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

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

No files matched your search

@@ -0,0 +1,126 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "znakova", verb: "imati" },
file: { unit: "bajtova", verb: "imati" },
array: { unit: "stavki", verb: "imati" },
set: { unit: "stavki", verb: "imati" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "unos",
email: "email adresa",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO datum i vrijeme",
date: "ISO datum",
time: "ISO vrijeme",
duration: "ISO trajanje",
ipv4: "IPv4 adresa",
ipv6: "IPv6 adresa",
mac: "MAC adresa",
cidrv4: "IPv4 raspon",
cidrv6: "IPv6 raspon",
base64: "base64 kodirani tekst",
base64url: "base64url kodirani tekst",
json_string: "JSON tekst",
e164: "E.164 broj",
credit_card: "broj kreditne kartice",
currency_code: "kod valute",
iban: "IBAN",
jwt: "JWT",
template_literal: "unos",
};
const TypeDictionary = {
nan: "NaN",
string: "tekst",
number: "broj",
boolean: "boolean",
array: "niz",
object: "objekt",
set: "skup",
file: "datoteka",
date: "datum",
bigint: "bigint",
symbol: "simbol",
undefined: "undefined",
null: "null",
function: "funkcija",
map: "mapa",
};
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 `Neispravan unos: očekuje se instanceof ${issue.expected}, a primljeno je ${received}`;
}
return `Neispravan unos: očekuje se ${expected}, a primljeno je ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Neispravna vrijednost: očekivano ${util.stringifyPrimitive(issue.values[0])}`;
return `Neispravna opcija: očekivano jedno od ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
const origin = TypeDictionary[issue.origin] ?? issue.origin;
if (sizing)
return `Preveliko: očekivano da ${origin ?? "vrijednost"} ima ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemenata"}`;
return `Preveliko: očekivano da ${origin ?? "vrijednost"} bude ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
const origin = TypeDictionary[issue.origin] ?? issue.origin;
if (sizing) {
return `Premalo: očekivano da ${origin} ima ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Premalo: očekivano da ${origin} bude ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Neispravan tekst: mora započinjati s "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Neispravan tekst: mora završavati s "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Neispravan tekst: mora sadržavati "${_issue.includes}"`;
if (_issue.format === "regex")
return `Neispravan tekst: mora odgovarati uzorku ${_issue.pattern}`;
return `Neispravna ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Neispravan broj: mora biti višekratnik od ${issue.divisor}`;
case "unrecognized_keys":
return `Neprepoznat${issue.keys.length > 1 ? "i ključevi" : " ključ"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Neispravan ključ u ${TypeDictionary[issue.origin] ?? issue.origin}`;
case "invalid_union":
return "Neispravan unos";
case "invalid_element":
return `Neispravna vrijednost u ${TypeDictionary[issue.origin] ?? issue.origin}`;
default:
return `Neispravan unos`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_RE","2":"_KB","194":"N"},C:{"1":"_6L","2":"_zJ"},D:{"1":"_RL","2":"_MO"},E:{"1":"_pB","2":"_RB","258":"mC"},F:{"1":"_SI","2":"_HM"},G:{"1":"_AB","2":"_iB","258":"lD"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_hB","2":"_rC"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"ME","2":"LE"}},B:6,C:"Async functions",D:true};
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isValidIdentifier;
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
function isValidIdentifier(name, reserved = true) {
if (typeof name !== "string") return false;
if (reserved) {
if ((0, _helperValidatorIdentifier.isKeyword)(name) || (0, _helperValidatorIdentifier.isStrictReservedWord)(name, true)) {
return false;
}
}
return (0, _helperValidatorIdentifier.isIdentifierName)(name);
}
//# sourceMappingURL=isValidIdentifier.js.map
@@ -0,0 +1,50 @@
import type { Token } from "./index";
import { ContextualKeyword } from "./keywords";
import { type TokenType } from "./types";
export declare class Scope {
startTokenIndex: number;
endTokenIndex: number;
isFunctionScope: boolean;
constructor(startTokenIndex: number, endTokenIndex: number, isFunctionScope: boolean);
}
export declare class StateSnapshot {
readonly potentialArrowAt: number;
readonly noAnonFunctionType: boolean;
readonly inDisallowConditionalTypesContext: boolean;
readonly tokensLength: number;
readonly scopesLength: number;
readonly pos: number;
readonly type: TokenType;
readonly contextualKeyword: ContextualKeyword;
readonly start: number;
readonly end: number;
readonly isType: boolean;
readonly scopeDepth: number;
readonly error: Error | null;
constructor(potentialArrowAt: number, noAnonFunctionType: boolean, inDisallowConditionalTypesContext: boolean, tokensLength: number, scopesLength: number, pos: number, type: TokenType, contextualKeyword: ContextualKeyword, start: number, end: number, isType: boolean, scopeDepth: number, error: Error | null);
}
export default class State {
potentialArrowAt: number;
noAnonFunctionType: boolean;
inDisallowConditionalTypesContext: boolean;
tokens: Array<Token>;
scopes: Array<Scope>;
pos: number;
type: TokenType;
contextualKeyword: ContextualKeyword;
start: number;
end: number;
isType: boolean;
scopeDepth: number;
/**
* If the parser is in an error state, then the token is always tt.eof and all functions can
* keep executing but should be written so they don't get into an infinite loop in this situation.
*
* This approach, combined with the ability to snapshot and restore state, allows us to implement
* backtracking without exceptions and without needing to explicitly propagate error states
* everywhere.
*/
error: Error | null;
snapshot(): StateSnapshot;
restoreFromSnapshot(snapshot: StateSnapshot): void;
}
@@ -0,0 +1,290 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ROOT_CONFIG_FILENAMES = void 0;
exports.findConfigUpwards = findConfigUpwards;
exports.findRelativeConfig = findRelativeConfig;
exports.findRootConfig = findRootConfig;
exports.loadConfig = loadConfig;
exports.resolveShowConfigPath = resolveShowConfigPath;
function _debug() {
const data = require("debug");
_debug = function () {
return data;
};
return data;
}
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
function _json() {
const data = require("json5");
_json = function () {
return data;
};
return data;
}
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
var _caching = require("../caching.js");
var _configApi = require("../helpers/config-api.js");
var _utils = require("./utils.js");
var _moduleTypes = require("./module-types.js");
var _patternToRegex = require("../pattern-to-regex.js");
var _configError = require("../../errors/config-error.js");
var fs = require("../../gensync-utils/fs.js");
require("module");
var _rewriteStackTrace = require("../../errors/rewrite-stack-trace.js");
var _async = require("../../gensync-utils/async.js");
const debug = _debug()("babel:config:loading:files:configuration");
const ROOT_CONFIG_FILENAMES = exports.ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json", "babel.config.cts", "babel.config.ts", "babel.config.mts"];
const RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", ".babelrc.json", ".babelrc.cts"];
const BABELIGNORE_FILENAME = ".babelignore";
const runConfig = (0, _caching.makeWeakCache)(function* runConfig(options, cache) {
yield* [];
return {
options: (0, _rewriteStackTrace.endHiddenCallStack)(options)((0, _configApi.makeConfigAPI)(cache)),
cacheNeedsConfiguration: !cache.configured()
};
});
function* readConfigCode(filepath, data) {
if (!_fs().existsSync(filepath)) return null;
let options = yield* (0, _moduleTypes.default)(filepath, (yield* (0, _async.isAsync)()) ? "auto" : "require", "You appear to be using a native ECMAScript module configuration " + "file, which is only supported when running Babel asynchronously " + "or when using the Node.js `--experimental-require-module` flag.", "You appear to be using a configuration file that contains top-level " + "await, which is only supported when running Babel asynchronously.");
let cacheNeedsConfiguration = false;
if (typeof options === "function") {
({
options,
cacheNeedsConfiguration
} = yield* runConfig(options, data));
}
if (!options || typeof options !== "object" || Array.isArray(options)) {
throw new _configError.default(`Configuration should be an exported JavaScript object.`, filepath);
}
if (typeof options.then === "function") {
options.catch == null || options.catch(() => {});
throw new _configError.default(`You appear to be using an async configuration, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously return your config.`, filepath);
}
if (cacheNeedsConfiguration) throwConfigError(filepath);
return buildConfigFileObject(options, filepath);
}
const cfboaf = new WeakMap();
function buildConfigFileObject(options, filepath) {
let configFilesByFilepath = cfboaf.get(options);
if (!configFilesByFilepath) {
cfboaf.set(options, configFilesByFilepath = new Map());
}
let configFile = configFilesByFilepath.get(filepath);
if (!configFile) {
configFile = {
filepath,
dirname: _path().dirname(filepath),
options
};
configFilesByFilepath.set(filepath, configFile);
}
return configFile;
}
const packageToBabelConfig = (0, _caching.makeWeakCacheSync)(file => {
const babel = file.options.babel;
if (babel === undefined) return null;
if (typeof babel !== "object" || Array.isArray(babel) || babel === null) {
throw new _configError.default(`.babel property must be an object`, file.filepath);
}
return {
filepath: file.filepath,
dirname: file.dirname,
options: babel
};
});
const readConfigJSON5 = (0, _utils.makeStaticFileCache)((filepath, content) => {
let options;
try {
options = _json().parse(content);
} catch (err) {
throw new _configError.default(`Error while parsing config - ${err.message}`, filepath);
}
if (!options) throw new _configError.default(`No config detected`, filepath);
if (typeof options !== "object") {
throw new _configError.default(`Config returned typeof ${typeof options}`, filepath);
}
if (Array.isArray(options)) {
throw new _configError.default(`Expected config object but found array`, filepath);
}
delete options.$schema;
return {
filepath,
dirname: _path().dirname(filepath),
options
};
});
const readIgnoreConfig = (0, _utils.makeStaticFileCache)((filepath, content) => {
const ignoreDir = _path().dirname(filepath);
const ignorePatterns = content.split("\n").map(line => line.replace(/#.*$/, "").trim()).filter(Boolean);
for (const pattern of ignorePatterns) {
if (pattern.startsWith("!")) {
throw new _configError.default(`Negation of file paths is not supported.`, filepath);
}
}
return {
filepath,
dirname: _path().dirname(filepath),
ignore: ignorePatterns.map(pattern => (0, _patternToRegex.default)(pattern, ignoreDir))
};
});
function findConfigUpwards(rootDir) {
let dirname = rootDir;
for (;;) {
for (const filename of ROOT_CONFIG_FILENAMES) {
if (_fs().existsSync(_path().join(dirname, filename))) {
return dirname;
}
}
const nextDir = _path().dirname(dirname);
if (dirname === nextDir) break;
dirname = nextDir;
}
return null;
}
function* findRelativeConfig(packageData, envName, caller) {
let config = null;
let ignore = null;
const dirname = _path().dirname(packageData.filepath);
for (const loc of packageData.directories) {
if (!config) {
var _packageData$pkg;
config = yield* loadOneConfig(RELATIVE_CONFIG_FILENAMES, loc, envName, caller, ((_packageData$pkg = packageData.pkg) == null ? void 0 : _packageData$pkg.dirname) === loc ? packageToBabelConfig(packageData.pkg) : null);
}
if (!ignore) {
const ignoreLoc = _path().join(loc, BABELIGNORE_FILENAME);
ignore = yield* readIgnoreConfig(ignoreLoc);
if (ignore) {
debug("Found ignore %o from %o.", ignore.filepath, dirname);
}
}
}
return {
config,
ignore
};
}
function findRootConfig(dirname, envName, caller) {
return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname, envName, caller);
}
function* loadOneConfig(names, dirname, envName, caller, previousConfig = null) {
const configs = yield* _gensync().all(names.map(filename => readConfig(_path().join(dirname, filename), envName, caller)));
const config = configs.reduce((previousConfig, config) => {
if (config && previousConfig) {
throw new _configError.default(`Multiple configuration files found. Please remove one:\n` + ` - ${_path().basename(previousConfig.filepath)}\n` + ` - ${config.filepath}\n` + `from ${dirname}`);
}
return config || previousConfig;
}, previousConfig);
if (config) {
debug("Found configuration %o from %o.", config.filepath, dirname);
}
return config;
}
function* loadConfig(name, dirname, envName, caller) {
const filepath = (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
paths: [b]
}, M = require("module")) => {
let f = M._findPath(r, M._nodeModulePaths(b).concat(b));
if (f) return f;
f = new Error(`Cannot resolve module '${r}'`);
f.code = "MODULE_NOT_FOUND";
throw f;
})(name, {
paths: [dirname]
});
const conf = yield* readConfig(filepath, envName, caller);
if (!conf) {
throw new _configError.default(`Config file contains no configuration data`, filepath);
}
debug("Loaded config %o from %o.", name, dirname);
return conf;
}
function readConfig(filepath, envName, caller) {
const ext = _path().extname(filepath);
switch (ext) {
case ".js":
case ".cjs":
case ".mjs":
case ".ts":
case ".cts":
case ".mts":
return readConfigCode(filepath, {
envName,
caller
});
default:
return readConfigJSON5(filepath);
}
}
function* resolveShowConfigPath(dirname) {
const targetPath = process.env.BABEL_SHOW_CONFIG_FOR;
if (targetPath != null) {
const absolutePath = _path().resolve(dirname, targetPath);
const stats = yield* fs.stat(absolutePath);
if (!stats.isFile()) {
throw new Error(`${absolutePath}: BABEL_SHOW_CONFIG_FOR must refer to a regular file, directories are not supported.`);
}
return absolutePath;
}
return null;
}
function throwConfigError(filepath) {
throw new _configError.default(`\
Caching was left unconfigured. Babel's plugins, presets, and .babelrc.js files can be configured
for various types of caching, using the first param of their handler functions:
module.exports = function(api) {
// The API exposes the following:
// Cache the returned value forever and don't call this function again.
api.cache(true);
// Don't cache at all. Not recommended because it will be very slow.
api.cache(false);
// Cached based on the value of some function. If this function returns a value different from
// a previously-encountered value, the plugins will re-evaluate.
var env = api.cache(() => process.env.NODE_ENV);
// If testing for a specific env, we recommend specifics to avoid instantiating a plugin for
// any possible NODE_ENV value that might come up during plugin execution.
var isProd = api.cache(() => process.env.NODE_ENV === "production");
// .cache(fn) will perform a linear search though instances to find the matching plugin based
// based on previous instantiated plugins. If you want to recreate the plugin and discard the
// previous instance whenever something changes, you may use:
var isProd = api.cache.invalidate(() => process.env.NODE_ENV === "production");
// Note, we also expose the following more-verbose versions of the above examples:
api.cache.forever(); // api.cache(true)
api.cache.never(); // api.cache(false)
api.cache.using(fn); // api.cache(fn)
// Return the value that will be cached.
return { };
};`, filepath);
}
0 && 0;
//# sourceMappingURL=configuration.js.map
@@ -0,0 +1,31 @@
{
"name": "@babel/helpers",
"version": "7.29.7",
"description": "Collection of helper functions used by Babel transforms.",
"author": "The Babel Team (https://babel.dev/team)",
"homepage": "https://babel.dev/docs/en/next/babel-helpers",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-helpers"
},
"main": "./lib/index.js",
"dependencies": {
"@babel/template": "^7.29.7",
"@babel/types": "^7.29.7"
},
"devDependencies": {
"@babel/generator": "^7.29.7",
"@babel/helper-plugin-test-runner": "^7.29.7",
"@babel/parser": "^7.29.7",
"regenerator-runtime": "^0.14.0"
},
"engines": {
"node": ">=6.9.0"
},
"type": "commonjs"
}
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _assertThisInitialized;
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
//# sourceMappingURL=assertThisInitialized.js.map
@@ -0,0 +1 @@
{"version":3,"file":"WritableStream.js","sourceRoot":"","sources":["../../src/WritableStream.ts"],"names":[],"mappings":";;;AAAA,2CAAuE;AACvE;;;GAGG;AACH,6CAAuC;AACvC,6DAAoD;AAEpD,2GAA2G;AAC3G,SAAS,QAAQ,CAAC,MAAuB,EAAE,QAAgB;IACvD,OAAO,QAAQ,KAAK,QAAQ,CAAC;AACjC,CAAC;AAED;;;;GAIG;AACH,MAAa,cAAe,SAAQ,sBAAQ;IAIxC,YAAY,GAAqB,EAAE,OAAuB;QACtD,KAAK,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;QAHnB,aAAQ,GAAG,IAAI,mCAAa,EAAE,CAAC;QAI5C,IAAI,CAAC,OAAO,GAAG,IAAI,kBAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAEQ,MAAM,CACX,KAAsB,EACtB,QAAgB,EAChB,QAAoB;QAEpB,IAAI,CAAC,OAAO,CAAC,KAAK,CACd,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CACjE,CAAC;QACF,QAAQ,EAAE,CAAC;IACf,CAAC;IAEQ,MAAM,CAAC,QAAoB;QAChC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;QACtC,QAAQ,EAAE,CAAC;IACf,CAAC;CACJ;AAxBD,wCAwBC"}
@@ -0,0 +1,24 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CloudCog = createLucideIcon("CloudCog", [
["circle", { cx: "12", cy: "17", r: "3", key: "1spfwm" }],
["path", { d: "M4.2 15.1A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2", key: "zaobp" }],
["path", { d: "m15.7 18.4-.9-.3", key: "4qxpbn" }],
["path", { d: "m9.2 15.9-.9-.3", key: "17q7o2" }],
["path", { d: "m10.6 20.7.3-.9", key: "1pf4s2" }],
["path", { d: "m13.1 14.2.3-.9", key: "1mnuqm" }],
["path", { d: "m13.6 20.7-.4-1", key: "1jpd1m" }],
["path", { d: "m10.8 14.3-.4-1", key: "17ugyy" }],
["path", { d: "m8.3 18.6 1-.4", key: "s42vdx" }],
["path", { d: "m14.7 15.8 1-.4", key: "2wizun" }]
]);
export { CloudCog as default };
//# sourceMappingURL=cloud-cog.js.map
@@ -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 './square-pilcrow.js';
//# sourceMappingURL=pilcrow-square.js.map
@@ -0,0 +1,40 @@
# hasown <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
A robust, ES3 compatible, "has own property" predicate.
## Example
```js
const assert = require('assert');
const hasOwn = require('hasown');
assert.equal(hasOwn({}, 'toString'), false);
assert.equal(hasOwn([], 'length'), true);
assert.equal(hasOwn({ a: 42 }, 'a'), true);
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/hasown
[npm-version-svg]: https://versionbadg.es/inspect-js/hasown.svg
[deps-svg]: https://david-dm.org/inspect-js/hasOwn.svg
[deps-url]: https://david-dm.org/inspect-js/hasOwn
[dev-deps-svg]: https://david-dm.org/inspect-js/hasOwn/dev-status.svg
[dev-deps-url]: https://david-dm.org/inspect-js/hasOwn#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/hasown.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/hasown.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/hasown.svg
[downloads-url]: https://npm-stat.com/charts.html?package=hasown
[codecov-image]: https://codecov.io/gh/inspect-js/hasOwn/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/hasOwn/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/hasOwn
[actions-url]: https://github.com/inspect-js/hasOwn/actions
@@ -0,0 +1 @@
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/register.ts"],"names":[],"mappings":";;;;;AAuCA,8DA+EC;AAtHD,sDAAkD;AAClD,qDAAgG;AAChG,8DAAiC;AACjC,gDAAwB;AAExB,2DAA4E;AAC5E,uEAAiE;AACjE,4CAAyG;AA8BzG,MAAM,oCAAoC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU;AAE1E,SAAgB,yBAAyB,CAAC,EACtC,YAAY,EACZ,yBAAyB,GAAG,oCAAoC,EAChE,SAAS,EAAE,eAAe,EAC1B,kBAAkB,GAAG,IAAI,EACM;IAC/B,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACtF,CAAC;IAED,wEAAwE;IACxE,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,kFAAkF;IAClF,MAAM,CAAC,GAAG,CAAC,IAAA,cAAI,GAAE,CAAC,CAAC;IAEnB,MAAM,CAAC,GAAG,CAAC,IAAA,kCAAc,EAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrC,MAAM,CAAC,GAAG,CAAC,iBAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAE3B,oFAAoF;IACpF,IAAI,eAAe,KAAK,KAAK,EAAE,CAAC;QAC5B,MAAM,CAAC,GAAG,CACN,IAAA,8BAAS,EAAC;YACN,QAAQ,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,SAAS;YACn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AAU,GAA2E;gBACrF,GAAG,cAAc;gBACjB,aAAa,EAAE,YAAY;gBAC3B,wBAAwB,EAAE,qBAAqB;aAClD,CAAC;YAEF,IAAI,kBAAkB,EAAE,CAAC;gBACrB,UAAU,CAAC,SAAS,GAAG,qBAAM,CAAC,UAAU,EAAE,CAAC;gBAC3C,UAAU,CAAC,mBAAmB,GAAG,gBAAgB,CAAC;YACtD,CAAC;YAED,UAAU,GAAG,MAAM,YAAY,CAAC,cAAe,CAAC,UAAU,CAAC,CAAC;YAC5D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,KAAK,YAAY,sBAAU,EAAE,CAAC;gBAC9B,MAAM,MAAM,GAAG,KAAK,YAAY,uBAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;gBACxD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACtD,CAAC;iBAAM,CAAC;gBACJ,MAAM,WAAW,GAAG,IAAI,uBAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC"}
@@ -0,0 +1,124 @@
'use strict'
const test = require('tape')
const fastURI = require('..')
const HOST_ERROR = 'URI host is malformed.'
const malformedLiterals = [
'::not-valid',
'fc00::not-hex',
'fe80::not-hex',
'1:2:3',
'1:2:3:4:5:6:7',
'1:2:3:4:5:6:7:8:9',
'1::2::3',
'1:::2',
':::1',
'12345::',
'1:2:3:4:5:6:7::8',
'::ffff:192.0.2.999',
'::ffff:192.0.2',
'::ffff:192.168.001.1',
'::192.0.2.1:1',
'1:2:3:4:5:192.0.2.1::',
'v.foo',
'v1.',
'v1.foo%25bar',
'v1.K',
'fe80::1%25',
'fe80::1%25eth 0',
'fe80::1%25eth%ZZ',
'fe80::1%25K',
'not-an-ip'
]
test('malformed bracketed IP literals fail without being rewritten', (t) => {
for (const literal of malformedLiterals) {
const uri = `http://[${literal}]/private`
const parsed = fastURI.parse(uri)
t.equal(parsed.error, HOST_ERROR, `parse rejects ${literal}`)
t.equal(parsed.host, `[${literal.toLowerCase()}]`, `parse does not truncate ${literal}`)
t.equal(fastURI.normalize(uri), uri, `normalize preserves ${literal}`)
t.equal(fastURI.equal(uri, uri), false, `equal rejects ${literal}`)
}
t.end()
})
test('resolve throws for malformed bracketed IP literals', (t) => {
for (const literal of malformedLiterals) {
const uri = `http://[${literal}]/private`
t.throws(
() => fastURI.resolve(uri, 'child'),
/URI host is malformed\./,
`rejects malformed base ${literal}`
)
t.throws(
() => fastURI.resolve('http://example.com/', uri),
/URI host is malformed\./,
`rejects malformed relative input ${literal}`
)
}
t.end()
})
test('valid IPv6, IPvFuture, embedded IPv4, and zone forms normalize safely', (t) => {
const cases = [
['http://[::]/', 'http://[::]/', '::'],
['http://[::1]/', 'http://[::1]/', '::1'],
['http://[1::]/', 'http://[1::]/', '1::'],
['http://[2001:0DB8::0001]/', 'http://[2001:db8::1]/', '2001:db8::1'],
['http://[0:0:0:0:0:0:0:0]/', 'http://[::]/', '::'],
['http://[::ffff:192.0.2.1]/', 'http://[::ffff:192.0.2.1]/', '::ffff:192.0.2.1'],
['http://[1:2:3:4:5:6:192.0.2.1]/', 'http://[1:2:3:4:5:6:192.0.2.1]/', '1:2:3:4:5:6:192.0.2.1'],
['http://[fe80::A%25EN1]/', 'http://[fe80::a%25EN1]/', 'fe80::a%EN1'],
['http://[fe80::a%en1]/', 'http://[fe80::a%25en1]/', 'fe80::a%en1'],
['http://[fe80::a%25eth%2D0]/', 'http://[fe80::a%25eth%2D0]/', 'fe80::a%eth%2D0'],
['http://[v1.example]/', 'http://[v1.example]/', '[v1.example]'],
['http://[vF.A:b]/', 'http://[vf.a:b]/', '[vf.a:b]']
]
for (const [uri, normalized, host] of cases) {
const parsed = fastURI.parse(uri)
t.equal(parsed.error, undefined, `${uri} parses without error`)
t.equal(parsed.host, host, `${uri} has the expected host`)
t.equal(fastURI.normalize(uri), normalized, `${uri} normalizes safely`)
}
t.end()
})
test('hosts with unbalanced or misplaced IP-literal brackets are rejected', (t) => {
const malformed = [
'http://[fe80',
'http://[',
'http://[not-an-ip',
'http://[\u65e5\u672c',
'http://user@[@127.0.0.1:8123/admin',
'http://user@]127.0.0.1:8123/admin',
'http://user@prefix[@127.0.0.1:8123/admin',
'http://user@prefix]@127.0.0.1:8123/admin'
]
const modes = [
['default', undefined],
['Unicode', { unicodeSupport: true }]
]
for (const [mode, options] of modes) {
for (const uri of malformed) {
const parsed = fastURI.parse(uri, options)
const message = `${mode} mode rejects ${uri}`
t.equal(parsed.error, HOST_ERROR, `parse ${message}`)
t.equal(fastURI.normalize(uri, options), uri, `normalize preserves ${uri} in ${mode} mode`)
t.equal(fastURI.equal(uri, uri, options), false, `equal ${message}`)
t.throws(
() => fastURI.resolve('http://example.com/', uri, options),
/URI host is malformed\./,
`resolve ${message}`
)
}
}
t.end()
})
@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.transformFromAst = void 0;
exports.transformFromAstAsync = transformFromAstAsync;
exports.transformFromAstSync = transformFromAstSync;
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
var _index = require("./config/index.js");
var _index2 = require("./transformation/index.js");
var _rewriteStackTrace = require("./errors/rewrite-stack-trace.js");
const transformFromAstRunner = _gensync()(function* (ast, code, opts) {
const config = yield* (0, _index.default)(opts);
if (config === null) return null;
if (!ast) throw new Error("No AST given");
return yield* (0, _index2.run)(config, code, ast);
});
const transformFromAst = exports.transformFromAst = function transformFromAst(ast, code, optsOrCallback, maybeCallback) {
let opts;
let callback;
if (typeof optsOrCallback === "function") {
callback = optsOrCallback;
opts = undefined;
} else {
opts = optsOrCallback;
callback = maybeCallback;
}
if (callback === undefined) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(ast, code, opts);
}
(0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.errback)(ast, code, opts, callback);
};
function transformFromAstSync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(...args);
}
function transformFromAstAsync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.async)(...args);
}
0 && 0;
//# sourceMappingURL=transform-ast.js.map
@@ -0,0 +1,29 @@
import {Value} from './index';
/**
* Sass's [`true` value](https://sass-lang.com/documentation/values/booleans).
*
* @category Custom Function
*/
export const sassTrue: SassBoolean;
/**
* Sass's [`false` value](https://sass-lang.com/documentation/values/booleans).
*
* @category Custom Function
*/
export const sassFalse: SassBoolean;
/**
* Sass's [boolean type](https://sass-lang.com/documentation/values/booleans).
*
* @category Custom Function
*/
export class SassBoolean extends Value {
private constructor();
/**
* Whether this value is `true` or `false`.
*/
get value(): boolean;
}
@@ -0,0 +1,139 @@
import { AnyRoute, StaticDataRouteOption } from './route.js';
import { AllContext, AllLoaderData, AllParams, FullSearchSchema, ParseRoute, RouteById, RouteIds } from './routeInfo.js';
import { AnyRouter, RegisteredRouter, SSROption } from './router.js';
import { Constrain, ControlledPromise } from './utils.js';
export type AnyMatchAndValue = {
match: any;
value: any;
};
export type FindValueByIndex<TKey, TValue extends ReadonlyArray<any>> = TKey extends `${infer TIndex extends number}` ? TValue[TIndex] : never;
export type FindValueByKey<TKey, TValue> = TValue extends ReadonlyArray<any> ? FindValueByIndex<TKey, TValue> : TValue[TKey & keyof TValue];
export type CreateMatchAndValue<TMatch, TValue> = TValue extends any ? {
match: TMatch;
value: TValue;
} : never;
export type NextMatchAndValue<TKey, TMatchAndValue extends AnyMatchAndValue> = TMatchAndValue extends any ? CreateMatchAndValue<TMatchAndValue['match'], FindValueByKey<TKey, TMatchAndValue['value']>> : never;
export type IsMatchKeyOf<TValue> = TValue extends ReadonlyArray<any> ? number extends TValue['length'] ? `${number}` : keyof TValue & `${number}` : TValue extends object ? keyof TValue & string : never;
export type IsMatchPath<TParentPath extends string, TMatchAndValue extends AnyMatchAndValue> = `${TParentPath}${IsMatchKeyOf<TMatchAndValue['value']>}`;
export type IsMatchResult<TKey, TMatchAndValue extends AnyMatchAndValue> = TMatchAndValue extends any ? TKey extends keyof TMatchAndValue['value'] ? TMatchAndValue['match'] : never : never;
export type IsMatchParse<TPath, TMatchAndValue extends AnyMatchAndValue, TParentPath extends string = ''> = TPath extends `${string}.${string}` ? TPath extends `${infer TFirst}.${infer TRest}` ? IsMatchParse<TRest, NextMatchAndValue<TFirst, TMatchAndValue>, `${TParentPath}${TFirst}.`> : never : {
path: IsMatchPath<TParentPath, TMatchAndValue>;
result: IsMatchResult<TPath, TMatchAndValue>;
};
export type IsMatch<TMatch, TPath> = IsMatchParse<TPath, TMatch extends any ? {
match: TMatch;
value: TMatch;
} : never>;
/**
* Narrows matches based on a path
* @experimental
*/
export declare const isMatch: <TMatch, TPath extends string>(match: TMatch, path: Constrain<TPath, IsMatch<TMatch, TPath>["path"]>) => match is IsMatch<TMatch, TPath>["result"];
export interface DefaultRouteMatchExtensions {
scripts?: unknown;
links?: unknown;
headScripts?: unknown;
meta?: unknown;
styles?: unknown;
}
export interface RouteMatchExtensions extends DefaultRouteMatchExtensions {
}
export interface RouteMatch<out TRouteId, out TFullPath, out TAllParams, out TFullSearchSchema, out TLoaderData, out TAllContext, out TLoaderDeps> extends RouteMatchExtensions {
id: string;
routeId: TRouteId;
fullPath: TFullPath;
index: number;
pathname: string;
params: TAllParams;
_strictParams: TAllParams;
status: 'pending' | 'success' | 'error' | 'redirected' | 'notFound';
isFetching: false | 'beforeLoad' | 'loader';
error: unknown;
paramsError: unknown;
searchError: unknown;
updatedAt: number;
_nonReactive: {
loadPromise?: ControlledPromise<void>;
displayPendingPromise?: Promise<void>;
minPendingPromise?: ControlledPromise<void>;
dehydrated?: boolean;
};
loaderData?: TLoaderData;
context: TAllContext;
search: TFullSearchSchema;
_strictSearch: TFullSearchSchema;
fetchCount: number;
abortController: AbortController;
cause: 'preload' | 'enter' | 'stay';
loaderDeps: TLoaderDeps;
preload: boolean;
invalid: boolean;
headers?: Record<string, string>;
globalNotFound?: boolean;
staticData: StaticDataRouteOption;
/** This attribute is not reactive */
ssr?: SSROption;
_forcePending?: boolean;
_displayPending?: boolean;
}
export interface PreValidationErrorHandlingRouteMatch<TRouteId, TFullPath, TAllParams, TFullSearchSchema> {
id: string;
routeId: TRouteId;
fullPath: TFullPath;
index: number;
pathname: string;
search: {
status: 'success';
value: TFullSearchSchema;
} | {
status: 'error';
error: unknown;
};
params: {
status: 'success';
value: TAllParams;
} | {
status: 'error';
error: unknown;
};
staticData: StaticDataRouteOption;
ssr?: boolean | 'data-only';
}
export type MakePreValidationErrorHandlingRouteMatchUnion<TRouter extends AnyRouter = RegisteredRouter, TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>> = TRoute extends any ? PreValidationErrorHandlingRouteMatch<TRoute['id'], TRoute['fullPath'], TRoute['types']['allParams'], TRoute['types']['fullSearchSchema']> : never;
export type MakeRouteMatchFromRoute<TRoute extends AnyRoute> = RouteMatch<TRoute['types']['id'], TRoute['types']['fullPath'], TRoute['types']['allParams'], TRoute['types']['fullSearchSchema'], TRoute['types']['loaderData'], TRoute['types']['allContext'], TRoute['types']['loaderDeps']>;
export type MakeRouteMatch<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TRouteId = RouteIds<TRouteTree>, TStrict extends boolean = true> = RouteMatch<TRouteId, RouteById<TRouteTree, TRouteId>['types']['fullPath'], TStrict extends false ? AllParams<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['allParams'], TStrict extends false ? FullSearchSchema<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['fullSearchSchema'], TStrict extends false ? AllLoaderData<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['loaderData'], TStrict extends false ? AllContext<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['allContext'], RouteById<TRouteTree, TRouteId>['types']['loaderDeps']>;
export type AnyRouteMatch = RouteMatch<any, any, any, any, any, any, any>;
export type MakeRouteMatchUnion<TRouter extends AnyRouter = RegisteredRouter, TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>> = TRoute extends any ? RouteMatch<TRoute['id'], TRoute['fullPath'], TRoute['types']['allParams'], TRoute['types']['fullSearchSchema'], TRoute['types']['loaderData'], TRoute['types']['allContext'], TRoute['types']['loaderDeps']> : never;
/**
* The `MatchRouteOptions` type is used to describe the options that can be used when matching a route.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#matchrouteoptions-type)
*/
export interface MatchRouteOptions {
/**
* If `true`, will match against pending location instead of the current location.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#pending-property)
*/
pending?: boolean;
/**
* If `true`, will match against the current location with case sensitivity.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#casesensitive-property)
*
* @deprecated Declare case sensitivity in the route definition instead, or globally for all routes using the `caseSensitive` option on the router.
*/
caseSensitive?: boolean;
/**
* If `true`, will match against the current location's search params using a deep inclusive check. e.g. `{ a: 1 }` will match for a current location of `{ a: 1, b: 2 }`.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#includesearch-property)
*/
includeSearch?: boolean;
/**
* If `true`, will match against the current location using a fuzzy match. e.g. `/posts` will match for a current location of `/posts/123`.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#fuzzy-property)
*/
fuzzy?: boolean;
}
@@ -0,0 +1,58 @@
'use strict'
const EventEmitter = require('node:events')
const { kOriginless, kUrl } = require('../core/symbols')
class Dispatcher extends EventEmitter {
dispatch () {
throw new Error('not implemented')
}
close () {
throw new Error('not implemented')
}
destroy () {
throw new Error('not implemented')
}
compose (...args) {
// So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ...
const interceptors = Array.isArray(args[0]) ? args[0] : args
// null disables origin-dependent interceptors; undefined uses opts.origin.
const interceptorOrigin = this[kOriginless] === true
? null
: this[kUrl]?.origin
let dispatch = this.dispatch.bind(this)
for (const interceptor of interceptors) {
if (interceptor == null) {
continue
}
if (typeof interceptor !== 'function') {
throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`)
}
dispatch = interceptor(dispatch, interceptorOrigin)
if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) {
throw new TypeError('invalid interceptor')
}
}
const originalDispatch = dispatch
const self = this
dispatch = function (opts, handler) {
if (opts && typeof opts === 'object' && !opts.origin && self[kUrl]) {
opts = Object.assign({}, opts, { origin: self[kUrl].origin })
}
return originalDispatch(opts, handler)
}
return new Proxy(this, {
get: (target, key) => key === 'dispatch' ? dispatch : target[key]
})
}
}
module.exports = Dispatcher
@@ -0,0 +1 @@
{"version":3,"file":"octagon-pause.js","sources":["../../../src/icons/octagon-pause.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name OctagonPause\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAgMTVWOSIgLz4KICA8cGF0aCBkPSJNMTQgMTVWOSIgLz4KICA8cGF0aCBkPSJNMi41ODYgMTYuNzI2QTIgMiAwIDAgMSAyIDE1LjMxMlY4LjY4OGEyIDIgMCAwIDEgLjU4Ni0xLjQxNGw0LjY4OC00LjY4OEEyIDIgMCAwIDEgOC42ODggMmg2LjYyNGEyIDIgMCAwIDEgMS40MTQuNTg2bDQuNjg4IDQuNjg4QTIgMiAwIDAgMSAyMiA4LjY4OHY2LjYyNGEyIDIgMCAwIDEtLjU4NiAxLjQxNGwtNC42ODggNC42ODhhMiAyIDAgMCAxLTEuNDE0LjU4Nkg4LjY4OGEyIDIgMCAwIDEtMS40MTQtLjU4NnoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/octagon-pause\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 OctagonPause = createLucideIcon('OctagonPause', [\n ['path', { d: 'M10 15V9', key: '1lckn7' }],\n ['path', { d: 'M14 15V9', key: '1muqhk' }],\n [\n 'path',\n {\n d: 'M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z',\n key: '2d38gg',\n },\n ],\n]);\n\nexport default OctagonPause;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,C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yBAAyB,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,CAAe;IAC1C,6EAA6E;IAC7E,kEAAkE;IAClE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;QAC1B,uCAAuC;QACvC,OAAO;KACR;IACD,IAAI,CAAC,CAAC,WAAW,KAAK,OAAO;QAAE,OAAO;IACtC,OAAO,CAAC,mBAAmB,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;QACnD,OAAO,OAAO,CAAC,mBAAmB,CAAC;QACnC,uCAAuC;QACvC,yBAAyB,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;IAC7C,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC","sourcesContent":["/**\n * touch.ts 12.6.0\n * Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license\n */\n\nimport { DDManager } from './dd-manager';\nimport { Utils } from './utils';\n\n/**\n * Detect touch support - Windows Surface devices and other touch devices\n * should we use this instead ? (what we had for always showing resize handles)\n * /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)\n */\nexport const isTouch: boolean = typeof window !== 'undefined' && typeof document !== 'undefined' &&\n ( 'ontouchstart' in document\n || 'ontouchstart' in window\n // || !!window.TouchEvent // true on Windows 10 Chrome desktop so don't use this\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n || ((window as any).DocumentTouch && document instanceof (window as any).DocumentTouch)\n || navigator.maxTouchPoints > 0\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n || (navigator as any).msMaxTouchPoints > 0\n );\n\n// interface TouchCoord {x: number, y: number};\n\nexport class DDTouch {\n /** set to true while we are handling touch dragging, to prevent accepting browser real mouse events (trusted:true) vs our simulated ones (trusted:false) */\n public static touchHandled: boolean;\n public static pointerLeaveTimeout: number;\n}\n\n/**\n* Get the x,y position of a touch event\n*/\n// function getTouchCoords(e: TouchEvent): TouchCoord {\n// return {\n// x: e.changedTouches[0].pageX,\n// y: e.changedTouches[0].pageY\n// };\n// }\n\n/**\n * Simulate a mouse event based on a corresponding touch event\n * @param {Object} e A touch event\n * @param {String} simulatedType The corresponding mouse event\n */\nfunction simulateMouseEvent(e: TouchEvent, simulatedType: string) {\n\n // Ignore multi-touch events\n if (e.touches.length > 1) return;\n\n // Prevent \"Ignored attempt to cancel a touchmove event with cancelable=false\" errors\n if (e.cancelable) e.preventDefault();\n\n // Dispatch the simulated event to the target element\n Utils.simulateMouseEvent(e.changedTouches[0], simulatedType);\n}\n\n/**\n * Simulate a mouse event based on a corresponding Pointer event\n * @param {Object} e A Line truncated
@@ -0,0 +1,12 @@
import { COMPOSED_HANDLER } from "./constants.js";
//#region src/utils/handler.ts
/**
* @module
* Handler utility.
*/
const isMiddleware = (handler) => handler.length > 1;
const findTargetHandler = (handler) => {
return handler["__COMPOSED_HANDLER"] ? findTargetHandler(handler[COMPOSED_HANDLER]) : handler;
};
//#endregion
export { findTargetHandler, isMiddleware };
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_YJ","2":"_yJ","194":"_hE"},D:{"1":"_mO","2":"_7N"},E:{"1":"XD","2":"_KI","322":"_zP RD _EE _OE"},F:{"1":"_bO","2":"_HP"},G:{"2":"_rJ","322":"_TD"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_U","2":"J"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"ME","2":"LE"}},B:5,C:"requestIdleCallback",D:true};
@@ -0,0 +1,13 @@
/**
* Experimental MCP SDK features.
* WARNING: These APIs are experimental and may change without notice.
*
* Import experimental features from this module:
* ```typescript
* import { TaskStore, InMemoryTaskStore } from '@modelcontextprotocol/sdk/experimental';
* ```
*
* @experimental
*/
export * from './tasks/index.js';
//# sourceMappingURL=index.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 Pencil = createLucideIcon("Pencil", [
[
"path",
{
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
key: "1a8usu"
}
],
["path", { d: "m15 5 4 4", key: "1mk7zo" }]
]);
export { Pencil as default };
//# sourceMappingURL=pencil.js.map
@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CAAC;AACpD,MAAM,CAAC,MAAM,mCAAmC,GAAG,YAAY,CAAC;AAChE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,uBAAuB,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AAE7H,MAAM,CAAC,MAAM,qBAAqB,GAAG,sCAAsC,CAAC;AAE5E,oBAAoB;AACpB,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AAMrC;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAS,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC;AAClI;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,CAA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BAAmB;AACnB;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACLine truncated
@@ -0,0 +1,174 @@
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
function normalizeWindowsPath(input = "") {
if (!input) {
return input;
}
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
}
const _UNC_REGEX = /^[/\\]{2}/;
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
const normalize = function(path) {
if (path.length === 0) {
return ".";
}
path = normalizeWindowsPath(path);
const isUNCPath = path.match(_UNC_REGEX);
const isPathAbsolute = isAbsolute(path);
const trailingSeparator = path[path.length - 1] === "/";
path = normalizeString(path, !isPathAbsolute);
if (path.length === 0) {
if (isPathAbsolute) {
return "/";
}
return trailingSeparator ? "./" : ".";
}
if (trailingSeparator) {
path += "/";
}
if (_DRIVE_LETTER_RE.test(path)) {
path += "/";
}
if (isUNCPath) {
if (!isPathAbsolute) {
return `//./${path}`;
}
return `//${path}`;
}
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
};
const join = function(...segments) {
let path = "";
for (const seg of segments) {
if (!seg) {
continue;
}
if (path.length > 0) {
const pathTrailing = path[path.length - 1] === "/";
const segLeading = seg[0] === "/";
const both = pathTrailing && segLeading;
if (both) {
path += seg.slice(1);
} else {
path += pathTrailing || segLeading ? seg : `/${seg}`;
}
} else {
path += seg;
}
}
return normalize(path);
};
function cwd() {
if (typeof process !== "undefined" && typeof process.cwd === "function") {
return process.cwd().replace(/\\/g, "/");
}
return "/";
}
const resolve = function(...arguments_) {
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
let resolvedPath = "";
let resolvedAbsolute = false;
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
const path = index >= 0 ? arguments_[index] : cwd();
if (!path || path.length === 0) {
continue;
}
resolvedPath = `${path}/${resolvedPath}`;
resolvedAbsolute = isAbsolute(path);
}
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
return `/${resolvedPath}`;
}
return resolvedPath.length > 0 ? resolvedPath : ".";
};
function normalizeString(path, allowAboveRoot) {
let res = "";
let lastSegmentLength = 0;
let lastSlash = -1;
let dots = 0;
let char = null;
for (let index = 0; index <= path.length; ++index) {
if (index < path.length) {
char = path[index];
} else if (char === "/") {
break;
} else {
char = "/";
}
if (char === "/") {
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
if (res.length > 2) {
const lastSlashIndex = res.lastIndexOf("/");
if (lastSlashIndex === -1) {
res = "";
lastSegmentLength = 0;
} else {
res = res.slice(0, lastSlashIndex);
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
}
lastSlash = index;
dots = 0;
continue;
} else if (res.length > 0) {
res = "";
lastSegmentLength = 0;
lastSlash = index;
dots = 0;
continue;
}
}
if (allowAboveRoot) {
res += res.length > 0 ? "/.." : "..";
lastSegmentLength = 2;
}
} else {
if (res.length > 0) {
res += `/${path.slice(lastSlash + 1, index)}`;
} else {
res = path.slice(lastSlash + 1, index);
}
lastSegmentLength = index - lastSlash - 1;
}
lastSlash = index;
dots = 0;
} else if (char === "." && dots !== -1) {
++dots;
} else {
dots = -1;
}
}
return res;
}
const isAbsolute = function(p) {
return _IS_ABSOLUTE_RE.test(p);
};
const extname = function(p) {
if (p === "..") return "";
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
return match && match[1] || "";
};
const dirname = function(p) {
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
segments[0] += "/";
}
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
};
const basename = function(p, extension) {
const segments = normalizeWindowsPath(p).split("/");
let lastSegment = "";
for (let i = segments.length - 1; i >= 0; i--) {
const val = segments[i];
if (val) {
lastSegment = val;
break;
}
}
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
};
export { basename as b, dirname as d, extname as e, isAbsolute as i, join as j, resolve as r };
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const scripthost: LibDefinition;
@@ -0,0 +1 @@
{"version":3,"file":"land-plot.js","sources":["../../../src/icons/land-plot.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name LandPlot\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTIgOCA2LTMtNi0zdjEwIiAvPgogIDxwYXRoIGQ9Im04IDExLjk5LTUuNSAzLjE0YTEgMSAwIDAgMCAwIDEuNzRsOC41IDQuODZhMiAyIDAgMCAwIDIgMGw4LjUtNC44NmExIDEgMCAwIDAgMC0xLjc0TDE2IDEyIiAvPgogIDxwYXRoIGQ9Im02LjQ5IDEyLjg1IDExLjAyIDYuMyIgLz4KICA8cGF0aCBkPSJNMTcuNTEgMTIuODUgNi41IDE5LjE1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/land-plot\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 LandPlot = createLucideIcon('LandPlot', [\n ['path', { d: 'm12 8 6-3-6-3v10', key: 'mvpnpy' }],\n [\n 'path',\n {\n d: 'm8 11.99-5.5 3.14a1 1 0 0 0 0 1.74l8.5 4.86a2 2 0 0 0 2 0l8.5-4.86a1 1 0 0 0 0-1.74L16 12',\n key: 'ek95tt',\n },\n ],\n ['path', { d: 'm6.49 12.85 11.02 6.3', key: '1kt42w' }],\n ['path', { d: 'M17.51 12.85 6.5 19.15', key: 'v55bdg' }],\n]);\n\nexport default LandPlot;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoB,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,CACjD,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,C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"},D:{"1":"_NF","129":"_iJ"},E:{"1":"_jB","129":"_wB ND","388":"_e"},F:{"1":"_oB","2":"F"},G:{"1":"_2","129":"_r"},H:{"1":"1D"},I:{"1":"_X","129":"_W"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"YC"},N:{"129":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:2,C:"CSS3 Media Queries",D:true};
@@ -0,0 +1,10 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"id-length": "off",
"sort-keys": "off",
},
}
@@ -0,0 +1 @@
{"version":3,"file":"wallet-2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,19 @@
import Pool from './pool'
export default PoolStats
declare class PoolStats {
constructor (pool: Pool)
/** Number of open socket connections in this pool. */
connected: number
/** Number of open socket connections in this pool that do not have an active request. */
free: number
/** Number of pending requests across all clients in this pool. */
pending: number
/** Number of queued requests across all clients in this pool. */
queued: number
/** Number of currently active requests across all clients in this pool. */
running: number
/** Number of active, pending, or queued requests across all clients in this pool. */
size: number
}
@@ -0,0 +1,272 @@
'use strict'
const { isUUID } = require('./utils')
const URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu
const supportedSchemeNames = /** @type {const} */ (['http', 'https', 'ws',
'wss', 'urn', 'urn:uuid'])
/** @typedef {supportedSchemeNames[number]} SchemeName */
/**
* @param {string} name
* @returns {name is SchemeName}
*/
function isValidSchemeName (name) {
return supportedSchemeNames.indexOf(/** @type {*} */ (name)) !== -1
}
/**
* @callback SchemeFn
* @param {import('../types/index').URIComponent} component
* @param {import('../types/index').Options} options
* @returns {import('../types/index').URIComponent}
*/
/**
* @typedef {Object} SchemeHandler
* @property {SchemeName} scheme - The scheme name.
* @property {boolean} [domainHost] - Indicates if the scheme supports domain hosts.
* @property {SchemeFn} parse - Function to parse the URI component for this scheme.
* @property {SchemeFn} serialize - Function to serialize the URI component for this scheme.
* @property {boolean} [skipNormalize] - Indicates if normalization should be skipped for this scheme.
* @property {boolean} [absolutePath] - Indicates if the scheme uses absolute paths.
* @property {boolean} [unicodeSupport] - Indicates if the scheme supports Unicode.
*/
/**
* @param {import('../types/index').URIComponent} wsComponent
* @returns {boolean}
*/
function wsIsSecure (wsComponent) {
if (wsComponent.secure === true) {
return true
} else if (wsComponent.secure === false) {
return false
} else if (wsComponent.scheme) {
return (
wsComponent.scheme.length === 3 &&
(wsComponent.scheme[0] === 'w' || wsComponent.scheme[0] === 'W') &&
(wsComponent.scheme[1] === 's' || wsComponent.scheme[1] === 'S') &&
(wsComponent.scheme[2] === 's' || wsComponent.scheme[2] === 'S')
)
} else {
return false
}
}
/** @type {SchemeFn} */
function httpParse (component) {
if (!component.host) {
component.error = component.error || 'HTTP URIs must have a host.'
}
return component
}
/** @type {SchemeFn} */
function httpSerialize (component) {
const secure = String(component.scheme).toLowerCase() === 'https'
// normalize the default port
if (component.port === (secure ? 443 : 80) || component.port === '') {
component.port = undefined
}
// normalize the empty path
if (!component.path) {
component.path = '/'
}
// NOTE: We do not parse query strings for HTTP URIs
// as WWW Form Url Encoded query strings are part of the HTML4+ spec,
// and not the HTTP spec.
return component
}
/** @type {SchemeFn} */
function wsParse (wsComponent) {
// indicate if the secure flag is set
wsComponent.secure = wsIsSecure(wsComponent)
// construct resouce name
wsComponent.resourceName = (wsComponent.path || '/') + (wsComponent.query ? '?' + wsComponent.query : '')
wsComponent.path = undefined
wsComponent.query = undefined
return wsComponent
}
/** @type {SchemeFn} */
function wsSerialize (wsComponent) {
// normalize the default port
if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === '') {
wsComponent.port = undefined
}
// ensure scheme matches secure flag
if (typeof wsComponent.secure === 'boolean') {
wsComponent.scheme = (wsComponent.secure ? 'wss' : 'ws')
wsComponent.secure = undefined
}
// reconstruct path from resource name
if (wsComponent.resourceName) {
const queryIndex = wsComponent.resourceName.indexOf('?')
const path = queryIndex === -1
? wsComponent.resourceName
: wsComponent.resourceName.slice(0, queryIndex)
wsComponent.path = (path && path !== '/' ? path : undefined)
wsComponent.query = queryIndex === -1
? undefined
: wsComponent.resourceName.slice(queryIndex + 1)
wsComponent.resourceName = undefined
}
// forbid fragment component
wsComponent.fragment = undefined
return wsComponent
}
/** @type {SchemeFn} */
function urnParse (urnComponent, options) {
if (!urnComponent.path) {
urnComponent.error = 'URN can not be parsed'
return urnComponent
}
const matches = urnComponent.path.match(URN_REG)
if (matches && matches[0] === urnComponent.path) {
const scheme = options.scheme || urnComponent.scheme || 'urn'
urnComponent.nid = matches[1].toLowerCase()
urnComponent.nss = matches[2]
const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`
const schemeHandler = getSchemeHandler(urnScheme)
urnComponent.path = undefined
if (schemeHandler) {
urnComponent = schemeHandler.parse(urnComponent, options)
}
} else {
urnComponent.error = urnComponent.error || 'URN can not be parsed.'
}
return urnComponent
}
/** @type {SchemeFn} */
function urnSerialize (urnComponent, options) {
if (urnComponent.nid === undefined) {
throw new Error('URN without nid cannot be serialized')
}
const scheme = options.scheme || urnComponent.scheme || 'urn'
const nid = urnComponent.nid.toLowerCase()
const urnScheme = `${scheme}:${options.nid || nid}`
const schemeHandler = getSchemeHandler(urnScheme)
if (schemeHandler) {
urnComponent = schemeHandler.serialize(urnComponent, options)
}
const uriComponent = urnComponent
const nss = urnComponent.nss
uriComponent.path = `${nid || options.nid}:${nss}`
options.skipEscape = true
return uriComponent
}
/** @type {SchemeFn} */
function urnuuidParse (urnComponent, options) {
const uuidComponent = urnComponent
uuidComponent.uuid = uuidComponent.nss
uuidComponent.nss = undefined
if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {
uuidComponent.error = uuidComponent.error || 'UUID is not valid.'
}
return uuidComponent
}
/** @type {SchemeFn} */
function urnuuidSerialize (uuidComponent) {
const urnComponent = uuidComponent
// normalize UUID
urnComponent.nss = (uuidComponent.uuid || '').toLowerCase()
return urnComponent
}
const http = /** @type {SchemeHandler} */ ({
scheme: 'http',
domainHost: true,
parse: httpParse,
serialize: httpSerialize
})
const https = /** @type {SchemeHandler} */ ({
scheme: 'https',
domainHost: http.domainHost,
parse: httpParse,
serialize: httpSerialize
})
const ws = /** @type {SchemeHandler} */ ({
scheme: 'ws',
domainHost: true,
parse: wsParse,
serialize: wsSerialize
})
const wss = /** @type {SchemeHandler} */ ({
scheme: 'wss',
domainHost: ws.domainHost,
parse: ws.parse,
serialize: ws.serialize
})
const urn = /** @type {SchemeHandler} */ ({
scheme: 'urn',
parse: urnParse,
serialize: urnSerialize,
skipNormalize: true
})
const urnuuid = /** @type {SchemeHandler} */ ({
scheme: 'urn:uuid',
parse: urnuuidParse,
serialize: urnuuidSerialize,
skipNormalize: true
})
const SCHEMES = /** @type {Record<SchemeName, SchemeHandler>} */ ({
http,
https,
ws,
wss,
urn,
'urn:uuid': urnuuid
})
Object.setPrototypeOf(SCHEMES, null)
/**
* @param {string|undefined} scheme
* @returns {SchemeHandler|undefined}
*/
function getSchemeHandler (scheme) {
return (
scheme && (
SCHEMES[/** @type {SchemeName} */ (scheme)] ||
SCHEMES[/** @type {SchemeName} */(scheme.toLowerCase())])
) ||
undefined
}
module.exports = {
wsIsSecure,
SCHEMES,
isValidSchemeName,
getSchemeHandler,
}
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Mathias Buus
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,23 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
interface Atomics {
/**
* Performs a finite-time microwait by signaling to the operating system or
* CPU that the current executing code is in a spin-wait loop.
*/
pause(n?: number): void;
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"BB _i","2":"_I","194":"_jG _UP AB","962":"0 _vH"},C:{"1":"_CH _ZF _p","2":"GD","516":"_PF c _CS _gE","772":"_2P _WB _MB b _L"},D:{"1":"BB _l","2":"_LE","194":"_UP AB","962":"_QC _mL _VC"},E:{"1":"_6D","2":"_cD","772":"_NH VD"},F:{"1":"_VN _h","2":"_QM","194":"_RQ _VM _AG","962":"QB _eG _HG _II l"},G:{"1":"_UE","2":"_YC","772":"_NH yD"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"2":"_N"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"2":"bC"},P:{"2":"_F"},Q:{"194":"JE"},R:{"2":"KE"},S:{"2":"LE","516":"ME"}},B:2,C:"CSS font-size-adjust",D:true};
@@ -0,0 +1,58 @@
import { F as FormatOptions } from './shared/confbox.9745c98f.mjs';
/**
* Converts a [JSON5](https://json5.org/) string into an object.
*
* @template T The type of the return value.
* @param text The string to parse as JSON5.
* @param options Parsing options.
* @returns The JavaScript value converted from the JSON5 string.
*/
declare function parseJSON5<T = unknown>(text: string, options?: JSON5ParseOptions): T;
/**
* Converts a JavaScript value to a [JSON5](https://json5.org/) string.
*
* @param value
* @param options
* @returns The JSON string converted from the JavaScript value.
*/
declare function stringifyJSON5(value: any, options?: JSON5StringifyOptions): string;
interface JSON5ParseOptions extends FormatOptions {
/**
* A function that alters the behavior of the parsing process, or an array of
* String and Number objects that serve as a allowlist for selecting/filtering
* the properties of the value object to be included in the resulting
* JavaScript object. If this value is null or not provided, all properties of
* the object are included in the resulting JavaScript object.
*/
reviver?: (this: any, key: string, value: any) => any;
}
interface JSON5StringifyOptions extends FormatOptions {
/**
* A function that alters the behavior of the stringification process, or an
* array of String and Number objects that serve as a allowlist for
* selecting/filtering the properties of the value object to be included in
* the JSON5 string. If this value is null or not provided, all properties
* of the object are included in the resulting JSON5 string.
*/
replacer?: ((this: any, key: string, value: any) => any) | null;
/**
* A String or Number object that's used to insert white space into the
* output JSON5 string for readability purposes. If this is a Number, it
* indicates the number of space characters to use as white space; this
* number is capped at 10 (if it is greater, the value is just 10). Values
* less than 1 indicate that no space should be used. If this is a String,
* the string (or the first 10 characters of the string, if it's longer than
* that) is used as white space. If this parameter is not provided (or is
* null), no white space is used. If white space is used, trailing commas
* will be used in objects and arrays.
*/
space?: string | number | null;
/**
* A String representing the quote character to use when serializing
* strings.
*/
quote?: string | null;
}
export { type JSON5ParseOptions, type JSON5StringifyOptions, parseJSON5, stringifyJSON5 };
@@ -0,0 +1,221 @@
/**
* @fileoverview Rule to disallow unsafe optional chaining
* @author Yeon JuAn
*/
"use strict";
const UNSAFE_ARITHMETIC_OPERATORS = new Set(["+", "-", "/", "*", "%", "**"]);
const UNSAFE_ASSIGNMENT_OPERATORS = new Set([
"+=",
"-=",
"/=",
"*=",
"%=",
"**=",
]);
const UNSAFE_RELATIONAL_OPERATORS = new Set(["in", "instanceof"]);
/**
* Checks whether a node is a destructuring pattern or not
* @param {ASTNode} node node to check
* @returns {boolean} `true` if a node is a destructuring pattern, otherwise `false`
*/
function isDestructuringPattern(node) {
return node.type === "ObjectPattern" || node.type === "ArrayPattern";
}
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
defaultOptions: [
{
disallowArithmeticOperators: false,
},
],
docs: {
description:
"Disallow use of optional chaining in contexts where the `undefined` value is not allowed",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining",
},
schema: [
{
type: "object",
properties: {
disallowArithmeticOperators: {
type: "boolean",
},
},
additionalProperties: false,
},
],
fixable: null,
messages: {
unsafeOptionalChain:
"Unsafe usage of optional chaining. If it short-circuits with 'undefined' the evaluation will throw TypeError.",
unsafeArithmetic:
"Unsafe arithmetic operation on optional chaining. It can result in NaN.",
},
},
create(context) {
const [{ disallowArithmeticOperators }] = context.options;
/**
* Reports unsafe usage of optional chaining
* @param {ASTNode} node node to report
* @returns {void}
*/
function reportUnsafeUsage(node) {
context.report({
messageId: "unsafeOptionalChain",
node,
});
}
/**
* Reports unsafe arithmetic operation on optional chaining
* @param {ASTNode} node node to report
* @returns {void}
*/
function reportUnsafeArithmetic(node) {
context.report({
messageId: "unsafeArithmetic",
node,
});
}
/**
* Checks and reports if a node can short-circuit with `undefined` by optional chaining.
* @param {ASTNode} [node] node to check
* @param {Function} reportFunc report function
* @returns {void}
*/
function checkUndefinedShortCircuit(node, reportFunc) {
if (!node) {
return;
}
switch (node.type) {
case "LogicalExpression":
if (node.operator === "||" || node.operator === "??") {
checkUndefinedShortCircuit(node.right, reportFunc);
} else if (node.operator === "&&") {
checkUndefinedShortCircuit(node.left, reportFunc);
checkUndefinedShortCircuit(node.right, reportFunc);
}
break;
case "SequenceExpression":
checkUndefinedShortCircuit(
node.expressions.at(-1),
reportFunc,
);
break;
case "ConditionalExpression":
checkUndefinedShortCircuit(node.consequent, reportFunc);
checkUndefinedShortCircuit(node.alternate, reportFunc);
break;
case "AwaitExpression":
checkUndefinedShortCircuit(node.argument, reportFunc);
break;
case "ChainExpression":
reportFunc(node);
break;
default:
break;
}
}
/**
* Checks unsafe usage of optional chaining
* @param {ASTNode} node node to check
* @returns {void}
*/
function checkUnsafeUsage(node) {
checkUndefinedShortCircuit(node, reportUnsafeUsage);
}
/**
* Checks unsafe arithmetic operations on optional chaining
* @param {ASTNode} node node to check
* @returns {void}
*/
function checkUnsafeArithmetic(node) {
checkUndefinedShortCircuit(node, reportUnsafeArithmetic);
}
return {
"AssignmentExpression, AssignmentPattern"(node) {
if (isDestructuringPattern(node.left)) {
checkUnsafeUsage(node.right);
}
},
"ClassDeclaration, ClassExpression"(node) {
checkUnsafeUsage(node.superClass);
},
CallExpression(node) {
if (!node.optional) {
checkUnsafeUsage(node.callee);
}
},
NewExpression(node) {
checkUnsafeUsage(node.callee);
},
VariableDeclarator(node) {
if (isDestructuringPattern(node.id)) {
checkUnsafeUsage(node.init);
}
},
MemberExpression(node) {
if (!node.optional) {
checkUnsafeUsage(node.object);
}
},
TaggedTemplateExpression(node) {
checkUnsafeUsage(node.tag);
},
ForOfStatement(node) {
checkUnsafeUsage(node.right);
},
SpreadElement(node) {
if (node.parent && node.parent.type !== "ObjectExpression") {
checkUnsafeUsage(node.argument);
}
},
BinaryExpression(node) {
if (UNSAFE_RELATIONAL_OPERATORS.has(node.operator)) {
checkUnsafeUsage(node.right);
}
if (
disallowArithmeticOperators &&
UNSAFE_ARITHMETIC_OPERATORS.has(node.operator)
) {
checkUnsafeArithmetic(node.right);
checkUnsafeArithmetic(node.left);
}
},
WithStatement(node) {
checkUnsafeUsage(node.object);
},
UnaryExpression(node) {
if (
disallowArithmeticOperators &&
UNSAFE_ARITHMETIC_OPERATORS.has(node.operator)
) {
checkUnsafeArithmetic(node.argument);
}
},
AssignmentExpression(node) {
if (
disallowArithmeticOperators &&
UNSAFE_ASSIGNMENT_OPERATORS.has(node.operator)
) {
checkUnsafeArithmetic(node.right);
}
},
};
},
};
@@ -0,0 +1,5 @@
import type { CodeKeywordDefinition, SchemaObject } from "../../types";
import { _JTDTypeError } from "./error";
export type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject>;
declare const def: CodeKeywordDefinition;
export default def;
@@ -0,0 +1,12 @@
/**
* Pipe
* Compose other transformers to run linearily
* pipe(min(20), max(40))
* @param {...functions} transformers
* @return {function}
*/
const combineFunctions = (a, b) => (v) => b(a(v));
const pipe = (...transformers) => transformers.reduce(combineFunctions);
export { pipe };
//# sourceMappingURL=pipe.mjs.map
@@ -0,0 +1,172 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const forEachBail = require("./forEachBail");
const { PathType, getType } = require("./util/path");
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/** @typedef {import("./Resolver").ResolveContext} ResolveContext */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
/** @typedef {import("./Resolver").ResolveCallback} ResolveCallback */
/** @typedef {string | string[] | false} Alias */
/** @typedef {{ alias: Alias, name: string, onlyModule?: boolean }} AliasOption */
/** @typedef {(err?: null | Error, result?: null | ResolveRequest) => void} InnerCallback */
/**
* @param {Resolver} resolver resolver
* @param {AliasOption[]} options options
* @param {ResolveStepHook} target target
* @param {ResolveRequest} request request
* @param {ResolveContext} resolveContext resolve context
* @param {InnerCallback} callback callback
* @returns {void}
*/
function aliasResolveHandler(
resolver,
options,
target,
request,
resolveContext,
callback,
) {
const innerRequest = request.request || request.path;
if (!innerRequest) return callback();
/**
* @param {string} maybeAbsolutePath path
* @returns {null | string} absolute path with slash ending
*/
const getAbsolutePathWithSlashEnding = (maybeAbsolutePath) => {
const type = getType(maybeAbsolutePath);
if (type === PathType.AbsolutePosix || type === PathType.AbsoluteWin) {
return resolver.join(maybeAbsolutePath, "_").slice(0, -1);
}
return null;
};
/**
* @param {string} path path
* @param {string} maybeSubPath sub path
* @returns {boolean} true, if path is sub path
*/
const isSubPath = (path, maybeSubPath) => {
const absolutePath = getAbsolutePathWithSlashEnding(maybeSubPath);
if (!absolutePath) return false;
return path.startsWith(absolutePath);
};
forEachBail(
options,
(item, callback) => {
/** @type {boolean} */
let shouldStop = false;
const matchRequest =
innerRequest === item.name ||
(!item.onlyModule &&
(request.request
? innerRequest.startsWith(`${item.name}/`)
: isSubPath(innerRequest, item.name)));
const splitName = item.name.split("*");
const matchWildcard = !item.onlyModule && splitName.length === 2;
if (matchRequest || matchWildcard) {
/**
* @param {Alias} alias alias
* @param {(err?: null | Error, result?: null | ResolveRequest) => void} callback callback
* @returns {void}
*/
const resolveWithAlias = (alias, callback) => {
if (alias === false) {
/** @type {ResolveRequest} */
const ignoreObj = {
...request,
path: false,
};
if (typeof resolveContext.yield === "function") {
resolveContext.yield(ignoreObj);
return callback(null, null);
}
return callback(null, ignoreObj);
}
let newRequestStr;
const [prefix, suffix] = splitName;
if (
matchWildcard &&
innerRequest.startsWith(prefix) &&
innerRequest.endsWith(suffix)
) {
const match = innerRequest.slice(
prefix.length,
innerRequest.length - suffix.length,
);
newRequestStr = alias.toString().replace("*", match);
}
if (
matchRequest &&
innerRequest !== alias &&
!innerRequest.startsWith(`${alias}/`)
) {
/** @type {string} */
const remainingRequest = innerRequest.slice(item.name.length);
newRequestStr = alias + remainingRequest;
}
if (newRequestStr !== undefined) {
shouldStop = true;
/** @type {ResolveRequest} */
const obj = {
...request,
request: newRequestStr,
fullySpecified: false,
};
return resolver.doResolve(
target,
obj,
`aliased with mapping '${item.name}': '${alias}' to '${newRequestStr}'`,
resolveContext,
(err, result) => {
if (err) return callback(err);
if (result) return callback(null, result);
return callback();
},
);
}
return callback();
};
/**
* @param {(null | Error)=} err error
* @param {(null | ResolveRequest)=} result result
* @returns {void}
*/
const stoppingCallback = (err, result) => {
if (err) return callback(err);
if (result) return callback(null, result);
// Don't allow other aliasing or raw request
if (shouldStop) return callback(null, null);
return callback();
};
if (Array.isArray(item.alias)) {
return forEachBail(item.alias, resolveWithAlias, stoppingCallback);
}
return resolveWithAlias(item.alias, stoppingCallback);
}
return callback();
},
callback,
);
}
module.exports.aliasResolveHandler = aliasResolveHandler;
@@ -0,0 +1,24 @@
export default {
a: ['4', '@'],
b: ['8'],
c: ['(', '{', '[', '<'],
d: ['6', '|)'],
e: ['3'],
f: ['#'],
g: ['6', '9', '&'],
h: ['#', '|-|'],
i: ['1', '!', '|'],
k: ['<', '|<'],
l: ['!', '1', '|', '7'],
m: ['^^', 'nn', '2n', '/\\\\/\\\\'],
n: ['//'],
o: ['0', '()'],
q: ['9'],
u: ['|_|'],
s: ['$', '5'],
t: ['+', '7'],
v: ['<', '>', '/'],
w: ['^/', 'uu', 'vv', '2u', '2v', '\\\\/\\\\/'],
x: ['%', '><'],
z: ['2'],
}
@@ -0,0 +1 @@
{"version":3,"names":["_shallowEqual","require","_isType","_isPlaceholderType","_index","is","type","node","opts","matches","isType","FLIPPED_ALIAS_KEYS","isPlaceholderType","expectedNode","undefined","shallowEqual"],"sources":["../../src/validators/is.ts"],"sourcesContent":["import shallowEqual from \"../utils/shallowEqual.ts\";\nimport isType from \"./isType.ts\";\nimport isPlaceholderType from \"./isPlaceholderType.ts\";\nimport { FLIPPED_ALIAS_KEYS } from \"../definitions/index.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function is<T extends t.Node[\"type\"]>(\n type: T,\n node: t.Node | null | undefined,\n opts?: undefined,\n): node is Extract<t.Node, { type: T }>;\n\nexport default function is<\n T extends t.Node[\"type\"],\n P extends Extract<t.Node, { type: T }>,\n>(type: T, n: t.Node | null | undefined, required: Partial<P>): n is P;\n\nexport default function is<P extends t.Node>(\n type: string,\n node: t.Node | null | undefined,\n opts: Partial<P>,\n): node is P;\n\nexport default function is(\n type: string,\n node: t.Node | null | undefined,\n opts?: Partial<t.Node>,\n): node is t.Node;\n/**\n * Returns whether `node` is of given `type`.\n *\n * For better performance, use this instead of `is[Type]` when `type` is unknown.\n */\nexport default function is(\n type: string,\n node: t.Node | null | undefined,\n opts?: Partial<t.Node>,\n): node is t.Node {\n if (!node) return false;\n\n const matches = isType(node.type, type);\n if (!matches) {\n if (!opts && node.type === \"Placeholder\" && type in FLIPPED_ALIAS_KEYS) {\n // We can only return true if the placeholder doesn't replace a real node,\n // but it replaces a category of nodes (an alias).\n //\n // t.is(\"Identifier\", node) gives some guarantees about node's shape, so we\n // can't say that Placeholder(expectedNode: \"Identifier\") is an identifier\n // because it doesn't have the same properties.\n // On the other hand, t.is(\"Expression\", node) doesn't say anything about\n // the shape of node because Expression can be many different nodes: we can,\n // and should, safely report expression placeholders as Expressions.\n return isPlaceholderType(node.expectedNode, type);\n }\n return false;\n }\n\n if (opts === undefined) {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AA8Be,SAASI,EAAEA,CACxBC,IAAY,EACZC,IAA+B,EAC/BC,IAAsB,EACN;EAChB,IAAI,CAACD,IAAI,EAAE,OAAO,KAAK;EAEvB,MAAME,OAAO,GAAG,IAAAC,eAAM,EAACH,IAAI,CAACD,IAAI,EAAEA,IAAI,CAAC;EACvC,IAAI,CAACG,OAAO,EAAE;IACZ,IAAI,CAACD,IAAI,IAAID,IAAI,CAACD,IAAI,KAAK,aAAa,IAAIA,IAAI,IAAIK,yBAAkB,EAAE;MAUtE,OAAO,IAAAC,0BAAiB,EAACL,IAAI,CAACM,YAAY,EAAEP,IAAI,CAAC;IACnD;IACA,OAAO,KAAK;EACd;EAEA,IAAIE,IAAI,KAAKM,SAAS,EAAE;IACtB,OAAO,IAAI;EACb,CAAC,MAAM;IACL,OAAO,IAAAC,qBAAY,EAACR,IAAI,EAAEC,IAAI,CAAC;EACjC;AACF","ignoreList":[]}
@@ -0,0 +1,843 @@
// @flow
type Exclude<A, B> = A;
// see https://gist.github.com/thecotne/6e5969f4aaf8f253985ed36b30ac9fe0
type $FlowGen$If<X: boolean, Then, Else = empty> = $Call<
((true, Then, Else) => Then) & ((false, Then, Else) => Else),
X,
Then,
Else
>;
type $FlowGen$Assignable<A, B> = $Call<
((...r: [B]) => true) & ((...r: [A]) => false),
A
>;
import type {
Angle,
CssColor,
Rule,
CustomProperty,
EnvironmentVariable,
Function,
Image,
LengthValue,
MediaQuery,
Declaration,
Ratio,
Resolution,
Selector,
SupportsCondition,
Time,
Token,
TokenOrValue,
UnknownAtRule,
Url,
Variable,
StyleRule,
DeclarationBlock,
ParsedComponent,
Multiplier,
StyleSheet,
Location2,
} from "./ast.js.flow";
import { Targets, Features } from "./targets.js.flow";
declare export * from "./ast.js.flow";
declare export { Targets, Features };
export type TransformOptions<C: CustomAtRules> = {|
/**
* The filename being transformed. Used for error messages and source maps.
*/
filename: string,
/**
* The source code to transform.
*/
code: Uint8Array,
/**
* Whether to enable minification.
*/
minify?: boolean,
/**
* Whether to output a source map.
*/
sourceMap?: boolean,
/**
* An input source map to extend.
*/
inputSourceMap?: string,
/**
* An optional project root path, used as the source root in the output source map.
* Also used to generate relative paths for sources used in CSS module hashes.
*/
projectRoot?: string,
/**
* The browser targets for the generated code.
*/
targets?: Targets,
/**
* Features that should always be compiled, even when supported by targets.
*/
include?: number,
/**
* Features that should never be compiled, even when unsupported by targets.
*/
exclude?: number,
/**
* Whether to enable parsing various draft syntax.
*/
drafts?: Drafts,
/**
* Whether to enable various non-standard syntax.
*/
nonStandard?: NonStandard,
/**
* Whether to compile this file as a CSS module.
*/
cssModules?: boolean | CSSModulesConfig,
/**
* Whether to analyze dependencies (e.g. string).
* When enabled, string dependencies
* are replaced with hashed placeholders that can be replaced with the final
* urls later (after bundling). Dependencies are returned as part of the result.
*/
analyzeDependencies?: boolean | DependencyOptions,
/**
* Replaces user action pseudo classes with class names that can be applied from JavaScript.
* This is useful for polyfills, for example.
*/
pseudoClasses?: PseudoClasses,
/**
* A list of class names, ids, and custom identifiers (e.g. @keyframes) that are known
* to be unused. These will be removed during minification. Note that these are not
* selectors but individual names (without any . or # prefixes).
*/
unusedSymbols?: string[],
/**
* Whether to ignore invalid rules and declarations rather than erroring.
* When enabled, warnings are returned, and the invalid rule or declaration is
* omitted from the output code.
*/
errorRecovery?: boolean,
/**
* An AST visitor object. This allows custom transforms or analysis to be implemented in JavaScript.
* Multiple visitors can be composed into one using the string function.
* For optimal performance, visitors should be as specific as possible about what types of values
* they care about so that JavaScript has to be called as little as possible.
*/
visitor?: Visitor<C> | VisitorFunction<C>,
/**
* Defines how to parse custom CSS at-rules. Each at-rule can have a prelude, defined using a CSS
* [syntax string](https://drafts.css-houdini.org/css-properties-values-api/#syntax-strings), and
* a block body. The body can be a declaration list, rule list, or style block as defined in the
* [css spec](https://drafts.csswg.org/css-syntax/#declaration-rule-list).
*/
customAtRules?: C,
|};
declare type PropertyStart =
| "-"
| "_"
| "a"
| "b"
| "c"
| "d"
| "e"
| "f"
| "g"
| "h"
| "i"
| "j"
| "k"
| "l"
| "m"
| "n"
| "o"
| "p"
| "q"
| "r"
| "s"
| "t"
| "u"
| "v"
| "w"
| "x"
| "y"
| "z";
export type ReturnedDeclaration =
| Declaration
| {|
/**
* The property name.
*/
property: string,
/**
* The raw string value for the declaration.
*/
raw: string,
|};
export type ReturnedMediaQuery =
| MediaQuery
| {|
/**
* The raw string value for the media query.
*/
raw: string,
|};
declare type FindByType<Union, Name> = $FlowGen$If<
$FlowGen$Assignable<
Union,
{|
type: Name,
|}
>,
Union,
empty
>;
export type ReturnedRule = Rule<ReturnedDeclaration, ReturnedMediaQuery>;
declare type RequiredValue<Rule> = $FlowGen$If<
$FlowGen$Assignable<
Rule,
{|
value: { [key: string]: any },
|}
>,
$FlowGen$If<
$FlowGen$Assignable<$PropertyType<Rule, "value">, StyleRule>,
{|
...Rule,
...{|
value: {|
...Required<StyleRule>,
...{|
declarations: Required<DeclarationBlock>,
|},
|},
|},
|},
{|
...Rule,
...{|
value: Required<$PropertyType<Rule, "value">>,
|},
|}
>,
Rule
>;
declare type RuleVisitor<R = RequiredValue<Rule>> = (
rule: R
) => ReturnedRule | ReturnedRule[] | void;
declare type MappedRuleVisitors = $ObjMapi<
{ [k: Exclude<$PropertyType<Rule, "type">, "unknown" | "custom">]: any },
<Name>(Name) => RuleVisitor<RequiredValue<FindByType<Rule, Name>>>
>;
declare type UnknownVisitors<T> = {
[name: string]: RuleVisitor<T>,
};
declare type CustomVisitors<T: CustomAtRules> = $ObjMapi<
T,
<Name>(Name) => RuleVisitor<CustomAtRule<Name, $ElementType<T, Name>>>
>;
declare type AnyCustomAtRule<C: CustomAtRules> = $ElementType<
$ObjMapi<C, <Key>(Key) => CustomAtRule<Key, $ElementType<C, Key>>>,
$Keys<C>
>;
declare type RuleVisitors<C: CustomAtRules> = {|
...MappedRuleVisitors,
...{|
unknown?:
| UnknownVisitors<UnknownAtRule>
| $Diff<
RuleVisitor<UnknownAtRule>,
{ [key: $Keys<CallableFunction>]: any }
>,
custom?:
| CustomVisitors<C>
| $Diff<
RuleVisitor<AnyCustomAtRule<C>>,
{ [key: $Keys<CallableFunction>]: any }
>,
|},
|};
declare type PreludeTypes = Exclude<
$PropertyType<ParsedComponent, "type">,
"literal" | "repeated" | "token"
>;
declare type SyntaxString = string | string;
declare type ComponentTypes = $ObjMapi<
{ [k: PreludeTypes]: any },
<Key>(Key) => FindByType<ParsedComponent, Key>
>;
declare type Repetitions = $ObjMapi<
{ [k: PreludeTypes]: any },
<Key>(Key) => {|
type: "repeated",
value: {|
components: FindByType<ParsedComponent, Key>[],
multiplier: Multiplier,
|},
|}
>;
declare type MappedPrelude = {| ...ComponentTypes, ...Repetitions |};
declare type MappedBody<P: $PropertyType<CustomAtRuleDefinition, "body">> =
$FlowGen$If<$FlowGen$Assignable<P, "style-block">, "rule-list", P>;
declare type CustomAtRule<N, R: CustomAtRuleDefinition> = {|
name: N,
prelude: $FlowGen$If<
$FlowGen$Assignable<$PropertyType<R, "prelude">, $Keys<MappedPrelude>>,
$ElementType<MappedPrelude, $PropertyType<R, "prelude">>,
ParsedComponent
>,
body: FindByType<CustomAtRuleBody, MappedBody<$PropertyType<R, "body">>>,
loc: Location2,
|};
declare type CustomAtRuleBody =
| {|
type: "declaration-list",
value: Required<DeclarationBlock>,
|}
| {|
type: "rule-list",
value: RequiredValue<Rule>[],
|};
declare type FindProperty<Union, Name> = $FlowGen$If<
$FlowGen$Assignable<
Union,
{|
property: Name,
|}
>,
Union,
empty
>;
declare type DeclarationVisitor<P = Declaration> = (
property: P
) => ReturnedDeclaration | ReturnedDeclaration[] | void;
declare type MappedDeclarationVisitors = $ObjMapi<
{
[k: Exclude<
$PropertyType<Declaration, "property">,
"unparsed" | "custom"
>]: any,
},
<Name>(
Name
) => DeclarationVisitor<
FindProperty<Declaration, Name> | FindProperty<Declaration, "unparsed">
>
>;
declare type CustomPropertyVisitors = {
[name: string]: DeclarationVisitor<CustomProperty>,
};
declare type DeclarationVisitors = {|
...MappedDeclarationVisitors,
...{|
custom?: CustomPropertyVisitors | DeclarationVisitor<CustomProperty>,
|},
|};
declare type RawValue = {|
/**
* A raw string value which will be parsed like CSS.
*/
raw: string,
|};
declare type TokenReturnValue = TokenOrValue | TokenOrValue[] | RawValue | void;
declare type TokenVisitor = (token: Token) => TokenReturnValue;
declare type VisitableTokenTypes =
| "ident"
| "at-keyword"
| "hash"
| "id-hash"
| "string"
| "number"
| "percentage"
| "dimension";
declare type TokenVisitors = $ObjMapi<
{ [k: VisitableTokenTypes]: any },
<Name>(Name) => (token: FindByType<Token, Name>) => TokenReturnValue
>;
declare type FunctionVisitor = (fn: Function) => TokenReturnValue;
declare type EnvironmentVariableVisitor = (
env: EnvironmentVariable
) => TokenReturnValue;
declare type EnvironmentVariableVisitors = {
[name: string]: EnvironmentVariableVisitor,
};
export type Visitor<C: CustomAtRules> = {|
StyleSheet?: (
stylesheet: StyleSheet
) => StyleSheet<ReturnedDeclaration, ReturnedMediaQuery> | void,
StyleSheetExit?: (
stylesheet: StyleSheet
) => StyleSheet<ReturnedDeclaration, ReturnedMediaQuery> | void,
Rule?: RuleVisitor<> | RuleVisitors<C>,
RuleExit?: RuleVisitor<> | RuleVisitors<C>,
Declaration?: DeclarationVisitor<> | DeclarationVisitors,
DeclarationExit?: DeclarationVisitor<> | DeclarationVisitors,
Url?: (url: Url) => Url | void,
Color?: (color: CssColor) => CssColor | void,
Image?: (image: Image) => Image | void,
ImageExit?: (image: Image) => Image | void,
Length?: (length: LengthValue) => LengthValue | void,
Angle?: (angle: Angle) => Angle | void,
Ratio?: (ratio: Ratio) => Ratio | void,
Resolution?: (resolution: Resolution) => Resolution | void,
Time?: (time: Time) => Time | void,
CustomIdent?: (ident: string) => string | void,
DashedIdent?: (ident: string) => string | void,
MediaQuery?: (
query: MediaQuery
) => ReturnedMediaQuery | ReturnedMediaQuery[] | void,
MediaQueryExit?: (
query: MediaQuery
) => ReturnedMediaQuery | ReturnedMediaQuery[] | void,
SupportsCondition?: (condition: SupportsCondition) => SupportsCondition,
SupportsConditionExit?: (condition: SupportsCondition) => SupportsCondition,
Selector?: (selector: Selector) => Selector | Selector[] | void,
Token?: TokenVisitor | TokenVisitors,
Function?:
| FunctionVisitor
| {
[name: string]: FunctionVisitor,
},
FunctionExit?:
| FunctionVisitor
| {
[name: string]: FunctionVisitor,
},
Variable?: (variable: Variable) => TokenReturnValue,
VariableExit?: (variable: Variable) => TokenReturnValue,
EnvironmentVariable?:
| EnvironmentVariableVisitor
| EnvironmentVariableVisitors,
EnvironmentVariableExit?:
| EnvironmentVariableVisitor
| EnvironmentVariableVisitors,
|};
export type VisitorDependency = FileDependency | GlobDependency;
export type VisitorOptions = {|
addDependency: (dep: VisitorDependency) => void,
|};
export type VisitorFunction<C: CustomAtRules> = (
options: VisitorOptions
) => Visitor<C>;
export type CustomAtRules = {|
[name: string]: CustomAtRuleDefinition,
|};
export type CustomAtRuleDefinition = {|
/**
* Defines the syntax for a custom at-rule prelude. The value should be a
* CSS [syntax string](https://drafts.css-houdini.org/css-properties-values-api/#syntax-strings)
* representing the types of values that are accepted. This property may be omitted or
* set to null to indicate that no prelude is accepted.
*/
prelude?: SyntaxString | null,
/**
* Defines the type of body contained within the at-rule block.
* - declaration-list: A CSS declaration list, as in a style rule.
* - rule-list: A list of CSS rules, as supported within a non-nested
* at-rule such as string.
* - style-block: Both a declaration list and rule list, as accepted within
* a nested at-rule within a style rule (e.g. string inside a style rule
* with directly nested declarations).
*/
body?: "declaration-list" | "rule-list" | "style-block" | null,
|};
export type DependencyOptions = {|
/**
* Whether to preserve string rules rather than removing them.
*/
preserveImports?: boolean,
|};
export type BundleOptions<C: CustomAtRules> = $Diff<
TransformOptions<C>,
{| code: any |}
>;
export type BundleAsyncOptions<C: CustomAtRules> = {|
...$Exact<BundleOptions<C>>,
resolver?: Resolver,
|};
/**
* Custom resolver to use when loading CSS files.
*/
export type Resolver = {|
/**
* Read the given file and return its contents as a string.
*/
read?: (file: string) => string | Promise<string>,
/**
* Resolve the given CSS import specifier from the provided originating file to a
* path which gets passed to string.
*/
resolve?: (
specifier: string,
originatingFile: string
) => string | Promise<string>,
|};
export type Drafts = {|
/**
* Whether to enable @custom-media rules.
*/
customMedia?: boolean,
|};
export type NonStandard = {|
/**
* Whether to enable the non-standard >>> and /deep/ selector combinators used by Angular and Vue.
*/
deepSelectorCombinator?: boolean,
|};
export type PseudoClasses = {|
hover?: string,
active?: string,
focus?: string,
focusVisible?: string,
focusWithin?: string,
|};
export type TransformResult = {|
/**
* The transformed code.
*/
code: Uint8Array,
/**
* The generated source map, if enabled.
*/
map: Uint8Array | void,
/**
* CSS module exports, if enabled.
*/
exports: CSSModuleExports | void,
/**
* CSS module references, if string is enabled.
*/
references: CSSModuleReferences,
/**
* string dependencies, if enabled.
*/
dependencies: Dependency[] | void,
/**
* Warnings that occurred during compilation.
*/
warnings: Warning[],
|};
export type Warning = {|
message: string,
type: string,
value?: any,
loc: ErrorLocation,
|};
export type CSSModulesConfig = {|
/**
* The pattern to use when renaming class names and other identifiers. Default is string.
*/
pattern?: string,
/**
* Whether to rename dashed identifiers, e.g. custom properties.
*/
dashedIdents?: boolean,
/**
* Whether to enable hashing for string.
*/
animation?: boolean,
/**
* Whether to enable hashing for CSS grid identifiers.
*/
grid?: boolean,
/**
* Whether to enable hashing for string names.
*/
container?: boolean,
/**
* Whether to enable hashing for custom identifiers.
*/
customIdents?: boolean,
/**
* Whether to require at least one class or id selector in each rule.
*/
pure?: boolean,
|};
export type CSSModuleExports = {
/**
* Maps exported (i.e. original) names to local names.
*/
[name: string]: CSSModuleExport,
};
export type CSSModuleExport = {|
/**
* The local (compiled) name for this export.
*/
name: string,
/**
* Whether the export is referenced in this file.
*/
isReferenced: boolean,
/**
* Other names that are composed by this export.
*/
composes: CSSModuleReference[],
|};
export type CSSModuleReferences = {
/**
* Maps placeholder names to references.
*/
[name: string]: DependencyCSSModuleReference,
};
export type CSSModuleReference =
| LocalCSSModuleReference
| GlobalCSSModuleReference
| DependencyCSSModuleReference;
export type LocalCSSModuleReference = {|
type: "local",
/**
* The local (compiled) name for the reference.
*/
name: string,
|};
export type GlobalCSSModuleReference = {|
type: "global",
/**
* The referenced global name.
*/
name: string,
|};
export type DependencyCSSModuleReference = {|
type: "dependency",
/**
* The name to reference within the dependency.
*/
name: string,
/**
* The dependency specifier for the referenced file.
*/
specifier: string,
|};
export type Dependency =
| ImportDependency
| UrlDependency
| FileDependency
| GlobDependency;
export type ImportDependency = {|
type: "import",
/**
* The url of the string dependency.
*/
url: string,
/**
* The media query for the string rule.
*/
media: string | null,
/**
* The string rule.
*/
supports: string | null,
/**
* The source location where the string rule was found.
*/
loc: SourceLocation,
/**
* The placeholder that the import was replaced with.
*/
placeholder: string,
|};
export type UrlDependency = {|
type: "url",
/**
* The url of the dependency.
*/
url: string,
/**
* The source location where the string was found.
*/
loc: SourceLocation,
/**
* The placeholder that the url was replaced with.
*/
placeholder: string,
|};
export type FileDependency = {|
type: "file",
filePath: string,
|};
export type GlobDependency = {|
type: "glob",
glob: string,
|};
export type SourceLocation = {|
/**
* The file path in which the dependency exists.
*/
filePath: string,
/**
* The start location of the dependency.
*/
start: Location,
/**
* The end location (inclusive) of the dependency.
*/
end: Location,
|};
export type Location = {|
/**
* The line number (1-based).
*/
line: number,
/**
* The column number (0-based).
*/
column: number,
|};
export type ErrorLocation = {|
...$Exact<Location>,
filename: string,
|};
/**
* Compiles a CSS file, including optionally minifying and lowering syntax to the given
* targets. A source map may also be generated, but this is not enabled by default.
*/
declare export function transform<C: CustomAtRules>(
options: TransformOptions<C>
): TransformResult;
export type TransformAttributeOptions = {|
/**
* The filename in which the style attribute appeared. Used for error messages and dependencies.
*/
filename?: string,
/**
* The source code to transform.
*/
code: Uint8Array,
/**
* Whether to enable minification.
*/
minify?: boolean,
/**
* The browser targets for the generated code.
*/
targets?: Targets,
/**
* Whether to analyze string dependencies.
* When enabled, string dependencies are replaced with hashed placeholders
* that can be replaced with the final urls later (after bundling).
* Dependencies are returned as part of the result.
*/
analyzeDependencies?: boolean,
/**
* Whether to ignore invalid rules and declarations rather than erroring.
* When enabled, warnings are returned, and the invalid rule or declaration is
* omitted from the output code.
*/
errorRecovery?: boolean,
/**
* An AST visitor object. This allows custom transforms or analysis to be implemented in JavaScript.
* Multiple visitors can be composed into one using the string function.
* For optimal performance, visitors should be as specific as possible about what types of values
* they care about so that JavaScript has to be called as little as possible.
*/
visitor?: Visitor<empty> | VisitorFunction<empty>,
|};
export type TransformAttributeResult = {|
/**
* The transformed code.
*/
code: Uint8Array,
/**
* string dependencies, if enabled.
*/
dependencies: Dependency[] | void,
/**
* Warnings that occurred during compilation.
*/
warnings: Warning[],
|};
/**
* Compiles a single CSS declaration list, such as an inline style attribute in HTML.
*/
declare export function transformStyleAttribute(
options: TransformAttributeOptions
): TransformAttributeResult;
/**
* Converts a browserslist result into targets that can be passed to lightningcss.
* @param browserslist the result of calling string
*/
declare export function browserslistToTargets(browserslist: string[]): Targets;
/**
* Bundles a CSS file and its dependencies, inlining @import rules.
*/
declare export function bundle<C: CustomAtRules>(
options: BundleOptions<C>
): TransformResult;
/**
* Bundles a CSS file and its dependencies asynchronously, inlining @import rules.
*/
declare export function bundleAsync<C: CustomAtRules>(
options: BundleAsyncOptions<C>
): Promise<TransformResult>;
/**
* Composes multiple visitor objects into a single one.
*/
declare export function composeVisitors<C: CustomAtRules>(
visitors: (Visitor<C> | VisitorFunction<C>)[]
): Visitor<C> | VisitorFunction<C>;
@@ -0,0 +1,12 @@
import type { AnySchema, AnySchemaObject, UriResolver } from "../types";
import type Ajv from "../ajv";
import type { URIComponent } from "fast-uri";
export type LocalRefs = {
[Ref in string]?: AnySchemaObject;
};
export declare function inlineRef(schema: AnySchema, limit?: boolean | number): boolean;
export declare function getFullPath(resolver: UriResolver, id?: string, normalize?: boolean): string;
export declare function _getFullPath(resolver: UriResolver, p: URIComponent): string;
export declare function normalizeId(id: string | undefined): string;
export declare function resolveUrl(resolver: UriResolver, baseId: string, id: string): string;
export declare function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): LocalRefs;
@@ -0,0 +1,19 @@
//#region src/utils/buffer.d.ts
/**
* @module
* Buffer utility.
*/
export declare const equal: (a: ArrayBuffer, b: ArrayBuffer) => boolean;
type StringHashFunction = (input: string) => string | null | Promise<string | null>;
type TimingSafeEqual = {
(a: string, b: string, hashFunction?: StringHashFunction): Promise<boolean>;
/**
* @deprecated object and boolean signatures that take boolean as first and second arguments, and functions with signatures that take non-string arguments have been deprecated
*/
(a: string | object | boolean, b: string | object | boolean, hashFunction?: Function): Promise<boolean>;
};
export declare const timingSafeEqual: TimingSafeEqual;
export declare const bufferToString: (buffer: ArrayBuffer) => string;
export declare const bufferToFormData: (arrayBuffer: ArrayBuffer, contentType: string) => Promise<FormData>;
//#endregion
export {};
@@ -0,0 +1,47 @@
interface PatternMatcher {
/**
* Replace all matched parts by a given replacer.
*
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#matcher-symbol-replace}
* @example
* const { PatternMatcher } = require("eslint-utils")
* const matcher = new PatternMatcher(/\\p{Script=Greek}/g)
*
* module.exports = {
* meta: {},
* create(context) {
* return {
* "Literal[regex]"(node) {
* const replacedPattern = node.regex.pattern.replace(
* matcher,
* "[\\u0370-\\u0373\\u0375-\\u0377\\u037A-\\u037D\\u037F\\u0384\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03E1\\u03F0-\\u03FF\\u1D26-\\u1D2A\\u1D5D-\\u1D61\\u1D66-\\u1D6A\\u1DBF\\u1F00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FC4\\u1FC6-\\u1FD3\\u1FD6-\\u1FDB\\u1FDD-\\u1FEF\\u1FF2-\\u1FF4\\u1FF6-\\u1FFE\\u2126\\uAB65]|\\uD800[\\uDD40-\\uDD8E\\uDDA0]|\\uD834[\\uDE00-\\uDE45]"
* )
* },
* }
* },
* }
*/
[Symbol.replace](str: string, replacer: string | ((...strs: string[]) => string)): string;
/**
* Iterate all matched parts in a given string.
*
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#matcher-execall}
*/
execAll(str: string): IterableIterator<RegExpExecArray>;
/**
* Check whether this pattern matches a given string or not.
*
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#matcher-test}
*/
test(str: string): boolean;
}
/**
* The class to find a pattern in strings as handling escape sequences.
* It ignores the found pattern if it's escaped with `\`.
*
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#patternmatcher-class}
*/
export declare const PatternMatcher: new (pattern: RegExp, options?: {
escaped?: boolean;
}) => PatternMatcher;
export {};
@@ -0,0 +1,50 @@
import { expect, test } from "vitest";
import type { StandardSchemaWithJSON } from "../../core/standard-schema.js";
import * as z from "../index.js";
function acceptSchema(schema: StandardSchemaWithJSON) {
return schema;
}
test("Zod Mini schemas are NOT assignable to StandardJSONSchema", () => {
const schema = z.string();
// @ts-expect-error
const _standard: StandardSchemaWithJSON["~standard"] = schema;
// @ts-expect-error
acceptSchema(schema);
});
test("toJSONSchema result ~standard.jsonSchema works with objects", () => {
const schema = z.object({
firstName: z.string(),
lastName: z.string(),
});
const jsonSchema = z.toJSONSchema(schema);
// Call ~standard.jsonSchema.input - this should not throw
const inputSchema = jsonSchema["~standard"].jsonSchema.input({ target: "draft-07" });
expect(inputSchema).toMatchObject({
type: "object",
properties: {
firstName: { type: "string" },
lastName: { type: "string" },
},
required: ["firstName", "lastName"],
});
// Call ~standard.jsonSchema.output - this should not throw
const outputSchema = jsonSchema["~standard"].jsonSchema.output({ target: "draft-07" });
expect(outputSchema).toMatchObject({
type: "object",
properties: {
firstName: { type: "string" },
lastName: { type: "string" },
},
required: ["firstName", "lastName"],
});
});
@@ -0,0 +1 @@
{"version":3,"file":"lucide-react.min.js","sources":["../../../shared/src/utils.ts","../../src/defaultAttributes.ts","../../src/Icon.ts","../../src/createLucideIcon.ts","../../src/icons/a-arrow-down.ts","../../src/icons/a-arrow-up.ts","../../src/icons/a-large-small.ts","../../src/icons/accessibility.ts","../../src/icons/activity.ts","../../src/icons/air-vent.ts","../../src/icons/airplay.ts","../../src/icons/alarm-clock-check.ts","../../src/icons/alarm-clock-minus.ts","../../src/icons/alarm-clock-off.ts","../../src/icons/alarm-clock-plus.ts","../../src/icons/alarm-clock.ts","../../src/icons/alarm-smoke.ts","../../src/icons/album.ts","../../src/icons/align-center-horizontal.ts","../../src/icons/align-center-vertical.ts","../../src/icons/align-center.ts","../../src/icons/align-end-horizontal.ts","../../src/icons/align-end-vertical.ts","../../src/icons/align-horizontal-distribute-center.ts","../../src/icons/align-horizontal-distribute-end.ts","../../src/icons/align-horizontal-distribute-start.ts","../../src/icons/align-horizontal-justify-center.ts","../../src/icons/align-horizontal-justify-end.ts","../../src/icons/align-horizontal-justify-start.ts","../../src/icons/align-horizontal-space-around.ts","../../src/icons/align-horizontal-space-between.ts","../../src/icons/align-justify.ts","../../src/icons/align-left.ts","../../src/icons/align-right.ts","../../src/icons/align-start-horizontal.ts","../../src/icons/align-start-vertical.ts","../../src/icons/align-vertical-distribute-center.ts","../../src/icons/align-vertical-distribute-end.ts","../../src/icons/align-vertical-distribute-start.ts","../../src/icons/align-vertical-justify-center.ts","../../src/icons/align-vertical-justify-end.ts","../../src/icons/align-vertical-justify-start.ts","../../src/icons/align-vertical-space-around.ts","../../src/icons/align-vertical-space-between.ts","../../src/icons/ambulance.ts","../../src/icons/ampersand.ts","../../src/icons/ampersands.ts","../../src/icons/amphora.ts","../../src/icons/anchor.ts","../../src/icons/angry.ts","../../src/icons/annoyed.ts","../../src/icons/antenna.ts","../../src/icons/anvil.ts","../../src/icons/aperture.ts","../../src/icons/app-window-mac.ts","../../src/icons/app-window.ts","../../src/icons/apple.ts","../../src/icons/archive-restore.ts","../../src/icons/archive-x.ts","../../src/icons/archive.ts","../../src/icons/armchair.ts","../../src/icons/arrow-big-down-dash.ts","../../src/icons/arrow-big-down.ts","../../src/icons/arrow-big-left-dash.ts","../../src/icons/arrow-big-left.ts","../../src/icons/arrow-big-right-dash.ts","../../src/icons/arrow-big-right.ts","../../src/icons/arrow-big-up-dash.ts","../../src/icons/arrow-big-up.ts","../../src/icons/arrow-down-0-1.ts","../../src/icons/arrow-down-1-0.ts","../../src/icons/arrow-down-a-z.ts","../../src/icons/arrow-down-from-line.ts","../../src/icons/arrow-down-left.ts","../../src/icons/arrow-down-narrow-wide.ts","../../src/icons/arrow-down-right.ts","../../src/icons/arrow-down-to-dot.ts","../../src/icons/arrow-down-to-line.ts","../../src/icons/arrow-down-up.ts","../../src/icons/arrow-down-wide-narrow.ts","../../src/icons/arrow-down-z-a.ts","../../src/icons/arrow-down.ts","../../src/icons/arrow-left-from-line.ts","../../src/icons/arrow-left-right.ts","../../src/icons/arrow-left-to-line.ts","../../src/icons/arrow-left.ts","../../src/icons/arrow-right-from-line.ts","../../src/icons/arrow-right-left.ts","../../src/icons/arrow-right-to-line.ts","../../src/icons/arrow-right.ts","../../src/icons/arrow-up-0-1.ts","../../src/icons/arrow-up-1-0.ts","../../src/icons/arrow-up-a-z.ts","../../src/icons/arrow-up-down.ts","../../src/icons/arrow-up-from-dot.ts","../../src/icons/arrow-up-from-line.ts","../../src/icons/arrow-up-left.ts","../../src/icons/arrow-up-narrow-wide.ts","../../src/icons/arrow-up-right.ts","../../src/icons/arrow-up-to-line.ts","../../src/icons/arrow-up-wide-narrow.ts","../../src/icons/arrow-up-z-a.ts","../../src/icons/arrow-up.ts","../../src/icons/arrows-up-from-line.ts","../../src/icons/asterisk.ts","../../src/icons/at-sign.ts","../../src/icons/atom.ts","../../src/icons/audio-lines.ts","../../src/icons/audio-waveform.ts","../../src/icons/award.ts","../../src/icons/axe.ts","../../src/icons/axis-3d.ts","../../src/icons/baby.ts","../../src/icons/backpack.ts","../../src/icons/badge-alert.ts","../../src/icons/badge-cent.ts","../../src/icons/badge-check.ts","../../src/icons/badge-dollar-sign.ts","../../src/icons/badge-euro.ts","../../src/icons/badge-help.ts","../../src/icons/badge-indian-rupee.ts","../../src/icons/badge-info.ts","../../src/icons/badge-japanese-yen.ts","../../src/icons/badge-minus.ts","../../src/icons/badge-percent.ts","../../src/icons/badge-plus.ts","../../src/icons/badge-pound-sterling.ts","../../src/icons/badge-russian-ruble.ts","../../src/icons/badge-swiss-franc.ts","../../src/icons/badge-x.ts","../../src/icons/badge.ts","../../src/icons/baggage-claim.ts","../../src/icons/ban.ts","../../src/icons/banana.ts","../../src/icons/bandage.ts","../.Line truncated
@@ -0,0 +1,28 @@
/**
* @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 Drama = createLucideIcon("Drama", [
["path", { d: "M10 11h.01", key: "d2at3l" }],
["path", { d: "M14 6h.01", key: "k028ub" }],
["path", { d: "M18 6h.01", key: "1v4wsw" }],
["path", { d: "M6.5 13.1h.01", key: "1748ia" }],
["path", { d: "M22 5c0 9-4 12-6 12s-6-3-6-12c0-2 2-3 6-3s6 1 6 3", key: "172yzv" }],
["path", { d: "M17.4 9.9c-.8.8-2 .8-2.8 0", key: "1obv0w" }],
[
"path",
{
d: "M10.1 7.1C9 7.2 7.7 7.7 6 8.6c-3.5 2-4.7 3.9-3.7 5.6 4.5 7.8 9.5 8.4 11.2 7.4.9-.5 1.9-2.1 1.9-4.7",
key: "rqjl8i"
}
],
["path", { d: "M9.1 16.5c.3-1.1 1.4-1.7 2.4-1.4", key: "1mr6wy" }]
]);
export { Drama as default };
//# sourceMappingURL=drama.js.map
@@ -0,0 +1,20 @@
/**
* @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 SquareDashedBottom = createLucideIcon("SquareDashedBottom", [
[
"path",
{ d: "M5 21a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2", key: "as5y1o" }
],
["path", { d: "M9 21h1", key: "15o7lz" }],
["path", { d: "M14 21h1", key: "v9vybs" }]
]);
export { SquareDashedBottom as default };
//# sourceMappingURL=square-dashed-bottom.js.map
@@ -0,0 +1 @@
{"version":3,"file":"square-parking.js","sources":["../../../src/icons/square-parking.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareParking\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik05IDE3VjdoNGEzIDMgMCAwIDEgMCA2SDkiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/square-parking\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 SquareParking = createLucideIcon('SquareParking', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M9 17V7h4a3 3 0 0 1 0 6H9', key: '1dfk2c' }],\n]);\n\nexport default SquareParking;\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,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,79 @@
import { AnyNode, Element } from "domhandler";
import type { ElementType } from "domelementtype";
/**
* An object with keys to check elements against. If a key is `tag_name`,
* `tag_type` or `tag_contains`, it will check the value against that specific
* value. Otherwise, it will check an attribute with the key's name.
*
* @category Legacy Query Functions
*/
export interface TestElementOpts {
tag_name?: string | ((name: string) => boolean);
tag_type?: string | ((name: string) => boolean);
tag_contains?: string | ((data?: string) => boolean);
[attributeName: string]: undefined | string | ((attributeValue: string) => boolean);
}
/**
* Checks whether a node matches the description in `options`.
*
* @category Legacy Query Functions
* @param options An object describing nodes to look for.
* @param node The element to test.
* @returns Whether the element matches the description in `options`.
*/
export declare function testElement(options: TestElementOpts, node: AnyNode): boolean;
/**
* Returns all nodes that match `options`.
*
* @category Legacy Query Functions
* @param options An object describing nodes to look for.
* @param nodes Nodes to search through.
* @param recurse Also consider child nodes.
* @param limit Maximum number of nodes to return.
* @returns All nodes that match `options`.
*/
export declare function getElements(options: TestElementOpts, nodes: AnyNode | AnyNode[], recurse: boolean, limit?: number): AnyNode[];
/**
* Returns the node with the supplied ID.
*
* @category Legacy Query Functions
* @param id The unique ID attribute value to look for.
* @param nodes Nodes to search through.
* @param recurse Also consider child nodes.
* @returns The node with the supplied ID.
*/
export declare function getElementById(id: string | ((id: string) => boolean), nodes: AnyNode | AnyNode[], recurse?: boolean): Element | null;
/**
* Returns all nodes with the supplied `tagName`.
*
* @category Legacy Query Functions
* @param tagName Tag name to search for.
* @param nodes Nodes to search through.
* @param recurse Also consider child nodes.
* @param limit Maximum number of nodes to return.
* @returns All nodes with the supplied `tagName`.
*/
export declare function getElementsByTagName(tagName: string | ((name: string) => boolean), nodes: AnyNode | AnyNode[], recurse?: boolean, limit?: number): Element[];
/**
* Returns all nodes with the supplied `className`.
*
* @category Legacy Query Functions
* @param className Class name to search for.
* @param nodes Nodes to search through.
* @param recurse Also consider child nodes.
* @param limit Maximum number of nodes to return.
* @returns All nodes with the supplied `className`.
*/
export declare function getElementsByClassName(className: string | ((name: string) => boolean), nodes: AnyNode | AnyNode[], recurse?: boolean, limit?: number): Element[];
/**
* Returns all nodes with the supplied `type`.
*
* @category Legacy Query Functions
* @param type Element type to look for.
* @param nodes Nodes to search through.
* @param recurse Also consider child nodes.
* @param limit Maximum number of nodes to return.
* @returns All nodes with the supplied `type`.
*/
export declare function getElementsByTagType(type: ElementType | ((type: ElementType) => boolean), nodes: AnyNode | AnyNode[], recurse?: boolean, limit?: number): AnyNode[];
//# sourceMappingURL=legacy.d.ts.map
@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = inherit;
function inherit(key, child, parent) {
if (child && parent) {
child[key] = Array.from(new Set([].concat(child[key], parent[key]).filter(Boolean)));
}
}
//# sourceMappingURL=inherit.js.map
@@ -0,0 +1,5 @@
declare function gOPD<O extends object, K extends keyof O>(obj: O, prop: K): PropertyDescriptor | undefined;
declare const fn: typeof gOPD | undefined | null;
export = fn;
@@ -0,0 +1,10 @@
import type { Vocabulary } from "../../types";
import { JTDTypeError } from "./type";
import { JTDEnumError } from "./enum";
import { JTDElementsError } from "./elements";
import { JTDPropertiesError } from "./properties";
import { JTDDiscriminatorError } from "./discriminator";
import { JTDValuesError } from "./values";
declare const jtdVocabulary: Vocabulary;
export default jtdVocabulary;
export type JTDErrorObject = JTDTypeError | JTDEnumError | JTDElementsError | JTDPropertiesError | JTDDiscriminatorError | JTDValuesError;
@@ -0,0 +1,20 @@
var Ajv = require('ajv');
var ajv = new Ajv({allErrors: true});
var schema = {
"properties": {
"foo": { "type": "string" },
"bar": { "type": "number", "maximum": 3 }
}
};
var validate = ajv.compile(schema);
test({"foo": "abc", "bar": 2});
test({"foo": 2, "bar": 4});
function test(data) {
var valid = validate(data);
if (valid) console.log('Valid!');
else console.log('Invalid: ' + ajv.errorsText(validate.errors));
}
@@ -0,0 +1 @@
{"version":3,"file":"filter-x.js","sources":["../../../src/icons/filter-x.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FilterX\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTMuMDEzIDNIMmw4IDkuNDZWMTlsNCAydi04LjU0bC45LTEuMDU1IiAvPgogIDxwYXRoIGQ9Im0yMiAzLTUgNSIgLz4KICA8cGF0aCBkPSJtMTcgMyA1IDUiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/filter-x\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 FilterX = createLucideIcon('FilterX', [\n ['path', { d: 'M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055', key: '1fi1da' }],\n ['path', { d: 'm22 3-5 5', key: '12jva0' }],\n ['path', { d: 'm17 3 5 5', key: 'k36vhe' }],\n]);\n\nexport default FilterX;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,55 @@
import type { StringReader, StringWriter } from './strings';
export const comma = ','.charCodeAt(0);
export const semicolon = ';'.charCodeAt(0);
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
const intToChar = new Uint8Array(64); // 64 possible chars.
const charToInt = new Uint8Array(128); // z is 122 in ASCII
for (let i = 0; i < chars.length; i++) {
const c = chars.charCodeAt(i);
intToChar[i] = c;
charToInt[c] = i;
}
export function decodeInteger(reader: StringReader, relative: number): number {
let value = 0;
let shift = 0;
let integer = 0;
do {
const c = reader.next();
integer = charToInt[c];
value |= (integer & 31) << shift;
shift += 5;
} while (integer & 32);
const shouldNegate = value & 1;
value >>>= 1;
if (shouldNegate) {
value = -0x80000000 | -value;
}
return relative + value;
}
export function encodeInteger(builder: StringWriter, num: number, relative: number): number {
let delta = num - relative;
delta = delta < 0 ? (-delta << 1) | 1 : delta << 1;
do {
let clamped = delta & 0b011111;
delta >>>= 5;
if (delta > 0) clamped |= 0b100000;
builder.write(intToChar[clamped]);
} while (delta > 0);
return num;
}
export function hasMoreVlq(reader: StringReader, max: number) {
if (reader.pos >= max) return false;
return reader.peek() !== comma;
}
@@ -0,0 +1 @@
{"version":3,"file":"fish-symbol.js","sources":["../../../src/icons/fish-symbol.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FishSymbol\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAxNnM5LTE1IDIwLTRDMTEgMjMgMiA4IDIgOCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/fish-symbol\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 FishSymbol = createLucideIcon('FishSymbol', [\n ['path', { d: 'M2 16s9-15 20-4C11 23 2 8 2 8', key: 'h4oh4o' }],\n]);\n\nexport default FishSymbol;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,54 @@
'use strict'
const eq = require('./eq')
const neq = require('./neq')
const gt = require('./gt')
const gte = require('./gte')
const lt = require('./lt')
const lte = require('./lte')
const cmp = (a, op, b, loose) => {
switch (op) {
case '===':
if (typeof a === 'object') {
a = a.version
}
if (typeof b === 'object') {
b = b.version
}
return a === b
case '!==':
if (typeof a === 'object') {
a = a.version
}
if (typeof b === 'object') {
b = b.version
}
return a !== b
case '':
case '=':
case '==':
return eq(a, b, loose)
case '!=':
return neq(a, b, loose)
case '>':
return gt(a, b, loose)
case '>=':
return gte(a, b, loose)
case '<':
return lt(a, b, loose)
case '<=':
return lte(a, b, loose)
default:
throw new TypeError(`Invalid operator: ${op}`)
}
}
module.exports = cmp
@@ -0,0 +1,8 @@
import type { ZodArray, ZodNullable, ZodObject, ZodOptional, ZodRawShape, ZodTuple, ZodTupleItems, ZodTypeAny } from "../types.js";
export declare namespace partialUtil {
type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<ZodRawShape> ? ZodObject<{
[k in keyof T["shape"]]: ZodOptional<DeepPartial<T["shape"][k]>>;
}, T["_def"]["unknownKeys"], T["_def"]["catchall"]> : T extends ZodArray<infer Type, infer Card> ? ZodArray<DeepPartial<Type>, Card> : T extends ZodOptional<infer Type> ? ZodOptional<DeepPartial<Type>> : T extends ZodNullable<infer Type> ? ZodNullable<DeepPartial<Type>> : T extends ZodTuple<infer Items> ? {
[k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never;
} extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
}
@@ -0,0 +1,64 @@
type RemoveFromTuple<
Tuple extends readonly unknown[],
RemoveCount extends number,
Index extends 1[] = []
> = Index["length"] extends RemoveCount
? Tuple
: Tuple extends [infer First, ...infer Rest]
? RemoveFromTuple<Rest, RemoveCount, [...Index, 1]>
: Tuple;
type ConcatTuples<
Prefix extends readonly unknown[],
Suffix extends readonly unknown[]
> = [...Prefix, ...Suffix];
type ExtractFunctionParams<T> = T extends (this: infer TThis, ...args: infer P extends readonly unknown[]) => infer R
? { thisArg: TThis; params: P; returnType: R }
: never;
type BindFunction<
T extends (this: any, ...args: any[]) => any,
TThis,
TBoundArgs extends readonly unknown[],
ReceiverBound extends boolean
> = ExtractFunctionParams<T> extends {
thisArg: infer OrigThis;
params: infer P extends readonly unknown[];
returnType: infer R;
}
? ReceiverBound extends true
? (...args: RemoveFromTuple<P, Extract<TBoundArgs["length"], number>>) => R extends [OrigThis, ...infer Rest]
? [TThis, ...Rest] // Replace `this` with `thisArg`
: R
: <U, RemainingArgs extends RemoveFromTuple<P, Extract<TBoundArgs["length"], number>>>(
thisArg: U,
...args: RemainingArgs
) => R extends [OrigThis, ...infer Rest]
? [U, ...ConcatTuples<TBoundArgs, Rest>] // Preserve bound args in return type
: R
: never;
declare function callBind<
const T extends (this: any, ...args: any[]) => any,
Extracted extends ExtractFunctionParams<T>,
const TBoundArgs extends Partial<Extracted["params"]> & readonly unknown[],
const TThis extends Extracted["thisArg"]
>(
args: [fn: T, thisArg: TThis, ...boundArgs: TBoundArgs]
): BindFunction<T, TThis, TBoundArgs, true>;
declare function callBind<
const T extends (this: any, ...args: any[]) => any,
Extracted extends ExtractFunctionParams<T>,
const TBoundArgs extends Partial<Extracted["params"]> & readonly unknown[]
>(
args: [fn: T, ...boundArgs: TBoundArgs]
): BindFunction<T, Extracted["thisArg"], TBoundArgs, false>;
declare function callBind<const TArgs extends readonly unknown[]>(
args: [fn: Exclude<TArgs[0], Function>, ...rest: TArgs]
): never;
// export as namespace callBind;
export = callBind;
@@ -0,0 +1,582 @@
/**
* blake2b (64-bit) & blake2s (8 to 32-bit) hash functions.
* b could have been faster, but there is no fast u64 in js, so s is 1.5x faster.
* @module
*/
import { BSIGMA, G1s, G2s } from './_blake.ts';
import { SHA256_IV } from './_md.ts';
import * as u64 from './_u64.ts';
// prettier-ignore
import {
abytes, aexists, anumber, aoutput,
clean, createHasher,
swap32IfBE, swap8IfBE,
u32,
type CHash,
type Hash,
type TArg,
type TRet
} from './utils.ts';
/**
* Blake hash options.
* `dkLen` is output length. `key` is used in MAC mode. `salt` is used in
* KDF mode.
*/
export type Blake2Opts = {
/** Desired digest length in bytes. RFC 7693 uses 1..64 for blake2b and 1..32 for blake2s. */
dkLen?: number;
/** Optional MAC key. */
key?: Uint8Array;
/** Optional salt mixed into initialization. */
salt?: Uint8Array;
/** Optional personalization bytes. */
personalization?: Uint8Array;
};
// Same IV words as `SHA512_IV`, but endian-swapped into LE u32 low/high halves
// for the BLAKE2b u64 helpers below.
const B2B_IV = /* @__PURE__ */ Uint32Array.from([
0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a,
0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19,
]);
// Shared synchronous BLAKE2b work vector as LE u32 low/high halves.
const BBUF = /* @__PURE__ */ new Uint32Array(32);
// BLAKE2b G mix split into two half-rounds over LE u32 low/high limbs.
function G1b(a: number, b: number, c: number, d: number, msg: TArg<Uint32Array>, x: number) {
// NOTE: V is LE here
const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore
let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore
let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore
let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore
let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore
// v[a] = (v[a] + v[b] + x) | 0;
let ll = u64.add3L(Al, Bl, Xl);
Ah = u64.add3H(ll, Ah, Bh, Xh);
Al = ll | 0;
// v[d] = rotr(v[d] ^ v[a], 32)
({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al });
({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) });
// v[c] = (v[c] + v[d]) | 0;
({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl));
// v[b] = rotr(v[b] ^ v[c], 24)
({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl });
({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 24), Bl: u64.rotrSL(Bh, Bl, 24) });
((BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah));
((BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh));
((BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch));
((BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh));
}
// Second half-round of the same LE-limb BLAKE2b G mix; `x` is the message word offset.
function G2b(a: number, b: number, c: number, d: number, msg: TArg<Uint32Array>, x: number) {
// NOTE: V is LE here
const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore
let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore
let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore
let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore
let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore
// v[a] = (v[a] + v[b] + x) | 0;
let ll = u64.add3L(Al, Bl, Xl);
Ah = u64.add3H(ll, Ah, Bh, Xh);
Al = ll | 0;
// v[d] = rotr(v[d] ^ v[a], 16)
({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al });
({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) });
// v[c] = (v[c] + v[d]) | 0;
({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl));
// v[b] = rotr(v[b] ^ v[c], 63)
({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl });
({ Bh, Bl } = { Bh: u64.rotrBH(Bh, Bl, 63), Bl: u64.rotrBL(Bh, Bl, 63) });
((BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah));
((BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh));
((BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch));
((BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh));
}
function checkBlake2Opts(
outputLen: number,
opts: TArg<Blake2Opts | undefined> = {},
keyLen: number,
saltLen: number,
persLen: number
) {
anumber(keyLen);
// RFC 7693 §2.1 requires digest length nn in 1..keyLen.
if (outputLen <= 0 || outputLen > keyLen) throw new Error('outputLen bigger than keyLen');
const { key, salt, personalization } = opts;
// This API uses `undefined` for the RFC 7693 `kk = 0` case, so a provided key must be non-empty.
if (key !== undefined && (key.length < 1 || key.length > keyLen))
throw new Error('"key" expected to be undefined or of length=1..' + keyLen);
if (salt !== undefined) abytes(salt, saltLen, 'salt');
if (personalization !== undefined) abytes(personalization, persLen, 'personalization');
}
/** Internal base class for BLAKE2. */
export abstract class _BLAKE2<T extends _BLAKE2<T>> implements Hash<T> {
protected abstract compress(msg: Uint32Array, offset: number, isLast: boolean): void;
protected abstract get(): number[];
protected abstract set(...args: number[]): void;
abstract destroy(): void;
protected buffer: Uint8Array;
protected buffer32: Uint32Array;
protected finished = false;
protected destroyed = false;
protected length: number = 0;
protected pos: number = 0;
readonly blockLen: number;
readonly outputLen: number;
readonly canXOF: boolean = false;
constructor(blockLen: number, outputLen: number) {
anumber(blockLen);
anumber(outputLen);
this.blockLen = blockLen;
this.outputLen = outputLen;
this.buffer = new Uint8Array(blockLen);
this.buffer32 = u32(this.buffer);
}
update(data: TArg<Uint8Array>): this {
aexists(this);
abytes(data);
// Main difference with other hashes: there is flag for last block,
// so we cannot process current block before we know that there
// is the next one. This significantly complicates logic and reduces ability
// to do zero-copy processing
const { blockLen, buffer, buffer32 } = this;
const len = data.length;
const offset = data.byteOffset;
const buf = data.buffer;
for (let pos = 0; pos < len; ) {
// If buffer is full and we still have input (don't process last block, same as blake2s)
if (this.pos === blockLen) {
swap32IfBE(buffer32);
this.compress(buffer32, 0, false);
swap32IfBE(buffer32);
this.pos = 0;
}
const take = Math.min(blockLen - this.pos, len - pos);
const dataOffset = offset + pos;
// Zero-copy only for full, 4-byte-aligned, non-final blocks.
if (take === blockLen && !(dataOffset % 4) && pos + take < len) {
const data32 = new Uint32Array(buf, dataOffset, Math.floor((len - pos) / 4));
swap32IfBE(data32);
for (let pos32 = 0; pos + blockLen < len; pos32 += buffer32.length, pos += blockLen) {
this.length += blockLen;
this.compress(data32, pos32, false);
}
swap32IfBE(data32);
continue;
}
buffer.set(data.subarray(pos, pos + take), this.pos);
this.pos += take;
this.length += take;
pos += take;
}
return this;
}
digestInto(out: TArg<Uint8Array>): void {
aexists(this);
aoutput(out, this);
const { pos, buffer32 } = this;
this.finished = true;
// Padding
clean(this.buffer.subarray(pos));
swap32IfBE(buffer32);
this.compress(buffer32, 0, true);
swap32IfBE(buffer32);
// Reject unaligned views explicitly instead of hiding them behind a full scratch copy.
if (out.byteOffset & 3)
throw new RangeError(
'"digestInto() output" expected 4-byte aligned byteOffset, got ' + out.byteOffset
);
const state = this.get();
const out32 = u32(out);
const full = Math.floor(this.outputLen / 4);
for (let i = 0; i < full; i++) out32[i] = swap8IfBE(state[i]);
const tail = this.outputLen % 4;
if (!tail) return;
const off = full * 4;
const word = state[full];
for (let i = 0; i < tail; i++) out[off + i] = word >>> (8 * i);
}
digest(): TRet<Uint8Array> {
const { buffer, outputLen } = this;
this.digestInto(buffer);
// Return a copy so callers do not alias the instance scratch buffer used during finalization.
const res = buffer.slice(0, outputLen);
this.destroy();
return res as TRet<Uint8Array>;
}
_cloneInto(to?: T): T {
const { buffer, length, finished, destroyed, outputLen, pos } = this;
// Recreate only `dkLen`; key/salt/personalization are already absorbed into the copied state.
to ||= new (this.constructor as any)({ dkLen: outputLen }) as T;
to.set(...this.get());
to.buffer.set(buffer);
to.destroyed = destroyed;
to.finished = finished;
to.length = length;
to.pos = pos;
// @ts-ignore
to.outputLen = outputLen;
return to;
}
clone(): T {
return this._cloneInto();
}
}
/** Internal blake2b hash class with state stored as LE u32 low/high halves. */
export class _BLAKE2b extends _BLAKE2<_BLAKE2b> {
// Same IV words as SHA-512 / BLAKE2b, encoded as LE u32 low/high halves.
private v0l = B2B_IV[0] | 0;
private v0h = B2B_IV[1] | 0;
private v1l = B2B_IV[2] | 0;
private v1h = B2B_IV[3] | 0;
private v2l = B2B_IV[4] | 0;
private v2h = B2B_IV[5] | 0;
private v3l = B2B_IV[6] | 0;
private v3h = B2B_IV[7] | 0;
private v4l = B2B_IV[8] | 0;
private v4h = B2B_IV[9] | 0;
private v5l = B2B_IV[10] | 0;
private v5h = B2B_IV[11] | 0;
private v6l = B2B_IV[12] | 0;
private v6h = B2B_IV[13] | 0;
private v7l = B2B_IV[14] | 0;
private v7h = B2B_IV[15] | 0;
constructor(opts: Blake2Opts = {}) {
const olen = opts.dkLen === undefined ? 64 : opts.dkLen;
super(128, olen);
checkBlake2Opts(olen, opts, 64, 16, 16);
let { key, personalization, salt } = opts;
let keyLength = 0;
if (key !== undefined) {
abytes(key, undefined, 'key');
keyLength = key.length;
}
// RFC 7693 §2.5: xor `p[0] = 0x0101kknn` into the low 32 bits of `h[0]`;
// the high 32 bits stay at `IV[0]`.
this.v0l ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24);
if (salt !== undefined) {
abytes(salt, undefined, 'salt');
const slt = u32(salt);
this.v4l ^= swap8IfBE(slt[0]);
this.v4h ^= swap8IfBE(slt[1]);
this.v5l ^= swap8IfBE(slt[2]);
this.v5h ^= swap8IfBE(slt[3]);
}
if (personalization !== undefined) {
abytes(personalization, undefined, 'personalization');
const pers = u32(personalization);
this.v6l ^= swap8IfBE(pers[0]);
this.v6h ^= swap8IfBE(pers[1]);
this.v7l ^= swap8IfBE(pers[2]);
this.v7h ^= swap8IfBE(pers[3]);
}
if (key !== undefined) {
// Pad to blockLen and update
const tmp = new Uint8Array(this.blockLen);
tmp.set(key);
this.update(tmp);
}
}
// prettier-ignore
protected get(): [
number, number, number, number, number, number, number, number,
number, number, number, number, number, number, number, number
] {
let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this;
return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h];
}
// prettier-ignore
protected set(
v0l: number, v0h: number, v1l: number, v1h: number,
v2l: number, v2h: number, v3l: number, v3h: number,
v4l: number, v4h: number, v5l: number, v5h: number,
v6l: number, v6h: number, v7l: number, v7h: number
): void {
this.v0l = v0l | 0;
this.v0h = v0h | 0;
this.v1l = v1l | 0;
this.v1h = v1h | 0;
this.v2l = v2l | 0;
this.v2h = v2h | 0;
this.v3l = v3l | 0;
this.v3h = v3h | 0;
this.v4l = v4l | 0;
this.v4h = v4h | 0;
this.v5l = v5l | 0;
this.v5h = v5h | 0;
this.v6l = v6l | 0;
this.v6h = v6h | 0;
this.v7l = v7l | 0;
this.v7h = v7h | 0;
}
protected compress(msg: Uint32Array, offset: number, isLast: boolean): void {
this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state.
BBUF.set(B2B_IV, 16); // Second half from IV.
let { h, l } = u64.fromBig(BigInt(this.length));
BBUF[24] = B2B_IV[8] ^ l; // Low word of the offset.
BBUF[25] = B2B_IV[9] ^ h; // High word.
// Invert all bits for last block
if (isLast) {
BBUF[28] = ~BBUF[28];
BBUF[29] = ~BBUF[29];
}
let j = 0;
const s = BSIGMA;
// SIGMA selects 64-bit message words; multiply by 2 because `msg` stores
// each word as [low32, high32].
for (let i = 0; i < 12; i++) {
G1b(0, 4, 8, 12, msg, offset + 2 * s[j++]);
G2b(0, 4, 8, 12, msg, offset + 2 * s[j++]);
G1b(1, 5, 9, 13, msg, offset + 2 * s[j++]);
G2b(1, 5, 9, 13, msg, offset + 2 * s[j++]);
G1b(2, 6, 10, 14, msg, offset + 2 * s[j++]);
G2b(2, 6, 10, 14, msg, offset + 2 * s[j++]);
G1b(3, 7, 11, 15, msg, offset + 2 * s[j++]);
G2b(3, 7, 11, 15, msg, offset + 2 * s[j++]);
G1b(0, 5, 10, 15, msg, offset + 2 * s[j++]);
G2b(0, 5, 10, 15, msg, offset + 2 * s[j++]);
G1b(1, 6, 11, 12, msg, offset + 2 * s[j++]);
G2b(1, 6, 11, 12, msg, offset + 2 * s[j++]);
G1b(2, 7, 8, 13, msg, offset + 2 * s[j++]);
G2b(2, 7, 8, 13, msg, offset + 2 * s[j++]);
G1b(3, 4, 9, 14, msg, offset + 2 * s[j++]);
G2b(3, 4, 9, 14, msg, offset + 2 * s[j++]);
}
this.v0l ^= BBUF[0] ^ BBUF[16];
this.v0h ^= BBUF[1] ^ BBUF[17];
this.v1l ^= BBUF[2] ^ BBUF[18];
this.v1h ^= BBUF[3] ^ BBUF[19];
this.v2l ^= BBUF[4] ^ BBUF[20];
this.v2h ^= BBUF[5] ^ BBUF[21];
this.v3l ^= BBUF[6] ^ BBUF[22];
this.v3h ^= BBUF[7] ^ BBUF[23];
this.v4l ^= BBUF[8] ^ BBUF[24];
this.v4h ^= BBUF[9] ^ BBUF[25];
this.v5l ^= BBUF[10] ^ BBUF[26];
this.v5h ^= BBUF[11] ^ BBUF[27];
this.v6l ^= BBUF[12] ^ BBUF[28];
this.v6h ^= BBUF[13] ^ BBUF[29];
this.v7l ^= BBUF[14] ^ BBUF[30];
this.v7h ^= BBUF[15] ^ BBUF[31];
clean(BBUF);
}
destroy(): void {
this.destroyed = true;
clean(this.buffer32);
this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
}
/**
* Blake2b hash function. 64-bit. 1.5x slower than blake2s in JS.
* @param msg - message that would be hashed
* @param opts - Optional output, MAC, salt, and personalization settings.
* `dkLen` must be 1..64 bytes; `salt` and `personalization`, if present,
* must be 16 bytes each. See {@link Blake2Opts}.
* @returns Digest bytes.
* @example
* Hash a message with Blake2b.
* ```ts
* blake2b(new Uint8Array([97, 98, 99]));
* ```
*/
export const blake2b: TRet<CHash<_BLAKE2b, Blake2Opts>> = /* @__PURE__ */ createHasher(
(opts) => new _BLAKE2b(opts)
);
// =================
// Blake2S
// =================
/** Internal type, 16 numbers. */
// prettier-ignore
export type _Num16 = {
v0: number; v1: number; v2: number; v3: number;
v4: number; v5: number; v6: number; v7: number;
v8: number; v9: number; v10: number; v11: number;
v12: number; v13: number; v14: number; v15: number;
};
/**
* BLAKE2-compress core method.
* Runs only the round function over a caller-supplied local vector; callers initialize `v0..v15`
* and apply the final `h[i] ^= v[i] ^ v[i + 8]` fold themselves.
* @param s - flattened sigma schedule bytes
* @param offset - starting word offset inside `msg`, not a byte offset
* @param msg - message words
* @param rounds - round count to execute
* @param v0 - state word 0
* @param v1 - state word 1
* @param v2 - state word 2
* @param v3 - state word 3
* @param v4 - state word 4
* @param v5 - state word 5
* @param v6 - state word 6
* @param v7 - state word 7
* @param v8 - state word 8
* @param v9 - state word 9
* @param v10 - state word 10
* @param v11 - state word 11
* @param v12 - state word 12
* @param v13 - state word 13
* @param v14 - state word 14
* @param v15 - state word 15
* @returns Updated compression state words.
* @example
* Run the BLAKE2 compression core on zeroed state and message words.
* ```ts
* import { compress } from '@noble/hashes/blake2.js';
* const state = compress(
* new Uint8Array(16),
* 0,
* new Uint32Array(16),
* 1,
* 0, 0, 0, 0, 0, 0, 0, 0,
* 0, 0, 0, 0, 0, 0, 0, 0
* );
* state.v0;
* ```
*/
// prettier-ignore
export function compress(s: TArg<Uint8Array>, offset: number, msg: TArg<Uint32Array>, rounds: number,
v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number,
v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number,
): _Num16 {
let j = 0;
for (let i = 0; i < rounds; i++) {
({ a: v0, b: v4, c: v8, d: v12 } = G1s(v0, v4, v8, v12, msg[offset + s[j++]]));
({ a: v0, b: v4, c: v8, d: v12 } = G2s(v0, v4, v8, v12, msg[offset + s[j++]]));
({ a: v1, b: v5, c: v9, d: v13 } = G1s(v1, v5, v9, v13, msg[offset + s[j++]]));
({ a: v1, b: v5, c: v9, d: v13 } = G2s(v1, v5, v9, v13, msg[offset + s[j++]]));
({ a: v2, b: v6, c: v10, d: v14 } = G1s(v2, v6, v10, v14, msg[offset + s[j++]]));
({ a: v2, b: v6, c: v10, d: v14 } = G2s(v2, v6, v10, v14, msg[offset + s[j++]]));
({ a: v3, b: v7, c: v11, d: v15 } = G1s(v3, v7, v11, v15, msg[offset + s[j++]]));
({ a: v3, b: v7, c: v11, d: v15 } = G2s(v3, v7, v11, v15, msg[offset + s[j++]]));
({ a: v0, b: v5, c: v10, d: v15 } = G1s(v0, v5, v10, v15, msg[offset + s[j++]]));
({ a: v0, b: v5, c: v10, d: v15 } = G2s(v0, v5, v10, v15, msg[offset + s[j++]]));
({ a: v1, b: v6, c: v11, d: v12 } = G1s(v1, v6, v11, v12, msg[offset + s[j++]]));
({ a: v1, b: v6, c: v11, d: v12 } = G2s(v1, v6, v11, v12, msg[offset + s[j++]]));
({ a: v2, b: v7, c: v8, d: v13 } = G1s(v2, v7, v8, v13, msg[offset + s[j++]]));
({ a: v2, b: v7, c: v8, d: v13 } = G2s(v2, v7, v8, v13, msg[offset + s[j++]]));
({ a: v3, b: v4, c: v9, d: v14 } = G1s(v3, v4, v9, v14, msg[offset + s[j++]]));
({ a: v3, b: v4, c: v9, d: v14 } = G2s(v3, v4, v9, v14, msg[offset + s[j++]]));
}
return { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 };
}
// Blake2s reuses the SHA-256 IV words as-is.
const B2S_IV = /* @__PURE__ */ SHA256_IV.slice();
/** Internal blake2s hash class. */
export class _BLAKE2s extends _BLAKE2<_BLAKE2s> {
// Internal state, same as SHA-256
private v0 = B2S_IV[0] | 0;
private v1 = B2S_IV[1] | 0;
private v2 = B2S_IV[2] | 0;
private v3 = B2S_IV[3] | 0;
private v4 = B2S_IV[4] | 0;
private v5 = B2S_IV[5] | 0;
private v6 = B2S_IV[6] | 0;
private v7 = B2S_IV[7] | 0;
constructor(opts: Blake2Opts = {}) {
const olen = opts.dkLen === undefined ? 32 : opts.dkLen;
super(64, olen);
checkBlake2Opts(olen, opts, 32, 8, 8);
let { key, personalization, salt } = opts;
let keyLength = 0;
if (key !== undefined) {
abytes(key, undefined, 'key');
keyLength = key.length;
}
// RFC 7693 §2.5: xor `p[0] = 0x0101kknn` directly into `h[0]`, since
// BLAKE2s stores each state word as one `u32`.
this.v0 ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24);
if (salt !== undefined) {
abytes(salt, undefined, 'salt');
const slt = u32(salt as Uint8Array);
this.v4 ^= swap8IfBE(slt[0]);
this.v5 ^= swap8IfBE(slt[1]);
}
if (personalization !== undefined) {
abytes(personalization, undefined, 'personalization');
const pers = u32(personalization as Uint8Array);
this.v6 ^= swap8IfBE(pers[0]);
this.v7 ^= swap8IfBE(pers[1]);
}
if (key !== undefined) {
// Pad to blockLen and update
const tmp = new Uint8Array(this.blockLen);
tmp.set(key);
this.update(tmp);
}
}
protected get(): [number, number, number, number, number, number, number, number] {
const { v0, v1, v2, v3, v4, v5, v6, v7 } = this;
return [v0, v1, v2, v3, v4, v5, v6, v7];
}
// prettier-ignore
protected set(
v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number
): void {
this.v0 = v0 | 0;
this.v1 = v1 | 0;
this.v2 = v2 | 0;
this.v3 = v3 | 0;
this.v4 = v4 | 0;
this.v5 = v5 | 0;
this.v6 = v6 | 0;
this.v7 = v7 | 0;
}
protected compress(msg: Uint32Array, offset: number, isLast: boolean): void {
const { h, l } = u64.fromBig(BigInt(this.length));
// Seed v8..v15 from the IV, xor the low/high 32-bit byte counter into
// v12/v13, and invert v14 on the final block.
// prettier-ignore
const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } =
compress(
BSIGMA, offset, msg, 10,
this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7,
B2S_IV[0], B2S_IV[1], B2S_IV[2], B2S_IV[3], l ^ B2S_IV[4], h ^ B2S_IV[5], isLast ? ~B2S_IV[6] : B2S_IV[6], B2S_IV[7]
);
this.v0 ^= v0 ^ v8;
this.v1 ^= v1 ^ v9;
this.v2 ^= v2 ^ v10;
this.v3 ^= v3 ^ v11;
this.v4 ^= v4 ^ v12;
this.v5 ^= v5 ^ v13;
this.v6 ^= v6 ^ v14;
this.v7 ^= v7 ^ v15;
}
destroy(): void {
this.destroyed = true;
clean(this.buffer32);
this.set(0, 0, 0, 0, 0, 0, 0, 0);
}
}
/**
* Blake2s hash function. Focuses on 8-bit to 32-bit platforms. 1.5x faster than blake2b in JS.
* @param msg - message that would be hashed
* @param opts - Optional output, MAC, salt, and personalization settings.
* `dkLen` must be 1..32 bytes; `salt` and `personalization`, if present,
* must be 8 bytes each. See {@link Blake2Opts}.
* @returns Digest bytes.
* @example
* Hash a message with Blake2s.
* ```ts
* blake2s(new Uint8Array([97, 98, 99]));
* ```
*/
export const blake2s: TRet<CHash<_BLAKE2s, Blake2Opts>> = /* @__PURE__ */ createHasher(
(opts) => new _BLAKE2s(opts)
);
@@ -0,0 +1,40 @@
{
"name": "@rolldown/pluginutils",
"version": "1.0.1",
"description": "Plugin utilities for Rolldown",
"keywords": [
"filter",
"plugin",
"rolldown"
],
"homepage": "https://github.com/rolldown/plugins/tree/main/packages/pluginutils#readme",
"bugs": {
"url": "https://github.com/rolldown/plugins/issues"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/rolldown/plugins.git",
"directory": "packages/pluginutils"
},
"files": [
"dist"
],
"type": "module",
"exports": {
".": "./dist/index.mjs",
"./filter": "./dist/filter/index.mjs",
"./package.json": "./package.json"
},
"devDependencies": {
"@types/picomatch": "^4.0.3",
"picomatch": "^4.0.4",
"typescript": "^5.9.3"
},
"scripts": {
"dev": "tsdown --watch",
"build": "tsdown",
"test": "vitest --project pluginutils",
"test:types": "vitest --project pluginutils --typecheck.only"
}
}
@@ -0,0 +1,38 @@
import {ContextualKeyword} from "../parser/tokenizer/keywords";
/**
* Determine whether this optional chain or nullish coalescing operation has any await statements in
* it. If so, we'll need to transpile to an async operation.
*
* We compute this by walking the length of the operation and returning true if we see an await
* keyword used as a real await (rather than an object key or property access). Nested optional
* chain/nullish operations need to be tracked but don't silence await, but a nested async function
* (or any other nested scope) will make the await not count.
*/
export default function isAsyncOperation(tokens) {
let index = tokens.currentIndex();
let depth = 0;
const startToken = tokens.currentToken();
do {
const token = tokens.tokens[index];
if (token.isOptionalChainStart) {
depth++;
}
if (token.isOptionalChainEnd) {
depth--;
}
depth += token.numNullishCoalesceStarts;
depth -= token.numNullishCoalesceEnds;
if (
token.contextualKeyword === ContextualKeyword._await &&
token.identifierRole == null &&
token.scopeDepth === startToken.scopeDepth
) {
return true;
}
index += 1;
} while (depth > 0 && index < tokens.tokens.length);
return false;
}
@@ -0,0 +1,3 @@
import * as ts from 'typescript';
export declare const isPossiblyFalsy: (type: ts.Type) => boolean;
export declare const isPossiblyTruthy: (type: ts.Type) => boolean;
@@ -0,0 +1,22 @@
import Agent from './agent'
import ProxyAgent from './proxy-agent'
import Dispatcher from './dispatcher'
export default EnvHttpProxyAgent
declare class EnvHttpProxyAgent extends Dispatcher {
constructor (opts?: EnvHttpProxyAgent.Options)
dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
}
declare namespace EnvHttpProxyAgent {
export interface Options extends Omit<ProxyAgent.Options, 'uri'> {
/** Overrides the value of the HTTP_PROXY environment variable */
httpProxy?: string;
/** Overrides the value of the HTTPS_PROXY environment variable */
httpsProxy?: string;
/** Overrides the value of the NO_PROXY environment variable */
noProxy?: string;
}
}
@@ -0,0 +1,101 @@
/**
* License for programmatically and manually incorporated
* documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
*
* Copyright Node.js contributors. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
// NOTE: These definitions support Node.js and TypeScript 5.8+.
// Reference required TypeScript libraries:
/// <reference lib="es2020" />
/// <reference lib="esnext.disposable" />
/// <reference lib="esnext.float16" />
// Iterator definitions required for compatibility with TypeScript <5.6:
/// <reference path="compatibility/iterators.d.ts" />
// Definitions for Node.js modules specific to TypeScript 5.7+:
/// <reference path="globals.typedarray.d.ts" />
/// <reference path="buffer.buffer.d.ts" />
// Definitions for Node.js modules that are not specific to any version of TypeScript:
/// <reference path="globals.d.ts" />
/// <reference path="web-globals/abortcontroller.d.ts" />
/// <reference path="web-globals/crypto.d.ts" />
/// <reference path="web-globals/domexception.d.ts" />
/// <reference path="web-globals/events.d.ts" />
/// <reference path="web-globals/fetch.d.ts" />
/// <reference path="web-globals/navigator.d.ts" />
/// <reference path="web-globals/storage.d.ts" />
/// <reference path="web-globals/streams.d.ts" />
/// <reference path="assert.d.ts" />
/// <reference path="assert/strict.d.ts" />
/// <reference path="async_hooks.d.ts" />
/// <reference path="buffer.d.ts" />
/// <reference path="child_process.d.ts" />
/// <reference path="cluster.d.ts" />
/// <reference path="console.d.ts" />
/// <reference path="constants.d.ts" />
/// <reference path="crypto.d.ts" />
/// <reference path="dgram.d.ts" />
/// <reference path="diagnostics_channel.d.ts" />
/// <reference path="dns.d.ts" />
/// <reference path="dns/promises.d.ts" />
/// <reference path="domain.d.ts" />
/// <reference path="events.d.ts" />
/// <reference path="fs.d.ts" />
/// <reference path="fs/promises.d.ts" />
/// <reference path="http.d.ts" />
/// <reference path="http2.d.ts" />
/// <reference path="https.d.ts" />
/// <reference path="inspector.d.ts" />
/// <reference path="inspector.generated.d.ts" />
/// <reference path="module.d.ts" />
/// <reference path="net.d.ts" />
/// <reference path="os.d.ts" />
/// <reference path="path.d.ts" />
/// <reference path="perf_hooks.d.ts" />
/// <reference path="process.d.ts" />
/// <reference path="punycode.d.ts" />
/// <reference path="querystring.d.ts" />
/// <reference path="readline.d.ts" />
/// <reference path="readline/promises.d.ts" />
/// <reference path="repl.d.ts" />
/// <reference path="sea.d.ts" />
/// <reference path="sqlite.d.ts" />
/// <reference path="stream.d.ts" />
/// <reference path="stream/promises.d.ts" />
/// <reference path="stream/consumers.d.ts" />
/// <reference path="stream/web.d.ts" />
/// <reference path="string_decoder.d.ts" />
/// <reference path="test.d.ts" />
/// <reference path="timers.d.ts" />
/// <reference path="timers/promises.d.ts" />
/// <reference path="tls.d.ts" />
/// <reference path="trace_events.d.ts" />
/// <reference path="tty.d.ts" />
/// <reference path="url.d.ts" />
/// <reference path="util.d.ts" />
/// <reference path="v8.d.ts" />
/// <reference path="vm.d.ts" />
/// <reference path="wasi.d.ts" />
/// <reference path="worker_threads.d.ts" />
/// <reference path="zlib.d.ts" />
@@ -0,0 +1 @@
{"version":3,"file":"compare-by-depth.mjs","sources":["../../../../src/projection/utils/compare-by-depth.ts"],"sourcesContent":["import type { VisualElement } from \"../../render/VisualElement\"\n\nexport interface WithDepth {\n depth: number\n}\n\nexport const compareByDepth = (a: VisualElement, b: VisualElement) =>\n a.depth - b.depth\n"],"names":[],"mappings":"AAMO,MAAM,cAAc,GAAG,CAAC,CAAgB,EAAE,CAAgB,KAC7D,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;;;;"}
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2023: LibDefinition;
@@ -0,0 +1,30 @@
/**
* @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 Flower = createLucideIcon("Flower", [
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
[
"path",
{
d: "M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5",
key: "14wa3c"
}
],
["path", { d: "M12 7.5V9", key: "1oy5b0" }],
["path", { d: "M7.5 12H9", key: "eltsq1" }],
["path", { d: "M16.5 12H15", key: "vk5kw4" }],
["path", { d: "M12 16.5V15", key: "k7eayi" }],
["path", { d: "m8 8 1.88 1.88", key: "nxy4qf" }],
["path", { d: "M14.12 9.88 16 8", key: "1lst6k" }],
["path", { d: "m8 16 1.88-1.88", key: "h2eex1" }],
["path", { d: "M14.12 14.12 16 16", key: "uqkrx3" }]
]);
export { Flower as default };
//# sourceMappingURL=flower.js.map
@@ -0,0 +1 @@
{"version":3,"file":"file-stack.js","sources":["../../../src/icons/file-stack.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileStack\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgN2gtM2EyIDIgMCAwIDEtMi0yVjIiIC8+CiAgPHBhdGggZD0iTTIxIDZ2Ni41YzAgLjgtLjcgMS41LTEuNSAxLjVoLTdjLS44IDAtMS41LS43LTEuNS0xLjV2LTljMC0uOC43LTEuNSAxLjUtMS41SDE3WiIgLz4KICA8cGF0aCBkPSJNNyA4djguOGMwIC4zLjIuNi40LjguMi4yLjUuNC44LjRIMTUiIC8+CiAgPHBhdGggZD0iTTMgMTJ2OC44YzAgLjMuMi42LjQuOC4yLjIuNS40LjguNEgxMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/file-stack\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 FileStack = createLucideIcon('FileStack', [\n ['path', { d: 'M21 7h-3a2 2 0 0 1-2-2V2', key: '9rb54x' }],\n [\n 'path',\n {\n d: 'M21 6v6.5c0 .8-.7 1.5-1.5 1.5h-7c-.8 0-1.5-.7-1.5-1.5v-9c0-.8.7-1.5 1.5-1.5H17Z',\n key: '1059l0',\n },\n ],\n ['path', { d: 'M7 8v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H15', key: '16874u' }],\n ['path', { d: 'M3 12v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H11', key: 'k2ox98' }],\n]);\n\nexport default FileStack;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,C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,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAyC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACxE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"is-svg-svg-element.mjs","sources":["../../../src/utils/is-svg-svg-element.ts"],"sourcesContent":["import { isSVGElement } from \"./is-svg-element\"\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nexport function isSVGSVGElement(element: unknown): element is SVGSVGElement {\n return isSVGElement(element) && element.tagName === \"svg\"\n}\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,SAAU,eAAe,CAAC,OAAgB,EAAA;IAC5C,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK;AAC7D;;;;"}
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2014-present, Lee Byron and other contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/es-errors
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with a single custom sponsorship URL
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"2":"_XH _8D _lE","16":"R"},C:{"2":"_S"},D:{"2":"_Q"},E:{"1":"B","2":"_1I _pK _WH _VH"},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:{"2":"_A"},O:{"2":"bC"},P:{"2":"_F"},Q:{"2":"JE"},R:{"2":"KE"},S:{"2":"_C"}},B:7,C:"Explicit descendant combinator >>",D:true};
@@ -0,0 +1 @@
{"version":3,"names":["_t","require","isBinding","isBlockScoped","nodeIsBlockScoped","isExportDeclaration","isExpression","nodeIsExpression","isFlow","nodeIsFlow","isForStatement","isForXStatement","isIdentifier","isImportDeclaration","isImportSpecifier","isJSXIdentifier","isJSXMemberExpression","isMemberExpression","isRestElement","nodeIsRestElement","isReferenced","nodeIsReferenced","isScope","nodeIsScope","isStatement","nodeIsStatement","isVar","nodeIsVar","isVariableDeclaration","react","isForOfStatement","isCompatTag","isReferencedIdentifier","opts","node","parent","parentPath","name","isReferencedMemberExpression","isBindingIdentifier","grandparent","left","init","isUser","_this$node","loc","isGenerated","isPure","constantsOnly","scope","importKind","exportKind","isRestProperty","_this$parentPath","isObjectPattern","isSpreadProperty","_this$parentPath2","isObjectExpression","isForAwaitStatement","await","exports","isExistentialTypeParam","Error","isNumericLiteralTypeAnnotation"],"sources":["../../../src/path/lib/virtual-types-validator.ts"],"sourcesContent":["import type NodePath from \"../index.ts\";\nimport {\n isBinding,\n isBlockScoped as nodeIsBlockScoped,\n isExportDeclaration,\n isExpression as nodeIsExpression,\n isFlow as nodeIsFlow,\n isForStatement,\n isForXStatement,\n isIdentifier,\n isImportDeclaration,\n isImportSpecifier,\n isJSXIdentifier,\n isJSXMemberExpression,\n isMemberExpression,\n isRestElement as nodeIsRestElement,\n isReferenced as nodeIsReferenced,\n isScope as nodeIsScope,\n isStatement as nodeIsStatement,\n isVar as nodeIsVar,\n isVariableDeclaration,\n react,\n isForOfStatement,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nconst { isCompatTag } = react;\nimport type { VirtualTypeAliases } from \"./virtual-types.ts\";\n\ntype Options<Obj> = Partial<{\n [Prop in Exclude<keyof Obj, \"type\">]: Obj[Prop] extends t.Node\n ? t.Node\n : Obj[Prop] extends t.Node[]\n ? t.Node[]\n : Obj[Prop];\n}>;\n\nexport interface VirtualTypeNodePathValidators {\n isBindingIdentifier(\n this: NodePath<t.Node | null>,\n ): this is NodePath<VirtualTypeAliases[\"BindingIdentifier\"]>;\n isBlockScoped(this: NodePath<t.Node | null>): boolean;\n /**\n * @deprecated\n */\n isExistentialTypeParam(\n this: NodePath<t.Node | null>,\n ): this is NodePath<VirtualTypeAliases[\"ExistentialTypeParam\"]>;\n isExpression(this: NodePath<t.Node | null>): this is NodePath<t.Expression>;\n isFlow(this: NodePath<t.Node | null>): this is NodePath<t.Flow>;\n isForAwaitStatement(\n this: NodePath<t.Node | null>,\n ): this is NodePath<VirtualTypeAliases[\"ForAwaitStatement\"]>;\n isGenerated(\n this: NodePath<t.Node | null>,\n ): this is NodePath<VirtualTypeAliases[\"Generated\"]>;\n /**\n * @deprecated\n */\n isNumericLiteralTypeAnnotation(this: NodePath<t.Node | null>): void;\n isPure(): boolean;\n isReferenced(): boolean;\n isReferencedIdentifier<\n Opts extends Options<VirtualTypeAliases[\"ReferencedIdentifier\"]>,\n >(\n this: NodePath<t.Node | null>,\n opts?: Opts,\n ): this is NodePath<VirtualTypeAliases[\"ReferencedIdentifier\"] & Opts>;\n isReferencedMemberExpression(\n this: NodePath<t.Node | null>,\n ): this is NodePath<VirtualTypeAliases[\"ReferencedMemberExpression\"]>;\n isRestProperty(\n this: NodePath<t.Node | null>,\n ): this is NodePath<t.RestProperty>;\n isScope(\n this: NodePath<t.Node | null>,\n ): this is NodePath<VirtualTypeAliases[\"Scope\"]>;\n isSpreadProperty(\n this: NodePath<t.Node | null>,\n ): this is NodePath<t.SpreadProperty>;\n isStatement(this: NodePath<t.Node | null>): this is NodePath<t.Statement>;\n isUser(\n this: NodePath<t.Node | null>,\n ): this is NodePath<VirtualTypeAliases[\"User\"]>;\n isVar(\n this: NodePath<t.Node | null>,\n ): this is NodePath<VirtualTypeAliases[\"Var\"]>;\n}\n\nexport function isReferencedIdentifier(\n this: NodePath<t.Node | null>,\n opts?: Options<VirtualTypeAliases[\"ReferencedIdentifier\"]>,\n): boolean {\n const { node, parent } = this;\n if (isIdentifier(node, opts)) {\n return nodeIsReferenced(node, parent, this.parentPath.parent);\n } else if (isJSXIdentifier(node, opts)) {\n if (!isJSXMemberExpression(parent) && isCompatTag(node.name)) return false;\n return nodeIsReferenced(node, parent, this.parentPath.parent);\n } else {\n // not a JSXIdentifier or an Identifier\n return false;\n }\n}\n\nexport function isReferencedMemberExpression(\n this: NodePath<t.Node | null>,\n): boolean {\n const { node, parent } = this;\n return isMemberExpression(node) && nodeIsReferenced(node, parent);\n}\n\nexport function isBindingIdentifier(this: NodePath<t.Node | null>): boolean {\n const { node, parent } = this;\n const grandparent = this.parentPath.parent;\n return isIdentifier(node) && isBinding(node, parent, grandparent);\n}\n\nexport function isStatement(this: NodePath<t.Node | null>): booLine truncated
@@ -0,0 +1,35 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
interface RegExpMatchArray {
groups?: {
[key: string]: string;
};
}
interface RegExpExecArray {
groups?: {
[key: string]: string;
};
}
interface RegExp {
/**
* Returns a Boolean value indicating the state of the dotAll flag (s) used with a regular expression.
* Default is false. Read-only.
*/
readonly dotAll: boolean;
}