docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped

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,52 @@
{
"name": "content-type",
"version": "2.0.0",
"description": "Create and parse HTTP Content-Type header",
"keywords": [
"content-type",
"http",
"req",
"res",
"rfc7231",
"rfc9110"
],
"repository": "jshttp/content-type",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
},
"license": "MIT",
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
"type": "commonjs",
"exports": "./dist/index.js",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"files": [
"dist/"
],
"scripts": {
"bench": "vitest bench",
"build": "ts-scripts build",
"format": "ts-scripts format",
"prepare": "ts-scripts install && npm run build",
"specs": "ts-scripts specs",
"test": "ts-scripts test"
},
"devDependencies": {
"@borderless/ts-scripts": "^0.15.0",
"@vitest/coverage-v8": "^3.0.5",
"typescript": "^5.7.3",
"vitest": "^3.2.4"
},
"engines": {
"node": ">=18"
},
"ts-scripts": {
"dist": [
"dist"
],
"project": [
"tsconfig.build.json"
]
}
}
@@ -0,0 +1 @@
{"version":3,"file":"bookmark-minus.js","sources":["../../../src/icons/bookmark-minus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BookmarkMinus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTkgMjEtNy00LTcgNFY1YTIgMiAwIDAgMSAyLTJoMTBhMiAyIDAgMCAxIDIgMnYxNnoiIC8+CiAgPGxpbmUgeDE9IjE1IiB4Mj0iOSIgeTE9IjEwIiB5Mj0iMTAiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/bookmark-minus\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst BookmarkMinus = createLucideIcon('BookmarkMinus', [\n ['path', { d: 'm19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z', key: '1fy3hk' }],\n ['line', { x1: '15', x2: '9', y1: '10', y2: '10', key: '1gty7f' }],\n]);\n\nexport default BookmarkMinus;\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,CAAuD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACpF,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,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,25 @@
/**
* @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 Rabbit = createLucideIcon("Rabbit", [
["path", { d: "M13 16a3 3 0 0 1 2.24 5", key: "1epib5" }],
["path", { d: "M18 12h.01", key: "yjnet6" }],
[
"path",
{
d: "M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3",
key: "ue9ozu"
}
],
["path", { d: "M20 8.54V4a2 2 0 1 0-4 0v3", key: "49iql8" }],
["path", { d: "M7.612 12.524a3 3 0 1 0-1.6 4.3", key: "1e33i0" }]
]);
export { Rabbit as default };
//# sourceMappingURL=rabbit.js.map
@@ -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 Cannabis = createLucideIcon("Cannabis", [
["path", { d: "M12 22v-4", key: "1utk9m" }],
[
"path",
{
d: "M7 12c-1.5 0-4.5 1.5-5 3 3.5 1.5 6 1 6 1-1.5 1.5-2 3.5-2 5 2.5 0 4.5-1.5 6-3 1.5 1.5 3.5 3 6 3 0-1.5-.5-3.5-2-5 0 0 2.5.5 6-1-.5-1.5-3.5-3-5-3 1.5-1 4-4 4-6-2.5 0-5.5 1.5-7 3 0-2.5-.5-5-2-7-1.5 2-2 4.5-2 7-1.5-1.5-4.5-3-7-3 0 2 2.5 5 4 6",
key: "1mezod"
}
]
]);
export { Cannabis as default };
//# sourceMappingURL=cannabis.js.map
@@ -0,0 +1,700 @@
import {DeprecationOrId, Version} from '../deprecations';
import {Logger} from '../logger';
import {LegacyImporter} from './importer';
import {LegacyFunction} from './function';
import {NodePackageImporter} from '../importer';
/**
* Options for {@link render} and {@link renderSync} that are shared between
* {@link LegacyFileOptions} and {@link LegacyStringOptions}.
*
* @typeParam sync - This lets the TypeScript checker verify that {@link
* LegacyAsyncImporter}s and {@link LegacyAsyncFunction}s aren't passed to
* {@link renderSync}.
*
* @category Legacy
* @deprecated This only works with the legacy {@link render} and {@link
* renderSync} APIs. Use {@link Options} with {@link compile}, {@link
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
*/
export interface LegacySharedOptions<sync extends 'sync' | 'async'> {
/**
* This array of strings option provides [load
* paths](https://sass-lang.com/documentation/at-rules/import#load-paths) for
* Sass to look for stylesheets. Earlier load paths will take precedence over
* later ones.
*
* ```js
* sass.renderSync({
* file: "style.scss",
* includePaths: ["node_modules/bootstrap/dist/css"]
* });
* ```
*
* Load paths are also loaded from the `SASS_PATH` environment variable, if
* it’s set. This variable should be a list of paths separated by `;` (on
* Windows) or `:` (on other operating systems). Load paths from the
* `includePaths` option take precedence over load paths from `SASS_PATH`.
*
* ```sh
* $ SASS_PATH=node_modules/bootstrap/dist/css sass style.scss style.css
* ```
*
* @category Input
* @compatibility feature: "SASS_PATH", dart: "1.15.0", node: "3.9.0"
*
* Earlier versions of Dart Sass and Node Sass didn’t support the `SASS_PATH`
* environment variable.
*/
includePaths?: string[];
/**
* Whether the generated CSS should use spaces or tabs for indentation.
*
* ```js
* const result = sass.renderSync({
* file: "style.scss",
* indentType: "tab",
* indentWidth: 1
* });
*
* result.css.toString();
* // "h1 {\n\tfont-size: 40px;\n}\n"
* ```
*
* @defaultValue `'space'`
* @category Output
* @compatibility dart: true, node: "3.0.0"
*/
indentType?: 'space' | 'tab';
/**
* How many spaces or tabs (depending on {@link indentType}) should be used
* per indentation level in the generated CSS. It must be between 0 and 10
* (inclusive).
*
* @defaultValue `2`
* @category Output
* @compatibility dart: true, node: "3.0.0"
*/
indentWidth?: number;
/**
* Which character sequence to use at the end of each line in the generated
* CSS. It can have the following values:
*
* * `'lf'` uses U+000A LINE FEED.
* * `'lfcr'` uses U+000A LINE FEED followed by U+000D CARRIAGE RETURN.
* * `'cr'` uses U+000D CARRIAGE RETURN.
* * `'crlf'` uses U+000D CARRIAGE RETURN followed by U+000A LINE FEED.
*
* @defaultValue `'lf'`
* @category Output
* @compatibility dart: true, node: "3.0.0"
*/
linefeed?: 'cr' | 'crlf' | 'lf' | 'lfcr';
/**
* If `true`, Sass won't add a link from the generated CSS to the source map.
*
* ```js
* const result = sass.renderSync({
* file: "style.scss",
* sourceMap: "out.map",
* omitSourceMapUrl: true
* })
* console.log(result.css.toString());
* // h1 {
* // font-size: 40px;
* // }
* ```
*
* @defaultValue `false`
* @category Source Maps
*/
omitSourceMapUrl?: boolean;
/**
* The location that Sass expects the generated CSS to be saved to. It’s used
* to determine the URL used to link from the generated CSS to the source map,
* and from the source map to the Sass source files.
*
* **Heads up!** Despite the name, Sass does *not* write the CSS output to
* this file. The caller must do that themselves.
*
* ```js
* result = sass.renderSync({
* file: "style.scss",
* sourceMap: true,
* outFile: "out.css"
* })
* console.log(result.css.toString());
* // h1 {
* // font-size: 40px;
* // }
* // /*# sourceMappingURL=out.css.map * /
* ```
*
* @category Source Maps
*/
outFile?: string;
/**
* The output style of the compiled CSS. There are four possible output styles:
*
* * `"expanded"` (the default for Dart Sass) writes each selector and
* declaration on its own line.
*
* * `"compressed"` removes as many extra characters as possible, and writes
* the entire stylesheet on a single line.
*
* * `"nested"` (the default for Node Sass, not supported by Dart Sass)
* indents CSS rules to match the nesting of the Sass source.
*
* * `"compact"` (not supported by Dart Sass) puts each CSS rule on its own single line.
*
* @example
*
* ```js
* const source = `
* h1 {
* font-size: 40px;
* code {
* font-face: Roboto Mono;
* }
* }`;
*
* let result = sass.renderSync({
* data: source,
* outputStyle: "expanded"
* });
* console.log(result.css.toString());
* // h1 {
* // font-size: 40px;
* // }
* // h1 code {
* // font-face: Roboto Mono;
* // }
*
* result = sass.renderSync({
* data: source,
* outputStyle: "compressed"
* });
* console.log(result.css.toString());
* // h1{font-size:40px}h1 code{font-face:Roboto Mono}
*
* result = sass.renderSync({
* data: source,
* outputStyle: "nested"
* });
* console.log(result.css.toString());
* // h1 {
* // font-size: 40px; }
* // h1 code {
* // font-face: Roboto Mono; }
*
* result = sass.renderSync({
* data: source,
* outputStyle: "compact"
* });
* console.log(result.css.toString());
* // h1 { font-size: 40px; }
* // h1 code { font-face: Roboto Mono; }
* ```
*
* @category Output
*/
outputStyle?: 'compressed' | 'expanded' | 'nested' | 'compact';
/**
* Whether or not Sass should generate a source map. If it does, the source
* map will be available as {@link LegacyResult.map} (unless {@link
* sourceMapEmbed} is `true`).
*
* If this option is a string, it’s the path that the source map is expected
* to be written to, which is used to link to the source map from the
* generated CSS and to link *from* the source map to the Sass source files.
* Note that if `sourceMap` is a string and {@link outFile} isn’t passed, Sass
* assumes that the CSS will be written to the same directory as the file
* option if it’s passed.
*
* If this option is `true`, the path is assumed to be {@link outFile} with
* `.map` added to the end. If it’s `true` and {@link outFile} isn’t passed,
* it has no effect.
*
* @example
*
* ```js
* let result = sass.renderSync({
* file: "style.scss",
* sourceMap: "out.map"
* })
* console.log(result.css.toString());
* // h1 {
* // font-size: 40px;
* // }
* // /*# sourceMappingURL=out.map * /
*
* result = sass.renderSync({
* file: "style.scss",
* sourceMap: true,
* outFile: "out.css"
* })
* console.log(result.css.toString());
* // h1 {
* // font-size: 40px;
* // }
* // /*# sourceMappingURL=out.css.map * /
* ```
*
* @defaultValue `false`
* @category Source Maps
*/
sourceMap?: boolean | string;
/**
* Whether to embed the entire contents of the Sass files that contributed to
* the generated CSS in the source map. This may produce very large source
* maps, but it guarantees that the source will be available on any computer
* no matter how the CSS is served.
*
* @example
*
* ```js
* sass.renderSync({
* file: "style.scss",
* sourceMap: "out.map",
* sourceMapContents: true
* })
* ```
*
* @defaultValue `false`
* @category Source Maps
*/
sourceMapContents?: boolean;
/**
* Whether to embed the contents of the source map file in the generated CSS,
* rather than creating a separate file and linking to it from the CSS.
*
* @example
*
* ```js
* sass.renderSync({
* file: "style.scss",
* sourceMap: "out.map",
* sourceMapEmbed: true
* });
* ```
*
* @defaultValue `false`
* @category Source Maps
*/
sourceMapEmbed?: boolean;
/**
* If this is passed, it's prepended to all the links from the source map to
* the Sass source files.
*
* @category Source Maps
*/
sourceMapRoot?: string;
/**
* Additional handler(s) for loading files when a [`@use`
* rule](https://sass-lang.com/documentation/at-rules/use) or an [`@import`
* rule](https://sass-lang.com/documentation/at-rules/import) is encountered.
* It can either be a single {@link LegacyImporter} function, or an array of
* {@link LegacyImporter}s.
*
* Importers take the URL of the `@import` or `@use` rule and return a {@link
* LegacyImporterResult} indicating how to handle that rule. For more details,
* see {@link LegacySyncImporter} and {@link LegacyAsyncImporter}.
*
* Loads are resolved by trying, in order:
*
* * Loading a file from disk relative to the file in which the `@use` or
* `@import` appeared.
*
* * Each custom importer.
*
* * Loading a file relative to the current working directory.
*
* * Each load path in {@link includePaths}.
*
* * Each load path specified in the `SASS_PATH` environment variable, which
* should be semicolon-separated on Windows and colon-separated elsewhere.
*
* @example
*
* ```js
* sass.render({
* file: "style.scss",
* importer: [
* // This importer uses the synchronous API, and can be passed to either
* // renderSync() or render().
* function(url, prev) {
* // This generates a stylesheet from scratch for `@use "big-headers"`.
* if (url != "big-headers") return null;
*
* return {
* contents: `
* h1 {
* font-size: 40px;
* }`
* };
* },
*
* // This importer uses the asynchronous API, and can only be passed to
* // render().
* function(url, prev, done) {
* // Convert `@use "foo/bar"` to "node_modules/foo/sass/bar".
* const components = url.split('/');
* const innerPath = components.slice(1).join('/');
* done({
* file: `node_modules/${components.first}/sass/${innerPath}`
* });
* }
* ]
* }, function(err, result) {
* // ...
* });
* ```
*
* @category Plugins
* @compatibility dart: true, node: "3.0.0"
*
* Versions of Node Sass before 3.0.0 don’t support arrays of importers, nor
* do they support importers that return `Error` objects.
*
* Versions of Node Sass before 2.0.0 don’t support the `importer` option at
* all.
*
* @compatibility feature: "Import order", dart: "1.20.2", node: false
*
* Versions of Dart Sass before 1.20.2 preferred resolving imports using
* {@link includePaths} before resolving them using custom importers.
*
* All versions of Node Sass currently pass imports to importers before
* loading them relative to the file in which the `@import` appears. This
* behavior is considered incorrect and should not be relied on because it
* violates the principle of *locality*, which says that it should be possible
* to reason about a stylesheet without knowing everything about how the
* entire system is set up. If a user tries to import a stylesheet relative to
* another stylesheet, that import should *always* work. It shouldn’t be
* possible for some configuration somewhere else to break it.
*/
importer?: LegacyImporter<sync> | LegacyImporter<sync>[];
/**
* Additional built-in Sass functions that are available in all stylesheets.
* This option takes an object whose keys are Sass function signatures and
* whose values are {@link LegacyFunction}s. Each function should take the
* same arguments as its signature.
*
* Functions are passed subclasses of {@link LegacyValue}, and must return the
* same.
*
* **Heads up!** When writing custom functions, it’s important to ensure that
* all the arguments are the types you expect. Otherwise, users’ stylesheets
* could crash in hard-to-debug ways or, worse, compile to meaningless CSS.
*
* @example
*
* ```js
* sass.render({
* data: `
* h1 {
* font-size: pow(2, 5) * 1px;
* }`,
* functions: {
* // This function uses the synchronous API, and can be passed to either
* // renderSync() or render().
* 'pow($base, $exponent)': function(base, exponent) {
* if (!(base instanceof sass.types.Number)) {
* throw "$base: Expected a number.";
* } else if (base.getUnit()) {
* throw "$base: Expected a unitless number.";
* }
*
* if (!(exponent instanceof sass.types.Number)) {
* throw "$exponent: Expected a number.";
* } else if (exponent.getUnit()) {
* throw "$exponent: Expected a unitless number.";
* }
*
* return new sass.types.Number(
* Math.pow(base.getValue(), exponent.getValue()));
* },
*
* // This function uses the asynchronous API, and can only be passed to
* // render().
* 'sqrt($number)': function(number, done) {
* if (!(number instanceof sass.types.Number)) {
* throw "$number: Expected a number.";
* } else if (number.getUnit()) {
* throw "$number: Expected a unitless number.";
* }
*
* done(new sass.types.Number(Math.sqrt(number.getValue())));
* }
* }
* }, function(err, result) {
* console.log(result.css.toString());
* // h1 {
* // font-size: 32px;
* // }
* });
* ```
*
* @category Plugins
*/
functions?: {[key: string]: LegacyFunction<sync>};
/**
* By default, if the CSS document contains non-ASCII characters, Sass adds a
* `@charset` declaration (in expanded output mode) or a byte-order mark (in
* compressed mode) to indicate its encoding to browsers or other consumers.
* If `charset` is `false`, these annotations are omitted.
*
* @category Output
* @compatibility dart: "1.39.0", node: false
*/
charset?: boolean;
/**
* If this option is set to `true`, Sass won’t print warnings that are caused
* by dependencies. A “dependency” is defined as any file that’s loaded
* through {@link includePaths} or {@link importer}. Stylesheets that are
* imported relative to the entrypoint are not considered dependencies.
*
* This is useful for silencing deprecation warnings that you can’t fix on
* your own. However, please <em>also</em> notify your dependencies of the deprecations
* so that they can get fixed as soon as possible!
*
* **Heads up!** If {@link render} or {@link renderSync} is called without
* {@link LegacyFileOptions.file} or {@link LegacyStringOptions.file},
* <em>all</em> stylesheets it loads will be considered dependencies. Since it
* doesn’t have a path of its own, everything it loads is coming from a load
* path rather than a relative import.
*
* @defaultValue `false`
* @category Messages
* @compatibility dart: "1.35.0", node: false
*/
quietDeps?: boolean;
/**
* A set of deprecations to treat as fatal.
*
* If a deprecation warning of any provided type is encountered during
* compilation, the compiler will error instead.
*
* If a `Version` is provided, then all deprecations that were active in that
* compiler version will be treated as fatal.
*
* @category Messages
* @compatiblity dart: "1.78.0", node: false
*/
fatalDeprecations?: (DeprecationOrId | Version)[];
/**
* A set of future deprecations to opt into early.
*
* Future deprecations passed here will be treated as active by the compiler,
* emitting warnings as necessary.
*
* @category Messages
* @compatiblity dart: "1.78.0", node: false
*/
futureDeprecations?: DeprecationOrId[];
/**
* A set of active deprecations to ignore.
*
* If a deprecation warning of any provided type is encountered during
* compilation, the compiler will ignore it instead.
*
* **Heads up!** The deprecated functionality you're depending on will
* eventually break.
*
* @category Messages
* @compatiblity dart: "1.78.0", node: false
*/
silenceDeprecations?: DeprecationOrId[];
/**
* By default, Dart Sass will print only five instances of the same
* deprecation warning per compilation to avoid deluging users in console
* noise. If you set `verbose` to `true`, it will instead print every
* deprecation warning it encounters.
*
* @defaultValue `false`
* @category Messages
* @compatibility dart: "1.35.0", node: false
*/
verbose?: boolean;
/**
* An object to use to handle warnings and/or debug messages from Sass.
*
* By default, Sass emits warnings and debug messages to standard error, but
* if {@link Logger.warn} or {@link Logger.debug} is set, this will invoke
* them instead.
*
* The special value {@link Logger.silent} can be used to easily silence all
* messages.
*
* @category Messages
* @compatibility dart: "1.43.0", node: false
*/
logger?: Logger;
/**
* If this option is set to an instance of `NodePackageImporter`, Sass will
* use the built-in Node.js package importer to resolve Sass files with a
* `pkg:` URL scheme. Details for library authors and users can be found in
* the {@link NodePackageImporter} documentation.
*
* @example
* ```js
* sass.renderSync({
* data: '@use "pkg:vuetify";',
* pkgImporter: new sass.NodePackageImporter()
* });
* ```
* @category Plugins
* @compatibility dart: "2.0", node: false
*/
pkgImporter?: NodePackageImporter;
}
/**
* If {@link file} is passed without {@link data}, Sass will load the stylesheet
* at {@link file} and compile it to CSS.
*
* @typeParam sync - This lets the TypeScript checker verify that {@link
* LegacyAsyncImporter}s and {@link LegacyAsyncFunction}s aren't passed to
* {@link renderSync}.
*/
export interface LegacyFileOptions<sync extends 'sync' | 'async'>
extends LegacySharedOptions<sync> {
/**
* The path to the file for Sass to load and compile. If the file’s extension
* is `.scss`, it will be parsed as SCSS; if it’s `.sass`, it will be parsed
* as the indented syntax; and if it’s `.css`, it will be parsed as plain CSS.
* If it has no extension, it will be parsed as SCSS.
*
* @example
*
* ```js
* sass.renderSync({file: "style.scss"});
* ```
*
* @category Input
* @compatibility feature: "Plain CSS files", dart: "1.11.0", node: "partial"
*
* Node Sass and older versions of Dart Sass support loading files with the
* extension `.css`, but contrary to the specification they’re treated as SCSS
* files rather than being parsed as CSS. This behavior has been deprecated
* and should not be relied on. Any files that use Sass features should use
* the `.scss` extension.
*
* All versions of Node Sass and Dart Sass otherwise support the file option
* as described below.
*/
file: string;
/**
* See {@link LegacyStringOptions.file} for documentation of passing {@link
* file} along with {@link data}.
*
* @category Input
*/
data?: never;
}
/**
* If {@link data} is passed, Sass will use it as the contents of the stylesheet
* to compile.
*
* @typeParam sync - This lets the TypeScript checker verify that {@link
* LegacyAsyncImporter}s and {@link LegacyAsyncFunction}s aren't passed to
* {@link renderSync}.
*
* @category Legacy
* @deprecated This only works with the legacy {@link render} and {@link
* renderSync} APIs. Use {@link StringOptions} with {@link compile}, {@link
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
*/
export interface LegacyStringOptions<sync extends 'sync' | 'async'>
extends LegacySharedOptions<sync> {
/**
* The contents of the stylesheet to compile. Unless {@link file} is passed as
* well, the stylesheet’s URL is set to `"stdin"`.
*
* By default, this stylesheet is parsed as SCSS. This can be controlled using
* {@link indentedSyntax}.
*
* @example
*
* ```js
* sass.renderSync({
* data: `
* h1 {
* font-size: 40px;
* }`
* });
* ```
*
* @category Input
*/
data: string;
/**
* If `file` and {@link data} are both passed, `file` is used as the path of
* the stylesheet for error reporting, but {@link data} is used as the
* contents of the stylesheet. In this case, `file`’s extension is not used to
* determine the syntax of the stylesheet.
*
* @category Input
*/
file?: string;
/**
* This flag controls whether {@link data} is parsed as the indented syntax or
* not.
*
* @example
*
* ```js
* sass.renderSync({
* data: `
* h1
* font-size: 40px`,
* indentedSyntax: true
* });
* ```
*
* @defaultValue `false`
* @category Input
*/
indentedSyntax?: boolean;
}
/**
* Options for {@link render} and {@link renderSync}. This can either be {@link
* LegacyFileOptions} to load a file from disk, or {@link LegacyStringOptions}
* to compile a string of Sass code.
*
* See {@link LegacySharedOptions} for options that are shared across both file
* and string inputs.
*
* @category Legacy
* @deprecated This only works with the legacy {@link render} and {@link
* renderSync} APIs. Use {@link Options} with {@link compile}, {@link
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead.
*/
export type LegacyOptions<sync extends 'sync' | 'async'> =
| LegacyFileOptions<sync>
| LegacyStringOptions<sync>;
@@ -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 Airplay = createLucideIcon("Airplay", [
[
"path",
{
d: "M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1",
key: "ns4c3b"
}
],
["path", { d: "m12 15 5 6H7Z", key: "14qnn2" }]
]);
export { Airplay as default };
//# sourceMappingURL=airplay.js.map
@@ -0,0 +1,224 @@
/**
* @fileoverview Rule to disallow returning values from setters
* @author Milos Djermanovic
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Determines whether the given node is an argument of the specified global method call, at the given `index` position.
* E.g., for given `index === 1`, this function checks for `objectName.methodName(foo, node)`, where objectName is a global variable.
* @param {ASTNode} node The node to check.
* @param {SourceCode} sourceCode Source code to which the node belongs.
* @param {string} objectName Name of the global object.
* @param {string} methodName Name of the method.
* @param {number} index The given position.
* @returns {boolean} `true` if the node is argument at the given position.
*/
function isArgumentOfGlobalMethodCall(
node,
sourceCode,
objectName,
methodName,
index,
) {
const callNode = node.parent;
return (
callNode.type === "CallExpression" &&
callNode.arguments[index] === node &&
astUtils.isSpecificMemberAccess(
callNode.callee,
objectName,
methodName,
) &&
sourceCode.isGlobalReference(
astUtils.skipChainExpression(callNode.callee).object,
)
);
}
/**
* Determines whether the given node is used as a property descriptor.
* @param {ASTNode} node The node to check.
* @param {SourceCode} sourceCode Source code to which the node belongs.
* @returns {boolean} `true` if the node is a property descriptor.
*/
function isPropertyDescriptor(node, sourceCode) {
if (
isArgumentOfGlobalMethodCall(
node,
sourceCode,
"Object",
"defineProperty",
2,
) ||
isArgumentOfGlobalMethodCall(
node,
sourceCode,
"Reflect",
"defineProperty",
2,
)
) {
return true;
}
const parent = node.parent;
if (parent.type === "Property" && parent.value === node) {
const grandparent = parent.parent;
if (
grandparent.type === "ObjectExpression" &&
(isArgumentOfGlobalMethodCall(
grandparent,
sourceCode,
"Object",
"create",
1,
) ||
isArgumentOfGlobalMethodCall(
grandparent,
sourceCode,
"Object",
"defineProperties",
1,
))
) {
return true;
}
}
return false;
}
/**
* Determines whether the given function node is used as a setter function.
* @param {ASTNode} node The node to check.
* @param {SourceCode} sourceCode Source code to which the node belongs.
* @returns {boolean} `true` if the node is a setter.
*/
function isSetter(node, sourceCode) {
const parent = node.parent;
if (
(parent.type === "Property" || parent.type === "MethodDefinition") &&
parent.kind === "set" &&
parent.value === node
) {
// Setter in an object literal or in a class
return true;
}
if (
parent.type === "Property" &&
parent.value === node &&
astUtils.getStaticPropertyName(parent) === "set" &&
parent.parent.type === "ObjectExpression" &&
isPropertyDescriptor(parent.parent, sourceCode)
) {
// Setter in a property descriptor
return true;
}
return false;
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
docs: {
description: "Disallow returning values from setters",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-setter-return",
},
schema: [],
messages: {
returnsValue: "Setter cannot return a value.",
},
},
create(context) {
let funcInfo = null;
const sourceCode = context.sourceCode;
/**
* Creates and pushes to the stack a function info object for the given function node.
* @param {ASTNode} node The function node.
* @returns {void}
*/
function enterFunction(node) {
funcInfo = {
upper: funcInfo,
isSetter: isSetter(node, sourceCode),
};
}
/**
* Pops the current function info object from the stack.
* @returns {void}
*/
function exitFunction() {
funcInfo = funcInfo.upper;
}
/**
* Reports the given node.
* @param {ASTNode} node Node to report.
* @returns {void}
*/
function report(node) {
context.report({ node, messageId: "returnsValue" });
}
return {
/*
* Function declarations cannot be setters, but we still have to track them in the `funcInfo` stack to avoid
* false positives, because a ReturnStatement node can belong to a function declaration inside a setter.
*
* Note: A previously declared function can be referenced and actually used as a setter in a property descriptor,
* but that's out of scope for this rule.
*/
FunctionDeclaration: enterFunction,
FunctionExpression: enterFunction,
ArrowFunctionExpression(node) {
enterFunction(node);
if (funcInfo.isSetter && node.expression) {
// { set: foo => bar } property descriptor. Report implicit return 'bar' as the equivalent for a return statement.
report(node.body);
}
},
"FunctionDeclaration:exit": exitFunction,
"FunctionExpression:exit": exitFunction,
"ArrowFunctionExpression:exit": exitFunction,
ReturnStatement(node) {
// Global returns (e.g., at the top level of a Node module) don't have `funcInfo`.
if (funcInfo && funcInfo.isSetter && node.argument) {
report(node);
}
},
};
},
};
@@ -0,0 +1,82 @@
import type * as errors from "./errors.js";
import type * as schemas from "./schemas.js";
import type { Class, ProtoOf } from "./util.js";
type ZodTrait = {
_zod: {
def: any;
[k: string]: any;
};
};
export interface $constructor<T extends ZodTrait, D = T["_zod"]["def"]> {
new (def: D): T;
init(inst: T, def: D): asserts inst is T;
}
export interface $constructorParams {
Parent?: typeof Class;
}
/** A special constant with type `never` */
export declare const NEVER: never;
export declare function $constructor<T extends ZodTrait, D = T["_zod"]["def"]>(name: string, initializer: (inst: T, def: D) => void,
/** This trait's members, installed once on every prototype that composes it. They cannot be declared in the initializer above: that runs per instance, and the prototype is shared. */
proto?: ProtoOf<T>, params?: $constructorParams): $constructor<T, D>;
export declare const $brand: unique symbol;
export type $brand<T extends string | number | symbol = string | number | symbol> = {
[$brand]: {
[k in T]: true;
};
};
export type $ZodBranded<T extends schemas.SomeType, Brand extends string | number | symbol, Dir extends "in" | "out" | "inout" = "out"> = T & (Dir extends "inout" ? {
_zod: {
input: input<T> & $brand<Brand>;
output: output<T> & $brand<Brand>;
};
} : Dir extends "in" ? {
_zod: {
input: input<T> & $brand<Brand>;
};
} : {
_zod: {
output: output<T> & $brand<Brand>;
};
});
export type $ZodNarrow<T extends schemas.SomeType, Out> = T & {
_zod: {
output: Out;
};
};
export declare class $ZodAsyncError extends Error {
constructor();
}
export declare class $ZodEncodeError extends Error {
constructor(name: string);
}
export type input<T> = T extends {
_zod: {
input: any;
};
} ? T["_zod"]["input"] : unknown;
export type output<T> = T extends {
_zod: {
output: any;
};
} ? T["_zod"]["output"] : unknown;
export type { output as infer };
export interface $ZodConfig {
/** Custom error map. Overrides `config().localeError`. */
customError?: errors.$ZodErrorMap | undefined;
/** Localized error map. Lowest priority. */
localeError?: errors.$ZodErrorMap | undefined;
/** Disable JIT schema compilation. Useful in environments that disallow `eval`. */
jitless?: boolean | undefined;
/** Enables parsing input that contains reference cycles. Read when a schema is constructed. */
memoizer?: schemas.$ZodMemoizer | undefined;
/**
* Internal: post-processor invoked on every freshly-constructed schema
* instance, after init and deferred fns run. Set by `import "zod/compile"`
* to install AOT compilation. Not part of the public API.
* @internal
*/
postProcessor?: ((inst: any) => void) | undefined;
}
export declare const globalConfig: $ZodConfig;
export declare function config(newConfig?: Partial<$ZodConfig>): $ZodConfig;
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_IB","161":"_LC"},B:{"2":"_K","161":"_I"},C:{"2":"_S"},D:{"2":"_Q"},E:{"2":"_R"},F:{"2":"_c"},G:{"2":"_M"},H:{"2":"1D"},I:{"2":"_P"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"2":"YC"},N:{"16":"_A"},O:{"2":"bC"},P:{"2":"_F"},Q:{"2":"JE"},R:{"2":"KE"},S:{"2":"_C"}},B:5,C:"CSS Text 4 text-spacing",D:false};
@@ -0,0 +1,124 @@
import { describe, expect, it } from "vitest";
import be from "../../../locales/be.js";
describe("Belarusian localization", () => {
const localeError = be().localeError;
describe("pluralization rules", () => {
for (const { type, cases } of TEST_CASES) {
describe(`${type} pluralization`, () => {
for (const { count, expected } of cases) {
it(`correctly pluralizes ${count} ${type}`, () => {
const error = localeError({
code: "too_small",
minimum: count,
type: "number",
inclusive: true,
path: [],
origin: type,
input: count - 1,
});
expect(error).toContain(expected);
});
}
});
}
it("handles negative numbers correctly", () => {
const error = localeError({
code: "too_small",
minimum: -2,
type: "number",
inclusive: true,
path: [],
origin: "array",
input: -3,
});
expect(error).toContain("-2 элементы");
});
it("handles zero correctly", () => {
const error = localeError({
code: "too_small",
minimum: 0,
type: "number",
inclusive: true,
path: [],
origin: "array",
input: -1,
});
expect(error).toContain("0 элементаў");
});
it("handles bigint values correctly", () => {
const error = localeError({
code: "too_small",
minimum: BigInt(21),
type: "number",
inclusive: true,
path: [],
origin: "array",
input: BigInt(20),
});
expect(error).toContain("21 элемент");
});
});
});
const TEST_CASES = [
{
type: "array",
cases: [
{ count: 1, expected: "1 элемент" },
{ count: 2, expected: "2 элементы" },
{ count: 5, expected: "5 элементаў" },
{ count: 11, expected: "11 элементаў" },
{ count: 21, expected: "21 элемент" },
{ count: 22, expected: "22 элементы" },
{ count: 25, expected: "25 элементаў" },
{ count: 101, expected: "101 элемент" },
{ count: 111, expected: "111 элементаў" },
],
},
{
type: "set",
cases: [
{ count: 1, expected: "1 элемент" },
{ count: 2, expected: "2 элементы" },
{ count: 5, expected: "5 элементаў" },
{ count: 11, expected: "11 элементаў" },
{ count: 21, expected: "21 элемент" },
{ count: 22, expected: "22 элементы" },
{ count: 25, expected: "25 элементаў" },
{ count: 101, expected: "101 элемент" },
{ count: 111, expected: "111 элементаў" },
],
},
{
type: "string",
cases: [
{ count: 1, expected: "1 сімвал" },
{ count: 2, expected: "2 сімвалы" },
{ count: 5, expected: "5 сімвалаў" },
{ count: 11, expected: "11 сімвалаў" },
{ count: 21, expected: "21 сімвал" },
{ count: 22, expected: "22 сімвалы" },
{ count: 25, expected: "25 сімвалаў" },
],
},
{
type: "file",
cases: [
{ count: 0, expected: "0 байтаў" },
{ count: 1, expected: "1 байт" },
{ count: 2, expected: "2 байты" },
{ count: 5, expected: "5 байтаў" },
{ count: 11, expected: "11 байтаў" },
{ count: 21, expected: "21 байт" },
{ count: 22, expected: "22 байты" },
{ count: 25, expected: "25 байтаў" },
{ count: 101, expected: "101 байт" },
{ count: 110, expected: "110 байтаў" },
],
},
] as const;
@@ -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 './hand-helping.js';
//# sourceMappingURL=helping-hand.js.map
@@ -0,0 +1,900 @@
flf2a$ 6 5 76 15 14 1 16271
Ivrit (Hebrew) Unicode font assembled by John Cowan <cowan@ccil.org>
Latin chars from Standard by G. Chappell & Ian Chai
Hebrew chars from Jerusalem by Gedaliah Friedenberg <gfrieden@nyx.cs.du.edu>
Use "ilhebrew.flc" for Hebrew keyboard mapping
Use "ushebrew.flc" for U.S.-style keyboard mapping ("febrew" script)
Use "8859-8.flc" for ISO 8859-8 text
Or use UTF-8
WARNING! FIGfonts aren't bidirectional; this is strictly right-to-left
(by default) even for the Latin characters.
figlet release 2.2 -- November 1996
Modified by Paul Burton <solution@earthlink.net> 12/96 to include new parameter
supported by FIGlet and FIGWin. May also be slightly modified for better use
of new full-width/kern/smush alternatives, but default output is NOT changed.
$@
$@
$@
$@
$@
$@@
_ @
| |@
| |@
|_|@
(_)@
@@
_ _ @
( | )@
V V @
$ @
$ @
@@
_ _ @
_| || |_ @
|_ .. _|@
|_ _|@
|_||_| @
@@
_ @
| | @
/ __)@
\__ \@
( /@
|_| @@
_ __@
(_)/ /@
/ / @
/ /_ @
/_/(_)@
@@
___ @
( _ ) @
/ _ \/\@
| (_> <@
\___/\/@
@@
_ @
( )@
|/ @
$ @
$ @
@@
__@
/ /@
| | @
| | @
| | @
\_\@@
__ @
\ \ @
| |@
| |@
| |@
/_/ @@
@
__/\__@
\ /@
/_ _\@
\/ @
@@
@
_ @
_| |_ @
|_ _|@
|_| @
@@
@
@
@
_ @
( )@
|/ @@
@
@
_____ @
|_____|@
$ @
@@
@
@
@
_ @
(_)@
@@
__@
/ /@
/ / @
/ / @
/_/ @
@@
___ @
/ _ \ @
| | | |@
| |_| |@
\___/ @
@@
_ @
/ |@
| |@
| |@
|_|@
@@
____ @
|___ \ @
__) |@
/ __/ @
|_____|@
@@
_____ @
|___ / @
|_ \ @
___) |@
|____/ @
@@
_ _ @
| || | @
| || |_ @
|__ _|@
|_| @
@@
____ @
| ___| @
|___ \ @
___) |@
|____/ @
@@
__ @
/ /_ @
| '_ \ @
| (_) |@
\___/ @
@@
_____ @
|___ |@
/ / @
/ / @
/_/ @
@@
___ @
( _ ) @
/ _ \ @
| (_) |@
\___/ @
@@
___ @
/ _ \ @
| (_) |@
\__, |@
/_/ @
@@
@
_ @
(_)@
_ @
(_)@
@@
@
_ @
(_)@
_ @
( )@
|/ @@
__@
/ /@
/ / @
\ \ @
\_\@
@@
@
_____ @
|_____|@
|_____|@
$ @
@@
__ @
\ \ @
\ \@
/ /@
/_/ @
@@
___ @
|__ \@
/ /@
|_| @
(_) @
@@
____ @
/ __ \ @
/ / _` |@
| | (_| |@
\ \__,_|@
\____/ @@
_ @
/ \ @
/ _ \ @
/ ___ \ @
/_/ \_\@
@@
____ @
| __ ) @
| _ \ @
| |_) |@
|____/ @
@@
____ @
/ ___|@
| | @
| |___ @
\____|@
@@
____ @
| _ \ @
| | | |@
| |_| |@
|____/ @
@@
_____ @
| ____|@
| _| @
| |___ @
|_____|@
@@
_____ @
| ___|@
| |_ @
| _| @
|_| @
@@
____ @
/ ___|@
| | _ @
| |_| |@
\____|@
@@
_ _ @
| | | |@
| |_| |@
| _ |@
|_| |_|@
@@
___ @
|_ _|@
| | @
| | @
|___|@
@@
_ @
| |@
_ | |@
| |_| |@
\___/ @
@@
_ __@
| |/ /@
| ' / @
| . \ @
|_|\_\@
@@
_ @
| | @
| | @
| |___ @
|_____|@
@@
__ __ @
| \/ |@
| |\/| |@
| | | |@
|_| |_|@
@@
_ _ @
| \ | |@
| \| |@
| |\ |@
|_| \_|@
@@
___ @
/ _ \ @
| | | |@
| |_| |@
\___/ @
@@
____ @
| _ \ @
| |_) |@
| __/ @
|_| @
@@
___ @
/ _ \ @
| | | |@
| |_| |@
\__\_\@
@@
____ @
| _ \ @
| |_) |@
| _ < @
|_| \_\@
@@
____ @
/ ___| @
\___ \ @
___) |@
|____/ @
@@
_____ @
|_ _|@
| | @
| | @
|_| @
@@
_ _ @
| | | |@
| | | |@
| |_| |@
\___/ @
@@
__ __@
\ \ / /@
\ \ / / @
\ V / @
\_/ @
@@
__ __@
\ \ / /@
\ \ /\ / / @
\ V V / @
\_/\_/ @
@@
__ __@
\ \/ /@
\ / @
/ \ @
/_/\_\@
@@
__ __@
\ \ / /@
\ V / @
| | @
|_| @
@@
_____@
|__ /@
/ / @
/ /_ @
/____|@
@@
__ @
| _|@
| | @
| | @
| | @
|__|@@
__ @
\ \ @
\ \ @
\ \ @
\_\@
@@
__ @
|_ |@
| |@
| |@
| |@
|__|@@
/\ @
|/\|@
$ @
$ @
$ @
@@
@
@
@
@
_____ @
|_____|@@
_ @
( )@
\|@
$ @
$ @
@@
@
__ _ @
/ _` |@
| (_| |@
\__,_|@
@@
_ @
| |__ @
| '_ \ @
| |_) |@
|_.__/ @
@@
@
___ @
/ __|@
| (__ @
\___|@
@@
_ @
__| |@
/ _` |@
| (_| |@
\__,_|@
@@
@
___ @
/ _ \@
| __/@
\___|@
@@
__ @
/ _|@
| |_ @
| _|@
|_| @
@@
@
__ _ @
/ _` |@
| (_| |@
\__, |@
|___/ @@
_ @
| |__ @
| '_ \ @
| | | |@
|_| |_|@
@@
_ @
(_)@
| |@
| |@
|_|@
@@
_ @
(_)@
| |@
| |@
_/ |@
|__/ @@
_ @
| | __@
| |/ /@
| < @
|_|\_\@
@@
_ @
| |@
| |@
| |@
|_|@
@@
@
_ __ ___ @
| '_ ` _ \ @
| | | | | |@
|_| |_| |_|@
@@
@
_ __ @
| '_ \ @
| | | |@
|_| |_|@
@@
@
___ @
/ _ \ @
| (_) |@
\___/ @
@@
@
_ __ @
| '_ \ @
| |_) |@
| .__/ @
|_| @@
@
__ _ @
/ _` |@
| (_| |@
\__, |@
|_|@@
@
_ __ @
| '__|@
| | @
|_| @
@@
@
___ @
/ __|@
\__ \@
|___/@
@@
_ @
| |_ @
| __|@
| |_ @
\__|@
@@
@
_ _ @
| | | |@
| |_| |@
\__,_|@
@@
@
__ __@
\ \ / /@
\ V / @
\_/ @
@@
@
__ __@
\ \ /\ / /@
\ V V / @
\_/\_/ @
@@
@
__ __@
\ \/ /@
> < @
/_/\_\@
@@
@
_ _ @
| | | |@
| |_| |@
\__, |@
|___/ @@
@
____@
|_ /@
/ / @
/___|@
@@
__@
/ /@
| | @
< < @
| | @
\_\@@
_ @
| |@
| |@
| |@
| |@
|_|@@
__ @
\ \ @
| | @
> >@
| | @
/_/ @@
/\/|@
|/\/ @
$ @
$ @
$ @
@@
_ _ @
(_)_(_)@
/_\ @
/ _ \ @
/_/ \_\@
@@
_ _ @
(_)_(_)@
/ _ \ @
| |_| |@
\___/ @
@@
_ _ @
(_) (_)@
| | | |@
| |_| |@
\___/ @
@@
_ _ @
(_)_(_)@
/ _` |@
| (_| |@
\__,_|@
@@
_ _ @
(_)_(_)@
/ _ \ @
| (_) |@
\___/ @
@@
_ _ @
(_) (_)@
| | | |@
| |_| |@
\__,_|@
@@
___ @
/ _ \@
| |/ /@
| |\ \@
| ||_/@
|_| @@
160 NO-BREAK SPACE
$@
$@
$@
$@
$@
$@@
173 SOFT HYPHEN
@
@
_____ @
|_____|@
$ @
@@
196 LATIN CAPITAL LETTER A WITH DIAERESIS
_ _ @
(_)_(_)@
/_\ @
/ _ \ @
/_/ \_\@
@@
214 LATIN CAPITAL LETTER O WITH DIAERESIS
_ _ @
(_)_(_)@
/ _ \ @
| |_| |@
\___/ @
@@
220 LATIN CAPITAL LETTER U WITH DIAERESIS
_ _ @
(_) (_)@
| | | |@
| |_| |@
\___/ @
@@
223 LATIN SMALL LETTER SHARP S
___ @
/ _ \@
| |/ /@
| |\ \@
| ||_/@
|_| @@
228 LATIN SMALL LETTER A WITH DIAERESIS
_ _ @
(_)_(_)@
/ _` |@
| (_| |@
\__,_|@
@@
246 LATIN SMALL LETTER O WITH DIAERESIS
_ _ @
(_)_(_)@
/ _ \ @
| (_) |@
\___/ @
@@
252 LATIN SMALL LETTER U WITH DIAERESIS
_ _ @
(_) (_)@
| | | |@
| |_| |@
\__,_|@
@@
0x05D0 HEBREW LETTER ALEF
__ __@
\ \ / /@
| V / @
| |\ \ @
|_| \_\@
@@
0x05D1 HEBREW LETTER BET
______ @
|____ | @
| | @
_____| |_@
/________/@
@@
0x05D2 HEBREW LETTER GIMEL
____ @
|__ | @
| | @
____| | @
/____/\_\@
@@
0x05D3 HEBREW LETTER DALET
_______ @
|____ |@
| | @
| | @
|_| @
@@
0x05D4 HEBREW LETTER HE
_______ @
|_____ |@
_ | |@
| | | |@
|_| |_|@
@@
0x05D5 HEBREW LETTER VAV
___ @
|_ |@
| |@
| |@
|_|@
@@
0x05D6 HEBREW LETTER ZAYIN
________ @
\__ __\@
| | @
| | @
|_| @
@@
0x05D7 HEBREW LETTER HET
_______ @
|. __ |@
| | | |@
| | | |@
|_| |_|@
@@
0x05D8 HEBREW LETTER TET
__ ___ @
|. | /_ |@
| | | |@
| |___| |@
|_______|@
@@
0x05D9 HEBREW LETTER YOD
___ @
|_ |@
|_|@
$ @
$ @
@@
0x05DA HEBREW LETTER FINAL KAF
_______ @
|____ .|@
| | @
| | @
| | @
|_| @@
0x05DB HEBREW LETTER KAF
_____ @
|____ \ @
| |@
____| |@
|_____/ @
@@
0x05DC HEBREW LETTER LAMED
|=|____ @
|____ |@
/ / @
/ / @
/_/ @
@@
0x05DD HEBREW LETTER FINAL MEM
________ @
|. ___ |@
| | | |@
| |___| |@
|_______|@
@@
0x05DE HEBREW LETTER MEM
_______ @
|. __ |@
| | | |@
| | _| |@
|_||___|@
@@
0x05DF HEBREW LETTER FINAL NUN
___ @
|_ |@
| |@
| |@
| |@
|_|@@
0x05E0 HEBREW LETTER NUN
___ @
|_ |@
| |@
__| |@
|____|@
@@
0x05E1 HEBREW LETTER SAMEKH
_______ @
|. __ |@
| | | |@
| |__/ |@
|_____/ @
@@
0x05E2 HEBREW LETTER AYIN
__ _ @
\ \ | |@
\ \| |@
__\ ` |@
|______|@
@@
0x05E3 HEBREW LETTER FINAL PE
______ @
| __ |@
| |_ | |@
|___|| |@
| |@
|_|@@
0x05E4 HEBREW LETTER PE
_______ @
| ___ |@
\_\ | |@
_____| |@
|_______|@
@@
0x05E5 HEBREW LETTER FINAL TSADI
__ _ @
|. | | |@
| | // @
| |// @
| | @
|_| @@
0x05E6 HEBREW LETTER TSADI
__ __.@
\ \ / / @
\ V / @
___\ \ @
|______| @
@@
0x05E7 HEBREW LETTER QOF
______ @
|____ |@
_ | |@
| | |_|@
| | @
|_| @@
0x05E8 HEBREW LETTER RESH
______ @
|____ |@
| |@
| |@
|_|@
@@
0x05E9 HEBREW LETTER SHIN
_ _ _ @
| | | | | |@
| | | | | |@
| |/ /_/ / @
|_______/ @
@@
0x05EA HEBREW LETTER TAV
______ @
| __ |@
| | | |@
_| | | |@
|___| |_|@
@@
0x2721 STAR OF DAVID
@
__/\__@
\ /@
/_ _\@
\/ @
@@
-0x0002
aleph = t, bet/vet = c, gimel = d, dalet = s, he = v, vav = u, zayin = z @
het = j, tet = y, yod = h, kaf/chaf = f, final kaf = l, lamed = k, mem = n@
final mem = o, nun = b, final nun = i, samekh = x, ayin = g, pe/fe = p, @
final pe = ;, tsadi = m, final tsadi = ., qof = e, resh = r, shin/sin = a @
tav = , comma = ', period = /, semicolon = `, slash = q, apostrophe = w @
Star of David = * @@
-0x0003
aleph = a, bet/vet = b, gimel = g, dalet = d, he = h, vav = v, zayin = z @
het = c, tet = t, yod = y, kaf/chaf = k, final kaf = f, lamed = l, mem = m@
final mem = o, nun = n, final nun = i, samekh = e, ayin = _, pe/fe = p, @
final pe = u, tsadi = j, final tsadi = w, qof = q, resh = r, shin/sin = s @
tav = x @
Star of David = * @@
@@ -0,0 +1,543 @@
import type { $ZodCheck, $ZodStringFormats } from "./checks.js";
import { $constructor } from "./core.js";
import type { $ZodType } from "./schemas.js";
import type { StandardSchemaV1 } from "./standard-schema.js";
import * as util from "./util.js";
///////////////////////////
//// base type ////
///////////////////////////
export interface $ZodIssueBase {
readonly code?: string;
readonly input?: unknown;
readonly path: PropertyKey[];
readonly message: string;
}
////////////////////////////////
//// issue subtypes ////
////////////////////////////////
export type $ZodInvalidTypeExpected =
| "string"
| "number"
| "int"
| "boolean"
| "bigint"
| "symbol"
| "undefined"
| "null"
| "never"
| "void"
| "date"
| "array"
| "object"
| "tuple"
| "record"
| "map"
| "set"
| "file"
| "nonoptional"
| "nan"
| "function"
| (string & {}); // class names for instanceof
export interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {
readonly code: "invalid_type";
readonly expected: $ZodInvalidTypeExpected;
readonly input?: Input;
}
export interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
readonly code: "too_big";
readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
readonly maximum: number | bigint;
readonly inclusive?: boolean;
readonly exact?: boolean;
readonly input?: Input;
}
export interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
readonly code: "too_small";
readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
readonly minimum: number | bigint;
/** True if the allowable range includes the minimum */
readonly inclusive?: boolean;
/** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */
readonly exact?: boolean;
readonly input?: Input;
}
export interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {
readonly code: "invalid_format";
readonly format: $ZodStringFormats | (string & {});
readonly pattern?: string;
readonly input?: string;
}
export interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {
readonly code: "not_multiple_of";
readonly divisor: number;
readonly input?: Input;
}
export interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {
readonly code: "unrecognized_keys";
readonly keys: string[];
readonly input?: Record<string, unknown>;
}
interface $ZodIssueInvalidUnionNoMatch extends $ZodIssueBase {
readonly code: "invalid_union";
readonly errors: $ZodIssue[][];
readonly input?: unknown;
readonly discriminator?: string | undefined;
readonly options?: util.Primitive[];
readonly inclusive?: true;
}
interface $ZodIssueInvalidUnionMultipleMatch extends $ZodIssueBase {
readonly code: "invalid_union";
readonly errors: [];
readonly input?: unknown;
readonly discriminator?: string | undefined;
readonly inclusive: false;
/** Indices of the options that matched */
readonly matches: number[];
}
export type $ZodIssueInvalidUnion = $ZodIssueInvalidUnionNoMatch | $ZodIssueInvalidUnionMultipleMatch;
export interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {
readonly code: "invalid_key";
readonly origin: "map" | "record";
readonly issues: $ZodIssue[];
readonly input?: Input;
}
export interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {
readonly code: "invalid_element";
readonly origin: "map" | "set";
readonly key: unknown;
readonly issues: $ZodIssue[];
readonly input?: Input;
}
export interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {
readonly code: "invalid_value";
readonly values: util.Primitive[];
readonly input?: Input;
}
export interface $ZodIssueCustom extends $ZodIssueBase {
readonly code: "custom";
readonly params?: Record<string, any> | undefined;
readonly input?: unknown;
}
////////////////////////////////////////////
//// first-party string formats ////
////////////////////////////////////////////
export interface $ZodIssueStringCommonFormats extends $ZodIssueInvalidStringFormat {
format: Exclude<$ZodStringFormats, "regex" | "jwt" | "starts_with" | "ends_with" | "includes">;
}
export interface $ZodIssueStringInvalidRegex extends $ZodIssueInvalidStringFormat {
format: "regex";
pattern: string;
}
export interface $ZodIssueStringInvalidJWT extends $ZodIssueInvalidStringFormat {
format: "jwt";
algorithm?: string;
}
export interface $ZodIssueStringStartsWith extends $ZodIssueInvalidStringFormat {
format: "starts_with";
prefix: string;
}
export interface $ZodIssueStringEndsWith extends $ZodIssueInvalidStringFormat {
format: "ends_with";
suffix: string;
}
export interface $ZodIssueStringIncludes extends $ZodIssueInvalidStringFormat {
format: "includes";
includes: string;
}
export type $ZodStringFormatIssues =
| $ZodIssueStringCommonFormats
| $ZodIssueStringInvalidRegex
| $ZodIssueStringInvalidJWT
| $ZodIssueStringStartsWith
| $ZodIssueStringEndsWith
| $ZodIssueStringIncludes;
////////////////////////
//// utils /////
////////////////////////
export type $ZodIssue =
| $ZodIssueInvalidType
| $ZodIssueTooBig
| $ZodIssueTooSmall
| $ZodIssueInvalidStringFormat
| $ZodIssueNotMultipleOf
| $ZodIssueUnrecognizedKeys
| $ZodIssueInvalidUnion
| $ZodIssueInvalidKey
| $ZodIssueInvalidElement
| $ZodIssueInvalidValue
| $ZodIssueCustom;
export type $ZodIssueCode = $ZodIssue["code"];
export type $ZodInternalIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
type RawIssue<T extends $ZodIssueBase> = T extends any
? util.Flatten<
util.MakePartial<T, "message" | "path"> & {
/** The input data */
readonly input: unknown;
/** The schema or check that originated this issue. */
readonly inst?: $ZodType | $ZodCheck;
/** The schema that owns the issue. Equal to `inst` when a schema originated the issue, and the schema the check was attached to when a check did. */
readonly schema?: $ZodType | undefined;
/** If `true`, Zod will continue executing checks/refinements after this issue. */
readonly continue?: boolean | undefined;
} & Record<string, unknown>
>
: never;
export type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T>;
export interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {
// biome-ignore lint/style/useShorthandFunctionType: interface form is public API
(issue: $ZodRawIssue<T>): { message: string } | string | undefined | null;
}
//////////////////////// ERROR CLASS ////////////////////////
// const ZOD_ERROR: symbol = Symbol.for("{{zod.error}}");
export interface $ZodError<T = unknown> extends Error {
type: T;
issues: $ZodIssue[];
_zod: {
output: T;
def: $ZodIssue[];
};
stack?: string;
name: string;
}
/* Computing the message eagerly is expensive (pretty-printed JSON of all
* issues), so defer it until first read. The accessor functions and
* descriptors are shared across instances to keep error construction
* cheap; the computed message is cached on the internals object. The
* setter preserves plain assignment semantics for consumers that
* overwrite `message`. */
function _getMessage(this: $ZodError): string {
const internals = this._zod as { def: $ZodIssue[]; message?: string };
internals.message ??= JSON.stringify(internals.def, util.jsonStringifyReplacer, 2);
return internals.message;
}
function _setMessage(this: $ZodError, value: string): void {
(this._zod as { message?: string }).message = value;
}
const _messageDesc: PropertyDescriptor = {
get: _getMessage,
set: _setMessage,
enumerable: true,
configurable: true,
};
const _issuesDesc: PropertyDescriptor = { value: undefined, enumerable: false };
/* Prototypes that already carry the lazy `toString`. Seeded with the
* intrinsics so that `init` on a foreign object — it accepts any object —
* can never install an accessor onto a prototype we do not own. */
const _installedToString = /* @__PURE__ */ new WeakSet<object>([Object.prototype, Error.prototype]);
const initializer = (inst: $ZodError, def: $ZodIssue[]): void => {
inst.name = "$ZodError";
// `_zod` is already non-enumerable: $constructor's init defined it with this same descriptor
_issuesDesc.value = def;
Object.defineProperty(inst, "issues", _issuesDesc);
// Clear the shared slot; a retained `value` pins the last error's issues.
_issuesDesc.value = undefined;
Object.defineProperty(inst, "message", _messageDesc);
/* `toString` lives as a non-enumerable lazy getter on the shared
* prototype; on first access it caches a per-instance closure so
* detached usage still works. */
const proto = Object.getPrototypeOf(inst);
if (!_installedToString.has(proto)) {
_installedToString.add(proto);
Object.defineProperty(proto, "toString", {
configurable: true,
enumerable: false,
get(this: $ZodError) {
const value = () => this.message;
Object.defineProperty(this, "toString", { value, configurable: true, writable: true });
return value;
},
set(this: $ZodError, value: unknown) {
Object.defineProperty(this, "toString", { value, configurable: true, writable: true });
},
});
}
};
export const $ZodError: $constructor<$ZodError> = $constructor("$ZodError", initializer);
interface $ZodRealError<T = any> extends $ZodError<T> {}
export const $ZodRealError: $constructor<$ZodRealError> = $constructor("$ZodError", initializer, undefined, {
Parent: Error,
});
/////////////////// ERROR UTILITIES ////////////////////////
// flatten
export type $ZodFlattenedError<T, U = string> = _FlattenedError<T, U>;
type _FlattenedError<T, U = string> = {
formErrors: U[];
fieldErrors: {
[P in keyof T]?: U[];
};
};
/** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
* ("toString", "constructor") would otherwise read through to the prototype, and assigning
* "__proto__" would hit the setter instead of creating a key. */
function node<T>(obj: any, key: PropertyKey, make: () => T): T {
if (!Object.prototype.hasOwnProperty.call(obj, key)) {
if (key === "__proto__") {
Object.defineProperty(obj, key, { value: make(), writable: true, enumerable: true, configurable: true });
} else {
obj[key] = make();
}
}
return obj[key];
}
export function flattenError<T>(error: $ZodError<T>): _FlattenedError<T>;
export function flattenError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): _FlattenedError<T, U>;
export function flattenError<T, U>(error: $ZodError<T>, mapper = (issue: $ZodIssue) => issue.message as U) {
const fieldErrors: Record<PropertyKey, any> = {};
const formErrors: U[] = [];
for (const sub of error.issues) {
if (sub.path.length > 0) {
node<U[]>(fieldErrors, sub.path[0]!, () => []).push(mapper(sub));
} else {
formErrors.push(mapper(sub));
}
}
return { formErrors, fieldErrors };
}
type _ZodFormattedError<T, U = string> = T extends [any, ...any[]]
? { [K in keyof T]?: $ZodFormattedError<T[K], U> }
: T extends any[]
? { [k: number]: $ZodFormattedError<T[number], U> }
: T extends object
? util.Flatten<{ [K in keyof T]?: $ZodFormattedError<T[K], U> }>
: any;
export type $ZodFormattedError<T, U = string> = {
_errors: U[];
} & util.Flatten<_ZodFormattedError<T, U>>;
export function formatError<T>(error: $ZodError<T>): $ZodFormattedError<T>;
export function formatError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;
export function formatError<T, U>(error: $ZodError<T>, mapper = (issue: $ZodIssue) => issue.message as U) {
const fieldErrors: $ZodFormattedError<T> = { _errors: [] } as any;
const processError = (error: { issues: $ZodIssue[] }, path: PropertyKey[] = []) => {
for (const issue of error.issues) {
if (issue.code === "invalid_union" && issue.errors.length) {
issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));
} else if (issue.code === "invalid_key") {
processError({ issues: issue.issues }, [...path, ...issue.path]);
} else if (issue.code === "invalid_element") {
processError({ issues: issue.issues }, [...path, ...issue.path]);
} else {
const fullpath = [...path, ...issue.path];
if (fullpath.length === 0) {
(fieldErrors as any)._errors.push(mapper(issue));
} else {
let curr: any = fieldErrors;
let i = 0;
while (i < fullpath.length) {
const el = fullpath[i]!;
const terminal = i === fullpath.length - 1;
// `_errors` is reserved by this legacy format, so merge a matching path segment into the current node instead of treating its array as a child.
if (el === "_errors") {
if (terminal) curr._errors.push(mapper(issue));
i++;
continue;
}
// A path element may collide with an inherited property name such as
// "__proto__" or "constructor". Truthiness checks read the prototype
// (so no node is created, then ._errors.push throws), and bracket
// assignment of "__proto__" hits the setter instead of creating an
// own key. Guard the read with hasOwnProperty and create the node
// with defineProperty so any path element becomes a real own key.
if (!Object.prototype.hasOwnProperty.call(curr, el)) {
Object.defineProperty(curr, el, {
value: { _errors: [] },
enumerable: true,
writable: true,
configurable: true,
});
}
const node = curr[el];
if (terminal) {
node._errors.push(mapper(issue));
}
curr = node;
i++;
}
}
}
}
};
processError(error);
return fieldErrors;
}
export type $ZodErrorTree<T, U = string> = T extends util.Primitive
? { errors: U[] }
: T extends [any, ...any[]]
? { errors: U[]; items?: { [K in keyof T]?: $ZodErrorTree<T[K], U> } }
: T extends any[]
? { errors: U[]; items?: Array<$ZodErrorTree<T[number], U>> }
: T extends object
? {
errors: U[];
properties?: { [K in keyof T]?: $ZodErrorTree<T[K], U> };
}
: { errors: U[] };
export function treeifyError<T>(error: $ZodError<T>): $ZodErrorTree<T>;
export function treeifyError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): $ZodErrorTree<T, U>;
export function treeifyError<T, U>(error: $ZodError<T>, mapper = (issue: $ZodIssue) => issue.message as U) {
const result: $ZodErrorTree<T, U> = { errors: [] } as any;
const processError = (error: { issues: $ZodIssue[] }, path: PropertyKey[] = []) => {
for (const issue of error.issues) {
if (issue.code === "invalid_union" && issue.errors.length) {
// regular union error
issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));
} else if (issue.code === "invalid_key") {
processError({ issues: issue.issues }, [...path, ...issue.path]);
} else if (issue.code === "invalid_element") {
processError({ issues: issue.issues }, [...path, ...issue.path]);
} else {
const fullpath = [...path, ...issue.path];
if (fullpath.length === 0) {
result.errors.push(mapper(issue));
continue;
}
let curr: any = result;
let i = 0;
while (i < fullpath.length) {
const el = fullpath[i]!;
const terminal = i === fullpath.length - 1;
if (typeof el === "string") {
curr.properties ??= {};
// el may collide with an inherited property name ("__proto__",
// "constructor", ...); ??= reads the prototype so the node is never
// created and curr.errors.push throws. Guard with hasOwnProperty and
// create the node with defineProperty so "__proto__" becomes a real
// own key rather than invoking the prototype setter.
if (!Object.prototype.hasOwnProperty.call(curr.properties, el)) {
Object.defineProperty(curr.properties, el, {
value: { errors: [] },
enumerable: true,
writable: true,
configurable: true,
});
}
curr = curr.properties[el];
} else {
curr.items ??= [];
curr.items[el] ??= { errors: [] };
curr = curr.items[el];
}
if (terminal) {
curr.errors.push(mapper(issue));
}
i++;
}
}
}
};
processError(error);
return result;
}
/** Format a ZodError as a human-readable string in the following form.
*
* From
*
* ```ts
* ZodError {
* issues: [
* {
* expected: 'string',
* code: 'invalid_type',
* path: [ 'username' ],
* message: 'Invalid input: expected string'
* },
* {
* expected: 'number',
* code: 'invalid_type',
* path: [ 'favoriteNumbers', 1 ],
* message: 'Invalid input: expected number'
* }
* ];
* }
* ```
*
* to
*
* ```
* username
* ✖ Expected number, received string at "username
* favoriteNumbers[0]
* ✖ Invalid input: expected number
* ```
*/
export function toDotPath(_path: readonly (string | number | symbol | StandardSchemaV1.PathSegment)[]): string {
const segs: string[] = [];
const path: PropertyKey[] = _path.map((seg: any) => (typeof seg === "object" ? seg.key : seg));
for (const seg of path) {
if (typeof seg === "number") segs.push(`[${seg}]`);
else if (typeof seg === "symbol") segs.push(`[${JSON.stringify(String(seg))}]`);
else if (/[^\w$]/.test(seg)) segs.push(`[${JSON.stringify(seg)}]`);
else {
if (segs.length) segs.push(".");
segs.push(seg);
}
}
return segs.join("");
}
export function prettifyError(error: StandardSchemaV1.FailureResult): string {
const lines: string[] = [];
// sort by path length
const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
// Process each issue
for (const issue of issues) {
lines.push(`✖ ${issue.message}`);
if (issue.path?.length) lines.push(` → at ${toDotPath(issue.path)}`);
}
// Convert Map to formatted string
return lines.join("\n");
}
@@ -0,0 +1,225 @@
/*!
* content-type
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1
*
* parameter = token "=" ( token / quoted-string )
* token = 1*tchar
* tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
* / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
* / DIGIT / ALPHA
* ; any VCHAR, except delimiters
* quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
* qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
* obs-text = %x80-FF
* quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
*/
var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g // eslint-disable-line no-control-regex
var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/ // eslint-disable-line no-control-regex
var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/
/**
* RegExp to match quoted-pair in RFC 7230 sec 3.2.6
*
* quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
* obs-text = %x80-FF
*/
var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g // eslint-disable-line no-control-regex
/**
* RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6
*/
var QUOTE_REGEXP = /([\\"])/g
/**
* RegExp to match type in RFC 7231 sec 3.1.1.1
*
* media-type = type "/" subtype
* type = token
* subtype = token
*/
var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/
/**
* Module exports.
* @public
*/
exports.format = format
exports.parse = parse
/**
* Format object to media type.
*
* @param {object} obj
* @return {string}
* @public
*/
function format (obj) {
if (!obj || typeof obj !== 'object') {
throw new TypeError('argument obj is required')
}
var parameters = obj.parameters
var type = obj.type
if (!type || !TYPE_REGEXP.test(type)) {
throw new TypeError('invalid type')
}
var string = type
// append parameters
if (parameters && typeof parameters === 'object') {
var param
var params = Object.keys(parameters).sort()
for (var i = 0; i < params.length; i++) {
param = params[i]
if (!TOKEN_REGEXP.test(param)) {
throw new TypeError('invalid parameter name')
}
string += '; ' + param + '=' + qstring(parameters[param])
}
}
return string
}
/**
* Parse media type to object.
*
* @param {string|object} string
* @return {Object}
* @public
*/
function parse (string) {
if (!string) {
throw new TypeError('argument string is required')
}
// support req/res-like objects as argument
var header = typeof string === 'object'
? getcontenttype(string)
: string
if (typeof header !== 'string') {
throw new TypeError('argument string is required to be a string')
}
var index = header.indexOf(';')
var type = index !== -1
? header.slice(0, index).trim()
: header.trim()
if (!TYPE_REGEXP.test(type)) {
throw new TypeError('invalid media type')
}
var obj = new ContentType(type.toLowerCase())
// parse parameters
if (index !== -1) {
var key
var match
var value
PARAM_REGEXP.lastIndex = index
while ((match = PARAM_REGEXP.exec(header))) {
if (match.index !== index) {
throw new TypeError('invalid parameter format')
}
index += match[0].length
key = match[1].toLowerCase()
value = match[2]
if (value.charCodeAt(0) === 0x22 /* " */) {
// remove quotes
value = value.slice(1, -1)
// remove escapes
if (value.indexOf('\\') !== -1) {
value = value.replace(QESC_REGEXP, '$1')
}
}
obj.parameters[key] = value
}
if (index !== header.length) {
throw new TypeError('invalid parameter format')
}
}
return obj
}
/**
* Get content-type from req/res objects.
*
* @param {object}
* @return {Object}
* @private
*/
function getcontenttype (obj) {
var header
if (typeof obj.getHeader === 'function') {
// res-like
header = obj.getHeader('content-type')
} else if (typeof obj.headers === 'object') {
// req-like
header = obj.headers && obj.headers['content-type']
}
if (typeof header !== 'string') {
throw new TypeError('content-type header is missing from object')
}
return header
}
/**
* Quote a string if necessary.
*
* @param {string} val
* @return {string}
* @private
*/
function qstring (val) {
var str = String(val)
// no need to quote tokens
if (TOKEN_REGEXP.test(str)) {
return str
}
if (str.length > 0 && !TEXT_REGEXP.test(str)) {
throw new TypeError('invalid parameter value')
}
return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"'
}
/**
* Class to represent a content type.
* @private
*/
function ContentType (type) {
this.parameters = Object.create(null)
this.type = type
}
@@ -0,0 +1,367 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
var _index = require('../../tokenizer/index');
var _types = require('../../tokenizer/types');
var _base = require('../../traverser/base');
var _expression = require('../../traverser/expression');
var _util = require('../../traverser/util');
var _charcodes = require('../../util/charcodes');
var _identifier = require('../../util/identifier');
var _typescript = require('../typescript');
/**
* Read token with JSX contents.
*
* In addition to detecting jsxTagStart and also regular tokens that might be
* part of an expression, this code detects the start and end of text ranges
* within JSX children. In order to properly count the number of children, we
* distinguish jsxText from jsxEmptyText, which is a text range that simplifies
* to the empty string after JSX whitespace trimming.
*
* It turns out that a JSX text range will simplify to the empty string if and
* only if both of these conditions hold:
* - The range consists entirely of whitespace characters (only counting space,
* tab, \r, and \n).
* - The range has at least one newline.
* This can be proven by analyzing any implementation of whitespace trimming,
* e.g. formatJSXTextLiteral in Sucrase or cleanJSXElementLiteralChild in Babel.
*/
function jsxReadToken() {
let sawNewline = false;
let sawNonWhitespace = false;
while (true) {
if (_base.state.pos >= _base.input.length) {
_util.unexpected.call(void 0, "Unterminated JSX contents");
return;
}
const ch = _base.input.charCodeAt(_base.state.pos);
if (ch === _charcodes.charCodes.lessThan || ch === _charcodes.charCodes.leftCurlyBrace) {
if (_base.state.pos === _base.state.start) {
if (ch === _charcodes.charCodes.lessThan) {
_base.state.pos++;
_index.finishToken.call(void 0, _types.TokenType.jsxTagStart);
return;
}
_index.getTokenFromCode.call(void 0, ch);
return;
}
if (sawNewline && !sawNonWhitespace) {
_index.finishToken.call(void 0, _types.TokenType.jsxEmptyText);
} else {
_index.finishToken.call(void 0, _types.TokenType.jsxText);
}
return;
}
// This is part of JSX text.
if (ch === _charcodes.charCodes.lineFeed) {
sawNewline = true;
} else if (ch !== _charcodes.charCodes.space && ch !== _charcodes.charCodes.carriageReturn && ch !== _charcodes.charCodes.tab) {
sawNonWhitespace = true;
}
_base.state.pos++;
}
}
function jsxReadString(quote) {
_base.state.pos++;
for (;;) {
if (_base.state.pos >= _base.input.length) {
_util.unexpected.call(void 0, "Unterminated string constant");
return;
}
const ch = _base.input.charCodeAt(_base.state.pos);
if (ch === quote) {
_base.state.pos++;
break;
}
_base.state.pos++;
}
_index.finishToken.call(void 0, _types.TokenType.string);
}
// Read a JSX identifier (valid tag or attribute name).
//
// Optimized version since JSX identifiers can't contain
// escape characters and so can be read as single slice.
// Also assumes that first character was already checked
// by isIdentifierStart in readToken.
function jsxReadWord() {
let ch;
do {
if (_base.state.pos > _base.input.length) {
_util.unexpected.call(void 0, "Unexpectedly reached the end of input.");
return;
}
ch = _base.input.charCodeAt(++_base.state.pos);
} while (_identifier.IS_IDENTIFIER_CHAR[ch] || ch === _charcodes.charCodes.dash);
_index.finishToken.call(void 0, _types.TokenType.jsxName);
}
// Parse next token as JSX identifier
function jsxParseIdentifier() {
nextJSXTagToken();
}
// Parse namespaced identifier.
function jsxParseNamespacedName(identifierRole) {
jsxParseIdentifier();
if (!_index.eat.call(void 0, _types.TokenType.colon)) {
// Plain identifier, so this is an access.
_base.state.tokens[_base.state.tokens.length - 1].identifierRole = identifierRole;
return;
}
// Process the second half of the namespaced name.
jsxParseIdentifier();
}
// Parses element name in any form - namespaced, member
// or single identifier.
function jsxParseElementName() {
const firstTokenIndex = _base.state.tokens.length;
jsxParseNamespacedName(_index.IdentifierRole.Access);
let hadDot = false;
while (_index.match.call(void 0, _types.TokenType.dot)) {
hadDot = true;
nextJSXTagToken();
jsxParseIdentifier();
}
// For tags like <div> with a lowercase letter and no dots, the name is
// actually *not* an identifier access, since it's referring to a built-in
// tag name. Remove the identifier role in this case so that it's not
// accidentally transformed by the imports transform when preserving JSX.
if (!hadDot) {
const firstToken = _base.state.tokens[firstTokenIndex];
const firstChar = _base.input.charCodeAt(firstToken.start);
if (firstChar >= _charcodes.charCodes.lowercaseA && firstChar <= _charcodes.charCodes.lowercaseZ) {
firstToken.identifierRole = null;
}
}
}
// Parses any type of JSX attribute value.
function jsxParseAttributeValue() {
switch (_base.state.type) {
case _types.TokenType.braceL:
_index.next.call(void 0, );
_expression.parseExpression.call(void 0, );
nextJSXTagToken();
return;
case _types.TokenType.jsxTagStart:
jsxParseElement();
nextJSXTagToken();
return;
case _types.TokenType.string:
nextJSXTagToken();
return;
default:
_util.unexpected.call(void 0, "JSX value should be either an expression or a quoted JSX text");
}
}
// Parse JSX spread child, after already processing the {
// Does not parse the closing }
function jsxParseSpreadChild() {
_util.expect.call(void 0, _types.TokenType.ellipsis);
_expression.parseExpression.call(void 0, );
}
// Parses JSX opening tag starting after "<".
// Returns true if the tag was self-closing.
// Does not parse the last token.
function jsxParseOpeningElement(initialTokenIndex) {
if (_index.match.call(void 0, _types.TokenType.jsxTagEnd)) {
// This is an open-fragment.
return false;
}
jsxParseElementName();
if (_base.isTypeScriptEnabled) {
_typescript.tsTryParseJSXTypeArgument.call(void 0, );
}
let hasSeenPropSpread = false;
while (!_index.match.call(void 0, _types.TokenType.slash) && !_index.match.call(void 0, _types.TokenType.jsxTagEnd) && !_base.state.error) {
if (_index.eat.call(void 0, _types.TokenType.braceL)) {
hasSeenPropSpread = true;
_util.expect.call(void 0, _types.TokenType.ellipsis);
_expression.parseMaybeAssign.call(void 0, );
// }
nextJSXTagToken();
continue;
}
if (
hasSeenPropSpread &&
_base.state.end - _base.state.start === 3 &&
_base.input.charCodeAt(_base.state.start) === _charcodes.charCodes.lowercaseK &&
_base.input.charCodeAt(_base.state.start + 1) === _charcodes.charCodes.lowercaseE &&
_base.input.charCodeAt(_base.state.start + 2) === _charcodes.charCodes.lowercaseY
) {
_base.state.tokens[initialTokenIndex].jsxRole = _index.JSXRole.KeyAfterPropSpread;
}
jsxParseNamespacedName(_index.IdentifierRole.ObjectKey);
if (_index.match.call(void 0, _types.TokenType.eq)) {
nextJSXTagToken();
jsxParseAttributeValue();
}
}
const isSelfClosing = _index.match.call(void 0, _types.TokenType.slash);
if (isSelfClosing) {
// /
nextJSXTagToken();
}
return isSelfClosing;
}
// Parses JSX closing tag starting after "</".
// Does not parse the last token.
function jsxParseClosingElement() {
if (_index.match.call(void 0, _types.TokenType.jsxTagEnd)) {
// Fragment syntax, so we immediately have a tag end.
return;
}
jsxParseElementName();
}
// Parses entire JSX element, including its opening tag
// (starting after "<"), attributes, contents and closing tag.
// Does not parse the last token.
function jsxParseElementAt() {
const initialTokenIndex = _base.state.tokens.length - 1;
_base.state.tokens[initialTokenIndex].jsxRole = _index.JSXRole.NoChildren;
let numExplicitChildren = 0;
const isSelfClosing = jsxParseOpeningElement(initialTokenIndex);
if (!isSelfClosing) {
nextJSXExprToken();
while (true) {
switch (_base.state.type) {
case _types.TokenType.jsxTagStart:
nextJSXTagToken();
if (_index.match.call(void 0, _types.TokenType.slash)) {
nextJSXTagToken();
jsxParseClosingElement();
// Key after prop spread takes precedence over number of children,
// since it means we switch to createElement, which doesn't care
// about number of children.
if (_base.state.tokens[initialTokenIndex].jsxRole !== _index.JSXRole.KeyAfterPropSpread) {
if (numExplicitChildren === 1) {
_base.state.tokens[initialTokenIndex].jsxRole = _index.JSXRole.OneChild;
} else if (numExplicitChildren > 1) {
_base.state.tokens[initialTokenIndex].jsxRole = _index.JSXRole.StaticChildren;
}
}
return;
}
numExplicitChildren++;
jsxParseElementAt();
nextJSXExprToken();
break;
case _types.TokenType.jsxText:
numExplicitChildren++;
nextJSXExprToken();
break;
case _types.TokenType.jsxEmptyText:
nextJSXExprToken();
break;
case _types.TokenType.braceL:
_index.next.call(void 0, );
if (_index.match.call(void 0, _types.TokenType.ellipsis)) {
jsxParseSpreadChild();
nextJSXExprToken();
// Spread children are a mechanism to explicitly mark children as
// static, so count it as 2 children to satisfy the "more than one
// child" condition.
numExplicitChildren += 2;
} else {
// If we see {}, this is an empty pseudo-expression that doesn't
// count as a child.
if (!_index.match.call(void 0, _types.TokenType.braceR)) {
numExplicitChildren++;
_expression.parseExpression.call(void 0, );
}
nextJSXExprToken();
}
break;
// istanbul ignore next - should never happen
default:
_util.unexpected.call(void 0, );
return;
}
}
}
}
// Parses entire JSX element from current position.
// Does not parse the last token.
function jsxParseElement() {
nextJSXTagToken();
jsxParseElementAt();
} exports.jsxParseElement = jsxParseElement;
// ==================================
// Overrides
// ==================================
function nextJSXTagToken() {
_base.state.tokens.push(new (0, _index.Token)());
_index.skipSpace.call(void 0, );
_base.state.start = _base.state.pos;
const code = _base.input.charCodeAt(_base.state.pos);
if (_identifier.IS_IDENTIFIER_START[code]) {
jsxReadWord();
} else if (code === _charcodes.charCodes.quotationMark || code === _charcodes.charCodes.apostrophe) {
jsxReadString(code);
} else {
// The following tokens are just one character each.
++_base.state.pos;
switch (code) {
case _charcodes.charCodes.greaterThan:
_index.finishToken.call(void 0, _types.TokenType.jsxTagEnd);
break;
case _charcodes.charCodes.lessThan:
_index.finishToken.call(void 0, _types.TokenType.jsxTagStart);
break;
case _charcodes.charCodes.slash:
_index.finishToken.call(void 0, _types.TokenType.slash);
break;
case _charcodes.charCodes.equalsTo:
_index.finishToken.call(void 0, _types.TokenType.eq);
break;
case _charcodes.charCodes.leftCurlyBrace:
_index.finishToken.call(void 0, _types.TokenType.braceL);
break;
case _charcodes.charCodes.dot:
_index.finishToken.call(void 0, _types.TokenType.dot);
break;
case _charcodes.charCodes.colon:
_index.finishToken.call(void 0, _types.TokenType.colon);
break;
default:
_util.unexpected.call(void 0, );
}
}
} exports.nextJSXTagToken = nextJSXTagToken;
function nextJSXExprToken() {
_base.state.tokens.push(new (0, _index.Token)());
_base.state.start = _base.state.pos;
jsxReadToken();
}
@@ -0,0 +1,68 @@
{
"name": "get-nonce",
"version": "1.0.1",
"description": "returns nonce",
"main": "dist/es5/index.js",
"types": "dist/es5/index.d.ts",
"sideEffects": false,
"repository": "git@github.com:theKashey/get-nonce.git",
"homepage": "https://github.com/theKashey/get-nonce",
"author": "Anton Korzunov <thekashey@gmail.com>",
"license": "MIT",
"keywords": [
"webpack",
"nonce",
"__webpack_nonce__"
],
"devDependencies": {
"@theuiteam/lib-builder": "^0.0.10",
"@size-limit/preset-small-lib": "^2.1.6"
},
"module": "dist/es2015/index.js",
"engines": {
"node": ">=6"
},
"scripts": {
"dev": "lib-builder dev",
"test": "jest",
"test:ci": "jest --runInBand --coverage",
"build": "lib-builder build && yarn size:report",
"release": "yarn build && yarn test",
"size": "npx size-limit",
"size:report": "npx size-limit --json > .size.json",
"lint": "lib-builder lint",
"format": "lib-builder format",
"update": "lib-builder update",
"docz:dev": "docz dev",
"docz:build": "docz build",
"prepublish": "yarn build && yarn changelog",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"changelog:rewrite": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
},
"files": [
"dist"
],
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{ts,tsx}": [
"prettier --write",
"tslint --fix",
"git add"
],
"*.{js,css,json,md}": [
"prettier --write",
"git add"
]
},
"prettier": {
"printWidth": 120,
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
}
@@ -0,0 +1,19 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
//#region src/jsx/children.ts
const toArray = (children) => Array.isArray(children) ? children : [children];
const Children = {
map: (children, fn) => toArray(children).map(fn),
forEach: (children, fn) => {
toArray(children).forEach(fn);
},
count: (children) => toArray(children).length,
only: (_children) => {
const children = toArray(_children);
if (children.length !== 1) throw new Error("Children.only() expects only one child");
return children[0];
},
toArray
};
//#endregion
exports.Children = Children;
exports.toArray = toArray;
@@ -0,0 +1,16 @@
import { setFeatureDefinitions } from 'motion-dom';
import { getInitializedFeatureDefinitions } from './definitions.mjs';
function loadFeatures(features) {
const featureDefinitions = getInitializedFeatureDefinitions();
for (const key in features) {
featureDefinitions[key] = {
...featureDefinitions[key],
...features[key],
};
}
setFeatureDefinitions(featureDefinitions);
}
export { loadFeatures };
//# sourceMappingURL=load-features.mjs.map
@@ -0,0 +1,81 @@
/*!
* express
* Copyright(c) 2009-2013 TJ Holowaychuk
* Copyright(c) 2013 Roman Shtylman
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict';
/**
* Module dependencies.
*/
var bodyParser = require('body-parser')
var EventEmitter = require('node:events').EventEmitter;
var mixin = require('merge-descriptors');
var proto = require('./application');
var Router = require('router');
var req = require('./request');
var res = require('./response');
/**
* Expose `createApplication()`.
*/
exports = module.exports = createApplication;
/**
* Create an express application.
*
* @return {Function}
* @api public
*/
function createApplication() {
var app = function(req, res, next) {
app.handle(req, res, next);
};
mixin(app, EventEmitter.prototype, false);
mixin(app, proto, false);
// expose the prototype that will get set on requests
app.request = Object.create(req, {
app: { configurable: true, enumerable: true, writable: true, value: app }
})
// expose the prototype that will get set on responses
app.response = Object.create(res, {
app: { configurable: true, enumerable: true, writable: true, value: app }
})
app.init();
return app;
}
/**
* Expose the prototypes.
*/
exports.application = proto;
exports.request = req;
exports.response = res;
/**
* Expose constructors.
*/
exports.Route = Router.Route;
exports.Router = Router;
/**
* Expose middleware
*/
exports.json = bodyParser.json
exports.raw = bodyParser.raw
exports.static = require('serve-static');
exports.text = bodyParser.text
exports.urlencoded = bodyParser.urlencoded
@@ -0,0 +1 @@
{"version":3,"file":"image-down.js","sources":["../../../src/icons/image-down.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ImageDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAuMyAyMUg1YTIgMiAwIDAgMS0yLTJWNWEyIDIgMCAwIDEgMi0yaDE0YTIgMiAwIDAgMSAyIDJ2MTBsLTMuMS0zLjFhMiAyIDAgMCAwLTIuODE0LjAxNEw2IDIxIiAvPgogIDxwYXRoIGQ9Im0xNCAxOSAzIDN2LTUuNSIgLz4KICA8cGF0aCBkPSJtMTcgMjIgMy0zIiAvPgogIDxjaXJjbGUgY3g9IjkiIGN5PSI5IiByPSIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/image-down\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 ImageDown = createLucideIcon('ImageDown', [\n [\n 'path',\n {\n d: 'M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21',\n key: '9csbqa',\n },\n ],\n ['path', { d: 'm14 19 3 3v-5.5', key: '9ldu5r' }],\n ['path', { d: 'm17 22 3-3', key: '1nkfve' }],\n ['circle', { cx: '9', cy: '9', r: '2', key: 'af1f0g' }],\n]);\n\nexport default ImageDown;\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;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,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC3C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AACxD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,2 @@
export { RouterClient } from './RouterClient.js';
export * from '@tanstack/router-core/ssr/client';
@@ -0,0 +1 @@
{"version":3,"file":"shallow-compare.mjs","sources":["../../../../src/render/utils/shallow-compare.ts"],"sourcesContent":["export function shallowCompare(next: any[], prev: any[] | null) {\n if (!Array.isArray(prev)) return false\n\n const prevLength = prev.length\n\n if (prevLength !== next.length) return false\n\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i]) return false\n }\n\n return true\n}\n"],"names":[],"mappings":"AAAM,SAAU,cAAc,CAAC,IAAW,EAAE,IAAkB,EAAA;AAC1D,IAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;AAAE,QAAA,OAAO,KAAK;AAEtC,IAAA,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM;AAE9B,IAAA,IAAI,UAAU,KAAK,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK;AAE5C,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE;QACjC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,KAAK;IACzC;AAEA,IAAA,OAAO,IAAI;AACf;;;;"}
@@ -0,0 +1,731 @@
flf2a$ 7 7 14 0 16 0 8004 0
Author : MJP (AKA MikeChat)
Date : 2003/9/27 12:58:29
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $##
.--. #
(O)(O) #
| o / #
|`-/ #
|_/ #
_ #
(_) ##
"#
#
#
#
#
#
##
##
#
#
#
#
#
##
$#
#
#
#
#
#
##
%#
#
#
#
#
#
##
&#
#
#
#
#
#
##
#
__ #
( ) #
)/ #
/ #
#
##
(#
#
#
#
#
#
##
)#
#
#
#
#
#
##
*#
#
#
#
#
#
##
+#
#
#
#
#
#
##
#
#
#
#
__ #
( ) #
)/ ##
#
#
#
_____ #
[_____] #
#
##
#
#
#
#
#
_ #
(_) ##
/#
#
#
#
#
#
##
.-. #
(O)_(O) #
/ .-. \ #
/ /_|_\ \ #
| \___/ | #
'. `-' .` #
`-.-' ##
__ #
/' \ #
" || #
|| #
|| #
_||_ #
(_/\_) ##
#
(O)-. #
(_.-. \ #
)/ #
// #
/(____; #
(____.-' ##
wWw #
_(O) #
(__ \ #
) \ #
(_ ) #
_/ / #
(__/ ##
\\ // #
(o)(o) #
/ /\ \ #
|(__)| #
\___ | #
| |_ #
\___) ##
#
oo_ #
.' __) #
| |__ #
|___ \ #
____) ) #
(_____/ ##
;(O) #
"/ __) #
| |__ #
| __ \ #
|(__)| #
\ / #
`--' ##
(O)-. #
(_.-. \ #
) ) #
/ / #
/ / #
/ | #
/_|_\ ##
wWwWw #
(O)o) #
/ _ \ #
/ (_) \ #
( /"\ ) #
\ \_/ / #
\___/ ##
,--. #
(O)(O) #
|(__)| #
| __/ #
| /|\ #
\ `-. #
`--' ##
#
#
_ #
(_) #
#
_ #
(_) ##
;#
#
#
#
#
#
##
<#
#
#
#
#
#
##
=#
#
#
#
#
#
##
>#
#
#
#
#
#
##
(O)-. #
(_.-. \ #
)/ #
// #
(/ #
_ #
(_) ##
@#
#
#
#
#
#
##
#
/) #
(o)(O) #
//\\ #
|(__)| #
/,-. | #
-' '' ##
___ #
(___)__ #
(O)(O) #
/ _\ #
| |_)) #
| |_)) #
(.'-' ##
c c #
(OO) #
,'.--.) #
/ //_|_\ #
| \___ #
'. ) #
`-.' ##
_ #
/||_ #
/o_) #
/ |(\ #
| | )) #
| |// #
\__/ ##
wWw #
(O)_ #
/ __) #
/ ( #
( _) #
\ \_ #
\__) ##
wWw #
(O)_ #
/ __) #
/ ( #
( _) #
/ / #
)/ ##
\/ #
(OO) #
,'.--.) #
/ /|_|_\ #
| \_.--. #
'. \) \ #
`-.(_.' ##
\\ // #
(o)(o) #
|| || #
|(__)| #
/.--.\ #
-' `- #
##
wW Ww #
(O)(O) #
(..) #
|| #
_||_ #
(_/\_) #
##
_ #
_||\ #
(_'\ #
( | #
\ | #
(\__)| #
`--.) ##
_ #
(OO) .' ) #
||_/ .' #
| / #
||\ \ #
(/\)\ `. #
`._) ##
W W #
(O)(O) #
|| #
| \ #
| `. #
(.-.__) #
`-' ##
\\\ /// #
((O) (O)) #
| \ / | #
||\\//|| #
|| \/ || #
|| || #
(_/ \_) ##
\\\ /// #
((O)(O)) #
| \ || #
||\\|| #
|| \ | #
|| || #
(_/ \_) ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \_____/ | #
'. `---' .` #
`-...-' ##
)) #
(o0)-. #
| (_)) #
| .-' #
|( #
\) #
( ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \___.--.| #
'. `---\) \ #
`-...(_.' ##
()_() #
(O o) #
|^_\ #
|(_)) #
| / #
)|\\ #
(/ \) ##
oo_ #
/ _)-< #
\__ `. #
`. | #
_| | #
,-' | #
(_..--' ##
(o)__(o) #
(__ __) #
( ) #
)( #
( ) #
)/ #
( ##
wWw wWw #
(O) (O) #
/ ) ( \ #
/ / \ \ #
| \____/ | #
'. `--' .` #
`-..-' ##
wWw wWw #
(O) (O) #
( \ / ) #
\ \ / / #
/ \/ \ #
\ `--' / #
`-..-' ##
(O)) ((O) #
|| || #
|| /\ || #
||//\\|| #
/ / \ \ #
( / \ ) #
) ( ##
wW Ww #
(O)\ /(O) #
`. \/ .' #
\ / #
/ \ #
.' /\ `. #
(_.' `._) ##
wWw wWw #
(O) (O) #
( \ / ) #
\ \/ / #
\o / #
_/ / #
(_.' ##
_oo #
>-(_ \ #
/ _/ #
/ / #
/ ( #
( `-. #
`--.._) ##
[#
#
#
#
#
#
##
\#
#
#
#
#
#
##
]#
#
#
#
#
#
##
#
/\ #
/ \ #
/ /\ \ #
\( )/ #
#
##
#
#
#
#
#
_____ #
[_____] ##
#
__ #
( ) #
\( #
\ #
#
##
#
/) #
(o)(O) #
//\\ #
|(__)| #
/,-. | #
-' '' ##
___ #
(___)__ #
(O)(O) #
/ _\ #
| |_)) #
| |_)) #
(.'-' ##
c c #
(OO) #
,'.--.) #
/ //_|_\ #
| \___ #
'. ) #
`-.' ##
_ #
/||_ #
/o_) #
/ |(\ #
| | )) #
| |// #
\__/ ##
wWw #
(O)_ #
/ __) #
/ ( #
( _) #
\ \_ #
\__) ##
wWw #
(O)_ #
/ __) #
/ ( #
( _) #
/ / #
)/ ##
\/ #
(OO) #
,'.--.) #
/ /|_|_\ #
| \_.--. #
'. \) \ #
`-.(_.' ##
\\ // #
(o)(o) #
|| || #
|(__)| #
/.--.\ #
-' `- #
##
wW Ww #
(O)(O) #
(..) #
|| #
_||_ #
(_/\_) #
##
_ #
_||\ #
(_'\ #
( | #
\ | #
(\__)| #
`--.) ##
_ #
(OO) .' ) #
||_/ .' #
| / #
||\ \ #
(/\)\ `. #
`._) ##
W W #
(O)(O) #
|| #
| \ #
| `. #
(.-.__) #
`-' ##
\\\ /// #
((O) (O)) #
| \ / | #
||\\//|| #
|| \/ || #
|| || #
(_/ \_) ##
\\\ /// #
((O)(O)) #
| \ || #
||\\|| #
|| \ | #
|| || #
(_/ \_) ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \_____/ | #
'. `---' .` #
`-...-' ##
)) #
(o0)-. #
| (_)) #
| .-' #
|( #
\) #
( ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \___.--.| #
'. `---\) \ #
`-...(_.' ##
()_() #
(O o) #
|^_\ #
|(_)) #
| / #
)|\\ #
(/ \) ##
oo_ #
/ _)-< #
\__ `. #
`. | #
_| | #
,-' | #
(_..--' ##
(o)__(o) #
(__ __) #
( ) #
)( #
( ) #
)/ #
( ##
wWw wWw #
(O) (O) #
/ ) ( \ #
/ / \ \ #
| \____/ | #
'. `--' .` #
`-..-' ##
wWw wWw #
(O) (O) #
( \ / ) #
\ \ / / #
/ \/ \ #
\ `--' / #
`-..-' ##
(O)) ((O) #
|| || #
|| /\ || #
||//\\|| #
/ / \ \ #
( / \ ) #
) ( ##
wW Ww #
(O)\ /(O) #
`. \/ .' #
\ / #
/ \ #
.' /\ `. #
(_.' `._) ##
wWw wWw #
(O) (O) #
( \ / ) #
\ \/ / #
\o / #
_/ / #
(_.' ##
_oo #
>-(_ \ #
/ _/ #
/ / #
/ ( #
( `-. #
`--.._) ##
{#
#
#
#
#
#
##
|#
#
#
#
#
#
##
}#
#
#
#
#
#
##
~#
#
#
#
#
#
##
#
/) #
(o)(O) #
//\\ #
|(__)| #
/,-. | #
-' '' ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \_____/ | #
'. `---' .` #
`-...-' ##
wWw wWw #
(O) (O) #
/ ) ( \ #
/ / \ \ #
| \____/ | #
'. `--' .` #
`-..-' ##
#
/) #
(o)(O) #
//\\ #
|(__)| #
/,-. | #
-' '' ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \_____/ | #
'. `---' .` #
`-...-' ##
wWw wWw #
(O) (O) #
/ ) ( \ #
/ / \ \ #
| \____/ | #
'. `--' .` #
`-..-' ##
ß#
#
#
#
#
#
##
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"B","2":"_Z","132":"A"},B:{"1":"_J"},C:{"1":"_w","2":"_f"},D:{"1":"_SL _HC","2":"_wB"},E:{"1":"_dB","2":"_4","260":"ND"},F:{"1":"_eD","2":"_6C"},G:{"1":"_t","2":"_sC","260":"ED"},H:{"1":"1D"},I:{"1":"_PE","2":"_LB"},J:{"1":"A","2":"D"},K:{"1":"_XD","2":"_gB"},L:{"1":"I"},M:{"1":"YC"},N:{"132":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:6,C:"Typed Arrays",D:true};
@@ -0,0 +1,11 @@
type Promisable<T> = T | Promise<T>;
export type Callback = (
directory: string,
files: string[],
) => Promisable<string | false | void>;
export default function (
directory: string,
callback: Callback,
): Promise<string | void>;
@@ -0,0 +1,136 @@
# RetryAgent
<!--introduced_in=v6.7.0-->
<!--type=module-->
<!-- source_link=lib/dispatcher/retry-agent.js -->
> Stability: 2 - Stable
A [`Dispatcher`][] that automatically retries failed requests by wrapping
another dispatcher with the retry logic of [`RetryHandler`][]. Requests that fail
with a retryable status code or transport error are re-dispatched according to
the configured retry policy.
```mjs
import { RetryAgent } from 'undici'
```
## Class: `RetryAgent`
<!-- YAML
added: v6.7.0
-->
* Extends: {Dispatcher}
Wraps an existing dispatcher and applies retry behaviour to every request it
dispatches. Lifecycle methods such as [`retryAgent.close()`][] and
[`retryAgent.destroy()`][] are forwarded to the wrapped dispatcher.
### `new RetryAgent(dispatcher[, options])`
<!-- YAML
added: v6.7.0
-->
* `dispatcher` {Dispatcher} The dispatcher to wrap and add retry behaviour to.
* `options` {RetryOptions} (optional)
* `throwOnError` {boolean} When `true`, an error is thrown on the final retry
attempt, preventing the following handlers from being called and destroying
the socket. Disable it when you need the response body for error responses
or when you provide a custom error handler. **Default:** `true`.
* `retry` {Function} Callback invoked on every retry iteration. It receives the
error, the current retry state, and a callback. Pass an error to the callback
to stop retrying, or call it with no argument to perform the retry.
* `err` {Error} The error that caused the retry attempt.
* `context` {RetryContext} The current retry context.
* `state` {RetryState} The mutable retry state.
* `counter` {number} The number of retries performed so far.
* `opts` {Object} The options passed to the retry handler, combining the
dispatch options with `retryOptions`.
* `callback` {Function} Called to continue. Pass an `Error` to stop retrying,
or `null`/`undefined` to perform the next retry.
* `maxRetries` {number} Maximum number of retries to allow. **Default:** `5`.
* `maxTimeout` {number} Maximum number of milliseconds to wait between retries.
**Default:** `30000` (30 seconds).
* `minTimeout` {number} Initial number of milliseconds to wait before the first
retry. **Default:** `500` (half a second).
* `timeoutFactor` {number} Factor by which the timeout is multiplied between
retries. **Default:** `2`.
* `retryAfter` {boolean} When `true`, the delay between retries is inferred from
the `Retry-After` response header when present. **Default:** `true`.
* `methods` {string[]} HTTP methods that are eligible for retry.
**Default:** `['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE']`.
* `statusCodes` {number[]} HTTP status codes that trigger a retry.
**Default:** `[500, 502, 503, 504, 429]`.
* `errorCodes` {string[]} Transport error codes that trigger a retry.
**Default:** `['ECONNRESET', 'ECONNREFUSED', 'ENOTFOUND', 'ENETDOWN', 'ENETUNREACH', 'EHOSTDOWN', 'EHOSTUNREACH', 'EPIPE', 'UND_ERR_SOCKET']`.
Creates a new `RetryAgent` that wraps `dispatcher`. The `options` are stored and
used to construct a [`RetryHandler`][] for each dispatched request.
```mjs
import { Agent, RetryAgent } from 'undici'
const agent = new RetryAgent(new Agent(), {
maxRetries: 3,
minTimeout: 1000,
timeoutFactor: 2,
})
const res = await agent.request({
method: 'GET',
origin: 'http://example.com',
path: '/',
})
console.log(res.statusCode)
console.log(await res.body.text())
```
### `retryAgent.dispatch(options, handler)`
<!-- YAML
added: v6.7.0
-->
* `options` {DispatchOptions} The dispatch options, identical to
[`dispatcher.dispatch()`][].
* `handler` {DispatchHandler} The dispatch handler.
* Returns: {boolean}
Dispatches `options` through the wrapped dispatcher, installing a
[`RetryHandler`][] that applies the configured retry policy before delegating to
`handler`. Returns `false` if the dispatcher is busy and the caller should wait
before dispatching again, otherwise `true`.
### `retryAgent.close()`
<!-- YAML
added: v6.7.0
-->
* Returns: {Promise} Resolves when the wrapped dispatcher has closed.
Gracefully closes the wrapped dispatcher, waiting for in-flight requests to
complete. Equivalent to calling [`dispatcher.close()`][] on the wrapped
dispatcher.
### `retryAgent.destroy()`
<!-- YAML
added: v6.7.0
-->
* Returns: {Promise} Resolves when the wrapped dispatcher has been destroyed.
Forcefully destroys the wrapped dispatcher, aborting all pending requests.
Equivalent to calling [`dispatcher.destroy()`][] on the wrapped dispatcher.
[`Dispatcher`]: Dispatcher.md#class-dispatcher
[`RetryHandler`]: RetryHandler.md#class-retryhandler
[`dispatcher.close()`]: Dispatcher.md#dispatcherclosecallback
[`dispatcher.destroy()`]: Dispatcher.md#dispatcherdestroyerror-callback
[`dispatcher.dispatch()`]: Dispatcher.md#dispatcherdispatchoptions-handler
[`retryAgent.close()`]: #retryagentclose
[`retryAgent.destroy()`]: #retryagentdestroy
@@ -0,0 +1,65 @@
//#region src/client/fetch-result-please.ts
/**
* @description This file is a modified version of `fetch-result-please` (`ofetch`), minimalized and adapted to Hono's custom needs.
*
* @link https://www.npmjs.com/package/fetch-result-please
*/
const nullBodyResponses = /* @__PURE__ */ new Set([
101,
204,
205,
304
]);
/**
* Smartly parses and return the consumable result from a fetch `Response`.
*
* Throwing a structured error if the response is not `ok`. ({@link DetailedError})
*/
async function fetchRP(fetchRes) {
const _fetchRes = await fetchRes;
if ((_fetchRes.body || _fetchRes._bodyInit) && !nullBodyResponses.has(_fetchRes.status)) _fetchRes._data = await _fetchRes[detectResponseType(_fetchRes)]();
if (!_fetchRes.ok) throw new DetailedError(`${_fetchRes.status} ${_fetchRes.statusText}`, {
statusCode: _fetchRes?.status,
detail: {
data: _fetchRes?._data,
statusText: _fetchRes?.statusText
}
});
return _fetchRes._data;
}
var DetailedError = class extends Error {
/**
* Additional `message` that will be logged AND returned to client
*/
detail;
/**
* Additional `code` that will be logged AND returned to client
*/
code;
/**
* Additional value that will be logged AND NOT returned to client
*/
log;
/**
* Optionally set the status code to return, in a web server context
*/
statusCode;
constructor(message, options = {}) {
super(message);
this.name = "DetailedError";
this.log = options.log;
this.detail = options.detail;
this.code = options.code;
this.statusCode = options.statusCode;
}
};
const jsonRegex = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(?:;.+)?$/i;
function detectResponseType(response) {
const _contentType = response.headers.get("content-type");
if (!_contentType) return "text";
const contentType = _contentType.split(";").shift();
if (jsonRegex.test(contentType)) return "json";
return "text";
}
//#endregion
export { DetailedError, fetchRP };
@@ -0,0 +1,123 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "знаци", verb: "да имаат" },
file: { unit: "бајти", verb: "да имаат" },
array: { unit: "ставки", verb: "да имаат" },
set: { unit: "ставки", verb: "да имаат" },
map: { unit: "ставки", verb: "да имаат" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const FormatDictionary: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "внес",
email: "адреса на е-пошта",
url: "URL",
emoji: "емоџи",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO датум и време",
date: "ISO датум",
time: "ISO време",
duration: "ISO времетраење",
ipv4: "IPv4 адреса",
ipv6: "IPv6 адреса",
mac: "MAC адреса",
cidrv4: "IPv4 опсег",
cidrv6: "IPv6 опсег",
base64: "base64-енкодирана низа",
base64url: "base64url-енкодирана низа",
json_string: "JSON низа",
e164: "E.164 број",
credit_card: "број на кредитна картичка",
currency_code: "код на валута",
iban: "IBAN",
jwt: "JWT",
template_literal: "внес",
};
const TypeDictionary: {
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
} = {
nan: "NaN",
number: "број",
array: "низа",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Грешен внес: се очекува instanceof ${issue.expected}, примено ${received}`;
}
return `Грешен внес: се очекува ${expected}, примено ${received}`;
}
case "invalid_value":
if (issue.values.length === 1) return `Invalid input: expected ${util.stringifyPrimitive(issue.values[0])}`;
return `Грешана опција: се очекува една ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Премногу голем: се очекува ${issue.origin ?? "вредноста"} да има ${adj}${issue.maximum.toString()} ${sizing.unit ?? "елементи"}`;
return `Премногу голем: се очекува ${issue.origin ?? "вредноста"} да биде ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Премногу мал: се очекува ${issue.origin} да има ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Премногу мал: се очекува ${issue.origin} да биде ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") {
return `Неважечка низа: мора да започнува со "${_issue.prefix}"`;
}
if (_issue.format === "ends_with") return `Неважечка низа: мора да завршува со "${_issue.suffix}"`;
if (_issue.format === "includes") return `Неважечка низа: мора да вклучува "${_issue.includes}"`;
if (_issue.format === "regex") return `Неважечка низа: мора да одгоара на патернот ${_issue.pattern}`;
return `Invalid ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Грешен број: мора да биде делив со ${issue.divisor}`;
case "unrecognized_keys":
return `${issue.keys.length > 1 ? "Непрепознаени клучеви" : "Непрепознаен клуч"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Грешен клуч во ${issue.origin}`;
case "invalid_union":
return "Грешен внес";
case "invalid_element":
return `Грешна вредност во ${issue.origin}`;
default:
return `Грешен внес`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -0,0 +1,383 @@
/**
* @fileoverview Rule to flag dangling underscores in variable declarations.
* @author Matt DuVall <http://www.mattduvall.com>
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [
{
allow: [],
allowAfterSuper: false,
allowAfterThis: false,
allowAfterThisConstructor: false,
allowFunctionParams: true,
allowInArrayDestructuring: true,
allowInObjectDestructuring: true,
enforceInClassFields: false,
enforceInMethodNames: false,
},
],
docs: {
description: "Disallow dangling underscores in identifiers",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/no-underscore-dangle",
},
schema: [
{
type: "object",
properties: {
allow: {
type: "array",
items: {
type: "string",
},
},
allowAfterThis: {
type: "boolean",
},
allowAfterSuper: {
type: "boolean",
},
allowAfterThisConstructor: {
type: "boolean",
},
enforceInMethodNames: {
type: "boolean",
},
allowFunctionParams: {
type: "boolean",
},
enforceInClassFields: {
type: "boolean",
},
allowInArrayDestructuring: {
type: "boolean",
},
allowInObjectDestructuring: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
unexpectedUnderscore:
"Unexpected dangling '_' in '{{identifier}}'.",
},
},
create(context) {
const [
{
allow,
allowAfterSuper,
allowAfterThis,
allowAfterThisConstructor,
allowFunctionParams,
allowInArrayDestructuring,
allowInObjectDestructuring,
enforceInClassFields,
enforceInMethodNames,
},
] = context.options;
const sourceCode = context.sourceCode;
//-------------------------------------------------------------------------
// Helpers
//-------------------------------------------------------------------------
/**
* Check if identifier is present inside the allowed option
* @param {string} identifier name of the node
* @returns {boolean} true if its is present
* @private
*/
function isAllowed(identifier) {
return allow.includes(identifier);
}
/**
* Check if identifier has a dangling underscore
* @param {string} identifier name of the node
* @returns {boolean} true if its is present
* @private
*/
function hasDanglingUnderscore(identifier) {
const len = identifier.length;
return (
identifier !== "_" &&
(identifier[0] === "_" || identifier[len - 1] === "_")
);
}
/**
* Check if identifier is a special case member expression
* @param {string} identifier name of the node
* @returns {boolean} true if its is a special case
* @private
*/
function isSpecialCaseIdentifierForMemberExpression(identifier) {
return identifier === "__proto__";
}
/**
* Check if identifier is a special case variable expression
* @param {string} identifier name of the node
* @returns {boolean} true if its is a special case
* @private
*/
function isSpecialCaseIdentifierInVariableExpression(identifier) {
// Checks for the underscore library usage here
return identifier === "_";
}
/**
* Check if a node is a member reference of this.constructor
* @param {ASTNode} node node to evaluate
* @returns {boolean} true if it is a reference on this.constructor
* @private
*/
function isThisConstructorReference(node) {
return (
node.object.type === "MemberExpression" &&
node.object.property.name === "constructor" &&
node.object.object.type === "ThisExpression"
);
}
/**
* Check if function parameter has a dangling underscore.
* @param {ASTNode} node function node to evaluate
* @returns {void}
* @private
*/
function checkForDanglingUnderscoreInFunctionParameters(node) {
if (!allowFunctionParams) {
node.params.forEach(param => {
const { type } = param;
let nodeToCheck;
if (type === "RestElement") {
nodeToCheck = param.argument;
} else if (type === "AssignmentPattern") {
nodeToCheck = param.left;
} else {
nodeToCheck = param;
}
if (nodeToCheck.type === "Identifier") {
const identifier = nodeToCheck.name;
if (
hasDanglingUnderscore(identifier) &&
!isAllowed(identifier)
) {
context.report({
node: param,
messageId: "unexpectedUnderscore",
data: {
identifier,
},
});
}
}
});
}
}
/**
* Check if function has a dangling underscore
* @param {ASTNode} node node to evaluate
* @returns {void}
* @private
*/
function checkForDanglingUnderscoreInFunction(node) {
if (node.type === "FunctionDeclaration" && node.id) {
const identifier = node.id.name;
if (
typeof identifier !== "undefined" &&
hasDanglingUnderscore(identifier) &&
!isAllowed(identifier)
) {
context.report({
node,
messageId: "unexpectedUnderscore",
data: {
identifier,
},
});
}
}
checkForDanglingUnderscoreInFunctionParameters(node);
}
/**
* Check if variable expression has a dangling underscore
* @param {ASTNode} node node to evaluate
* @returns {void}
* @private
*/
function checkForDanglingUnderscoreInVariableExpression(node) {
sourceCode.getDeclaredVariables(node).forEach(variable => {
const definition = variable.defs.find(def => def.node === node);
const identifierNode = definition.name;
const identifier = identifierNode.name;
let parent = identifierNode.parent;
while (
![
"VariableDeclarator",
"ArrayPattern",
"ObjectPattern",
].includes(parent.type)
) {
parent = parent.parent;
}
if (
hasDanglingUnderscore(identifier) &&
!isSpecialCaseIdentifierInVariableExpression(identifier) &&
!isAllowed(identifier) &&
!(
allowInArrayDestructuring &&
parent.type === "ArrayPattern"
) &&
!(
allowInObjectDestructuring &&
parent.type === "ObjectPattern"
)
) {
context.report({
node,
messageId: "unexpectedUnderscore",
data: {
identifier,
},
});
}
});
}
/**
* Check if member expression has a dangling underscore
* @param {ASTNode} node node to evaluate
* @returns {void}
* @private
*/
function checkForDanglingUnderscoreInMemberExpression(node) {
const identifier = node.property.name,
isMemberOfThis = node.object.type === "ThisExpression",
isMemberOfSuper = node.object.type === "Super",
isMemberOfThisConstructor = isThisConstructorReference(node);
if (
typeof identifier !== "undefined" &&
hasDanglingUnderscore(identifier) &&
!(isMemberOfThis && allowAfterThis) &&
!(isMemberOfSuper && allowAfterSuper) &&
!(isMemberOfThisConstructor && allowAfterThisConstructor) &&
!isSpecialCaseIdentifierForMemberExpression(identifier) &&
!isAllowed(identifier)
) {
context.report({
node,
messageId: "unexpectedUnderscore",
data: {
identifier,
},
});
}
}
/**
* Check if method declaration or method property has a dangling underscore
* @param {ASTNode} node node to evaluate
* @returns {void}
* @private
*/
function checkForDanglingUnderscoreInMethod(node) {
const identifier = node.key.name;
const isMethod =
node.type === "MethodDefinition" ||
(node.type === "Property" && node.method);
if (
typeof identifier !== "undefined" &&
enforceInMethodNames &&
isMethod &&
hasDanglingUnderscore(identifier) &&
!isAllowed(identifier)
) {
context.report({
node,
messageId: "unexpectedUnderscore",
data: {
identifier:
node.key.type === "PrivateIdentifier"
? `#${identifier}`
: identifier,
},
});
}
}
/**
* Check if a class field has a dangling underscore
* @param {ASTNode} node node to evaluate
* @returns {void}
* @private
*/
function checkForDanglingUnderscoreInClassField(node) {
const identifier = node.key.name;
if (
typeof identifier !== "undefined" &&
hasDanglingUnderscore(identifier) &&
enforceInClassFields &&
!isAllowed(identifier)
) {
context.report({
node,
messageId: "unexpectedUnderscore",
data: {
identifier:
node.key.type === "PrivateIdentifier"
? `#${identifier}`
: identifier,
},
});
}
}
//--------------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------------
return {
FunctionDeclaration: checkForDanglingUnderscoreInFunction,
VariableDeclarator: checkForDanglingUnderscoreInVariableExpression,
MemberExpression: checkForDanglingUnderscoreInMemberExpression,
MethodDefinition: checkForDanglingUnderscoreInMethod,
PropertyDefinition: checkForDanglingUnderscoreInClassField,
Property: checkForDanglingUnderscoreInMethod,
FunctionExpression: checkForDanglingUnderscoreInFunction,
ArrowFunctionExpression: checkForDanglingUnderscoreInFunction,
};
},
};
@@ -0,0 +1,117 @@
/**
* @fileoverview Rule to check multiple var declarations per line
* @author Alberto Rodríguez
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "one-var-declaration-per-line",
url: "https://eslint.style/rules/one-var-declaration-per-line",
},
},
],
},
type: "suggestion",
docs: {
description:
"Require or disallow newlines around variable declarations",
recommended: false,
url: "https://eslint.org/docs/latest/rules/one-var-declaration-per-line",
},
schema: [
{
enum: ["always", "initializations"],
},
],
fixable: "whitespace",
messages: {
expectVarOnNewline:
"Expected variable declaration to be on a new line.",
},
},
create(context) {
const always = context.options[0] === "always";
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Determine if provided keyword is a variant of for specifiers
* @private
* @param {string} keyword keyword to test
* @returns {boolean} True if `keyword` is a variant of for specifier
*/
function isForTypeSpecifier(keyword) {
return (
keyword === "ForStatement" ||
keyword === "ForInStatement" ||
keyword === "ForOfStatement"
);
}
/**
* Checks newlines around variable declarations.
* @private
* @param {ASTNode} node `VariableDeclaration` node to test
* @returns {void}
*/
function checkForNewLine(node) {
if (isForTypeSpecifier(node.parent.type)) {
return;
}
const declarations = node.declarations;
let prev;
declarations.forEach(current => {
if (prev && prev.loc.end.line === current.loc.start.line) {
if (always || prev.init || current.init) {
context.report({
node,
messageId: "expectVarOnNewline",
loc: current.loc,
fix: fixer => fixer.insertTextBefore(current, "\n"),
});
}
}
prev = current;
});
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
VariableDeclaration: checkForNewLine,
};
},
};
@@ -0,0 +1,947 @@
export default `flf2a$ 9 8 13 0 18 0 24447 0
Font : Fire Font-k
Author : MJP
Date : 2003/11/6 11:11:05
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
Based on Small.flf by Glenn Chappell 4/93 -- based on Standard
---
Font modified May 26, 2012 by patorjk
- Added the 0xCA0 character.
$ #
$ #
$ #
$ #
$ #
$ #
$ #
$ #
$ ##
____ #
| / #
| / #
| / #
|/ #
( #
)\\ #
((_) #
##
#
( ( #
)\\ )\\ #
((_)((_) #
#
#
#
#
##
#
_ _ #
_| | |_ #
|_ . _| #
|_ _| #
|_|_| #
#
#
##
#
#
||_ #
(_-< #
/ _/ #
|| #
#
#
##
#
#
#
_ __ #
(_)/ / #
/ /_ #
/_/(_) #
#
##
#
#
( #
__ )\\ #
/ _|((_) #
> _|_ _| #
\\_____| #
#
##
#
( #
)\\ #
((_) #
#
#
#
#
##
#
#
#
__ #
/ / #
| | #
| | #
\\_\\ #
##
#
#
#
__ #
\\ \\ #
| | #
| | #
/_/ #
##
_/\\_ #
> < #
\\/ #
#
#
#
#
#
##
#
#
#
_ #
_| |_ #
|_ _| #
|_| #
#
##
#
#
#
#
#
) #
/( #
(_)) #
##
#
#
#
___ #
|___| #
#
#
#
##
#
#
#
#
#
#
_ #
(_) #
##
#
#
#
__ #
/ / #
/ / #
/_/ #
#
##
#
) #
( /( #
)\\()) #
((_)\\ #
/ (_) #
| () | #
\\__/ #
##
#
) #
( /( #
)\\()) #
((_)\\ #
/ (_) #
| | #
|_| #
##
#
) #
( /( #
)(_)) #
((_) #
|_ ) #
/ / #
/___| #
##
#
) #
( /( #
)\\()) #
((_)\\ #
|__ (_) #
|_ \\ #
|___/ #
##
#
) #
( /( #
)\\()) #
((_)\\ #
| | (_) #
|_ _| #
|_| #
##
#
( ( #
)\\))( #
((_)()\\ #
(()((_) #
| __| #
|__ \\ #
|___/ #
##
#
( #
)\\ ) #
(()/( #
/(_)) #
(_) / #
/ _ \\ #
\\___/ #
##
#
) #
( /( #
)\\()) #
((_)\\ #
|__ / #
/ / #
/_/ #
##
#
( #
)\\ ( #
((_))\\ #
_((_) #
( _ ) #
/ _ \\ #
\\___/ #
##
#
) #
( /( #
)\\()) #
((_)\\ #
/ _(_) #
\\_, / #
/_/ #
##
#
#
#
#
_ #
(_) #
_ #
(_) #
##
#
#
#
#
_ #
(_) #
( #
)\\ #
((_) ##
#
#
#
#
__ #
/ / #
< < #
\\_\\ #
##
#
#
#
#
#
___ #
|___| #
|___| #
##
#
#
#
#
__ #
\\ \\ #
> > #
/_/ #
##
#
#
( #
)\\ #
((_) #
|__ \\ #
/_/ #
(_) #
##
#
#
( #
)\\ #
((_) #
/__ _\\ #
// _\` |\\ #
\\\\__,_|/ #
\\____/ ##
#
( #
)\\ #
((((_)( #
)\\ _ )\\ #
(_)_\\(_) #
/ _ \\ #
/_/ \\_\\ #
##
#
( #
( )\\ #
)((_) #
((_)_ #
| _ ) #
| _ \\ #
|___/ #
##
#
( #
)\\ #
(((_) #
)\\___ #
((/ __| #
| (__ #
\\___| #
##
( #
)\\ ) #
(()/( #
/(_)) #
(_))_ #
| \\ #
| |) | #
|___/ #
##
#
#
( #
)\\ #
((_) #
| __| #
| _| #
|___| #
##
( #
)\\ ) #
(()/( #
/(_)) #
(_))_| #
| |_ #
| __| #
|_| #
##
#
( #
)\\ ) #
(()/( #
/(_))_ #
(_)) __| #
| (_ | #
\\___| #
##
) #
( /( #
)\\()) #
((_)\\ #
_((_) #
| || | #
| __ | #
|_||_| #
##
( #
)\\ ) #
(()/( #
/(_)) #
(_)) #
|_ _| #
| | #
|___| #
##
#
#
( #
)\\ #
((_) #
_ | | #
| || | #
\\__/ #
##
) #
( /( #
)\\()) #
|((_)\\ #
|_ ((_) #
| |/ / #
' < #
_|\\_\\ #
##
( #
)\\ ) #
(()/( #
/(_)) #
(_)) #
| | #
| |__ #
|____| #
##
* #
( \` #
)\\))( #
((_)()\\ #
(_()((_) #
| \\/ | #
| |\\/| | #
|_| |_| #
##
) #
( /( #
)\\()) #
((_)\\ #
_((_) #
| \\| | #
| .\` | #
|_|\\_| #
##
) #
( /( #
)\\()) #
((_)\\ #
((_) #
/ _ \\ #
| (_) | #
\\___/ #
##
( #
)\\ ) #
(()/( #
/(_)) #
(_)) #
| _ \\ #
| _/ #
|_| #
##
#
( #
( )\\ #
)((_) #
((_)_ #
/ _ \\ #
| (_) | #
\\__\\_\\ #
##
( #
)\\ ) #
(()/( #
/(_)) #
(_)) #
| _ \\ #
| / #
|_|_\\ #
##
( #
)\\ ) #
(()/( #
/(_)) #
(_)) #
/ __| #
\\__ \\ #
|___/ #
##
#
* ) #
\` ) /( #
( )(_)) #
(_(_()) #
|_ _| #
| | #
|_| #
##
#
#
( #
)\\ #
_ ((_) #
| | | | #
| |_| | #
\\___/ #
##
#
#
( ( #
)\\ )\\ #
((_)((_) #
\\ \\ / / #
\\ V / #
\\_/ #
##
#
( ( #
)\\))( '#
((_)()\\ ) #
_(())\\_)()#
\\ \\((_)/ /#
\\ \\/\\/ / #
\\_/\\_/ #
##
) #
( /( #
)\\()) #
((_)\\ #
__((_) #
\\ \\/ / #
> < #
/_/\\_\\ #
##
) #
( /( #
)\\()) #
((_)\\ #
__ ((_) #
\\ \\ / / #
\\ V / #
|_| #
##
) #
( /( #
)\\()) #
((_)\\ #
_((_) #
|_ / #
/ / #
/___| #
##
#
#
#
#
__ #
| _| #
| | #
| | #
|__| ##
#
#
#
#
__ #
\\ \\ #
\\ \\ #
\\_\\ #
##
#
#
#
#
__ #
|_ | #
| | #
| | #
|__| ##
#
/\\ #
|/\\| #
#
#
#
#
#
##
#
#
#
#
#
#
#
_____ #
|_____| ##
\`#
#
#
#
#
#
#
#
##
#
#
) #
( /( #
)(_)) #
((_)_ #
/ _\` | #
\\__,_| #
##
#
) #
( /( #
)\\()) #
((_)\\ #
| |(_) #
| '_ \\ #
|_.__/ #
##
#
#
#
( #
)\\ #
((_) #
/ _| #
\\__| #
##
#
( #
)\\ ) #
(()/( #
((_)) #
_| | #
/ _\` | #
\\__,_| #
##
#
#
( #
))\\ #
/((_) #
(_)) #
/ -_) #
\\___| #
##
#
( #
)\\ ) #
(()/( #
/(_)) #
(_) _| #
| _| #
|_| #
##
#
#
( ( #
)\\))( #
((_))\\ #
(()(_) #
/ _\` | #
\\__, | #
|___/ ##
#
) #
( /( #
)\\()) #
((_)\\ #
| |(_) #
| ' \\ #
|_||_| #
##
#
#
( #
)\\ #
((_) #
(_) #
| | #
|_| #
##
#
#
( #
)\\ #
((_) #
! #
| | #
_/ | #
|__/ ##
#
) #
( /( #
)\\()) #
((_)\\ #
| |(_) #
| / / #
|_\\_\\ #
##
#
( #
)\\ #
((_) #
_ #
| | #
| | #
|_| #
##
#
#
) #
( #
)\\ ' #
_((_)) #
| ' \\() #
|_|_|_| #
##
#
#
#
( #
)\\ ) #
_(_/( #
| ' \\)) #
|_||_| #
##
#
#
#
( #
)\\ #
((_) #
/ _ \\ #
\\___/ #
##
#
#
#
\` ) #
/(/( #
((_)_\\ #
| '_ \\) #
| .__/ #
|_| ##
#
#
( #
( )\\ #
)(( ) #
((_)_) #
/ _\` | #
\\__, | #
|_| ##
#
#
( #
)( #
(()\\ #
((_) #
| '_| #
|_| #
##
#
#
#
( #
)\\ #
((_) #
(_-< #
/__/ #
##
#
) #
( /( #
)\\()) #
(_))/ #
| |_ #
| _| #
\\__| #
##
#
#
( #
))\\ #
/((_) #
(_))( #
| || | #
\\_,_| #
##
#
#
) #
/(( #
(_))\\ #
_)((_) #
\\ V / #
\\_/ #
##
#
#
( ( #
)\\))( #
((_)()\\ #
_(()((_) #
\\ V V / #
\\_/\\_/ #
##
#
#
) #
( /( #
)\\()) #
((_)\\ #
\\ \\ / #
/_\\_\\ #
##
#
#
( #
)\\ ) #
(()/( #
)(_)) #
| || | #
\\_, | #
|__/ ##
#
#
#
( #
)\\ #
((_) #
|_ / #
/__| #
##
#
#
#
#
__ #
/ / #
_| | #
| | #
\\_\\ ##
#
#
#
#
_ #
| | #
| | #
| | #
|_| ##
#
#
#
#
__ #
\\ \\ #
| |_ #
| | #
/_/ ##
#
/\\/| #
|/\\/ #
#
#
#
#
#
##
) #
/( ( #
(_)))\\ #
(_)_(_) #
/_\\ #
/ _ \\ #
/_/ \\_\\ #
#
##
( #
) )\\ #
/(((_) #
(_)_(_) #
/ _ \\ #
| (_) | #
\\___/ #
#
##
) #
/( ( #
(_)))\\ #
(_)_(_) #
| | | | #
| |_| | #
\\___/ #
#
##
#
#
( #
_ )\\ #
(_((_) #
/ _\` | #
\\__,_| #
#
##
#
#
) #
/( _ #
(_))(_) #
/ _ \\ #
\\___/ #
#
##
#
#
( #
_ )\\ #
(_)((_) #
| |_| | #
\\___/ #
#
##
#
( #
( )\\ #
)((_) #
(/__ \\ #
| |< < #
| ||_/ #
|_| #
##
0xCA0 KANNADA LETTER TTHA
) #
( /( #
)\\()) #
((_)\\__)#
/____/ #
/ _ \\ #
| (_) | #
$\\___/$ #
##`
@@ -0,0 +1,32 @@
const lib = require('./nopt-lib')
const defaultTypeDefs = require('./type-defs')
// This is the version of nopt's API that requires setting typeDefs and invalidHandler on the required `nopt` object since it is a singleton.
// To not do a breaking change an API that requires all options be passed in is located in `nopt-lib.js` and exported here as lib.
// TODO(breaking): make API only work in non-singleton mode
module.exports = exports = nopt
exports.clean = clean
exports.typeDefs = defaultTypeDefs
exports.lib = lib
function nopt (types, shorthands, args = process.argv, slice = 2) {
return lib.nopt(args.slice(slice), {
types: types || {},
shorthands: shorthands || {},
typeDefs: exports.typeDefs,
invalidHandler: exports.invalidHandler,
unknownHandler: exports.unknownHandler,
abbrevHandler: exports.abbrevHandler,
})
}
function clean (data, types, typeDefs = exports.typeDefs) {
return lib.clean(data, {
types: types || {},
typeDefs,
invalidHandler: exports.invalidHandler,
unknownHandler: exports.unknownHandler,
abbrevHandler: exports.abbrevHandler,
})
}
@@ -0,0 +1,18 @@
export declare function escapeHtml(s: string): string;
/**
* @returns {String} the string with all zeroes contained in a <span>
*/
export declare function spanAllZeroes(s: string): string;
/**
* @returns {String} the string with each character contained in a <span>
*/
export declare function spanAll(s: string, offset?: number): string;
/**
* @returns {String} the string with leading zeroes contained in a <span>
*/
export declare function spanLeadingZeroes(address: string): string;
/**
* Groups an address
* @returns {String} a grouped address
*/
export declare function simpleGroup(addressString: string, offset?: number): string[];
@@ -0,0 +1,623 @@
export default `flf2a$ 6 5 25 0 9 0
ticksslant.flf (C) 1994 by Victor Parada (vparada@inf.utfsm.cl) 94/09/23.
figlet 2.1 font based on ticks.flf, slanted using slantfigfont.
Try option "-m 1" to smush one "_" between fonts.
Latin fonts a' e' i' o' u' n~ and N~ replaces A" O" U" a" o" u" and B.
____@
____ @
____ @
____ @
____ @
____ @@
_/\\/\\_@
_/\\/\\_ @
_/\\/\\_ @
______ @
_/\\/\\_ @
______ @@
_/\\/\\/\\/\\_@
_/\\/\\/\\/\\_ @
_/\\__/\\___ @
__________ @
__________ @
__________ @@
___/\\/\\__/\\/\\___@
_/\\/\\/\\/\\/\\/\\/\\_ @
___/\\/\\__/\\/\\___ @
_/\\/\\/\\/\\/\\/\\/\\_ @
___/\\/\\__/\\/\\___ @
________________ @@
_____/\\/\\_____@
___/\\/\\/\\/\\/\\_ @
_/\\/\\/\\/\\_____ @
_____/\\/\\/\\/\\_ @
_/\\/\\/\\/\\/\\___ @
_____/\\/\\_____ @@
_/\\/\\____/\\/\\_@
_/\\/\\__/\\/\\___ @
_____/\\/\\_____ @
___/\\/\\__/\\/\\_ @
_/\\/\\____/\\/\\_ @
______________ @@
_____/\\/\\_______@
_____/\\/\\_______ @
___/\\/\\/\\__/\\/\\_ @
_/\\/\\____/\\/\\___ @
___/\\/\\/\\__/\\/\\_ @
________________ @@
_/\\/\\_@
_/\\/\\_ @
_/\\___ @
______ @
______ @
______ @@
___/\\/\\/\\_@
_/\\/\\/\\___ @
_/\\/\\_____ @
_/\\/\\/\\___ @
___/\\/\\/\\_ @
__________ @@
_/\\/\\/\\___@
___/\\/\\/\\_ @
_____/\\/\\_ @
___/\\/\\/\\_ @
_/\\/\\/\\___ @
__________ @@
___/\\/\\__/\\/\\___@
_____/\\/\\/\\_____ @
_/\\/\\/\\/\\/\\/\\/\\_ @
_____/\\/\\/\\_____ @
___/\\/\\__/\\/\\___ @
________________ @@
______________@
_____/\\/\\_____ @
_/\\/\\/\\/\\/\\/\\_ @
_____/\\/\\_____ @
______________ @
______________ @@
______@
______ @
______ @
_/\\/\\_ @
_/\\/\\_ @
_/\\___ @@
__________@
__________ @
_/\\/\\/\\/\\_ @
__________ @
__________ @
__________ @@
______@
______ @
______ @
_/\\/\\_ @
_/\\/\\_ @
______ @@
_________/\\/\\_@
_______/\\/\\___ @
_____/\\/\\_____ @
___/\\/\\_______ @
_/\\/\\_________ @
______________ @@
___/\\/\\/\\/\\___@
_/\\/\\____/\\/\\_ @
_/\\/\\__/\\/\\/\\_ @
_/\\/\\/\\__/\\/\\_ @
___/\\/\\/\\/\\___ @
______________ @@
___/\\/\\_@
_/\\/\\/\\_ @
___/\\/\\_ @
___/\\/\\_ @
___/\\/\\_ @
________ @@
_/\\/\\/\\/\\/\\___@
_________/\\/\\_ @
___/\\/\\/\\/\\___ @
_/\\/\\_________ @
_/\\/\\/\\/\\/\\/\\_ @
______________ @@
_/\\/\\/\\/\\/\\___@
_________/\\/\\_ @
___/\\/\\/\\/\\___ @
_________/\\/\\_ @
_/\\/\\/\\/\\/\\___ @
______________ @@
_____/\\/\\/\\___@
___/\\/\\/\\/\\___ @
_/\\/\\__/\\/\\___ @
_/\\/\\/\\/\\/\\/\\_ @
_______/\\/\\___ @
______________ @@
_/\\/\\/\\/\\/\\/\\_@
_/\\/\\_________ @
_/\\/\\/\\/\\/\\___ @
_________/\\/\\_ @
_/\\/\\/\\/\\/\\___ @
______________ @@
___/\\/\\/\\/\\___@
_/\\/\\_________ @
_/\\/\\/\\/\\/\\___ @
_/\\/\\____/\\/\\_ @
___/\\/\\/\\/\\___ @
______________ @@
_/\\/\\/\\/\\/\\/\\_@
_______/\\/\\___ @
_____/\\/\\_____ @
___/\\/\\_______ @
_/\\/\\_________ @
______________ @@
___/\\/\\/\\/\\___@
_/\\/\\____/\\/\\_ @
___/\\/\\/\\/\\___ @
_/\\/\\____/\\/\\_ @
___/\\/\\/\\/\\___ @
______________ @@
___/\\/\\/\\/\\___@
_/\\/\\____/\\/\\_ @
___/\\/\\/\\/\\/\\_ @
_________/\\/\\_ @
___/\\/\\/\\/\\___ @
______________ @@
_/\\/\\_@
_/\\/\\_ @
______ @
_/\\/\\_ @
_/\\/\\_ @
______ @@
_/\\/\\_@
_/\\/\\_ @
______ @
_/\\/\\_ @
_/\\/\\_ @
_/\\___ @@
_____/\\/\\_@
___/\\/\\___ @
_/\\/\\_____ @
___/\\/\\___ @
_____/\\/\\_ @
__________ @@
__________@
_/\\/\\/\\/\\_ @
__________ @
_/\\/\\/\\/\\_ @
__________ @
__________ @@
_/\\/\\_____@
___/\\/\\___ @
_____/\\/\\_ @
___/\\/\\___ @
_/\\/\\_____ @
__________ @@
_/\\/\\/\\/\\/\\___@
_________/\\/\\_ @
_____/\\/\\/\\___ @
______________ @
_____/\\/\\_____ @
______________ @@
___/\\/\\/\\/\\___@
_/\\/\\__/\\/\\/\\_ @
_/\\/\\__/\\/\\/\\_ @
_/\\/\\_________ @
___/\\/\\/\\/\\___ @
______________ @@
_____/\\/\\_____@
___/\\/\\/\\/\\___ @
_/\\/\\____/\\/\\_ @
_/\\/\\/\\/\\/\\/\\_ @
_/\\/\\____/\\/\\_ @
______________ @@
_/\\/\\/\\/\\/\\___@
_/\\/\\____/\\/\\_ @
_/\\/\\/\\/\\/\\___ @
_/\\/\\____/\\/\\_ @
_/\\/\\/\\/\\/\\___ @
______________ @@
___/\\/\\/\\/\\/\\_@
_/\\/\\_________ @
_/\\/\\_________ @
_/\\/\\_________ @
___/\\/\\/\\/\\/\\_ @
______________ @@
_/\\/\\/\\/\\/\\___@
_/\\/\\____/\\/\\_ @
_/\\/\\____/\\/\\_ @
_/\\/\\____/\\/\\_ @
_/\\/\\/\\/\\/\\___ @
______________ @@
_/\\/\\/\\/\\/\\/\\_@
_/\\___________ @
_/\\/\\/\\/\\/\\___ @
_/\\/\\_________ @
_/\\/\\/\\/\\/\\/\\_ @
______________ @@
_/\\/\\/\\/\\/\\/\\_@
_/\\/\\_________ @
_/\\/\\/\\/\\/\\___ @
_/\\/\\_________ @
_/\\/\\_________ @
______________ @@
___/\\/\\/\\/\\/\\_@
_/\\/\\_________ @
_/\\/\\__/\\/\\/\\_ @
_/\\/\\____/\\/\\_ @
___/\\/\\/\\/\\/\\_ @
______________ @@
_/\\/\\____/\\/\\_@
_/\\/\\____/\\/\\_ @
_/\\/\\/\\/\\/\\/\\_ @
_/\\/\\____/\\/\\_ @
_/\\/\\____/\\/\\_ @
______________ @@
_/\\/\\/\\/\\_@
___/\\/\\___ @
___/\\/\\___ @
___/\\/\\___ @
_/\\/\\/\\/\\_ @
__________ @@
_________/\\/\\_@
_________/\\/\\_ @
_________/\\/\\_ @
_/\\/\\____/\\/\\_ @
___/\\/\\/\\/\\___ @
______________ @@
_/\\/\\____/\\/\\_@
_/\\/\\__/\\/\\___ @
_/\\/\\/\\/\\_____ @
_/\\/\\__/\\/\\___ @
_/\\/\\____/\\/\\_ @
______________ @@
_/\\/\\_______@
_/\\/\\_______ @
_/\\/\\_______ @
_/\\/\\_______ @
_/\\/\\/\\/\\/\\_ @
____________ @@
_/\\/\\______/\\/\\_@
_/\\/\\/\\__/\\/\\/\\_ @
_/\\/\\/\\/\\/\\/\\/\\_ @
_/\\/\\__/\\__/\\/\\_ @
_/\\/\\______/\\/\\_ @
________________ @@
_/\\/\\____/\\/\\_@
_/\\/\\/\\__/\\/\\_ @
_/\\/\\/\\/\\/\\/\\_ @
_/\\/\\__/\\/\\/\\_ @
_/\\/\\____/\\/\\_ @
______________ @@
___/\\/\\/\\/\\___@
_/\\/\\____/\\/\\_ @
_/\\/\\____/\\/\\_ @
_/\\/\\____/\\/\\_ @
___/\\/\\/\\/\\___ @
______________ @@
_/\\/\\/\\/\\/\\___@
_/\\/\\____/\\/\\_ @
_/\\/\\/\\/\\/\\___ @
_/\\/\\_________ @
_/\\/\\_________ @
______________ @@
___/\\/\\/\\/\\___@
_/\\/\\____/\\/\\_ @
_/\\/\\____/\\/\\_ @
_/\\/\\__/\\/\\___ @
___/\\/\\/\\/\\/\\_ @
______________ @@
_/\\/\\/\\/\\/\\___@
_/\\/\\____/\\/\\_ @
_/\\/\\/\\/\\/\\___ @
_/\\/\\__/\\/\\___ @
_/\\/\\____/\\/\\_ @
______________ @@
___/\\/\\/\\/\\/\\_@
_/\\/\\_________ @
___/\\/\\/\\/\\___ @
_________/\\/\\_ @
_/\\/\\/\\/\\/\\___ @
______________ @@
_/\\/\\/\\/\\/\\/\\_@
_____/\\/\\_____ @
_____/\\/\\_____ @
_____/\\/\\_____ @
_____/\\/\\_____ @
______________ @@
_/\\/\\____/\\/\\_@
_/\\/\\____/\\/\\_ @
_/\\/\\____/\\/\\_ @
_/\\/\\____/\\/\\_ @
___/\\/\\/\\/\\___ @
______________ @@
_/\\/\\____/\\/\\_@
_/\\/\\____/\\/\\_ @
_/\\/\\____/\\/\\_ @
___/\\/\\/\\/\\___ @
_____/\\/\\_____ @
______________ @@
_/\\/\\______/\\/\\_@
_/\\/\\__/\\__/\\/\\_ @
_/\\/\\/\\/\\/\\/\\/\\_ @
_/\\/\\/\\__/\\/\\/\\_ @
_/\\/\\______/\\/\\_ @
________________ @@
_/\\/\\____/\\/\\_@
___/\\/\\/\\/\\___ @
_____/\\/\\_____ @
___/\\/\\/\\/\\___ @
_/\\/\\____/\\/\\_ @
______________ @@
_/\\/\\____/\\/\\_@
_/\\/\\____/\\/\\_ @
___/\\/\\/\\/\\___ @
_____/\\/\\_____ @
_____/\\/\\_____ @
______________ @@
_/\\/\\/\\/\\/\\/\\_@
_______/\\/\\___ @
_____/\\/\\_____ @
___/\\/\\_______ @
_/\\/\\/\\/\\/\\/\\_ @
______________ @@
_/\\/\\/\\/\\_@
_/\\/\\_____ @
_/\\/\\_____ @
_/\\/\\_____ @
_/\\/\\/\\/\\_ @
__________ @@
_/\\/\\_________@
___/\\/\\_______ @
_____/\\/\\_____ @
_______/\\/\\___ @
_________/\\/\\_ @
______________ @@
_/\\/\\/\\/\\_@
_____/\\/\\_ @
_____/\\/\\_ @
_____/\\/\\_ @
_/\\/\\/\\/\\_ @
__________ @@
___/\\/\\___@
_/\\/\\/\\/\\_ @
_/\\____/\\_ @
__________ @
__________ @
__________ @@
______________@
______________ @
______________ @
______________ @
______________ @
_/\\/\\/\\/\\/\\/\\_ @@
_/\\/\\_@
_/\\/\\_ @
___/\\_ @
______ @
______ @
______ @@
____________@
_/\\/\\/\\_____ @
_____/\\/\\___ @
_/\\/\\/\\/\\___ @
_/\\/\\/\\/\\/\\_ @
____________ @@
_/\\/\\_______@
_/\\/\\_______ @
_/\\/\\/\\/\\___ @
_/\\/\\__/\\/\\_ @
_/\\/\\/\\/\\___ @
____________ @@
____________@
___/\\/\\/\\/\\_ @
_/\\/\\_______ @
_/\\/\\_______ @
___/\\/\\/\\/\\_ @
____________ @@
_______/\\/\\_@
_______/\\/\\_ @
___/\\/\\/\\/\\_ @
_/\\/\\__/\\/\\_ @
___/\\/\\/\\/\\_ @
____________ @@
____________@
___/\\/\\/\\___ @
_/\\/\\/\\/\\/\\_ @
_/\\/\\_______ @
___/\\/\\/\\/\\_ @
____________ @@
___/\\/\\/\\_@
_/\\/\\_____ @
_/\\/\\/\\___ @
_/\\/\\_____ @
_/\\/\\_____ @
__________ @@
____________@
___/\\/\\/\\/\\_ @
_/\\/\\__/\\/\\_ @
___/\\/\\/\\/\\_ @
_______/\\/\\_ @
_/\\/\\/\\/\\___ @@
_/\\/\\_______@
_/\\/\\_______ @
_/\\/\\/\\/\\___ @
_/\\/\\__/\\/\\_ @
_/\\/\\__/\\/\\_ @
____________ @@
_/\\/\\___@
________ @
_/\\/\\___ @
_/\\/\\___ @
_/\\/\\/\\_ @
________ @@
_____/\\/\\_@
__________ @
_____/\\/\\_ @
_____/\\/\\_ @
_____/\\/\\_ @
_/\\/\\/\\___ @@
_/\\/\\_______@
_/\\/\\__/\\/\\_ @
_/\\/\\/\\/\\___ @
_/\\/\\/\\/\\___ @
_/\\/\\__/\\/\\_ @
____________ @@
_/\\/\\___@
_/\\/\\___ @
_/\\/\\___ @
_/\\/\\___ @
_/\\/\\/\\_ @
________ @@
________________@
_/\\/\\/\\__/\\/\\___ @
_/\\/\\/\\/\\/\\/\\/\\_ @
_/\\/\\__/\\__/\\/\\_ @
_/\\/\\______/\\/\\_ @
________________ @@
____________@
_/\\/\\/\\/\\___ @
_/\\/\\__/\\/\\_ @
_/\\/\\__/\\/\\_ @
_/\\/\\__/\\/\\_ @
____________ @@
____________@
___/\\/\\/\\___ @
_/\\/\\__/\\/\\_ @
_/\\/\\__/\\/\\_ @
___/\\/\\/\\___ @
____________ @@
____________@
_/\\/\\/\\/\\___ @
_/\\/\\__/\\/\\_ @
_/\\/\\/\\/\\___ @
_/\\/\\_______ @
_/\\/\\_______ @@
____________@
___/\\/\\/\\/\\_ @
_/\\/\\__/\\/\\_ @
___/\\/\\/\\/\\_ @
_______/\\/\\_ @
_______/\\/\\_ @@
____________@
_/\\/\\__/\\/\\_ @
_/\\/\\/\\/\\___ @
_/\\/\\_______ @
_/\\/\\_______ @
____________ @@
____________@
___/\\/\\/\\/\\_ @
_/\\/\\/\\/\\___ @
_______/\\/\\_ @
_/\\/\\/\\/\\___ @
____________ @@
___/\\/\\_____@
_/\\/\\/\\/\\/\\_ @
___/\\/\\_____ @
___/\\/\\_____ @
___/\\/\\/\\___ @
____________ @@
____________@
_/\\/\\__/\\/\\_ @
_/\\/\\__/\\/\\_ @
_/\\/\\__/\\/\\_ @
___/\\/\\/\\/\\_ @
____________ @@
____________@
_/\\/\\__/\\/\\_ @
_/\\/\\__/\\/\\_ @
___/\\/\\/\\___ @
_____/\\_____ @
____________ @@
________________@
_/\\/\\______/\\/\\_ @
_/\\/\\__/\\__/\\/\\_ @
_/\\/\\/\\/\\/\\/\\/\\_ @
___/\\/\\__/\\/\\___ @
________________ @@
____________@
_/\\/\\__/\\/\\_ @
___/\\/\\/\\___ @
___/\\/\\/\\___ @
_/\\/\\__/\\/\\_ @
____________ @@
____________@
_/\\/\\__/\\/\\_ @
_/\\/\\__/\\/\\_ @
___/\\/\\/\\/\\_ @
_______/\\/\\_ @
_/\\/\\/\\/\\___ @@
____________@
_/\\/\\/\\/\\/\\_ @
_____/\\/\\___ @
___/\\/\\_____ @
_/\\/\\/\\/\\/\\_ @
____________ @@
___/\\/\\/\\/\\_@
___/\\/\\_____ @
_/\\/\\_______ @
___/\\/\\_____ @
___/\\/\\/\\/\\_ @
____________ @@
_/\\/\\_@
_/\\/\\_ @
_/\\/\\_ @
_/\\/\\_ @
_/\\/\\_ @
_/\\/\\_ @@
_/\\/\\/\\/\\___@
_____/\\/\\___ @
_______/\\/\\_ @
_____/\\/\\___ @
_/\\/\\/\\/\\___ @
____________ @@
___/\\/\\__/\\/\\_@
_/\\/\\/\\/\\/\\/\\_ @
_/\\/\\__/\\/\\___ @
______________ @
______________ @
______________ @@
_______/\\/\\_@
_/\\/\\/\\_____ @
_____/\\/\\___ @
_/\\/\\/\\/\\___ @
_/\\/\\/\\/\\/\\_ @
____________ @@
_______/\\/\\_@
___/\\/\\/\\___ @
_/\\/\\/\\/\\/\\_ @
_/\\/\\_______ @
___/\\/\\/\\/\\_ @
____________ @@
___/\\/\\_@
________ @
_/\\/\\___ @
_/\\/\\___ @
_/\\/\\/\\_ @
________ @@
_______/\\/\\_@
___/\\/\\/\\___ @
_/\\/\\__/\\/\\_ @
_/\\/\\__/\\/\\_ @
___/\\/\\/\\___ @
____________ @@
_______/\\/\\_@
_/\\/\\__/\\/\\_ @
_/\\/\\__/\\/\\_ @
_/\\/\\__/\\/\\_ @
___/\\/\\/\\/\\_ @
____________ @@
_/\\/\\/\\/\\/\\_@
____________ @
_/\\/\\/\\/\\___ @
_/\\/\\__/\\/\\_ @
_/\\/\\__/\\/\\_ @
____________ @@
_/\\/\\/\\/\\/\\/\\_@
______________ @
_/\\/\\/\\__/\\/\\_ @
_/\\/\\__/\\/\\/\\_ @
_/\\/\\____/\\/\\_ @
______________ @@
`
@@ -0,0 +1,214 @@
import { expect, test } from "vitest";
import { z } from "../../../../index.js";
import el from "../../../locales/el.js";
test("Greek locale - too_small errors", () => {
z.config(el());
// Test string type translation
const stringSchema = z.string().min(5);
const stringResult = stringSchema.safeParse("abc");
expect(stringResult.success).toBe(false);
if (!stringResult.success) {
expect(stringResult.error.issues[0].message).toBe("Πολύ μικρό: αναμενόταν string να έχει >=5 χαρακτήρες");
}
// Test number type translation
const numberSchema = z.number().min(10);
const numberResult = numberSchema.safeParse(5);
expect(numberResult.success).toBe(false);
if (!numberResult.success) {
expect(numberResult.error.issues[0].message).toBe("Πολύ μικρό: αναμενόταν number να είναι >=10");
}
// Test array type translation
const arraySchema = z.array(z.string()).min(3);
const arrayResult = arraySchema.safeParse(["a", "b"]);
expect(arrayResult.success).toBe(false);
if (!arrayResult.success) {
expect(arrayResult.error.issues[0].message).toBe("Πολύ μικρό: αναμενόταν array να έχει >=3 στοιχεία");
}
// Test set type translation
const setSchema = z.set(z.string()).min(2);
const setResult = setSchema.safeParse(new Set(["a"]));
expect(setResult.success).toBe(false);
if (!setResult.success) {
expect(setResult.error.issues[0].message).toBe("Πολύ μικρό: αναμενόταν set να έχει >=2 στοιχεία");
}
});
test("Greek locale - too_big errors", () => {
z.config(el());
// Test string type translation
const stringSchema = z.string().max(3);
const stringResult = stringSchema.safeParse("abcde");
expect(stringResult.success).toBe(false);
if (!stringResult.success) {
expect(stringResult.error.issues[0].message).toBe("Πολύ μεγάλο: αναμενόταν string να έχει <=3 χαρακτήρες");
}
// Test number type translation
const numberSchema = z.number().max(10);
const numberResult = numberSchema.safeParse(15);
expect(numberResult.success).toBe(false);
if (!numberResult.success) {
expect(numberResult.error.issues[0].message).toBe("Πολύ μεγάλο: αναμενόταν number να είναι <=10");
}
// Test array type translation
const arraySchema = z.array(z.string()).max(2);
const arrayResult = arraySchema.safeParse(["a", "b", "c"]);
expect(arrayResult.success).toBe(false);
if (!arrayResult.success) {
expect(arrayResult.error.issues[0].message).toBe("Πολύ μεγάλο: αναμενόταν array να έχει <=2 στοιχεία");
}
});
test("Greek locale - invalid_type errors", () => {
z.config(el());
// Test string expected, number received
const stringSchema = z.string();
const stringResult = stringSchema.safeParse(123);
expect(stringResult.success).toBe(false);
if (!stringResult.success) {
expect(stringResult.error.issues[0].message).toBe("Μη έγκυρη είσοδος: αναμενόταν string, λήφθηκε number");
}
// Test number expected, string received
const numberSchema = z.number();
const numberResult = numberSchema.safeParse("abc");
expect(numberResult.success).toBe(false);
if (!numberResult.success) {
expect(numberResult.error.issues[0].message).toBe("Μη έγκυρη είσοδος: αναμενόταν number, λήφθηκε string");
}
// Test boolean expected, null received
const booleanSchema = z.boolean();
const booleanResult = booleanSchema.safeParse(null);
expect(booleanResult.success).toBe(false);
if (!booleanResult.success) {
expect(booleanResult.error.issues[0].message).toBe("Μη έγκυρη είσοδος: αναμενόταν boolean, λήφθηκε null");
}
// Test array expected, object received
const arraySchema = z.array(z.string());
const arrayResult = arraySchema.safeParse({});
expect(arrayResult.success).toBe(false);
if (!arrayResult.success) {
expect(arrayResult.error.issues[0].message).toBe("Μη έγκυρη είσοδος: αναμενόταν array, λήφθηκε object");
}
});
test("Greek locale - other error cases", () => {
z.config(el());
// Test invalid_element with map (only "map" | "set" produce invalid_element)
const mapSchema = z.map(z.bigint(), z.number());
const mapResult = mapSchema.safeParse(new Map([[BigInt(123), BigInt(123)]]));
expect(mapResult.success).toBe(false);
if (!mapResult.success) {
expect(mapResult.error.issues[0].code).toBe("invalid_element");
expect(mapResult.error.issues[0].message).toBe("Μη έγκυρη τιμή στο map");
}
// Test invalid_key with record (only "map" | "record" produce invalid_key)
const recordSchema = z.record(z.number(), z.string());
const recordResult = recordSchema.safeParse({ notANumber: "value" });
expect(recordResult.success).toBe(false);
if (!recordResult.success) {
expect(recordResult.error.issues[0].code).toBe("invalid_key");
expect(recordResult.error.issues[0].message).toBe("Μη έγκυρο κλειδί στο record");
}
// Test invalid_value with enum
const enumSchema = z.enum(["a", "b"]);
const enumResult = enumSchema.safeParse("c");
expect(enumResult.success).toBe(false);
if (!enumResult.success) {
expect(enumResult.error.issues[0].message).toBe('Μη έγκυρη επιλογή: αναμενόταν ένα από "a"|"b"');
}
// Test not_multiple_of
const multipleSchema = z.number().multipleOf(3);
const multipleResult = multipleSchema.safeParse(10);
expect(multipleResult.success).toBe(false);
if (!multipleResult.success) {
expect(multipleResult.error.issues[0].message).toBe("Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του 3");
}
// Test unrecognized_keys (single key)
const strictSchema = z.object({ a: z.string() }).strict();
const strictResult = strictSchema.safeParse({ a: "test", b: "extra" });
expect(strictResult.success).toBe(false);
if (!strictResult.success) {
expect(strictResult.error.issues[0].message).toBe('Άγνωστο κλειδί: "b"');
}
// Test unrecognized_keys (multiple keys)
const strictMultipleResult = strictSchema.safeParse({
a: "test",
b: "extra",
c: "another",
});
expect(strictMultipleResult.success).toBe(false);
if (!strictMultipleResult.success) {
expect(strictMultipleResult.error.issues[0].message).toBe('Άγνωστα κλειδιά: "b", "c"');
}
// Test invalid_union
const unionSchema = z.union([z.string(), z.number()]);
const unionResult = unionSchema.safeParse(true);
expect(unionResult.success).toBe(false);
if (!unionResult.success) {
expect(unionResult.error.issues[0].message).toBe("Μη έγκυρη είσοδος");
}
// Test invalid_format with regex
const regexSchema = z.string().regex(/^[a-z]+$/);
const regexResult = regexSchema.safeParse("ABC123");
expect(regexResult.success).toBe(false);
if (!regexResult.success) {
expect(regexResult.error.issues[0].message).toBe(
"Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο /^[a-z]+$/"
);
}
// Test invalid_format with startsWith
const startsWithSchema = z.string().startsWith("hello");
const startsWithResult = startsWithSchema.safeParse("world");
expect(startsWithResult.success).toBe(false);
if (!startsWithResult.success) {
expect(startsWithResult.error.issues[0].message).toBe('Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "hello"');
}
// Test invalid_format with endsWith
const endsWithSchema = z.string().endsWith("world");
const endsWithResult = endsWithSchema.safeParse("hello");
expect(endsWithResult.success).toBe(false);
if (!endsWithResult.success) {
expect(endsWithResult.error.issues[0].message).toBe('Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "world"');
}
// Test invalid_format with includes
const includesSchema = z.string().includes("test");
const includesResult = includesSchema.safeParse("hello");
expect(includesResult.success).toBe(false);
if (!includesResult.success) {
expect(includesResult.error.issues[0].message).toBe('Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "test"');
}
});
test("Greek locale - invalid_type with instanceof (class-name expected)", () => {
z.config(el());
// When `expected` starts with a capital letter, render an `instanceof` message, matching the convention used by most other locales (de, es, fr, it, etc.).
const dateSchema = z.instanceof(Date);
const dateResult = dateSchema.safeParse("not a date");
expect(dateResult.success).toBe(false);
if (!dateResult.success) {
expect(dateResult.error.issues[0].message).toBe("Μη έγκυρη είσοδος: αναμενόταν instanceof Date, λήφθηκε string");
}
});
@@ -0,0 +1 @@
{"version":3,"file":"folder-root.js","sources":["../../../src/icons/folder-root.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FolderRoot\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAyMGgxNmEyIDIgMCAwIDAgMi0yVjhhMiAyIDAgMCAwLTItMmgtNy45M2EyIDIgMCAwIDEtMS42Ni0uOWwtLjgyLTEuMkEyIDIgMCAwIDAgNy45MyAzSDRhMiAyIDAgMCAwLTIgMnYxM2MwIDEuMS45IDIgMiAyWiIgLz4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEzIiByPSIyIiAvPgogIDxwYXRoIGQ9Ik0xMiAxNXY1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/folder-root\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 FolderRoot = createLucideIcon('FolderRoot', [\n [\n 'path',\n {\n d: 'M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z',\n key: '1fr9dc',\n },\n ],\n ['circle', { cx: '12', cy: '13', r: '2', key: '1c1ljs' }],\n ['path', { d: 'M12 15v5', key: '11xva1' }],\n]);\n\nexport default FolderRoot;\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,CAChD,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;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,CACA,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACxD,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,66 @@
/**
* @fileoverview Rule to check use of chained assignment expressions
* @author Stewart Rand
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [
{
ignoreNonDeclaration: false,
},
],
docs: {
description: "Disallow use of chained assignment expressions",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-multi-assign",
},
schema: [
{
type: "object",
properties: {
ignoreNonDeclaration: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
unexpectedChain: "Unexpected chained assignment.",
},
},
create(context) {
const [{ ignoreNonDeclaration }] = context.options;
const selectors = [
"VariableDeclarator > AssignmentExpression.init",
"PropertyDefinition > AssignmentExpression.value",
];
if (!ignoreNonDeclaration) {
selectors.push("AssignmentExpression > AssignmentExpression.right");
}
return {
[selectors](node) {
context.report({
node,
messageId: "unexpectedChain",
});
},
};
},
};
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CircleUser = createLucideIcon("CircleUser", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["circle", { cx: "12", cy: "10", r: "3", key: "ilqhr7" }],
["path", { d: "M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662", key: "154egf" }]
]);
export { CircleUser as default };
//# sourceMappingURL=circle-user.js.map
@@ -0,0 +1,21 @@
"use client";
import { useContext } from 'react';
import { MotionConfigContext } from '../../context/MotionConfigContext.mjs';
import { useReducedMotion } from './use-reduced-motion.mjs';
function useReducedMotionConfig() {
const reducedMotionPreference = useReducedMotion();
const { reducedMotion } = useContext(MotionConfigContext);
if (reducedMotion === "never") {
return false;
}
else if (reducedMotion === "always") {
return true;
}
else {
return reducedMotionPreference;
}
}
export { useReducedMotionConfig };
//# sourceMappingURL=use-reduced-motion-config.mjs.map
@@ -0,0 +1,43 @@
"use strict";
/* eslint-disable @typescript-eslint/no-namespace */
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.Scope = void 0;
const scopeManager = __importStar(require("@typescript-eslint/scope-manager"));
var Scope;
(function (Scope) {
Scope.ScopeType = scopeManager.ScopeType;
Scope.DefinitionType = scopeManager.DefinitionType;
})(Scope || (exports.Scope = Scope = {}));
@@ -0,0 +1,126 @@
# mime-types
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][ci-image]][ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]
The ultimate javascript content-type utility.
Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except:
- __No fallbacks.__ Instead of naively returning the first available type,
`mime-types` simply returns `false`, so do
`var type = mime.lookup('unrecognized') || 'application/octet-stream'`.
- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.
- No `.define()` functionality
- Bug fixes for `.lookup(path)`
Otherwise, the API is compatible with `mime` 1.x.
## Install
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```sh
$ npm install mime-types
```
## Note on MIME Type Data and Semver
This package considers the programmatic api as the semver compatibility. Additionally, the package which provides the MIME data
for this package (`mime-db`) *also* considers it's programmatic api as the semver contract. This means the MIME type resolution is *not* considered
in the semver bumps.
In the past the version of `mime-db` was pinned to give two decision points when adopting MIME data changes. This is no longer true. We still update the
`mime-db` package here as a `minor` release when necessary, but will use a `^` range going forward. This means that if you want to pin your `mime-db` data
you will need to do it in your application. While this expectation was not set in docs until now, it is how the pacakge operated, so we do not feel this is
a breaking change.
If you wish to pin your `mime-db` version you can do that with overrides via your package manager of choice. See their documentation for how to correctly configure that.
## Adding Types
All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db),
so open a PR there if you'd like to add mime types.
## API
```js
var mime = require('mime-types')
```
All functions return `false` if input is invalid or not found.
### mime.lookup(path)
Lookup the content-type associated with a file.
```js
mime.lookup('json') // 'application/json'
mime.lookup('.md') // 'text/markdown'
mime.lookup('file.html') // 'text/html'
mime.lookup('folder/file.js') // 'application/javascript'
mime.lookup('folder/.htaccess') // false
mime.lookup('cats') // false
```
### mime.contentType(type)
Create a full content-type header given a content-type or extension.
When given an extension, `mime.lookup` is used to get the matching
content-type, otherwise the given content-type is used. Then if the
content-type does not already have a `charset` parameter, `mime.charset`
is used to get the default charset and add to the returned content-type.
```js
mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
mime.contentType('file.json') // 'application/json; charset=utf-8'
mime.contentType('text/html') // 'text/html; charset=utf-8'
mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1'
// from a full path
mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'
```
### mime.extension(type)
Get the default extension for a content-type.
```js
mime.extension('application/octet-stream') // 'bin'
```
### mime.charset(type)
Lookup the implied default charset of a content-type.
```js
mime.charset('text/markdown') // 'UTF-8'
```
### var type = mime.types[extension]
A map of content-types by extension.
### [extensions...] = mime.extensions[type]
A map of extensions by content-type.
## License
[MIT](LICENSE)
[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci
[ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master
[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master
[node-version-image]: https://badgen.net/npm/node/mime-types
[node-version-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/mime-types
[npm-url]: https://npmjs.org/package/mime-types
[npm-version-image]: https://badgen.net/npm/v/mime-types
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,uCAOkB;AAClB,mCAAiC;AAGjC,sDAAgD;AAgBhD,MAAM,QAAQ,GAAG,IAAI,cAAI,CAAC,aAAa,CAAC,CAAA;AACxC,MAAM,QAAQ,GAAG,IAAI,cAAI,CAAC,aAAa,CAAC,CAAA;AAExC,MAAM,aAAa,GAAkB,CACnC,GAAQ,EACR,OAA6B,EAAC,QAAQ,EAAE,IAAI,EAAC,EACxC,EAAE;IACP,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACvB,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,qBAAW,EAAE,QAAQ,CAAC,CAAA;QAC5C,OAAO,GAAG,CAAA;KACX;IACD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GACzB,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,qBAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAW,EAAE,QAAQ,CAAC,CAAA;IAC1E,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,IAAI,qBAAW,CAAA;IACxC,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,CAAA;IAC1C,IAAI,IAAI,CAAC,QAAQ;QAAE,IAAA,eAAW,EAAC,GAAG,CAAC,CAAA;IACnC,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,aAAa,CAAC,GAAG,GAAG,CAAC,IAAgB,EAAE,OAAmB,MAAM,EAAU,EAAE;IAC1E,MAAM,OAAO,GAAG,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,qBAAW,CAAC,CAAC,CAAC,qBAAW,CAAA;IAC3D,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACvB,IAAI,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,GAAG,CAAC,CAAA;IACnD,OAAO,CAAC,CAAA;AACV,CAAC,CAAA;AAED,SAAS,UAAU,CAAC,GAAQ,EAAE,IAAkB,EAAE,EAAkB,EAAE,UAAgB;;;IACpF,YAAA,GAAG,CAAC,IAAI,CAAC,IAAI,EAAC,OAAO,uCAAP,OAAO,GAAK,IAAA,WAAC,EAAA,uCAAuC,UAAU,EAAE,EAAA;IAC9E,KAAK,MAAM,CAAC,IAAI,IAAI;QAAE,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AAC/C,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,aAAa,CAAA;AACxC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,aAAa,CAAA"}
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Eclipse = createLucideIcon("Eclipse", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["path", { d: "M12 2a7 7 0 1 0 10 10", key: "1yuj32" }]
]);
export { Eclipse as default };
//# sourceMappingURL=eclipse.js.map
@@ -0,0 +1,3 @@
import { IBackOffOptions } from "../options";
export declare type Jitter = (delay: number) => number;
export declare function JitterFactory(options: IBackOffOptions): Jitter;
@@ -0,0 +1 @@
{"version":3,"file":"dynamicIconImports.js","sources":["src/dynamicIconImports.ts"],"sourcesContent":["const dynamicIconImports = {\n 'a-arrow-down': () => import('./icons/a-arrow-down'),\n 'a-arrow-up': () => import('./icons/a-arrow-up'),\n 'a-large-small': () => import('./icons/a-large-small'),\n 'accessibility': () => import('./icons/accessibility'),\n 'activity': () => import('./icons/activity'),\n 'air-vent': () => import('./icons/air-vent'),\n 'airplay': () => import('./icons/airplay'),\n 'alarm-clock-check': () => import('./icons/alarm-clock-check'),\n 'alarm-clock-minus': () => import('./icons/alarm-clock-minus'),\n 'alarm-clock-off': () => import('./icons/alarm-clock-off'),\n 'alarm-clock-plus': () => import('./icons/alarm-clock-plus'),\n 'alarm-clock': () => import('./icons/alarm-clock'),\n 'alarm-smoke': () => import('./icons/alarm-smoke'),\n 'album': () => import('./icons/album'),\n 'align-center-horizontal': () => import('./icons/align-center-horizontal'),\n 'align-center-vertical': () => import('./icons/align-center-vertical'),\n 'align-center': () => import('./icons/align-center'),\n 'align-end-horizontal': () => import('./icons/align-end-horizontal'),\n 'align-end-vertical': () => import('./icons/align-end-vertical'),\n 'align-horizontal-distribute-center': () => import('./icons/align-horizontal-distribute-center'),\n 'align-horizontal-distribute-end': () => import('./icons/align-horizontal-distribute-end'),\n 'align-horizontal-distribute-start': () => import('./icons/align-horizontal-distribute-start'),\n 'align-horizontal-justify-center': () => import('./icons/align-horizontal-justify-center'),\n 'align-horizontal-justify-end': () => import('./icons/align-horizontal-justify-end'),\n 'align-horizontal-justify-start': () => import('./icons/align-horizontal-justify-start'),\n 'align-horizontal-space-around': () => import('./icons/align-horizontal-space-around'),\n 'align-horizontal-space-between': () => import('./icons/align-horizontal-space-between'),\n 'align-justify': () => import('./icons/align-justify'),\n 'align-left': () => import('./icons/align-left'),\n 'align-right': () => import('./icons/align-right'),\n 'align-start-horizontal': () => import('./icons/align-start-horizontal'),\n 'align-start-vertical': () => import('./icons/align-start-vertical'),\n 'align-vertical-distribute-center': () => import('./icons/align-vertical-distribute-center'),\n 'align-vertical-distribute-end': () => import('./icons/align-vertical-distribute-end'),\n 'align-vertical-distribute-start': () => import('./icons/align-vertical-distribute-start'),\n 'align-vertical-justify-center': () => import('./icons/align-vertical-justify-center'),\n 'align-vertical-justify-end': () => import('./icons/align-vertical-justify-end'),\n 'align-vertical-justify-start': () => import('./icons/align-vertical-justify-start'),\n 'align-vertical-space-around': () => import('./icons/align-vertical-space-around'),\n 'align-vertical-space-between': () => import('./icons/align-vertical-space-between'),\n 'ambulance': () => import('./icons/ambulance'),\n 'ampersand': () => import('./icons/ampersand'),\n 'ampersands': () => import('./icons/ampersands'),\n 'amphora': () => import('./icons/amphora'),\n 'anchor': () => import('./icons/anchor'),\n 'angry': () => import('./icons/angry'),\n 'annoyed': () => import('./icons/annoyed'),\n 'antenna': () => import('./icons/antenna'),\n 'anvil': () => import('./icons/anvil'),\n 'aperture': () => import('./icons/aperture'),\n 'app-window-mac': () => import('./icons/app-window-mac'),\n 'app-window': () => import('./icons/app-window'),\n 'apple': () => import('./icons/apple'),\n 'archive-restore': () => import('./icons/archive-restore'),\n 'archive-x': () => import('./icons/archive-x'),\n 'archive': () => import('./icons/archive'),\n 'armchair': () => import('./icons/armchair'),\n 'arrow-big-down-dash': () => import('./icons/arrow-big-down-dash'),\n 'arrow-big-down': () => import('./icons/arrow-big-down'),\n 'arrow-big-left-dash': () => import('./icons/arrow-big-left-dash'),\n 'arrow-big-left': () => import('./icons/arrow-big-left'),\n 'arrow-big-right-dash': () => import('./icons/arrow-big-right-dash'),\n 'arrow-big-right': () => import('./icons/arrow-big-right'),\n 'arrow-big-up-dash': () => import('./icons/arrow-big-up-dash'),\n 'arrow-big-up': () => import('./icons/arrow-big-up'),\n 'arrow-down-0-1': () => import('./icons/arrow-down-0-1'),\n 'arrow-down-1-0': () => import('./icons/arrow-down-1-0'),\n 'arrow-down-a-z': () => import('./icons/arrow-down-a-z'),\n 'arrow-down-from-line': () => import('./icons/arrow-down-from-line'),\n 'arrow-down-left': () => import('./icons/arrow-down-left'),\n 'arrow-down-narrow-wide': () => import('./icons/arrow-down-narrow-wide'),\n 'arrow-down-right': () => import('./icons/arrow-down-right'),\n 'arrow-down-to-dot': () => import('./icons/arrow-down-to-dot'),\n 'arrow-down-to-line': () => impLine truncated
@@ -0,0 +1,80 @@
# isexe
Minimal module to check if a file is executable, and a normal file.
Uses `fs.stat` and tests against the `PATHEXT` environment variable on
Windows.
## USAGE
```js
// default export is a minified version that doesn't need to
// load more than one file. Load the 'isexe/raw' export if
// you want the non-minified version for some reason.
import { isexe, sync } from 'isexe'
// or require() works too
// const { isexe } = require('isexe')
isexe('some-file-name').then(
isExe => {
if (isExe) {
console.error('this thing can be run')
} else {
console.error('cannot be run')
}
},
err => {
console.error('probably file doesnt exist or something')
},
)
// same thing but synchronous, throws errors
isExe = sync('some-file-name')
// treat errors as just "not executable"
const isExe = await isexe('maybe-missing-file', { ignoreErrors: true })
const isExe = sync('maybe-missing-file', { ignoreErrors: true })
```
## API
### `isexe(path, [options]) => Promise<boolean>`
Check if the path is executable.
Will raise whatever errors may be raised by `fs.stat`, unless
`options.ignoreErrors` is set to true.
### `sync(path, [options]) => boolean`
Same as `isexe` but returns the value and throws any errors raised.
## Platform Specific Implementations
If for some reason you want to use the implementation for a
specific platform, you can do that.
```js
import { win32, posix } from 'isexe'
win32.isexe(...)
win32.sync(...)
// etc
// or:
import { isexe, sync } from 'isexe/posix'
```
The default exported implementation will be chosen based on
`process.platform`.
### Options
```ts
import type IsexeOptions from 'isexe'
```
- `ignoreErrors` Treat all errors as "no, this is not
executable", but don't raise them.
- `uid` Number to use as the user id on posix
- `gid` Number to use as the group id on posix
- `pathExt` List of path extensions to use instead of `PATHEXT`
environment variable on Windows.
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { createLazyMeasurementsView } from './lazy-measurements'\nimport { approxEqual, debounce, memo, notUndefined } from './utils'\n\n// Browser-aware iOS detection. Programmatic `scrollTo`/`scrollTop` writes\n// during a momentum-scroll cancel the momentum on iOS WebKit, so we defer\n// scroll-position adjustments triggered by mid-scroll resizes until the\n// scroll settles. SSR-safe (returns false when navigator is unavailable).\nlet _isIOSResult: boolean | undefined\nconst isIOSWebKit = (): boolean => {\n if (_isIOSResult !== undefined) return _isIOSResult\n if (typeof navigator === 'undefined') return (_isIOSResult = false)\n if (/iP(hone|od|ad)/.test(navigator.userAgent)) return (_isIOSResult = true)\n // iPadOS 13+ reports as MacIntel; touch-points distinguishes it from desktop.\n const mtp = (navigator as Navigator & { maxTouchPoints?: number })\n .maxTouchPoints\n return (_isIOSResult =\n navigator.platform === 'MacIntel' && mtp !== undefined && mtp > 0)\n}\n\n// Test hook: reset the iOS detection cache. Not exported.\nexport const _resetIOSDetectionForTests = () => {\n _isIOSResult = undefined\n}\n\nexport { approxEqual, debounce, memo, notUndefined } from './utils'\nexport type { NoInfer, PartialKeys } from './utils'\n\n//\n\ntype ScrollDirection = 'forward' | 'backward'\n\ntype ScrollAlignment = 'start' | 'center' | 'end' | 'auto'\n\ntype ScrollBehavior = 'auto' | 'smooth' | 'instant'\n\ntype ScrollAnchor = 'start' | 'end'\n\ntype FollowOnAppend = boolean | ScrollBehavior\n\nexport interface ScrollToOptions {\n align?: ScrollAlignment\n behavior?: ScrollBehavior\n}\n\ntype ScrollToOffsetOptions = ScrollToOptions\n\ntype ScrollToIndexOptions = ScrollToOptions\n\ntype ScrollToEndOptions = Pick<ScrollToOptions, 'behavior'>\n\nexport interface Range {\n startIndex: number\n endIndex: number\n overscan: number\n count: number\n}\n\ntype Key = number | string | bigint\n\nexport interface VirtualItem {\n key: Key\n index: number\n start: number\n end: number\n size: number\n lane: number\n}\n\nexport interface Rect {\n width: number\n height: number\n}\n\n//\n\nconst getRect = (element: HTMLElement): Rect => {\n const { offsetWidth, offsetHeight } = element\n return { width: offsetWidth, height: offsetHeight }\n}\n\nexport const defaultKeyExtractor = (index: number) => index\n\nexport const defaultRangeExtractor = (range: Range) => {\n const start = Math.max(range.startIndex - range.overscan, 0)\n const end = Math.min(range.endIndex + range.overscan, range.count - 1)\n const len = end - start + 1\n\n const arr = new Array<number>(len)\n for (let i = 0; i < len; i++) {\n arr[i] = start + i\n }\n return arr\n}\n\nexport const observeElementRect = <T extends Element>(\n instance: Virtualizer<T, any>,\n cb: (rect: Rect) => void,\n) => {\n const element = instance.scrollElement\n if (!element) {\n return\n }\n const targetWindow = instance.targetWindow\n if (!targetWindow) {\n return\n }\n\n const handler = (rect: Rect) => {\n const { width, height } = rect\n cb({ width: Math.round(width), height: Math.round(height) })\n }\n\n handler(getRect(element as unknown as HTMLElement))\n\n if (!targetWindow.ResizeObserver) {\n return () => {}\n }\n\n const observer = new targetWindow.ResizeObserver((entries) => {\n const run = () => {\n const entry = entries[0]\n if (entry?.borderBoxSize) {\n const box = entry.borderBoxSize[0]\n if (box) {\n handler({ width: box.inlineSize, height: box.blockSize })\n return\n }\n }\n handler(getRect(element as unknown as HTMLElement))\n }\n\n instance.options.useAnimationFrameWithResizeObserver\n ? requestAnimationFrame(run)\n : run()\n })\n\n observer.observe(element, { box: 'border-box' })\n\n return () => {\n observer.unobserve(element)\n }\n}\n\nconst addEventListenerOptions = {\n passive: true,\n}\n\nexport const observeWindowRect = (\n instance: Virtualizer<Window, any>,\n cb: (rect: Rect) => void,\n) => {\n const element = instance.scrollElement\n if (!element) {\n return\n }\n\n const handler = () => {\n cb({ width: element.innerWidth, height: element.innerHeight })\n }\n handler()\n\n element.addEventListener('resize', handler, addEventListenerOptions)\n\n return () => {\n element.removeEventListener('resize', handler)\n }\n}\n\nconst supportsScrollend =\n typeof window == 'undefined' ? true : 'onscrollend' in window\n\ntype ObserveOffsetCallBack = (offset: number, isScrolling: boolean) => void\n\n// Shared core: both element and window variants attach scroll/scrollend\n// listeners with the same lifecycle; they only differ in how to read the\n// current offset from the scroll target.\nconst observeOffset = <T extends Element | Window>(\n instance: Virtualizer<T, any>,\n cb: ObserveOffsetCallBack,\n readOffset: (tLine truncated
@@ -0,0 +1,69 @@
{
"name": "@radix-ui/react-portal",
"version": "1.1.9",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"dependencies": {
"@radix-ui/react-primitive": "2.1.3",
"@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/eslint-config": "0.0.0",
"@repo/typescript-config": "0.0.0",
"@repo/builder": "0.0.0"
},
"peerDependencies": {
"@types/react": "*",
"@types/react-dom": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"@types/react-dom": {
"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 @@
{"version":3,"file":"TrieNode.mjs","sources":["../../../../../../src/matcher/dictionary/variants/matching/unmunger/TrieNode.ts"],"sourcesContent":[null],"names":["TrieNode","constructor","parents","children","Map","addSub","key","subs","firstChar","charAt","has","set","cur","get","i","length","c","hasChild","addChild","getChild","concat","child","isTerminal"],"mappings":"AAAc,MAAOA,QAAQ,CAAA;AAK3BC,EAAAA,WAAAA,CAAmBC,UAAoB,EAAE,EAAA;IAAtB,IAAA,CAAAA,OAAO,GAAPA,OAAO;AAJ1B,IAAA,IAAA,CAAAC,QAAQ,GAAG,IAAIC,GAAG,EAAoB;AAIM,EAAA;AAE5CC,EAAAA,MAAMA,CAACC,GAAW,EAAE,GAAGC,IAAc,EAAA;AACnC,IAAA,MAAMC,SAAS,GAAGF,GAAG,CAACG,MAAM,CAAC,CAAC,CAAC;IAC/B,IAAI,CAAC,IAAI,CAACN,QAAQ,CAACO,GAAG,CAACF,SAAS,CAAC,EAAE;AACjC,MAAA,IAAI,CAACL,QAAQ,CAACQ,GAAG,CAACH,SAAS,EAAE,IAAIR,QAAQ,CAAC,CAAC,GAAG,IAAI,CAACE,OAAO,EAAEM,SAAS,CAAC,CAAC,CAAC;AAC1E,IAAA;IACA,IAAII,GAAG,GAAG,IAAI,CAACT,QAAQ,CAACU,GAAG,CAACL,SAAS,CAAE;AACvC,IAAA,KAAK,IAAIM,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGR,GAAG,CAACS,MAAM,EAAED,CAAC,IAAI,CAAC,EAAE;AACtC,MAAA,MAAME,CAAC,GAAGV,GAAG,CAACG,MAAM,CAACK,CAAC,CAAC;AACvB,MAAA,IAAI,CAACF,GAAG,CAACK,QAAQ,CAACD,CAAC,CAAC,EAAE;AACpBJ,QAAAA,GAAG,CAACM,QAAQ,CAACF,CAAC,CAAC;AACjB,MAAA;AACAJ,MAAAA,GAAG,GAAGA,GAAG,CAACO,QAAQ,CAACH,CAAC,CAAE;AACxB,IAAA;AACAJ,IAAAA,GAAG,CAACL,IAAI,GAAG,CAACK,GAAG,CAACL,IAAI,IAAI,EAAE,EAAEa,MAAM,CAACb,IAAI,CAAC;AACxC,IAAA,OAAO,IAAI;AACb,EAAA;EAEAY,QAAQA,CAACE,KAAa,EAAA;AACpB,IAAA,OAAO,IAAI,CAAClB,QAAQ,CAACU,GAAG,CAACQ,KAAK,CAAC;AACjC,EAAA;AAEAC,EAAAA,UAAUA,GAAA;AACR,IAAA,OAAO,CAAC,CAAC,IAAI,CAACf,IAAI;AACpB,EAAA;EAEAW,QAAQA,CAACG,KAAa,EAAA;AACpB,IAAA,IAAI,CAAC,IAAI,CAACJ,QAAQ,CAACI,KAAK,CAAC,EAAE;AACzB,MAAA,IAAI,CAAClB,QAAQ,CAACQ,GAAG,CAACU,KAAK,EAAE,IAAIrB,QAAQ,CAAC,CAAC,GAAG,IAAI,CAACE,OAAO,EAAEmB,KAAK,CAAC,CAAC,CAAC;AAClE,IAAA;AACF,EAAA;EAEAJ,QAAQA,CAACI,KAAa,EAAA;AACpB,IAAA,OAAO,IAAI,CAAClB,QAAQ,CAACO,GAAG,CAACW,KAAK,CAAC;AACjC,EAAA;AACD;;;;"}
@@ -0,0 +1,47 @@
import {List, OrderedMap} from 'immutable';
import {Value} from './index';
import {SassList, ListSeparator} from './list';
/**
* Sass's [argument list
* type](https://sass-lang.com/documentation/values/lists#argument-lists).
*
* An argument list comes from a rest argument. It's distinct from a normal
* {@link SassList} in that it may contain a keyword map as well as the
* positional arguments.
*
* @category Custom Function
*/
export class SassArgumentList extends SassList {
/**
* Creates a new argument list.
*
* @param contents - The positional arguments that make up the primary
* contents of the list. This may be either a plain JavaScript array or an
* immutable {@link List} from the [`immutable`
* package](https://immutable-js.com/).
*
* @param keywords - The keyword arguments attached to this argument list,
* whose names should exclude `$`. This can be either a plain JavaScript
* object with argument names as fields, or an immutable {@link OrderedMap}
* from the [`immutable` package](https://immutable-js.com/)
*
* @param separator - The separator for this list. Defaults to `','`.
*/
constructor(
contents: Value[] | List<Value>,
keywords: Record<string, Value> | OrderedMap<string, Value>,
separator?: ListSeparator
);
/**
* The keyword arguments attached to this argument list.
*
* The argument names don't include `$`.
*
* @returns An immutable {@link OrderedMap} from the [`immutable`
* package](https://immutable-js.com/).
*/
get keywords(): OrderedMap<string, Value>;
}
@@ -0,0 +1,85 @@
import * as React from 'react';
import { styleSingleton } from 'react-style-singleton';
import { fullWidthClassName, zeroRightClassName, noScrollbarsClassName, removedBarSizeVariable } from './constants';
import { getGapWidth } from './utils';
const Style = styleSingleton();
export const lockAttribute = 'data-scroll-locked';
// important tip - once we measure scrollBar width and remove them
// we could not repeat this operation
// thus we are using style-singleton - only the first "yet correct" style will be applied.
const getStyles = ({ left, top, right, gap }, allowRelative, gapMode = 'margin', important) => `
.${noScrollbarsClassName} {
overflow: hidden ${important};
padding-right: ${gap}px ${important};
}
body[${lockAttribute}] {
overflow: hidden ${important};
overscroll-behavior: contain;
${[
allowRelative && `position: relative ${important};`,
gapMode === 'margin' &&
`
padding-left: ${left}px;
padding-top: ${top}px;
padding-right: ${right}px;
margin-left:0;
margin-top:0;
margin-right: ${gap}px ${important};
`,
gapMode === 'padding' && `padding-right: ${gap}px ${important};`,
]
.filter(Boolean)
.join('')}
}
.${zeroRightClassName} {
right: ${gap}px ${important};
}
.${fullWidthClassName} {
margin-right: ${gap}px ${important};
}
.${zeroRightClassName} .${zeroRightClassName} {
right: 0 ${important};
}
.${fullWidthClassName} .${fullWidthClassName} {
margin-right: 0 ${important};
}
body[${lockAttribute}] {
${removedBarSizeVariable}: ${gap}px;
}
`;
const getCurrentUseCounter = () => {
const counter = parseInt(document.body.getAttribute(lockAttribute) || '0', 10);
return isFinite(counter) ? counter : 0;
};
export const useLockAttribute = () => {
React.useEffect(() => {
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
return () => {
const newCounter = getCurrentUseCounter() - 1;
if (newCounter <= 0) {
document.body.removeAttribute(lockAttribute);
}
else {
document.body.setAttribute(lockAttribute, newCounter.toString());
}
};
}, []);
};
/**
* Removes page scrollbar and blocks page scroll when mounted
*/
export const RemoveScrollBar = ({ noRelative, noImportant, gapMode = 'margin' }) => {
useLockAttribute();
/*
gap will be measured on every component mount
however it will be used only by the "first" invocation
due to singleton nature of <Style
*/
const gap = React.useMemo(() => getGapWidth(gapMode), [gapMode]);
return React.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') });
};
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2020_string: LibDefinition;
@@ -0,0 +1,160 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
const printNodeModifiers = (node, final) => `${node.accessibility ?? ''}${node.static ? ' static' : ''} ${final} `.trimStart();
const isSupportedLiteral = (node) => {
switch (node.type) {
case utils_1.AST_NODE_TYPES.Literal:
return true;
case utils_1.AST_NODE_TYPES.TaggedTemplateExpression:
return node.quasi.quasis.length === 1;
case utils_1.AST_NODE_TYPES.TemplateLiteral:
return node.quasis.length === 1;
default:
return false;
}
};
exports.default = (0, util_1.createRule)({
name: 'class-literal-property-style',
meta: {
type: 'problem',
docs: {
description: 'Enforce that literals on classes are exposed in a consistent style',
recommended: 'stylistic',
},
hasSuggestions: true,
messages: {
preferFieldStyle: 'Literals should be exposed using readonly fields.',
preferFieldStyleSuggestion: 'Replace the literals with readonly fields.',
preferGetterStyle: 'Literals should be exposed using getters.',
preferGetterStyleSuggestion: 'Replace the literals with getters.',
},
schema: [
{
type: 'string',
description: 'Which literal class member syntax to prefer.',
enum: ['fields', 'getters'],
},
],
},
defaultOptions: ['fields'],
create(context, [style]) {
const propertiesInfoStack = [];
function enterClassBody() {
propertiesInfoStack.push({
excludeSet: new Set(),
properties: [],
});
}
function exitClassBody() {
const { excludeSet, properties } = (0, util_1.nullThrows)(propertiesInfoStack.pop(), 'Stack should exist on class exit');
properties.forEach(node => {
const { value } = node;
if (!value || !isSupportedLiteral(value)) {
return;
}
const name = (0, util_1.getStaticMemberAccessValue)(node, context);
if (name && excludeSet.has(name)) {
return;
}
context.report({
node: node.key,
messageId: 'preferGetterStyle',
suggest: [
{
messageId: 'preferGetterStyleSuggestion',
fix(fixer) {
const name = context.sourceCode.getText(node.key);
let text = '';
text += printNodeModifiers(node, 'get');
text += node.computed ? `[${name}]` : name;
text += `() { return ${context.sourceCode.getText(value)}; }`;
return fixer.replaceText(node, text);
},
},
],
});
});
}
function excludeAssignedProperty(node) {
if ((0, util_1.isAssignee)(node)) {
const { excludeSet } = propertiesInfoStack[propertiesInfoStack.length - 1];
const name = (0, util_1.getStaticMemberAccessValue)(node, context);
if (name) {
excludeSet.add(name);
}
}
}
return {
...(style === 'fields' && {
MethodDefinition(node) {
if (node.kind !== 'get' ||
node.override ||
!node.value.body ||
node.value.body.body.length === 0) {
return;
}
const [statement] = node.value.body.body;
if (statement.type !== utils_1.AST_NODE_TYPES.ReturnStatement) {
return;
}
const { argument } = statement;
if (!argument || !isSupportedLiteral(argument)) {
return;
}
const name = (0, util_1.getStaticMemberAccessValue)(node, context);
const hasDuplicateKeySetter = name &&
node.parent.body.some(element => {
return (element.type === utils_1.AST_NODE_TYPES.MethodDefinition &&
element.kind === 'set' &&
(0, util_1.isStaticMemberAccessOfValue)(element, context, name));
});
if (hasDuplicateKeySetter) {
return;
}
context.report({
node: node.key,
messageId: 'preferFieldStyle',
suggest: [
{
messageId: 'preferFieldStyleSuggestion',
fix(fixer) {
const name = context.sourceCode.getText(node.key);
let text = '';
text += printNodeModifiers(node, 'readonly');
text += node.computed ? `[${name}]` : name;
text += ` = ${context.sourceCode.getText(argument)};`;
return fixer.replaceText(node, text);
},
},
],
});
},
}),
...(style === 'getters' && {
ClassBody: enterClassBody,
'ClassBody:exit': exitClassBody,
'MethodDefinition[kind="constructor"] ThisExpression'(node) {
if (node.parent.type === utils_1.AST_NODE_TYPES.MemberExpression) {
let parent = node.parent;
while (!(0, util_1.isFunction)(parent)) {
parent = parent.parent;
}
if (parent.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition &&
parent.parent.kind === 'constructor') {
excludeAssignedProperty(node.parent);
}
}
},
PropertyDefinition(node) {
if (!node.readonly || node.declare || node.override) {
return;
}
const { properties } = propertiesInfoStack[propertiesInfoStack.length - 1];
properties.push(node);
},
}),
};
},
});
@@ -0,0 +1,40 @@
import { AsymmetricAlgorithm, SignatureAlgorithm } from "./jwa.js";
import { HonoJsonWebKey, SignatureKey } from "./jws.js";
import { JWTPayload } from "./types.js";
//#region src/utils/jwt/jwt.d.ts
export interface TokenHeader {
alg: SignatureAlgorithm;
typ?: 'JWT';
kid?: string;
}
export declare function isTokenHeader(obj: unknown): obj is TokenHeader;
export declare const sign: (payload: JWTPayload, privateKey: SignatureKey, alg?: SignatureAlgorithm) => Promise<string>;
export type VerifyOptions = {
/** The expected issuer used for verifying the token */
iss?: string | RegExp;
/** Verify the `nbf` claim (default: `true`) */
nbf?: boolean;
/** Verify the `exp` claim (default: `true`) */
exp?: boolean;
/** Verify the `iat` claim (default: `true`) */
iat?: boolean;
/** Acceptable audience(s) for the token */
aud?: string | string[] | RegExp;
};
export type VerifyOptionsWithAlg = {
/** The algorithm used for decoding the token */
alg: SignatureAlgorithm;
} & VerifyOptions;
export declare const verify: (token: string, publicKey: SignatureKey, algOrOptions: SignatureAlgorithm | VerifyOptionsWithAlg) => Promise<JWTPayload>;
export declare const verifyWithJwks: (token: string, options: {
keys?: HonoJsonWebKey[];
jwks_uri?: string;
verification?: VerifyOptions;
allowedAlgorithms: readonly AsymmetricAlgorithm[];
}, init?: RequestInit) => Promise<JWTPayload>;
export declare const decode: (token: string) => {
header: TokenHeader;
payload: JWTPayload;
};
export declare const decodeHeader: (token: string) => TokenHeader;
//#endregion
@@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const ast_utils_1 = require("@typescript-eslint/utils/ast-utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-array-constructor',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow generic `Array` constructors',
extendsBaseRule: true,
recommended: 'recommended',
},
fixable: 'code',
messages: {
useLiteral: 'The array literal notation [] is preferable.',
},
schema: [],
},
defaultOptions: [],
create(context) {
const sourceCode = context.sourceCode;
function getArgumentsText(node) {
const lastToken = sourceCode.getLastToken(node);
if (lastToken == null || !(0, ast_utils_1.isClosingParenToken)(lastToken)) {
return '';
}
let firstToken = node.callee;
do {
firstToken = sourceCode.getTokenAfter(firstToken);
if (!firstToken || firstToken === lastToken) {
return '';
}
} while (!(0, ast_utils_1.isOpeningParenToken)(firstToken));
return sourceCode.text.slice(firstToken.range[1], lastToken.range[0]);
}
/**
* Disallow construction of dense arrays using the Array constructor
* @param node node to evaluate
*/
function check(node) {
if (node.arguments.length !== 1 &&
node.callee.type === utils_1.AST_NODE_TYPES.Identifier &&
node.callee.name === 'Array' &&
!node.typeArguments) {
context.report({
node,
messageId: 'useLiteral',
fix(fixer) {
const argsText = getArgumentsText(node);
return fixer.replaceText(node, `[${argsText}]`);
},
});
}
}
return {
CallExpression: check,
NewExpression: check,
};
},
});
@@ -0,0 +1,8 @@
import { isCI } from 'std-env';
const isNode = typeof process < "u" && typeof process.stdout < "u" && !process.versions?.deno && !globalThis.window;
const isDeno = typeof process < "u" && typeof process.stdout < "u" && process.versions?.deno !== void 0;
const isWindows = (isNode || isDeno) && process.platform === "win32";
const isTTY = (isNode || isDeno) && process.stdout?.isTTY && !isCI;
export { isWindows as a, isTTY as i };
@@ -0,0 +1,26 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
// TODO: this doesn't make sense for an ESLint rule.
// We need to fix our build process to not create bundles for "raw" packages like this.
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/eslint-plugin-react-hooks.production.js');
} else {
module.exports = require('./cjs/eslint-plugin-react-hooks.development.js');
}
// Hint to Node’s cjs-module-lexer to make named imports work
// https://github.com/facebook/react/issues/34801#issuecomment-3433478810
// eslint-disable-next-line ft-flow/no-unused-expressions
0 &&
(module.exports = {
meta: true,
rules: true,
configs: true,
});
@@ -0,0 +1,174 @@
import { Client } from '../../client/index.js';
import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js';
import { ListToolsResultSchema, CallToolResultSchema, LoggingMessageNotificationSchema } from '../../types.js';
/**
* Parallel Tool Calls MCP Client
*
* This client demonstrates how to:
* 1. Start multiple tool calls in parallel
* 2. Track notifications from each tool call using a caller parameter
*/
// Command line args processing
const args = process.argv.slice(2);
const serverUrl = args[0] || 'http://localhost:3000/mcp';
async function main() {
console.log('MCP Parallel Tool Calls Client');
console.log('==============================');
console.log(`Connecting to server at: ${serverUrl}`);
let client;
let transport;
try {
// Create client with streamable HTTP transport
client = new Client({
name: 'parallel-tool-calls-client',
version: '1.0.0'
});
client.onerror = error => {
console.error('Client error:', error);
};
// Connect to the server
transport = new StreamableHTTPClientTransport(new URL(serverUrl));
await client.connect(transport);
console.log('Successfully connected to MCP server');
// Set up notification handler with caller identification
client.setNotificationHandler(LoggingMessageNotificationSchema, notification => {
console.log(`Notification: ${notification.params.data}`);
});
console.log('List tools');
const toolsRequest = await listTools(client);
console.log('Tools: ', toolsRequest);
// 2. Start multiple notification tools in parallel
console.log('\n=== Starting Multiple Notification Streams in Parallel ===');
const toolResults = await startParallelNotificationTools(client);
// Log the results from each tool call
for (const [caller, result] of Object.entries(toolResults)) {
console.log(`\n=== Tool result for ${caller} ===`);
result.content.forEach((item) => {
if (item.type === 'text') {
console.log(` ${item.text}`);
}
else {
console.log(` ${item.type} content:`, item);
}
});
}
// 3. Wait for all notifications (10 seconds)
console.log('\n=== Waiting for all notifications ===');
await new Promise(resolve => setTimeout(resolve, 10000));
// 4. Disconnect
console.log('\n=== Disconnecting ===');
await transport.close();
console.log('Disconnected from MCP server');
}
catch (error) {
console.error('Error running client:', error);
process.exit(1);
}
}
/**
* List available tools on the server
*/
async function listTools(client) {
try {
const toolsRequest = {
method: 'tools/list',
params: {}
};
const toolsResult = await client.request(toolsRequest, ListToolsResultSchema);
console.log('Available tools:');
if (toolsResult.tools.length === 0) {
console.log(' No tools available');
}
else {
for (const tool of toolsResult.tools) {
console.log(` - ${tool.name}: ${tool.description}`);
}
}
}
catch (error) {
console.log(`Tools not supported by this server: ${error}`);
}
}
/**
* Start multiple notification tools in parallel with different configurations
* Each tool call includes a caller parameter to identify its notifications
*/
async function startParallelNotificationTools(client) {
try {
// Define multiple tool calls with different configurations
const toolCalls = [
{
caller: 'fast-notifier',
request: {
method: 'tools/call',
params: {
name: 'start-notification-stream',
arguments: {
interval: 2, // 0.5 second between notifications
count: 10, // Send 10 notifications
caller: 'fast-notifier' // Identify this tool call
}
}
}
},
{
caller: 'slow-notifier',
request: {
method: 'tools/call',
params: {
name: 'start-notification-stream',
arguments: {
interval: 5, // 2 seconds between notifications
count: 5, // Send 5 notifications
caller: 'slow-notifier' // Identify this tool call
}
}
}
},
{
caller: 'burst-notifier',
request: {
method: 'tools/call',
params: {
name: 'start-notification-stream',
arguments: {
interval: 1, // 0.1 second between notifications
count: 3, // Send just 3 notifications
caller: 'burst-notifier' // Identify this tool call
}
}
}
}
];
console.log(`Starting ${toolCalls.length} notification tools in parallel...`);
// Start all tool calls in parallel
const toolPromises = toolCalls.map(({ caller, request }) => {
console.log(`Starting tool call for ${caller}...`);
return client
.request(request, CallToolResultSchema)
.then(result => ({ caller, result }))
.catch(error => {
console.error(`Error in tool call for ${caller}:`, error);
throw error;
});
});
// Wait for all tool calls to complete
const results = await Promise.all(toolPromises);
// Organize results by caller
const resultsByTool = {};
results.forEach(({ caller, result }) => {
resultsByTool[caller] = result;
});
return resultsByTool;
}
catch (error) {
console.error(`Error starting parallel notification tools:`, error);
throw error;
}
}
// Start the client
main().catch((error) => {
console.error('Error running MCP client:', error);
process.exit(1);
});
//# sourceMappingURL=parallelToolCallsClient.js.map