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,19 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2017_sharedmemory = void 0;
const base_config_1 = require("./base-config");
const es2015_symbol_1 = require("./es2015.symbol");
const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown");
exports.es2017_sharedmemory = {
libs: [es2015_symbol_1.es2015_symbol, es2015_symbol_wellknown_1.es2015_symbol_wellknown],
variables: [
['SharedArrayBuffer', base_config_1.TYPE_VALUE],
['SharedArrayBufferConstructor', base_config_1.TYPE],
['ArrayBufferTypes', base_config_1.TYPE],
['Atomics', base_config_1.TYPE_VALUE],
],
};
@@ -0,0 +1,153 @@
/**
* @fileoverview Rule to flag use of an empty block statement
* @author Nicholas C. Zakas
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
hasSuggestions: true,
type: "suggestion",
defaultOptions: [
{
allowEmptyCatch: false,
},
],
docs: {
description: "Disallow empty block statements",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-empty",
},
schema: [
{
type: "object",
properties: {
allowEmptyCatch: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
unexpected: "Empty {{type}} statement.",
suggestComment: "Add comment inside empty {{type}} statement.",
},
},
create(context) {
const [{ allowEmptyCatch }] = context.options;
const sourceCode = context.sourceCode;
return {
BlockStatement(node) {
// if the body is not empty, we can just return immediately
if (node.body.length !== 0) {
return;
}
// a function is generally allowed to be empty
if (astUtils.isFunction(node.parent)) {
return;
}
if (allowEmptyCatch && node.parent.type === "CatchClause") {
return;
}
// any other block is only allowed to be empty, if it contains a comment
if (sourceCode.getCommentsInside(node).length > 0) {
return;
}
context.report({
node,
messageId: "unexpected",
data: { type: "block" },
suggest: [
{
messageId: "suggestComment",
data: { type: "block" },
fix(fixer) {
const range = [
node.range[0] + 1,
node.range[1] - 1,
];
return fixer.replaceTextRange(
range,
" /* empty */ ",
);
},
},
],
});
},
SwitchStatement(node) {
if (
typeof node.cases === "undefined" ||
node.cases.length === 0
) {
const openingBrace = sourceCode.getTokenAfter(
node.discriminant,
astUtils.isOpeningBraceToken,
);
const closingBrace = sourceCode.getLastToken(node);
if (
sourceCode.commentsExistBetween(
openingBrace,
closingBrace,
)
) {
return;
}
context.report({
node,
loc: {
start: openingBrace.loc.start,
end: closingBrace.loc.end,
},
messageId: "unexpected",
data: { type: "switch" },
suggest: [
{
messageId: "suggestComment",
data: { type: "switch" },
fix(fixer) {
const range = [
openingBrace.range[1],
closingBrace.range[0],
];
return fixer.replaceTextRange(
range,
" /* empty */ ",
);
},
},
],
});
}
},
};
},
};
@@ -0,0 +1,9 @@
import { M as ModuleMockerInterceptor, a as ModuleMockerCompilerHints, b as ModuleMocker } from './mocker.d-QEntlm6J.js';
import '@vitest/spy';
import './types.d-BjI5eAwu.js';
import './index.d-B41z0AuW.js';
declare function registerModuleMocker(interceptor: (accessor: string) => ModuleMockerInterceptor): ModuleMockerCompilerHints;
declare function registerNativeFactoryResolver(mocker: ModuleMocker): void;
export { registerModuleMocker, registerNativeFactoryResolver };
@@ -0,0 +1,19 @@
# @babel/core
> Babel compiler core.
See our website [@babel/core](https://babeljs.io/docs/babel-core) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen) associated with this package.
## Install
Using npm:
```sh
npm install --save-dev @babel/core
```
or using yarn:
```sh
yarn add @babel/core --dev
```
@@ -0,0 +1 @@
{"version":3,"file":"house-plus.js","sources":["../../../src/icons/house-plus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name HousePlus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTMuMjIgMi40MTZhMiAyIDAgMCAwLTIuNTExLjA1N2wtNyA1Ljk5OUEyIDIgMCAwIDAgMyAxMHY5YTIgMiAwIDAgMCAyIDJoMTRhMiAyIDAgMCAwIDItMnYtNy4zNTQiIC8+CiAgPHBhdGggZD0iTTE1IDIxdi04YTEgMSAwIDAgMC0xLTFoLTRhMSAxIDAgMCAwLTEgMXY4IiAvPgogIDxwYXRoIGQ9Ik0xNSA2aDYiIC8+CiAgPHBhdGggZD0iTTE4IDN2NiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/house-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 HousePlus = createLucideIcon('HousePlus', [\n [\n 'path',\n {\n d: 'M13.22 2.416a2 2 0 0 0-2.511.057l-7 5.999A2 2 0 0 0 3 10v9a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7.354',\n key: '5phn05',\n },\n ],\n ['path', { d: 'M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8', key: '5wwlr5' }],\n ['path', { d: 'M15 6h6', key: '1jlkvy' }],\n ['path', { d: 'M18 3v6', key: 'x1uolp' }],\n]);\n\nexport default HousePlus;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,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,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,CAA8C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC3E,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;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"square-arrow-up-left.js","sources":["../../../src/icons/square-arrow-up-left.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareArrowUpLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik04IDE2VjhoOCIgLz4KICA8cGF0aCBkPSJNMTYgMTYgOCA4IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/square-arrow-up-left\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 SquareArrowUpLeft = createLucideIcon('SquareArrowUpLeft', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M8 16V8h8', key: '19xb1h' }],\n ['path', { d: 'M16 16 8 8', key: '1qdy8n' }],\n]);\n\nexport default SquareArrowUpLeft;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoB,iBAAiB,mBAAqB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,21 @@
const ScrollOffset = {
Enter: [
[0, 1],
[1, 1],
],
Exit: [
[0, 0],
[1, 0],
],
Any: [
[1, 0],
[0, 1],
],
All: [
[0, 0],
[1, 1],
],
};
export { ScrollOffset };
//# sourceMappingURL=presets.mjs.map
@@ -0,0 +1,10 @@
import { ZodSchema } from "zod/v3";
import { Options, Targets } from "./Options.js";
import { JsonSchema7Type } from "./parseTypes.js";
declare const zodToJsonSchema: <Target extends Targets = "jsonSchema7">(schema: ZodSchema<any>, options?: string | Partial<Options<Target>> | undefined) => (Target extends "jsonSchema7" ? JsonSchema7Type : object) & {
$schema?: string | undefined;
definitions?: {
[key: string]: Target extends "jsonSchema7" ? JsonSchema7Type : Target extends "jsonSchema2019-09" ? JsonSchema7Type : object;
} | undefined;
};
export { zodToJsonSchema };
@@ -0,0 +1,125 @@
/**
* gridstack-item.component.ts 12.6.0
* Copyright (c) 2022-2024 Alain Dumesny - see GridStack root license
*/
import { Component, ElementRef, Input, ViewChild, ViewContainerRef, OnDestroy, ComponentRef } from '@angular/core';
import { GridItemHTMLElement, GridStackNode } from 'gridstack';
import { BaseWidget } from './base-widget';
/**
* Extended HTMLElement interface for grid items.
* Stores a back-reference to the Angular component for integration.
*/
export interface GridItemCompHTMLElement extends GridItemHTMLElement {
/** Back-reference to the Angular GridStackItem component */
_gridItemComp?: GridstackItemComponent;
}
/**
* Angular component wrapper for individual GridStack items.
*
* This component represents a single grid item and handles:
* - Dynamic content creation and management
* - Integration with parent GridStack component
* - Component lifecycle and cleanup
* - Widget options and configuration
*
* Use in combination with GridstackComponent for the parent grid.
*
* @example
* ```html
* <gridstack>
* <gridstack-item [options]="{x: 0, y: 0, w: 2, h: 1}">
* <my-widget-component></my-widget-component>
* </gridstack-item>
* </gridstack>
* ```
*/
@Component({
selector: 'gridstack-item',
template: `
<div class="grid-stack-item-content">
<!-- where dynamic items go based on component selector (recommended way), or sub-grids, etc...) -->
<ng-template #container></ng-template>
<!-- any static (defined in DOM - not recommended) content goes here -->
<ng-content></ng-content>
<!-- fallback HTML content from GridStackWidget.content if used instead (not recommended) -->
{{options.content}}
</div>`,
styles: [`
:host { display: block; }
`],
standalone: true,
// changeDetection: ChangeDetectionStrategy.OnPush, // IFF you want to optimize and control when ChangeDetection needs to happen...
})
export class GridstackItemComponent implements OnDestroy {
/**
* Container for dynamic component creation within this grid item.
* Used to append child components programmatically.
*/
@ViewChild('container', { read: ViewContainerRef, static: true}) public container?: ViewContainerRef;
/**
* Component reference for dynamic component removal.
* Used internally when this component is created dynamically.
*/
public ref: ComponentRef<GridstackItemComponent> | undefined;
/**
* Reference to child widget component for serialization.
* Used to save/restore additional data along with grid position.
*/
public childWidget: BaseWidget | undefined;
/**
* Grid item configuration options.
* Defines position, size, and behavior of this grid item.
*
* @example
* ```typescript
* itemOptions: GridStackNode = {
* x: 0, y: 0, w: 2, h: 1,
* noResize: true,
* content: 'Item content'
* };
* ```
*/
@Input() public set options(val: GridStackNode) {
const grid = this.el.gridstackNode?.grid;
if (grid) {
// already built, do an update...
grid.update(this.el, val);
} else {
// store our custom element in options so we can update it and not re-create a generic div!
this._options = {...val, el: this.el};
}
}
/** return the latest grid options (from GS once built, otherwise initial values) */
public get options(): GridStackNode {
return this.el.gridstackNode || this._options || {el: this.el};
}
protected _options?: GridStackNode;
/** return the native element that contains grid specific fields as well */
public get el(): GridItemCompHTMLElement { return this.elementRef.nativeElement; }
/** clears the initial options now that we've built */
public clearOptions() {
delete this._options;
}
constructor(protected readonly elementRef: ElementRef<GridItemCompHTMLElement>) {
this.el._gridItemComp = this;
}
public ngOnDestroy(): void {
this.clearOptions();
delete this.childWidget
delete this.el._gridItemComp;
delete this.container;
delete this.ref;
}
}
@@ -0,0 +1 @@
{"version":3,"file":"key.js","sources":["../../../src/icons/key.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Key\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTUuNSA3LjUgMi4zIDIuM2ExIDEgMCAwIDAgMS40IDBsMi4xLTIuMWExIDEgMCAwIDAgMC0xLjRMMTkgNCIgLz4KICA8cGF0aCBkPSJtMjEgMi05LjYgOS42IiAvPgogIDxjaXJjbGUgY3g9IjcuNSIgY3k9IjE1LjUiIHI9IjUuNSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/key\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 Key = createLucideIcon('Key', [\n ['path', { d: 'm15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4', key: 'g0fldk' }],\n ['path', { d: 'm21 2-9.6 9.6', key: '1j0ho8' }],\n ['circle', { cx: '7.5', cy: '15.5', r: '5.5', key: 'yqb3hr' }],\n]);\n\nexport default Key;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,iBAAiB,KAAO,CAAA,CAAA,CAAA;AAAA,CAAA,CAClC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC/F,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,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,CAAI,CAAA,CAAA,CAAA,MAAA,CAAQ,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AAC/D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,24 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ClipboardPen = createLucideIcon("ClipboardPen", [
["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", key: "1oijnt" }],
["path", { d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-5.5", key: "cereej" }],
["path", { d: "M4 13.5V6a2 2 0 0 1 2-2h2", key: "5ua5vh" }],
[
"path",
{
d: "M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",
key: "1y4qbx"
}
]
]);
export { ClipboardPen as default };
//# sourceMappingURL=clipboard-pen.js.map
@@ -0,0 +1,165 @@
/**
* @fileoverview Rule to flag use of duplicate keys in an object.
* @author Ian Christian Myers
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const GET_KIND = /^(?:init|get)$/u;
const SET_KIND = /^(?:init|set)$/u;
/**
* The class which stores properties' information of an object.
*/
class ObjectInfo {
/**
* @param {ObjectInfo|null} upper The information of the outer object.
* @param {ASTNode} node The ObjectExpression node of this information.
*/
constructor(upper, node) {
this.upper = upper;
this.node = node;
this.properties = new Map();
}
/**
* Gets the information of the given Property node.
* @param {ASTNode} node The Property node to get.
* @returns {{get: boolean, set: boolean}} The information of the property.
*/
getPropertyInfo(node) {
const name = astUtils.getStaticPropertyName(node);
if (!this.properties.has(name)) {
this.properties.set(name, { get: false, set: false });
}
return this.properties.get(name);
}
/**
* Checks whether the given property has been defined already or not.
* @param {ASTNode} node The Property node to check.
* @returns {boolean} `true` if the property has been defined.
*/
isPropertyDefined(node) {
const entry = this.getPropertyInfo(node);
return (
(GET_KIND.test(node.kind) && entry.get) ||
(SET_KIND.test(node.kind) && entry.set)
);
}
/**
* Defines the given property.
* @param {ASTNode} node The Property node to define.
* @returns {void}
*/
defineProperty(node) {
const entry = this.getPropertyInfo(node);
if (GET_KIND.test(node.kind)) {
entry.get = true;
}
if (SET_KIND.test(node.kind)) {
entry.set = true;
}
}
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
docs: {
description: "Disallow duplicate keys in object literals",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-dupe-keys",
},
schema: [],
messages: {
unexpected: "Duplicate key '{{name}}'.",
},
},
create(context) {
let info = null;
return {
ObjectExpression(node) {
info = new ObjectInfo(info, node);
},
"ObjectExpression:exit"() {
info = info.upper;
},
Property(node) {
const name = astUtils.getStaticPropertyName(node);
// Skip destructuring.
if (node.parent.type !== "ObjectExpression") {
return;
}
// Skip if the name is not static.
if (name === null) {
return;
}
/*
* Skip if the property node is a proto setter.
* Proto setter is a special syntax that sets
* object's prototype instead of creating a property.
* It can be in one of the following forms:
*
* __proto__: <expression>
* '__proto__': <expression>
* "__proto__": <expression>
*
* Duplicate proto setters produce parsing errors,
* so we can just skip them to not interfere with
* regular properties named "__proto__".
*/
if (
name === "__proto__" &&
node.kind === "init" &&
!node.computed &&
!node.shorthand &&
!node.method
) {
return;
}
// Reports if the name is defined already.
if (info.isPropertyDefined(node)) {
context.report({
node: info.node,
loc: node.key.loc,
messageId: "unexpected",
data: { name },
});
}
// Update info.
info.defineProperty(node);
},
};
},
};
@@ -0,0 +1,280 @@
import type * as checks from "./checks.cjs";
import type { $ZodConfig } from "./core.cjs";
import type * as errors from "./errors.cjs";
import type * as schemas from "./schemas.cjs";
export type JSONType = string | number | boolean | null | JSONType[] | {
[key: string]: JSONType;
};
export type JWTAlgorithm = "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "EdDSA" | (string & {});
export type HashAlgorithm = "md5" | "sha1" | "sha256" | "sha384" | "sha512";
export type HashEncoding = "hex" | "base64" | "base64url";
export type HashFormat = `${HashAlgorithm}_${HashEncoding}`;
export type IPVersion = "v4" | "v6";
export type MimeTypes = "application/json" | "application/xml" | "application/x-www-form-urlencoded" | "application/javascript" | "application/pdf" | "application/zip" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/octet-stream" | "application/graphql" | "text/html" | "text/plain" | "text/css" | "text/javascript" | "text/csv" | "image/png" | "image/jpeg" | "image/gif" | "image/svg+xml" | "image/webp" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "video/mp4" | "video/webm" | "video/ogg" | "font/woff" | "font/woff2" | "font/ttf" | "font/otf" | "multipart/form-data" | (string & {});
export type ParsedTypes = "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "file" | "date" | "array" | "map" | "set" | "nan" | "null" | "promise";
export type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
export type AssertNotEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? false : true;
export type AssertExtends<T, U> = T extends U ? T : never;
type ToZodMismatch<T, S extends schemas.$ZodType> = {
"types do not match": {
expected: T;
received: S["_zod"]["output"];
};
};
type ToZodKeyMismatch<Expected, Received> = schemas.$ZodType & {
"types do not match": {
expected: Expected;
received: Received;
};
};
declare const toZodDummy: unique symbol;
type ToZodNormalize<T> = [T] extends [(...args: any[]) => any] ? T : [T] extends [object] ? {
[K in keyof T]: ToZodNormalize<T[K]>;
} : T | typeof toZodDummy;
type ToZodEqual<Output, T> = AssertEqual<Output, T> extends true ? true : IsAny<Output> extends true ? false : IsAny<T> extends true ? false : AssertEqual<ToZodNormalize<Output>, ToZodNormalize<T>>;
type ToZodShape<Shape, T> = {
[K in keyof Shape]: Shape[K] extends schemas.$ZodType ? K extends keyof T ? ToZodEqual<Shape[K]["_zod"]["output"], T[K]> extends true ? Shape[K] : ToZodKeyMismatch<T[K], Shape[K]["_zod"]["output"]> : ToZodKeyMismatch<never, Shape[K]["_zod"]["output"]> : Shape[K];
} & {
[K in Exclude<keyof T, keyof Shape>]: ToZodKeyMismatch<T[K], never>;
};
type ToZodExpand<X> = {
[K in keyof X]: X[K];
} & {};
type ToZodTarget<S extends schemas.$ZodType, T> = S extends schemas.$ZodObject<infer Shape, infer Config> ? T extends object ? AssertEqual<ToZodExpand<ToZodShape<Shape, T>>, ToZodExpand<Shape>> extends true ? S & ToZodMismatch<T, S> : schemas.$ZodObject<ToZodExpand<ToZodShape<Shape, T>>, Config> : S & ToZodMismatch<T, S> : S & ToZodMismatch<T, S>;
export type IsAny<T> = 0 extends 1 & T ? true : false;
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
export type MakePartial<T, K extends keyof T> = Omit<T, K> & InexactPartial<Pick<T, K>>;
export type MakeRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
export type NoUndefined<T> = T extends undefined ? never : T;
export type Whatever = {} | undefined | null;
export type Widen<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends bigint ? bigint : T;
export type LoosePartial<T extends object> = InexactPartial<T> & {
[k: string]: unknown;
};
export type Mask<Keys extends PropertyKey> = {
[K in Keys]?: true;
};
export type Writeable<T> = {
-readonly [P in keyof T]: T[P];
} & {};
export type InexactPartial<T> = {
[P in keyof T]?: T[P] | undefined;
};
export type EmptyObject = Record<string, never>;
export type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
readonly [Symbol.toStringTag]: string;
} | Date | Error | Generator | Promise<unknown> | RegExp;
export type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
export type SomeObject = Record<PropertyKey, any>;
export type Identity<T> = T;
export type Flatten<T> = Identity<{
[k in keyof T]: T[k];
}>;
export type Mapped<T> = {
[k in keyof T]: T[k];
};
export type Prettify<T> = {
[K in keyof T]: T[K];
} & {};
export type NoNeverKeys<T> = {
[k in keyof T]: [T[k]] extends [never] ? never : k;
}[keyof T];
export type NoNever<T> = Identity<{
[k in NoNeverKeys<T>]: k extends keyof T ? T[k] : never;
}>;
export type Extend<A extends SomeObject, B extends SomeObject> = Flatten<keyof A & keyof B extends never ? A & B : {
[K in keyof A as K extends keyof B ? never : K]: A[K];
} & {
[K in keyof B]: B[K];
}>;
export type TupleItems = ReadonlyArray<schemas.SomeType>;
export type AnyFunc = (...args: any[]) => any;
export type IsProp<T, K extends keyof T> = T[K] extends AnyFunc ? never : K;
export type MaybeAsync<T> = T | Promise<T>;
export type KeyOf<T> = keyof OmitIndexSignature<T>;
export type OmitIndexSignature<T> = {
[K in keyof T as string extends K ? never : K extends string ? K : never]: T[K];
};
export type ExtractIndexSignature<T> = {
[K in keyof T as string extends K ? K : K extends string ? never : K]: T[K];
};
export type Keys<T extends object> = keyof OmitIndexSignature<T>;
export type SchemaClass<T extends schemas.SomeType> = {
new (def: T["_zod"]["def"]): T;
};
export type EnumValue = string | number;
export type EnumLike = Readonly<Record<string, EnumValue>>;
export type ToEnum<T extends EnumValue> = Flatten<{
[k in T]: k;
}>;
export type KeysEnum<T extends object> = ToEnum<Exclude<keyof T, symbol>>;
export type KeysArray<T extends object> = Flatten<(keyof T & string)[]>;
export type Literal = string | number | bigint | boolean | null | undefined;
export type LiteralArray = Array<Literal>;
export type Primitive = string | number | symbol | bigint | boolean | null | undefined;
export type PrimitiveArray = Array<Primitive>;
export type HasSize = {
size: number;
};
export type HasLength = {
length: number;
};
export type Numeric = number | bigint | Date;
export type SafeParseResult<T> = SafeParseSuccess<T> | SafeParseError<T>;
export type SafeParseSuccess<T> = {
success: true;
data: T;
error?: never;
};
export type SafeParseError<T> = {
success: false;
data?: never;
error: errors.$ZodError<T>;
};
export type PropValues = Record<string, Set<Primitive>>;
export type PrimitiveSet = Set<Primitive>;
export declare function assertEqual<A, B>(val: AssertEqual<A, B>): AssertEqual<A, B>;
export declare function assertNotEqual<A, B>(val: AssertNotEqual<A, B>): AssertNotEqual<A, B>;
export declare function toZod<T>(): <S extends schemas.$ZodType>(schema: ToZodEqual<S["_zod"]["output"], T> extends true ? S : ToZodTarget<S, T>) => S;
export declare function assertIs<T>(_arg: T): void;
export declare function assertNever(_x: never): never;
export declare function assert<T>(_: any): asserts _ is T;
export declare function getEnumValues(entries: EnumLike): EnumValue[];
export declare function joinValues<T extends Primitive[]>(array: T, separator?: string): string;
export declare function jsonStringifyReplacer(_: string, value: any): any;
export declare function cached<T>(getter: () => T): {
value: T;
};
export declare function nullish(input: any): boolean;
export declare function cleanRegex(source: string): string;
export declare function floatSafeRemainder(val: number, step: number): number;
export declare function defineLazy<T, K extends keyof T>(object: T, key: K, getter: () => T[K]): void;
export declare function objectClone(obj: object): any;
export declare function assignProp<T extends object, K extends PropertyKey>(target: T, prop: K, value: K extends keyof T ? T[K] : any): void;
/** A def's `shape` accessor, carrying whichever object it currently answers from. */
export interface ShapeGetter {
(): Record<PropertyKey, any>;
raw: Record<PropertyKey, any>;
}
/**
* Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it.
*
* Its keys and descriptors read without invoking anything, which is what lets a discriminated union check its discriminator, and the cycle walk read a shape, without resolving a getter that references the schema being constructed. A def that answers `shape` from an accessor of its own has none.
*/
export declare function rawShape(def: any): Record<PropertyKey, any> | undefined;
export declare function mergeDefs(...defs: Record<string, any>[]): any;
export declare function cloneDef(schema: schemas.$ZodType): any;
export declare function getElementAtPath(obj: any, path: (string | number)[] | null | undefined): any;
export declare function promiseAllObject<T extends object>(promisesObj: T): Promise<{
[k in keyof T]: Awaited<T[k]>;
}>;
export declare function randomString(length?: number): string;
export declare function esc(str: string): string;
export declare function slugify(input: string): string;
export declare const captureStackTrace: (targetObject: object, constructorOpt?: Function) => void;
export declare function isObject(data: any): data is Record<PropertyKey, unknown>;
export declare const allowsEval: {
value: boolean;
};
export declare function isPlainObject(o: any): o is Record<PropertyKey, unknown>;
export declare function shallowClone(o: any): any;
export declare function numKeys(data: any): number;
export declare const getParsedType: (data: any) => ParsedTypes;
export declare const propertyKeyTypes: Set<string>;
export declare const primitiveTypes: Set<string>;
export declare function escapeRegex(str: string): string;
export declare function clone<T extends schemas.$ZodType>(inst: T, def?: T["_zod"]["def"], params?: {
parent: boolean;
}): T;
export type EmptyToNever<T> = keyof T extends never ? never : T;
export type Normalize<T> = T extends undefined ? never : T extends Record<any, any> ? Flatten<{
[k in keyof Omit<T, "error" | "message">]: T[k];
} & ("error" extends keyof T ? {
error?: Exclude<T["error"], string>;
} : unknown)> : never;
export declare function normalizeParams<T>(_params: T): Normalize<T>;
export declare function createTransparentProxy<T extends object>(getter: () => T): T;
export declare function stringifyPrimitive(value: any): string;
export declare function optionalKeys(shape: schemas.$ZodShape): string[];
export type CleanKey<T extends PropertyKey> = T extends `?${infer K}` ? K : T extends `${infer K}?` ? K : T;
export type ToCleanMap<T extends schemas.$ZodLooseShape> = {
[k in keyof T]: k extends `?${infer K}` ? K : k extends `${infer K}?` ? K : k;
};
export type FromCleanMap<T extends schemas.$ZodLooseShape> = {
[k in keyof T as k extends `?${infer K}` ? K : k extends `${infer K}?` ? K : k]: k;
};
export declare const NUMBER_FORMAT_RANGES: Record<checks.$ZodNumberFormats, [number, number]>;
export declare const BIGINT_FORMAT_RANGES: Record<checks.$ZodBigIntFormats, [bigint, bigint]>;
export declare function pick(schema: schemas.$ZodObject, mask: Record<string, unknown>): any;
export declare function omit(schema: schemas.$ZodObject, mask: object): any;
export declare function extend(schema: schemas.$ZodObject, shape: schemas.$ZodShape): any;
export declare function safeExtend(schema: schemas.$ZodObject, shape: schemas.$ZodShape): any;
export declare function merge(a: schemas.$ZodObject, b: schemas.$ZodObject): any;
export declare function partial(Class: SchemaClass<schemas.$ZodOptional> | null, schema: schemas.$ZodObject, mask: object | undefined, name?: string): any;
export declare function required(Class: SchemaClass<schemas.$ZodNonOptional>, schema: schemas.$ZodObject, mask: object | undefined): any;
export type Constructor<T, Def extends any[] = any[]> = new (...args: Def) => T;
export declare function aborted(x: schemas.ParsePayload, startIndex?: number): boolean;
export declare function explicitlyAborted(x: schemas.ParsePayload, startIndex?: number): boolean;
export declare function prefixIssues(path: PropertyKey, issues: errors.$ZodRawIssue[]): errors.$ZodRawIssue[];
export declare function unwrapMessage(message: string | {
message: string;
} | undefined | null): string | undefined;
/** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
export declare function sizeCaps(defChecks: checks.$ZodCheck<never>[] | undefined): [number, checks.$ZodCheck<never>][];
export declare function attachSchema(issues: errors.$ZodRawIssue[], start: number, inst: schemas.$ZodType): void;
export declare function finalizeIssue(iss: errors.$ZodRawIssue, ctx: schemas.ParseContextInternal | undefined, config: $ZodConfig): errors.$ZodIssue;
export declare function getSizableOrigin(input: any): "set" | "map" | "file" | "unknown";
export declare function codePointLength(str: string): number;
export declare function getLengthableOrigin(input: any): "array" | "string" | "unknown";
export declare function parsedType(data: unknown): errors.$ZodInvalidTypeExpected;
export declare function issue(_iss: string, input: any, inst: any): errors.$ZodRawIssue;
export declare function issue(_iss: errors.$ZodRawIssue): errors.$ZodRawIssue;
export declare function cleanEnum(obj: Record<string, EnumValue>): EnumValue[];
export declare function base64ToUint8Array(base64: string): InstanceType<typeof Uint8Array>;
export declare function uint8ArrayToBase64(bytes: Uint8Array): string;
export declare function base64urlToUint8Array(base64url: string): InstanceType<typeof Uint8Array>;
export declare function uint8ArrayToBase64url(bytes: Uint8Array): string;
export declare function hexToUint8Array(hex: string): InstanceType<typeof Uint8Array>;
export declare function uint8ArrayToHex(bytes: Uint8Array): string;
export declare abstract class Class {
constructor(..._args: any[]);
}
/**
* Installs a trait's members on its prototype. Each value builds that member for the instance on first read; the built value shadows the accessor as an own property, so a detached `const { parse } = schema` keeps working.
*
* Call this from a `proto` initializer, which runs once per prototype — never per instance.
*/
export declare function members(proto: object, table: object): void;
/** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */
export declare function own<T>(inst: object, key: PropertyKey, value: T, enumerable?: boolean): T;
/** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */
export declare function hide<T>(inst: object, key: PropertyKey, value: T): T;
/** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
export declare function derived<T>(computes: {
[K in keyof T]?: (inst: T) => T[K];
}, table: ProtoOf<T>): ProtoOf<T>;
/** A trait's prototype members: a partial view of its own interface, with `this` typed as the instance. */
export type ProtoOf<T> = {
[K in keyof T]?: (T[K] extends (...args: infer A) => infer R ? (...args: A) => R : T[K]) | undefined;
} & ThisType<T>;
/**
* Installs a lazily-derived internal on the `_zod` prototype of `inst`'s
* constructor, computed from the internals object itself and cached there on
* first read. One accessor per constructor rather than one per instance.
*/
export declare function defineLazyInternal<T extends {
_zod: any;
}>(inst: T, key: string, compute: (zod: T["_zod"]) => unknown): void;
/**
* Installs `key` on `inst`'s prototype, computed by `make` on first read and cached there as an own
* data property. One accessor per constructor rather than one per instance, because an own accessor
* puts every instance after the first into v8 dictionary mode. The key doubles as the sentinel.
*/
export declare function installLazyProp(inst: object, key: string, make: (self: any) => unknown, enumerable: boolean): void;
/** Marks the thunk `_catch` synthesises for a constant catch value. `Function.length` cannot tell that thunk from a user callback — rest and defaulted parameters both report arity 0 — and a user callback reads `ctx.error`, whose issues only finalize correctly against the caller's per-parse error map. Provenance can say what arity cannot. A plain string key rather than `Symbol.for`, whose call at module scope no bundler can prove pure — the same shape that anchored `urlCanParse` into every build. */
export declare const CONSTANT_CATCH = "~constantCatch";
/** Wraps a constant catch value in a thunk tagged with {@link CONSTANT_CATCH}. */
export declare function constantCatch<T>(value: T): () => T;
export {};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_RE","2":"_x"},C:{"1":"_4L","2":"_iO"},D:{"1":"_yH","2":"_rG","194":"6B","257":"7B"},E:{"1":"_YE","2":"_qB","513":"_7Q"},F:{"1":"_1L","2":"_9G","194":"_QF"},G:{"1":"_AB","2":"_XB"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_U","2":"J"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:6,C:"Brotli Accept-Encoding/Content-Encoding",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/create.ts"],"names":[],"mappings":";;;;;;AAAA,qDAAkE;AAElE,0DAA4B;AAC5B,uCAAgC;AAChC,uDAA+C;AAO/C,uCAA0C;AAE1C,MAAM,cAAc,GAAG,CAAC,GAAuB,EAAE,KAAe,EAAE,EAAE;IAClE,MAAM,CAAC,GAAG,IAAI,kBAAQ,CAAC,GAAG,CAAC,CAAA;IAC3B,MAAM,MAAM,GAAG,IAAI,6BAAe,CAAC,GAAG,CAAC,IAAI,EAAE;QAC3C,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,KAAK;KACxB,CAAC,CAAA;IACF,CAAC,CAAC,IAAI,CAAC,MAAsC,CAAC,CAAA;IAC9C,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;AACxB,CAAC,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,GAAmB,EAAE,KAAe,EAAE,EAAE;IAC1D,MAAM,CAAC,GAAG,IAAI,cAAI,CAAC,GAAG,CAAC,CAAA;IACvB,MAAM,MAAM,GAAG,IAAI,yBAAW,CAAC,GAAG,CAAC,IAAI,EAAE;QACvC,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,KAAK;KACxB,CAAC,CAAA;IACF,CAAC,CAAC,IAAI,CAAC,MAAsC,CAAC,CAAA;IAE9C,MAAM,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC7C,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;QACvB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;QACvB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IACpB,CAAC,CAAC,CAAA;IAEF,aAAa,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;IAExD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,CAAW,EAAE,KAAe,EAAE,EAAE;IACpD,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YAC3B,IAAA,cAAI,EAAC;gBACH,IAAI,EAAE,mBAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACxC,IAAI,EAAE,IAAI;gBACV,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;aACnC,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACb,CAAC;IACH,CAAC,CAAC,CAAA;IACF,CAAC,CAAC,GAAG,EAAE,CAAA;AACT,CAAC,CAAA;AAED,MAAM,aAAa,GAAG,KAAK,EAAE,CAAO,EAAE,KAAe,EAAiB,EAAE;IACtE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YAC3B,MAAM,IAAA,cAAI,EAAC;gBACT,IAAI,EAAE,mBAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAChD,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,KAAK,CAAC,EAAE;oBACnB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;gBACd,CAAC;aACF,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACb,CAAC;IACH,CAAC;IACD,CAAC,CAAC,GAAG,EAAE,CAAA;AACT,CAAC,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,GAAmB,EAAE,KAAe,EAAE,EAAE;IAC1D,MAAM,CAAC,GAAG,IAAI,kBAAQ,CAAC,GAAG,CAAC,CAAA;IAC3B,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;IACtB,OAAO,CAAC,CAAA;AACV,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,GAAe,EAAE,KAAe,EAAE,EAAE;IACvD,MAAM,CAAC,GAAG,IAAI,cAAI,CAAC,GAAG,CAAC,CAAA;IACvB,aAAa,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;IACxD,OAAO,CAAC,CAAA;AACV,CAAC,CAAA;AAEY,QAAA,MAAM,GAAG,IAAA,6BAAW,EAC/B,cAAc,EACd,UAAU,EACV,UAAU,EACV,WAAW,EACX,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;IACd,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC,CAAA;IAC7D,CAAC;AACH,CAAC,CACF,CAAA","sourcesContent":["import { WriteStream, WriteStreamSync } from '@isaacs/fs-minipass'\nimport type { Minipass } from 'minipass'\nimport path from 'node:path'\nimport { list } from './list.js'\nimport { makeCommand } from './make-command.js'\nimport type {\n TarOptions,\n TarOptionsFile,\n TarOptionsSync,\n TarOptionsSyncFile,\n} from './options.js'\nimport { Pack, PackSync } from './pack.js'\n\nconst createFileSync = (opt: TarOptionsSyncFile, files: string[]) => {\n const p = new PackSync(opt)\n const stream = new WriteStreamSync(opt.file, {\n mode: opt.mode || 0o666,\n })\n p.pipe(stream as unknown as Minipass.Writable)\n addFilesSync(p, files)\n}\n\nconst createFile = (opt: TarOptionsFile, files: string[]) => {\n const p = new Pack(opt)\n const stream = new WriteStream(opt.file, {\n mode: opt.mode || 0o666,\n })\n p.pipe(stream as unknown as Minipass.Writable)\n\n const promise = new Promise<void>((res, rej) => {\n stream.on('error', rej)\n stream.on('close', res)\n p.on('error', rej)\n })\n\n addFilesAsync(p, files).catch(er => p.emit('error', er))\n\n return promise\n}\n\nconst addFilesSync = (p: PackSync, files: string[]) => {\n files.forEach(file => {\n if (file.charAt(0) === '@') {\n list({\n file: path.resolve(p.cwd, file.slice(1)),\n sync: true,\n noResume: true,\n onReadEntry: entry => p.add(entry),\n })\n } else {\n p.add(file)\n }\n })\n p.end()\n}\n\nconst addFilesAsync = async (p: Pack, files: string[]): Promise<void> => {\n for (const file of files) {\n if (file.charAt(0) === '@') {\n await list({\n file: path.resolve(String(p.cwd), file.slice(1)),\n noResume: true,\n onReadEntry: entry => {\n p.add(entry)\n },\n })\n } else {\n p.add(file)\n }\n }\n p.end()\n}\n\nconst createSync = (opt: TarOptionsSync, files: string[]) => {\n const p = new PackSync(opt)\n addFilesSync(p, files)\n return p\n}\n\nconst createAsync = (opt: TarOptions, files: string[]) => {\n const p = new Pack(opt)\n addFilesAsync(p, files).catch(er => p.emit('eLine truncated
@@ -0,0 +1,44 @@
#include "./win_utils.hh"
std::wstring utf8ToUtf16(std::string input) {
unsigned int len = MultiByteToWideChar(CP_UTF8, 0, input.c_str(), -1, NULL, 0);
WCHAR *output = new WCHAR[len];
MultiByteToWideChar(CP_UTF8, 0, input.c_str(), -1, output, len);
std::wstring res(output);
delete[] output;
return res;
}
std::string utf16ToUtf8(const WCHAR *input, DWORD length) {
unsigned int len = WideCharToMultiByte(CP_UTF8, 0, input, length, NULL, 0, NULL, NULL);
char *output = new char[len + 1];
WideCharToMultiByte(CP_UTF8, 0, input, length, output, len, NULL, NULL);
output[len] = '\0';
std::string res(output);
delete[] output;
return res;
}
std::string normalizePath(std::string path) {
// Prevent truncation to MAX_PATH characters by adding the \\?\ prefix
std::wstring p = utf8ToUtf16("\\\\?\\" + path);
// Get the required length for the output
DWORD len = GetLongPathNameW(p.data(), NULL, 0);
if (!len) {
return path;
}
// Allocate output array and get long path
WCHAR *output = new WCHAR[len];
len = GetLongPathNameW(p.data(), output, len);
if (!len) {
delete[] output;
return path;
}
// Convert back to utf8
std::string res = utf16ToUtf8(output + 4, len - 4);
delete[] output;
return res;
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"2":"_I","132":"_K"},C:{"2":"_LP","132":"_PI"},D:{"2":"_dL","132":"_1K _sL"},E:{"2":"_u","132":"_dB"},F:{"2":"_T","132":"_a"},G:{"2":"_EB","132":"_9B"},H:{"2":"1D"},I:{"2":"_W","132":"_X"},J:{"2":"_B"},K:{"2":"_D","132":"H"},L:{"132":"I"},M:{"132":"YC"},N:{"132":"_A"},O:{"132":"bC"},P:{"2":"_rC","132":"_hB"},Q:{"132":"JE"},R:{"132":"KE"},S:{"132":"_C"}},B:2,C:"Media Fragments",D:true};
@@ -0,0 +1,63 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Awaitable = void 0;
exports.needsToBeAwaited = needsToBeAwaited;
const type_utils_1 = require("@typescript-eslint/type-utils");
const tsutils = __importStar(require("ts-api-utils"));
const getConstraintInfo_1 = require("./getConstraintInfo");
var Awaitable;
(function (Awaitable) {
Awaitable[Awaitable["Always"] = 0] = "Always";
Awaitable[Awaitable["Never"] = 1] = "Never";
Awaitable[Awaitable["May"] = 2] = "May";
})(Awaitable || (exports.Awaitable = Awaitable = {}));
function needsToBeAwaited(checker, node, type) {
const { constraintType, isTypeParameter } = (0, getConstraintInfo_1.getConstraintInfo)(checker, type);
// unconstrained generic types should be treated as unknown
if (isTypeParameter && constraintType == null) {
return Awaitable.May;
}
// `any` and `unknown` types may need to be awaited
if ((0, type_utils_1.isTypeAnyType)(constraintType) || (0, type_utils_1.isTypeUnknownType)(constraintType)) {
return Awaitable.May;
}
// 'thenable' values should always be be awaited
if (tsutils.isThenableType(checker, node, constraintType)) {
return Awaitable.Always;
}
// anything else should not be awaited
return Awaitable.Never;
}
@@ -0,0 +1,74 @@
import { i as jsonSchemaValidator, n as JsonSchemaValidator, t as JsonSchemaType } from "./types-DUs7mGBv.mjs";
//#region ../core-internal/src/validators/cfWorkerProvider.d.ts
/**
* JSON Schema draft version supported by `@cfworker/json-schema`.
*/
type CfWorkerSchemaDraft = '4' | '7' | '2019-09' | '2020-12';
/**
* `@cfworker/json-schema`-backed JSON Schema validator. See
* `@modelcontextprotocol/{client,server}/validators/cf-worker` for the customisation entry point.
*
* Default dispatches on the schema's declared dialect: no `$schema` or 2020-12 → `'2020-12'`
* (SEP-1613); 2019-09 → `'2019-09'`; draft-07 or draft-06 → `'7'`. Schemas declaring any other `$schema` are rejected
* with a plain `Error`. Passing an explicit `draft` to the constructor
* overrides this — that draft is used for every schema regardless of `$schema`.
*
* Known draft-07 engine gap: `@cfworker/json-schema` does not treat draft-07 `dependencies` as
* a name→subschema map during `$ref` collection, so a dependency entry whose KEY collides with
* a JSON Schema keyword (`type`, `default`, `format`, `required`, `pattern`, …) and whose
* subschema contains a `$ref` throws `Unresolved $ref` at validation time when the dependency
* triggers — data-dependently, not at compile. The Node (classic Ajv) engine handles the same
* schema correctly. Callers that hit this receive the SDK's typed validation error (the throw
* is captured by the validation paths), and the deviation is pinned by a recorded-contract test.
*
* @example Use with default configuration (2020-12, shortcircuit on)
* ```ts source="./cfWorkerProvider.examples.ts#CfWorkerJsonSchemaValidator_default"
* const validator = new CfWorkerJsonSchemaValidator();
* ```
*
* @example Use with custom configuration
* ```ts source="./cfWorkerProvider.examples.ts#CfWorkerJsonSchemaValidator_customConfig"
* const validator = new CfWorkerJsonSchemaValidator({
* draft: '2020-12',
* shortcircuit: false // Report all errors
* });
* ```
*/
declare class CfWorkerJsonSchemaValidator implements jsonSchemaValidator {
private readonly shortcircuit;
/** Caller-supplied draft; when set, the `$schema` check is skipped (caller owns dialect). */
private readonly draft?;
/**
* Create a validator
*
* @param options - Configuration options
* @param options.shortcircuit - If `true`, stop validation after first error (default: `true`)
* @param options.draft - JSON Schema draft version to force for every schema. When set, the
* `$schema` dispatch is skipped. When omitted, the provider dispatches on each schema's
* declared `$schema` (2020-12, 2019-09, draft-07, draft-06; absent means 2020-12) and rejects others.
*/
constructor(options?: {
shortcircuit?: boolean;
draft?: CfWorkerSchemaDraft;
});
/**
* Pick the engine draft for a schema's declared dialect (a caller-forced `{draft}` bypasses
* this — do not second-guess by `$schema`). No `$schema` or 2020-12 → `'2020-12'`; 2019-09 →
* `'2019-09'`; draft-07 or draft-06 → `'7'`; anything else → `Error`.
*/
private _draftFor;
/**
* Create a validator for the given JSON Schema
*
* Unlike AJV, this validator is not cached internally
*
* @param schema - Standard JSON Schema object
* @returns A validator function that validates input data
*/
getValidator<T>(schema: JsonSchemaType): JsonSchemaValidator<T>;
}
//#endregion
export { CfWorkerSchemaDraft as n, CfWorkerJsonSchemaValidator as t };
//# sourceMappingURL=cfWorkerProvider-C03CSigr.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"clipboard-type.js","sources":["../../../src/icons/clipboard-type.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ClipboardType\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI0IiB4PSI4IiB5PSIyIiByeD0iMSIgcnk9IjEiIC8+CiAgPHBhdGggZD0iTTE2IDRoMmEyIDIgMCAwIDEgMiAydjE0YTIgMiAwIDAgMS0yIDJINmEyIDIgMCAwIDEtMi0yVjZhMiAyIDAgMCAxIDItMmgyIiAvPgogIDxwYXRoIGQ9Ik05IDEydi0xaDZ2MSIgLz4KICA8cGF0aCBkPSJNMTEgMTdoMiIgLz4KICA8cGF0aCBkPSJNMTIgMTF2NiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/clipboard-type\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 ClipboardType = createLucideIcon('ClipboardType', [\n ['rect', { width: '8', height: '4', x: '8', y: '2', rx: '1', ry: '1', key: 'tgr4d6' }],\n [\n 'path',\n {\n d: 'M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2',\n key: '116196',\n },\n ],\n ['path', { d: 'M9 12v-1h6v1', key: 'iehl6m' }],\n ['path', { d: 'M11 17h2', key: '12w5me' }],\n ['path', { d: 'M12 11v6', key: '1bwqyc' }],\n]);\n\nexport default ClipboardType;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,KAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAA,CAAA,CAAA,CAAK,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,CACrF,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;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,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,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,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,12 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}
{{# def.numberKeyword }}
{{ var $op = $keyword == 'maxProperties' ? '>' : '<'; }}
if ({{# def.$dataNotType:'number' }} Object.keys({{=$data}}).length {{=$op}} {{=$schemaValue}}) {
{{ var $errorKeyword = $keyword; }}
{{# def.error:'_limitProperties' }}
} {{? $breakOnError }} else { {{?}}
@@ -0,0 +1,16 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2018_regexp = void 0;
const base_config_1 = require("./base-config");
exports.es2018_regexp = {
libs: [],
variables: [
['RegExpMatchArray', base_config_1.TYPE],
['RegExpExecArray', base_config_1.TYPE],
['RegExp', base_config_1.TYPE],
],
};
@@ -0,0 +1,64 @@
{
"name": "@radix-ui/react-use-controllable-state",
"version": "1.2.2",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"dependencies": {
"@radix-ui/react-use-effect-event": "0.0.2",
"@radix-ui/react-use-layout-effect": "1.1.1"
},
"devDependencies": {
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"eslint": "^9.18.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"typescript": "^5.7.3",
"@repo/builder": "0.0.0",
"@repo/eslint-config": "0.0.0",
"@repo/typescript-config": "0.0.0"
},
"peerDependencies": {
"@types/react": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"scripts": {
"lint": "eslint --max-warnings 0 src",
"clean": "rm -rf dist",
"typecheck": "tsc --noEmit",
"build": "radix-build"
},
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
}
@@ -0,0 +1,985 @@
import v8 from "node:v8";
import vm from "node:vm";
import { expect, test } from "vitest";
import * as z from "zod/v4";
test("parses a self-referential object and preserves identity", () => {
const Node: any = z.object({
id: z.number(),
get self() {
return Node;
},
});
const input: any = { id: 1 };
input.self = input;
const result = Node.parse(input);
expect(result.id).toBe(1);
expect(result.self).toBe(result);
expect(result).not.toBe(input);
});
test("validates a node against every schema that reaches it", () => {
const A: any = z.object({
x: z.string(),
get b() {
return B;
},
});
const B: any = z.object({
y: z.number(),
get a() {
return A;
},
});
const input: any = { x: "s", y: 1 };
input.b = input;
input.a = input;
const result = A.parse(input);
expect(Object.keys(result).sort()).toEqual(["b", "x"]);
expect(Object.keys(result.b).sort()).toEqual(["a", "y"]);
expect(result.b.y).toBe(1);
expect(result.b.a).toBe(result);
const bad: any = { x: "s", y: "not a number" };
bad.b = bad;
bad.a = bad;
expect(A.safeParse(bad).success).toBe(false);
});
test("breaks cycles through every container", () => {
const cases: [string, () => { schema: any; input: any }][] = [
[
"array",
() => {
const S: any = z.object({
id: z.number(),
get kids() {
return z.array(S);
},
});
const a: any = { id: 1, kids: [] };
a.kids.push(a);
return { schema: S, input: a };
},
],
[
"record",
() => {
const S: any = z.object({
id: z.number(),
get kids() {
return z.record(z.string(), S);
},
});
const a: any = { id: 1, kids: {} };
a.kids.self = a;
return { schema: S, input: a };
},
],
[
"tuple",
() => {
const S: any = z.object({
id: z.number(),
get pair() {
return z.tuple([z.number(), S]);
},
});
const a: any = { id: 1 };
a.pair = [1, a];
return { schema: S, input: a };
},
],
[
"set",
() => {
const S: any = z.object({
id: z.number(),
get peers() {
return z.set(S);
},
});
const a: any = { id: 1, peers: new Set() };
a.peers.add(a);
return { schema: S, input: a };
},
],
[
"map",
() => {
const S: any = z.object({
id: z.number(),
get links() {
return z.map(z.string(), S);
},
});
const a: any = { id: 1, links: new Map() };
a.links.set("s", a);
return { schema: S, input: a };
},
],
[
"union",
() => {
const S: any = z.object({
id: z.number(),
get self() {
return z.union([z.string(), S]);
},
});
const a: any = { id: 1 };
a.self = a;
return { schema: S, input: a };
},
],
[
"discriminated union",
() => {
const S: any = z.discriminatedUnion("kind", [
z.object({ kind: z.literal("leaf"), v: z.number() }),
z.object({
kind: z.literal("branch"),
get next() {
return S;
},
}),
]);
const a: any = { kind: "branch" };
a.next = a;
return { schema: S, input: a };
},
],
[
"lazy",
() => {
const S: any = z.object({ id: z.number(), self: z.lazy(() => S) });
const a: any = { id: 1 };
a.self = a;
return { schema: S, input: a };
},
],
[
"mutual recursion five hops apart",
() => {
const A: any = z.object({
get b() {
return B;
},
});
const B: any = z.object({
get c() {
return C;
},
});
const C: any = z.object({
get d() {
return D;
},
});
const D: any = z.object({
get e() {
return E;
},
});
const E: any = z.object({
get a() {
return A;
},
});
const a: any = {};
a.b = { c: { d: { e: { a } } } };
return { schema: A, input: a };
},
],
];
for (const [name, build] of cases) {
for (const jitless of [false, true]) {
const { schema, input } = build();
expect(() => schema.parse(input, { jitless }), `${name} (jitless: ${jitless})`).not.toThrow();
}
}
});
test("checks run once per node and never against a half-built object", () => {
const seen: number[] = [];
const Node: any = z
.object({
id: z.number(),
get self() {
return Node;
},
})
.refine((value: any) => {
seen.push(Object.keys(value).length);
return true;
});
const input: any = { id: 1 };
input.self = input;
Node.parse(input);
expect(seen).toEqual([2]);
});
test("reports a failing check inside a cycle", () => {
const Node: any = z
.object({
id: z.number(),
get self() {
return Node;
},
})
.refine((value: any) => value.id > 100, "too small");
const input: any = { id: 1 };
input.self = input;
expect(Node.safeParse(input).success).toBe(false);
});
test("reports an invalid value inside a cycle once, at its own path", () => {
const Node: any = z.object({
id: z.number(),
get self() {
return Node;
},
});
const input: any = { id: "nope" };
input.self = input;
const result = Node.safeParse(input);
expect(result.success).toBe(false);
expect(result.error!.issues).toHaveLength(1);
expect(result.error!.issues[0].path).toEqual(["id"]);
});
test("rejects a cycle that closes through a transform", () => {
const Inner: any = z.object({
name: z.string(),
get self() {
return Wrapped;
},
});
const Wrapped: any = Inner.transform((value: any) => ({ wrapped: value }));
const input: any = { name: "x" };
input.self = input;
expect(() => Wrapped.parse(input)).toThrow(/reference cycle/);
});
test("leaves a transform that is not on the cycle alone", () => {
const Node: any = z.object({
n: z.number().transform((value: number) => value * 2),
get self() {
return Node;
},
});
const input: any = { n: 21 };
input.self = input;
const result = Node.parse(input);
expect(result.n).toBe(42);
expect(result.self).toBe(result);
});
test("encodes through a cycle", () => {
const Stringified = z.codec(z.string(), z.number(), {
decode: (value) => Number(value),
encode: (value) => String(value),
});
const Node: any = z.object({
n: Stringified,
get self() {
return Node;
},
});
const input: any = { n: 5 };
input.self = input;
const result: any = z.encode(Node, input);
expect(result.n).toBe("5");
expect(result.self).toBe(result);
});
test("keeps separate parses independent", () => {
const Node: any = z.object({
id: z.number(),
get self() {
return Node;
},
});
const input: any = { id: 1 };
input.self = input;
const first = Node.parse(input);
const second = Node.parse(input);
expect(first).not.toBe(second);
expect(first.self).toBe(first);
expect(second.self).toBe(second);
const bad: any = { id: "x" };
bad.self = bad;
expect(Node.safeParse(bad).success).toBe(false);
expect(Node.safeParse(input).success).toBe(true);
});
test("parses a cycle asynchronously", async () => {
const Node: any = z.object({
id: z.number().refine(async (value: number) => value > 0),
get self() {
return Node;
},
});
const input: any = { id: 1 };
input.self = input;
const result = await Node.parseAsync(input);
expect(result.self).toBe(result);
const bad: any = { id: -1 };
bad.self = bad;
expect((await Node.safeParseAsync(bad)).success).toBe(false);
});
test("a non-recursive schema still copies a shared reference twice", () => {
const Leaf = z.object({ v: z.number() });
const Pair = z.object({ a: Leaf, b: Leaf });
const shared = { v: 1 };
const result = Pair.parse({ a: shared, b: shared });
expect(result.a).not.toBe(result.b);
expect(result.a.v).toBe(1);
expect(result.b.v).toBe(1);
});
test("a recursive schema shares one output node per input node", () => {
const Node: any = z.object({
v: z.number(),
get kids() {
return z.array(Node);
},
});
const shared: any = { v: 1, kids: [] };
const result = Node.parse({ v: 0, kids: [shared, shared] });
expect(result.kids[0]).toBe(result.kids[1]);
});
test("sync and async agree on a shared reference", async () => {
const build = (asyncCheck: boolean) => {
const Node: any = z.object({
v: asyncCheck ? z.number().refine(async (n: number) => n >= 0) : z.number(),
get kids() {
return z.array(Node);
},
});
return Node;
};
const shared: any = { v: 1, kids: [] };
const input = { v: 0, kids: [shared, shared] };
const syncResult = build(false).parse(input);
const asyncResult = await build(true).parseAsync(input);
expect(syncResult.kids[0]).toBe(syncResult.kids[1]);
expect(asyncResult.kids[0]).toBe(asyncResult.kids[1]);
});
test("a cycle through .readonly() keeps the node intact", () => {
const Node: any = z.object({
id: z.number(),
get self() {
return Node.readonly();
},
});
const input: any = { id: 1 };
input.self = input;
// Freezing a node that is still being built would make its remaining keys fail to assign, silently, because generated code is not strict mode.
const result = Node.parse(input);
expect(Object.keys(result).sort()).toEqual(["id", "self"]);
expect(result.self).toBe(result);
});
test("a cycle through z.intersection validates but does not mirror the graph", () => {
const Node: any = z.object({
id: z.number(),
get self() {
return z.intersection(Node, z.object({ id: z.number() }));
},
});
const input: any = { id: 7 };
input.self = input;
// The merged value is built after both sides are parsed, so it cannot be the object a back-edge already resolved to. Values are right, the graph is not.
const result = Node.parse(input);
expect(result.id).toBe(7);
expect(result.self.id).toBe(7);
expect(result.self).not.toBe(result);
expect(result.self.self).toBeUndefined();
const bad: any = { id: "nope" };
bad.self = bad;
expect(Node.safeParse(bad).success).toBe(false);
});
test("keeps two cycles and a shared node distinct in one input", () => {
const Node: any = z.object({
id: z.number(),
get kids() {
return z.array(Node);
},
});
const shared: any = { id: 9, kids: [] };
const root: any = { id: 0, kids: [shared, shared] };
root.kids.push(root);
const result = Node.parse(root);
expect(result.kids[0]).toBe(result.kids[1]);
expect(result.kids[2]).toBe(result);
});
test("closes a cycle through a Map key and a Set member", () => {
const Keyed: any = z.object({
id: z.number(),
get keyed() {
return z.map(Keyed, z.string());
},
});
const k: any = { id: 1, keyed: new Map() };
k.keyed.set(k, "v");
const keyedOut = Keyed.parse(k);
expect([...keyedOut.keyed.keys()][0]).toBe(keyedOut);
const Peered: any = z.object({
id: z.number(),
get peers() {
return z.set(Peered);
},
});
const p: any = { id: 1, peers: new Set() };
p.peers.add(p);
const peeredOut = Peered.parse(p);
expect([...peeredOut.peers][0]).toBe(peeredOut);
});
test("does not mutate the input, and tolerates a frozen one", () => {
const Node: any = z.object({
id: z.number(),
get self() {
return Node;
},
});
const input: any = { id: 1 };
input.self = input;
Object.freeze(input);
const result = Node.parse(input);
expect(result).not.toBe(input);
expect(result.self).toBe(result);
expect(Reflect.ownKeys(input)).toEqual(["id", "self"]);
});
test("keys identity on the schema, not just the input", () => {
const Node: any = z.object({
id: z.number(),
get self() {
return Node.optional();
},
});
const Partial: any = Node.partial();
const input: any = { id: 1 };
input.self = input;
// `Partial` and `Node` are different schemas, so the root and the node its cycle points back to are different output objects. Same rule that lets one input node be validated against two schemas in mutual recursion.
const result = Partial.parse(input);
expect(result.self).not.toBe(result);
expect(result.self.self).toBe(result.self);
expect(result.id).toBe(1);
expect(result.self.id).toBe(1);
});
test("keeps concurrent async parses of one schema independent", async () => {
const Node: any = z.object({
id: z.number().refine(async (n: number) => {
await new Promise((r) => setTimeout(r, 5 + (n % 3)));
return true;
}),
get self() {
return Node;
},
});
const make = (id: number) => {
const o: any = { id };
o.self = o;
return o;
};
const [a, b, c] = await Promise.all([Node.parseAsync(make(1)), Node.parseAsync(make(2)), Node.parseAsync(make(3))]);
expect([a.id, b.id, c.id]).toEqual([1, 2, 3]);
expect(a.self).toBe(a);
expect(b.self).toBe(b);
expect(c.self).toBe(c);
});
test("runs checks once per reference, as it does without a cycle", () => {
let calls = 0;
const Node: any = z
.object({
id: z.number(),
get kids() {
return z.array(Node);
},
})
.refine(() => {
calls++;
return true;
});
const shared: any = { id: 1, kids: [] };
Node.parse({ id: 0, kids: [shared, shared] });
// Memoization skips the container's parse, not the checks layered on it.
expect(calls).toBe(3);
});
test("a schema wrapped at the root adds one node and no more", () => {
const Node: any = z.object({
id: z.number(),
get self() {
return Node.optional();
},
});
const input: any = { id: 1 };
input.self = input;
// The root is keyed on the wrapper, everything under it on `Node`, so the graph closes one level down rather than at the root. It does not compound: stacking wrappers still yields exactly two nodes.
const count = (root: any) => {
const seen: any[] = [];
let n = root;
while (n && !seen.includes(n)) {
seen.push(n);
n = n.self;
}
return seen.length;
};
expect(count(Node.parse(input))).toBe(1);
expect(count(Node.partial().parse(input))).toBe(2);
expect(count(Node.partial().partial().parse(input))).toBe(2);
expect(count(Node.extend({ extra: z.string().optional() }).parse(input))).toBe(2);
});
test("resolves a recursive reference once, however it is written", () => {
// This is what bounds the above: core caches a shape getter and a lazy getter, so a getter returning a fresh clone still yields a finite schema graph rather than a new schema per node.
let getterCalls = 0;
const ViaGetter: any = z.object({
id: z.number(),
get self() {
getterCalls++;
return ViaGetter.partial();
},
});
let lazyCalls = 0;
const ViaLazy: any = z.object({
id: z.number(),
self: z.lazy(() => {
lazyCalls++;
return ViaLazy.partial();
}),
});
const input: any = { id: 1 };
input.self = input;
expect(() => ViaGetter.parse(input)).not.toThrow();
expect(() => ViaLazy.parse(input)).not.toThrow();
expect(getterCalls).toBe(1);
expect(lazyCalls).toBe(1);
});
// The second visitor of a shared node must not prefix onto the first visitor's path.
test.each([false, true])("prefixes a shared node's issues once per reference (jitless: %s)", (jitless) => {
z.config({ jitless });
try {
const Node: any = z.object({
name: z.string(),
get left() {
return z.optional(Node);
},
get right() {
return z.optional(Node);
},
});
const shared: any = { name: 123 };
const result = Node.safeParse({ name: "root", left: shared, right: shared });
expect(result.success).toBe(false);
expect(result.error.issues.map((iss: any) => iss.path)).toEqual([
["left", "name"],
["right", "name"],
]);
} finally {
z.config({ jitless: false });
}
});
test("the default memoizer is installed before the first container reads it", () => {
// the delete manufactures the fresh-process state; a container with only getter keys then constructs no leaf before the config read
delete z.config().memoizer;
const Node: any = z.object({
get self() {
return Node;
},
});
const input: any = {};
input.self = input;
const out = Node.parse(input);
expect(out.self).toBe(out);
});
test("guards a transform built before any container", () => {
// the guard attaches at construction, so a transform predating the first container must still get the default
delete z.config().memoizer;
const wrap = z.transform((value: any) => ({ wrapped: value }));
const Inner: any = z.object({
name: z.string(),
get self() {
return Wrapped;
},
});
const Wrapped: any = z.pipe(Inner, wrap);
const input: any = { name: "x" };
input.self = input;
expect(() => Wrapped.parse(input)).toThrow(/reference cycle/);
});
test("detects a cycle reachable only through a merged catchall", () => {
const Cyclic: any = z.object({
id: z.string(),
get next() {
return z.optional(Root);
},
});
const Root: any = z.object({ tag: z.string() }).merge(z.object({}).catchall(Cyclic));
const input: any = { tag: "root" };
input.child = { id: "1", next: input };
const out: any = Root.parse(input);
expect(out.child.next).toBe(out);
});
// the per-type switch can only enumerate kinds Zod ships, so an unknown `def.type` falls back to scanning the def; without it a cycle through a third-party container overflows the stack
test("detects a cycle through a user-defined container type", () => {
const MyBox: any = z.core.$constructor("MyBox", (inst: any, def: any) => {
z.core.$ZodType.init(inst, def);
inst._zod.parse = (payload: any, ctx: any) => {
if (payload.value === null || typeof payload.value !== "object") return payload;
const inner = def.inner._zod.run({ value: payload.value.v, issues: [] }, ctx);
payload.value = { v: inner.value };
return payload;
};
});
const Node: any = z.object({
id: z.string(),
get boxed() {
return z.optional(new MyBox({ type: "mybox", inner: z.lazy(() => Node) }));
},
});
const input: any = { id: "1" };
input.boxed = { v: input };
const out: any = Node.parse(input);
expect(out.boxed.v).toBe(out);
});
// #6526: a factory returns fresh instances, so the identity walk never revisits a node; it descends until the stack overflows unless it stops at the deferred edge
test("parses a factory-built recursive schema", () => {
const Node = (): any =>
z.object({
id: z.number(),
get kids() {
return z.array(Node());
},
});
const S = z.object({ root: Node() });
const out = S.parse({ root: { id: 1, kids: [{ id: 2, kids: [] }] } });
expect(out.root.kids[0].id).toBe(2);
expect(S.safeParse({ root: { id: 1, kids: [{ id: "x", kids: [] }] } }).success).toBe(false);
});
test("parses a factory-built recursive discriminated union at the root and nested", () => {
const Geometry = (): any =>
z.discriminatedUnion("type", [
z.object({ type: z.literal("Point"), coordinates: z.array(z.number()) }),
z.looseObject({
type: z.literal("GeometryCollection"),
get geometries() {
return z.array(Geometry());
},
}),
]);
const collection = { type: "GeometryCollection", geometries: [{ type: "Point", coordinates: [1, 2] }] };
expect(Geometry().parse(collection).geometries[0].coordinates).toEqual([1, 2]);
expect(z.object({ g: Geometry() }).parse({ g: collection }).g.type).toBe("GeometryCollection");
});
test("the walk reports a cycle for a deferred edge instead of resolving it", () => {
const Node = (): any =>
z.object({
get self() {
return Node();
},
});
expect(z.core.isRecursiveSchema(Node())).toBe(true);
// conservative by design: a getter that closes no cycle is reported too, and pays only the memoizer it keeps
const Leaf = z.object({ id: z.string() });
const forward: any = z.object({
get leaf() {
return Leaf;
},
});
expect(z.core.isRecursiveSchema(forward)).toBe(true);
// a lazy is followed one hop, which is what lets z.compile see past it; past that hop it is deferred like any other edge
expect(z.core.isRecursiveSchema(z.lazy(() => Leaf) as any)).toBe(false);
expect(z.core.isRecursiveSchema(z.lazy(() => z.lazy(() => Leaf)) as any)).toBe(true);
});
// the builders answer `shape` from an accessor that resolves the source's getters, so the walk has to reach the source schema itself
test("parses a factory-built recursive schema through every object builder", () => {
const wraps: [string, (base: () => any) => any][] = [
["extend", (b) => b().extend({ x: z.string() })],
["safeExtend", (b) => b().safeExtend({ x: z.string() })],
["merge", (b) => z.object({ x: z.string() }).merge(b())],
["partial", (b) => b().partial()],
["required", (b) => b().required()],
["pick", (b) => b().pick({ self: true })],
["omit", (b) => b().omit({ y: true })],
["chained", (b) => b().extend({ x: z.string() }).partial()],
// rebuilds the def without touching the shape, so the clone carries the source's accessor rather than a shape of its own
["strict", (b) => b().extend({ x: z.string() }).strict()],
["catchall", (b) => b().extend({ x: z.string() }).catchall(z.unknown())],
["meta", (b) => b().extend({ x: z.string() }).meta({ id: "node" })],
];
for (const [name, wrap] of wraps) {
const Node = (): any =>
wrap(() =>
z.object({
y: z.string(),
get self() {
return z.optional(Node());
},
})
);
const S = z.object({ r: Node() });
for (const attempt of ["first", "second"]) {
expect(() => S.safeParse({ r: { y: "s", x: "s" } }), `${name} (${attempt} parse)`).not.toThrow();
}
}
});
test("an ordinary builder stays exact, so it still compiles", () => {
const plain = z.object({ a: z.string(), b: z.number() });
const derived: [string, any][] = [
["extend", plain.extend({ c: z.boolean() })],
["merge", plain.merge(z.object({ d: z.string() }))],
["partial", plain.partial()],
["required", plain.partial().required()],
["pick", plain.pick({ a: true })],
["omit", plain.omit({ a: true })],
["strict", plain.extend({ c: z.boolean() }).strict()],
["catchall", plain.extend({ c: z.boolean() }).catchall(z.unknown())],
["meta", plain.extend({ c: z.boolean() }).meta({ id: "plain" })],
];
for (const [name, schema] of derived) {
expect(z.core.isRecursiveSchema(schema), name).toBe(false);
expect(() => z.compile(schema, { strict: true }), name).not.toThrow();
}
});
// a derived shape mirrors its source's descriptors, so dropping or overwriting the key that carries the cycle leaves nothing deferred and the walk is exact before anything parses
test("a builder that drops the recursive key ends up exact", () => {
const Node: any = z.object({
id: z.number(),
get self() {
return z.optional(Node);
},
});
const derived: [string, any, any][] = [
["omit", Node.omit({ self: true }), { id: 1 }],
["pick", Node.pick({ id: true }), { id: 1 }],
["extend overwrites it", Node.extend({ self: z.string() }), { id: 1, self: "x" }],
];
for (const [name, schema, input] of derived) {
expect(z.core.isRecursiveSchema(schema), name).toBe(false);
expect(() => z.compile(schema, { strict: true }), name).not.toThrow();
expect(schema.parse(input), name).toEqual(input);
}
// the branch that stays is still found
const kept = Node.extend({ x: z.string() });
expect(z.core.isRecursiveSchema(kept)).toBe(true);
});
// resolving a lazy runs user code, which can re-enter the walk; a walk that kept its certainty outside its own frames would have the inner one clobber the outer
test("a nested walk can't corrupt the one that resolved into it", () => {
const Node: any = z.object({
id: z.number(),
self: z.lazy(() => {
z.compile(z.string(), { strict: true });
return z.optional(Node);
}),
});
const omitted = Node.omit({ self: true });
// exact before anything parses: the mirrored shape kept only `id`, so nothing here is deferred
expect(z.core.isRecursiveSchema(omitted)).toBe(false);
omitted.parse({ id: 1 });
expect(z.core.isRecursiveSchema(omitted)).toBe(false);
expect(() => z.compile(omitted, { strict: true })).not.toThrow();
const shared = { id: 1 };
const out: any = z.object({ a: omitted, b: omitted }).parse({ a: shared, b: shared });
expect(out.a).not.toBe(out.b);
expect(z.core.isRecursiveSchema(Node)).toBe(true);
});
test("detects a cycle that closes through a builder", () => {
const Node: any = z
.object({
id: z.number(),
get self() {
return z.optional(Node);
},
})
.extend({ x: z.string() });
const input: any = { id: 1, x: "s" };
input.self = input;
const out = Node.parse(input);
expect(out.self).toBe(out);
});
test("a deferred edge stops being assumed a cycle once the graph resolves", () => {
const Leaf = z.object({ n: z.number() });
const Forward: any = z.object({
get a() {
return Leaf;
},
});
expect(z.core.isRecursiveSchema(Forward)).toBe(true);
Forward.parse({ a: { n: 1 } });
// the parse resolved the getter, so the walk can follow it and drop the assumption
expect(z.core.isRecursiveSchema(Forward)).toBe(false);
// a factory hands back a fresh subtree every time, so no parse ever resolves it into a finite graph
const Node = (): any =>
z.object({
get kids() {
return z.array(Node());
},
});
const Generated = Node();
expect(z.core.isRecursiveSchema(Generated)).toBe(true);
Generated.parse({ kids: [] });
expect(z.core.isRecursiveSchema(Generated)).toBe(true);
// a lazy that closes a real cycle stays recursive however often it resolves
const Cyclic: any = z.object({ id: z.number(), self: z.lazy(() => z.optional(Cyclic)) });
Cyclic.parse({ id: 1 });
expect(z.core.isRecursiveSchema(Cyclic)).toBe(true);
});
// `z.object` resolves its shape by spread, so a non-enumerable key is no part of it
test("a non-enumerable key does not count for z.object", () => {
const object = (enumerable: boolean) => {
const shape: Record<string, any> = { id: z.number() };
const O: any = z.object(shape);
Object.defineProperty(shape, "next", { value: z.lazy(() => z.optional(O)), enumerable, configurable: true });
return O;
};
expect(z.core.isRecursiveSchema(object(true))).toBe(true);
// the spread drops it, so nothing can ever parse it
expect(z.core.isRecursiveSchema(object(false))).toBe(false);
});
test("the walk stays exact where nothing is deferred", () => {
let deep: any = z.string();
for (let i = 0; i < 300; i++) deep = z.object({ v: deep });
expect(z.core.isRecursiveSchema(deep)).toBe(false);
});
test("parses a factory-built recursive schema through z.lazy", () => {
const Node = (): any =>
z.object({
id: z.number(),
child: z.lazy(() => z.optional(Node())),
});
const out = z.object({ root: Node() }).parse({ root: { id: 1, child: { id: 2, child: undefined } } });
expect(out.root.child.id).toBe(2);
});
test("a finished parse pins nothing on the schema", async () => {
// es2020 is the target, and its lib predates WeakRef
type Weak<T extends object> = { deref(): T | undefined };
const { WeakRef: Weak } = globalThis as unknown as { WeakRef: new <T extends object>(target: T) => Weak<T> };
// vitest carries no --expose-gc, so reach the collector the way node's own tests do
v8.setFlagsFromString("--expose-gc");
const gc = vm.runInNewContext("gc") as () => void;
const Node: any = z.object({
id: z.number(),
get next() {
return z.optional(Node);
},
});
const ref = ((): Weak<object> => {
const input = { id: 1, next: { id: 2, next: undefined } };
Node.parse(input);
return new Weak(input);
})();
for (let attempt = 0; attempt < 10 && ref.deref(); attempt++) {
// the input stays on the stack until a macrotask boundary
await new Promise((resolve) => setTimeout(resolve, 0));
gc();
}
expect(ref.deref()).toBeUndefined();
});
@@ -0,0 +1,14 @@
"use client";
import { createContext } from 'react';
/**
* @public
*/
const MotionConfigContext = createContext({
transformPagePoint: (p) => p,
isStatic: false,
reducedMotion: "never",
});
export { MotionConfigContext };
//# sourceMappingURL=MotionConfigContext.mjs.map
@@ -0,0 +1,169 @@
/**
* negotiator
* Copyright(c) 2012 Isaac Z. Schlueter
* Copyright(c) 2014 Federico Romero
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict';
/**
* Module exports.
* @public
*/
module.exports = preferredCharsets;
module.exports.preferredCharsets = preferredCharsets;
/**
* Module variables.
* @private
*/
var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/;
/**
* Parse the Accept-Charset header.
* @private
*/
function parseAcceptCharset(accept) {
var accepts = accept.split(',');
for (var i = 0, j = 0; i < accepts.length; i++) {
var charset = parseCharset(accepts[i].trim(), i);
if (charset) {
accepts[j++] = charset;
}
}
// trim accepts
accepts.length = j;
return accepts;
}
/**
* Parse a charset from the Accept-Charset header.
* @private
*/
function parseCharset(str, i) {
var match = simpleCharsetRegExp.exec(str);
if (!match) return null;
var charset = match[1];
var q = 1;
if (match[2]) {
var params = match[2].split(';')
for (var j = 0; j < params.length; j++) {
var p = params[j].trim().split('=');
if (p[0] === 'q') {
q = parseFloat(p[1]);
break;
}
}
}
return {
charset: charset,
q: q,
i: i
};
}
/**
* Get the priority of a charset.
* @private
*/
function getCharsetPriority(charset, accepted, index) {
var priority = {o: -1, q: 0, s: 0};
for (var i = 0; i < accepted.length; i++) {
var spec = specify(charset, accepted[i], index);
if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
priority = spec;
}
}
return priority;
}
/**
* Get the specificity of the charset.
* @private
*/
function specify(charset, spec, index) {
var s = 0;
if(spec.charset.toLowerCase() === charset.toLowerCase()){
s |= 1;
} else if (spec.charset !== '*' ) {
return null
}
return {
i: index,
o: spec.i,
q: spec.q,
s: s
}
}
/**
* Get the preferred charsets from an Accept-Charset header.
* @public
*/
function preferredCharsets(accept, provided) {
// RFC 2616 sec 14.2: no header = *
var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');
if (!provided) {
// sorted list of all charsets
return accepts
.filter(isQuality)
.sort(compareSpecs)
.map(getFullCharset);
}
var priorities = provided.map(function getPriority(type, index) {
return getCharsetPriority(type, accepts, index);
});
// sorted list of accepted charsets
return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {
return provided[priorities.indexOf(priority)];
});
}
/**
* Compare two specs.
* @private
*/
function compareSpecs(a, b) {
return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;
}
/**
* Get full charset string.
* @private
*/
function getFullCharset(spec) {
return spec.charset;
}
/**
* Check if a spec has any quality.
* @private
*/
function isQuality(spec) {
return spec.q > 0;
}
@@ -0,0 +1 @@
{"version":3,"file":"heart.js","sources":["../../../src/icons/heart.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Heart\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTkgMTRjMS40OS0xLjQ2IDMtMy4yMSAzLTUuNUE1LjUgNS41IDAgMCAwIDE2LjUgM2MtMS43NiAwLTMgLjUtNC41IDItMS41LTEuNS0yLjc0LTItNC41LTJBNS41IDUuNSAwIDAgMCAyIDguNWMwIDIuMyAxLjUgNC4wNSAzIDUuNWw3IDdaIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/heart\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Heart = createLucideIcon('Heart', [\n [\n 'path',\n {\n d: 'M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z',\n key: 'c3ymky',\n },\n ],\n]);\n\nexport default Heart;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CACtC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;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,25 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
//#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
exports.getConnInfo = getConnInfo;
@@ -0,0 +1,3 @@
# `react-tabs`
View docs [here](https://radix-ui.com/primitives/docs/components/tabs).
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkMetadata = void 0;
const util_1 = require("../../compile/util");
const def = {
keyword: "metadata",
schemaType: "object",
code(cxt) {
checkMetadata(cxt);
const { gen, schema, it } = cxt;
if ((0, util_1.alwaysValidSchema)(it, schema))
return;
const valid = gen.name("valid");
cxt.subschema({ keyword: "metadata", jtdMetadata: true }, valid);
cxt.ok(valid);
},
};
function checkMetadata({ it, keyword }, metadata) {
if (it.jtdMetadata !== metadata) {
throw new Error(`JTD: "${keyword}" cannot be used in this schema location`);
}
}
exports.checkMetadata = checkMetadata;
exports.default = def;
//# sourceMappingURL=metadata.js.map
@@ -0,0 +1,13 @@
/* eslint-disable no-console */
'use strict'
let printed = {}
module.exports = function warnOnce(message) {
if (printed[message]) return
printed[message] = true
if (typeof console !== 'undefined' && console.warn) {
console.warn(message)
}
}
@@ -0,0 +1,137 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.traverseNode = traverseNode;
var _context = require("./context.js");
var _index = require("./path/index.js");
var _t = require("@babel/types");
var _context2 = require("./path/context.js");
const {
VISITOR_KEYS
} = _t;
function _visitPaths(ctx, paths) {
ctx.queue = paths;
ctx.priorityQueue = [];
const visited = new Set();
let stop = false;
let visitIndex = 0;
for (; visitIndex < paths.length;) {
const path = paths[visitIndex];
visitIndex++;
_context2.resync.call(path);
if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== ctx) {
_context2.pushContext.call(path, ctx);
}
if (path.key === null) continue;
const {
node
} = path;
if (visited.has(node)) continue;
if (node) visited.add(node);
if (_visit(ctx, path)) {
stop = true;
break;
}
if (ctx.priorityQueue.length) {
stop = _visitPaths(ctx, ctx.priorityQueue);
ctx.priorityQueue = [];
ctx.queue = paths;
if (stop) break;
}
}
for (let i = 0; i < visitIndex; i++) {
_context2.popContext.call(paths[i]);
}
ctx.queue = null;
return stop;
}
function _visit(ctx, path) {
var _opts$denylist;
const node = path.node;
if (!node) {
return false;
}
const opts = ctx.opts;
const denylist = (_opts$denylist = opts.denylist) != null ? _opts$denylist : opts.blacklist;
if (denylist != null && denylist.includes(node.type)) {
return false;
}
if (opts.shouldSkip != null && opts.shouldSkip(path)) {
return false;
}
if (path.shouldSkip) return path.shouldStop;
if (_context2._call.call(path, opts.enter)) return path.shouldStop;
if (path.node) {
var _opts$node$type;
if (_context2._call.call(path, (_opts$node$type = opts[node.type]) == null ? void 0 : _opts$node$type.enter)) return path.shouldStop;
}
path.shouldStop = _traverse(path.node, opts, path.scope, ctx.state, path, path.skipKeys);
if (path.node) {
if (_context2._call.call(path, opts.exit)) return true;
}
if (path.node) {
var _opts$node$type2;
_context2._call.call(path, (_opts$node$type2 = opts[node.type]) == null ? void 0 : _opts$node$type2.exit);
}
return path.shouldStop;
}
function _traverse(node, opts, scope, state, path, skipKeys, visitSelf) {
const keys = VISITOR_KEYS[node.type];
if (!(keys != null && keys.length)) return false;
const ctx = new _context.default(scope, opts, state, path);
if (visitSelf) {
if (skipKeys != null && skipKeys[path.parentKey]) return false;
return _visitPaths(ctx, [path]);
}
for (const key of keys) {
if (skipKeys != null && skipKeys[key]) continue;
const prop = node[key];
if (!prop) continue;
if (Array.isArray(prop)) {
if (!prop.length) continue;
const paths = [];
for (let i = 0; i < prop.length; i++) {
const childPath = _index.default.get({
parentPath: path,
parent: node,
container: prop,
key: i,
listKey: key
});
paths.push(childPath);
}
if (_visitPaths(ctx, paths)) return true;
} else {
if (_visitPaths(ctx, [_index.default.get({
parentPath: path,
parent: node,
container: node,
key,
listKey: null
})])) {
return true;
}
}
}
return false;
}
function traverseNode(node, opts, scope, state, path, skipKeys, visitSelf) {
const keys = VISITOR_KEYS[node.type];
if (!keys) return false;
const context = new _context.default(scope, opts, state, path);
if (visitSelf) {
if (skipKeys != null && skipKeys[path.parentKey]) return false;
return context.visitQueue([path]);
}
for (const key of keys) {
if (skipKeys != null && skipKeys[key]) continue;
if (context.visit(node, key)) {
return true;
}
}
return false;
}
//# sourceMappingURL=traverse-node.js.map
@@ -0,0 +1,210 @@
# type-check [![Build Status](https://travis-ci.org/gkz/type-check.png?branch=master)](https://travis-ci.org/gkz/type-check)
<a name="type-check" />
`type-check` is a library which allows you to check the types of JavaScript values at runtime with a Haskell like type syntax. It is great for checking external input, for testing, or even for adding a bit of safety to your internal code. It is a major component of [levn](https://github.com/gkz/levn). MIT license. Version 0.4.0. Check out the [demo](http://gkz.github.io/type-check/).
For updates on `type-check`, [follow me on twitter](https://twitter.com/gkzahariev).
npm install type-check
## Quick Examples
```js
// Basic types:
var typeCheck = require('type-check').typeCheck;
typeCheck('Number', 1); // true
typeCheck('Number', 'str'); // false
typeCheck('Error', new Error); // true
typeCheck('Undefined', undefined); // true
// Comment
typeCheck('count::Number', 1); // true
// One type OR another type:
typeCheck('Number | String', 2); // true
typeCheck('Number | String', 'str'); // true
// Wildcard, matches all types:
typeCheck('*', 2) // true
// Array, all elements of a single type:
typeCheck('[Number]', [1, 2, 3]); // true
typeCheck('[Number]', [1, 'str', 3]); // false
// Tuples, or fixed length arrays with elements of different types:
typeCheck('(String, Number)', ['str', 2]); // true
typeCheck('(String, Number)', ['str']); // false
typeCheck('(String, Number)', ['str', 2, 5]); // false
// Object properties:
typeCheck('{x: Number, y: Boolean}', {x: 2, y: false}); // true
typeCheck('{x: Number, y: Boolean}', {x: 2}); // false
typeCheck('{x: Number, y: Maybe Boolean}', {x: 2}); // true
typeCheck('{x: Number, y: Boolean}', {x: 2, y: false, z: 3}); // false
typeCheck('{x: Number, y: Boolean, ...}', {x: 2, y: false, z: 3}); // true
// A particular type AND object properties:
typeCheck('RegExp{source: String, ...}', /re/i); // true
typeCheck('RegExp{source: String, ...}', {source: 're'}); // false
// Custom types:
var opt = {customTypes:
{Even: { typeOf: 'Number', validate: function(x) { return x % 2 === 0; }}}};
typeCheck('Even', 2, opt); // true
// Nested:
var type = '{a: (String, [Number], {y: Array, ...}), b: Error{message: String, ...}}'
typeCheck(type, {a: ['hi', [1, 2, 3], {y: [1, 'ms']}], b: new Error('oh no')}); // true
```
Check out the [type syntax format](#syntax) and [guide](#guide).
## Usage
`require('type-check');` returns an object that exposes four properties. `VERSION` is the current version of the library as a string. `typeCheck`, `parseType`, and `parsedTypeCheck` are functions.
```js
// typeCheck(type, input, options);
typeCheck('Number', 2); // true
// parseType(type);
var parsedType = parseType('Number'); // object
// parsedTypeCheck(parsedType, input, options);
parsedTypeCheck(parsedType, 2); // true
```
### typeCheck(type, input, options)
`typeCheck` checks a JavaScript value `input` against `type` written in the [type format](#type-format) (and taking account the optional `options`) and returns whether the `input` matches the `type`.
##### arguments
* type - `String` - the type written in the [type format](#type-format) which to check against
* input - `*` - any JavaScript value, which is to be checked against the type
* options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types)
##### returns
`Boolean` - whether the input matches the type
##### example
```js
typeCheck('Number', 2); // true
```
### parseType(type)
`parseType` parses string `type` written in the [type format](#type-format) into an object representing the parsed type.
##### arguments
* type - `String` - the type written in the [type format](#type-format) which to parse
##### returns
`Object` - an object in the parsed type format representing the parsed type
##### example
```js
parseType('Number'); // [{type: 'Number'}]
```
### parsedTypeCheck(parsedType, input, options)
`parsedTypeCheck` checks a JavaScript value `input` against parsed `type` in the parsed type format (and taking account the optional `options`) and returns whether the `input` matches the `type`. Use this in conjunction with `parseType` if you are going to use a type more than once.
##### arguments
* type - `Object` - the type in the parsed type format which to check against
* input - `*` - any JavaScript value, which is to be checked against the type
* options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types)
##### returns
`Boolean` - whether the input matches the type
##### example
```js
parsedTypeCheck([{type: 'Number'}], 2); // true
var parsedType = parseType('String');
parsedTypeCheck(parsedType, 'str'); // true
```
<a name="type-format" />
## Type Format
### Syntax
White space is ignored. The root node is a __Types__.
* __Identifier__ = `[\$\w]+` - a group of any lower or upper case letters, numbers, underscores, or dollar signs - eg. `String`
* __Type__ = an `Identifier`, an `Identifier` followed by a `Structure`, just a `Structure`, or a wildcard `*` - eg. `String`, `Object{x: Number}`, `{x: Number}`, `Array{0: String, 1: Boolean, length: Number}`, `*`
* __Types__ = optionally a comment (an `Identifier` followed by a `::`), optionally the identifier `Maybe`, one or more `Type`, separated by `|` - eg. `Number`, `String | Date`, `Maybe Number`, `Maybe Boolean | String`
* __Structure__ = `Fields`, or a `Tuple`, or an `Array` - eg. `{x: Number}`, `(String, Number)`, `[Date]`
* __Fields__ = a `{`, followed one or more `Field` separated by a comma `,` (trailing comma `,` is permitted), optionally an `...` (always preceded by a comma `,`), followed by a `}` - eg. `{x: Number, y: String}`, `{k: Function, ...}`
* __Field__ = an `Identifier`, followed by a colon `:`, followed by `Types` - eg. `x: Date | String`, `y: Boolean`
* __Tuple__ = a `(`, followed by one or more `Types` separated by a comma `,` (trailing comma `,` is permitted), followed by a `)` - eg `(Date)`, `(Number, Date)`
* __Array__ = a `[` followed by exactly one `Types` followed by a `]` - eg. `[Boolean]`, `[Boolean | Null]`
### Guide
`type-check` uses `Object.toString` to find out the basic type of a value. Specifically,
```js
{}.toString.call(VALUE).slice(8, -1)
{}.toString.call(true).slice(8, -1) // 'Boolean'
```
A basic type, eg. `Number`, uses this check. This is much more versatile than using `typeof` - for example, with `document`, `typeof` produces `'object'` which isn't that useful, and our technique produces `'HTMLDocument'`.
You may check for multiple types by separating types with a `|`. The checker proceeds from left to right, and passes if the value is any of the types - eg. `String | Boolean` first checks if the value is a string, and then if it is a boolean. If it is none of those, then it returns false.
Adding a `Maybe` in front of a list of multiple types is the same as also checking for `Null` and `Undefined` - eg. `Maybe String` is equivalent to `Undefined | Null | String`.
You may add a comment to remind you of what the type is for by following an identifier with a `::` before a type (or multiple types). The comment is simply thrown out.
The wildcard `*` matches all types.
There are three types of structures for checking the contents of a value: 'fields', 'tuple', and 'array'.
If used by itself, a 'fields' structure will pass with any type of object as long as it is an instance of `Object` and the properties pass - this allows for duck typing - eg. `{x: Boolean}`.
To check if the properties pass, and the value is of a certain type, you can specify the type - eg. `Error{message: String}`.
If you want to make a field optional, you can simply use `Maybe` - eg. `{x: Boolean, y: Maybe String}` will still pass if `y` is undefined (or null).
If you don't care if the value has properties beyond what you have specified, you can use the 'etc' operator `...` - eg. `{x: Boolean, ...}` will match an object with an `x` property that is a boolean, and with zero or more other properties.
For an array, you must specify one or more types (separated by `|`) - it will pass for something of any length as long as each element passes the types provided - eg. `[Number]`, `[Number | String]`.
A tuple checks for a fixed number of elements, each of a potentially different type. Each element is separated by a comma - eg. `(String, Number)`.
An array and tuple structure check that the value is of type `Array` by default, but if another type is specified, they will check for that instead - eg. `Int32Array[Number]`. You can use the wildcard `*` to search for any type at all.
Check out the [type precedence](https://github.com/zaboco/type-precedence) library for type-check.
## Options
Options is an object. It is an optional parameter to the `typeCheck` and `parsedTypeCheck` functions. The only current option is `customTypes`.
<a name="custom-types" />
### Custom Types
__Example:__
```js
var options = {
customTypes: {
Even: {
typeOf: 'Number',
validate: function(x) {
return x % 2 === 0;
}
}
}
};
typeCheck('Even', 2, options); // true
typeCheck('Even', 3, options); // false
```
`customTypes` allows you to set up custom types for validation. The value of this is an object. The keys of the object are the types you will be matching. Each value of the object will be an object having a `typeOf` property - a string, and `validate` property - a function.
The `typeOf` property is the type the value should be (optional - if not set only `validate` will be used), and `validate` is a function which should return true if the value is of that type. `validate` receives one parameter, which is the value that we are checking.
## Technical About
`type-check` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It also uses the [prelude.ls](http://preludels.com/) library.
@@ -0,0 +1,280 @@
import { B as ResolveResult, C as BindingViteManifestPluginConfig, G as isolatedDeclaration, I as NapiResolveOptions, K as isolatedDeclarationSync, M as IsolatedDeclarationsResult, O as BindingViteTransformPluginConfig, V as ResolverFactory, _ as BindingTsconfigRawOptions, f as BindingRebuildStrategy, g as BindingTsconfigCompilerOptions, i as BindingClientHmrUpdate, j as IsolatedDeclarationsOptions, n as BindingBundleAnalyzerPluginConfig, q as moduleRunnerTransform, r as BindingBundleState } from "./shared/binding-D26QphWG.mjs";
import { Bt as OutputOptions, F as BuiltinPlugin, Q as defineParallelPlugin, Wt as StringOrRegExp, Yt as RolldownOutput, Zt as freeExternalMemory, l as InputOptions, lt as NormalizedOutputOptions } from "./shared/define-config-BhJ90aEv.mjs";
import { a as MinifyOptions$1, c as minifySync$1, d as parse$1, f as parseSync$1, i as transformSync$1, l as ParseResult$1, m as resolveTsconfig, n as TransformResult$1, o as MinifyResult$1, p as TsconfigCache$1, r as transform$1, s as minify$1, t as TransformOptions$1, u as ParserOptions$1 } from "./shared/transform-BPrUvqEZ.mjs";
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-BbWPse2X.mjs";
//#region src/api/dev/dev-options.d.ts
type DevOnHmrUpdates = (result: Error | {
updates: BindingClientHmrUpdate[];
changedFiles: string[];
}) => void | Promise<void>;
type DevOnOutput = (result: Error | RolldownOutput) => void | Promise<void>;
type DevOnAdditionalAssets = (output: RolldownOutput) => void | Promise<void>;
interface DevWatchOptions {
/**
* If `true`, files are not written to disk.
* @default false
*/
skipWrite?: boolean;
/**
* If `true`, use polling instead of native file system events for watching.
* @default false
*/
usePolling?: boolean;
/**
* Poll interval in milliseconds (only used when usePolling is true).
* @default 100
*/
pollInterval?: number;
/**
* If `true`, use debounced watcher. If `false`, use non-debounced watcher for immediate responses.
* @default true
*/
useDebounce?: boolean;
/**
* Debounce duration in milliseconds (only used when useDebounce is true).
* @default 10
*/
debounceDuration?: number;
/**
* Whether to compare file contents for poll-based watchers (only used when usePolling is true).
* When enabled, poll watchers will check file contents to determine if they actually changed.
* @default false
*/
compareContentsForPolling?: boolean;
/**
* Tick rate in milliseconds for debounced watchers (only used when useDebounce is true).
* Controls how frequently the debouncer checks for events to process.
* When not specified, the debouncer will auto-select an appropriate tick rate (1/4 of the debounce duration).
* @default undefined (auto-select)
*/
debounceTickRate?: number;
/**
* Filter to limit which discovered files are registered with the file watcher.
*
* Strings are treated as glob patterns.
*
* @default []
*/
include?: StringOrRegExp | StringOrRegExp[];
/**
* Filter to prevent discovered files from being registered with the file watcher.
*
* Strings are treated as glob patterns.
*
* @default []
*/
exclude?: StringOrRegExp | StringOrRegExp[];
}
interface DevOptions {
onHmrUpdates?: DevOnHmrUpdates;
onOutput?: DevOnOutput;
/**
* Called with assets emitted while generating an HMR patch or compiling a
* lazy entry (e.g. an image newly imported by the changed/lazy module).
*
* These never go through {@link onOutput}, so a consumer that serves built
* files (e.g. Vite's bundled dev server) must register this to receive them
* and write them to its in-memory file store before the client requests them.
*/
onAdditionalAssets?: DevOnAdditionalAssets;
/**
* Strategy for triggering rebuilds after HMR updates.
* - `'always'`: Always trigger a rebuild after HMR updates
* - `'auto'`: Trigger rebuild only if HMR updates contain full reload updates
* - `'never'`: Never trigger rebuild after HMR updates (default)
* @default 'auto'
*/
rebuildStrategy?: "always" | "auto" | "never";
watch?: DevWatchOptions;
}
//#endregion
//#region src/api/dev/dev-engine.d.ts
declare class DevEngine {
#private;
static create(inputOptions: InputOptions, outputOptions?: OutputOptions, devOptions?: DevOptions): Promise<DevEngine>;
private constructor();
run(): Promise<void>;
ensureCurrentBuildFinish(): Promise<void>;
getBundleState(): Promise<BindingBundleState>;
ensureLatestBuildOutput(): Promise<void>;
triggerFullBuild(): void;
invalidate(file: string, firstInvalidatedBy?: string): Promise<BindingClientHmrUpdate[]>;
registerModules(clientId: string, modules: string[]): Promise<void>;
removeClient(clientId: string): Promise<void>;
close(): Promise<void>;
/**
* Compile a lazy entry module and return HMR-style patch code.
*
* This is called when a dynamically imported module is first requested at runtime.
* The module was previously stubbed with a proxy, and now we need to compile the
* actual module and its dependencies.
*
* @param moduleId - The absolute file path of the module to compile
* @param clientId - The client ID requesting this compilation
* @returns The compiled JavaScript code as a string (HMR patch format)
*/
compileEntry(moduleId: string, clientId: string): Promise<string>;
}
//#endregion
//#region src/api/dev/index.d.ts
declare const dev: typeof DevEngine.create;
//#endregion
//#region src/api/experimental.d.ts
/**
* This is an experimental API. Its behavior may change in the future.
*
* - Calling this API will only execute the `scan/build` stage of rolldown.
* - `scan` will clean up all resources automatically, but if you want to ensure timely cleanup, you need to wait for the returned promise to resolve.
*
* @example To ensure cleanup of resources, use the returned promise to wait for the scan to complete.
* ```ts
* import { scan } from 'rolldown/api/experimental';
*
* const cleanupPromise = await scan(...);
* await cleanupPromise;
* // Now all resources have been cleaned up.
* ```
*/
declare const scan: (rawInputOptions: InputOptions, rawOutputOptions?: {}) => Promise<Promise<void>>;
//#endregion
//#region src/builtin-plugin/alias-plugin.d.ts
type ViteAliasPluginConfig = {
entries: {
find: string | RegExp;
replacement: string;
}[];
};
declare function viteAliasPlugin(config: ViteAliasPluginConfig): BuiltinPlugin;
//#endregion
//#region src/builtin-plugin/bundle-analyzer-plugin.d.ts
/**
* A plugin that analyzes bundle composition and generates detailed reports.
*
* The plugin outputs a file containing detailed information about:
* - All chunks and their relationships
* - Modules bundled in each chunk
* - Import dependencies between chunks
* - Reachable modules from each entry point
*
* @example
* ```js
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
*
* export default {
* plugins: [
* bundleAnalyzerPlugin()
* ]
* }
* ```
*
* @example
* **Custom filename**
* ```js
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
*
* export default {
* plugins: [
* bundleAnalyzerPlugin({
* fileName: 'bundle-analysis.json'
* })
* ]
* }
* ```
*
* @example
* **LLM-friendly markdown output**
* ```js
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
*
* export default {
* plugins: [
* bundleAnalyzerPlugin({
* format: 'md'
* })
* ]
* }
* ```
*/
declare function bundleAnalyzerPlugin(config?: BindingBundleAnalyzerPluginConfig): BuiltinPlugin;
//#endregion
//#region src/builtin-plugin/transform-plugin.d.ts
type TransformPattern = string | RegExp | readonly (RegExp | string)[];
type TransformPluginConfig = Omit<BindingViteTransformPluginConfig, "include" | "exclude" | "jsxRefreshInclude" | "jsxRefreshExclude" | "yarnPnp"> & {
include?: TransformPattern;
exclude?: TransformPattern;
jsxRefreshInclude?: TransformPattern;
jsxRefreshExclude?: TransformPattern;
};
declare function viteTransformPlugin(config: TransformPluginConfig): BuiltinPlugin;
//#endregion
//#region src/builtin-plugin/vite-manifest-plugin.d.ts
type ViteManifestPluginConfig = Omit<BindingViteManifestPluginConfig, "isLegacy"> & {
isOutputOptionsForLegacyChunks?: (outputOptions: NormalizedOutputOptions) => boolean;
};
declare function viteManifestPlugin(config: ViteManifestPluginConfig): BuiltinPlugin;
//#endregion
//#region src/experimental-index.d.ts
/**
* In-memory file system for browser builds.
*
* This is a re-export of the {@link https://github.com/streamich/memfs | memfs} package used by the WASI runtime.
* It allows you to read and write files to a virtual filesystem when using rolldown in browser environments.
*
* - `fs`: A Node.js-compatible filesystem API (`IFs` from memfs)
* - `volume`: The underlying `Volume` instance that stores the filesystem state
*
* Returns `undefined` in Node.js builds (only available in browser builds via `@rolldown/browser`).
*
* @example
* ```typescript
* import { memfs } from 'rolldown/experimental';
*
* // Write files to virtual filesystem before bundling
* memfs?.volume.fromJSON({
* '/src/index.js': 'export const foo = 42;',
* '/package.json': '{"name": "my-app"}'
* });
*
* // Read files from the virtual filesystem
* const content = memfs?.fs.readFileSync('/src/index.js', 'utf8');
* ```
*
* @see {@link https://github.com/streamich/memfs} for more information on the memfs API.
*/
declare const memfs: {
fs: any;
volume: any;
} | undefined;
/** @deprecated Use from `rolldown/utils` instead. */
declare const parse: typeof parse$1;
/** @deprecated Use from `rolldown/utils` instead. */
declare const parseSync: typeof parseSync$1;
/** @deprecated Use from `rolldown/utils` instead. */
type ParseResult = ParseResult$1;
/** @deprecated Use from `rolldown/utils` instead. */
type ParserOptions = ParserOptions$1;
/** @deprecated Use from `rolldown/utils` instead. */
declare const minify: typeof minify$1;
/** @deprecated Use from `rolldown/utils` instead. */
declare const minifySync: typeof minifySync$1;
/** @deprecated Use from `rolldown/utils` instead. */
type MinifyOptions = MinifyOptions$1;
/** @deprecated Use from `rolldown/utils` instead. */
type MinifyResult = MinifyResult$1;
/** @deprecated Use from `rolldown/utils` instead. */
declare const transform: typeof transform$1;
/** @deprecated Use from `rolldown/utils` instead. */
declare const transformSync: typeof transformSync$1;
/** @deprecated Use from `rolldown/utils` instead. */
type TransformOptions = TransformOptions$1;
/** @deprecated Use from `rolldown/utils` instead. */
type TransformResult = TransformResult$1;
/** @deprecated Use from `rolldown/utils` instead. */
declare const TsconfigCache: typeof TsconfigCache$1;
/** @deprecated Use from `rolldown/utils` instead. */
type TsconfigRawOptions = BindingTsconfigRawOptions;
/** @deprecated Use from `rolldown/utils` instead. */
type TsconfigCompilerOptions = BindingTsconfigCompilerOptions;
//#endregion
export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, MinifyOptions, MinifyResult, ParseResult, ParserOptions, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, TransformOptions, TransformResult, TsconfigCache, TsconfigCompilerOptions, TsconfigRawOptions, bundleAnalyzerPlugin, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, oxcRuntimePlugin, parse, parseSync, resolveTsconfig, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWebWorkerPostPlugin };
@@ -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 MessageCircleHeart = createLucideIcon("MessageCircleHeart", [
["path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z", key: "vv11sd" }],
[
"path",
{
d: "M15.8 9.2a2.5 2.5 0 0 0-3.5 0l-.3.4-.35-.3a2.42 2.42 0 1 0-3.2 3.6l3.6 3.5 3.6-3.5c1.2-1.2 1.1-2.7.2-3.7",
key: "43lnbm"
}
]
]);
export { MessageCircleHeart as default };
//# sourceMappingURL=message-circle-heart.js.map
@@ -0,0 +1,101 @@
'use strict'
const path = require('path')
const fs = require('../fs')
const { pathExists } = require('../path-exists')
const u = require('universalify').fromPromise
/**
* Function that returns two types of paths, one relative to symlink, and one
* relative to the current working directory. Checks if path is absolute or
* relative. If the path is relative, this function checks if the path is
* relative to symlink or relative to current working directory. This is an
* initiative to find a smarter `srcpath` to supply when building symlinks.
* This allows you to determine which path to use out of one of three possible
* types of source paths. The first is an absolute path. This is detected by
* `path.isAbsolute()`. When an absolute path is provided, it is checked to
* see if it exists. If it does it's used, if not an error is returned
* (callback)/ thrown (sync). The other two options for `srcpath` are a
* relative url. By default Node's `fs.symlink` works by creating a symlink
* using `dstpath` and expects the `srcpath` to be relative to the newly
* created symlink. If you provide a `srcpath` that does not exist on the file
* system it results in a broken symlink. To minimize this, the function
* checks to see if the 'relative to symlink' source file exists, and if it
* does it will use it. If it does not, it checks if there's a file that
* exists that is relative to the current working directory, if does its used.
* This preserves the expectations of the original fs.symlink spec and adds
* the ability to pass in `relative to current working direcotry` paths.
*/
async function symlinkPaths (srcpath, dstpath) {
if (path.isAbsolute(srcpath)) {
try {
await fs.lstat(srcpath)
} catch (err) {
err.message = err.message.replace('lstat', 'ensureSymlink')
throw err
}
return {
toCwd: srcpath,
toDst: srcpath
}
}
const dstdir = path.dirname(dstpath)
const relativeToDst = path.join(dstdir, srcpath)
const exists = await pathExists(relativeToDst)
if (exists) {
return {
toCwd: relativeToDst,
toDst: srcpath
}
}
try {
await fs.lstat(srcpath)
} catch (err) {
err.message = err.message.replace('lstat', 'ensureSymlink')
throw err
}
return {
toCwd: srcpath,
toDst: path.relative(dstdir, srcpath)
}
}
function symlinkPathsSync (srcpath, dstpath) {
if (path.isAbsolute(srcpath)) {
const exists = fs.existsSync(srcpath)
if (!exists) throw new Error('absolute srcpath does not exist')
return {
toCwd: srcpath,
toDst: srcpath
}
}
const dstdir = path.dirname(dstpath)
const relativeToDst = path.join(dstdir, srcpath)
const exists = fs.existsSync(relativeToDst)
if (exists) {
return {
toCwd: relativeToDst,
toDst: srcpath
}
}
const srcExists = fs.existsSync(srcpath)
if (!srcExists) throw new Error('relative srcpath does not exist')
return {
toCwd: srcpath,
toDst: path.relative(dstdir, srcpath)
}
}
module.exports = {
symlinkPaths: u(symlinkPaths),
symlinkPathsSync
}
@@ -0,0 +1,31 @@
import {augmentError, initParser, state} from "./traverser/base";
import {parseFile} from "./traverser/index";
export class File {
constructor(tokens, scopes) {
this.tokens = tokens;
this.scopes = scopes;
}
}
export function parse(
input,
isJSXEnabled,
isTypeScriptEnabled,
isFlowEnabled,
) {
if (isFlowEnabled && isTypeScriptEnabled) {
throw new Error("Cannot combine flow and typescript plugins.");
}
initParser(input, isJSXEnabled, isTypeScriptEnabled, isFlowEnabled);
const result = parseFile();
if (state.error) {
throw augmentError(state.error);
}
return result;
}
@@ -0,0 +1 @@
{"version":3,"file":"arrow-down-10.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,352 @@
// @generated
// This code is automatically generated. Manual editing is not recommended.
/*
* BSD-2-Clause License
*
* Original source code is copyright (c) 2025 Remy Rylan
* <https://github.com/RemyRylan>
*
* Documentation and keyword descriptions are copyright (c) 2020 IETF Trust
* <https://www.ietf.org/>, Austin Wright <aaa@bzfx.net>, Henry Andrews
* <andrews_henry@yahoo.com>, Ben Hutton <ben@jsonschema.dev>, and Greg Dennis
* <gregsdennis@yahoo.com>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
export const draft = "2020-12";
export const $schema = "https://json-schema.org/draft/2020-12/schema";
// -----------------------------------------------------------------------------
/**
* Content encoding strategy enum.
*
* - [Content-Transfer-Encoding Syntax](https://datatracker.ietf.org/doc/html/rfc2045#section-6.1)
* - [7bit vs 8bit encoding](https://stackoverflow.com/questions/25710599/content-transfer-encoding-7bit-or-8-bit/28531705#28531705)
*/
export var ContentEncoding;
(function (ContentEncoding) {
/**
* Only US-ASCII characters, which use the lower 7 bits for each character.
*
* Each line must be less than 1,000 characters.
*/
ContentEncoding["7bit"] = "7bit";
/**
* Allow extended ASCII characters which can use the 8th (highest) bit to
* indicate special characters not available in 7bit.
*
* Each line must be less than 1,000 characters.
*/
ContentEncoding["8bit"] = "8bit";
/**
* Useful for data that is mostly non-text.
*/
ContentEncoding["Base64"] = "base64";
/**
* Same character set as 8bit, with no line length restriction.
*/
ContentEncoding["Binary"] = "binary";
/**
* An extension token defined by a standards-track RFC and registered with
* IANA.
*/
ContentEncoding["IETFToken"] = "ietf-token";
/**
* Lines are limited to 76 characters, and line breaks are represented using
* special characters that are escaped.
*/
ContentEncoding["QuotedPrintable"] = "quoted-printable";
/**
* The two characters "X-" or "x-" followed, with no intervening white space,
* by any token.
*/
ContentEncoding["XToken"] = "x-token";
})(ContentEncoding || (ContentEncoding = {}));
/**
* This enum provides well-known formats that apply to strings.
*/
export var Format;
(function (Format) {
/**
* A string instance is valid against this attribute if it is a valid
* representation according to the "full-date" production in
* [RFC 3339][RFC3339].
*
* [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339
*/
Format["Date"] = "date";
/**
* A string instance is valid against this attribute if it is a valid
* representation according to the "date-time" production in
* [RFC 3339][RFC3339].
*
* [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339
*/
Format["DateTime"] = "date-time";
/**
* A string instance is valid against this attribute if it is a valid
* representation according to the "duration" production.
*/
Format["Duration"] = "duration";
/**
* A string instance is valid against this attribute if it is a valid Internet
* email address as defined by by the "Mailbox" ABNF rule in [RFC
* 5321][RFC5322], section 4.1.2.
*
* [RFC5321]: https://datatracker.ietf.org/doc/html/rfc5321
*/
Format["Email"] = "email";
/**
* As defined by [RFC 1123, section 2.1][RFC1123], including host names
* produced using the Punycode algorithm specified in
* [RFC 5891, section 4.4][RFC5891].
*
* [RFC1123]: https://datatracker.ietf.org/doc/html/rfc1123
* [RFC5891]: https://datatracker.ietf.org/doc/html/rfc5891
*/
Format["Hostname"] = "hostname";
/**
* A string instance is valid against this attribute if it is a valid Internet
* email address as defined by the extended "Mailbox" ABNF rule in
* [RFC 6531][RFC6531], section 3.3.
*
* [RFC6531]: https://datatracker.ietf.org/doc/html/rfc6531
*/
Format["IDNEmail"] = "idn-email";
/**
* As defined by either [RFC 1123, section 2.1][RFC1123] as for hostname, or
* an internationalized hostname as defined by
* [RFC 5890, section 2.3.2.3][RFC5890].
*
* [RFC1123]: https://datatracker.ietf.org/doc/html/rfc1123
* [RFC5890]: https://datatracker.ietf.org/doc/html/rfc5890
*/
Format["IDNHostname"] = "idn-hostname";
/**
* An IPv4 address according to the "dotted-quad" ABNF syntax as defined in
* [RFC 2673, section 3.2][RFC2673].
*
* [RFC2673]: https://datatracker.ietf.org/doc/html/rfc2673
*/
Format["IPv4"] = "ipv4";
/**
* An IPv6 address as defined in [RFC 4291, section 2.2][RFC4291].
*
* [RFC4291]: https://datatracker.ietf.org/doc/html/rfc4291
*/
Format["IPv6"] = "ipv6";
/**
* A string instance is valid against this attribute if it is a valid IRI,
* according to [RFC 3987][RFC3987].
*
* [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987
*/
Format["IRI"] = "iri";
/**
* A string instance is valid against this attribute if it is a valid IRI
* Reference (either an IRI or a relative-reference), according to
* [RFC 3987][RFC3987].
*
* [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987
*/
Format["IRIReference"] = "iri-reference";
/**
* A string instance is valid against this attribute if it is a valid JSON
* string representation of a JSON Pointer, according to
* [RFC 6901, section 5][RFC6901].
*
* [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901
*/
Format["JSONPointer"] = "json-pointer";
/**
* A string instance is valid against this attribute if it is a valid JSON
* string representation of a JSON Pointer fragment, according to
* [RFC 6901, section 5][RFC6901].
*
* [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901
*/
Format["JSONPointerURIFragment"] = "json-pointer-uri-fragment";
/**
* This attribute applies to string instances.
*
* A regular expression, which SHOULD be valid according to the
* [ECMA-262][ecma262] regular expression dialect.
*
* Implementations that validate formats MUST accept at least the subset of
* [ECMA-262][ecma262] defined in the [Regular Expressions][regexInterop]
* section of this specification, and SHOULD accept all valid
* [ECMA-262][ecma262] expressions.
*
* [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/
* [regexInterop]: https://json-schema.org/draft/2020-12/json-schema-validation.html#regexInterop
*/
Format["RegEx"] = "regex";
/**
* A string instance is valid against this attribute if it is a valid
* [Relative JSON Pointer][relative-json-pointer].
*
* [relative-json-pointer]: https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer-01
*/
Format["RelativeJSONPointer"] = "relative-json-pointer";
/**
* A string instance is valid against this attribute if it is a valid
* representation according to the "time" production in [RFC 3339][RFC3339].
*
* [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339
*/
Format["Time"] = "time";
/**
* A string instance is valid against this attribute if it is a valid URI,
* according to [RFC3986][RFC3986].
*
* [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986
*/
Format["URI"] = "uri";
/**
* A string instance is valid against this attribute if it is a valid URI
* Reference (either a URI or a relative-reference), according to
* [RFC3986][RFC3986].
*
* [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986
*/
Format["URIReference"] = "uri-reference";
/**
* A string instance is valid against this attribute if it is a valid URI
* Template (of any level), according to [RFC 6570][RFC6570].
*
* Note that URI Templates may be used for IRIs; there is no separate IRI
* Template specification.
*
* [RFC6570]: https://datatracker.ietf.org/doc/html/rfc6570
*/
Format["URITemplate"] = "uri-template";
/**
* A string instance is valid against this attribute if it is a valid string
* representation of a UUID, according to [RFC 4122][RFC4122].
*
* [RFC4122]: https://datatracker.ietf.org/doc/html/rfc4122
*/
Format["UUID"] = "uuid";
})(Format || (Format = {}));
/**
* Enum consisting of simple type names for the `type` keyword
*/
export var TypeName;
(function (TypeName) {
/**
* Value MUST be an array.
*/
TypeName["Array"] = "array";
/**
* Value MUST be a boolean.
*/
TypeName["Boolean"] = "boolean";
/**
* Value MUST be an integer, no floating point numbers are allowed. This is a
* subset of the number type.
*/
TypeName["Integer"] = "integer";
/**
* Value MUST be null. Note this is mainly for purpose of being able use union
* types to define nullability. If this type is not included in a union, null
* values are not allowed (the primitives listed above do not allow nulls on
* their own).
*/
TypeName["Null"] = "null";
/**
* Value MUST be a number, floating point numbers are allowed.
*/
TypeName["Number"] = "number";
/**
* Value MUST be an object.
*/
TypeName["Object"] = "object";
/**
* Value MUST be a string.
*/
TypeName["String"] = "string";
})(TypeName || (TypeName = {}));
// -----------------------------------------------------------------------------
// Keywords
// -----------------------------------------------------------------------------
export const keywords = [
"$anchor",
"$comment",
"$defs",
"$dynamicAnchor",
"$dynamicRef",
"$id",
"$ref",
"$schema",
"$vocabulary",
"additionalItems",
"additionalProperties",
"allOf",
"anyOf",
"const",
"contains",
"contentEncoding",
"contentMediaType",
"contentSchema",
"default",
"definitions",
"dependencies",
"dependentRequired",
"dependentSchemas",
"deprecated",
"description",
"else",
"enum",
"examples",
"exclusiveMaximum",
"exclusiveMinimum",
"format",
"if",
"items",
"maxContains",
"maximum",
"maxItems",
"maxLength",
"maxProperties",
"minContains",
"minimum",
"minItems",
"minLength",
"minProperties",
"multipleOf",
"not",
"oneOf",
"pattern",
"patternProperties",
"prefixItems",
"properties",
"propertyNames",
"readOnly",
"required",
"then",
"title",
"type",
"unevaluatedItems",
"unevaluatedProperties",
"uniqueItems",
"writeOnly",
];
@@ -0,0 +1,136 @@
"use client";
import { jsx } from 'react/jsx-runtime';
import { globalProjectionState, frame, microtask } from 'motion-dom';
import { useContext, Component } from 'react';
import { usePresence } from '../../../components/AnimatePresence/use-presence.mjs';
import { LayoutGroupContext } from '../../../context/LayoutGroupContext.mjs';
import { SwitchLayoutGroupContext } from '../../../context/SwitchLayoutGroupContext.mjs';
/**
* Track whether we've taken any snapshots yet. If not,
* we can safely skip notification of didUpdate.
*
* Difficult to capture in a test but to prevent flickering
* we must set this to true either on update or unmount.
* Running `next-env/layout-id` in Safari will show this behaviour if broken.
*/
let hasTakenAnySnapshot = false;
class MeasureLayoutWithContext extends Component {
/**
* This only mounts projection nodes for components that
* need measuring, we might want to do it for all components
* in order to incorporate transforms
*/
componentDidMount() {
const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;
const { projection } = visualElement;
if (projection) {
if (layoutGroup.group)
layoutGroup.group.add(projection);
if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {
switchLayoutGroup.register(projection);
}
if (hasTakenAnySnapshot) {
projection.root.didUpdate();
}
projection.addEventListener("animationComplete", () => {
this.safeToRemove();
});
projection.setOptions({
...projection.options,
layoutDependency: this.props.layoutDependency,
onExitComplete: () => this.safeToRemove(),
});
}
globalProjectionState.hasEverUpdated = true;
}
getSnapshotBeforeUpdate(prevProps) {
const { layoutDependency, visualElement, drag, isPresent } = this.props;
const { projection } = visualElement;
if (!projection)
return null;
/**
* TODO: We use this data in relegate to determine whether to
* promote a previous element. There's no guarantee its presence data
* will have updated by this point - if a bug like this arises it will
* have to be that we markForRelegation and then find a new lead some other way,
* perhaps in didUpdate
*/
projection.isPresent = isPresent;
if (prevProps.layoutDependency !== layoutDependency) {
projection.setOptions({
...projection.options,
layoutDependency,
});
}
hasTakenAnySnapshot = true;
if (drag ||
prevProps.layoutDependency !== layoutDependency ||
layoutDependency === undefined ||
prevProps.isPresent !== isPresent) {
projection.willUpdate();
}
else {
this.safeToRemove();
}
if (prevProps.isPresent !== isPresent) {
if (isPresent) {
projection.promote();
}
else if (!projection.relegate()) {
/**
* If there's another stack member taking over from this one,
* it's in charge of the exit animation and therefore should
* be in charge of the safe to remove. Otherwise we call it here.
*/
frame.postRender(() => {
const stack = projection.getStack();
if (!stack || !stack.members.length) {
this.safeToRemove();
}
});
}
}
return null;
}
componentDidUpdate() {
const { visualElement, layoutAnchor } = this.props;
const { projection } = visualElement;
if (projection) {
projection.options.layoutAnchor = layoutAnchor;
projection.root.didUpdate();
microtask.postRender(() => {
if (!projection.currentAnimation && projection.isLead()) {
this.safeToRemove();
}
});
}
}
componentWillUnmount() {
const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props;
const { projection } = visualElement;
hasTakenAnySnapshot = true;
if (projection) {
projection.scheduleCheckAfterUnmount();
if (layoutGroup && layoutGroup.group)
layoutGroup.group.remove(projection);
if (promoteContext && promoteContext.deregister)
promoteContext.deregister(projection);
}
}
safeToRemove() {
const { safeToRemove } = this.props;
safeToRemove && safeToRemove();
}
render() {
return null;
}
}
function MeasureLayout(props) {
const [isPresent, safeToRemove] = usePresence();
const layoutGroup = useContext(LayoutGroupContext);
return (jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }));
}
export { MeasureLayout };
//# sourceMappingURL=MeasureLayout.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"seroval-plugins.cjs","names":[],"sources":["../../../../src/ssr/serializer/seroval-plugins.ts"],"sourcesContent":["import { ReadableStreamPlugin } from 'seroval-plugins/web'\nimport { ShallowErrorPlugin } from './ShallowErrorPlugin'\nimport { RawStreamSSRPlugin } from './RawStream'\nimport type { RawStream } from './RawStream'\nimport type { Plugin } from 'seroval'\n\nexport const defaultSerovalPlugins = [\n ShallowErrorPlugin as Plugin<Error, any>,\n // RawStreamSSRPlugin must come before ReadableStreamPlugin to match first\n RawStreamSSRPlugin as Plugin<RawStream, any>,\n // ReadableStreamNode is not exported by seroval\n ReadableStreamPlugin as Plugin<ReadableStream, any>,\n]\n"],"mappings":";;;;AAMA,MAAa,wBAAwB;CACnC,2BAAA;CAEA,kBAAA;CAEA,oBAAA;CACD"}
@@ -0,0 +1,99 @@
'use strict';
// Descend into a directory structure and, for each file matching *.node, output
// based on the imports found in the file whether it's an N-API module or not.
const fs = require('fs');
const path = require('path');
// Read the output of the command, break it into lines, and use the reducer to
// decide whether the file is an N-API module or not.
function checkFile (file, command, argv, reducer) {
const child = require('child_process').spawn(command, argv, {
stdio: ['inherit', 'pipe', 'inherit']
});
let leftover = '';
let isNapi;
child.stdout.on('data', (chunk) => {
if (isNapi === undefined) {
chunk = (leftover + chunk.toString()).split(/[\r\n]+/);
leftover = chunk.pop();
isNapi = chunk.reduce(reducer, isNapi);
if (isNapi !== undefined) {
child.kill();
}
}
});
child.on('close', (code, signal) => {
if ((code === null && signal !== null) || (code !== 0)) {
console.log(
command + ' exited with code: ' + code + ' and signal: ' + signal);
} else {
// Green if it's a N-API module, red otherwise.
console.log(
'\x1b[' + (isNapi ? '42' : '41') + 'm' +
(isNapi ? ' N-API' : 'Not N-API') +
'\x1b[0m: ' + file);
}
});
}
// Use nm -a to list symbols.
function checkFileUNIX (file) {
checkFile(file, 'nm', ['-a', file], (soFar, line) => {
if (soFar === undefined) {
line = line.match(/([0-9a-f]*)? ([a-zA-Z]) (.*$)/);
if (line[2] === 'U') {
if (/^napi/.test(line[3])) {
soFar = true;
}
}
}
return soFar;
});
}
// Use dumpbin /imports to list symbols.
function checkFileWin32 (file) {
checkFile(file, 'dumpbin', ['/imports', file], (soFar, line) => {
if (soFar === undefined) {
line = line.match(/([0-9a-f]*)? +([a-zA-Z0-9]) (.*$)/);
if (line && /^napi/.test(line[line.length - 1])) {
soFar = true;
}
}
return soFar;
});
}
// Descend into a directory structure and pass each file ending in '.node' to
// one of the above checks, depending on the OS.
function recurse (top) {
fs.readdir(top, (error, items) => {
if (error) {
throw new Error('error reading directory ' + top + ': ' + error);
}
items.forEach((item) => {
item = path.join(top, item);
fs.stat(item, ((item) => (error, stats) => {
if (error) {
throw new Error('error about ' + item + ': ' + error);
}
if (stats.isDirectory()) {
recurse(item);
} else if (/[.]node$/.test(item) &&
// Explicitly ignore files called 'nothing.node' because they are
// artefacts of node-addon-api having identified a version of
// Node.js that ships with a correct implementation of N-API.
path.basename(item) !== 'nothing.node') {
process.platform === 'win32'
? checkFileWin32(item)
: checkFileUNIX(item);
}
})(item));
});
});
}
// Start with the directory given on the command line or the current directory
// if nothing was given.
recurse(process.argv.length > 3 ? process.argv[2] : '.');
@@ -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 TvMinimal = createLucideIcon("TvMinimal", [
["path", { d: "M7 21h10", key: "1b0cd5" }],
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }]
]);
export { TvMinimal as default };
//# sourceMappingURL=tv-minimal.js.map
@@ -0,0 +1 @@
{"version":3,"file":"phone-call.js","sources":["../../../src/icons/phone-call.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PhoneCall\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjIgMTYuOTJ2M2EyIDIgMCAwIDEtMi4xOCAyIDE5Ljc5IDE5Ljc5IDAgMCAxLTguNjMtMy4wNyAxOS41IDE5LjUgMCAwIDEtNi02IDE5Ljc5IDE5Ljc5IDAgMCAxLTMuMDctOC42N0EyIDIgMCAwIDEgNC4xMSAyaDNhMiAyIDAgMCAxIDIgMS43MiAxMi44NCAxMi44NCAwIDAgMCAuNyAyLjgxIDIgMiAwIDAgMS0uNDUgMi4xMUw4LjA5IDkuOTFhMTYgMTYgMCAwIDAgNiA2bDEuMjctMS4yN2EyIDIgMCAwIDEgMi4xMS0uNDUgMTIuODQgMTIuODQgMCAwIDAgMi44MS43QTIgMiAwIDAgMSAyMiAxNi45MnoiIC8+CiAgPHBhdGggZD0iTTE0LjA1IDJhOSA5IDAgMCAxIDggNy45NCIgLz4KICA8cGF0aCBkPSJNMTQuMDUgNkE1IDUgMCAwIDEgMTggMTAiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/phone-call\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 PhoneCall = createLucideIcon('PhoneCall', [\n [\n 'path',\n {\n d: 'M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z',\n key: 'foiqr5',\n },\n ],\n ['path', { d: 'M14.05 2a9 9 0 0 1 8 7.94', key: 'vmijpz' }],\n ['path', { d: 'M14.05 6A5 5 0 0 1 18 10', key: '13nbpp' }],\n]);\n\nexport default PhoneCall;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC3D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"tally-5.js","sources":["../../../src/icons/tally-5.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Tally5\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCA0djE2IiAvPgogIDxwYXRoIGQ9Ik05IDR2MTYiIC8+CiAgPHBhdGggZD0iTTE0IDR2MTYiIC8+CiAgPHBhdGggZD0iTTE5IDR2MTYiIC8+CiAgPHBhdGggZD0iTTIyIDYgMiAxOCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/tally-5\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 Tally5 = createLucideIcon('Tally5', [\n ['path', { d: 'M4 4v16', key: '6qkkli' }],\n ['path', { d: 'M9 4v16', key: '81ygyz' }],\n ['path', { d: 'M14 4v16', key: '12vmem' }],\n ['path', { d: 'M19 4v16', key: '8ij5ei' }],\n ['path', { d: 'M22 6 2 18', key: 'h9moai' }],\n]);\n\nexport default Tally5;\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,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,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,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,64 @@
import { HTTPException } from "../http-exception.js";
import { bufferToFormData } from "../utils/buffer.js";
import { getCookie } from "../helper/cookie/index.js";
//#region src/validator/validator.ts
const jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i;
const multipartRegex = /^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/i;
const urlencodedRegex = /^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i;
const validator = (target, validationFunc) => {
return async (c, next) => {
let value = {};
const contentType = c.req.header("Content-Type");
switch (target) {
case "json":
if (!contentType || !jsonRegex.test(contentType)) break;
try {
value = await c.req.json();
} catch {
throw new HTTPException(400, { message: "Malformed JSON in request body" });
}
break;
case "form": {
if (!contentType || !(multipartRegex.test(contentType) || urlencodedRegex.test(contentType))) break;
let formData;
if (c.req.bodyCache.formData) formData = await c.req.bodyCache.formData;
else try {
const arrayBuffer = await c.req.arrayBuffer();
formData = await bufferToFormData(arrayBuffer, contentType);
c.req.bodyCache.formData = formData;
} catch (e) {
let message = "Malformed FormData request.";
message += e instanceof Error ? ` ${e.message}` : ` ${String(e)}`;
throw new HTTPException(400, { message });
}
const form = Object.create(null);
formData.forEach((value, key) => {
if (key.endsWith("[]")) (form[key] ??= []).push(value);
else if (Array.isArray(form[key])) form[key].push(value);
else if (Object.hasOwn(form, key)) form[key] = [form[key], value];
else form[key] = value;
});
value = form;
break;
}
case "query":
value = Object.fromEntries(Object.entries(c.req.queries()).map(([k, v]) => {
return v.length === 1 ? [k, v[0]] : [k, v];
}));
break;
case "param":
value = c.req.param();
break;
case "header":
value = c.req.header();
break;
case "cookie": value = getCookie(c);
}
const res = await validationFunc(value, c);
if (res instanceof Response) return res;
c.req.addValidatedData(target, res);
return await next();
};
};
//#endregion
export { validator };
@@ -0,0 +1,39 @@
import { d as safeReplaceTextBetween, f as createRule, g as import_ast_utils } from "../utils.js";
var implicit_arrow_linebreak_default = createRule({
name: "implicit-arrow-linebreak",
meta: {
type: "layout",
docs: { description: "Enforce the location of arrow function bodies" },
fixable: "whitespace",
schema: [{
type: "string",
enum: ["beside", "below"]
}],
defaultOptions: ["beside"],
messages: {
expected: "Expected a linebreak before this expression.",
unexpected: "Expected no linebreak before this expression."
}
},
create(context, [option]) {
const sourceCode = context.sourceCode;
function validateExpression(node) {
if (node.body.type === "BlockStatement") return;
const arrowToken = sourceCode.getTokenBefore(node.body, import_ast_utils.isNotOpeningParenToken);
const firstTokenOfBody = sourceCode.getTokenAfter(arrowToken);
const onSameLine = (0, import_ast_utils.isTokenOnSameLine)(arrowToken, firstTokenOfBody);
if (onSameLine && option === "below") context.report({
node: firstTokenOfBody,
messageId: "expected",
fix: (fixer) => fixer.insertTextBefore(firstTokenOfBody, "\n")
});
else if (!onSameLine && option === "beside") context.report({
node: firstTokenOfBody,
messageId: "unexpected",
fix: safeReplaceTextBetween(sourceCode, arrowToken, firstTokenOfBody, " ")
});
}
return { ArrowFunctionExpression: (node) => validateExpression(node) };
}
});
export { implicit_arrow_linebreak_default as t };
@@ -0,0 +1,203 @@
'use strict';
const { tokenChars } = require('./validation');
/**
* Adds an offer to the map of extension offers or a parameter to the map of
* parameters.
*
* @param {Object} dest The map of extension offers or parameters
* @param {String} name The extension or parameter name
* @param {(Object|Boolean|String)} elem The extension parameters or the
* parameter value
* @private
*/
function push(dest, name, elem) {
if (dest[name] === undefined) dest[name] = [elem];
else dest[name].push(elem);
}
/**
* Parses the `Sec-WebSocket-Extensions` header into an object.
*
* @param {String} header The field value of the header
* @return {Object} The parsed object
* @public
*/
function parse(header) {
const offers = Object.create(null);
let params = Object.create(null);
let mustUnescape = false;
let isEscaping = false;
let inQuotes = false;
let extensionName;
let paramName;
let start = -1;
let code = -1;
let end = -1;
let i = 0;
for (; i < header.length; i++) {
code = header.charCodeAt(i);
if (extensionName === undefined) {
if (end === -1 && tokenChars[code] === 1) {
if (start === -1) start = i;
} else if (
i !== 0 &&
(code === 0x20 /* ' ' */ || code === 0x09) /* '\t' */
) {
if (end === -1 && start !== -1) end = i;
} else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) {
if (start === -1) {
throw new SyntaxError(`Unexpected character at index ${i}`);
}
if (end === -1) end = i;
const name = header.slice(start, end);
if (code === 0x2c) {
push(offers, name, params);
params = Object.create(null);
} else {
extensionName = name;
}
start = end = -1;
} else {
throw new SyntaxError(`Unexpected character at index ${i}`);
}
} else if (paramName === undefined) {
if (end === -1 && tokenChars[code] === 1) {
if (start === -1) start = i;
} else if (code === 0x20 || code === 0x09) {
if (end === -1 && start !== -1) end = i;
} else if (code === 0x3b || code === 0x2c) {
if (start === -1) {
throw new SyntaxError(`Unexpected character at index ${i}`);
}
if (end === -1) end = i;
push(params, header.slice(start, end), true);
if (code === 0x2c) {
push(offers, extensionName, params);
params = Object.create(null);
extensionName = undefined;
}
start = end = -1;
} else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) {
paramName = header.slice(start, i);
start = end = -1;
} else {
throw new SyntaxError(`Unexpected character at index ${i}`);
}
} else {
//
// The value of a quoted-string after unescaping must conform to the
// token ABNF, so only token characters are valid.
// Ref: https://tools.ietf.org/html/rfc6455#section-9.1
//
if (isEscaping) {
if (tokenChars[code] !== 1) {
throw new SyntaxError(`Unexpected character at index ${i}`);
}
if (start === -1) start = i;
else if (!mustUnescape) mustUnescape = true;
isEscaping = false;
} else if (inQuotes) {
if (tokenChars[code] === 1) {
if (start === -1) start = i;
} else if (code === 0x22 /* '"' */ && start !== -1) {
inQuotes = false;
end = i;
} else if (code === 0x5c /* '\' */) {
isEscaping = true;
} else {
throw new SyntaxError(`Unexpected character at index ${i}`);
}
} else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) {
inQuotes = true;
} else if (end === -1 && tokenChars[code] === 1) {
if (start === -1) start = i;
} else if (start !== -1 && (code === 0x20 || code === 0x09)) {
if (end === -1) end = i;
} else if (code === 0x3b || code === 0x2c) {
if (start === -1) {
throw new SyntaxError(`Unexpected character at index ${i}`);
}
if (end === -1) end = i;
let value = header.slice(start, end);
if (mustUnescape) {
value = value.replace(/\\/g, '');
mustUnescape = false;
}
push(params, paramName, value);
if (code === 0x2c) {
push(offers, extensionName, params);
params = Object.create(null);
extensionName = undefined;
}
paramName = undefined;
start = end = -1;
} else {
throw new SyntaxError(`Unexpected character at index ${i}`);
}
}
}
if (start === -1 || inQuotes || code === 0x20 || code === 0x09) {
throw new SyntaxError('Unexpected end of input');
}
if (end === -1) end = i;
const token = header.slice(start, end);
if (extensionName === undefined) {
push(offers, token, params);
} else {
if (paramName === undefined) {
push(params, token, true);
} else if (mustUnescape) {
push(params, paramName, token.replace(/\\/g, ''));
} else {
push(params, paramName, token);
}
push(offers, extensionName, params);
}
return offers;
}
/**
* Builds the `Sec-WebSocket-Extensions` header field value.
*
* @param {Object} extensions The map of extensions and parameters to format
* @return {String} A string representing the given object
* @public
*/
function format(extensions) {
return Object.keys(extensions)
.map((extension) => {
let configurations = extensions[extension];
if (!Array.isArray(configurations)) configurations = [configurations];
return configurations
.map((params) => {
return [extension]
.concat(
Object.keys(params).map((k) => {
let values = params[k];
if (!Array.isArray(values)) values = [values];
return values
.map((v) => (v === true ? k : `${k}=${v}`))
.join('; ');
})
)
.join('; ');
})
.join(', ');
})
.join(', ');
}
module.exports = { format, parse };
@@ -0,0 +1,129 @@
/**
* These are types for things that are present in the React `canary` release channel.
*
* 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/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/canary'
* ```
*
* It is also possible to include it through a triple-slash reference:
*
* ```ts
* /// <reference types="react/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/src/React.js to see how the exports are declared,
import React = require(".");
export {};
declare const UNDEFINED_VOID_ONLY: unique symbol;
type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
type NativeSubmitEvent = SubmitEvent;
declare module "." {
export function unstable_useCacheRefresh(): () => void;
// @enableViewTransition
export interface ViewTransitionInstance {
/**
* The {@link ViewTransitionProps name} that was used in the corresponding {@link ViewTransition} component or `"auto"` if the `name` prop was omitted.
*/
name: string;
}
export type ViewTransitionClassPerType = Record<"default" | (string & {}), "none" | "auto" | (string & {})>;
export type ViewTransitionClass = ViewTransitionClassPerType | ViewTransitionClassPerType[string];
export interface ViewTransitionProps {
children?: ReactNode | undefined;
/**
* Assigns the {@link https://developer.chrome.com/blog/view-transitions-update-io24#view-transition-class `view-transition-class`} class to the underlying DOM node.
*/
default?: ViewTransitionClass | undefined;
/**
* Combined with {@link className} if this `<ViewTransition>` or its parent Component is mounted and there's no other with the same name being deleted.
* `"none"` is a special value that deactivates the view transition name under that condition.
*/
enter?: ViewTransitionClass | undefined;
/**
* Combined with {@link className} if this `<ViewTransition>` or its parent Component is unmounted and there's no other with the same name being deleted.
* `"none"` is a special value that deactivates the view transition name under that condition.
*/
exit?: ViewTransitionClass | undefined;
/**
* "auto" will automatically assign a view-transition-name to the inner DOM node.
* That way you can add a View Transition to a Component without controlling its DOM nodes styling otherwise.
*
* A difference between this and the browser's built-in view-transition-name: auto is that switching the DOM nodes within the `<ViewTransition>` component preserves the same name so this example cross-fades between the DOM nodes instead of causing an exit and enter.
* @default "auto"
*/
name?: "auto" | (string & {}) | undefined;
/**
* The `<ViewTransition>` or its parent Component is mounted and there's no other `<ViewTransition>` with the same name being deleted.
*/
onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
/**
* The `<ViewTransition>` or its parent Component is unmounted and there's no other `<ViewTransition>` with the same name being deleted.
*/
onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
/**
* This `<ViewTransition>` is being mounted and another `<ViewTransition>` instance with the same name is being unmounted elsewhere.
*/
onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
/**
* The content of `<ViewTransition>` has changed either due to DOM mutations or because an inner child `<ViewTransition>` has resized.
*/
onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
ref?: Ref<ViewTransitionInstance> | undefined;
/**
* Combined with {@link className} if this `<ViewTransition>` is being mounted and another instance with the same name is being unmounted elsewhere.
* `"none"` is a special value that deactivates the view transition name under that condition.
*/
share?: ViewTransitionClass | undefined;
/**
* Combined with {@link className} if the content of this `<ViewTransition>` has changed either due to DOM mutations or because an inner child has resized.
* `"none"` is a special value that deactivates the view transition name under that condition.
*/
update?: ViewTransitionClass | undefined;
}
/**
* Opt-in for using {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API View Transitions} in React.
* View Transitions only trigger for async updates like {@link startTransition}, {@link useDeferredValue}, Actions or <{@link Suspense}> revealing from fallback to content.
* Synchronous updates provide an opt-out but also guarantee that they commit immediately which View Transitions can't.
*
* @see {@link https://react.dev/reference/react/ViewTransition `<ViewTransition>` reference documentation}
*/
export const ViewTransition: ExoticComponent<ViewTransitionProps>;
/**
* @see {@link https://react.dev/reference/react/addTransitionType `addTransitionType` reference documentation}
*/
export function addTransitionType(type: string): void;
// @enableFragmentRefs
export interface FragmentInstance {}
export interface FragmentProps {
ref?: Ref<FragmentInstance> | undefined;
}
interface SubmitEvent<T = Element> extends SyntheticEvent<T, NativeSubmitEvent> {
/**
* Only available in react@canary
*/
submitter: HTMLElement | null;
}
}
@@ -0,0 +1,5 @@
import type * as errors from "../core/errors.js";
/** @deprecated Use `km` instead. */
export default function (): {
localeError: errors.$ZodErrorMap;
};
@@ -0,0 +1 @@
{"version":3,"file":"hostHeaderValidation.js","sourceRoot":"","sources":["../../../../src/server/middleware/hostHeaderValidation.ts"],"names":[],"mappings":";;AAqBA,oDA4CC;AAWD,0DAEC;AA5ED;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,oBAAoB,CAAC,gBAA0B;IAC3D,OAAO,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;QACvD,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;QACpC,IAAI,CAAC,UAAU,EAAE,CAAC;YACd,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACjB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACH,IAAI,EAAE,CAAC,KAAK;oBACZ,OAAO,EAAE,qBAAqB;iBACjC;gBACD,EAAE,EAAE,IAAI;aACX,CAAC,CAAC;YACH,OAAO;QACX,CAAC;QAED,4EAA4E;QAC5E,IAAI,QAAgB,CAAC;QACrB,IAAI,CAAC;YACD,QAAQ,GAAG,IAAI,GAAG,CAAC,UAAU,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC;QACxD,CAAC;QAAC,MAAM,CAAC;YACL,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACjB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACH,IAAI,EAAE,CAAC,KAAK;oBACZ,OAAO,EAAE,wBAAwB,UAAU,EAAE;iBAChD;gBACD,EAAE,EAAE,IAAI;aACX,CAAC,CAAC;YACH,OAAO;QACX,CAAC;QAED,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YACvC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACjB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACH,IAAI,EAAE,CAAC,KAAK;oBACZ,OAAO,EAAE,iBAAiB,QAAQ,EAAE;iBACvC;gBACD,EAAE,EAAE,IAAI;aACX,CAAC,CAAC;YACH,OAAO;QACX,CAAC;QACD,IAAI,EAAE,CAAC;IACX,CAAC,CAAC;AACN,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,uBAAuB;IACnC,OAAO,oBAAoB,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC"}
@@ -0,0 +1,468 @@
/**
* @fileoverview A rule to disallow the type conversions with shorter notations.
* @author Toru Nagashima
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const INDEX_OF_PATTERN = /^(?:i|lastI)ndexOf$/u;
const ALLOWABLE_OPERATORS = ["~", "!!", "+", "- -", "-", "*"];
/**
* Checks whether or not a node is a double logical negating.
* @param {ASTNode} node An UnaryExpression node to check.
* @returns {boolean} Whether or not the node is a double logical negating.
*/
function isDoubleLogicalNegating(node) {
return (
node.operator === "!" &&
node.argument.type === "UnaryExpression" &&
node.argument.operator === "!"
);
}
/**
* Checks whether or not a node is a binary negating of `.indexOf()` method calling.
* @param {ASTNode} node An UnaryExpression node to check.
* @returns {boolean} Whether or not the node is a binary negating of `.indexOf()` method calling.
*/
function isBinaryNegatingOfIndexOf(node) {
if (node.operator !== "~") {
return false;
}
const callNode = astUtils.skipChainExpression(node.argument);
return (
callNode.type === "CallExpression" &&
astUtils.isSpecificMemberAccess(callNode.callee, null, INDEX_OF_PATTERN)
);
}
/**
* Checks whether or not a node is a multiplying by one.
* @param {BinaryExpression} node A BinaryExpression node to check.
* @returns {boolean} Whether or not the node is a multiplying by one.
*/
function isMultiplyByOne(node) {
return (
node.operator === "*" &&
((node.left.type === "Literal" && node.left.value === 1) ||
(node.right.type === "Literal" && node.right.value === 1))
);
}
/**
* Checks whether the given node logically represents multiplication by a fraction of `1`.
* For example, `a * 1` in `a * 1 / b` is technically multiplication by `1`, but the
* whole expression can be logically interpreted as `a * (1 / b)` rather than `(a * 1) / b`.
* @param {BinaryExpression} node A BinaryExpression node to check.
* @param {SourceCode} sourceCode The source code object.
* @returns {boolean} Whether or not the node is a multiplying by a fraction of `1`.
*/
function isMultiplyByFractionOfOne(node, sourceCode) {
return (
node.type === "BinaryExpression" &&
node.operator === "*" &&
node.right.type === "Literal" &&
node.right.value === 1 &&
node.parent.type === "BinaryExpression" &&
node.parent.operator === "/" &&
node.parent.left === node &&
!astUtils.isParenthesised(sourceCode, node)
);
}
/**
* Checks whether the result of a node is numeric or not
* @param {ASTNode} node The node to test
* @returns {boolean} true if the node is a number literal or a `Number()`, `parseInt` or `parseFloat` call
*/
function isNumeric(node) {
return (
(node.type === "Literal" && typeof node.value === "number") ||
(node.type === "CallExpression" &&
(node.callee.name === "Number" ||
node.callee.name === "parseInt" ||
node.callee.name === "parseFloat"))
);
}
/**
* Returns the first non-numeric operand in a BinaryExpression. Designed to be
* used from bottom to up since it walks up the BinaryExpression trees using
* node.parent to find the result.
* @param {BinaryExpression} node The BinaryExpression node to be walked up on
* @returns {ASTNode|null} The first non-numeric item in the BinaryExpression tree or null
*/
function getNonNumericOperand(node) {
const left = node.left,
right = node.right;
if (right.type !== "BinaryExpression" && !isNumeric(right)) {
return right;
}
if (left.type !== "BinaryExpression" && !isNumeric(left)) {
return left;
}
return null;
}
/**
* Checks whether an expression evaluates to a string.
* @param {ASTNode} node node that represents the expression to check.
* @returns {boolean} Whether or not the expression evaluates to a string.
*/
function isStringType(node) {
return (
astUtils.isStringLiteral(node) ||
(node.type === "CallExpression" &&
node.callee.type === "Identifier" &&
node.callee.name === "String")
);
}
/**
* Checks whether a node is an empty string literal or not.
* @param {ASTNode} node The node to check.
* @returns {boolean} Whether or not the passed in node is an
* empty string literal or not.
*/
function isEmptyString(node) {
return (
astUtils.isStringLiteral(node) &&
(node.value === "" ||
(node.type === "TemplateLiteral" &&
node.quasis.length === 1 &&
node.quasis[0].value.cooked === ""))
);
}
/**
* Checks whether or not a node is a concatenating with an empty string.
* @param {ASTNode} node A BinaryExpression node to check.
* @returns {boolean} Whether or not the node is a concatenating with an empty string.
*/
function isConcatWithEmptyString(node) {
return (
node.operator === "+" &&
((isEmptyString(node.left) && !isStringType(node.right)) ||
(isEmptyString(node.right) && !isStringType(node.left)))
);
}
/**
* Checks whether or not a node is appended with an empty string.
* @param {ASTNode} node An AssignmentExpression node to check.
* @returns {boolean} Whether or not the node is appended with an empty string.
*/
function isAppendEmptyString(node) {
return node.operator === "+=" && isEmptyString(node.right);
}
/**
* Returns the operand that is not an empty string from a flagged BinaryExpression.
* @param {ASTNode} node The flagged BinaryExpression node to check.
* @returns {ASTNode} The operand that is not an empty string from a flagged BinaryExpression.
*/
function getNonEmptyOperand(node) {
return isEmptyString(node.left) ? node.right : node.left;
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
hasSuggestions: true,
type: "suggestion",
docs: {
description: "Disallow shorthand type conversions",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/no-implicit-coercion",
},
fixable: "code",
schema: [
{
type: "object",
properties: {
boolean: {
type: "boolean",
},
number: {
type: "boolean",
},
string: {
type: "boolean",
},
disallowTemplateShorthand: {
type: "boolean",
},
allow: {
type: "array",
items: {
enum: ALLOWABLE_OPERATORS,
},
uniqueItems: true,
},
},
additionalProperties: false,
},
],
defaultOptions: [
{
allow: [],
boolean: true,
disallowTemplateShorthand: false,
number: true,
string: true,
},
],
messages: {
implicitCoercion:
"Unexpected implicit coercion encountered. Use `{{recommendation}}` instead.",
useRecommendation: "Use `{{recommendation}}` instead.",
},
},
create(context) {
const [options] = context.options;
const sourceCode = context.sourceCode;
/**
* Reports an error and autofixes the node
* @param {ASTNode} node An ast node to report the error on.
* @param {string} recommendation The recommended code for the issue
* @param {bool} shouldSuggest Whether this report should offer a suggestion
* @param {bool} shouldFix Whether this report should fix the node
* @returns {void}
*/
function report(node, recommendation, shouldSuggest, shouldFix) {
/**
* Fix function
* @param {RuleFixer} fixer The fixer to fix.
* @returns {Fix} The fix object.
*/
function fix(fixer) {
const tokenBefore = sourceCode.getTokenBefore(node);
if (
tokenBefore?.range[1] === node.range[0] &&
!astUtils.canTokensBeAdjacent(tokenBefore, recommendation)
) {
return fixer.replaceText(node, ` ${recommendation}`);
}
return fixer.replaceText(node, recommendation);
}
context.report({
node,
messageId: "implicitCoercion",
data: { recommendation },
fix(fixer) {
if (!shouldFix) {
return null;
}
return fix(fixer);
},
suggest: [
{
messageId: "useRecommendation",
data: { recommendation },
fix(fixer) {
if (shouldFix || !shouldSuggest) {
return null;
}
return fix(fixer);
},
},
],
});
}
return {
UnaryExpression(node) {
let operatorAllowed;
// !!foo
operatorAllowed = options.allow.includes("!!");
if (
!operatorAllowed &&
options.boolean &&
isDoubleLogicalNegating(node)
) {
const recommendation = `Boolean(${sourceCode.getText(node.argument.argument)})`;
const variable = astUtils.getVariableByName(
sourceCode.getScope(node),
"Boolean",
);
const booleanExists = variable?.identifiers.length === 0;
report(node, recommendation, true, booleanExists);
}
// ~foo.indexOf(bar)
operatorAllowed = options.allow.includes("~");
if (
!operatorAllowed &&
options.boolean &&
isBinaryNegatingOfIndexOf(node)
) {
// `foo?.indexOf(bar) !== -1` will be true (== found) if the `foo` is nullish. So use `>= 0` in that case.
const comparison =
node.argument.type === "ChainExpression"
? ">= 0"
: "!== -1";
const recommendation = `${sourceCode.getText(node.argument)} ${comparison}`;
report(node, recommendation, false, false);
}
// +foo
operatorAllowed = options.allow.includes("+");
if (
!operatorAllowed &&
options.number &&
node.operator === "+" &&
!isNumeric(node.argument)
) {
const recommendation = `Number(${sourceCode.getText(node.argument)})`;
report(node, recommendation, true, false);
}
// -(-foo)
operatorAllowed = options.allow.includes("- -");
if (
!operatorAllowed &&
options.number &&
node.operator === "-" &&
node.argument.type === "UnaryExpression" &&
node.argument.operator === "-" &&
!isNumeric(node.argument.argument)
) {
const recommendation = `Number(${sourceCode.getText(node.argument.argument)})`;
report(node, recommendation, true, false);
}
},
// Use `:exit` to prevent double reporting
"BinaryExpression:exit"(node) {
let operatorAllowed;
// 1 * foo
operatorAllowed = options.allow.includes("*");
const nonNumericOperand =
!operatorAllowed &&
options.number &&
isMultiplyByOne(node) &&
!isMultiplyByFractionOfOne(node, sourceCode) &&
getNonNumericOperand(node);
if (nonNumericOperand) {
const recommendation = `Number(${sourceCode.getText(nonNumericOperand)})`;
report(node, recommendation, true, false);
}
// foo - 0
operatorAllowed = options.allow.includes("-");
if (
!operatorAllowed &&
options.number &&
node.operator === "-" &&
node.right.type === "Literal" &&
node.right.value === 0 &&
!isNumeric(node.left)
) {
const recommendation = `Number(${sourceCode.getText(node.left)})`;
report(node, recommendation, true, false);
}
// "" + foo
operatorAllowed = options.allow.includes("+");
if (
!operatorAllowed &&
options.string &&
isConcatWithEmptyString(node)
) {
const recommendation = `String(${sourceCode.getText(getNonEmptyOperand(node))})`;
report(node, recommendation, true, false);
}
},
AssignmentExpression(node) {
// foo += ""
const operatorAllowed = options.allow.includes("+");
if (
!operatorAllowed &&
options.string &&
isAppendEmptyString(node)
) {
const code = sourceCode.getText(getNonEmptyOperand(node));
const recommendation = `${code} = String(${code})`;
report(node, recommendation, true, false);
}
},
TemplateLiteral(node) {
if (!options.disallowTemplateShorthand) {
return;
}
// tag`${foo}`
if (node.parent.type === "TaggedTemplateExpression") {
return;
}
// `` or `${foo}${bar}`
if (node.expressions.length !== 1) {
return;
}
// `prefix${foo}`
if (node.quasis[0].value.cooked !== "") {
return;
}
// `${foo}postfix`
if (node.quasis[1].value.cooked !== "") {
return;
}
// if the expression is already a string, then this isn't a coercion
if (isStringType(node.expressions[0])) {
return;
}
const code = sourceCode.getText(node.expressions[0]);
const recommendation = `String(${code})`;
report(node, recommendation, true, false);
},
};
},
};
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_A","16":"FD","132":"_RC"},B:{"1":"_J"},C:{"1":"_iT _XC","2":"_PS"},D:{"1":"_Q"},E:{"1":"_DB","2":"_e"},F:{"1":"_zG","16":"_mB"},G:{"1":"_eB","16":"lC"},H:{"1":"1D"},I:{"1":"_SB","16":"_m"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:4,C:"Element.insertAdjacentHTML()",D:true};
@@ -0,0 +1,12 @@
import { getType } from "./getType.mjs";
import { isObject } from "./isObject.mjs";
function isPlainObject(value) {
if (!isObject(value) || getType(value) !== "Object") {
return false;
}
const prototype = Object.getPrototypeOf(value);
return prototype === null || prototype === Object.prototype;
}
export {
isPlainObject
};
@@ -0,0 +1,895 @@
'use strict';
var levn = require('levn');
/**
* @fileoverview Config Comment Parser
* @author Nicholas C. Zakas
*/
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/** @import * as $eslintcore from "@eslint/core"; */
/** @typedef {$eslintcore.RuleConfig} RuleConfig */
/** @typedef {$eslintcore.RulesConfig} RulesConfig */
/** @import * as $typests from "./types.ts"; */
/** @typedef {$typests.StringConfig} StringConfig */
/** @typedef {$typests.BooleanConfig} BooleanConfig */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const directivesPattern = /^([a-z]+(?:-[a-z]+)*)(?:\s|$)/u;
const validSeverities = new Set([0, 1, 2, "off", "warn", "error"]);
/**
* Determines if the severity in the rule configuration is valid.
* @param {RuleConfig} ruleConfig A rule's configuration.
* @returns {boolean} `true` if the severity is valid, otherwise `false`.
*/
function isSeverityValid(ruleConfig) {
const severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
return validSeverities.has(severity);
}
/**
* Determines if all severities in the rules configuration are valid.
* @param {RulesConfig} rulesConfig The rules configuration to check.
* @returns {boolean} `true` if all severities are valid, otherwise `false`.
*/
function isEverySeverityValid(rulesConfig) {
return Object.values(rulesConfig).every(isSeverityValid);
}
/**
* Represents a directive comment.
*/
class DirectiveComment {
/**
* The label of the directive, such as "eslint", "eslint-disable", etc.
* @type {string}
*/
label = "";
/**
* The value of the directive (the string after the label).
* @type {string}
*/
value = "";
/**
* The justification of the directive (the string after the --).
* @type {string}
*/
justification = "";
/**
* Creates a new directive comment.
* @param {string} label The label of the directive.
* @param {string} value The value of the directive.
* @param {string} justification The justification of the directive.
*/
constructor(label, value, justification) {
this.label = label;
this.value = value;
this.justification = justification;
}
}
//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------
/**
* Object to parse ESLint configuration comments.
*/
class ConfigCommentParser {
/**
* Parses a list of "name:string_value" or/and "name" options divided by comma or
* whitespace. Used for "global" comments.
* @param {string} string The string to parse.
* @returns {StringConfig} Result map object of names and string values, or null values if no value was provided.
*/
parseStringConfig(string) {
const items = /** @type {StringConfig} */ ({});
// Collapse whitespace around `:` and `,` to make parsing easier
const trimmedString = string
.trim()
.replace(/(?<!\s)\s*([:,])\s*/gu, "$1");
trimmedString.split(/\s|,+/u).forEach(name => {
if (!name) {
return;
}
// value defaults to null (if not provided), e.g: "foo" => ["foo", null]
const [key, value = null] = name.split(":");
items[key] = value;
});
return items;
}
/**
* Parses a JSON-like config.
* @param {string} string The string to parse.
* @returns {({ok: true, config: RulesConfig}|{ok: false, error: {message: string}})} Result map object
*/
parseJSONLikeConfig(string) {
// Parses a JSON-like comment by the same way as parsing CLI option.
try {
const items =
/** @type {RulesConfig} */ (levn.parse("Object", string)) || {};
/*
* When the configuration has any invalid severities, it should be completely
* ignored. This is because the configuration is not valid and should not be
* applied.
*
* For example, the following configuration is invalid:
*
* "no-alert: 2 no-console: 2"
*
* This results in a configuration of { "no-alert": "2 no-console: 2" }, which is
* not valid. In this case, the configuration should be ignored.
*/
if (isEverySeverityValid(items)) {
return {
ok: true,
config: items,
};
}
} catch {
// levn parsing error: ignore to parse the string by a fallback.
}
/*
* Optionator cannot parse commaless notations.
* But we are supporting that. So this is a fallback for that.
*/
const normalizedString = string
.replace(/(?<![-a-zA-Z0-9/])([-a-zA-Z0-9/]+):/gu, '"$1":')
.replace(/([\]0-9])\s+(?=")/u, "$1,");
try {
const items = JSON.parse(`{${normalizedString}}`);
return {
ok: true,
config: items,
};
} catch (ex) {
const errorMessage = ex instanceof Error ? ex.message : String(ex);
return {
ok: false,
error: {
message: `Failed to parse JSON from '${normalizedString}': ${errorMessage}`,
},
};
}
}
/**
* Parses a config of values separated by comma.
* @param {string} string The string to parse.
* @returns {BooleanConfig} Result map of values and true values
*/
parseListConfig(string) {
const items = /** @type {BooleanConfig} */ ({});
string.split(",").forEach(name => {
const trimmedName = name
.trim()
.replace(
/^(?<quote>['"]?)(?<ruleId>.*)\k<quote>$/su,
"$<ruleId>",
);
if (trimmedName) {
items[trimmedName] = true;
}
});
return items;
}
/**
* Extract the directive and the justification from a given directive comment and trim them.
* @param {string} value The comment text to extract.
* @returns {{directivePart: string, justificationPart: string}} The extracted directive and justification.
*/
#extractDirectiveComment(value) {
const match = /\s-{2,}\s/u.exec(value);
if (!match) {
return { directivePart: value.trim(), justificationPart: "" };
}
const directive = value.slice(0, match.index).trim();
const justification = value.slice(match.index + match[0].length).trim();
return { directivePart: directive, justificationPart: justification };
}
/**
* Parses a directive comment into directive text and value.
* @param {string} string The string with the directive to be parsed.
* @returns {DirectiveComment|undefined} The parsed directive or `undefined` if the directive is invalid.
*/
parseDirective(string) {
const { directivePart, justificationPart } =
this.#extractDirectiveComment(string);
const match = directivesPattern.exec(directivePart);
if (!match) {
return undefined;
}
const directiveText = match[1];
const directiveValue = directivePart.slice(
match.index + directiveText.length,
);
return new DirectiveComment(
directiveText,
directiveValue.trim(),
justificationPart,
);
}
}
/**
* @fileoverview A collection of helper classes for implementing `SourceCode`.
* @author Nicholas C. Zakas
*/
/* eslint class-methods-use-this: off -- Required to complete interface. */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/** @typedef {$eslintcore.VisitTraversalStep} VisitTraversalStep */
/** @typedef {$eslintcore.CallTraversalStep} CallTraversalStep */
/** @typedef {$eslintcore.TraversalStep} TraversalStep */
/** @typedef {$eslintcore.SourceLocation} SourceLocation */
/** @typedef {$eslintcore.SourceLocationWithOffset} SourceLocationWithOffset */
/** @typedef {$eslintcore.SourceRange} SourceRange */
/** @typedef {$eslintcore.Directive} IDirective */
/** @typedef {$eslintcore.DirectiveType} DirectiveType */
/** @typedef {$eslintcore.SourceCodeBaseTypeOptions} SourceCodeBaseTypeOptions */
/**
* @typedef {import("@eslint/core").TextSourceCode<Options>} TextSourceCode
* @template {SourceCodeBaseTypeOptions} [Options=SourceCodeBaseTypeOptions]
*/
/** @typedef {$eslintcore.RuleVisitor} RuleVisitor */
/**
* @typedef {import("./types.ts").CustomRuleVisitorWithExit<RuleVisitorType>} CustomRuleVisitorWithExit
* @template {RuleVisitor} RuleVisitorType
*/
/** @typedef {$typests.CustomRuleTypeDefinitions} CustomRuleTypeDefinitions */
/**
* @typedef {import("./types.ts").CustomRuleDefinitionType<LanguageSpecificOptions, Options>} CustomRuleDefinitionType
* @template {Omit<import("@eslint/core").RuleDefinitionTypeOptions, keyof CustomRuleTypeDefinitions>} LanguageSpecificOptions
* @template {Partial<CustomRuleTypeDefinitions>} Options
*/
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/**
* Determines if a node has ESTree-style loc information.
* @param {object} node The node to check.
* @returns {node is {loc:SourceLocation}} `true` if the node has ESTree-style loc information, `false` if not.
*/
function hasESTreeStyleLoc(node) {
return "loc" in node;
}
/**
* Determines if a node has position-style loc information.
* @param {object} node The node to check.
* @returns {node is {position:SourceLocation}} `true` if the node has position-style range information, `false` if not.
*/
function hasPosStyleLoc(node) {
return "position" in node;
}
/**
* Determines if a node has ESTree-style range information.
* @param {object} node The node to check.
* @returns {node is {range:SourceRange}} `true` if the node has ESTree-style range information, `false` if not.
*/
function hasESTreeStyleRange(node) {
return "range" in node;
}
/**
* Determines if a node has position-style range information.
* @param {object} node The node to check.
* @returns {node is {position:SourceLocationWithOffset}} `true` if the node has position-style range information, `false` if not.
*/
function hasPosStyleRange(node) {
return "position" in node;
}
/**
* Performs binary search to find the line number containing a given target index.
* Returns the lower bound - the index of the first element greater than the target.
* **Please note that the `lineStartIndices` should be sorted in ascending order**.
* - Time Complexity: O(log n) - Significantly faster than linear search for large files.
* @param {number[]} lineStartIndices Sorted array of line start indices.
* @param {number} targetIndex The target index to find the line number for.
* @returns {number} The line number for the target index.
*/
function findLineNumberBinarySearch(lineStartIndices, targetIndex) {
let low = 0;
let high = lineStartIndices.length - 1;
while (low < high) {
const mid = ((low + high) / 2) | 0; // Use bitwise OR to floor the division.
if (targetIndex < lineStartIndices[mid]) {
high = mid;
} else {
low = mid + 1;
}
}
return low;
}
//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------
/**
* A class to represent a step in the traversal process where a node is visited.
* @implements {VisitTraversalStep}
*/
class VisitNodeStep {
/**
* The type of the step.
* @type {"visit"}
* @readonly
*/
type = "visit";
/**
* The kind of the step. Represents the same data as the `type` property
* but it's a number for performance.
* @type {1}
* @readonly
*/
kind = 1;
/**
* The target of the step.
* @type {object}
*/
target;
/**
* The phase of the step.
* @type {1|2}
*/
phase;
/**
* The arguments of the step.
* @type {Array<any>}
*/
args;
/**
* Creates a new instance.
* @param {Object} options The options for the step.
* @param {object} options.target The target of the step.
* @param {1|2} options.phase The phase of the step.
* @param {Array<any>} options.args The arguments of the step.
*/
constructor({ target, phase, args }) {
this.target = target;
this.phase = phase;
this.args = args;
}
}
/**
* A class to represent a step in the traversal process where a
* method is called.
* @implements {CallTraversalStep}
*/
class CallMethodStep {
/**
* The type of the step.
* @type {"call"}
* @readonly
*/
type = "call";
/**
* The kind of the step. Represents the same data as the `type` property
* but it's a number for performance.
* @type {2}
* @readonly
*/
kind = 2;
/**
* The name of the method to call.
* @type {string}
*/
target;
/**
* The arguments to pass to the method.
* @type {Array<any>}
*/
args;
/**
* Creates a new instance.
* @param {Object} options The options for the step.
* @param {string} options.target The target of the step.
* @param {Array<any>} options.args The arguments of the step.
*/
constructor({ target, args }) {
this.target = target;
this.args = args;
}
}
/**
* A class to represent a directive comment.
* @implements {IDirective}
*/
class Directive {
/**
* The type of directive.
* @type {DirectiveType}
* @readonly
*/
type;
/**
* The node representing the directive.
* @type {unknown}
* @readonly
*/
node;
/**
* Everything after the "eslint-disable" portion of the directive,
* but before the "--" that indicates the justification.
* @type {string}
* @readonly
*/
value;
/**
* The justification for the directive.
* @type {string}
* @readonly
*/
justification;
/**
* Creates a new instance.
* @param {Object} options The options for the directive.
* @param {"disable"|"enable"|"disable-next-line"|"disable-line"} options.type The type of directive.
* @param {unknown} options.node The node representing the directive.
* @param {string} options.value The value of the directive.
* @param {string} options.justification The justification for the directive.
*/
constructor({ type, node, value, justification }) {
this.type = type;
this.node = node;
this.value = value;
this.justification = justification;
}
}
/**
* Source Code Base Object
* @template {SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}} [Options=SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}]
* @implements {TextSourceCode<Options>}
*/
class TextSourceCodeBase {
/**
* The lines of text in the source code.
* @type {Array<string>}
*/
#lines = [];
/**
* The indices of the start of each line in the source code.
* @type {Array<number>}
*/
#lineStartIndices = [0];
/**
* The pattern to match lineEndings in the source code.
* @type {RegExp}
*/
#lineEndingPattern;
/**
* The AST of the source code.
* @type {Options['RootNode']}
*/
ast;
/**
* The text of the source code.
* @type {string}
*/
text;
/**
* Creates a new instance.
* @param {Object} options The options for the instance.
* @param {string} options.text The source code text.
* @param {Options['RootNode']} options.ast The root AST node.
* @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code. Defaults to `/\r?\n/u`.
*/
constructor({ text, ast, lineEndingPattern = /\r?\n/u }) {
this.ast = ast;
this.text = text;
// Remove the global(`g`) and sticky(`y`) flags from the `lineEndingPattern` to avoid issues with lastIndex.
this.#lineEndingPattern = new RegExp(
lineEndingPattern.source,
lineEndingPattern.flags.replace(/[gy]/gu, ""),
);
}
/**
* Finds the next line in the source text and updates `#lines` and `#lineStartIndices`.
* @param {string} text The text to search for the next line.
* @returns {boolean} `true` if a next line was found, `false` otherwise.
*/
#findNextLine(text) {
const match = this.#lineEndingPattern.exec(text);
if (!match) {
return false;
}
this.#lines.push(text.slice(0, match.index));
this.#lineStartIndices.push(
(this.#lineStartIndices.at(-1) ?? 0) +
match.index +
match[0].length,
);
return true;
}
/**
* Ensures `#lines` is lazily calculated from the source text.
* @returns {void}
*/
#ensureLines() {
// If `#lines` has already been calculated, do nothing.
if (this.#lines.length === this.#lineStartIndices.length) {
return;
}
while (
this.#findNextLine(this.text.slice(this.#lineStartIndices.at(-1)))
) {
// Continue parsing until no more matches are found.
}
this.#lines.push(this.text.slice(this.#lineStartIndices.at(-1)));
Object.freeze(this.#lines);
}
/**
* Ensures `#lineStartIndices` is lazily calculated up to the specified index.
* @param {number} index The index of a character in a file.
* @returns {void}
*/
#ensureLineStartIndicesFromIndex(index) {
// If we've already parsed up to or beyond this index, do nothing.
if (index <= (this.#lineStartIndices.at(-1) ?? 0)) {
return;
}
while (
index > (this.#lineStartIndices.at(-1) ?? 0) &&
this.#findNextLine(this.text.slice(this.#lineStartIndices.at(-1)))
) {
// Continue parsing until no more matches are found.
}
}
/**
* Ensures `#lineStartIndices` is lazily calculated up to the specified loc.
* @param {Object} loc A line/column location.
* @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
* @param {number} lineStart The line number at which the parser starts counting.
* @returns {void}
*/
#ensureLineStartIndicesFromLoc(loc, lineStart) {
// Calculate line indices up to the potentially next line, as it is needed for the follow‑up calculation.
const nextLocLineIndex = loc.line - lineStart + 1;
const lastCalculatedLineIndex = this.#lineStartIndices.length - 1;
let additionalLinesNeeded = nextLocLineIndex - lastCalculatedLineIndex;
// If we've already parsed up to or beyond this line, do nothing.
if (additionalLinesNeeded <= 0) {
return;
}
while (
additionalLinesNeeded > 0 &&
this.#findNextLine(this.text.slice(this.#lineStartIndices.at(-1)))
) {
// Continue parsing until no more matches are found or we have enough lines.
additionalLinesNeeded -= 1;
}
}
/**
* Returns the loc information for the given node or token.
* @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the loc information for.
* @returns {SourceLocation} The loc information for the node or token.
* @throws {Error} If the node or token does not have loc information.
*/
getLoc(nodeOrToken) {
if (hasESTreeStyleLoc(nodeOrToken)) {
return nodeOrToken.loc;
}
if (hasPosStyleLoc(nodeOrToken)) {
return nodeOrToken.position;
}
throw new Error(
"Custom getLoc() method must be implemented in the subclass.",
);
}
/**
* Converts a source text index into a `{ line: number, column: number }` pair.
* @param {number} index The index of a character in a file.
* @throws {TypeError|RangeError} If non-numeric index or index out of range.
* @returns {{line: number, column: number}} A `{ line: number, column: number }` location object with 0 or 1-indexed line and 0 or 1-indexed column based on language.
* @public
*/
getLocFromIndex(index) {
if (typeof index !== "number") {
throw new TypeError("Expected `index` to be a number.");
}
if (index < 0 || index > this.text.length) {
throw new RangeError(
`Index out of range (requested index ${index}, but source text has length ${this.text.length}).`,
);
}
const {
start: { line: lineStart, column: columnStart },
end: { line: lineEnd, column: columnEnd },
} = this.getLoc(this.ast);
// If the index is at the start, return the start location of the root node.
if (index === 0) {
return {
line: lineStart,
column: columnStart,
};
}
// If the index is `this.text.length`, return the location one "spot" past the last character of the file.
if (index === this.text.length) {
return {
line: lineEnd,
column: columnEnd,
};
}
// Ensure `#lineStartIndices` are lazily calculated.
this.#ensureLineStartIndicesFromIndex(index);
/*
* To figure out which line `index` is on, determine the last place at which index could
* be inserted into `#lineStartIndices` to keep the list sorted.
*/
const lineNumber =
(index >= (this.#lineStartIndices.at(-1) ?? 0)
? this.#lineStartIndices.length
: findLineNumberBinarySearch(this.#lineStartIndices, index)) -
1 +
lineStart;
return {
line: lineNumber,
column:
index -
this.#lineStartIndices[lineNumber - lineStart] +
columnStart,
};
}
/**
* Converts a `{ line: number, column: number }` pair into a source text index.
* @param {Object} loc A line/column location.
* @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
* @param {number} loc.column The column number of the location. (0 or 1-indexed based on language.)
* @throws {TypeError|RangeError} If `loc` is not an object with a numeric
* `line` and `column`, if the `line` is less than or equal to zero or
* the `line` or `column` is out of the expected range.
* @returns {number} The index of the line/column location in a file.
* @public
*/
getIndexFromLoc(loc) {
if (
loc === null ||
typeof loc !== "object" ||
typeof loc.line !== "number" ||
typeof loc.column !== "number"
) {
throw new TypeError(
"Expected `loc` to be an object with numeric `line` and `column` properties.",
);
}
const {
start: { line: lineStart, column: columnStart },
end: { line: lineEnd, column: columnEnd },
} = this.getLoc(this.ast);
if (loc.line < lineStart || lineEnd < loc.line) {
throw new RangeError(
`Line number out of range (line ${loc.line} requested). Valid range: ${lineStart}-${lineEnd}`,
);
}
// If the loc is at the start, return the start index of the root node.
if (loc.line === lineStart && loc.column === columnStart) {
return 0;
}
// If the loc is at the end, return the index one "spot" past the last character of the file.
if (loc.line === lineEnd && loc.column === columnEnd) {
return this.text.length;
}
// Ensure `#lineStartIndices` are lazily calculated.
this.#ensureLineStartIndicesFromLoc(loc, lineStart);
const isLastLine = loc.line === lineEnd;
const lineStartIndex = this.#lineStartIndices[loc.line - lineStart];
const lineEndIndex = isLastLine
? this.text.length
: this.#lineStartIndices[loc.line - lineStart + 1];
const positionIndex = lineStartIndex + loc.column - columnStart;
if (
loc.column < columnStart ||
(isLastLine && positionIndex > lineEndIndex) ||
(!isLastLine && positionIndex >= lineEndIndex)
) {
throw new RangeError(
`Column number out of range (column ${loc.column} requested). Valid range for line ${loc.line}: ${columnStart}-${lineEndIndex - lineStartIndex + columnStart + (isLastLine ? 0 : -1)}`,
);
}
return positionIndex;
}
/**
* Returns the range information for the given node or token.
* @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the range information for.
* @returns {SourceRange} The range information for the node or token.
* @throws {Error} If the node or token does not have range information.
*/
getRange(nodeOrToken) {
if (hasESTreeStyleRange(nodeOrToken)) {
return nodeOrToken.range;
}
if (hasPosStyleRange(nodeOrToken)) {
return [
nodeOrToken.position.start.offset,
nodeOrToken.position.end.offset,
];
}
throw new Error(
"Custom getRange() method must be implemented in the subclass.",
);
}
/* eslint-disable no-unused-vars -- Required to complete interface. */
/**
* Returns the parent of the given node.
* @param {Options['SyntaxElementWithLoc']} node The node to get the parent of.
* @returns {Options['SyntaxElementWithLoc']|undefined} The parent of the node.
* @throws {Error} If the method is not implemented in the subclass.
*/
getParent(node) {
throw new Error("Not implemented.");
}
/* eslint-enable no-unused-vars -- Required to complete interface. */
/**
* Gets all the ancestors of a given node
* @param {Options['SyntaxElementWithLoc']} node The node
* @returns {Array<Options['SyntaxElementWithLoc']>} All the ancestor nodes in the AST, not including the provided node, starting
* from the root node at index 0 and going inwards to the parent node.
* @throws {TypeError} When `node` is missing.
*/
getAncestors(node) {
if (!node) {
throw new TypeError("Missing required argument: node.");
}
const ancestorsStartingAtParent = [];
for (
let ancestor = this.getParent(node);
ancestor;
ancestor = this.getParent(ancestor)
) {
ancestorsStartingAtParent.push(ancestor);
}
return ancestorsStartingAtParent.reverse();
}
/**
* Gets the source code for the given node.
* @param {Options['SyntaxElementWithLoc']} [node] The AST node to get the text for.
* @param {number} [beforeCount] The number of characters before the node to retrieve.
* @param {number} [afterCount] The number of characters after the node to retrieve.
* @returns {string} The text representing the AST node.
* @public
*/
getText(node, beforeCount, afterCount) {
if (node) {
const range = this.getRange(node);
return this.text.slice(
Math.max(range[0] - (beforeCount || 0), 0),
range[1] + (afterCount || 0),
);
}
return this.text;
}
/**
* Gets the entire source text split into an array of lines.
* @returns {Array<string>} The source text as an array of lines.
* @public
*/
get lines() {
this.#ensureLines(); // Ensure `#lines` is lazily calculated.
return this.#lines;
}
/**
* Traverse the source code and return the steps that were taken.
* @returns {Iterable<TraversalStep>} The steps that were taken while traversing the source code.
*/
traverse() {
throw new Error("Not implemented.");
}
}
exports.CallMethodStep = CallMethodStep;
exports.ConfigCommentParser = ConfigCommentParser;
exports.Directive = Directive;
exports.TextSourceCodeBase = TextSourceCodeBase;
exports.VisitNodeStep = VisitNodeStep;
@@ -0,0 +1 @@
{"version":3,"file":"book-open-check.js","sources":["../../../src/icons/book-open-check.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BookOpenCheck\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMjFWNyIgLz4KICA8cGF0aCBkPSJtMTYgMTIgMiAyIDQtNCIgLz4KICA8cGF0aCBkPSJNMjIgNlY0YTEgMSAwIDAgMC0xLTFoLTVhNCA0IDAgMCAwLTQgNCA0IDQgMCAwIDAtNC00SDNhMSAxIDAgMCAwLTEgMXYxM2ExIDEgMCAwIDAgMSAxaDZhMyAzIDAgMCAxIDMgMyAzIDMgMCAwIDEgMy0zaDZhMSAxIDAgMCAwIDEtMXYtMS4zIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/book-open-check\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 BookOpenCheck = createLucideIcon('BookOpenCheck', [\n ['path', { d: 'M12 21V7', key: 'gj6g52' }],\n ['path', { d: 'm16 12 2 2 4-4', key: 'mdajum' }],\n [\n 'path',\n {\n d: 'M22 6V4a1 1 0 0 0-1-1h-5a4 4 0 0 0-4 4 4 4 0 0 0-4-4H3a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h6a3 3 0 0 1 3 3 3 3 0 0 1 3-3h6a1 1 0 0 0 1-1v-1.3',\n key: '8arnkb',\n },\n ],\n]);\n\nexport default BookOpenCheck;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAkB,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,CAC/C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;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,615 @@
export default `flf2a$ 6 5 15 1 1
rectangles.flf by David Villegas <mnementh@netcom.com> 12/94
$$@
$$@
$$@
$$@
$$@
$$@@
__ @
| |@
| |@
|__|@
|__|@
@@
_ _ @
| | |@
|_|_|@
$$$ @
$$$ @
$$$ @@
_ _ @
_| | |_ @
|_ _|@
|_ _|@
|_|_| @
@@
_ @
_| |_ @
| __|@
|__ |@
|_ _|@
|_| @@
@
__ __ @
|__| |@
| __|@
|__|__|@
@@
_ @
_| |_ @
| __|@
| __|@
|_ _|@
|_| @@
_ @
| |@
|_|@
$ @
$ @
$ @@
_ @
_|_|@
| | @
| | @
|_|_ @
|_|@@
_ @
|_|_ @
| |@
| |@
_|_|@
|_| @@
@
_____ @
| | | |@
|- -|@
|_|_|_|@
@@
@
_ @
_| |_ @
|_ _|@
|_| @
@@
$ @
$ @
$ @
_ @
| |@
|_|@@
$$$ @
$$$ @
___ @
|___|@
$$$ @
$$$ @@
$ @
$ @
$ @
_ @
|_|@
$ @@
@
_ @
/ |@
/ / @
|_/ @
@@
@
___ @
| |@
| | |@
|___|@
@@
@
___ @
|_ | @
_| |_ @
|_____|@
@@
@
___ @
|_ |@
| _|@
|___|@
@@
@
___ @
|_ |@
|_ |@
|___|@
@@
@
___ @
| | |@
|_ |@
|_|@
@@
@
___ @
| _|@
|_ |@
|___|@
@@
@
___ @
| _|@
| . |@
|___|@
@@
@
___ @
|_ |@
| |@
|_|@
@@
@
___ @
| . |@
| . |@
|___|@
@@
@
___ @
| . |@
|_ |@
|___|@
@@
@
_ @
|_|@
_ @
|_|@
@@
@
_ @
|_|@
_ @
| |@
|_|@@
__@
/ /@
/ / @
< < @
\\ \\ @
\\_\\@@
$$$$$ @
$$$$$ @
_____ @
|_____|@
|_____|@
$$$$$ @@
__ @
\\ \\ @
\\ \\ @
> >@
/ / @
/_/ @@
_____ @
|___ |@
| _|@
|_| @
|_| @
@@
@
_____ @
| __ |@
| |___|@
|_____|@
@@
@
_____ @
| _ |@
| |@
|__|__|@
@@
@
_____ @
| __ |@
| __ -|@
|_____|@
@@
@
_____ @
| |@
| --|@
|_____|@
@@
@
____ @
| \\ @
| | |@
|____/ @
@@
@
_____ @
| __|@
| __|@
|_____|@
@@
@
_____ @
| __|@
| __|@
|__| @
@@
@
_____ @
| __|@
| | |@
|_____|@
@@
@
_____ @
| | |@
| |@
|__|__|@
@@
@
_____ @
| |@
|- -|@
|_____|@
@@
@
__ @
__| |@
| | |@
|_____|@
@@
@
_____ @
| | |@
| -|@
|__|__|@
@@
@
__ @
| | @
| |__ @
|_____|@
@@
@
_____ @
| |@
| | | |@
|_|_|_|@
@@
@
_____ @
| | |@
| | | |@
|_|___|@
@@
@
_____ @
| |@
| | |@
|_____|@
@@
@
_____ @
| _ |@
| __|@
|__| @
@@
@
_____ @
| |@
| | |@
|__ _|@
|__|@@
@
_____ @
| __ |@
| -|@
|__|__|@
@@
@
_____ @
| __|@
|__ |@
|_____|@
@@
@
_____ @
|_ _|@
| | @
|_| @
@@
@
_____ @
| | |@
| | |@
|_____|@
@@
@
_____ @
| | |@
| | |@
\\___/ @
@@
@
_ _ _ @
| | | |@
| | | |@
|_____|@
@@
@
__ __ @
| | |@
|- -|@
|__|__|@
@@
@
__ __ @
| | |@
|_ _|@
|_| @
@@
@
_____ @
|__ |@
| __|@
|_____|@
@@
___ @
| _|@
| | @
| | @
| |_ @
|___|@@
@
_ @
| \\ @
\\ \\ @
\\_|@
@@
___ @
|_ |@
| |@
| |@
_| |@
|___|@@
_____ @
| _ |@
|_| |_|@
$$$$$ @
$$$$$ @
$$$$$ @@
$$$$$ @
$$$$$ @
$$$$$ @
$$$$$ @
_____ @
|_____|@@
___ @
|_ |@
|_|@
$$$ @
$$$ @
$$$ @@
@
@
___ @
| .'|@
|__,|@
@@
@
_ @
| |_ @
| . |@
|___|@
@@
@
@
___ @
| _|@
|___|@
@@
@
_ @
_| |@
| . |@
|___|@
@@
@
@
___ @
| -_|@
|___|@
@@
@
___ @
| _|@
| _|@
|_| @
@@
@
@
___ @
| . |@
|_ |@
|___|@@
@
_ @
| |_ @
| |@
|_|_|@
@@
@
_ @
|_|@
| |@
|_|@
@@
@
_ @
|_|@
| |@
_| |@
|___|@@
@
_ @
| |_ @
| '_|@
|_,_|@
@@
@
_ @
| |@
| |@
|_|@
@@
@
@
_____ @
| |@
|_|_|_|@
@@
@
@
___ @
| |@
|_|_|@
@@
@
@
___ @
| . |@
|___|@
@@
@
@
___ @
| . |@
| _|@
|_| @@
@
@
___ @
| . |@
|_ |@
|_|@@
@
@
___ @
| _|@
|_| @
@@
@
@
___ @
|_ -|@
|___|@
@@
@
_ @
| |_ @
| _|@
|_| @
@@
@
@
_ _ @
| | |@
|___|@
@@
@
@
_ _ @
| | |@
\\_/ @
@@
@
@
_ _ _ @
| | | |@
|_____|@
@@
@
@
_ _ @
|_'_|@
|_,_|@
@@
@
@
_ _ @
| | |@
|_ |@
|___|@@
@
@
___ @
|- _|@
|___|@
@@
___ @
| _|@
_| | @
|_ | @
| |_ @
|___|@@
_ @
| |@
| |@
| |@
| |@
|_|@@
___ @
|_ | @
| |_ @
| _|@
_| | @
|___| @@
_____ @
| | |@
|_|___|@
$$$$$ @
$$$$$ @
$$$$$ @@
__ __ @
|__|__|@
| _ |@
| |@
|__|__|@
@@
__ __ @
|__|__|@
| |@
| | |@
|_____|@
@@
__ __ @
|__|__|@
| | |@
| | |@
|_____|@
@@
_ _ @
|_|_|@
___ @
| .'|@
|__,|@
@@
_ _ @
|_|_|@
___ @
| . |@
|___|@
@@
_ _ @
|_|_|@
_ _ @
| | |@
|___|@
@@
@
_____ @
| __ |@
| __ -|@
| ___|@
|_| @@
`
@@ -0,0 +1,24 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FileStack = createLucideIcon("FileStack", [
["path", { d: "M21 7h-3a2 2 0 0 1-2-2V2", key: "9rb54x" }],
[
"path",
{
d: "M21 6v6.5c0 .8-.7 1.5-1.5 1.5h-7c-.8 0-1.5-.7-1.5-1.5v-9c0-.8.7-1.5 1.5-1.5H17Z",
key: "1059l0"
}
],
["path", { d: "M7 8v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H15", key: "16874u" }],
["path", { d: "M3 12v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H11", key: "k2ox98" }]
]);
export { FileStack as default };
//# sourceMappingURL=file-stack.js.map
@@ -0,0 +1,55 @@
/*!
* body-parser
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* @typedef {Object} Parsers
* @property {Function} json JSON parser
* @property {Function} raw Raw parser
* @property {Function} text Text parser
* @property {Function} urlencoded URL-encoded parser
*/
/**
* Module exports.
* @type {Function & Parsers}
*/
exports = module.exports = bodyParser
/**
* JSON parser.
* @public
*/
exports.json = require('./lib/types/json')
/**
* Raw parser.
* @public
*/
exports.raw = require('./lib/types/raw')
/**
* Text parser.
* @public
*/
exports.text = require('./lib/types/text')
/**
* URL-encoded parser.
* @public
*/
exports.urlencoded = require('./lib/types/urlencoded')
/**
* Create a middleware to parse json and urlencoded bodies.
*
* @deprecated
* @public
*/
function bodyParser () {
throw new Error('The bodyParser() generic has been split into individual middleware to use instead.')
}
@@ -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 Bean = createLucideIcon("Bean", [
[
"path",
{
d: "M10.165 6.598C9.954 7.478 9.64 8.36 9 9c-.64.64-1.521.954-2.402 1.165A6 6 0 0 0 8 22c7.732 0 14-6.268 14-14a6 6 0 0 0-11.835-1.402Z",
key: "1tvzk7"
}
],
["path", { d: "M5.341 10.62a4 4 0 1 0 5.279-5.28", key: "2cyri2" }]
]);
export { Bean as default };
//# sourceMappingURL=bean.js.map
@@ -0,0 +1 @@
{"version":3,"file":"pen-off.js","sources":["../../../src/icons/pen-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PenOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTAgMTAtNi4xNTcgNi4xNjJhMiAyIDAgMCAwLS41LjgzM2wtMS4zMjIgNC4zNmEuNS41IDAgMCAwIC42MjIuNjI0bDQuMzU4LTEuMzIzYTIgMiAwIDAgMCAuODMtLjVMMTQgMTMuOTgyIiAvPgogIDxwYXRoIGQ9Im0xMi44MjkgNy4xNzIgNC4zNTktNC4zNDZhMSAxIDAgMSAxIDMuOTg2IDMuOTg2bC00LjM1MyA0LjM1MyIgLz4KICA8cGF0aCBkPSJtMiAyIDIwIDIwIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/pen-off\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst PenOff = createLucideIcon('PenOff', [\n [\n 'path',\n {\n d: 'm10 10-6.157 6.162a2 2 0 0 0-.5.833l-1.322 4.36a.5.5 0 0 0 .622.624l4.358-1.323a2 2 0 0 0 .83-.5L14 13.982',\n key: 'bjo8r8',\n },\n ],\n ['path', { d: 'm12.829 7.172 4.359-4.346a1 1 0 1 1 3.986 3.986l-4.353 4.353', key: '16h5ne' }],\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n]);\n\nexport default PenOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CACxC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAAgE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC7F,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,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 Maximize2 = createLucideIcon("Maximize2", [
["polyline", { points: "15 3 21 3 21 9", key: "mznyad" }],
["polyline", { points: "9 21 3 21 3 15", key: "1avn1i" }],
["line", { x1: "21", x2: "14", y1: "3", y2: "10", key: "ota7mn" }],
["line", { x1: "3", x2: "10", y1: "21", y2: "14", key: "1atl0r" }]
]);
export { Maximize2 as default };
//# sourceMappingURL=maximize-2.js.map
@@ -0,0 +1,7 @@
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/scheduler-unstable_mock.production.js');
} else {
module.exports = require('./cjs/scheduler-unstable_mock.development.js');
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_RE","2":"C","388":"_CC"},C:{"1":"_QI","2":"_HF"},D:{"1":"_FN _SG","2":"_iJ","132":"_wK _7H"},E:{"1":"_PB","2":"_KC _UH","388":"E PD","514":"OD"},F:{"1":"_bG _vB","2":"_T","132":"_cH"},G:{"1":"_s","2":"_EB","388":"_lC"},H:{"2":"1D"},I:{"1":"_X","2":"_W"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"HTML templates",D:true};
@@ -0,0 +1,304 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _assert = require("assert");
var _t = require("@babel/types");
var _importBuilder = require("./import-builder.js");
var _isModule = require("./is-module.js");
const {
identifier,
importSpecifier,
numericLiteral,
sequenceExpression,
isImportDeclaration
} = _t;
class ImportInjector {
constructor(path, importedSource, opts) {
this._defaultOpts = {
importedSource: null,
importedType: "commonjs",
importedInterop: "babel",
importingInterop: "babel",
ensureLiveReference: false,
ensureNoContext: false,
importPosition: "before"
};
const programPath = path.find(p => p.isProgram());
this._programPath = programPath;
this._programScope = programPath.scope;
this._hub = programPath.hub;
this._defaultOpts = this._applyDefaults(importedSource, opts, true);
}
addDefault(importedSourceIn, opts) {
return this.addNamed("default", importedSourceIn, opts);
}
addNamed(importName, importedSourceIn, opts) {
_assert(typeof importName === "string");
return this._generateImport(this._applyDefaults(importedSourceIn, opts), importName);
}
addNamespace(importedSourceIn, opts) {
return this._generateImport(this._applyDefaults(importedSourceIn, opts), null);
}
addSideEffect(importedSourceIn, opts) {
return this._generateImport(this._applyDefaults(importedSourceIn, opts), void 0);
}
_applyDefaults(importedSource, opts, isInit = false) {
let newOpts;
if (typeof importedSource === "string") {
newOpts = Object.assign({}, this._defaultOpts, {
importedSource
}, opts);
} else {
_assert(!opts, "Unexpected secondary arguments.");
newOpts = Object.assign({}, this._defaultOpts, importedSource);
}
if (!isInit && opts) {
if (opts.nameHint !== undefined) newOpts.nameHint = opts.nameHint;
if (opts.blockHoist !== undefined) newOpts.blockHoist = opts.blockHoist;
}
return newOpts;
}
_generateImport(opts, importName) {
const isDefault = importName === "default";
const isNamed = !!importName && !isDefault;
const isNamespace = importName === null;
const {
importedSource,
importedType,
importedInterop,
importingInterop,
ensureLiveReference,
ensureNoContext,
nameHint,
importPosition,
blockHoist
} = opts;
let name = nameHint || importName;
const isMod = (0, _isModule.default)(this._programPath);
const isModuleForNode = isMod && importingInterop === "node";
const isModuleForBabel = isMod && importingInterop === "babel";
if (importPosition === "after" && !isMod) {
throw new Error(`"importPosition": "after" is only supported in modules`);
}
const builder = new _importBuilder.default(importedSource, this._programScope, this._hub);
if (importedType === "es6") {
if (!isModuleForNode && !isModuleForBabel) {
throw new Error("Cannot import an ES6 module from CommonJS");
}
builder.import();
if (isNamespace) {
builder.namespace(nameHint || importedSource);
} else if (isDefault || isNamed) {
builder.named(name, importName);
}
} else if (importedType !== "commonjs") {
throw new Error(`Unexpected interopType "${importedType}"`);
} else if (importedInterop === "babel") {
if (isModuleForNode) {
name = name !== "default" ? name : importedSource;
const es6Default = `${importedSource}$es6Default`;
builder.import();
if (isNamespace) {
builder.default(es6Default).var(name || importedSource).wildcardInterop();
} else if (isDefault) {
if (ensureLiveReference) {
builder.default(es6Default).var(name || importedSource).defaultInterop().read("default");
} else {
builder.default(es6Default).var(name).defaultInterop().prop(importName);
}
} else if (isNamed) {
builder.default(es6Default).read(importName);
}
} else if (isModuleForBabel) {
builder.import();
if (isNamespace) {
builder.namespace(name || importedSource);
} else if (isDefault || isNamed) {
builder.named(name, importName);
}
} else {
builder.require();
if (isNamespace) {
builder.var(name || importedSource).wildcardInterop();
} else if ((isDefault || isNamed) && ensureLiveReference) {
if (isDefault) {
name = name !== "default" ? name : importedSource;
builder.var(name).read(importName);
builder.defaultInterop();
} else {
builder.var(importedSource).read(importName);
}
} else if (isDefault) {
builder.var(name).defaultInterop().prop(importName);
} else if (isNamed) {
builder.var(name).prop(importName);
}
}
} else if (importedInterop === "compiled") {
if (isModuleForNode) {
builder.import();
if (isNamespace) {
builder.default(name || importedSource);
} else if (isDefault || isNamed) {
builder.default(importedSource).read(name);
}
} else if (isModuleForBabel) {
builder.import();
if (isNamespace) {
builder.namespace(name || importedSource);
} else if (isDefault || isNamed) {
builder.named(name, importName);
}
} else {
builder.require();
if (isNamespace) {
builder.var(name || importedSource);
} else if (isDefault || isNamed) {
if (ensureLiveReference) {
builder.var(importedSource).read(name);
} else {
builder.prop(importName).var(name);
}
}
}
} else if (importedInterop === "uncompiled") {
if (isDefault && ensureLiveReference) {
throw new Error("No live reference for commonjs default");
}
if (isModuleForNode) {
builder.import();
if (isNamespace) {
builder.default(name || importedSource);
} else if (isDefault) {
builder.default(name);
} else if (isNamed) {
builder.default(importedSource).read(name);
}
} else if (isModuleForBabel) {
builder.import();
if (isNamespace) {
builder.default(name || importedSource);
} else if (isDefault) {
builder.default(name);
} else if (isNamed) {
builder.named(name, importName);
}
} else {
builder.require();
if (isNamespace) {
builder.var(name || importedSource);
} else if (isDefault) {
builder.var(name);
} else if (isNamed) {
if (ensureLiveReference) {
builder.var(importedSource).read(name);
} else {
builder.var(name).prop(importName);
}
}
}
} else {
throw new Error(`Unknown importedInterop "${importedInterop}".`);
}
const {
statements,
resultName
} = builder.done();
this._insertStatements(statements, importPosition, blockHoist);
if ((isDefault || isNamed) && ensureNoContext && resultName.type !== "Identifier") {
return sequenceExpression([numericLiteral(0), resultName]);
}
return resultName;
}
_insertStatements(statements, importPosition = "before", blockHoist = 3) {
if (importPosition === "after") {
if (this._insertStatementsAfter(statements)) return;
} else {
if (this._insertStatementsBefore(statements, blockHoist)) return;
}
this._programPath.unshiftContainer("body", statements);
}
_insertStatementsBefore(statements, blockHoist) {
if (statements.length === 1 && isImportDeclaration(statements[0]) && isValueImport(statements[0])) {
const firstImportDecl = this._programPath.get("body").find(p => {
return p.isImportDeclaration() && isValueImport(p.node);
});
if ((firstImportDecl == null ? void 0 : firstImportDecl.node.source.value) === statements[0].source.value && maybeAppendImportSpecifiers(firstImportDecl.node, statements[0])) {
return true;
}
}
statements.forEach(node => {
node._blockHoist = blockHoist;
});
const targetPath = this._programPath.get("body").find(p => {
const val = p.node._blockHoist;
return Number.isFinite(val) && val < 4;
});
if (targetPath) {
targetPath.insertBefore(statements);
return true;
}
return false;
}
_insertStatementsAfter(statements) {
const statementsSet = new Set(statements);
const importDeclarations = new Map();
for (const statement of statements) {
if (isImportDeclaration(statement) && isValueImport(statement)) {
const source = statement.source.value;
if (!importDeclarations.has(source)) importDeclarations.set(source, []);
importDeclarations.get(source).push(statement);
}
}
let lastImportPath = null;
for (const bodyStmt of this._programPath.get("body")) {
if (bodyStmt.isImportDeclaration() && isValueImport(bodyStmt.node)) {
lastImportPath = bodyStmt;
const source = bodyStmt.node.source.value;
const newImports = importDeclarations.get(source);
if (!newImports) continue;
for (const decl of newImports) {
if (!statementsSet.has(decl)) continue;
if (maybeAppendImportSpecifiers(bodyStmt.node, decl)) {
statementsSet.delete(decl);
}
}
}
}
if (statementsSet.size === 0) return true;
if (lastImportPath) lastImportPath.insertAfter(Array.from(statementsSet));
return !!lastImportPath;
}
}
exports.default = ImportInjector;
function isValueImport(node) {
return node.importKind !== "type" && node.importKind !== "typeof";
}
function hasNamespaceImport(node) {
return node.specifiers.length === 1 && node.specifiers[0].type === "ImportNamespaceSpecifier" || node.specifiers.length === 2 && node.specifiers[1].type === "ImportNamespaceSpecifier";
}
function hasDefaultImport(node) {
return node.specifiers.length > 0 && node.specifiers[0].type === "ImportDefaultSpecifier";
}
function maybeAppendImportSpecifiers(target, source) {
if (!target.specifiers.length) {
target.specifiers = source.specifiers;
return true;
}
if (!source.specifiers.length) return true;
if (hasNamespaceImport(target) || hasNamespaceImport(source)) return false;
if (hasDefaultImport(source)) {
if (hasDefaultImport(target)) {
source.specifiers[0] = importSpecifier(source.specifiers[0].local, identifier("default"));
} else {
target.specifiers.unshift(source.specifiers.shift());
}
}
target.specifiers.push(...source.specifiers);
return true;
}
//# sourceMappingURL=import-injector.js.map
@@ -0,0 +1,74 @@
/**
* @fileoverview Rule to flag use of certain node types
* @author Burak Yigit Kaya
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow specified syntax",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-restricted-syntax",
},
schema: {
type: "array",
items: {
oneOf: [
{
type: "string",
},
{
type: "object",
properties: {
selector: { type: "string" },
message: { type: "string" },
},
required: ["selector"],
additionalProperties: false,
},
],
},
uniqueItems: true,
minItems: 0,
},
messages: {
// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
restrictedSyntax: "{{message}}",
},
},
create(context) {
return context.options.reduce((result, selectorOrObject) => {
const isStringFormat = typeof selectorOrObject === "string";
const hasCustomMessage =
!isStringFormat && Boolean(selectorOrObject.message);
const selector = isStringFormat
? selectorOrObject
: selectorOrObject.selector;
const message = hasCustomMessage
? selectorOrObject.message
: `Using '${selector}' is not allowed.`;
return Object.assign(result, {
[selector](node) {
context.report({
node,
messageId: "restrictedSyntax",
data: { message },
});
},
});
}, {});
},
};
@@ -0,0 +1,6 @@
import type { AnySchemaObject } from "../../types";
import type { SchemaObjCxt } from "..";
import type { JSONType, RuleGroup, Rule } from "../rules";
export declare function schemaHasRulesForType({ schema, self }: SchemaObjCxt, type: JSONType): boolean | undefined;
export declare function shouldUseGroup(schema: AnySchemaObject, group: RuleGroup): boolean;
export declare function shouldUseRule(schema: AnySchemaObject, rule: Rule): boolean | undefined;
@@ -0,0 +1,7 @@
/**
* Tests a provided value against a ValueType
*/
const testValueType = (v) => (type) => type.test(v);
export { testValueType };
//# sourceMappingURL=test.mjs.map
@@ -0,0 +1,8 @@
import type { TSESTree } from '@typescript-eslint/types';
import type { ScopeManager } from '../ScopeManager';
import type { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
export declare class SwitchScope extends ScopeBase<ScopeType.switch, TSESTree.SwitchStatement, Scope> {
constructor(scopeManager: ScopeManager, upperScope: SwitchScope['upper'], block: SwitchScope['block']);
}
@@ -0,0 +1,19 @@
# @babel/template
> Generate an AST from a string template.
See our website [@babel/template](https://babeljs.io/docs/babel-template) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20template%22+is%3Aopen) associated with this package.
## Install
Using npm:
```sh
npm install --save-dev @babel/template
```
or using yarn:
```sh
yarn add @babel/template --dev
```
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './chart-no-axes-column.js';
//# sourceMappingURL=bar-chart-2.js.map
@@ -0,0 +1,150 @@
'use strict';
module.exports = function generate_format(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 || '');
if (it.opts.format === false) {
if ($breakOnError) {
out += ' if (true) { ';
}
return out;
}
var $isData = it.opts.$data && $schema && $schema.$data,
$schemaValue;
if ($isData) {
out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
$schemaValue = 'schema' + $lvl;
} else {
$schemaValue = $schema;
}
var $unknownFormats = it.opts.unknownFormats,
$allowUnknown = Array.isArray($unknownFormats);
if ($isData) {
var $format = 'format' + $lvl,
$isObject = 'isObject' + $lvl,
$formatType = 'formatType' + $lvl;
out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { ';
if (it.async) {
out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; ';
}
out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( ';
if ($isData) {
out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
}
out += ' (';
if ($unknownFormats != 'ignore') {
out += ' (' + ($schemaValue) + ' && !' + ($format) + ' ';
if ($allowUnknown) {
out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 ';
}
out += ') || ';
}
out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? ';
if (it.async) {
out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) ';
} else {
out += ' ' + ($format) + '(' + ($data) + ') ';
}
out += ' : ' + ($format) + '.test(' + ($data) + '))))) {';
} else {
var $format = it.formats[$schema];
if (!$format) {
if ($unknownFormats == 'ignore') {
it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"');
if ($breakOnError) {
out += ' if (true) { ';
}
return out;
} else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) {
if ($breakOnError) {
out += ' if (true) { ';
}
return out;
} else {
throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"');
}
}
var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate;
var $formatType = $isObject && $format.type || 'string';
if ($isObject) {
var $async = $format.async === true;
$format = $format.validate;
}
if ($formatType != $ruleType) {
if ($breakOnError) {
out += ' if (true) { ';
}
return out;
}
if ($async) {
if (!it.async) throw new Error('async format in sync schema');
var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate';
out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { ';
} else {
out += ' if (! ';
var $formatRef = 'formats' + it.util.getProperty($schema);
if ($isObject) $formatRef += '.validate';
if (typeof $format == 'function') {
out += ' ' + ($formatRef) + '(' + ($data) + ') ';
} else {
out += ' ' + ($formatRef) + '.test(' + ($data) + ') ';
}
out += ') { ';
}
}
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = ''; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: ';
if ($isData) {
out += '' + ($schemaValue);
} else {
out += '' + (it.util.toQuotedString($schema));
}
out += ' } ';
if (it.opts.messages !== false) {
out += ' , message: \'should match format "';
if ($isData) {
out += '\' + ' + ($schemaValue) + ' + \'';
} else {
out += '' + (it.util.escapeQuotes($schema));
}
out += '"\' ';
}
if (it.opts.verbose) {
out += ' , schema: ';
if ($isData) {
out += 'validate.schema' + ($schemaPath);
} else {
out += '' + (it.util.toQuotedString($schema));
}
out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
var __err = out;
out = $$outStack.pop();
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError([' + (__err) + ']); ';
} else {
out += ' validate.errors = [' + (__err) + ']; return false; ';
}
} else {
out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
}
out += ' } ';
if ($breakOnError) {
out += ' else { ';
}
return out;
}
@@ -0,0 +1,12 @@
require('./sass.dart.js');
const library = globalThis._cliPkgExports.pop();
if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports;
library.load({
util: require("util"),
stream: require("stream"),
nodeModule: require("module"),
fs: require("fs"),
immutable: require("immutable"),
});
module.exports = library;
@@ -0,0 +1,200 @@
{
"name": "jose",
"version": "6.2.3",
"description": "JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes",
"keywords": [
"akp",
"browser",
"bun",
"cloudflare",
"compact",
"decode",
"decrypt",
"deno",
"detached",
"ec",
"ecdsa",
"ed25519",
"eddsa",
"edge",
"electron",
"embedded",
"encrypt",
"flattened",
"general",
"jose",
"json web token",
"jsonwebtoken",
"jwa",
"jwe",
"jwk",
"jwks",
"jws",
"jwt-decode",
"jwt",
"ml-dsa",
"netlify",
"next",
"nextjs",
"oct",
"okp",
"payload",
"pem",
"pkcs8",
"rsa",
"sign",
"signature",
"spki",
"validate",
"vercel",
"verify",
"webcrypto",
"workerd",
"workers",
"x509"
],
"homepage": "https://github.com/panva/jose",
"repository": "panva/jose",
"funding": {
"url": "https://github.com/sponsors/panva"
},
"license": "MIT",
"author": "Filip Skokan <panva.ip@gmail.com>",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"default": "./dist/webapi/index.js"
},
"./jwk/embedded": {
"types": "./dist/types/jwk/embedded.d.ts",
"default": "./dist/webapi/jwk/embedded.js"
},
"./jwk/thumbprint": {
"types": "./dist/types/jwk/thumbprint.d.ts",
"default": "./dist/webapi/jwk/thumbprint.js"
},
"./key/import": {
"types": "./dist/types/key/import.d.ts",
"default": "./dist/webapi/key/import.js"
},
"./key/export": {
"types": "./dist/types/key/export.d.ts",
"default": "./dist/webapi/key/export.js"
},
"./key/generate/keypair": {
"types": "./dist/types/key/generate_key_pair.d.ts",
"default": "./dist/webapi/key/generate_key_pair.js"
},
"./key/generate/secret": {
"types": "./dist/types/key/generate_secret.d.ts",
"default": "./dist/webapi/key/generate_secret.js"
},
"./jwks/remote": {
"types": "./dist/types/jwks/remote.d.ts",
"default": "./dist/webapi/jwks/remote.js"
},
"./jwks/local": {
"types": "./dist/types/jwks/local.d.ts",
"default": "./dist/webapi/jwks/local.js"
},
"./jwt/sign": {
"types": "./dist/types/jwt/sign.d.ts",
"default": "./dist/webapi/jwt/sign.js"
},
"./jwt/verify": {
"types": "./dist/types/jwt/verify.d.ts",
"default": "./dist/webapi/jwt/verify.js"
},
"./jwt/encrypt": {
"types": "./dist/types/jwt/encrypt.d.ts",
"default": "./dist/webapi/jwt/encrypt.js"
},
"./jwt/decrypt": {
"types": "./dist/types/jwt/decrypt.d.ts",
"default": "./dist/webapi/jwt/decrypt.js"
},
"./jwt/unsecured": {
"types": "./dist/types/jwt/unsecured.d.ts",
"default": "./dist/webapi/jwt/unsecured.js"
},
"./jwt/decode": {
"types": "./dist/types/util/decode_jwt.d.ts",
"default": "./dist/webapi/util/decode_jwt.js"
},
"./decode/protected_header": {
"types": "./dist/types/util/decode_protected_header.d.ts",
"default": "./dist/webapi/util/decode_protected_header.js"
},
"./jws/compact/sign": {
"types": "./dist/types/jws/compact/sign.d.ts",
"default": "./dist/webapi/jws/compact/sign.js"
},
"./jws/compact/verify": {
"types": "./dist/types/jws/compact/verify.d.ts",
"default": "./dist/webapi/jws/compact/verify.js"
},
"./jws/flattened/sign": {
"types": "./dist/types/jws/flattened/sign.d.ts",
"default": "./dist/webapi/jws/flattened/sign.js"
},
"./jws/flattened/verify": {
"types": "./dist/types/jws/flattened/verify.d.ts",
"default": "./dist/webapi/jws/flattened/verify.js"
},
"./jws/general/sign": {
"types": "./dist/types/jws/general/sign.d.ts",
"default": "./dist/webapi/jws/general/sign.js"
},
"./jws/general/verify": {
"types": "./dist/types/jws/general/verify.d.ts",
"default": "./dist/webapi/jws/general/verify.js"
},
"./jwe/compact/encrypt": {
"types": "./dist/types/jwe/compact/encrypt.d.ts",
"default": "./dist/webapi/jwe/compact/encrypt.js"
},
"./jwe/compact/decrypt": {
"types": "./dist/types/jwe/compact/decrypt.d.ts",
"default": "./dist/webapi/jwe/compact/decrypt.js"
},
"./jwe/flattened/encrypt": {
"types": "./dist/types/jwe/flattened/encrypt.d.ts",
"default": "./dist/webapi/jwe/flattened/encrypt.js"
},
"./jwe/flattened/decrypt": {
"types": "./dist/types/jwe/flattened/decrypt.d.ts",
"default": "./dist/webapi/jwe/flattened/decrypt.js"
},
"./jwe/general/encrypt": {
"types": "./dist/types/jwe/general/encrypt.d.ts",
"default": "./dist/webapi/jwe/general/encrypt.js"
},
"./jwe/general/decrypt": {
"types": "./dist/types/jwe/general/decrypt.d.ts",
"default": "./dist/webapi/jwe/general/decrypt.js"
},
"./errors": {
"types": "./dist/types/util/errors.d.ts",
"default": "./dist/webapi/util/errors.js"
},
"./base64url": {
"types": "./dist/types/util/base64url.d.ts",
"default": "./dist/webapi/util/base64url.js"
},
"./package.json": "./package.json"
},
"main": "./dist/webapi/index.js",
"types": "./dist/types/index.d.ts",
"files": [
"dist/webapi/**/*.js",
"dist/types/**/*.d.ts",
"!dist/**/*.bundle.js",
"!dist/**/*.umd.js",
"!dist/**/*.min.js",
"!dist/types/runtime/*",
"!dist/types/lib/*",
"!dist/deno/**/*"
]
}
@@ -0,0 +1 @@
{"version":3,"file":"equal.js","sources":["../../../src/icons/equal.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Equal\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iNSIgeDI9IjE5IiB5MT0iOSIgeTI9IjkiIC8+CiAgPGxpbmUgeDE9IjUiIHgyPSIxOSIgeTE9IjE1IiB5Mj0iMTUiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/equal\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 Equal = createLucideIcon('Equal', [\n ['line', { x1: '5', x2: '19', y1: '9', y2: '9', key: '1nwqeh' }],\n ['line', { x1: '5', x2: '19', y1: '15', y2: '15', key: 'g8yjpy' }],\n]);\n\nexport default Equal;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CACtC,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC/D,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACnE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,146 @@
import { arraysEqual, functionalUpdate } from "./utils.js";
import { createLRUCache } from "./lru-cache.js";
//#region src/stores.ts
/** SSR non-reactive createMutableStore */
function createNonReactiveMutableStore(initialValue) {
let value = initialValue;
return {
get() {
return value;
},
set(nextOrUpdater) {
value = functionalUpdate(nextOrUpdater, value);
}
};
}
/** SSR non-reactive createReadonlyStore */
function createNonReactiveReadonlyStore(read) {
return { get() {
return read();
} };
}
function createRouterStores(initialState, config) {
const { createMutableStore, createReadonlyStore, batch, init } = config;
const matchStores = /* @__PURE__ */ new Map();
const pendingMatchStores = /* @__PURE__ */ new Map();
const cachedMatchStores = /* @__PURE__ */ new Map();
const status = createMutableStore(initialState.status);
const loadedAt = createMutableStore(initialState.loadedAt);
const isLoading = createMutableStore(initialState.isLoading);
const isTransitioning = createMutableStore(initialState.isTransitioning);
const location = createMutableStore(initialState.location);
const resolvedLocation = createMutableStore(initialState.resolvedLocation);
const statusCode = createMutableStore(initialState.statusCode);
const redirect = createMutableStore(initialState.redirect);
const matchesId = createMutableStore([]);
const pendingIds = createMutableStore([]);
const cachedIds = createMutableStore([]);
const matches = createReadonlyStore(() => readPoolMatches(matchStores, matchesId.get()));
const pendingMatches = createReadonlyStore(() => readPoolMatches(pendingMatchStores, pendingIds.get()));
const cachedMatches = createReadonlyStore(() => readPoolMatches(cachedMatchStores, cachedIds.get()));
const firstId = createReadonlyStore(() => matchesId.get()[0]);
const hasPending = createReadonlyStore(() => matchesId.get().some((matchId) => {
return matchStores.get(matchId)?.get().status === "pending";
}));
const matchRouteDeps = createReadonlyStore(() => ({
locationHref: location.get().href,
resolvedLocationHref: resolvedLocation.get()?.href,
status: status.get()
}));
const __store = createReadonlyStore(() => ({
status: status.get(),
loadedAt: loadedAt.get(),
isLoading: isLoading.get(),
isTransitioning: isTransitioning.get(),
matches: matches.get(),
location: location.get(),
resolvedLocation: resolvedLocation.get(),
statusCode: statusCode.get(),
redirect: redirect.get()
}));
const matchStoreByRouteIdCache = createLRUCache(64);
function getRouteMatchStore(routeId) {
let cached = matchStoreByRouteIdCache.get(routeId);
if (!cached) {
cached = createReadonlyStore(() => {
const ids = matchesId.get();
for (const id of ids) {
const matchStore = matchStores.get(id);
if (matchStore && matchStore.routeId === routeId) return matchStore.get();
}
});
matchStoreByRouteIdCache.set(routeId, cached);
}
return cached;
}
const store = {
status,
loadedAt,
isLoading,
isTransitioning,
location,
resolvedLocation,
statusCode,
redirect,
matchesId,
pendingIds,
cachedIds,
matches,
pendingMatches,
cachedMatches,
firstId,
hasPending,
matchRouteDeps,
matchStores,
pendingMatchStores,
cachedMatchStores,
__store,
getRouteMatchStore,
setMatches,
setPending,
setCached
};
setMatches(initialState.matches);
init?.(store);
function setMatches(nextMatches) {
reconcileMatchPool(nextMatches, matchStores, matchesId, createMutableStore, batch);
}
function setPending(nextMatches) {
reconcileMatchPool(nextMatches, pendingMatchStores, pendingIds, createMutableStore, batch);
}
function setCached(nextMatches) {
reconcileMatchPool(nextMatches, cachedMatchStores, cachedIds, createMutableStore, batch);
}
return store;
}
function readPoolMatches(pool, ids) {
const matches = [];
for (const id of ids) {
const matchStore = pool.get(id);
if (matchStore) matches.push(matchStore.get());
}
return matches;
}
function reconcileMatchPool(nextMatches, pool, idStore, createMutableStore, batch) {
const nextIds = nextMatches.map((d) => d.id);
const nextIdSet = new Set(nextIds);
batch(() => {
for (const id of pool.keys()) if (!nextIdSet.has(id)) pool.delete(id);
for (const nextMatch of nextMatches) {
const existing = pool.get(nextMatch.id);
if (!existing) {
const matchStore = createMutableStore(nextMatch);
matchStore.routeId = nextMatch.routeId;
pool.set(nextMatch.id, matchStore);
continue;
}
existing.routeId = nextMatch.routeId;
if (existing.get() !== nextMatch) existing.set(nextMatch);
}
if (!arraysEqual(idStore.get(), nextIds)) idStore.set(nextIds);
});
}
//#endregion
export { createNonReactiveMutableStore, createNonReactiveReadonlyStore, createRouterStores };
//# sourceMappingURL=stores.js.map
@@ -0,0 +1 @@
{"version":3,"names":["_isValidIdentifier","require","_index","_default","exports","default","valueToNode","objectToString","Function","call","bind","Object","prototype","toString","isRegExp","value","isPlainObject","proto","getPrototypeOf","undefined","identifier","booleanLiteral","nullLiteral","stringLiteral","result","Number","isFinite","numericLiteral","Math","abs","numerator","isNaN","binaryExpression","is","unaryExpression","bigIntLiteral","pattern","source","flags","exec","regExpLiteral","Array","isArray","arrayExpression","map","props","key","keys","nodeKey","computed","isValidIdentifier","push","objectProperty","objectExpression","Error"],"sources":["../../src/converters/valueToNode.ts"],"sourcesContent":["import isValidIdentifier from \"../validators/isValidIdentifier.ts\";\nimport {\n identifier,\n booleanLiteral,\n nullLiteral,\n stringLiteral,\n numericLiteral,\n bigIntLiteral,\n regExpLiteral,\n arrayExpression,\n objectProperty,\n objectExpression,\n unaryExpression,\n binaryExpression,\n} from \"../builders/generated/index.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default valueToNode as {\n (value: undefined): t.Identifier; // TODO: This should return \"void 0\"\n (value: boolean): t.BooleanLiteral;\n (value: null): t.NullLiteral;\n (value: string): t.StringLiteral;\n // Infinities and NaN need to use a BinaryExpression; negative values must be wrapped in UnaryExpression\n (value: number): t.NumericLiteral | t.BinaryExpression | t.UnaryExpression;\n (value: bigint): t.BigIntLiteral;\n (value: RegExp): t.RegExpLiteral;\n (value: readonly unknown[]): t.ArrayExpression;\n\n // this throws with objects that are not plain objects,\n // or if there are non-valueToNode-able values\n (value: object): t.ObjectExpression;\n\n (value: unknown): t.Expression;\n};\n\n// @ts-expect-error: Object.prototype.toString must return a string\nconst objectToString: (value: unknown) => string = Function.call.bind(\n Object.prototype.toString,\n);\n\nfunction isRegExp(value: unknown): value is RegExp {\n return objectToString(value) === \"[object RegExp]\";\n}\n\nfunction isPlainObject(value: unknown): value is object {\n if (\n typeof value !== \"object\" ||\n value === null ||\n Object.prototype.toString.call(value) !== \"[object Object]\"\n ) {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n // Object.prototype's __proto__ is null. Every other class's __proto__.__proto__ is\n // not null by default. We cannot check if proto === Object.prototype because it\n // could come from another realm.\n return proto === null || Object.getPrototypeOf(proto) === null;\n}\n\nfunction valueToNode(value: unknown): t.Expression {\n // undefined\n if (value === undefined) {\n return identifier(\"undefined\");\n }\n\n // boolean\n if (value === true || value === false) {\n return booleanLiteral(value);\n }\n\n // null\n if (value === null) {\n return nullLiteral();\n }\n\n // strings\n if (typeof value === \"string\") {\n return stringLiteral(value);\n }\n\n // numbers\n if (typeof value === \"number\") {\n let result;\n if (Number.isFinite(value)) {\n result = numericLiteral(Math.abs(value));\n } else {\n let numerator;\n if (Number.isNaN(value)) {\n // NaN\n numerator = numericLiteral(0);\n } else {\n // Infinity / -Infinity\n numerator = numericLiteral(1);\n }\n\n result = binaryExpression(\"/\", numerator, numericLiteral(0));\n }\n\n if (value < 0 || Object.is(value, -0)) {\n result = unaryExpression(\"-\", result);\n }\n\n return result;\n }\n\n // bigints\n if (typeof value === \"bigint\") {\n if (value < 0) {\n return unaryExpression(\"-\", bigIntLiteral(-value));\n } else {\n return bigIntLiteral(value);\n }\n }\n\n // regexes\n if (isRegExp(value)) {\n const pattern = value.source;\n const flags = /\\/([a-z]*)$/.exec(value.toString())[1];\n return regExpLiteral(pattern, flags);\n }\n\n // array\n if (Array.isArray(value)) {\n return arrayExpression(value.map(valueToNode));\n }\n\n // object\n if (isPlainObject(value)) {\n const props = [];\n for (const key of Object.keys(value)) {\n let nodeKey,\n computed = false;\n if (isValidIdentifier(key)) {\n if (key === \"__proto__\") {\n computed = true;\n nodeKey = stringLiteral(key);\n } else {\n nodeKey = identifier(key);\n }\n } else {\n nodeKey = stringLiteral(key);\n }\n props.push(\n objectProperty(\n nodeKey,\n valueToNode(\n // @ts-expect-error key must present in value\n value[key],\n ),\n computed,\n ),\n );\n }\n return objectExpression(props);\n }\n\n throw new Error(\"don't know how to turn this value into a node\");\n}\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"file-output.js","sources":["../../../src/icons/file-output.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileOutput\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTQgMnY0YTIgMiAwIDAgMCAyIDJoNCIgLz4KICA8cGF0aCBkPSJNNCA3VjRhMiAyIDAgMCAxIDItMiAyIDIgMCAwIDAtMiAyIiAvPgogIDxwYXRoIGQ9Ik00LjA2MyAyMC45OTlhMiAyIDAgMCAwIDIgMUwxOCAyMmEyIDIgMCAwIDAgMi0yVjdsLTUtNUg2IiAvPgogIDxwYXRoIGQ9Im01IDExLTMgMyIgLz4KICA8cGF0aCBkPSJtNSAxNy0zLTNoMTAiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/file-output\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 FileOutput = createLucideIcon('FileOutput', [\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n ['path', { d: 'M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2', key: '1vk7w2' }],\n ['path', { d: 'M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6', key: '1jink5' }],\n ['path', { d: 'm5 11-3 3', key: '1dgrs4' }],\n ['path', { d: 'm5 17-3-3h10', key: '1mvvaf' }],\n]);\n\nexport default FileOutput;\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,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACnE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACzF,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,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,40 @@
declare const _default: {
extends: string[];
rules: {
'@typescript-eslint/ban-ts-comment': ["error", {
minimumDescriptionLength: number;
}];
'no-array-constructor': "off";
'@typescript-eslint/no-array-constructor': "error";
'@typescript-eslint/no-duplicate-enum-values': "error";
'@typescript-eslint/no-dynamic-delete': "error";
'@typescript-eslint/no-empty-object-type': "error";
'@typescript-eslint/no-explicit-any': "error";
'@typescript-eslint/no-extra-non-null-assertion': "error";
'@typescript-eslint/no-extraneous-class': "error";
'@typescript-eslint/no-invalid-void-type': "error";
'@typescript-eslint/no-misused-new': "error";
'@typescript-eslint/no-namespace': "error";
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': "error";
'@typescript-eslint/no-non-null-asserted-optional-chain': "error";
'@typescript-eslint/no-non-null-assertion': "error";
'@typescript-eslint/no-require-imports': "error";
'@typescript-eslint/no-this-alias': "error";
'@typescript-eslint/no-unnecessary-type-constraint': "error";
'@typescript-eslint/no-unsafe-declaration-merging': "error";
'@typescript-eslint/no-unsafe-function-type': "error";
'no-unused-expressions': "off";
'@typescript-eslint/no-unused-expressions': "error";
'no-unused-vars': "off";
'@typescript-eslint/no-unused-vars': "error";
'no-useless-constructor': "off";
'@typescript-eslint/no-useless-constructor': "error";
'@typescript-eslint/no-wrapper-object-types': "error";
'@typescript-eslint/prefer-as-const': "error";
'@typescript-eslint/prefer-literal-enum-member': "error";
'@typescript-eslint/prefer-namespace-keyword': "error";
'@typescript-eslint/triple-slash-reference': "error";
'@typescript-eslint/unified-signatures': "error";
};
};
export = _default;
@@ -0,0 +1 @@
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":";;;;;;AAgIA,sCAyCC;AA8BD,sDAuBC;AAaD,oFAIC;AA/OD,sDAAkD;AAClD,wDAAqG;AACrG,kDAAwE;AACxE,0DAA4F;AAC5F,oDAAmF;AACnF,wDAAyD;AAIzD,sFAAsF;AACtF,MAAM,sBAAsB,GACxB,OAAO,CAAC,GAAG,CAAC,yCAAyC,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,yCAAyC,KAAK,GAAG,CAAC;AACtI,IAAI,sBAAsB,EAAE,CAAC;IACzB,sCAAsC;IACtC,OAAO,CAAC,IAAI,CAAC,gHAAgH,CAAC,CAAC;AACnI,CAAC;AAgDD,MAAM,cAAc,GAAG,CAAC,MAAW,EAAQ,EAAE;IACzC,mHAAmH;IACnH,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAChI,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAChD,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,wCAAwC,MAAM,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,4CAA4C,MAAM,EAAE,CAAC,CAAC;IAC1E,CAAC;AACL,CAAC,CAAC;AAEK,MAAM,mBAAmB,GAAG,CAAC,OAMnC,EAAiB,EAAE;IAChB,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IACjC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAEhC,cAAc,CAAC,MAAM,CAAC,CAAC;IAEvB,MAAM,sBAAsB,GAAG,YAAY,CAAC;IAC5C,MAAM,cAAc,GAAG,QAAQ,CAAC;IAChC,MAAM,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;IACrG,MAAM,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IAEjF,MAAM,QAAQ,GAAkB;QAC5B,MAAM,EAAE,MAAM,CAAC,IAAI;QACnB,qBAAqB,EAAE,OAAO,CAAC,uBAAuB,EAAE,IAAI;QAE5D,sBAAsB,EAAE,IAAI,GAAG,CAAC,sBAAsB,EAAE,OAAO,IAAI,MAAM,CAAC,CAAC,IAAI;QAC/E,wBAAwB,EAAE,CAAC,MAAM,CAAC;QAClC,gCAAgC,EAAE,CAAC,MAAM,CAAC;QAE1C,cAAc,EAAE,IAAI,GAAG,CAAC,cAAc,EAAE,OAAO,IAAI,MAAM,CAAC,CAAC,IAAI;QAC/D,qCAAqC,EAAE,CAAC,oBAAoB,EAAE,MAAM,CAAC;QACrE,qBAAqB,EAAE,CAAC,oBAAoB,EAAE,eAAe,CAAC;QAE9D,gBAAgB,EAAE,OAAO,CAAC,eAAe;QAEzC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,mBAAmB,EAAE,OAAO,IAAI,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QAC3G,0CAA0C,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,SAAS;QAEpG,qBAAqB,EAAE,qBAAqB,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,qBAAqB,EAAE,OAAO,IAAI,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;KACpH,CAAC;IAEF,OAAO,QAAQ,CAAC;AACpB,CAAC,CAAC;AAtCW,QAAA,mBAAmB,uBAsC9B;AAEF;;;;;;;;;;;GAWG;AACH,SAAgB,aAAa,CAAC,OAA0B;IACpD,MAAM,aAAa,GAAG,IAAA,2BAAmB,EAAC,OAAO,CAAC,CAAC;IAEnD,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,MAAM,CAAC,GAAG,CACN,IAAI,GAAG,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC,QAAQ,EACtD,IAAA,mCAAoB,EAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CACxF,CAAC;IAEF,MAAM,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,IAAA,uBAAY,EAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAElI,MAAM,CAAC,GAAG,CACN,qBAAqB,CAAC;QAClB,aAAa;QACb,sFAAsF;QACtF,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,OAAO,CAAC,OAAO,IAAI,IAAI,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC;QAChG,uBAAuB,EAAE,OAAO,CAAC,uBAAuB;QACxD,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,YAAY,EAAE,OAAO,CAAC,YAAY;KACrC,CAAC,CACL,CAAC;IAEF,IAAI,aAAa,CAAC,qBAAqB,EAAE,CAAC;QACtC,MAAM,CAAC,GAAG,CACN,IAAI,GAAG,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC,QAAQ,EACrD,IAAA,uCAAyB,EAAC;YACtB,YAAY,EAAE,OAAO,CAAC,QAAQ,CAAC,YAAY;YAC3C,GAAG,OAAO,CAAC,yBAAyB;SACvC,CAAC,CACL,CAAC;IACN,CAAC;IAED,IAAI,aAAa,CAAC,mBAAmB,EAAE,CAAC;QACpC,MAAM,CAAC,GAAG,CACN,IAAI,GAAG,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EACnD,IAAA,6BAAiB,EAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAClF,CAAC;IACN,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AA8BD,SAAgB,qBAAqB,CAAC,OAA4B;IAC9D,cAAc,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IAEtD,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,MAAM,yBAAyB,GAAmC;QAC9D,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,IAAI;QAExC,qBAAqB,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC;QAErD,gBAAgB,EAAE,OAAO,CAAC,eAAe;QACzC,aAAa,EAAE,OAAO,CAAC,YAAY;QACnC,sBAAsB,EAAE,OAAO,CAAC,uBAAuB,EAAE,IAAI;KAChE,CAAC;IAEF,kDAAkD;IAClD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IAChE,MAAM,CAAC,GAAG,CAAC,wCAAwC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,IAAA,6BAAe,EAAC,yBAAyB,CAAC,CAAC,CAAC;IAE/H,uEAAuE;IACvE,MAAM,CAAC,GAAG,CAAC,yCAAyC,EAAE,IAAA,6BAAe,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;IAE9F,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,oCAAoC,CAAC,SAAc;IAC/D,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IAClE,OAAO,IAAI,GAAG,CAAC,wCAAwC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7E,CAAC"}
@@ -0,0 +1,264 @@
# @jridgewell/sourcemap-codec
Encode/decode the `mappings` property of a [sourcemap](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit).
## Why?
Sourcemaps are difficult to generate and manipulate, because the `mappings` property – the part that actually links the generated code back to the original source – is encoded using an obscure method called [Variable-length quantity](https://en.wikipedia.org/wiki/Variable-length_quantity). On top of that, each segment in the mapping contains offsets rather than absolute indices, which means that you can't look at a segment in isolation – you have to understand the whole sourcemap.
This package makes the process slightly easier.
## Installation
```bash
npm install @jridgewell/sourcemap-codec
```
## Usage
```js
import { encode, decode } from '@jridgewell/sourcemap-codec';
var decoded = decode( ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' );
assert.deepEqual( decoded, [
// the first line (of the generated code) has no mappings,
// as shown by the starting semi-colon (which separates lines)
[],
// the second line contains four (comma-separated) segments
[
// segments are encoded as you'd expect:
// [ generatedCodeColumn, sourceIndex, sourceCodeLine, sourceCodeColumn, nameIndex ]
// i.e. the first segment begins at column 2, and maps back to the second column
// of the second line (both zero-based) of the 0th source, and uses the 0th
// name in the `map.names` array
[ 2, 0, 2, 2, 0 ],
// the remaining segments are 4-length rather than 5-length,
// because they don't map a name
[ 4, 0, 2, 4 ],
[ 6, 0, 2, 5 ],
[ 7, 0, 2, 7 ]
],
// the final line contains two segments
[
[ 2, 1, 10, 19 ],
[ 12, 1, 11, 20 ]
]
]);
var encoded = encode( decoded );
assert.equal( encoded, ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' );
```
## Benchmarks
```
node v20.10.0
amp.js.map - 45120 segments
Decode Memory Usage:
local code 5815135 bytes
@jridgewell/sourcemap-codec 1.4.15 5868160 bytes
sourcemap-codec 5492584 bytes
source-map-0.6.1 13569984 bytes
source-map-0.8.0 6390584 bytes
chrome dev tools 8011136 bytes
Smallest memory usage is sourcemap-codec
Decode speed:
decode: local code x 492 ops/sec ±1.22% (90 runs sampled)
decode: @jridgewell/sourcemap-codec 1.4.15 x 499 ops/sec ±1.16% (89 runs sampled)
decode: sourcemap-codec x 376 ops/sec ±1.66% (89 runs sampled)
decode: source-map-0.6.1 x 34.99 ops/sec ±0.94% (48 runs sampled)
decode: source-map-0.8.0 x 351 ops/sec ±0.07% (95 runs sampled)
chrome dev tools x 165 ops/sec ±0.91% (86 runs sampled)
Fastest is decode: @jridgewell/sourcemap-codec 1.4.15
Encode Memory Usage:
local code 444248 bytes
@jridgewell/sourcemap-codec 1.4.15 623024 bytes
sourcemap-codec 8696280 bytes
source-map-0.6.1 8745176 bytes
source-map-0.8.0 8736624 bytes
Smallest memory usage is local code
Encode speed:
encode: local code x 796 ops/sec ±0.11% (97 runs sampled)
encode: @jridgewell/sourcemap-codec 1.4.15 x 795 ops/sec ±0.25% (98 runs sampled)
encode: sourcemap-codec x 231 ops/sec ±0.83% (86 runs sampled)
encode: source-map-0.6.1 x 166 ops/sec ±0.57% (86 runs sampled)
encode: source-map-0.8.0 x 203 ops/sec ±0.45% (88 runs sampled)
Fastest is encode: local code,encode: @jridgewell/sourcemap-codec 1.4.15
***
babel.min.js.map - 347793 segments
Decode Memory Usage:
local code 35424960 bytes
@jridgewell/sourcemap-codec 1.4.15 35424696 bytes
sourcemap-codec 36033464 bytes
source-map-0.6.1 62253704 bytes
source-map-0.8.0 43843920 bytes
chrome dev tools 45111400 bytes
Smallest memory usage is @jridgewell/sourcemap-codec 1.4.15
Decode speed:
decode: local code x 38.18 ops/sec ±5.44% (52 runs sampled)
decode: @jridgewell/sourcemap-codec 1.4.15 x 38.36 ops/sec ±5.02% (52 runs sampled)
decode: sourcemap-codec x 34.05 ops/sec ±4.45% (47 runs sampled)
decode: source-map-0.6.1 x 4.31 ops/sec ±2.76% (15 runs sampled)
decode: source-map-0.8.0 x 55.60 ops/sec ±0.13% (73 runs sampled)
chrome dev tools x 16.94 ops/sec ±3.78% (46 runs sampled)
Fastest is decode: source-map-0.8.0
Encode Memory Usage:
local code 2606016 bytes
@jridgewell/sourcemap-codec 1.4.15 2626440 bytes
sourcemap-codec 21152576 bytes
source-map-0.6.1 25023928 bytes
source-map-0.8.0 25256448 bytes
Smallest memory usage is local code
Encode speed:
encode: local code x 127 ops/sec ±0.18% (83 runs sampled)
encode: @jridgewell/sourcemap-codec 1.4.15 x 128 ops/sec ±0.26% (83 runs sampled)
encode: sourcemap-codec x 29.31 ops/sec ±2.55% (53 runs sampled)
encode: source-map-0.6.1 x 18.85 ops/sec ±3.19% (36 runs sampled)
encode: source-map-0.8.0 x 19.34 ops/sec ±1.97% (36 runs sampled)
Fastest is encode: @jridgewell/sourcemap-codec 1.4.15
***
preact.js.map - 1992 segments
Decode Memory Usage:
local code 261696 bytes
@jridgewell/sourcemap-codec 1.4.15 244296 bytes
sourcemap-codec 302816 bytes
source-map-0.6.1 939176 bytes
source-map-0.8.0 336 bytes
chrome dev tools 587368 bytes
Smallest memory usage is source-map-0.8.0
Decode speed:
decode: local code x 17,782 ops/sec ±0.32% (97 runs sampled)
decode: @jridgewell/sourcemap-codec 1.4.15 x 17,863 ops/sec ±0.40% (100 runs sampled)
decode: sourcemap-codec x 12,453 ops/sec ±0.27% (101 runs sampled)
decode: source-map-0.6.1 x 1,288 ops/sec ±1.05% (96 runs sampled)
decode: source-map-0.8.0 x 9,289 ops/sec ±0.27% (101 runs sampled)
chrome dev tools x 4,769 ops/sec ±0.18% (100 runs sampled)
Fastest is decode: @jridgewell/sourcemap-codec 1.4.15
Encode Memory Usage:
local code 262944 bytes
@jridgewell/sourcemap-codec 1.4.15 25544 bytes
sourcemap-codec 323048 bytes
source-map-0.6.1 507808 bytes
source-map-0.8.0 507480 bytes
Smallest memory usage is @jridgewell/sourcemap-codec 1.4.15
Encode speed:
encode: local code x 24,207 ops/sec ±0.79% (95 runs sampled)
encode: @jridgewell/sourcemap-codec 1.4.15 x 24,288 ops/sec ±0.48% (96 runs sampled)
encode: sourcemap-codec x 6,761 ops/sec ±0.21% (100 runs sampled)
encode: source-map-0.6.1 x 5,374 ops/sec ±0.17% (99 runs sampled)
encode: source-map-0.8.0 x 5,633 ops/sec ±0.32% (99 runs sampled)
Fastest is encode: @jridgewell/sourcemap-codec 1.4.15,encode: local code
***
react.js.map - 5726 segments
Decode Memory Usage:
local code 678816 bytes
@jridgewell/sourcemap-codec 1.4.15 678816 bytes
sourcemap-codec 816400 bytes
source-map-0.6.1 2288864 bytes
source-map-0.8.0 721360 bytes
chrome dev tools 1012512 bytes
Smallest memory usage is local code
Decode speed:
decode: local code x 6,178 ops/sec ±0.19% (98 runs sampled)
decode: @jridgewell/sourcemap-codec 1.4.15 x 6,261 ops/sec ±0.22% (100 runs sampled)
decode: sourcemap-codec x 4,472 ops/sec ±0.90% (99 runs sampled)
decode: source-map-0.6.1 x 449 ops/sec ±0.31% (95 runs sampled)
decode: source-map-0.8.0 x 3,219 ops/sec ±0.13% (100 runs sampled)
chrome dev tools x 1,743 ops/sec ±0.20% (99 runs sampled)
Fastest is decode: @jridgewell/sourcemap-codec 1.4.15
Encode Memory Usage:
local code 140960 bytes
@jridgewell/sourcemap-codec 1.4.15 159808 bytes
sourcemap-codec 969304 bytes
source-map-0.6.1 930520 bytes
source-map-0.8.0 930248 bytes
Smallest memory usage is local code
Encode speed:
encode: local code x 8,013 ops/sec ±0.19% (100 runs sampled)
encode: @jridgewell/sourcemap-codec 1.4.15 x 7,989 ops/sec ±0.20% (101 runs sampled)
encode: sourcemap-codec x 2,472 ops/sec ±0.21% (99 runs sampled)
encode: source-map-0.6.1 x 2,200 ops/sec ±0.17% (99 runs sampled)
encode: source-map-0.8.0 x 2,220 ops/sec ±0.37% (99 runs sampled)
Fastest is encode: local code
***
vscode.map - 2141001 segments
Decode Memory Usage:
local code 198955264 bytes
@jridgewell/sourcemap-codec 1.4.15 199175352 bytes
sourcemap-codec 199102688 bytes
source-map-0.6.1 386323432 bytes
source-map-0.8.0 244116432 bytes
chrome dev tools 293734280 bytes
Smallest memory usage is local code
Decode speed:
decode: local code x 3.90 ops/sec ±22.21% (15 runs sampled)
decode: @jridgewell/sourcemap-codec 1.4.15 x 3.95 ops/sec ±23.53% (15 runs sampled)
decode: sourcemap-codec x 3.82 ops/sec ±17.94% (14 runs sampled)
decode: source-map-0.6.1 x 0.61 ops/sec ±7.81% (6 runs sampled)
decode: source-map-0.8.0 x 9.54 ops/sec ±0.28% (28 runs sampled)
chrome dev tools x 2.18 ops/sec ±10.58% (10 runs sampled)
Fastest is decode: source-map-0.8.0
Encode Memory Usage:
local code 13509880 bytes
@jridgewell/sourcemap-codec 1.4.15 13537648 bytes
sourcemap-codec 32540104 bytes
source-map-0.6.1 127531040 bytes
source-map-0.8.0 127535312 bytes
Smallest memory usage is local code
Encode speed:
encode: local code x 20.10 ops/sec ±0.19% (38 runs sampled)
encode: @jridgewell/sourcemap-codec 1.4.15 x 20.26 ops/sec ±0.32% (38 runs sampled)
encode: sourcemap-codec x 5.44 ops/sec ±1.64% (18 runs sampled)
encode: source-map-0.6.1 x 2.30 ops/sec ±4.79% (10 runs sampled)
encode: source-map-0.8.0 x 2.46 ops/sec ±6.53% (10 runs sampled)
Fastest is encode: @jridgewell/sourcemap-codec 1.4.15
```
# License
MIT
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './chart-pie.js';
//# sourceMappingURL=pie-chart.js.map
@@ -0,0 +1,104 @@
import * as React from 'react';
import { Ref, RefObject } from 'react';
import { ForwardRefExoticComponent } from 'react';
import { RefAttributes } from 'react';
export declare type Axis = 'v' | 'h';
export declare type GapMode = 'padding' | 'margin';
export interface RemoveScrollEffectCallbacks {
onScrollCapture(event: any): void;
onWheelCapture(event: any): void;
onTouchMoveCapture(event: any): void;
}
export interface ChildrenNode {
/**
* if forwardProps is false - children should be ReactNode
* and it would be wrapper with a div
* @see {@link IRemoveScrollSelfProps.as}
*/
forwardProps?: false;
children: React.ReactNode;
}
export interface ChildrenForward {
/**
* if forwardProps is true - everything will be forwarded to a single child node
* otherwise - a Container, controlled by `as` prop will be rendered in place
* @default false
* @see {@link IRemoveScrollSelfProps.as}
*/
forwardProps: true;
children: React.ReactElement;
}
export interface IRemoveScrollSelfProps {
ref?: Ref<HTMLElement>;
/**
* prevents 'position="relative"' being set on body
* @default false
*/
noRelative?: boolean;
/**
* disables "event isolation" (suppressing of events happening outside of the Lock)
* @default false
*/
noIsolation?: boolean;
/**
* enabled complete Lock isolation using `pointer-events:none` for anything outside the Lock
* you probably don't need it, except you do
* @default false
* @see {IRemoveScrollSelfProps.noIsolation}
*/
inert?: boolean;
/**
* allows pinch-zoom, however might work not perfectly for normal scroll
*/
allowPinchZoom?: boolean;
/**
* switches on/off the behavior of the component
*/
enabled?: boolean;
/**
* Controls the body scroll bar removal
* @default false
*/
removeScrollBar?: boolean;
className?: string;
style?: React.CSSProperties;
/**
* array of refs to other Elements, which should be considered as a part of the Lock
*/
shards?: Array<React.RefObject<any> | HTMLElement>;
/**
* Control host node used for the lock.
* @default 'div'
*/
as?: string | React.ElementType;
/**
* controls the way "gap" is filled
* @default "margin"
*/
gapMode?: GapMode;
}
export declare type IRemoveScrollProps = IRemoveScrollSelfProps & (ChildrenForward | ChildrenNode);
export declare type IRemoveScrollUIProps = IRemoveScrollProps & {
sideCar: React.FC<any>;
};
export interface IRemoveScrollEffectProps {
noRelative?: boolean;
noIsolation?: boolean;
removeScrollBar?: boolean;
allowPinchZoom: boolean;
inert?: boolean;
shards?: Array<React.RefObject<any> | HTMLElement>;
lockRef: RefObject<HTMLElement>;
gapMode?: GapMode;
setCallbacks(cb: RemoveScrollEffectCallbacks): void;
}
interface WithClassNames {
classNames: {
fullWidth: string;
zeroRight: string;
};
}
declare type RefForwarded<T> = ForwardRefExoticComponent<T & RefAttributes<HTMLElement>> & WithClassNames;
export declare type RemoveScrollType = RefForwarded<IRemoveScrollProps>;
export declare type RemoveScrollUIType = RefForwarded<IRemoveScrollUIProps>;
export {};
@@ -0,0 +1 @@
module.exports={C:{"48":0.00959,"68":0.0048,"78":0.0048,"102":0.01439,"115":0.19184,"120":0.00959,"121":0.01439,"122":0.0048,"123":0.01439,"124":0.0048,"125":0.0048,"127":0.0048,"128":0.0048,"130":0.0048,"134":0.0048,"135":0.0048,"136":0.00959,"139":0.0048,"140":0.16306,"141":0.0048,"142":0.0048,"146":0.00959,"147":0.0048,"148":0.00959,"149":0.0048,"150":0.01918,"151":0.01439,"152":0.02398,"153":0.07674,"154":0.40766,"155":1.29492,"156":1.28533,"157":0.04316,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 126 129 131 132 133 137 138 143 144 145 158 159 160 3.5 3.6"},D:{"49":0.00959,"67":0.0048,"70":0.00959,"87":0.01439,"103":0.06235,"104":0.04316,"105":0.04316,"106":0.04316,"107":0.04316,"108":0.04316,"109":0.32133,"110":0.04316,"111":0.04796,"112":0.04316,"114":0.0048,"116":0.13908,"117":0.04316,"118":0.09112,"119":0.01918,"120":0.07194,"121":0.02398,"122":0.07194,"123":0.00959,"124":0.05755,"125":0.09592,"126":0.01439,"127":0.0048,"128":0.04316,"129":0.0048,"130":0.01439,"131":0.09592,"132":0.00959,"133":0.12949,"134":0.05276,"135":0.05276,"136":0.06235,"137":0.08633,"138":0.16786,"139":0.05755,"140":0.07674,"141":0.08633,"142":0.17745,"143":0.03837,"144":0.07674,"145":0.08153,"146":0.06235,"147":0.07674,"148":0.19184,"149":0.19664,"150":0.65705,"151":1.69778,"152":8.67117,"153":8.37861,"154":2.23494,"155":0.03837,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 68 69 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 113 115 156 157"},F:{"46":0.0048,"48":0.0048,"95":0.0048,"101":0.01439,"102":0.0048,"107":0.0048,"133":0.00959,"134":0.10072,"135":0.7146,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 100 103 104 105 106 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.0048,"109":0.02878,"114":0.0048,"119":0.00959,"120":0.00959,"121":0.0048,"122":0.00959,"123":0.0048,"125":0.0048,"128":0.0048,"129":0.0048,"131":0.0048,"132":0.0048,"133":0.0048,"134":0.0048,"135":0.00959,"136":0.0048,"138":0.0048,"139":0.0048,"140":0.00959,"141":0.00959,"142":0.01439,"143":0.01918,"144":0.01918,"145":0.01439,"146":0.01439,"147":0.01918,"148":0.01918,"149":0.03837,"150":0.10072,"151":0.33572,"152":3.28526,"153":4.18691,"154":1.15104,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 124 126 127 130 137"},E:{"14":0.0048,"27":0.30694,_:"4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 15.1 15.2-15.3 27.1 TP","12.1":0.00959,"13.1":0.01918,"14.1":0.03357,"15.4":0.0048,"15.5":0.0048,"15.6":0.19664,"16.0":0.0048,"16.1":0.00959,"16.2":0.00959,"16.3":0.01439,"16.4":0.0048,"16.5":0.01918,"16.6":0.235,"17.0":0.0048,"17.1":0.21102,"17.2":0.01439,"17.3":0.01918,"17.4":0.02878,"17.5":0.04316,"17.6":0.26378,"18.0":0.01439,"18.1":0.02878,"18.2":0.01918,"18.3":0.05276,"18.4":0.04316,"18.5-18.7":0.07674,"26.0":0.02878,"26.1":0.02878,"26.2":0.1151,"26.3":0.15827,"26.4":0.09112,"26.5":0.58511,"26.6":2.73852,"27.2":0.0048},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00189,"5.0-5.1":0.00189,"6.0-6.1":0,"7.0-7.1":0.00377,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01886,"11.0-11.2":0.00189,"11.3-11.4":0.00377,"12.0-12.1":0,"12.2-12.5":0.04903,"13.0-13.1":0,"13.2":0.00943,"13.3":0,"13.4-13.7":0.00189,"14.0-14.4":0.00754,"14.5-14.8":0.01132,"15.0-15.1":0.01132,"15.2-15.3":0.00754,"15.4":0.00943,"15.5":0.01132,"15.6-15.8":0.24517,"16.0":0.01886,"16.1":0.03395,"16.2":0.01886,"16.3":0.04149,"16.4":0.00943,"16.5":0.01509,"16.6-16.7":0.34135,"17.0":0.0132,"17.1":0.01886,"17.2":0.01886,"17.3":0.02829,"17.4":0.0396,"17.5":0.07732,"17.6-17.7":0.19991,"18.0":0.04149,"18.1":0.08298,"18.2":0.11316,"18.3":0.19614,"18.4":0.12259,"18.5-18.7":2.5328,"26.0":0.12259,"26.1":0.12447,"26.2":0.32438,"26.3":0.35078,"26.4":0.25649,"26.5":1.71808,"26.6":10.60081,"27.0":0.81284,"27.1":0,"27.2":0.02075},P:{"21":0.00885,"22":0.00885,"23":0.0177,"24":0.00885,"26":0.04424,"27":0.0177,"28":0.03539,"29":0.07963,"30":2.91993,_:"4 20 25 5.0-5.4 6.2-6.4 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.00885,"8.2":0.00885},I:{"0":0.026,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},K:{"0":0.17694,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 Line truncated