docs: 仓库链接指向本镜像仓库
Build NapCat Artifacts / Type Check & Test (push) Waiting to run

This commit is contained in:
TanTan committed 2026-11-13 09:25:58 +08:00
1 parent f954252a34
commit e311ca3275
35554 files changed
+6229626 -4

No files matched your search

@@ -0,0 +1 @@
{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC"}
@@ -0,0 +1,46 @@
# String.prototype.trimStart <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
An ES2019-spec-compliant `String.prototype.trimStart` shim. Invoke its "shim" method to shim `String.prototype.trimStart` if it is unavailable.
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](https://www.ecma-international.org/ecma-262/6.0/#sec-object.assign). In an ES6 environment, it will also work properly with `Symbol`s.
Most common usage:
```js
var trimStart = require('string.prototype.trimstart');
assert(trimStart(' \t\na \t\n') === 'a \t\n');
if (!String.prototype.trimStart) {
trimStart.shim();
}
assert(trimStart(' \t\na \t\n') === ' \t\na \t\n'.trimStart());
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.com/package/string.prototype.trimstart
[npm-version-svg]: https://vb.teelaun.ch/es-shims/String.prototype.trimStart.svg
[deps-svg]: https://david-dm.org/es-shims/String.prototype.trimStart.svg
[deps-url]: https://david-dm.org/es-shims/String.prototype.trimStart
[dev-deps-svg]: https://david-dm.org/es-shims/String.prototype.trimStart/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/String.prototype.trimStart#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/string.prototype.trimstart.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/string.prototype.trimstart.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/string.prototype.trimstart.svg
[downloads-url]: https://npm-stat.com/charts.html?package=string.prototype.trimstart
[codecov-image]: https://codecov.io/gh/es-shims/String.prototype.trimStart/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/es-shims/String.prototype.trimStart/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/String.prototype.trimStart
[actions-url]: https://github.com/es-shims/String.prototype.trimStart/actions
@@ -0,0 +1 @@
{"version":3,"file":"resolveSingletonScopedBinding.spec.d.ts","sourceRoot":"","sources":["../../../../src/resolution/actions/resolveSingletonScopedBinding.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,109 @@
{
"name": "htmlparser2",
"version": "10.0.0",
"description": "Fast & forgiving HTML/XML parser",
"keywords": [
"html",
"parser",
"streams",
"xml",
"dom",
"rss",
"feed",
"atom"
],
"repository": {
"type": "git",
"url": "git://github.com/fb55/htmlparser2.git"
},
"funding": [
"https://github.com/fb55/htmlparser2?sponsor=1",
{
"type": "github",
"url": "https://github.com/sponsors/fb55"
}
],
"license": "MIT",
"author": "Felix Boehm <me@feedic.com>",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
},
"./WritableStream": {
"import": {
"types": "./dist/esm/WritableStream.d.ts",
"default": "./dist/esm/WritableStream.js"
},
"require": {
"types": "./dist/commonjs/WritableStream.d.ts",
"default": "./dist/commonjs/WritableStream.js"
}
}
},
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/commonjs/index.d.ts",
"files": [
"WritableStream.js",
"dist",
"src"
],
"scripts": {
"build": "tshy",
"format": "npm run format:es && npm run format:prettier",
"format:es": "npm run lint:es -- --fix",
"format:prettier": "npm run format:prettier:raw -- --write",
"format:prettier:raw": "prettier '**/*.{ts,md,json,yml}'",
"lint": "npm run lint:es && npm run lint:ts && npm run lint:prettier",
"lint:es": "eslint src",
"lint:prettier": "npm run format:prettier:raw -- --check",
"lint:ts": "tsc --noEmit",
"prepare": "npm run build",
"test": "npm run test:vi && npm run lint",
"test:vi": "vitest run"
},
"prettier": {
"tabWidth": 4
},
"dependencies": {
"domelementtype": "^2.3.0",
"domhandler": "^5.0.3",
"domutils": "^3.2.1",
"entities": "^6.0.0"
},
"devDependencies": {
"@types/node": "^22.10.2",
"@typescript-eslint/eslint-plugin": "^8.18.1",
"@typescript-eslint/parser": "^8.18.1",
"@vitest/coverage-v8": "^2.1.8",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-n": "^17.15.1",
"eslint-plugin-unicorn": "^56.0.1",
"prettier": "^3.4.2",
"tshy": "^3.0.2",
"typescript": "^5.7.2",
"vitest": "^2.0.2"
},
"tshy": {
"exclude": [
"**/*.spec.ts",
"**/__fixtures__/*",
"**/__tests__/*",
"**/__snapshots__/*"
],
"exports": {
".": "./src/index.ts",
"./WritableStream": "./src/WritableStream.ts"
}
}
}
@@ -0,0 +1 @@
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["normalize.js"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,iCANW,MAAM,GAEJ,MAAM,CAMlB"}
@@ -0,0 +1,28 @@
export type TSetIncludes<T extends PropertyKey[], S extends PropertyKey> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? S extends L ? true : TSetIncludes<R, S> : false);
/** Returns true if element right is in the set of left */
export declare function SetIncludes<T extends PropertyKey[], S extends PropertyKey>(T: [...T], S: S): TSetIncludes<T, S>;
export type TSetIsSubset<T extends PropertyKey[], S extends PropertyKey[]> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetIsSubset<R, S> : false : true);
/** Returns true if left is a subset of right */
export declare function SetIsSubset<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetIsSubset<T, S>;
export type TSetDistinct<T extends PropertyKey[], Acc extends PropertyKey[] = []> = T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<Acc, L> extends false ? TSetDistinct<R, [...Acc, L]> : TSetDistinct<R, [...Acc]> : Acc;
/** Returns a distinct set of elements */
export declare function SetDistinct<T extends PropertyKey[]>(T: [...T]): TSetDistinct<T>;
export type TSetIntersect<T extends PropertyKey[], S extends PropertyKey[], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetIntersect<R, S, [...Acc, L]> : TSetIntersect<R, S, [...Acc]> : Acc);
/** Returns the Intersect of the given sets */
export declare function SetIntersect<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetIntersect<T, S>;
export type TSetUnion<T extends PropertyKey[], S extends PropertyKey[]> = ([
...T,
...S
]);
/** Returns the Union of the given sets */
export declare function SetUnion<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetUnion<T, S>;
export type TSetComplement<T extends PropertyKey[], S extends PropertyKey[], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetComplement<R, S, [...Acc]> : TSetComplement<R, S, [...Acc, L]> : Acc);
/** Returns the Complement by omitting elements in T that are in S */
export declare function SetComplement<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetComplement<T, S>;
type TSetIntersectManyResolve<T extends PropertyKey[][], Acc extends PropertyKey[]> = (T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetIntersectManyResolve<R, TSetIntersect<Acc, L>> : Acc);
export type TSetIntersectMany<T extends PropertyKey[][]> = (T extends [infer L extends PropertyKey[]] ? L : T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetIntersectManyResolve<R, L> : []);
export declare function SetIntersectMany<T extends PropertyKey[][]>(T: [...T]): TSetIntersectMany<T>;
export type TSetUnionMany<T extends PropertyKey[][], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetUnionMany<R, TSetUnion<Acc, L>> : Acc);
/** Returns the Union of multiple sets */
export declare function SetUnionMany<T extends PropertyKey[][]>(T: [...T]): TSetUnionMany<T>;
export {};
@@ -0,0 +1,114 @@
[![Node.js CI](https://github.com/Borewit/tokenizer-inflate/actions/workflows/nodejs-ci.yml/badge.svg)](https://github.com/Borewit/tokenizer-inflate/actions/workflows/nodejs-ci.yml)
[![NPM version](https://badge.fury.io/js/%40tokenizer%2Finflate.svg)](https://npmjs.org/package/@tokenizer/inflate)
[![npm downloads](https://img.shields.io/npm/dm/@tokenizer%2Finflate.svg)](https://npmcharts.com/compare/%40tokenizer%2Finflate?start=1200&interval=30)
# @tokenizer/inflate
`@tokenizer/inflate` is a package designed for handling and extracting data from ZIP files efficiently using a tokenizer-based approach.
The library provides a customizable way to parse ZIP archives and extract compressed data while minimizing memory usage.
## Features
- Efficient Decompression: Handles streams compressed with DEFLATE and related formats (e.g., gzip).
- Tokenizer Compatibility: Seamlessly integrates with [strtok3](https://github.com/Borewit/strtok3). For example, use [@tokenizer/s3](https://github.com/Borewit/tokenizer-s3) for efficient partial extraction of a Zip stored on AWS S3 cloud file storage.
- Streamlined Interface: Provides an intuitive API for working with compressed data in streaming and random-access scenarios.
- Chunked Data Access: Leverages the underlying media's capabilities to offer chunked or random access to data, unlike traditional streams.
- Plug-and-Play: Easily integrate with existing tokenizer-based workflows for parsing file metadata or binary structures.
- Interrupt the extraction process conditionally.
## Installation
```bash
npm install @tokenizer/inflate
```
## Usage
### Example: Extracting Specific Files
The following example demonstrates how to use the library to extract .txt files and stop processing when encountering a .stop file.
```js
import { ZipHandler } from '@tokenizer/inflate';
import { fromFile } from 'strtok3';
const fileFilter = (file) => {
console.log(`Processing file: ${file.filename}`);
if (file.filename?.endsWith(".stop")) {
console.log(`Stopping processing due to file: ${file.filename}`);
return { handler: false, stop: true }; // Stop the unzip process
}
if (file.filename?.endsWith(".txt")) {
return {
handler: async (data) => {
console.log(`Extracted text file: ${file.filename}`);
console.log(new TextDecoder().decode(data));
},
};
}
return { handler: false }; // Ignore other files
};
async function extractFiles(zipFilePath) {
const tokenizer = await fromFile(zipFilePath);
const zipHandler = new ZipHandler(tokenizer);
await zipHandler.unzip(fileFilter);
}
extractFiles('example.zip').catch(console.error);
```
## API
### `ZipHandler`
A class for handling ZIP file parsing and extraction.
#### Constructor
```ts
new ZipHandler(tokenizer: ITokenizer)
```
- **tokenizer**: An instance of ITokenizer to read the ZIP archive.
#### Methods
- `isZip(): Promise<boolean>`
Determines whether the input file is a ZIP archive.
- `unzip(fileCb: InflateFileFilter): Promise<void>`
Extracts files from the ZIP archive, applying the provided `InflateFileFilter` callback to each file.
```InflatedDataHandler```
## Types
### `InflateFileFilter`
```ts
type InflateFileFilter = (file: IFullZipHeader) => InflateFileFilterResult;
```
Callback function to determine whether a file should be handled or ignored.
### `InflateFileFilterResult`
```ts
type InflateFileFilterResult = {
handler: InflatedDataHandler | false; // Handle file data or ignore
stop?: boolean; // Stop processing further files
};
```
Returned from `InflateFileFilter` to control file handling and extraction flow.
### `InflatedDataHandler`
```ts
type InflatedDataHandler = (fileData: Uint8Array) => Promise<void>;
```
Handler for processing uncompressed file data.
## Compatibility
This module is a [pure ECMAScript Module (ESM)](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
The distributed JavaScript codebase is compliant with the [ECMAScript 2020 (11th Edition)](https://en.wikipedia.org/wiki/ECMAScript_version_history#11th_Edition_%E2%80%93_ECMAScript_2020) standard.
If used with Node.js, it requires version ≥ 18.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,46 @@
'use strict';
// modified from https://github.com/es-shims/es6-shim
var objectKeys = require('object-keys');
var hasSymbols = require('has-symbols/shams')();
var callBound = require('call-bound');
var $Object = require('es-object-atoms');
var $push = callBound('Array.prototype.push');
var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');
var originalGetSymbols = hasSymbols ? $Object.getOwnPropertySymbols : null;
// eslint-disable-next-line no-unused-vars
module.exports = function assign(target, source1) {
if (target == null) { throw new TypeError('target must be an object'); }
var to = $Object(target); // step 1
if (arguments.length === 1) {
return to; // step 2
}
for (var s = 1; s < arguments.length; ++s) {
var from = $Object(arguments[s]); // step 3.a.i
// step 3.a.ii:
var keys = objectKeys(from);
var getSymbols = hasSymbols && ($Object.getOwnPropertySymbols || originalGetSymbols);
if (getSymbols) {
var syms = getSymbols(from);
for (var j = 0; j < syms.length; ++j) {
var key = syms[j];
if ($propIsEnumerable(from, key)) {
$push(keys, key);
}
}
}
// step 3.a.iii:
for (var i = 0; i < keys.length; ++i) {
var nextKey = keys[i];
if ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2
var propValue = from[nextKey]; // step 3.a.iii.2.a
to[nextKey] = propValue; // step 3.a.iii.2.b
}
}
}
return to; // step 4
};
@@ -0,0 +1,558 @@
# fflate
High performance (de)compression in an 8kB package
## Why fflate?
`fflate` (short for fast flate) is the **fastest, smallest, and most versatile** pure JavaScript compression and decompression library in existence, handily beating [`pako`](https://npmjs.com/package/pako), [`tiny-inflate`](https://npmjs.com/package/tiny-inflate), and [`UZIP.js`](https://github.com/photopea/UZIP.js) in performance benchmarks while being multiple times more lightweight. Its compression ratios are often better than even the original Zlib C library. It includes support for DEFLATE, GZIP, and Zlib data. Data compressed by `fflate` can be decompressed by other tools, and vice versa.
In addition to the base decompression and compression APIs, `fflate` supports high-speed ZIP file archiving for an extra 3 kB. In fact, the compressor, in synchronous mode, compresses both more quickly and with a higher compression ratio than most compression software (even Info-ZIP, a C program), and in asynchronous mode it can utilize multiple threads to achieve over 3x the performance of virtually any other utility.
| | `pako` | `tiny-inflate` | `UZIP.js` | `fflate` |
|-----------------------------|--------|------------------------|-----------------------|--------------------------------|
| Decompression performance | 1x | Up to 40% slower | **Up to 40% faster** | **Up to 40% faster** |
| Compression performance | 1x | N/A | Up to 25% faster | **Up to 50% faster** |
| Base bundle size (minified) | 45.6kB | **3kB (inflate only)** | 14.2kB | 8kB **(3kB for inflate only)** |
| Decompression support | ✅ | ✅ | ✅ | ✅ |
| Compression support | ✅ | ❌ | ✅ | ✅ |
| ZIP support | ❌ | ❌ | ✅ | ✅ |
| Streaming support | ✅ | ❌ | ❌ | ✅ |
| GZIP support | ✅ | ❌ | ❌ | ✅ |
| Supports files up to 4GB | ✅ | ❌ | ❌ | ✅ |
| Doesn't hang on error | ✅ | ❌ | ❌ | ✅ |
| Dictionary support | ✅ | ❌ | ❌ | ✅ |
| Multi-thread/Asynchronous | ❌ | ❌ | ❌ | ✅ |
| Streaming ZIP support | ❌ | ❌ | ❌ | ✅ |
| Uses ES Modules | ❌ | ❌ | ❌ | ✅ |
## Demo
If you'd like to try `fflate` for yourself without installing it, you can take a look at the [browser demo](https://101arrowz.github.io/fflate). Since `fflate` is a pure JavaScript library, it works in both the browser and Node.js (see [Browser support](https://github.com/101arrowz/fflate/#browser-support) for more info).
## Usage
Install `fflate`:
```sh
npm i fflate # or yarn add fflate, or pnpm add fflate
```
Import:
```js
// I will assume that you use the following for the rest of this guide
import * as fflate from 'fflate';
// However, you should import ONLY what you need to minimize bloat.
// So, if you just need GZIP compression support:
import { gzipSync } from 'fflate';
// Woo! You just saved 20 kB off your bundle with one line.
```
If your environment doesn't support ES Modules (e.g. Node.js):
```js
// Try to avoid this when using fflate in the browser, as it will import
// all of fflate's components, even those that you aren't using.
const fflate = require('fflate');
```
If you want to load from a CDN in the browser:
```html
<!--
You should use either UNPKG or jsDelivr (i.e. only one of the following)
Note that tree shaking is completely unsupported from the CDN. If you want
a small build without build tools, please ask me and I will make one manually
with only the features you need. This build is about 31kB, or 11.5kB gzipped.
-->
<script src="https://unpkg.com/fflate@0.8.2"></script>
<script src="https://cdn.jsdelivr.net/npm/fflate@0.8.2/umd/index.js"></script>
<!-- Now, the global variable fflate contains the library -->
<!-- If you're going buildless but want ESM, import from Skypack -->
<script type="module">
import * as fflate from 'https://cdn.skypack.dev/fflate@0.8.2?min';
</script>
```
If you are using Deno:
```js
// Don't use the ?dts Skypack flag; it isn't necessary for Deno support
// The @deno-types comment adds TypeScript typings
// @deno-types="https://cdn.skypack.dev/fflate@0.8.2/lib/index.d.ts"
import * as fflate from 'https://cdn.skypack.dev/fflate@0.8.2?min';
```
If your environment doesn't support bundling:
```js
// Again, try to import just what you need
// For the browser:
import * as fflate from 'fflate/esm/browser.js';
// If the standard ESM import fails on Node (i.e. older version):
import * as fflate from 'fflate/esm';
```
And use:
```js
// This is an ArrayBuffer of data
const massiveFileBuf = await fetch('/aMassiveFile').then(
res => res.arrayBuffer()
);
// To use fflate, you need a Uint8Array
const massiveFile = new Uint8Array(massiveFileBuf);
// Note that Node.js Buffers work just fine as well:
// const massiveFile = require('fs').readFileSync('aMassiveFile.txt');
// Higher level means lower performance but better compression
// The level ranges from 0 (no compression) to 9 (max compression)
// The default level is 6
const notSoMassive = fflate.zlibSync(massiveFile, { level: 9 });
const massiveAgain = fflate.unzlibSync(notSoMassive);
const gzipped = fflate.gzipSync(massiveFile, {
// GZIP-specific: the filename to use when decompressed
filename: 'aMassiveFile.txt',
// GZIP-specific: the modification time. Can be a Date, date string,
// or Unix timestamp
mtime: '9/1/16 2:00 PM'
});
```
`fflate` can autodetect a compressed file's format as well:
```js
const compressed = new Uint8Array(
await fetch('/GZIPorZLIBorDEFLATE').then(res => res.arrayBuffer())
);
// Above example with Node.js Buffers:
// Buffer.from('H4sIAAAAAAAAE8tIzcnJBwCGphA2BQAAAA==', 'base64');
const decompressed = fflate.decompressSync(compressed);
```
Using strings is easy with `fflate`'s string conversion API:
```js
const buf = fflate.strToU8('Hello world!');
// The default compression method is gzip
// Increasing mem may increase performance at the cost of memory
// The mem ranges from 0 to 12, where 4 is the default
const compressed = fflate.compressSync(buf, { level: 6, mem: 8 });
// When you need to decompress:
const decompressed = fflate.decompressSync(compressed);
const origText = fflate.strFromU8(decompressed);
console.log(origText); // Hello world!
```
If you need to use an (albeit inefficient) binary string, you can set the second argument to `true`.
```js
const buf = fflate.strToU8('Hello world!');
// The second argument, latin1, is a boolean that indicates that the data
// is not Unicode but rather should be encoded and decoded as Latin-1.
// This is useful for creating a string from binary data that isn't
// necessarily valid UTF-8. However, binary strings are incredibly
// inefficient and tend to double file size, so they're not recommended.
const compressedString = fflate.strFromU8(
fflate.compressSync(buf),
true
);
const decompressed = fflate.decompressSync(
fflate.strToU8(compressedString, true)
);
const origText = fflate.strFromU8(decompressed);
console.log(origText); // Hello world!
```
You can use streams as well to incrementally add data to be compressed or decompressed:
```js
// This example uses synchronous streams, but for the best experience
// you'll definitely want to use asynchronous streams.
let outStr = '';
const gzipStream = new fflate.Gzip({ level: 9 }, (chunk, isLast) => {
// accumulate in an inefficient binary string (just an example)
outStr += fflate.strFromU8(chunk, true);
});
// You can also attach the data handler separately if you don't want to
// do so in the constructor.
gzipStream.ondata = (chunk, final) => { ... }
// Since this is synchronous, all errors will be thrown by stream.push()
gzipStream.push(chunk1);
gzipStream.push(chunk2);
...
// You should mark the last chunk by using true in the second argument
// In addition to being necessary for the stream to work properly, this
// will also set the isLast parameter in the handler to true.
gzipStream.push(lastChunk, true);
console.log(outStr); // The compressed binary string is now available
// The options parameter for compression streams is optional; you can
// provide one parameter (the handler) or none at all if you set
// deflateStream.ondata later.
const deflateStream = new fflate.Deflate((chunk, final) => {
console.log(chunk, final);
});
// If you want to create a stream from strings, use EncodeUTF8
const utfEncode = new fflate.EncodeUTF8((data, final) => {
// Chaining streams together is done by pushing to the
// next stream in the handler for the previous stream
deflateStream.push(data, final);
});
utfEncode.push('Hello'.repeat(1000));
utfEncode.push(' '.repeat(100));
utfEncode.push('world!'.repeat(10), true);
// The deflateStream has logged the compressed data
const inflateStream = new fflate.Inflate();
inflateStream.ondata = (decompressedChunk, final) => { ... };
let stringData = '';
// Streaming UTF-8 decode is available too
const utfDecode = new fflate.DecodeUTF8((data, final) => {
stringData += data;
});
// Decompress streams auto-detect the compression method, as the
// non-streaming decompress() method does.
const dcmpStrm = new fflate.Decompress((chunk, final) => {
console.log(chunk, 'was encoded with GZIP, Zlib, or DEFLATE');
utfDecode.push(chunk, final);
});
dcmpStrm.push(zlibJSONData1);
dcmpStrm.push(zlibJSONData2, true);
// This succeeds; the UTF-8 decoder chained with the unknown compression format
// stream to reach a string as a sink.
console.log(JSON.parse(stringData));
```
You can create multi-file ZIP archives easily as well. Note that by default, compression is enabled for all files, which is not useful when ZIPping many PNGs, JPEGs, PDFs, etc. because those formats are already compressed. You should either override the level on a per-file basis or globally to avoid wasting resources.
```js
// Note that the asynchronous version (see below) runs in parallel and
// is *much* (up to 3x) faster for larger archives.
const zipped = fflate.zipSync({
// Directories can be nested structures, as in an actual filesystem
'dir1': {
'nested': {
// You can use Unicode in filenames
'你好.txt': fflate.strToU8('Hey there!')
},
// You can also manually write out a directory path
'other/tmp.txt': new Uint8Array([97, 98, 99, 100])
},
// You can also provide compression options
'massiveImage.bmp': [aMassiveFile, {
level: 9,
mem: 12
}],
// PNG is pre-compressed; no need to waste time
'superTinyFile.png': [aPNGFile, { level: 0 }],
// Directories take options too
'exec': [{
'hello.sh': [fflate.strToU8('echo hello world'), {
// ZIP only: Set the operating system to Unix
os: 3,
// ZIP only: Make this file executable on Unix
attrs: 0o755 << 16
}]
}, {
// ZIP and GZIP support mtime (defaults to current time)
mtime: new Date('10/20/2020')
}]
}, {
// These options are the defaults for all files, but file-specific
// options take precedence.
level: 1,
// Obfuscate last modified time by default
mtime: new Date('1/1/1980')
});
// If you write the zipped data to myzip.zip and unzip, the folder
// structure will be outputted as:
// myzip.zip (original file)
// dir1
// |-> nested
// | |-> 你好.txt
// |-> other
// | |-> tmp.txt
// massiveImage.bmp
// superTinyFile.png
// When decompressing, folders are not nested; all filepaths are fully
// written out in the keys. For example, the return value may be:
// { 'nested/directory/structure.txt': Uint8Array(2) [97, 97] }
const decompressed = fflate.unzipSync(zipped, {
// You may optionally supply a filter for files. By default, all files in a
// ZIP archive are extracted, but a filter can save resources by telling
// the library not to decompress certain files
filter(file) {
// Don't decompress the massive image or any files larger than 10 MiB
return file.name != 'massiveImage.bmp' && file.originalSize <= 10_000_000;
}
});
```
If you need extremely high performance or custom ZIP compression formats, you can use the highly-extensible ZIP streams. They take streams as both input and output. You can even use custom compression/decompression algorithms from other libraries, as long as they [are defined in the ZIP spec](https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT) (see section 4.4.5). If you'd like more info on using custom compressors, [feel free to ask](https://github.com/101arrowz/fflate/discussions).
```js
// ZIP object
// Can also specify zip.ondata outside of the constructor
const zip = new fflate.Zip((err, dat, final) => {
if (!err) {
// output of the streams
console.log(dat, final);
}
});
const helloTxt = new fflate.ZipDeflate('hello.txt', {
level: 9
});
// Always add streams to ZIP archives before pushing to those streams
zip.add(helloTxt);
helloTxt.push(chunk1);
// Last chunk
helloTxt.push(chunk2, true);
// ZipPassThrough is like ZipDeflate with level 0, but allows for tree shaking
const nonStreamingFile = new fflate.ZipPassThrough('test.png');
zip.add(nonStreamingFile);
// If you have data already loaded, just .push(data, true)
nonStreamingFile.push(pngData, true);
// You need to call .end() after finishing
// This ensures the ZIP is valid
zip.end();
// Unzip object
const unzipper = new fflate.Unzip();
// This function will almost always have to be called. It is used to support
// compression algorithms such as BZIP2 or LZMA in ZIP files if just DEFLATE
// is not enough (though it almost always is).
// If your ZIP files are not compressed, this line is not needed.
unzipper.register(fflate.UnzipInflate);
const neededFiles = ['file1.txt', 'example.json'];
// Can specify handler in constructor too
unzipper.onfile = file => {
// file.name is a string, file is a stream
if (neededFiles.includes(file.name)) {
file.ondata = (err, dat, final) => {
// Stream output here
console.log(dat, final);
};
console.log('Reading:', file.name);
// File sizes are sometimes not set if the ZIP file did not encode
// them, so you may want to check that file.size != undefined
console.log('Compressed size', file.size);
console.log('Decompressed size', file.originalSize);
// You should only start the stream if you plan to use it to improve
// performance. Only after starting the stream will ondata be called.
// This method will throw if the compression method hasn't been registered
file.start();
}
};
// Try to keep under 5,000 files per chunk to avoid stack limit errors
// For example, if all files are a few kB, multi-megabyte chunks are OK
// If files are mostly under 100 bytes, 64kB chunks are the limit
unzipper.push(zipChunk1);
unzipper.push(zipChunk2);
unzipper.push(zipChunk3, true);
```
As you may have guessed, there is an asynchronous version of every method as well. Unlike most libraries, this will cause the compression or decompression run in a separate thread entirely and automatically by using Web (or Node) Workers. This means that the processing will not block the main thread at all.
Note that there is a significant initial overhead to using workers of about 50ms for each asynchronous function. For instance, if you call `unzip` ten times, the overhead only applies for the first call, but if you call `unzip` and `zlib`, they will each cause the 50ms delay. For small (under about 50kB) payloads, the asynchronous APIs will be much slower. However, if you're compressing larger files/multiple files at once, or if the synchronous API causes the main thread to hang for too long, the callback APIs are an order of magnitude better.
```js
import {
gzip, zlib, AsyncGzip, zip, unzip, strFromU8,
Zip, AsyncZipDeflate, Unzip, AsyncUnzipInflate
} from 'fflate';
// Workers will work in almost any browser (even IE11!)
// All of the async APIs use a node-style callback as so:
const terminate = gzip(aMassiveFile, (err, data) => {
if (err) {
// The compressed data was likely corrupt, so we have to handle
// the error.
return;
}
// Use data however you like
console.log(data.length);
});
if (needToCancel) {
// The return value of any of the asynchronous APIs is a function that,
// when called, will immediately cancel the operation. The callback
// will not be called.
terminate();
}
// If you wish to provide options, use the second argument.
// The consume option will render the data inside aMassiveFile unusable,
// but can improve performance and dramatically reduce memory usage.
zlib(aMassiveFile, { consume: true, level: 9 }, (err, data) => {
// Use the data
});
// Asynchronous streams are similar to synchronous streams, but the
// handler has the error that occurred (if any) as the first parameter,
// and they don't block the main thread.
// Additionally, any buffers that are pushed in will be consumed and
// rendered unusable; if you need to use a buffer you push in, you
// should clone it first.
const gzs = new AsyncGzip({ level: 9, mem: 12, filename: 'hello.txt' });
let wasCallbackCalled = false;
gzs.ondata = (err, chunk, final) => {
// Note the new err parameter
if (err) {
// Note that after this occurs, the stream becomes corrupt and must
// be discarded. You can't continue pushing chunks and expect it to
// work.
console.error(err);
return;
}
wasCallbackCalled = true;
}
gzs.push(chunk);
// Since the stream is asynchronous, the callback will not be called
// immediately. If such behavior is absolutely necessary (it shouldn't
// be), use synchronous streams.
console.log(wasCallbackCalled) // false
// To terminate an asynchronous stream's internal worker, call
// stream.terminate().
gzs.terminate();
// This is way faster than zipSync because the compression of multiple
// files runs in parallel. In fact, the fact that it's parallelized
// makes it faster than most standalone ZIP CLIs. The effect is most
// significant for multiple large files; less so for many small ones.
zip({ f1: aMassiveFile, 'f2.txt': anotherMassiveFile }, {
// The options object is still optional, you can still do just
// zip(archive, callback)
level: 6
}, (err, data) => {
// Save the ZIP file
});
// unzip is the only async function without support for consume option
// It is parallelized, so unzip is also often much faster than unzipSync
unzip(aMassiveZIPFile, (err, unzipped) => {
// If the archive has data.xml, log it here
console.log(unzipped['data.xml']);
// Conversion to string
console.log(strFromU8(unzipped['data.xml']))
});
// Streaming ZIP archives can accept asynchronous streams. This automatically
// uses multicore compression.
const zip = new Zip();
zip.ondata = (err, chunk, final) => { ... };
// The JSON and BMP are compressed in parallel
const exampleFile = new AsyncZipDeflate('example.json');
zip.add(exampleFile);
exampleFile.push(JSON.stringify({ large: 'object' }), true);
const exampleFile2 = new AsyncZipDeflate('example2.bmp', { level: 9 });
zip.add(exampleFile2);
exampleFile2.push(ec2a);
exampleFile2.push(ec2b);
exampleFile2.push(ec2c);
...
exampleFile2.push(ec2Final, true);
zip.end();
// Streaming Unzip should register the asynchronous inflation algorithm
// for parallel processing.
const unzip = new Unzip(stream => {
if (stream.name.endsWith('.json')) {
stream.ondata = (err, chunk, final) => { ... };
stream.start();
if (needToCancel) {
// To cancel these streams, call .terminate()
stream.terminate();
}
}
});
unzip.register(AsyncUnzipInflate);
unzip.push(data, true);
```
See the [documentation](https://github.com/101arrowz/fflate/blob/master/docs/README.md) for more detailed information about the API.
## Bundle size estimates
The bundle size measurements for `fflate` on sites like Bundlephobia include every feature of the library and should be seen as an upper bound. As long as you are using tree shaking or dead code elimination, this table should give you a general idea of `fflate`'s bundle size for the features you need.
The maximum bundle size that is possible with `fflate` is about 31kB (11.5kB gzipped) if you use every single feature, but feature parity with `pako` is only around 10kB (as opposed to 45kB from `pako`). If your bundle size increases dramatically after adding `fflate`, please [create an issue](https://github.com/101arrowz/fflate/issues/new).
| Feature | Bundle size (minified) | Nearest competitor |
|-------------------------|--------------------------------|-------------------------|
| Decompression | 3kB | `tiny-inflate` |
| Compression | 5kB | `UZIP.js`, 2.84x larger |
| Async decompression | 4kB (1kB + raw decompression) | N/A |
| Async compression | 6kB (1kB + raw compression) | N/A |
| ZIP decompression | 5kB (2kB + raw decompression) | `UZIP.js`, 2.84x larger |
| ZIP compression | 7kB (2kB + raw compression) | `UZIP.js`, 2.03x larger |
| GZIP/Zlib decompression | 4kB (1kB + raw decompression) | `pako`, 11.4x larger |
| GZIP/Zlib compression | 5kB (1kB + raw compression) | `pako`, 9.12x larger |
| Streaming decompression | 4kB (1kB + raw decompression) | `pako`, 11.4x larger |
| Streaming compression | 5kB (1kB + raw compression) | `pako`, 9.12x larger |
## What makes `fflate` so fast?
Many JavaScript compression/decompression libraries exist. However, the most popular one, [`pako`](https://npmjs.com/package/pako), is merely a clone of Zlib rewritten nearly line-for-line in JavaScript. Although it is by no means poorly made, `pako` doesn't recognize the many differences between JavaScript and C, and therefore is suboptimal for performance. Moreover, even when minified, the library is 45 kB; it may not seem like much, but for anyone concerned with optimizing bundle size (especially library authors), it's more weight than necessary.
Note that there exist some small libraries like [`tiny-inflate`](https://npmjs.com/package/tiny-inflate) for solely decompression, and with a minified size of 3 kB, it can be appealing; however, its performance is lackluster, typically 40% worse than `pako` in my tests.
[`UZIP.js`](https://github.com/photopea/UZIP.js) is both faster (by up to 40%) and smaller (14 kB minified) than `pako`, and it contains a variety of innovations that make it excellent for both performance and compression ratio. However, the developer made a variety of tiny mistakes and inefficient design choices that make it imperfect. Moreover, it does not support GZIP or Zlib data directly; one must remove the headers manually to use `UZIP.js`.
So what makes `fflate` different? It takes the brilliant innovations of `UZIP.js` and optimizes them while adding direct support for GZIP and Zlib data. And unlike all of the above libraries, it uses ES Modules to allow for partial builds through tree shaking, meaning that it can rival even `tiny-inflate` in size while maintaining excellent performance. The end result is a library that, in total, weighs 8kB minified for the core build (3kB for decompression only and 5kB for compression only), is about 15% faster than `UZIP.js` or up to 60% faster than `pako`, and achieves the same or better compression ratio than the rest.
Before you decide that `fflate` is the end-all compression library, you should note that JavaScript simply cannot rival the performance of a native program. If you're only using Node.js, it's probably better to use the [native Zlib bindings](https://nodejs.org/api/zlib.html), which tend to offer the best performance. Though note that even against Zlib, `fflate` is only around 30% slower in decompression and 10% slower in compression, and can still achieve better compression ratios!
## What about `CompressionStream`?
Like `fflate`, the [Compression Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Compression_Streams_API) provides DEFLATE, GZIP, and Zlib compression and decompression support. It's a good option if you'd like to compress or decompress data without installing any third-party libraries, and it wraps native Zlib bindings to achieve better performance than what most JavaScript programs can achieve.
However, browsers do not offer any native non-streaming compression API, and `CompressionStream` has surprisingly poor performance on data already loaded into memory; `fflate` tends to be faster even for files that are dozens of megabytes large. Similarly, `fflate` is much faster for files under a megabyte because it avoids marshalling overheads. Even when streaming hundreds of megabytes of data, the native API usually performs between 30% faster and 10% slower than `fflate`. And Compression Streams have many other disadvantages - no ability to control compression level, poor support for older browsers, no ZIP support, etc.
If you'd still prefer to depend upon a native browser API but want to support older browsers, you can use an `fflate`-based [Compression Streams ponyfill](https://github.com/101arrowz/compression-streams-polyfill).
## Browser support
`fflate` makes heavy use of typed arrays (`Uint8Array`, `Uint16Array`, etc.). Typed arrays can be polyfilled at the cost of performance, but the most recent browser that doesn't support them [is from 2011](https://caniuse.com/typedarrays), so I wouldn't bother.
The asynchronous APIs also use `Worker`, which is not supported in a few browsers (however, the vast majority of browsers that support typed arrays support `Worker`).
Other than that, `fflate` is completely ES3, meaning you probably won't even need a bundler to use it.
## Testing
You can validate the performance of `fflate` with `npm test`. It validates that the module is working as expected, ensures the outputs are no more than 5% larger than competitors at max compression, and outputs performance metrics to `test/results`.
Note that the time it takes for the CLI to show the completion of each test is not representative of the time each package took, so please check the JSON output if you want accurate measurements.
## License
This software is [MIT Licensed](./LICENSE), with special exemptions for projects
and organizations as noted below:
- [SheetJS](https://github.com/SheetJS/) is exempt from MIT licensing and may
license any source code from this software under the BSD Zero Clause License
@@ -0,0 +1,2 @@
import type { TSESTree } from '@typescript-eslint/utils';
export declare function isNullLiteral(i: TSESTree.Node): i is TSESTree.NullLiteral;
@@ -0,0 +1,32 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
module.exports = {
meta: {
docs: {
description: "disallow destructuring.",
category: "ES2015",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-destructuring.html",
},
fixable: null,
messages: {
forbidden: "ES2015 destructuring is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
":matches(:function, AssignmentExpression, VariableDeclarator, :function > :matches(AssignmentPattern, RestElement), ForInStatement, ForOfStatement) > :matches(ArrayPattern, ObjectPattern)"(
node
) {
context.report({ node, messageId: "forbidden" })
},
}
},
}
@@ -0,0 +1 @@
{"version":3,"file":"Container.spec.d.ts","sourceRoot":"","sources":["../../../../src/container/services/Container.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
import { type ZodErrorMap } from "../ZodError.js";
declare const errorMap: ZodErrorMap;
export default errorMap;
@@ -0,0 +1,11 @@
export * from './AST';
export * from './Config';
export * from './ESLint';
export * from './Linter';
export * from './Parser';
export * from './ParserOptions';
export * from './Processor';
export * from './Rule';
export * from './RuleTester';
export * from './Scope';
export * from './SourceCode';
@@ -0,0 +1,90 @@
{
"name": "safe-array-concat",
"version": "1.1.3",
"description": "`Array.prototype.concat`, but made safe by ignoring Symbol.isConcatSpreadable",
"main": "index.js",
"exports": {
".": "./index.js",
"./package.json": "./package.json"
},
"sideEffects": false,
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"",
"prelint": "evalmd README.md",
"lint": "eslint --ext=js,mjs .",
"postlint": "tsc && attw -P",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"pretest": "npm run lint",
"tests-only": "nyc tape test",
"test": "npm run tests-only",
"posttest": "npx npm@'>= 10.2' audit --production"
},
"keywords": [
"safe",
"Array",
"concat",
"push",
"isConcatSpreadable"
],
"author": "Jordan Harband <ljharb@gmail.com>",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/ljharb/safe-array-concat.git"
},
"bugs": {
"url": "https://github.com/ljharb/safe-array-concat/issues"
},
"homepage": "https://github.com/ljharb/safe-array-concat#readme",
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.1",
"@ljharb/eslint-config": "^21.1.1",
"@ljharb/tsconfig": "^0.2.2",
"@types/call-bind": "^1.0.5",
"@types/get-intrinsic": "^1.2.3",
"@types/has-symbols": "^1.0.2",
"@types/isarray": "^2.0.2",
"@types/tape": "^5.6.5",
"auto-changelog": "^2.5.0",
"encoding": "^0.1.13",
"eslint": "=8.8.0",
"evalmd": "^0.0.19",
"in-publish": "^2.0.1",
"mock-property": "^1.1.0",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"set-function-length": "^1.2.2",
"tape": "^5.9.0",
"typescript": "next"
},
"dependencies": {
"call-bind": "^1.0.8",
"call-bound": "^1.0.2",
"get-intrinsic": "^1.2.6",
"has-symbols": "^1.1.0",
"isarray": "^2.0.5"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows"
]
},
"engines": {
"node": ">=0.4"
}
}
@@ -0,0 +1,50 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var roletypeRole = {
abstract: true,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: [],
prohibitedProps: [],
props: {
'aria-atomic': null,
'aria-busy': null,
'aria-controls': null,
'aria-current': null,
'aria-describedby': null,
'aria-details': null,
'aria-dropeffect': null,
'aria-flowto': null,
'aria-grabbed': null,
'aria-hidden': null,
'aria-keyshortcuts': null,
'aria-label': null,
'aria-labelledby': null,
'aria-live': null,
'aria-owns': null,
'aria-relevant': null,
'aria-roledescription': null
},
relatedConcepts: [{
concept: {
name: 'role'
},
module: 'XHTML'
}, {
concept: {
name: 'type'
},
module: 'Dublin Core'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: []
};
var _default = exports.default = roletypeRole;
@@ -0,0 +1,356 @@
import * as core from "../core/index.cjs";
import { util } from "../core/index.cjs";
type SomeType = core.SomeType;
export interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {
check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
clone(def?: Internals["def"], params?: {
parent: boolean;
}): this;
register<R extends core.$ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [core.$replace<R["_meta"], this>?] : [core.$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
brand<T extends PropertyKey = PropertyKey>(value?: T): PropertyKey extends T ? this : this & Record<"_zod", Record<"output", core.output<this> & core.$brand<T>>>;
def: Internals["def"];
parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
safeParse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): util.SafeParseResult<core.output<this>>;
parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
safeParseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<util.SafeParseResult<core.output<this>>>;
}
interface _ZodMiniType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals> extends ZodMiniType<any, any, Internals> {
}
export declare const ZodMiniType: core.$constructor<ZodMiniType>;
export interface _ZodMiniString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>> extends _ZodMiniType<T>, core.$ZodString<T["input"]> {
_zod: T;
}
export interface ZodMiniString<Input = unknown> extends _ZodMiniString<core.$ZodStringInternals<Input>>, core.$ZodString<Input> {
}
export declare const ZodMiniString: core.$constructor<ZodMiniString>;
export declare function string(params?: string | core.$ZodStringParams): ZodMiniString<string>;
export interface ZodMiniStringFormat<Format extends string = string> extends _ZodMiniString<core.$ZodStringFormatInternals<Format>>, core.$ZodStringFormat<Format> {
}
export declare const ZodMiniStringFormat: core.$constructor<ZodMiniStringFormat>;
export interface ZodMiniEmail extends _ZodMiniString<core.$ZodEmailInternals> {
}
export declare const ZodMiniEmail: core.$constructor<ZodMiniEmail>;
export declare function email(params?: string | core.$ZodEmailParams): ZodMiniEmail;
export interface ZodMiniGUID extends _ZodMiniString<core.$ZodGUIDInternals> {
}
export declare const ZodMiniGUID: core.$constructor<ZodMiniGUID>;
export declare function guid(params?: string | core.$ZodGUIDParams): ZodMiniGUID;
export interface ZodMiniUUID extends _ZodMiniString<core.$ZodUUIDInternals> {
}
export declare const ZodMiniUUID: core.$constructor<ZodMiniUUID>;
export declare function uuid(params?: string | core.$ZodUUIDParams): ZodMiniUUID;
export declare function uuidv4(params?: string | core.$ZodUUIDv4Params): ZodMiniUUID;
export declare function uuidv6(params?: string | core.$ZodUUIDv6Params): ZodMiniUUID;
export declare function uuidv7(params?: string | core.$ZodUUIDv7Params): ZodMiniUUID;
export interface ZodMiniURL extends _ZodMiniString<core.$ZodURLInternals> {
}
export declare const ZodMiniURL: core.$constructor<ZodMiniURL>;
export declare function url(params?: string | core.$ZodURLParams): ZodMiniURL;
export interface ZodMiniEmoji extends _ZodMiniString<core.$ZodEmojiInternals> {
}
export declare const ZodMiniEmoji: core.$constructor<ZodMiniEmoji>;
export declare function emoji(params?: string | core.$ZodEmojiParams): ZodMiniEmoji;
export interface ZodMiniNanoID extends _ZodMiniString<core.$ZodNanoIDInternals> {
}
export declare const ZodMiniNanoID: core.$constructor<ZodMiniNanoID>;
export declare function nanoid(params?: string | core.$ZodNanoIDParams): ZodMiniNanoID;
export interface ZodMiniCUID extends _ZodMiniString<core.$ZodCUIDInternals> {
}
export declare const ZodMiniCUID: core.$constructor<ZodMiniCUID>;
export declare function cuid(params?: string | core.$ZodCUIDParams): ZodMiniCUID;
export interface ZodMiniCUID2 extends _ZodMiniString<core.$ZodCUID2Internals> {
}
export declare const ZodMiniCUID2: core.$constructor<ZodMiniCUID2>;
export declare function cuid2(params?: string | core.$ZodCUID2Params): ZodMiniCUID2;
export interface ZodMiniULID extends _ZodMiniString<core.$ZodULIDInternals> {
}
export declare const ZodMiniULID: core.$constructor<ZodMiniULID>;
export declare function ulid(params?: string | core.$ZodULIDParams): ZodMiniULID;
export interface ZodMiniXID extends _ZodMiniString<core.$ZodXIDInternals> {
}
export declare const ZodMiniXID: core.$constructor<ZodMiniXID>;
export declare function xid(params?: string | core.$ZodXIDParams): ZodMiniXID;
export interface ZodMiniKSUID extends _ZodMiniString<core.$ZodKSUIDInternals> {
}
export declare const ZodMiniKSUID: core.$constructor<ZodMiniKSUID>;
export declare function ksuid(params?: string | core.$ZodKSUIDParams): ZodMiniKSUID;
export interface ZodMiniIPv4 extends _ZodMiniString<core.$ZodIPv4Internals> {
}
export declare const ZodMiniIPv4: core.$constructor<ZodMiniIPv4>;
export declare function ipv4(params?: string | core.$ZodIPv4Params): ZodMiniIPv4;
export interface ZodMiniIPv6 extends _ZodMiniString<core.$ZodIPv6Internals> {
}
export declare const ZodMiniIPv6: core.$constructor<ZodMiniIPv6>;
export declare function ipv6(params?: string | core.$ZodIPv6Params): ZodMiniIPv6;
export interface ZodMiniCIDRv4 extends _ZodMiniString<core.$ZodCIDRv4Internals> {
}
export declare const ZodMiniCIDRv4: core.$constructor<ZodMiniCIDRv4>;
export declare function cidrv4(params?: string | core.$ZodCIDRv4Params): ZodMiniCIDRv4;
export interface ZodMiniCIDRv6 extends _ZodMiniString<core.$ZodCIDRv6Internals> {
}
export declare const ZodMiniCIDRv6: core.$constructor<ZodMiniCIDRv6>;
export declare function cidrv6(params?: string | core.$ZodCIDRv6Params): ZodMiniCIDRv6;
export interface ZodMiniBase64 extends _ZodMiniString<core.$ZodBase64Internals> {
}
export declare const ZodMiniBase64: core.$constructor<ZodMiniBase64>;
export declare function base64(params?: string | core.$ZodBase64Params): ZodMiniBase64;
export interface ZodMiniBase64URL extends _ZodMiniString<core.$ZodBase64URLInternals> {
}
export declare const ZodMiniBase64URL: core.$constructor<ZodMiniBase64URL>;
export declare function base64url(params?: string | core.$ZodBase64URLParams): ZodMiniBase64URL;
export interface ZodMiniE164 extends _ZodMiniString<core.$ZodE164Internals> {
}
export declare const ZodMiniE164: core.$constructor<ZodMiniE164>;
export declare function e164(params?: string | core.$ZodE164Params): ZodMiniE164;
export interface ZodMiniJWT extends _ZodMiniString<core.$ZodJWTInternals> {
}
export declare const ZodMiniJWT: core.$constructor<ZodMiniJWT>;
export declare function jwt(params?: string | core.$ZodJWTParams): ZodMiniJWT;
export interface ZodMiniCustomStringFormat<Format extends string = string> extends ZodMiniStringFormat<Format>, core.$ZodCustomStringFormat<Format> {
_zod: core.$ZodCustomStringFormatInternals<Format>;
}
export declare const ZodMiniCustomStringFormat: core.$constructor<ZodMiniCustomStringFormat>;
export declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<Format>;
interface _ZodMiniNumber<T extends core.$ZodNumberInternals<unknown> = core.$ZodNumberInternals<unknown>> extends _ZodMiniType<T>, core.$ZodNumber<T["input"]> {
_zod: T;
}
export interface ZodMiniNumber<Input = unknown> extends _ZodMiniNumber<core.$ZodNumberInternals<Input>>, core.$ZodNumber<Input> {
}
export declare const ZodMiniNumber: core.$constructor<ZodMiniNumber>;
export declare function number(params?: string | core.$ZodNumberParams): ZodMiniNumber<number>;
export interface ZodMiniNumberFormat extends _ZodMiniNumber<core.$ZodNumberFormatInternals>, core.$ZodNumberFormat {
}
export declare const ZodMiniNumberFormat: core.$constructor<ZodMiniNumberFormat>;
export declare function int(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniNumberFormat;
export declare function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniNumberFormat;
export declare function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniNumberFormat;
export declare function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniNumberFormat;
export declare function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniNumberFormat;
export interface ZodMiniBoolean<T = unknown> extends _ZodMiniType<core.$ZodBooleanInternals<T>> {
}
export declare const ZodMiniBoolean: core.$constructor<ZodMiniBoolean>;
export declare function boolean(params?: string | core.$ZodBooleanParams): ZodMiniBoolean<boolean>;
export interface ZodMiniBigInt<T = unknown> extends _ZodMiniType<core.$ZodBigIntInternals<T>>, core.$ZodBigInt<T> {
}
export declare const ZodMiniBigInt: core.$constructor<ZodMiniBigInt>;
export declare function bigint(params?: string | core.$ZodBigIntParams): ZodMiniBigInt<bigint>;
export interface ZodMiniBigIntFormat extends _ZodMiniType<core.$ZodBigIntFormatInternals> {
}
export declare const ZodMiniBigIntFormat: core.$constructor<ZodMiniBigIntFormat>;
export declare function int64(params?: string | core.$ZodBigIntFormatParams): ZodMiniBigIntFormat;
export declare function uint64(params?: string | core.$ZodBigIntFormatParams): ZodMiniBigIntFormat;
export interface ZodMiniSymbol extends _ZodMiniType<core.$ZodSymbolInternals> {
}
export declare const ZodMiniSymbol: core.$constructor<ZodMiniSymbol>;
export declare function symbol(params?: string | core.$ZodSymbolParams): ZodMiniSymbol;
export interface ZodMiniUndefined extends _ZodMiniType<core.$ZodUndefinedInternals> {
}
export declare const ZodMiniUndefined: core.$constructor<ZodMiniUndefined>;
declare function _undefined(params?: string | core.$ZodUndefinedParams): ZodMiniUndefined;
export { _undefined as undefined };
export interface ZodMiniNull extends _ZodMiniType<core.$ZodNullInternals> {
}
export declare const ZodMiniNull: core.$constructor<ZodMiniNull>;
declare function _null(params?: string | core.$ZodNullParams): ZodMiniNull;
export { _null as null };
export interface ZodMiniAny extends _ZodMiniType<core.$ZodAnyInternals> {
}
export declare const ZodMiniAny: core.$constructor<ZodMiniAny>;
export declare function any(): ZodMiniAny;
export interface ZodMiniUnknown extends _ZodMiniType<core.$ZodUnknownInternals> {
}
export declare const ZodMiniUnknown: core.$constructor<ZodMiniUnknown>;
export declare function unknown(): ZodMiniUnknown;
export interface ZodMiniNever extends _ZodMiniType<core.$ZodNeverInternals> {
}
export declare const ZodMiniNever: core.$constructor<ZodMiniNever>;
export declare function never(params?: string | core.$ZodNeverParams): ZodMiniNever;
export interface ZodMiniVoid extends _ZodMiniType<core.$ZodVoidInternals> {
}
export declare const ZodMiniVoid: core.$constructor<ZodMiniVoid>;
declare function _void(params?: string | core.$ZodVoidParams): ZodMiniVoid;
export { _void as void };
export interface ZodMiniDate<T = unknown> extends _ZodMiniType<core.$ZodDateInternals<T>> {
}
export declare const ZodMiniDate: core.$constructor<ZodMiniDate>;
export declare function date(params?: string | core.$ZodDateParams): ZodMiniDate<Date>;
export interface ZodMiniArray<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodArrayInternals<T>>, core.$ZodArray<T> {
}
export declare const ZodMiniArray: core.$constructor<ZodMiniArray>;
export declare function array<T extends SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodMiniArray<T>;
export declare function keyof<T extends ZodMiniObject>(schema: T): ZodMiniLiteral<Exclude<keyof T["shape"], symbol>>;
export interface ZodMiniObject<
/** @ts-ignore Cast variance */
out Shape extends core.$ZodShape = core.$ZodShape, out Config extends core.$ZodObjectConfig = core.$strip> extends ZodMiniType<any, any, core.$ZodObjectInternals<Shape, Config>>, core.$ZodObject<Shape, Config> {
shape: Shape;
}
export declare const ZodMiniObject: core.$constructor<ZodMiniObject>;
export declare function object<T extends core.$ZodLooseShape = Record<never, SomeType>>(shape?: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T, core.$strip>;
export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T, core.$strict>;
export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T, core.$loose>;
export declare function extend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: U): ZodMiniObject<util.Extend<T["shape"], U>, T["_zod"]["config"]>;
/** @deprecated Identical to `z.extend(A, B)` */
export declare function merge<T extends ZodMiniObject, U extends ZodMiniObject>(a: T, b: U): ZodMiniObject<util.Extend<T["shape"], U["shape"]>, T["_zod"]["config"]>;
export declare function pick<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M): ZodMiniObject<util.Flatten<Pick<T["shape"], keyof T["shape"] & keyof M>>, T["_zod"]["config"]>;
export declare function omit<T extends ZodMiniObject, const M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M): ZodMiniObject<util.Flatten<Omit<T["shape"], keyof M>>, T["_zod"]["config"]>;
export declare function partial<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
[k in keyof T["shape"]]: ZodMiniOptional<T["shape"][k]>;
}, T["_zod"]["config"]>;
export declare function partial<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M): ZodMiniObject<{
[k in keyof T["shape"]]: k extends keyof M ? ZodMiniOptional<T["shape"][k]> : T["shape"][k];
}, T["_zod"]["config"]>;
export type RequiredInterfaceShape<Shape extends core.$ZodLooseShape, Keys extends PropertyKey = keyof Shape> = util.Identity<{
[k in keyof Shape as k extends Keys ? k : never]: ZodMiniNonOptional<Shape[k]>;
} & {
[k in keyof Shape as k extends Keys ? never : k]: Shape[k];
}>;
export declare function required<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
[k in keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
}, T["_zod"]["config"]>;
export declare function required<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M): ZodMiniObject<util.Extend<T["shape"], {
[k in keyof M & keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
}>, T["_zod"]["config"]>;
export declare function catchall<T extends ZodMiniObject, U extends SomeType>(inst: T, catchall: U): ZodMiniObject<T["shape"], core.$catchall<U>>;
export interface ZodMiniUnion<T extends readonly SomeType[] = readonly core.$ZodType[]> extends _ZodMiniType<core.$ZodUnionInternals<T>> {
}
export declare const ZodMiniUnion: core.$constructor<ZodMiniUnion>;
export declare function union<const T extends readonly SomeType[]>(options: T, params?: string | core.$ZodUnionParams): ZodMiniUnion<T>;
export interface ZodMiniDiscriminatedUnion<Options extends readonly SomeType[] = readonly core.$ZodType[]> extends ZodMiniUnion<Options> {
_zod: core.$ZodDiscriminatedUnionInternals<Options>;
}
export declare const ZodMiniDiscriminatedUnion: core.$constructor<ZodMiniDiscriminatedUnion>;
export declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]]>(discriminator: string, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): ZodMiniDiscriminatedUnion<Types>;
export interface ZodMiniIntersection<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodIntersectionInternals<A, B>> {
}
export declare const ZodMiniIntersection: core.$constructor<ZodMiniIntersection>;
export declare function intersection<T extends SomeType, U extends SomeType>(left: T, right: U): ZodMiniIntersection<T, U>;
export interface ZodMiniTuple<T extends util.TupleItems = readonly core.$ZodType[], Rest extends SomeType | null = core.$ZodType | null> extends _ZodMiniType<core.$ZodTupleInternals<T, Rest>> {
}
export declare const ZodMiniTuple: core.$constructor<ZodMiniTuple>;
export declare function tuple<const T extends readonly [SomeType, ...SomeType[]]>(items: T, params?: string | core.$ZodTupleParams): ZodMiniTuple<T, null>;
export declare function tuple<const T extends readonly [SomeType, ...SomeType[]], Rest extends SomeType>(items: T, rest: Rest, params?: string | core.$ZodTupleParams): ZodMiniTuple<T, Rest>;
export declare function tuple(items: [], params?: string | core.$ZodTupleParams): ZodMiniTuple<[], null>;
export interface ZodMiniRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodRecordInternals<Key, Value>> {
}
export declare const ZodMiniRecord: core.$constructor<ZodMiniRecord>;
export declare function record<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodMiniRecord<Key, Value>;
export declare function partialRecord<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodMiniRecord<Key & core.$partial, Value>;
export interface ZodMiniMap<Key extends SomeType = core.$ZodType, Value extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodMapInternals<Key, Value>> {
}
export declare const ZodMiniMap: core.$constructor<ZodMiniMap>;
export declare function map<Key extends SomeType, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodMapParams): ZodMiniMap<Key, Value>;
export interface ZodMiniSet<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodSetInternals<T>> {
}
export declare const ZodMiniSet: core.$constructor<ZodMiniSet>;
export declare function set<Value extends SomeType>(valueType: Value, params?: string | core.$ZodSetParams): ZodMiniSet<Value>;
export interface ZodMiniEnum<T extends util.EnumLike = util.EnumLike> extends _ZodMiniType<core.$ZodEnumInternals<T>> {
}
export declare const ZodMiniEnum: core.$constructor<ZodMiniEnum>;
declare function _enum<const T extends readonly string[]>(values: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<util.ToEnum<T[number]>>;
declare function _enum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<T>;
export { _enum as enum };
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
*
* ```ts
* enum Colors { red, green, blue }
* z.enum(Colors);
* ```
*/
export declare function nativeEnum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<T>;
export interface ZodMiniLiteral<T extends util.Literal = util.Literal> extends _ZodMiniType<core.$ZodLiteralInternals<T>> {
}
export declare const ZodMiniLiteral: core.$constructor<ZodMiniLiteral>;
export declare function literal<const T extends ReadonlyArray<util.Literal>>(value: T, params?: string | core.$ZodLiteralParams): ZodMiniLiteral<T[number]>;
export declare function literal<const T extends util.Literal>(value: T, params?: string | core.$ZodLiteralParams): ZodMiniLiteral<T>;
export interface ZodMiniFile extends _ZodMiniType<core.$ZodFileInternals> {
}
export declare const ZodMiniFile: core.$constructor<ZodMiniFile>;
export declare function file(params?: string | core.$ZodFileParams): ZodMiniFile;
export interface ZodMiniTransform<O = unknown, I = unknown> extends _ZodMiniType<core.$ZodTransformInternals<O, I>> {
}
export declare const ZodMiniTransform: core.$constructor<ZodMiniTransform>;
export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O): ZodMiniTransform<Awaited<O>, I>;
export interface ZodMiniOptional<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodOptionalInternals<T>>, core.$ZodOptional<T> {
}
export declare const ZodMiniOptional: core.$constructor<ZodMiniOptional>;
export declare function optional<T extends SomeType>(innerType: T): ZodMiniOptional<T>;
export interface ZodMiniNullable<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodNullableInternals<T>> {
}
export declare const ZodMiniNullable: core.$constructor<ZodMiniNullable>;
export declare function nullable<T extends SomeType>(innerType: T): ZodMiniNullable<T>;
export declare function nullish<T extends SomeType>(innerType: T): ZodMiniOptional<ZodMiniNullable<T>>;
export interface ZodMiniDefault<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodDefaultInternals<T>> {
}
export declare const ZodMiniDefault: core.$constructor<ZodMiniDefault>;
export declare function _default<T extends SomeType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)): ZodMiniDefault<T>;
export interface ZodMiniPrefault<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPrefaultInternals<T>> {
}
export declare const ZodMiniPrefault: core.$constructor<ZodMiniPrefault>;
export declare function prefault<T extends SomeType>(innerType: T, defaultValue: util.NoUndefined<core.input<T>> | (() => util.NoUndefined<core.input<T>>)): ZodMiniPrefault<T>;
export interface ZodMiniNonOptional<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodNonOptionalInternals<T>> {
}
export declare const ZodMiniNonOptional: core.$constructor<ZodMiniNonOptional>;
export declare function nonoptional<T extends SomeType>(innerType: T, params?: string | core.$ZodNonOptionalParams): ZodMiniNonOptional<T>;
export interface ZodMiniSuccess<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodSuccessInternals<T>> {
}
export declare const ZodMiniSuccess: core.$constructor<ZodMiniSuccess>;
export declare function success<T extends SomeType>(innerType: T): ZodMiniSuccess<T>;
export interface ZodMiniCatch<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodCatchInternals<T>> {
}
export declare const ZodMiniCatch: core.$constructor<ZodMiniCatch>;
declare function _catch<T extends SomeType>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)): ZodMiniCatch<T>;
export { _catch as catch };
export interface ZodMiniNaN extends _ZodMiniType<core.$ZodNaNInternals> {
}
export declare const ZodMiniNaN: core.$constructor<ZodMiniNaN>;
export declare function nan(params?: string | core.$ZodNaNParams): ZodMiniNaN;
export interface ZodMiniPipe<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPipeInternals<A, B>> {
}
export declare const ZodMiniPipe: core.$constructor<ZodMiniPipe>;
export declare function pipe<const A extends SomeType, B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>>(in_: A, out: B | core.$ZodType<unknown, core.output<A>>): ZodMiniPipe<A, B>;
export interface ZodMiniReadonly<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodReadonlyInternals<T>> {
}
export declare const ZodMiniReadonly: core.$constructor<ZodMiniReadonly>;
export declare function readonly<T extends SomeType>(innerType: T): ZodMiniReadonly<T>;
export interface ZodMiniTemplateLiteral<Template extends string = string> extends _ZodMiniType<core.$ZodTemplateLiteralInternals<Template>> {
}
export declare const ZodMiniTemplateLiteral: core.$constructor<ZodMiniTemplateLiteral>;
export declare function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[]>(parts: Parts, params?: string | core.$ZodTemplateLiteralParams): ZodMiniTemplateLiteral<core.$PartsToTemplateLiteral<Parts>>;
export interface ZodMiniLazy<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodLazyInternals<T>> {
}
export declare const ZodMiniLazy: core.$constructor<ZodMiniLazy>;
declare function _lazy<T extends SomeType>(getter: () => T): ZodMiniLazy<T>;
export { _lazy as lazy };
export interface ZodMiniPromise<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPromiseInternals<T>> {
}
export declare const ZodMiniPromise: core.$constructor<ZodMiniPromise>;
export declare function promise<T extends SomeType>(innerType: T): ZodMiniPromise<T>;
export interface ZodMiniCustom<O = unknown, I = unknown> extends _ZodMiniType<core.$ZodCustomInternals<O, I>> {
}
export declare const ZodMiniCustom: core.$constructor<ZodMiniCustom>;
export declare function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$ZodCustomParams): core.$ZodCheck<O>;
export declare function custom<O = unknown, I = O>(fn?: (data: O) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodMiniCustom<O, I>;
export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
declare abstract class Class {
constructor(..._args: any[]);
}
declare function _instanceof<T extends typeof Class>(cls: T, params?: core.$ZodCustomParams): ZodMiniCustom<InstanceType<T>, InstanceType<T>>;
export { _instanceof as instanceof };
export declare const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodMiniPipe<ZodMiniPipe<ZodMiniString, ZodMiniTransform<boolean, string>>, ZodMiniBoolean>;
type _ZodMiniJSONSchema = ZodMiniUnion<[
ZodMiniString,
ZodMiniNumber,
ZodMiniBoolean,
ZodMiniNull,
ZodMiniArray<ZodMiniJSONSchema>,
ZodMiniRecord<ZodMiniString<string>, ZodMiniJSONSchema>
]>;
type _ZodMiniJSONSchemaInternals = _ZodMiniJSONSchema["_zod"];
export interface ZodMiniJSONSchemaInternals extends _ZodMiniJSONSchemaInternals {
output: util.JSONType;
input: util.JSONType;
}
export interface ZodMiniJSONSchema extends _ZodMiniJSONSchema {
_zod: ZodMiniJSONSchemaInternals;
}
export declare function json(): ZodMiniJSONSchema;
@@ -0,0 +1 @@
{"name":"@typescript-eslint/types","version":"8.46.4","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532095078,"integrity":"sha512-t0z/UCQ+RY4AylIo7v6ZCtzCdS9pMnC0+yB0VQa2A+1S+oV4noJtM9o2SOJfDVq7GqTVK4GsuGR2QO4Nb/K7kw==","mode":420,"size":1097},"dist/generated/ast-spec.js":{"checkedAt":1794532095079,"integrity":"sha512-Vg0ksjKD18XqjEwJB5kSuvBimaxj2eTt+RbNEMZD0BvSGnrn7/tj6LPUiwbpKis2rdz/UuSvUJVXoe6czVUGKQ==","mode":420,"size":11762},"dist/index.js":{"checkedAt":1794532095079,"integrity":"sha512-br0xfOvtZ19facPamcs36sLsQQugMt4k5rMBy9329Ke2C8sBEvoYVVFTHggI/IdMK6yY+NeVt5n0RQu83gdPfQ==","mode":420,"size":1264},"dist/lib.js":{"checkedAt":1794532095079,"integrity":"sha512-XcV+t/zMLVgrArWBYyIC7MFATOcVS+EON5Jo3klYDy1ysSIAicEnBsQckbHZic9jSuqtTmysbitcNhIlBuEV0Q==","mode":420,"size":247},"dist/parser-options.js":{"checkedAt":1794532095079,"integrity":"sha512-f2XGQDoj2T+xSOglmwEtZVKrO/8Xj0p9ap2c7A9gQp/BiZ45tLyozAivx12afHv9sT/DcspjyF6yKwNV601gAA==","mode":420,"size":77},"dist/ts-estree.js":{"checkedAt":1794532095079,"integrity":"sha512-OK4w5JK6cHW0W51Bgs8z0lr+tsUbIYJP2+bT37uKoiRL96s94oNklgQq27+K8KVLNOcSFM970t1QPkGFpEfkPw==","mode":420,"size":1529},"package.json":{"checkedAt":1794532095079,"integrity":"sha512-e02lVPJEYm3X7B9QBGIzoViG9v4BOxwPxKt4TfIO24BFAnt1GHt0v2YObLEhIiBPrqe2yKUyX/Kx2w9ksioJfA==","mode":420,"size":2177},"README.md":{"checkedAt":1794532095079,"integrity":"sha512-pmjlBNIkmyNK+P3y8mZW5SuTcGF66FehKIY1Fj1ciOgT+0jzN66IsX/T+ej8cU01idesLzQONa9NIl6T0seRAg==","mode":420,"size":432},"dist/generated/ast-spec.d.ts":{"checkedAt":1794532095080,"integrity":"sha512-tfEdZ1hC10zKvfrVeMi1t0dMiWH3c62ji3MPbfAeCq9xBiMwkNFTOrmAjl2sz6EJQ0XSkCIHQhSb2gu33JvFKg==","mode":420,"size":81471},"dist/index.d.ts":{"checkedAt":1794532095080,"integrity":"sha512-Q6fezhmdfo9FEKYEaiak0Vt3cIJJxlnWYXp3a91nWfC4XCHTepcqg93LZDpDyaXipbU8qheuQBqoZ6TNnEO6mg==","mode":420,"size":158},"dist/lib.d.ts":{"checkedAt":1794532095080,"integrity":"sha512-3v0GcSnfcp7w8sQ3ZH4HwWUBLZtiGmj1jUstXi7NYHiHkE+Pu8jpXaV04hyz4cEx2AquB0Hq+IeWOAueoFAXlw==","mode":420,"size":1934},"dist/parser-options.d.ts":{"checkedAt":1794532095080,"integrity":"sha512-rSj11EYD4ohDlkB+BmJvypONXOfS3kdxSvqZz+ePDws+tkQH6OYNb/aojTJT8V7vnSTK/rb7p6F63j7/Y/Tc6g==","mode":420,"size":2643},"dist/ts-estree.d.ts":{"checkedAt":1794532095081,"integrity":"sha512-gUvvgIUZftRDIk5WcZnXOYDIEKcgaUz2Tgfru2tfYJReDbBc4Ck4cMQV3HpL8RULrQP5E1MOos35CWx7mJnXew==","mode":420,"size":6559}}}
@@ -0,0 +1,11 @@
'use strict';
// var modulo = require('./modulo');
var $floor = require('math-intrinsics/floor');
// http://262.ecma-international.org/5.1/#sec-5.2
module.exports = function floor(x) {
// return x - modulo(x, 1);
return $floor(x);
};
@@ -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/side-channel-list
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 up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"A B","16":"wC","900":"K D E F"},B:{"1":"0 1 2 3 4 5 Q H R S T U V W X Y Z 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","1025":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","900":"xC TC 0C 1C","1025":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC"},E:{"1":"K D E F A B C L M G 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","16":"ZB 2C","900":"J ZC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z 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","16":"F","132":"B C FD GD HD ID NC uC JD OC"},G:{"1":"KD vC LD MD ND PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","16":"ZC","2052":"E OD"},H:{"132":"hD"},I:{"1":"TC J kD lD vC mD nD","16":"iD jD","4097":"I"},J:{"1":"D A"},K:{"132":"A B C NC uC OC","4097":"H"},L:{"4097":"I"},M:{"4097":"MC"},N:{"1":"A B"},O:{"1":"PC"},P:{"4097":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1025":"1D 2D"}},B:1,C:"maxlength attribute for input and textarea elements",D:true};
@@ -0,0 +1,46 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils")
const { getSourceCode } = require("eslint-compat-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Math.log10` method.",
category: "ES2015",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-math-log10.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' method is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"(program) {
const sourceCode = getSourceCode(context)
const tracker = new ReferenceTracker(
sourceCode.getScope(program),
)
for (const { node, path } of tracker.iterateGlobalReferences({
Math: {
log10: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from './types.js';
import 'react';
declare const LinkIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { LinkIcon };
@@ -0,0 +1,26 @@
/**
* @file 按Y轴平移变换, 变换中心为图像中心点
* @author mengke01(kekee000@gmail.com)
*/
import {computePath} from './computeBoundingBox';
/**
* path倾斜变换
*
* @param {Object} contour 坐标点
* @param {number} angle 角度
*
* @return {Object} contour 坐标点
*/
export default function pathSkewY(contour, angle) {
angle = angle === undefined ? 0 : angle;
const x = computePath(contour).x;
const tan = Math.tan(angle);
let p;
// y 平移
for (let i = 0, l = contour.length; i < l; i++) {
p = contour[i];
p.y += tan * (p.x - x);
}
return contour;
}
@@ -0,0 +1,147 @@
import LazyWrapper from './_LazyWrapper.js';
import LodashWrapper from './_LodashWrapper.js';
import baseLodash from './_baseLodash.js';
import isArray from './isArray.js';
import isObjectLike from './isObjectLike.js';
import wrapperClone from './_wrapperClone.js';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Creates a `lodash` object which wraps `value` to enable implicit method
* chain sequences. Methods that operate on and return arrays, collections,
* and functions can be chained together. Methods that retrieve a single value
* or may return a primitive value will automatically end the chain sequence
* and return the unwrapped value. Otherwise, the value must be unwrapped
* with `_#value`.
*
* Explicit chain sequences, which must be unwrapped with `_#value`, may be
* enabled using `_.chain`.
*
* The execution of chained methods is lazy, that is, it's deferred until
* `_#value` is implicitly or explicitly called.
*
* Lazy evaluation allows several methods to support shortcut fusion.
* Shortcut fusion is an optimization to merge iteratee calls; this avoids
* the creation of intermediate arrays and can greatly reduce the number of
* iteratee executions. Sections of a chain sequence qualify for shortcut
* fusion if the section is applied to an array and iteratees accept only
* one argument. The heuristic for whether a section qualifies for shortcut
* fusion is subject to change.
*
* Chaining is supported in custom builds as long as the `_#value` method is
* directly or indirectly included in the build.
*
* In addition to lodash methods, wrappers have `Array` and `String` methods.
*
* The wrapper `Array` methods are:
* `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
*
* The wrapper `String` methods are:
* `replace` and `split`
*
* The wrapper methods that support shortcut fusion are:
* `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
* `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
* `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
*
* The chainable wrapper methods are:
* `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
* `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
* `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
* `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
* `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
* `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
* `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
* `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
* `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
* `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
* `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
* `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
* `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
* `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
* `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
* `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
* `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
* `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
* `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
* `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
* `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
* `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
* `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
* `zipObject`, `zipObjectDeep`, and `zipWith`
*
* The wrapper methods that are **not** chainable by default are:
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
* `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
* `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
* `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
* `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
* `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
* `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
* `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
* `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
* `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
* `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
* `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
* `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
* `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
* `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
* `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
* `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
* `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
* `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
* `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
* `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
* `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
* `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
* `upperFirst`, `value`, and `words`
*
* @name _
* @constructor
* @category Seq
* @param {*} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2, 3]);
*
* // Returns an unwrapped value.
* wrapped.reduce(_.add);
* // => 6
*
* // Returns a wrapped value.
* var squares = wrapped.map(square);
*
* _.isArray(squares);
* // => false
*
* _.isArray(squares.value());
* // => true
*/
function lodash(value) {
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
if (value instanceof LodashWrapper) {
return value;
}
if (hasOwnProperty.call(value, '__wrapped__')) {
return wrapperClone(value);
}
}
return new LodashWrapper(value);
}
// Ensure wrappers are instances of `baseLodash`.
lodash.prototype = baseLodash.prototype;
lodash.prototype.constructor = lodash;
export default lodash;
@@ -0,0 +1,33 @@
'use strict';
var DefinePropertyOrThrow = require('./DefinePropertyOrThrow');
var Get = require('./Get');
var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty');
var ToObject = require('./ToObject');
var ToPropertyDescriptor = require('./ToPropertyDescriptor');
var forEach = require('../helpers/forEach');
var OwnPropertyKeys = require('own-keys');
// https://262.ecma-international.org/15.0/#sec-objectdefineproperties
module.exports = function ObjectDefineProperties(O, Properties) {
var props = ToObject(Properties); // step 1
var keys = OwnPropertyKeys(props); // step 2
var descriptors = []; // step 3
forEach(keys, function (nextKey) { // step 4
var propDesc = OrdinaryGetOwnProperty(props, nextKey); // ToPropertyDescriptor(getOwnPropertyDescriptor(props, nextKey)); // step 4.a
if (typeof propDesc !== 'undefined' && propDesc['[[Enumerable]]']) { // step 4.b
var descObj = Get(props, nextKey); // step 4.b.i
var desc = ToPropertyDescriptor(descObj); // step 4.b.ii
descriptors[descriptors.length] = { '[[Key]]': nextKey, '[[Descriptor]]': desc }; // step 4.b.iii
}
});
forEach(descriptors, function (pair) { // step 5
DefinePropertyOrThrow(O, pair['[[Key]]'], pair['[[Descriptor]]']); // step 5.c
});
return O; // step 6
};
@@ -0,0 +1 @@
{"version":3,"file":"xlink.d.ts","sourceRoot":"","sources":["xlink.js"],"names":[],"mappings":"AAEA,sDAcE"}
@@ -0,0 +1 @@
{"version":3,"file":"no-arrow-function-lifecycle.d.ts","sourceRoot":"","sources":["no-arrow-function-lifecycle.js"],"names":[],"mappings":"wBAsCW,OAAO,QAAQ,EAAE,IAAI,CAAC,UAAU"}
@@ -0,0 +1,36 @@
import * as ValueGuard from '../guard/value.mjs';
function ArrayType(value) {
return value.map((value) => Visit(value));
}
function DateType(value) {
return new Date(value.getTime());
}
function Uint8ArrayType(value) {
return new Uint8Array(value);
}
function RegExpType(value) {
return new RegExp(value.source, value.flags);
}
function ObjectType(value) {
const result = {};
for (const key of Object.getOwnPropertyNames(value)) {
result[key] = Visit(value[key]);
}
for (const key of Object.getOwnPropertySymbols(value)) {
result[key] = Visit(value[key]);
}
return result;
}
// prettier-ignore
function Visit(value) {
return (ValueGuard.IsArray(value) ? ArrayType(value) :
ValueGuard.IsDate(value) ? DateType(value) :
ValueGuard.IsUint8Array(value) ? Uint8ArrayType(value) :
ValueGuard.IsRegExp(value) ? RegExpType(value) :
ValueGuard.IsObject(value) ? ObjectType(value) :
value);
}
/** Clones a value */
export function Clone(value) {
return Visit(value);
}
@@ -0,0 +1,27 @@
import type { AssertRest, Evaluate } from '../helpers/index';
import type { TSchema, SchemaOptions } from '../schema/index';
import { type TAny } from '../any/index';
import { type TBigInt } from '../bigint/index';
import { type TDate } from '../date/index';
import { type TFunction } from '../function/index';
import { type TLiteral } from '../literal/index';
import { type TNever } from '../never/index';
import { type TNull } from '../null/index';
import { type TObject } from '../object/index';
import { type TSymbol } from '../symbol/index';
import { type TTuple } from '../tuple/index';
import { type TReadonly } from '../readonly/index';
import { type TUndefined } from '../undefined/index';
import { type TUint8Array } from '../uint8array/index';
import { type TUnknown } from '../unknown/index';
type TFromArray<T extends readonly unknown[]> = T extends readonly [infer L extends unknown, ...infer R extends unknown[]] ? [FromValue<L, false>, ...TFromArray<R>] : T;
type TFromProperties<T extends Record<PropertyKey, unknown>> = {
-readonly [K in keyof T]: FromValue<T[K], false> extends infer R extends TSchema ? TReadonly<R> : TReadonly<TNever>;
};
type TConditionalReadonly<T extends TSchema, Root extends boolean> = Root extends true ? T : TReadonly<T>;
type FromValue<T, Root extends boolean> = T extends AsyncIterableIterator<unknown> ? TConditionalReadonly<TAny, Root> : T extends IterableIterator<unknown> ? TConditionalReadonly<TAny, Root> : T extends readonly unknown[] ? TReadonly<TTuple<AssertRest<TFromArray<T>>>> : T extends Uint8Array ? TUint8Array : T extends Date ? TDate : T extends Record<PropertyKey, unknown> ? TConditionalReadonly<TObject<Evaluate<TFromProperties<T>>>, Root> : T extends Function ? TConditionalReadonly<TFunction<[], TUnknown>, Root> : T extends undefined ? TUndefined : T extends null ? TNull : T extends symbol ? TSymbol : T extends number ? TLiteral<T> : T extends boolean ? TLiteral<T> : T extends string ? TLiteral<T> : T extends bigint ? TBigInt : TObject<{}>;
declare function FromValue<T, Root extends boolean>(value: T, root: Root): FromValue<T, Root>;
export type TConst<T> = FromValue<T, true>;
/** `[JavaScript]` Creates a readonly const type from the given value. */
export declare function Const</* const (not supported in 4.0) */ T>(T: T, options?: SchemaOptions): TConst<T>;
export {};
@@ -0,0 +1,18 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./create"), exports);
@@ -0,0 +1,49 @@
var createPadding = require('./_createPadding'),
stringSize = require('./_stringSize'),
toInteger = require('./toInteger'),
toString = require('./toString');
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
nativeFloor = Math.floor;
/**
* Pads `string` on the left and right sides if it's shorter than `length`.
* Padding characters are truncated if they can't be evenly divided by `length`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.pad('abc', 8);
* // => ' abc '
*
* _.pad('abc', 8, '_-');
* // => '_-abc_-_'
*
* _.pad('abc', 3);
* // => 'abc'
*/
function pad(string, length, chars) {
string = toString(string);
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
if (!length || strLength >= length) {
return string;
}
var mid = (length - strLength) / 2;
return (
createPadding(nativeFloor(mid), chars) +
string +
createPadding(nativeCeil(mid), chars)
);
}
module.exports = pad;
@@ -0,0 +1 @@
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwCvD,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAkCrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;gBAiBtB,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,CAAC,EAAE,GAAG,EACZ,OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IA+ClB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAY/B,MAAM;IAgBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsIjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CAmMjE"}
@@ -0,0 +1,175 @@
{
"es3": true,
"additionalRules": [],
"requireSemicolons": true,
"disallowMultipleSpaces": true,
"disallowIdentifierNames": [],
"requireCurlyBraces": {
"allExcept": [],
"keywords": ["if", "else", "for", "while", "do", "try", "catch"]
},
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"],
"disallowSpaceAfterKeywords": [],
"disallowSpaceBeforeComma": true,
"disallowSpaceAfterComma": false,
"disallowSpaceBeforeSemicolon": true,
"disallowNodeTypes": [
"DebuggerStatement",
"LabeledStatement",
"SwitchCase",
"SwitchStatement",
"WithStatement"
],
"requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] },
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true },
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
"disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
"requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true },
"disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true },
"requireSpaceBetweenArguments": true,
"disallowSpacesInsideParentheses": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowQuotedKeysInObjects": { "allExcept": ["reserved"] },
"disallowSpaceAfterObjectKeys": true,
"requireCommaBeforeLineBreak": true,
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"requireSpaceAfterPrefixUnaryOperators": [],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"requireSpaceBeforePostfixUnaryOperators": [],
"disallowSpaceBeforeBinaryOperators": [],
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"disallowSpaceAfterBinaryOperators": [],
"disallowImplicitTypeConversion": ["binary", "string"],
"disallowKeywords": ["with", "eval"],
"requireKeywordsOnNewLine": [],
"disallowKeywordsOnNewLine": ["else"],
"requireLineFeedAtFileEnd": true,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"excludeFiles": ["node_modules/**", "vendor/**"],
"disallowMultipleLineStrings": true,
"requireDotNotation": { "allExcept": ["keywords"] },
"requireParenthesesAroundIIFE": true,
"validateLineBreaks": "LF",
"validateQuoteMarks": {
"escape": true,
"mark": "'"
},
"disallowOperatorBeforeLineBreak": [],
"requireSpaceBeforeKeywords": [
"do",
"for",
"if",
"else",
"switch",
"case",
"try",
"catch",
"finally",
"while",
"with",
"return"
],
"validateAlignedFunctionParameters": {
"lineBreakAfterOpeningBraces": true,
"lineBreakBeforeClosingBraces": true
},
"requirePaddingNewLinesBeforeExport": true,
"validateNewlineAfterArrayElements": {
"maximum": 6
},
"requirePaddingNewLinesAfterUseStrict": true,
"disallowArrowFunctions": true,
"disallowMultiLineTernary": true,
"validateOrderInObjectKeys": false,
"disallowIdenticalDestructuringNames": true,
"disallowNestedTernaries": { "maxLevel": 1 },
"requireSpaceAfterComma": { "allExcept": ["trailing"] },
"requireAlignedMultilineParams": false,
"requireSpacesInGenerator": {
"afterStar": true
},
"disallowSpacesInGenerator": {
"beforeStar": true
},
"disallowVar": false,
"requireArrayDestructuring": false,
"requireEnhancedObjectLiterals": false,
"requireObjectDestructuring": false,
"requireEarlyReturn": false,
"requireCapitalizedConstructorsNew": {
"allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"]
},
"requireImportAlphabetized": false,
"requireSpaceBeforeObjectValues": true,
"requireSpaceBeforeDestructuredValues": true,
"disallowSpacesInsideTemplateStringPlaceholders": true,
"disallowArrayDestructuringReturn": false,
"requireNewlineBeforeSingleStatementsInIf": false,
"disallowUnusedVariables": true,
"requireSpacesInsideImportedObjectBraces": true,
"requireUseStrict": true
}
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from '../types.mjs';
import 'react';
declare const ShoppingCartBoldIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { ShoppingCartBoldIcon };
@@ -0,0 +1,18 @@
import arrayMap from './_arrayMap.js';
/**
* The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
* of key-value pairs for `object` corresponding to the property names of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the key-value pairs.
*/
function baseToPairs(object, props) {
return arrayMap(props, function(key) {
return [key, object[key]];
});
}
export default baseToPairs;
@@ -0,0 +1,142 @@
/**
* @fileoverview Enforce the use of the 'onChange' or 'readonly' attribute when 'checked' is used'
* @author Jaesoekjjang
*/
'use strict';
const ASTUtils = require('jsx-ast-utils');
const flatMap = require('array.prototype.flatmap');
const isCreateElement = require('../util/isCreateElement');
const report = require('../util/report');
const docsUrl = require('../util/docsUrl');
const messages = {
missingProperty: '`checked` should be used with either `onChange` or `readOnly`.',
exclusiveCheckedAttribute: 'Use either `checked` or `defaultChecked`, but not both.',
};
const targetPropSet = new Set(['checked', 'onChange', 'readOnly', 'defaultChecked']);
const defaultOptions = {
ignoreMissingProperties: false,
ignoreExclusiveCheckedAttribute: false,
};
/**
* @param {object[]} properties
* @param {string} keyName
* @returns {Set<string>}
*/
function extractTargetProps(properties, keyName) {
return new Set(
flatMap(
properties,
(prop) => (
prop[keyName] && targetPropSet.has(prop[keyName].name)
? [prop[keyName].name]
: []
)
)
);
}
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Enforce using `onChange` or `readonly` attribute when `checked` is used',
category: 'Best Practices',
recommended: false,
url: docsUrl('checked-requires-onchange-or-readonly'),
},
messages,
schema: [{
additionalProperties: false,
properties: {
ignoreMissingProperties: {
type: 'boolean',
},
ignoreExclusiveCheckedAttribute: {
type: 'boolean',
},
},
}],
},
create(context) {
const options = Object.assign({}, defaultOptions, context.options[0]);
function reportMissingProperty(node) {
report(
context,
messages.missingProperty,
'missingProperty',
{ node }
);
}
function reportExclusiveCheckedAttribute(node) {
report(
context,
messages.exclusiveCheckedAttribute,
'exclusiveCheckedAttribute',
{ node }
);
}
/**
* @param {ASTNode} node
* @param {Set<string>} propSet
* @returns {void}
*/
const checkAttributesAndReport = (node, propSet) => {
if (!propSet.has('checked')) {
return;
}
if (!options.ignoreExclusiveCheckedAttribute && propSet.has('defaultChecked')) {
reportExclusiveCheckedAttribute(node);
}
if (
!options.ignoreMissingProperties
&& !(propSet.has('onChange') || propSet.has('readOnly'))
) {
reportMissingProperty(node);
}
};
return {
JSXOpeningElement(node) {
if (ASTUtils.elementType(node) !== 'input') {
return;
}
const propSet = extractTargetProps(node.attributes, 'name');
checkAttributesAndReport(node, propSet);
},
CallExpression(node) {
if (!isCreateElement(context, node)) {
return;
}
const firstArg = node.arguments[0];
const secondArg = node.arguments[1];
if (
!firstArg
|| firstArg.type !== 'Literal'
|| firstArg.value !== 'input'
) {
return;
}
if (!secondArg || secondArg.type !== 'ObjectExpression') {
return;
}
const propSet = extractTargetProps(secondArg.properties, 'key');
checkAttributesAndReport(node, propSet);
},
};
},
};
@@ -0,0 +1,14 @@
import coreJsData from './_coreJsData.js';
import isFunction from './isFunction.js';
import stubFalse from './stubFalse.js';
/**
* Checks if `func` is capable of being masked.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `func` is maskable, else `false`.
*/
var isMaskable = coreJsData ? isFunction : stubFalse;
export default isMaskable;
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return _default;
}
});
const _cloneDeep = require("../util/cloneDeep");
const _configfull = /*#__PURE__*/ _interop_require_default(require("../../stubs/config.full"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const _default = (0, _cloneDeep.cloneDeep)(_configfull.default);
@@ -0,0 +1,43 @@
# es-abstract <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
ECMAScript spec abstract operations.
Every operation is available by edition/year and by name - for example, `es-abstract/2020/Call` gives you the `Call` operation from ES2020, `es-abstract/5/Type` gives you the `Type` operation from ES5.
All abstract operations are also available under an `es5`/`es2015`/`es2016`/`es2017`/`es2018`/`es2019`/`es2020`/`es2021` entry point, and as a property on the `main` export, but using deep imports is highly encouraged for bundle size and performance reasons. Non-deep entry points will be removed in the next semver-major release.
## Example
```js
var ES = require('es-abstract');
var assert = require('assert');
assert(ES.isCallable(function () {}));
assert(!ES.isCallable(/a/g));
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
## Security
Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
[package-url]: https://npmjs.org/package/es-abstract
[npm-version-svg]: https://versionbadg.es/ljharb/es-abstract.svg
[deps-svg]: https://david-dm.org/ljharb/es-abstract.svg
[deps-url]: https://david-dm.org/ljharb/es-abstract
[dev-deps-svg]: https://david-dm.org/ljharb/es-abstract/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/es-abstract#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/es-abstract.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/es-abstract.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/es-abstract.svg
[downloads-url]: https://npm-stat.com/charts.html?package=es-abstract
@@ -0,0 +1,279 @@
"use strict";
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.unload = exports.load = exports.onExit = exports.signals = void 0;
// Note: since nyc uses this module to output coverage, any lines
// that are in the direct sync flow of nyc's outputCoverage are
// ignored, since we can never get coverage for them.
// grab a reference to node's real process object right away
const signals_js_1 = require("./signals.js");
Object.defineProperty(exports, "signals", { enumerable: true, get: function () { return signals_js_1.signals; } });
const processOk = (process) => !!process &&
typeof process === 'object' &&
typeof process.removeListener === 'function' &&
typeof process.emit === 'function' &&
typeof process.reallyExit === 'function' &&
typeof process.listeners === 'function' &&
typeof process.kill === 'function' &&
typeof process.pid === 'number' &&
typeof process.on === 'function';
const kExitEmitter = Symbol.for('signal-exit emitter');
const global = globalThis;
const ObjectDefineProperty = Object.defineProperty.bind(Object);
// teeny special purpose ee
class Emitter {
emitted = {
afterExit: false,
exit: false,
};
listeners = {
afterExit: [],
exit: [],
};
count = 0;
id = Math.random();
constructor() {
if (global[kExitEmitter]) {
return global[kExitEmitter];
}
ObjectDefineProperty(global, kExitEmitter, {
value: this,
writable: false,
enumerable: false,
configurable: false,
});
}
on(ev, fn) {
this.listeners[ev].push(fn);
}
removeListener(ev, fn) {
const list = this.listeners[ev];
const i = list.indexOf(fn);
/* c8 ignore start */
if (i === -1) {
return;
}
/* c8 ignore stop */
if (i === 0 && list.length === 1) {
list.length = 0;
}
else {
list.splice(i, 1);
}
}
emit(ev, code, signal) {
if (this.emitted[ev]) {
return false;
}
this.emitted[ev] = true;
let ret = false;
for (const fn of this.listeners[ev]) {
ret = fn(code, signal) === true || ret;
}
if (ev === 'exit') {
ret = this.emit('afterExit', code, signal) || ret;
}
return ret;
}
}
class SignalExitBase {
}
const signalExitWrap = (handler) => {
return {
onExit(cb, opts) {
return handler.onExit(cb, opts);
},
load() {
return handler.load();
},
unload() {
return handler.unload();
},
};
};
class SignalExitFallback extends SignalExitBase {
onExit() {
return () => { };
}
load() { }
unload() { }
}
class SignalExit extends SignalExitBase {
// "SIGHUP" throws an `ENOSYS` error on Windows,
// so use a supported signal instead
/* c8 ignore start */
#hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP';
/* c8 ignore stop */
#emitter = new Emitter();
#process;
#originalProcessEmit;
#originalProcessReallyExit;
#sigListeners = {};
#loaded = false;
constructor(process) {
super();
this.#process = process;
// { <signal>: <listener fn>, ... }
this.#sigListeners = {};
for (const sig of signals_js_1.signals) {
this.#sigListeners[sig] = () => {
// If there are no other listeners, an exit is coming!
// Simplest way: remove us and then re-send the signal.
// We know that this will kill the process, so we can
// safely emit now.
const listeners = this.#process.listeners(sig);
let { count } = this.#emitter;
// This is a workaround for the fact that signal-exit v3 and signal
// exit v4 are not aware of each other, and each will attempt to let
// the other handle it, so neither of them do. To correct this, we
// detect if we're the only handler *except* for previous versions
// of signal-exit, and increment by the count of listeners it has
// created.
/* c8 ignore start */
const p = process;
if (typeof p.__signal_exit_emitter__ === 'object' &&
typeof p.__signal_exit_emitter__.count === 'number') {
count += p.__signal_exit_emitter__.count;
}
/* c8 ignore stop */
if (listeners.length === count) {
this.unload();
const ret = this.#emitter.emit('exit', null, sig);
/* c8 ignore start */
const s = sig === 'SIGHUP' ? this.#hupSig : sig;
if (!ret)
process.kill(process.pid, s);
/* c8 ignore stop */
}
};
}
this.#originalProcessReallyExit = process.reallyExit;
this.#originalProcessEmit = process.emit;
}
onExit(cb, opts) {
/* c8 ignore start */
if (!processOk(this.#process)) {
return () => { };
}
/* c8 ignore stop */
if (this.#loaded === false) {
this.load();
}
const ev = opts?.alwaysLast ? 'afterExit' : 'exit';
this.#emitter.on(ev, cb);
return () => {
this.#emitter.removeListener(ev, cb);
if (this.#emitter.listeners['exit'].length === 0 &&
this.#emitter.listeners['afterExit'].length === 0) {
this.unload();
}
};
}
load() {
if (this.#loaded) {
return;
}
this.#loaded = true;
// This is the number of onSignalExit's that are in play.
// It's important so that we can count the correct number of
// listeners on signals, and don't wait for the other one to
// handle it instead of us.
this.#emitter.count += 1;
for (const sig of signals_js_1.signals) {
try {
const fn = this.#sigListeners[sig];
if (fn)
this.#process.on(sig, fn);
}
catch (_) { }
}
this.#process.emit = (ev, ...a) => {
return this.#processEmit(ev, ...a);
};
this.#process.reallyExit = (code) => {
return this.#processReallyExit(code);
};
}
unload() {
if (!this.#loaded) {
return;
}
this.#loaded = false;
signals_js_1.signals.forEach(sig => {
const listener = this.#sigListeners[sig];
/* c8 ignore start */
if (!listener) {
throw new Error('Listener not defined for signal: ' + sig);
}
/* c8 ignore stop */
try {
this.#process.removeListener(sig, listener);
/* c8 ignore start */
}
catch (_) { }
/* c8 ignore stop */
});
this.#process.emit = this.#originalProcessEmit;
this.#process.reallyExit = this.#originalProcessReallyExit;
this.#emitter.count -= 1;
}
#processReallyExit(code) {
/* c8 ignore start */
if (!processOk(this.#process)) {
return 0;
}
this.#process.exitCode = code || 0;
/* c8 ignore stop */
this.#emitter.emit('exit', this.#process.exitCode, null);
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
}
#processEmit(ev, ...args) {
const og = this.#originalProcessEmit;
if (ev === 'exit' && processOk(this.#process)) {
if (typeof args[0] === 'number') {
this.#process.exitCode = args[0];
/* c8 ignore start */
}
/* c8 ignore start */
const ret = og.call(this.#process, ev, ...args);
/* c8 ignore start */
this.#emitter.emit('exit', this.#process.exitCode, null);
/* c8 ignore stop */
return ret;
}
else {
return og.call(this.#process, ev, ...args);
}
}
}
const process = globalThis.process;
// wrap so that we call the method on the actual handler, without
// exporting it directly.
_a = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback()),
/**
* Called when the process is exiting, whether via signal, explicit
* exit, or running out of stuff to do.
*
* If the global process object is not suitable for instrumentation,
* then this will be a no-op.
*
* Returns a function that may be used to unload signal-exit.
*/
exports.onExit = _a.onExit,
/**
* Load the listeners. Likely you never need to call this, unless
* doing a rather deep integration with signal-exit functionality.
* Mostly exposed for the benefit of testing.
*
* @internal
*/
exports.load = _a.load,
/**
* Unload the listeners. Likely you never need to call this, unless
* doing a rather deep integration with signal-exit functionality.
* Mostly exposed for the benefit of testing.
*
* @internal
*/
exports.unload = _a.unload;
//# sourceMappingURL=index.js.map
@@ -0,0 +1,744 @@
'use strict';
module.exports = {
IsPropertyDescriptor: 'https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op
abs: {
url: 'https://262.ecma-international.org/6.0/#sec-algorithm-conventions'
},
'Abstract Equality Comparison': {
url: 'https://262.ecma-international.org/6.0/#sec-abstract-equality-comparison'
},
'Abstract Relational Comparison': {
url: 'https://262.ecma-international.org/6.0/#sec-abstract-relational-comparison'
},
AddRestrictedFunctionProperties: {
url: 'https://262.ecma-international.org/6.0/#sec-addrestrictedfunctionproperties'
},
AdvanceStringIndex: {
url: 'https://262.ecma-international.org/6.0/#sec-advancestringindex'
},
AllocateArrayBuffer: {
url: 'https://262.ecma-international.org/6.0/#sec-allocatearraybuffer'
},
AllocateTypedArray: {
url: 'https://262.ecma-international.org/6.0/#sec-allocatetypedarray'
},
ArrayCreate: {
url: 'https://262.ecma-international.org/6.0/#sec-arraycreate'
},
ArraySetLength: {
url: 'https://262.ecma-international.org/6.0/#sec-arraysetlength'
},
ArraySpeciesCreate: {
url: 'https://262.ecma-international.org/6.0/#sec-arrayspeciescreate'
},
BoundFunctionCreate: {
url: 'https://262.ecma-international.org/6.0/#sec-boundfunctioncreate'
},
Call: {
url: 'https://262.ecma-international.org/6.0/#sec-call'
},
Canonicalize: {
url: 'https://262.ecma-international.org/6.0/#sec-runtime-semantics-canonicalize-ch'
},
CanonicalNumericIndexString: {
url: 'https://262.ecma-international.org/6.0/#sec-canonicalnumericindexstring'
},
CharacterRange: {
url: 'https://262.ecma-international.org/6.0/#sec-runtime-semantics-characterrange-abstract-operation'
},
CharacterSetMatcher: {
url: 'https://262.ecma-international.org/6.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation'
},
CloneArrayBuffer: {
url: 'https://262.ecma-international.org/6.0/#sec-clonearraybuffer'
},
CompletePropertyDescriptor: {
url: 'https://262.ecma-international.org/6.0/#sec-completepropertydescriptor'
},
Completion: {
url: 'https://262.ecma-international.org/6.0/#sec-implicit-completion-values'
},
CompletionRecord: {
url: 'https://262.ecma-international.org/6.0/#sec-completion-record-specification-type'
},
Construct: {
url: 'https://262.ecma-international.org/6.0/#sec-construct'
},
CopyDataBlockBytes: {
url: 'https://262.ecma-international.org/6.0/#sec-copydatablockbytes'
},
CreateArrayFromList: {
url: 'https://262.ecma-international.org/6.0/#sec-createarrayfromlist'
},
CreateArrayIterator: {
url: 'https://262.ecma-international.org/6.0/#sec-createarrayiterator'
},
CreateBuiltinFunction: {
url: 'https://262.ecma-international.org/6.0/#sec-createbuiltinfunction'
},
CreateByteDataBlock: {
url: 'https://262.ecma-international.org/6.0/#sec-createbytedatablock'
},
CreateDataProperty: {
url: 'https://262.ecma-international.org/6.0/#sec-createdataproperty'
},
CreateDataPropertyOrThrow: {
url: 'https://262.ecma-international.org/6.0/#sec-createdatapropertyorthrow'
},
CreateDynamicFunction: {
url: 'https://262.ecma-international.org/6.0/#sec-createdynamicfunction'
},
CreateHTML: {
url: 'https://262.ecma-international.org/6.0/#sec-createhtml'
},
CreateIntrinsics: {
url: 'https://262.ecma-international.org/6.0/#sec-createintrinsics'
},
CreateIterResultObject: {
url: 'https://262.ecma-international.org/6.0/#sec-createiterresultobject'
},
CreateListFromArrayLike: {
url: 'https://262.ecma-international.org/6.0/#sec-createlistfromarraylike'
},
CreateListIterator: {
url: 'https://262.ecma-international.org/6.0/#sec-createlistiterator'
},
CreateMapIterator: {
url: 'https://262.ecma-international.org/6.0/#sec-createmapiterator'
},
CreateMappedArgumentsObject: {
url: 'https://262.ecma-international.org/6.0/#sec-createmappedargumentsobject'
},
CreateMethodProperty: {
url: 'https://262.ecma-international.org/6.0/#sec-createmethodproperty'
},
CreatePerIterationEnvironment: {
url: 'https://262.ecma-international.org/6.0/#sec-createperiterationenvironment'
},
CreateRealm: {
url: 'https://262.ecma-international.org/6.0/#sec-createrealm'
},
CreateSetIterator: {
url: 'https://262.ecma-international.org/6.0/#sec-createsetiterator'
},
CreateUnmappedArgumentsObject: {
url: 'https://262.ecma-international.org/6.0/#sec-createunmappedargumentsobject'
},
DateFromTime: {
url: 'https://262.ecma-international.org/6.0/#sec-date-number'
},
Day: {
url: 'https://262.ecma-international.org/6.0/#sec-day-number-and-time-within-day'
},
DayFromYear: {
url: 'https://262.ecma-international.org/6.0/#sec-year-number'
},
DaylightSavingTA: {
url: 'https://262.ecma-international.org/6.0/#sec-daylight-saving-time-adjustment'
},
DaysInYear: {
url: 'https://262.ecma-international.org/6.0/#sec-year-number'
},
DayWithinYear: {
url: 'https://262.ecma-international.org/6.0/#sec-month-number'
},
Decode: {
url: 'https://262.ecma-international.org/6.0/#sec-decode'
},
DefinePropertyOrThrow: {
url: 'https://262.ecma-international.org/6.0/#sec-definepropertyorthrow'
},
DeletePropertyOrThrow: {
url: 'https://262.ecma-international.org/6.0/#sec-deletepropertyorthrow'
},
DetachArrayBuffer: {
url: 'https://262.ecma-international.org/6.0/#sec-detacharraybuffer'
},
Encode: {
url: 'https://262.ecma-international.org/6.0/#sec-encode'
},
EnqueueJob: {
url: 'https://262.ecma-international.org/6.0/#sec-enqueuejob'
},
EnumerableOwnNames: {
url: 'https://262.ecma-international.org/6.0/#sec-enumerableownnames'
},
EscapeRegExpPattern: {
url: 'https://262.ecma-international.org/6.0/#sec-escaperegexppattern'
},
EvalDeclarationInstantiation: {
url: 'https://262.ecma-international.org/6.0/#sec-evaldeclarationinstantiation'
},
EvaluateCall: {
url: 'https://262.ecma-international.org/6.0/#sec-evaluatecall'
},
EvaluateDirectCall: {
url: 'https://262.ecma-international.org/6.0/#sec-evaluatedirectcall'
},
EvaluateNew: {
url: 'https://262.ecma-international.org/6.0/#sec-evaluatenew'
},
floor: {
url: 'https://262.ecma-international.org/6.0/#sec-algorithm-conventions'
},
ForBodyEvaluation: {
url: 'https://262.ecma-international.org/6.0/#sec-forbodyevaluation'
},
'ForIn/OfBodyEvaluation': {
url: 'https://262.ecma-international.org/6.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset'
},
'ForIn/OfHeadEvaluation': {
url: 'https://262.ecma-international.org/6.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind'
},
FromPropertyDescriptor: {
url: 'https://262.ecma-international.org/6.0/#sec-frompropertydescriptor'
},
FulfillPromise: {
url: 'https://262.ecma-international.org/6.0/#sec-fulfillpromise'
},
FunctionAllocate: {
url: 'https://262.ecma-international.org/6.0/#sec-functionallocate'
},
FunctionCreate: {
url: 'https://262.ecma-international.org/6.0/#sec-functioncreate'
},
FunctionInitialize: {
url: 'https://262.ecma-international.org/6.0/#sec-functioninitialize'
},
GeneratorFunctionCreate: {
url: 'https://262.ecma-international.org/6.0/#sec-generatorfunctioncreate'
},
GeneratorResume: {
url: 'https://262.ecma-international.org/6.0/#sec-generatorresume'
},
GeneratorResumeAbrupt: {
url: 'https://262.ecma-international.org/6.0/#sec-generatorresumeabrupt'
},
GeneratorStart: {
url: 'https://262.ecma-international.org/6.0/#sec-generatorstart'
},
GeneratorValidate: {
url: 'https://262.ecma-international.org/6.0/#sec-generatorvalidate'
},
GeneratorYield: {
url: 'https://262.ecma-international.org/6.0/#sec-generatoryield'
},
Get: {
url: 'https://262.ecma-international.org/6.0/#sec-get-o-p'
},
GetBase: {
url: 'https://262.ecma-international.org/6.0/#sec-jobs-and-job-queues'
},
GetFunctionRealm: {
url: 'https://262.ecma-international.org/6.0/#sec-getfunctionrealm'
},
GetGlobalObject: {
url: 'https://262.ecma-international.org/6.0/#sec-getglobalobject'
},
GetIdentifierReference: {
url: 'https://262.ecma-international.org/6.0/#sec-getidentifierreference'
},
GetIterator: {
url: 'https://262.ecma-international.org/6.0/#sec-getiterator'
},
GetMethod: {
url: 'https://262.ecma-international.org/6.0/#sec-getmethod'
},
GetModuleNamespace: {
url: 'https://262.ecma-international.org/6.0/#sec-getmodulenamespace'
},
GetNewTarget: {
url: 'https://262.ecma-international.org/6.0/#sec-getnewtarget'
},
GetOwnPropertyKeys: {
url: 'https://262.ecma-international.org/6.0/#sec-getownpropertykeys'
},
GetPrototypeFromConstructor: {
url: 'https://262.ecma-international.org/6.0/#sec-getprototypefromconstructor'
},
GetReferencedName: {
url: 'https://262.ecma-international.org/6.0/#sec-jobs-and-job-queues'
},
GetSubstitution: {
url: 'https://262.ecma-international.org/6.0/#sec-getsubstitution'
},
GetSuperConstructor: {
url: 'https://262.ecma-international.org/6.0/#sec-getsuperconstructor'
},
GetTemplateObject: {
url: 'https://262.ecma-international.org/6.0/#sec-gettemplateobject'
},
GetThisEnvironment: {
url: 'https://262.ecma-international.org/6.0/#sec-getthisenvironment'
},
GetThisValue: {
url: 'https://262.ecma-international.org/6.0/#sec-getthisvalue'
},
GetV: {
url: 'https://262.ecma-international.org/6.0/#sec-getv'
},
GetValue: {
url: 'https://262.ecma-international.org/6.0/#sec-getvalue'
},
GetValueFromBuffer: {
url: 'https://262.ecma-international.org/6.0/#sec-getvaluefrombuffer'
},
GetViewValue: {
url: 'https://262.ecma-international.org/6.0/#sec-getviewvalue'
},
HasOwnProperty: {
url: 'https://262.ecma-international.org/6.0/#sec-hasownproperty'
},
HasPrimitiveBase: {
url: 'https://262.ecma-international.org/6.0/#sec-jobs-and-job-queues'
},
HasProperty: {
url: 'https://262.ecma-international.org/6.0/#sec-hasproperty'
},
HourFromTime: {
url: 'https://262.ecma-international.org/6.0/#sec-hours-minutes-second-and-milliseconds'
},
ImportedLocalNames: {
url: 'https://262.ecma-international.org/6.0/#sec-importedlocalnames'
},
InitializeHostDefinedRealm: {
url: 'https://262.ecma-international.org/6.0/#sec-initializehostdefinedrealm'
},
InitializeReferencedBinding: {
url: 'https://262.ecma-international.org/6.0/#sec-initializereferencedbinding'
},
InLeapYear: {
url: 'https://262.ecma-international.org/6.0/#sec-year-number'
},
InstanceofOperator: {
url: 'https://262.ecma-international.org/6.0/#sec-instanceofoperator'
},
IntegerIndexedElementGet: {
url: 'https://262.ecma-international.org/6.0/#sec-integerindexedelementget'
},
IntegerIndexedElementSet: {
url: 'https://262.ecma-international.org/6.0/#sec-integerindexedelementset'
},
IntegerIndexedObjectCreate: {
url: 'https://262.ecma-international.org/6.0/#sec-integerindexedobjectcreate'
},
InternalizeJSONProperty: {
url: 'https://262.ecma-international.org/6.0/#sec-internalizejsonproperty'
},
Invoke: {
url: 'https://262.ecma-international.org/6.0/#sec-invoke'
},
IsAccessorDescriptor: {
url: 'https://262.ecma-international.org/6.0/#sec-isaccessordescriptor'
},
IsAnonymousFunctionDefinition: {
url: 'https://262.ecma-international.org/6.0/#sec-isanonymousfunctiondefinition'
},
IsArray: {
url: 'https://262.ecma-international.org/6.0/#sec-isarray'
},
IsCallable: {
url: 'https://262.ecma-international.org/6.0/#sec-iscallable'
},
IsCompatiblePropertyDescriptor: {
url: 'https://262.ecma-international.org/6.0/#sec-iscompatiblepropertydescriptor'
},
IsConcatSpreadable: {
url: 'https://262.ecma-international.org/6.0/#sec-isconcatspreadable'
},
IsConstructor: {
url: 'https://262.ecma-international.org/6.0/#sec-isconstructor'
},
IsDataDescriptor: {
url: 'https://262.ecma-international.org/6.0/#sec-isdatadescriptor'
},
IsDetachedBuffer: {
url: 'https://262.ecma-international.org/6.0/#sec-isdetachedbuffer'
},
IsExtensible: {
url: 'https://262.ecma-international.org/6.0/#sec-isextensible-o'
},
IsGenericDescriptor: {
url: 'https://262.ecma-international.org/6.0/#sec-isgenericdescriptor'
},
IsInTailPosition: {
url: 'https://262.ecma-international.org/6.0/#sec-isintailposition'
},
IsInteger: {
url: 'https://262.ecma-international.org/6.0/#sec-isinteger'
},
IsLabelledFunction: {
url: 'https://262.ecma-international.org/6.0/#sec-islabelledfunction'
},
IsPromise: {
url: 'https://262.ecma-international.org/6.0/#sec-ispromise'
},
IsPropertyKey: {
url: 'https://262.ecma-international.org/6.0/#sec-ispropertykey'
},
IsPropertyReference: {
url: 'https://262.ecma-international.org/6.0/#sec-jobs-and-job-queues'
},
IsRegExp: {
url: 'https://262.ecma-international.org/6.0/#sec-isregexp'
},
IsStrictReference: {
url: 'https://262.ecma-international.org/6.0/#sec-jobs-and-job-queues'
},
IsSuperReference: {
url: 'https://262.ecma-international.org/6.0/#sec-jobs-and-job-queues'
},
IsUnresolvableReference: {
url: 'https://262.ecma-international.org/6.0/#sec-jobs-and-job-queues'
},
IsWordChar: {
url: 'https://262.ecma-international.org/6.0/#sec-runtime-semantics-iswordchar-abstract-operation'
},
IteratorClose: {
url: 'https://262.ecma-international.org/6.0/#sec-iteratorclose'
},
IteratorComplete: {
url: 'https://262.ecma-international.org/6.0/#sec-iteratorcomplete'
},
IteratorNext: {
url: 'https://262.ecma-international.org/6.0/#sec-iteratornext'
},
IteratorStep: {
url: 'https://262.ecma-international.org/6.0/#sec-iteratorstep'
},
IteratorValue: {
url: 'https://262.ecma-international.org/6.0/#sec-iteratorvalue'
},
LocalTime: {
url: 'https://262.ecma-international.org/6.0/#sec-localtime'
},
LoopContinues: {
url: 'https://262.ecma-international.org/6.0/#sec-loopcontinues'
},
MakeArgGetter: {
url: 'https://262.ecma-international.org/6.0/#sec-makearggetter'
},
MakeArgSetter: {
url: 'https://262.ecma-international.org/6.0/#sec-makeargsetter'
},
MakeClassConstructor: {
url: 'https://262.ecma-international.org/6.0/#sec-makeclassconstructor'
},
MakeConstructor: {
url: 'https://262.ecma-international.org/6.0/#sec-makeconstructor'
},
MakeDate: {
url: 'https://262.ecma-international.org/6.0/#sec-makedate'
},
MakeDay: {
url: 'https://262.ecma-international.org/6.0/#sec-makeday'
},
MakeMethod: {
url: 'https://262.ecma-international.org/6.0/#sec-makemethod'
},
MakeSuperPropertyReference: {
url: 'https://262.ecma-international.org/6.0/#sec-makesuperpropertyreference'
},
MakeTime: {
url: 'https://262.ecma-international.org/6.0/#sec-maketime'
},
max: {
url: 'https://262.ecma-international.org/6.0/#sec-algorithm-conventions'
},
min: {
url: 'https://262.ecma-international.org/6.0/#sec-algorithm-conventions'
},
MinFromTime: {
url: 'https://262.ecma-international.org/6.0/#sec-hours-minutes-second-and-milliseconds'
},
ModuleNamespaceCreate: {
url: 'https://262.ecma-international.org/6.0/#sec-modulenamespacecreate'
},
modulo: {
url: 'https://262.ecma-international.org/6.0/#sec-algorithm-conventions'
},
MonthFromTime: {
url: 'https://262.ecma-international.org/6.0/#sec-month-number'
},
msFromTime: {
url: 'https://262.ecma-international.org/6.0/#sec-hours-minutes-second-and-milliseconds'
},
msPerDay: {
url: 'https://262.ecma-international.org/6.0/#sec-day-number-and-time-within-day'
},
NewDeclarativeEnvironment: {
url: 'https://262.ecma-international.org/6.0/#sec-newdeclarativeenvironment'
},
NewFunctionEnvironment: {
url: 'https://262.ecma-international.org/6.0/#sec-newfunctionenvironment'
},
NewGlobalEnvironment: {
url: 'https://262.ecma-international.org/6.0/#sec-newglobalenvironment'
},
NewModuleEnvironment: {
url: 'https://262.ecma-international.org/6.0/#sec-newmoduleenvironment'
},
NewObjectEnvironment: {
url: 'https://262.ecma-international.org/6.0/#sec-newobjectenvironment'
},
NewPromiseCapability: {
url: 'https://262.ecma-international.org/6.0/#sec-newpromisecapability'
},
NormalCompletion: {
url: 'https://262.ecma-international.org/6.0/#sec-normalcompletion'
},
ObjectCreate: {
url: 'https://262.ecma-international.org/6.0/#sec-objectcreate'
},
ObjectDefineProperties: {
url: 'https://262.ecma-international.org/6.0/#sec-objectdefineproperties'
},
OrdinaryCallBindThis: {
url: 'https://262.ecma-international.org/6.0/#sec-ordinarycallbindthis'
},
OrdinaryCallEvaluateBody: {
url: 'https://262.ecma-international.org/6.0/#sec-ordinarycallevaluatebody'
},
OrdinaryCreateFromConstructor: {
url: 'https://262.ecma-international.org/6.0/#sec-ordinarycreatefromconstructor'
},
OrdinaryDefineOwnProperty: {
url: 'https://262.ecma-international.org/6.0/#sec-ordinarydefineownproperty'
},
OrdinaryGetOwnProperty: {
url: 'https://262.ecma-international.org/6.0/#sec-ordinarygetownproperty'
},
OrdinaryHasInstance: {
url: 'https://262.ecma-international.org/6.0/#sec-ordinaryhasinstance'
},
OrdinaryHasProperty: {
url: 'https://262.ecma-international.org/6.0/#sec-ordinaryhasproperty'
},
ParseModule: {
url: 'https://262.ecma-international.org/6.0/#sec-parsemodule'
},
PerformEval: {
url: 'https://262.ecma-international.org/6.0/#sec-performeval'
},
PerformPromiseAll: {
url: 'https://262.ecma-international.org/6.0/#sec-performpromiseall'
},
PerformPromiseRace: {
url: 'https://262.ecma-international.org/6.0/#sec-performpromiserace'
},
PerformPromiseThen: {
url: 'https://262.ecma-international.org/6.0/#sec-performpromisethen'
},
PrepareForOrdinaryCall: {
url: 'https://262.ecma-international.org/6.0/#sec-prepareforordinarycall'
},
PrepareForTailCall: {
url: 'https://262.ecma-international.org/6.0/#sec-preparefortailcall'
},
ProxyCreate: {
url: 'https://262.ecma-international.org/6.0/#sec-proxycreate'
},
PutValue: {
url: 'https://262.ecma-international.org/6.0/#sec-putvalue'
},
QuoteJSONString: {
url: 'https://262.ecma-international.org/6.0/#sec-quotejsonstring'
},
RegExpAlloc: {
url: 'https://262.ecma-international.org/6.0/#sec-regexpalloc'
},
RegExpBuiltinExec: {
url: 'https://262.ecma-international.org/6.0/#sec-regexpbuiltinexec'
},
RegExpCreate: {
url: 'https://262.ecma-international.org/6.0/#sec-regexpcreate'
},
RegExpExec: {
url: 'https://262.ecma-international.org/6.0/#sec-regexpexec'
},
RegExpInitialize: {
url: 'https://262.ecma-international.org/6.0/#sec-regexpinitialize'
},
RejectPromise: {
url: 'https://262.ecma-international.org/6.0/#sec-rejectpromise'
},
RepeatMatcher: {
url: 'https://262.ecma-international.org/6.0/#sec-runtime-semantics-repeatmatcher-abstract-operation'
},
RequireObjectCoercible: {
url: 'https://262.ecma-international.org/6.0/#sec-requireobjectcoercible'
},
ResolveBinding: {
url: 'https://262.ecma-international.org/6.0/#sec-resolvebinding'
},
ResolveThisBinding: {
url: 'https://262.ecma-international.org/6.0/#sec-resolvethisbinding'
},
SameValue: {
url: 'https://262.ecma-international.org/6.0/#sec-samevalue'
},
SameValueZero: {
url: 'https://262.ecma-international.org/6.0/#sec-samevaluezero'
},
SecFromTime: {
url: 'https://262.ecma-international.org/6.0/#sec-hours-minutes-second-and-milliseconds'
},
SerializeJSONArray: {
url: 'https://262.ecma-international.org/6.0/#sec-serializejsonarray'
},
SerializeJSONObject: {
url: 'https://262.ecma-international.org/6.0/#sec-serializejsonobject'
},
SerializeJSONProperty: {
url: 'https://262.ecma-international.org/6.0/#sec-serializejsonproperty'
},
Set: {
url: 'https://262.ecma-international.org/6.0/#sec-set-o-p-v-throw'
},
SetDefaultGlobalBindings: {
url: 'https://262.ecma-international.org/6.0/#sec-setdefaultglobalbindings'
},
SetFunctionName: {
url: 'https://262.ecma-international.org/6.0/#sec-setfunctionname'
},
SetIntegrityLevel: {
url: 'https://262.ecma-international.org/6.0/#sec-setintegritylevel'
},
SetRealmGlobalObject: {
url: 'https://262.ecma-international.org/6.0/#sec-setrealmglobalobject'
},
SetValueInBuffer: {
url: 'https://262.ecma-international.org/6.0/#sec-setvalueinbuffer'
},
SetViewValue: {
url: 'https://262.ecma-international.org/6.0/#sec-setviewvalue'
},
sign: {
url: 'https://262.ecma-international.org/6.0/#sec-algorithm-conventions'
},
SortCompare: {
url: 'https://262.ecma-international.org/6.0/#sec-sortcompare'
},
SpeciesConstructor: {
url: 'https://262.ecma-international.org/6.0/#sec-speciesconstructor'
},
SplitMatch: {
url: 'https://262.ecma-international.org/6.0/#sec-splitmatch'
},
'Strict Equality Comparison': {
url: 'https://262.ecma-international.org/6.0/#sec-strict-equality-comparison'
},
StringCreate: {
url: 'https://262.ecma-international.org/6.0/#sec-stringcreate'
},
StringGetIndexProperty: {
url: 'https://262.ecma-international.org/6.0/#sec-stringgetindexproperty'
},
SymbolDescriptiveString: {
url: 'https://262.ecma-international.org/6.0/#sec-symboldescriptivestring'
},
TestIntegrityLevel: {
url: 'https://262.ecma-international.org/6.0/#sec-testintegritylevel'
},
thisBooleanValue: {
url: 'https://262.ecma-international.org/6.0/#sec-properties-of-the-boolean-prototype-object'
},
thisNumberValue: {
url: 'https://262.ecma-international.org/6.0/#sec-properties-of-the-number-prototype-object'
},
thisStringValue: {
url: 'https://262.ecma-international.org/6.0/#sec-properties-of-the-string-prototype-object'
},
thisTimeValue: {
url: 'https://262.ecma-international.org/6.0/#sec-properties-of-the-date-prototype-object'
},
TimeClip: {
url: 'https://262.ecma-international.org/6.0/#sec-timeclip'
},
TimeFromYear: {
url: 'https://262.ecma-international.org/6.0/#sec-year-number'
},
TimeWithinDay: {
url: 'https://262.ecma-international.org/6.0/#sec-day-number-and-time-within-day'
},
ToBoolean: {
url: 'https://262.ecma-international.org/6.0/#sec-toboolean'
},
ToDateString: {
url: 'https://262.ecma-international.org/6.0/#sec-todatestring'
},
ToInt16: {
url: 'https://262.ecma-international.org/6.0/#sec-toint16'
},
ToInt32: {
url: 'https://262.ecma-international.org/6.0/#sec-toint32'
},
ToInt8: {
url: 'https://262.ecma-international.org/6.0/#sec-toint8'
},
ToInteger: {
url: 'https://262.ecma-international.org/6.0/#sec-tointeger'
},
ToLength: {
url: 'https://262.ecma-international.org/6.0/#sec-tolength'
},
ToNumber: {
url: 'https://262.ecma-international.org/6.0/#sec-tonumber'
},
ToObject: {
url: 'https://262.ecma-international.org/6.0/#sec-toobject'
},
ToPrimitive: {
url: 'https://262.ecma-international.org/6.0/#sec-toprimitive'
},
ToPropertyDescriptor: {
url: 'https://262.ecma-international.org/6.0/#sec-topropertydescriptor'
},
ToPropertyKey: {
url: 'https://262.ecma-international.org/6.0/#sec-topropertykey'
},
ToString: {
url: 'https://262.ecma-international.org/6.0/#sec-tostring'
},
ToUint16: {
url: 'https://262.ecma-international.org/6.0/#sec-touint16'
},
ToUint32: {
url: 'https://262.ecma-international.org/6.0/#sec-touint32'
},
ToUint8: {
url: 'https://262.ecma-international.org/6.0/#sec-touint8'
},
ToUint8Clamp: {
url: 'https://262.ecma-international.org/6.0/#sec-touint8clamp'
},
TriggerPromiseReactions: {
url: 'https://262.ecma-international.org/6.0/#sec-triggerpromisereactions'
},
Type: {
url: 'https://262.ecma-international.org/6.0/#sec-ecmascript-data-types-and-values'
},
TypedArrayFrom: {
url: 'https://262.ecma-international.org/6.0/#sec-typedarrayfrom'
},
UpdateEmpty: {
url: 'https://262.ecma-international.org/6.0/#sec-updateempty'
},
UTC: {
url: 'https://262.ecma-international.org/6.0/#sec-utc-t'
},
ValidateAndApplyPropertyDescriptor: {
url: 'https://262.ecma-international.org/6.0/#sec-validateandapplypropertydescriptor'
},
ValidateTypedArray: {
url: 'https://262.ecma-international.org/6.0/#sec-validatetypedarray'
},
WeekDay: {
url: 'https://262.ecma-international.org/6.0/#sec-week-day'
},
YearFromTime: {
url: 'https://262.ecma-international.org/6.0/#sec-year-number'
}
};
@@ -0,0 +1,30 @@
import * as fsScandir from '@nodelib/fs.scandir';
import type { Entry, Errno } from './types';
export declare type FilterFunction<T> = (value: T) => boolean;
export declare type DeepFilterFunction = FilterFunction<Entry>;
export declare type EntryFilterFunction = FilterFunction<Entry>;
export declare type ErrorFilterFunction = FilterFunction<Errno>;
export interface Options {
basePath?: string;
concurrency?: number;
deepFilter?: DeepFilterFunction;
entryFilter?: EntryFilterFunction;
errorFilter?: ErrorFilterFunction;
followSymbolicLinks?: boolean;
fs?: Partial<fsScandir.FileSystemAdapter>;
pathSegmentSeparator?: string;
stats?: boolean;
throwErrorOnBrokenSymbolicLink?: boolean;
}
export default class Settings {
private readonly _options;
readonly basePath?: string;
readonly concurrency: number;
readonly deepFilter: DeepFilterFunction | null;
readonly entryFilter: EntryFilterFunction | null;
readonly errorFilter: ErrorFilterFunction | null;
readonly pathSegmentSeparator: string;
readonly fsScandirSettings: fsScandir.Settings;
constructor(_options?: Options);
private _getValue;
}
@@ -0,0 +1 @@
export {pointEnd, pointStart, position} from './lib/index.js'
@@ -0,0 +1,292 @@
import {
each,
has,
is,
isDraftable,
shallowCopy,
latest,
ImmerBaseState,
ImmerState,
Drafted,
AnyObject,
AnyArray,
Objectish,
getCurrentScope,
getPrototypeOf,
DRAFT_STATE,
die,
createProxy,
ArchType,
ImmerScope
} from "../internal"
interface ProxyBaseState extends ImmerBaseState {
assigned_: {
[property: string]: boolean
}
parent_?: ImmerState
revoke_(): void
}
export interface ProxyObjectState extends ProxyBaseState {
type_: ArchType.Object
base_: any
copy_: any
draft_: Drafted<AnyObject, ProxyObjectState>
}
export interface ProxyArrayState extends ProxyBaseState {
type_: ArchType.Array
base_: AnyArray
copy_: AnyArray | null
draft_: Drafted<AnyArray, ProxyArrayState>
}
type ProxyState = ProxyObjectState | ProxyArrayState
/**
* Returns a new draft of the `base` object.
*
* The second argument is the parent draft-state (used internally).
*/
export function createProxyProxy<T extends Objectish>(
base: T,
parent?: ImmerState
): Drafted<T, ProxyState> {
const isArray = Array.isArray(base)
const state: ProxyState = {
type_: isArray ? ArchType.Array : (ArchType.Object as any),
// Track which produce call this is associated with.
scope_: parent ? parent.scope_ : getCurrentScope()!,
// True for both shallow and deep changes.
modified_: false,
// Used during finalization.
finalized_: false,
// Track which properties have been assigned (true) or deleted (false).
assigned_: {},
// The parent draft state.
parent_: parent,
// The base state.
base_: base,
// The base proxy.
draft_: null as any, // set below
// The base copy with any updated values.
copy_: null,
// Called by the `produce` function.
revoke_: null as any,
isManual_: false
}
// the traps must target something, a bit like the 'real' base.
// but also, we need to be able to determine from the target what the relevant state is
// (to avoid creating traps per instance to capture the state in closure,
// and to avoid creating weird hidden properties as well)
// So the trick is to use 'state' as the actual 'target'! (and make sure we intercept everything)
// Note that in the case of an array, we put the state in an array to have better Reflect defaults ootb
let target: T = state as any
let traps: ProxyHandler<object | Array<any>> = objectTraps
if (isArray) {
target = [state] as any
traps = arrayTraps
}
const {revoke, proxy} = Proxy.revocable(target, traps)
state.draft_ = proxy as any
state.revoke_ = revoke
return proxy as any
}
/**
* Object drafts
*/
export const objectTraps: ProxyHandler<ProxyState> = {
get(state, prop) {
if (prop === DRAFT_STATE) return state
const source = latest(state)
if (!has(source, prop)) {
// non-existing or non-own property...
return readPropFromProto(state, source, prop)
}
const value = source[prop]
if (state.finalized_ || !isDraftable(value)) {
return value
}
// Check for existing draft in modified state.
// Assigned values are never drafted. This catches any drafts we created, too.
if (value === peek(state.base_, prop)) {
prepareCopy(state)
return (state.copy_![prop as any] = createProxy(value, state))
}
return value
},
has(state, prop) {
return prop in latest(state)
},
ownKeys(state) {
return Reflect.ownKeys(latest(state))
},
set(
state: ProxyObjectState,
prop: string /* strictly not, but helps TS */,
value
) {
const desc = getDescriptorFromProto(latest(state), prop)
if (desc?.set) {
// special case: if this write is captured by a setter, we have
// to trigger it with the correct context
desc.set.call(state.draft_, value)
return true
}
if (!state.modified_) {
// the last check is because we need to be able to distinguish setting a non-existing to undefined (which is a change)
// from setting an existing property with value undefined to undefined (which is not a change)
const current = peek(latest(state), prop)
// special case, if we assigning the original value to a draft, we can ignore the assignment
const currentState: ProxyObjectState = current?.[DRAFT_STATE]
if (currentState && currentState.base_ === value) {
state.copy_![prop] = value
state.assigned_[prop] = false
return true
}
if (is(value, current) && (value !== undefined || has(state.base_, prop)))
return true
prepareCopy(state)
markChanged(state)
}
if (
(state.copy_![prop] === value &&
// special case: handle new props with value 'undefined'
(value !== undefined || prop in state.copy_)) ||
// special case: NaN
(Number.isNaN(value) && Number.isNaN(state.copy_![prop]))
)
return true
// @ts-ignore
state.copy_![prop] = value
state.assigned_[prop] = true
return true
},
deleteProperty(state, prop: string) {
// The `undefined` check is a fast path for pre-existing keys.
if (peek(state.base_, prop) !== undefined || prop in state.base_) {
state.assigned_[prop] = false
prepareCopy(state)
markChanged(state)
} else {
// if an originally not assigned property was deleted
delete state.assigned_[prop]
}
if (state.copy_) {
delete state.copy_[prop]
}
return true
},
// Note: We never coerce `desc.value` into an Immer draft, because we can't make
// the same guarantee in ES5 mode.
getOwnPropertyDescriptor(state, prop) {
const owner = latest(state)
const desc = Reflect.getOwnPropertyDescriptor(owner, prop)
if (!desc) return desc
return {
writable: true,
configurable: state.type_ !== ArchType.Array || prop !== "length",
enumerable: desc.enumerable,
value: owner[prop]
}
},
defineProperty() {
die(11)
},
getPrototypeOf(state) {
return getPrototypeOf(state.base_)
},
setPrototypeOf() {
die(12)
}
}
/**
* Array drafts
*/
const arrayTraps: ProxyHandler<[ProxyArrayState]> = {}
each(objectTraps, (key, fn) => {
// @ts-ignore
arrayTraps[key] = function() {
arguments[0] = arguments[0][0]
return fn.apply(this, arguments)
}
})
arrayTraps.deleteProperty = function(state, prop) {
if (process.env.NODE_ENV !== "production" && isNaN(parseInt(prop as any)))
die(13)
// @ts-ignore
return arrayTraps.set!.call(this, state, prop, undefined)
}
arrayTraps.set = function(state, prop, value) {
if (
process.env.NODE_ENV !== "production" &&
prop !== "length" &&
isNaN(parseInt(prop as any))
)
die(14)
return objectTraps.set!.call(this, state[0], prop, value, state[0])
}
// Access a property without creating an Immer draft.
function peek(draft: Drafted, prop: PropertyKey) {
const state = draft[DRAFT_STATE]
const source = state ? latest(state) : draft
return source[prop]
}
function readPropFromProto(state: ImmerState, source: any, prop: PropertyKey) {
const desc = getDescriptorFromProto(source, prop)
return desc
? `value` in desc
? desc.value
: // This is a very special case, if the prop is a getter defined by the
// prototype, we should invoke it with the draft as context!
desc.get?.call(state.draft_)
: undefined
}
function getDescriptorFromProto(
source: any,
prop: PropertyKey
): PropertyDescriptor | undefined {
// 'in' checks proto!
if (!(prop in source)) return undefined
let proto = getPrototypeOf(source)
while (proto) {
const desc = Object.getOwnPropertyDescriptor(proto, prop)
if (desc) return desc
proto = getPrototypeOf(proto)
}
return undefined
}
export function markChanged(state: ImmerState) {
if (!state.modified_) {
state.modified_ = true
if (state.parent_) {
markChanged(state.parent_)
}
}
}
export function prepareCopy(state: {
base_: any
copy_: any
scope_: ImmerScope
}) {
if (!state.copy_) {
state.copy_ = shallowCopy(
state.base_,
state.scope_.immer_.useStrictShallowCopy_
)
}
}
@@ -0,0 +1,47 @@
import * as path from 'node:path';
import path__default from 'node:path';
/**
* Constant for path separator.
*
* Always equals to `"/"`.
*/
declare const sep = "/";
declare const normalize: typeof path__default.normalize;
declare const join: typeof path__default.join;
declare const resolve: typeof path__default.resolve;
/**
* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
*
* @param path - The path to normalise.
* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
* @returns the normalised path string.
*/
declare function normalizeString(path: string, allowAboveRoot: boolean): string;
declare const isAbsolute: typeof path__default.isAbsolute;
declare const toNamespacedPath: typeof path__default.toNamespacedPath;
declare const extname: typeof path__default.extname;
declare const relative: typeof path__default.relative;
declare const dirname: typeof path__default.dirname;
declare const format: typeof path__default.format;
declare const basename: typeof path__default.basename;
declare const parse: typeof path__default.parse;
/**
* The `path.matchesGlob()` method determines if `path` matches the `pattern`.
* @param path The path to glob-match against.
* @param pattern The glob to check the path against.
*/
declare const matchesGlob: (path: string, pattern: string | string[]) => boolean;
type NodePath = typeof path;
/**
* The platform-specific file delimiter.
*
* Equals to `";"` in windows and `":"` in all other platforms.
*/
declare const delimiter: ";" | ":";
declare const posix: NodePath["posix"];
declare const win32: NodePath["win32"];
declare const _default: NodePath;
export { basename, _default as default, delimiter, dirname, extname, format, isAbsolute, join, matchesGlob, normalize, normalizeString, parse, posix, relative, resolve, sep, toNamespacedPath, win32 };
@@ -0,0 +1,26 @@
import { OB11EmitEventContent, OB11NetworkReloadType } from './index';
import { NapCatCore } from '../../napcat-core';
import { ActionMap } from '../action';
import { WebsocketServerConfig } from '../config/config';
import { NapCatOneBot11Adapter } from '../index';
import { IOB11NetworkAdapter } from '../network/adapter';
export declare class OB11WebSocketServerAdapter extends IOB11NetworkAdapter<WebsocketServerConfig> {
wsServer?: any;
wsClients: any[];
wsClientsMutex: any;
private heartbeatIntervalId;
wsClientWithEvent: any[];
get isActive(): boolean;
constructor(name: string, config: WebsocketServerConfig, core: NapCatCore, obContext: NapCatOneBot11Adapter, actions: ActionMap);
createServer(newServer: any): void;
connectEvent(core: NapCatCore, wsClient: any): void;
onEvent<T extends OB11EmitEventContent>(event: T): Promise<void>;
open(): void;
close(): Promise<void>;
private startHeartbeat;
private stopHeartbeat;
private authorize;
private checkStateAndReply;
private handleMessage;
reload(newConfig: WebsocketServerConfig): Promise<OB11NetworkReloadType.Normal | OB11NetworkReloadType.NetWorkReload | OB11NetworkReloadType.NetWorkClose | OB11NetworkReloadType.NetWorkOpen>;
}
@@ -0,0 +1 @@
{"name":"string.prototype.trimstart","version":"1.0.8","requiresBuild":false,"files":{".editorconfig":{"checkedAt":1794532097388,"integrity":"sha512-gD3iQtgC7ZgFS97pyZqR0FPjMNyRAfat8dipbSL28iiJ6B1MP5dDeDYeEnP5sYMTz8whQIk3E5vltk2kcyJJEQ==","mode":420,"size":286},".eslintrc":{"checkedAt":1794532097388,"integrity":"sha512-VX5h4KYPUk/60YDe88/JOL/KEIq3w4/KRWV2lMhhR0B8fNgZMrnW0qfK9AbGfUQ5qHTKhWrpsoRB2AgBpiy9ZA==","mode":420,"size":295},".nycrc":{"checkedAt":1794532089075,"integrity":"sha512-2vm1RFz8Ajl/OYrfoCWPJIm3Bpnf7Gyn5bha/lZx/cq+We3uMy9xj15XeP6x4wF3jf/pO7KMHAkU9mllm605xg==","mode":420,"size":139},"LICENSE":{"checkedAt":1794532097388,"integrity":"sha512-H02Tjxpuy9eBjZl1pN0vTzFJc8We+8STkC4VFz+NcFbtCW4a+nVLOy4kYuRlQFAvO46EYcbDB9C3dJ9PD3s0zg==","mode":420,"size":1073},"auto.js":{"checkedAt":1794532097388,"integrity":"sha512-8Q3Im5cACiIFrMmxvLnJnA8SXOjAd1kh/R0UIDVnErDD1WUlJIDrNfaOcIB6rtjAXNhq/OdL1374JM/QcAJ1VQ==","mode":420,"size":36},"implementation.js":{"checkedAt":1794532097388,"integrity":"sha512-hPsIb9ctQLsjRdT9s9Qmsjc6bvhM5EixNMcFSASoxotG3NKzuZp5UJSObc2J6t/9sDQwqQPQklRExxNCGIb3jA==","mode":420,"size":650},"test/implementation.js":{"checkedAt":1794532097389,"integrity":"sha512-JVgZ475qHrp+7T5MQ8DPUnl1KEDRSb6XNvWVNHBfUl1zDcoltosZk+r5LZfXwAYgu6V002a4EwqLca+bH3g29A==","mode":420,"size":637},"index.js":{"checkedAt":1794532097370,"integrity":"sha512-uwyPmwcvAoDWvvufOyUJSWhh3sTYQmtOTnogTiIDeSkOt5v+pa81MWvHMfQlCCn2YFARHvX3kHAzJXQe0mwn6Q==","mode":420,"size":572},"test/index.js":{"checkedAt":1794532097389,"integrity":"sha512-ddQEn3P5ZoVAK4ElmH0Bv7lbf1ExGCB1BbwJTWhdldYco2RA9gAfZ0Rnfj6ierf94ThbSGKt5GHLRTW5+YvIkA==","mode":420,"size":447},"polyfill.js":{"checkedAt":1794532097389,"integrity":"sha512-lo53WwUvZ3cCGxy+P+bsl3HC/uHRI9oCjzGDZeTswLYnzluAxEQqDHDMPbLrBeKq/OjWRdrVBe0Q1kPU0dAl6Q==","mode":420,"size":463},"shim.js":{"checkedAt":1794532097389,"integrity":"sha512-sFJKHQdaTScCe2Br9eL8+wUIkSaGZZVXpcnyWf40Km7y9QMiCYAkvhUX8bPCcfmKC+c3ji3M0cdO1tgpwgMnxw==","mode":420,"size":337},"test/shimmed.js":{"checkedAt":1794532097389,"integrity":"sha512-+Z2jurqK2UtezlYW/zbaNI5L3myS5DfiFKonkopQSD423dR4Q2v7b41er1xioI1ItmkY39gEqpyxVJR4XAl44Q==","mode":420,"size":1371},"test/tests.js":{"checkedAt":1794532097389,"integrity":"sha512-SVnGeqOvCuYT6i1LkMz+bqjZF0F3fijUP1ZJhllWPIL5wjhnBCl9TcgyWqJh8IqTRbDatF0pNyggGgTuTp6H1g==","mode":420,"size":1305},"package.json":{"checkedAt":1794532097389,"integrity":"sha512-71dZODKtZRpjqjUEt2IwW7ofGDc69WdP427vmT5G3lEaDIU2xMVS8Ed6mzr6MqiGvoCb53l+arr/K1U93vje0A==","mode":420,"size":2052},"CHANGELOG.md":{"checkedAt":1794532097390,"integrity":"sha512-FVlT3BVQKPI1WGQPEibGFCVsPgQoqc9bol9Rdn9GhfpIlgqO7QZYacJgWOYu8Di+6q4HYrAv3I9OJHSEkyrWkA==","mode":420,"size":10822},"README.md":{"checkedAt":1794532097390,"integrity":"sha512-UQJ0fquL4eGhn+Xwv/84P5HpAR7Lzqb2flMtUNl0PQUROqPi/14kLggUCxon3fgeI0lNlvoqvbXWcVYvJXcJAw==","mode":420,"size":2404}}}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 M G N O P Q H R S T U V W X Y Z 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L"},C:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"xC TC J ZB K D E F A B C L M 0C 1C"},D:{"1":"0 1 2 3 4 5 eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB"},E:{"2":"J ZB K D E F A 2C ZC 3C 4C 5C 6C aC","132":"B C L M G NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC","260":"lC","516":"mC CD SC nC oC pC","1028":"qC rC sC tC DD ED"},F:{"1":"0 1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z 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","2":"F B C G N O P aB FD GD HD ID NC uC JD OC"},G:{"1":"qC rC sC tC","2":"E ZC KD vC LD MD ND OD PD QD RD SD","132":"TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC","260":"lC","516":"mC gD SC nC oC pC"},H:{"2":"hD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD","2":"J"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:6,C:"Opus audio format",D:true};
@@ -0,0 +1 @@
{"name":"source-map-js","version":"1.2.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532092003,"integrity":"sha512-a4quda6qIVBUjYbx8AJc7J3bx9+jwfUeh96Hch7GTvMbYNorBIcYOMqVHOobuDrw3FGKsW0I5TNBGdEq703iew==","mode":420,"size":1526},"lib/array-set.js":{"checkedAt":1794532092003,"integrity":"sha512-/Ou0vVc0wZWT/wWuMPXJbSv3GHGF6gsYKDtzs/ej89xwTeuExiZakM8lbyeM9qXo4Vw+j3nyjQOLbVoTqBKr6g==","mode":420,"size":3197},"lib/base64-vlq.js":{"checkedAt":1794532092003,"integrity":"sha512-4iW04DK4voFlS0PnPjjRYsxEn4D16ha5f4d1mAgxfAIsm2DNwMEZ7WvX5p23u4NZt0K/APdoGXtbiMRhnowm4g==","mode":420,"size":4714},"lib/base64.js":{"checkedAt":1794532092003,"integrity":"sha512-+JZQPKYAvOuuLKlL9dQZPekes34WSJ3fPddKQ6ljF2muTTs8W5UvvmkgSOk/hHSAlD7C0wDum6T5OCh+uDoBIQ==","mode":420,"size":1540},"lib/binary-search.js":{"checkedAt":1794532092003,"integrity":"sha512-rJG62wV+zBLl+zcBJBTbBRyNnDU4npBQeZEfibzxIokkn241CAyLp7MjCGXFG9YhB8ggUROfm7xcsN8FkjtuDA==","mode":420,"size":4249},"lib/mapping-list.js":{"checkedAt":1794532092003,"integrity":"sha512-IGMtpwSL9QukmC3s3uaNHg7NHaUql5+bXdCJHPutUrs0tLyS30Zsbbf6WMnAEbnner0g5oA+LuG4TPuP0JnHew==","mode":420,"size":2339},"lib/quick-sort.js":{"checkedAt":1794532092004,"integrity":"sha512-VPX0GnsfQa+dnKFeUs7k/bqt/uWAJdZSQmKMHZPzXdK6ml5hUZQVWxY8R/lj0GHguK9e55X1eQorLpWo/tWFIg==","mode":420,"size":4068},"lib/source-map-consumer.js":{"checkedAt":1794532092004,"integrity":"sha512-sn2GxvzWJyIvJKbe4mj/sFmiWHpFP2ykW0GjQpvGqASrfZ99YFteF4CLpM1aFPNJvWWoGO0hmLtHnrTwtOFPTg==","mode":420,"size":41580},"lib/source-map-generator.js":{"checkedAt":1794532092004,"integrity":"sha512-+qVl3xUM1rfnnbIWXKYtb1mx/B2RKW+zQpt4gbv/fNKY+n3kItXb+8xol5xzZbyWP+AvffQuaBf+yQz7uYS/ZQ==","mode":420,"size":14933},"source-map.js":{"checkedAt":1794532092004,"integrity":"sha512-C+oUuncUn7WIh8JI4Kvc24krlT3unZRwf7QZT7rsPmr6E7qcWEblKXbDRE/dEqJqepjNjH+r3BZv+MmOKUw6TQ==","mode":420,"size":405},"lib/source-node.js":{"checkedAt":1794532092005,"integrity":"sha512-p+PQSP1b8COp/v3bAS9K1KLCSWu0vnfaV+So4LF9LkRyzuaO7hk0x1Mbg1uS+kKVU7WAbrl5A4MNCxyqyoQjng==","mode":420,"size":13808},"lib/util.js":{"checkedAt":1794532092005,"integrity":"sha512-mB1bNboxZcSn2/ps1LPlJKW0OpxZrUnh7IYkAyIo+OartEFKKMu4YohEDJGqxnQpMqOCi7+HaTOGy4C9KwIP2w==","mode":420,"size":15403},"package.json":{"checkedAt":1794532092005,"integrity":"sha512-+V/PKFrWxISNw7qt+OWYyAQSWMIOthzgRX346kL3t3T4oqpNPZpNvabO7lrluA8NKMfB8BeytBzz1ghEYLWu8A==","mode":420,"size":2548},"README.md":{"checkedAt":1794532092005,"integrity":"sha512-e25bHHZBeC49ctZIg1Q1IceQhjtmOy8XGle4/74nIrl5XiaGU7a8vr5srWM7IF/lfBPcLSIjj3JXvaQ2HiKqeQ==","mode":420,"size":26040},"lib/source-map-consumer.d.ts":{"checkedAt":1794532092005,"integrity":"sha512-CcDv6cr+8toFNChStJinlqQWO561KToqmmUBPW1fldINL1peKeCyjFz2C6E3tOgfbkWzukrSeR6bci0eu3FFWQ==","mode":420,"size":40},"lib/source-map-generator.d.ts":{"checkedAt":1794532092006,"integrity":"sha512-hzQMczqJAc805gGccJUXYA7CBJOPmigla0q+ageY49LacAMAMVhA3ZPHQQftDPgN3bxwMWskwCiXq0gambl7Ow==","mode":420,"size":41},"source-map.d.ts":{"checkedAt":1794532092006,"integrity":"sha512-uODu5uZuy1G6aV0EI1Wg2QX9hDjjBpewNhgTkfQ32k0TorvaruwM25MtaXDYcisuscr/4CqiWBotjAbmiThKAg==","mode":420,"size":3408},"lib/source-node.d.ts":{"checkedAt":1794532092006,"integrity":"sha512-klFaw42FbmKsOzx5NIDgNtnUssq860ULrjzSyvhI3yZAWntgpMpNaKqfJoqJWq4tSbdglSe6yfZaeMSSB7jk4w==","mode":420,"size":33}}}
@@ -0,0 +1,242 @@
"use strict";
var defaultParseOptions = {
decodeValues: true,
map: false,
silent: false,
};
function isForbiddenKey(key) {
return typeof key !== "string" || key in {};
}
function createNullObj() {
return Object.create(null);
}
function isNonEmptyString(str) {
return typeof str === "string" && !!str.trim();
}
function parseString(setCookieValue, options) {
var parts = setCookieValue.split(";").filter(isNonEmptyString);
var nameValuePairStr = parts.shift();
var parsed = parseNameValuePair(nameValuePairStr);
var name = parsed.name;
var value = parsed.value;
options = options
? Object.assign({}, defaultParseOptions, options)
: defaultParseOptions;
if (isForbiddenKey(name)) {
return null;
}
try {
value = options.decodeValues ? decodeURIComponent(value) : value; // decode cookie value
} catch (e) {
console.error(
"set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",
e
);
}
var cookie = createNullObj();
cookie.name = name;
cookie.value = value;
parts.forEach(function (part) {
var sides = part.split("=");
var key = sides.shift().trimLeft().toLowerCase();
if (isForbiddenKey(key)) {
return;
}
var value = sides.join("=");
if (key === "expires") {
cookie.expires = new Date(value);
} else if (key === "max-age") {
var n = parseInt(value, 10);
if (!Number.isNaN(n)) cookie.maxAge = n;
} else if (key === "secure") {
cookie.secure = true;
} else if (key === "httponly") {
cookie.httpOnly = true;
} else if (key === "samesite") {
cookie.sameSite = value;
} else if (key === "partitioned") {
cookie.partitioned = true;
} else if (key) {
cookie[key] = value;
}
});
return cookie;
}
function parseNameValuePair(nameValuePairStr) {
// Parses name-value-pair according to rfc6265bis draft
var name = "";
var value = "";
var nameValueArr = nameValuePairStr.split("=");
if (nameValueArr.length > 1) {
name = nameValueArr.shift();
value = nameValueArr.join("="); // everything after the first =, joined by a "=" if there was more than one part
} else {
value = nameValuePairStr;
}
return { name: name, value: value };
}
function parse(input, options) {
options = options
? Object.assign({}, defaultParseOptions, options)
: defaultParseOptions;
if (!input) {
if (!options.map) {
return [];
} else {
return createNullObj();
}
}
if (input.headers) {
if (typeof input.headers.getSetCookie === "function") {
// for fetch responses - they combine headers of the same type in the headers array,
// but getSetCookie returns an uncombined array
input = input.headers.getSetCookie();
} else if (input.headers["set-cookie"]) {
// fast-path for node.js (which automatically normalizes header names to lower-case)
input = input.headers["set-cookie"];
} else {
// slow-path for other environments - see #25
var sch =
input.headers[
Object.keys(input.headers).find(function (key) {
return key.toLowerCase() === "set-cookie";
})
];
// warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36
if (!sch && input.headers.cookie && !options.silent) {
console.warn(
"Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."
);
}
input = sch;
}
}
if (!Array.isArray(input)) {
input = [input];
}
if (!options.map) {
return input
.filter(isNonEmptyString)
.map(function (str) {
return parseString(str, options);
})
.filter(Boolean);
} else {
var cookies = createNullObj();
return input.filter(isNonEmptyString).reduce(function (cookies, str) {
var cookie = parseString(str, options);
if (cookie && !isForbiddenKey(cookie.name)) {
cookies[cookie.name] = cookie;
}
return cookies;
}, cookies);
}
}
/*
Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas
that are within a single set-cookie field-value, such as in the Expires portion.
This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2
Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128
React Native's fetch does this for *every* header, including set-cookie.
Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25
Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
*/
function splitCookiesString(cookiesString) {
if (Array.isArray(cookiesString)) {
return cookiesString;
}
if (typeof cookiesString !== "string") {
return [];
}
var cookiesStrings = [];
var pos = 0;
var start;
var ch;
var lastComma;
var nextStart;
var cookiesSeparatorFound;
function skipWhitespace() {
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
pos += 1;
}
return pos < cookiesString.length;
}
function notSpecialChar() {
ch = cookiesString.charAt(pos);
return ch !== "=" && ch !== ";" && ch !== ",";
}
while (pos < cookiesString.length) {
start = pos;
cookiesSeparatorFound = false;
while (skipWhitespace()) {
ch = cookiesString.charAt(pos);
if (ch === ",") {
// ',' is a cookie separator if we have later first '=', not ';' or ','
lastComma = pos;
pos += 1;
skipWhitespace();
nextStart = pos;
while (pos < cookiesString.length && notSpecialChar()) {
pos += 1;
}
// currently special character
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
// we found cookies separator
cookiesSeparatorFound = true;
// pos is inside the next cookie, so back up and return it.
pos = nextStart;
cookiesStrings.push(cookiesString.substring(start, lastComma));
start = pos;
} else {
// in param ',' or param separator ';',
// we continue from that comma
pos = lastComma + 1;
}
} else {
pos += 1;
}
}
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
}
}
return cookiesStrings;
}
module.exports = parse;
module.exports.parse = parse;
module.exports.parseString = parseString;
module.exports.splitCookiesString = splitCookiesString;
@@ -0,0 +1,259 @@
# `node-gyp` - Node.js native addon build tool
[![Build Status](https://github.com/nodejs/node-gyp/workflows/Tests/badge.svg?branch=master)](https://github.com/nodejs/node-gyp/actions?query=workflow%3ATests+branch%3Amaster)
![npm](https://img.shields.io/npm/dm/node-gyp)
`node-gyp` is a cross-platform command-line tool written in Node.js for
compiling native addon modules for Node.js. It contains a vendored copy of the
[gyp-next](https://github.com/nodejs/gyp-next) project that was previously used
by the Chromium team, extended to support the development of Node.js native addons.
Note that `node-gyp` is _not_ used to build Node.js itself.
Multiple target versions of Node.js are supported (i.e. `0.8`, ..., `4`, `5`, `6`,
etc.), regardless of what version of Node.js is actually installed on your system
(`node-gyp` downloads the necessary development files or headers for the target version).
## Features
* The same build commands work on any of the supported platforms
* Supports the targeting of different versions of Node.js
## Installation
You can install `node-gyp` using `npm`:
``` bash
npm install -g node-gyp
```
Depending on your operating system, you will need to install:
### On Unix
* Python v3.7, v3.8, v3.9, or v3.10
* `make`
* A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org)
### On macOS
**ATTENTION**: If your Mac has been _upgraded_ to macOS Catalina (10.15) or higher, please read [macOS_Catalina.md](macOS_Catalina.md).
* Python v3.7, v3.8, v3.9, or v3.10
* `XCode Command Line Tools` which will install `clang`, `clang++`, and `make`.
* Install the `XCode Command Line Tools` standalone by running `xcode-select --install`. -- OR --
* Alternatively, if you already have the [full Xcode installed](https://developer.apple.com/xcode/download/), you can install the Command Line Tools under the menu `Xcode -> Open Developer Tool -> More Developer Tools...`.
### On Windows
Install the current version of Python from the [Microsoft Store package](https://www.microsoft.com/en-us/p/python-310/9pjpw5ldxlz5).
Install tools and configuration manually:
* Install Visual C++ Build Environment: [Visual Studio Build Tools](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools)
(using "Visual C++ build tools" workload) or [Visual Studio Community](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community)
(using the "Desktop development with C++" workload)
If the above steps didn't work for you, please visit [Microsoft's Node.js Guidelines for Windows](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules) for additional tips.
To target native ARM64 Node.js on Windows on ARM, add the components "Visual C++ compilers and libraries for ARM64" and "Visual C++ ATL for ARM64".
To use the native ARM64 C++ compiler on Windows on ARM, ensure that you have Visual Studio 2022 [17.4 or later](https://devblogs.microsoft.com/visualstudio/arm64-visual-studio-is-officially-here/) installed.
### Configuring Python Dependency
`node-gyp` requires that you have installed a compatible version of Python, one of: v3.7, v3.8,
v3.9, or v3.10. If you have multiple Python versions installed, you can identify which Python
version `node-gyp` should use in one of the following ways:
1. by setting the `--python` command-line option, e.g.:
``` bash
node-gyp <command> --python /path/to/executable/python
```
2. If `node-gyp` is called by way of `npm`, *and* you have multiple versions of
Python installed, then you can set `npm`'s 'python' config key to the appropriate
value:
``` bash
npm config set python /path/to/executable/python
```
3. If the `PYTHON` environment variable is set to the path of a Python executable,
then that version will be used, if it is a compatible version.
4. If the `NODE_GYP_FORCE_PYTHON` environment variable is set to the path of a
Python executable, it will be used instead of any of the other configured or
builtin Python search paths. If it's not a compatible version, no further
searching will be done.
### Build for Third Party Node.js Runtimes
When building modules for third party Node.js runtimes like Electron, which have
different build configurations from the official Node.js distribution, you
should use `--dist-url` or `--nodedir` flags to specify the headers of the
runtime to build for.
Also when `--dist-url` or `--nodedir` flags are passed, node-gyp will use the
`config.gypi` shipped in the headers distribution to generate build
configurations, which is different from the default mode that would use the
`process.config` object of the running Node.js instance.
Some old versions of Electron shipped malformed `config.gypi` in their headers
distributions, and you might need to pass `--force-process-config` to node-gyp
to work around configuration errors.
## How to Use
To compile your native addon, first go to its root directory:
``` bash
cd my_node_addon
```
The next step is to generate the appropriate project build files for the current
platform. Use `configure` for that:
``` bash
node-gyp configure
```
Auto-detection fails for Visual C++ Build Tools 2015, so `--msvs_version=2015`
needs to be added (not needed when run by npm as configured above):
``` bash
node-gyp configure --msvs_version=2015
```
__Note__: The `configure` step looks for a `binding.gyp` file in the current
directory to process. See below for instructions on creating a `binding.gyp` file.
Now you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file
(on Windows) in the `build/` directory. Next, invoke the `build` command:
``` bash
node-gyp build
```
Now you have your compiled `.node` bindings file! The compiled bindings end up
in `build/Debug/` or `build/Release/`, depending on the build mode. At this point,
you can require the `.node` file with Node.js and run your tests!
__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or
`-d`) switch when running either the `configure`, `build` or `rebuild` commands.
## The `binding.gyp` file
A `binding.gyp` file describes the configuration to build your module, in a
JSON-like format. This file gets placed in the root of your package, alongside
`package.json`.
A barebones `gyp` file appropriate for building a Node.js addon could look like:
```python
{
"targets": [
{
"target_name": "binding",
"sources": [ "src/binding.cc" ]
}
]
}
```
## Further reading
The **[docs](./docs/)** directory contains additional documentation on specific node-gyp topics that may be useful if you are experiencing problems installing or building addons using node-gyp.
Some additional resources for Node.js native addons and writing `gyp` configuration files:
* ["Going Native" a nodeschool.io tutorial](http://nodeschool.io/#goingnative)
* ["Hello World" node addon example](https://github.com/nodejs/node/tree/master/test/addons/hello-world)
* [gyp user documentation](https://gyp.gsrc.io/docs/UserDocumentation.md)
* [gyp input format reference](https://gyp.gsrc.io/docs/InputFormatReference.md)
* [*"binding.gyp" files out in the wild* wiki page](./docs/binding.gyp-files-in-the-wild.md)
## Commands
`node-gyp` responds to the following commands:
| **Command** | **Description**
|:--------------|:---------------------------------------------------------------
| `help` | Shows the help dialog
| `build` | Invokes `make`/`msbuild.exe` and builds the native addon
| `clean` | Removes the `build` directory if it exists
| `configure` | Generates project build files for the current platform
| `rebuild` | Runs `clean`, `configure` and `build` all in a row
| `install` | Installs Node.js header files for the given version
| `list` | Lists the currently installed Node.js header versions
| `remove` | Removes the Node.js header files for the given version
## Command Options
`node-gyp` accepts the following command options:
| **Command** | **Description**
|:----------------------------------|:------------------------------------------
| `-j n`, `--jobs n` | Run `make` in parallel. The value `max` will use all available CPU cores
| `--target=v6.2.1` | Node.js version to build for (default is `process.version`)
| `--silly`, `--loglevel=silly` | Log all progress to console
| `--verbose`, `--loglevel=verbose` | Log most progress to console
| `--silent`, `--loglevel=silent` | Don't log anything to console
| `debug`, `--debug` | Make Debug build (default is `Release`)
| `--release`, `--no-debug` | Make Release build
| `-C $dir`, `--directory=$dir` | Run command in different directory
| `--make=$make` | Override `make` command (e.g. `gmake`)
| `--thin=yes` | Enable thin static libraries
| `--arch=$arch` | Set target architecture (e.g. ia32)
| `--tarball=$path` | Get headers from a local tarball
| `--devdir=$path` | SDK download directory (default is OS cache directory)
| `--ensure` | Don't reinstall headers if already present
| `--dist-url=$url` | Download header tarball from custom URL
| `--proxy=$url` | Set HTTP(S) proxy for downloading header tarball
| `--noproxy=$urls` | Set urls to ignore proxies when downloading header tarball
| `--cafile=$cafile` | Override default CA chain (to download tarball)
| `--nodedir=$path` | Set the path to the node source code
| `--python=$path` | Set path to the Python binary
| `--msvs_version=$version` | Set Visual Studio version (Windows only)
| `--solution=$solution` | Set Visual Studio Solution version (Windows only)
| `--force-process-config` | Force using runtime's `process.config` object to generate `config.gypi` file
## Configuration
### Environment variables
Use the form `npm_config_OPTION_NAME` for any of the command options listed
above (dashes in option names should be replaced by underscores).
For example, to set `devdir` equal to `/tmp/.gyp`, you would:
Run this on Unix:
```bash
export npm_config_devdir=/tmp/.gyp
```
Or this on Windows:
```console
set npm_config_devdir=c:\temp\.gyp
```
### `npm` configuration
Use the form `OPTION_NAME` for any of the command options listed above.
For example, to set `devdir` equal to `/tmp/.gyp`, you would run:
```bash
npm config set [--global] devdir /tmp/.gyp
```
**Note:** Configuration set via `npm` will only be used when `node-gyp`
is run via `npm`, not when `node-gyp` is run directly.
## License
`node-gyp` is available under the MIT license. See the [LICENSE
file](LICENSE) for details.
@@ -0,0 +1,7 @@
// Generated using scripts/write-decode-map.ts
export default new Uint16Array(
// prettier-ignore
"\u1d41<\xd5\u0131\u028a\u049d\u057b\u05d0\u0675\u06de\u07a2\u07d6\u080f\u0a4a\u0a91\u0da1\u0e6d\u0f09\u0f26\u10ca\u1228\u12e1\u1415\u149d\u14c3\u14df\u1525\0\0\0\0\0\0\u156b\u16cd\u198d\u1c12\u1ddd\u1f7e\u2060\u21b0\u228d\u23c0\u23fb\u2442\u2824\u2912\u2d08\u2e48\u2fce\u3016\u32ba\u3639\u37ac\u38fe\u3a28\u3a71\u3ae0\u3b2e\u0800EMabcfglmnoprstu\\bfms\x7f\x84\x8b\x90\x95\x98\xa6\xb3\xb9\xc8\xcflig\u803b\xc6\u40c6P\u803b&\u4026cute\u803b\xc1\u40c1reve;\u4102\u0100iyx}rc\u803b\xc2\u40c2;\u4410r;\uc000\ud835\udd04rave\u803b\xc0\u40c0pha;\u4391acr;\u4100d;\u6a53\u0100gp\x9d\xa1on;\u4104f;\uc000\ud835\udd38plyFunction;\u6061ing\u803b\xc5\u40c5\u0100cs\xbe\xc3r;\uc000\ud835\udc9cign;\u6254ilde\u803b\xc3\u40c3ml\u803b\xc4\u40c4\u0400aceforsu\xe5\xfb\xfe\u0117\u011c\u0122\u0127\u012a\u0100cr\xea\xf2kslash;\u6216\u0176\xf6\xf8;\u6ae7ed;\u6306y;\u4411\u0180crt\u0105\u010b\u0114ause;\u6235noullis;\u612ca;\u4392r;\uc000\ud835\udd05pf;\uc000\ud835\udd39eve;\u42d8c\xf2\u0113mpeq;\u624e\u0700HOacdefhilorsu\u014d\u0151\u0156\u0180\u019e\u01a2\u01b5\u01b7\u01ba\u01dc\u0215\u0273\u0278\u027ecy;\u4427PY\u803b\xa9\u40a9\u0180cpy\u015d\u0162\u017aute;\u4106\u0100;i\u0167\u0168\u62d2talDifferentialD;\u6145leys;\u612d\u0200aeio\u0189\u018e\u0194\u0198ron;\u410cdil\u803b\xc7\u40c7rc;\u4108nint;\u6230ot;\u410a\u0100dn\u01a7\u01adilla;\u40b8terDot;\u40b7\xf2\u017fi;\u43a7rcle\u0200DMPT\u01c7\u01cb\u01d1\u01d6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01e2\u01f8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020foubleQuote;\u601duote;\u6019\u0200lnpu\u021e\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6a74\u0180git\u022f\u0236\u023aruent;\u6261nt;\u622fourIntegral;\u622e\u0100fr\u024c\u024e;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6a2fcr;\uc000\ud835\udc9ep\u0100;C\u0284\u0285\u62d3ap;\u624d\u0580DJSZacefios\u02a0\u02ac\u02b0\u02b4\u02b8\u02cb\u02d7\u02e1\u02e6\u0333\u048d\u0100;o\u0179\u02a5trahd;\u6911cy;\u4402cy;\u4405cy;\u440f\u0180grs\u02bf\u02c4\u02c7ger;\u6021r;\u61a1hv;\u6ae4\u0100ay\u02d0\u02d5ron;\u410e;\u4414l\u0100;t\u02dd\u02de\u6207a;\u4394r;\uc000\ud835\udd07\u0100af\u02eb\u0327\u0100cm\u02f0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031ccute;\u40b4o\u0174\u030b\u030d;\u42d9bleAcute;\u42ddrave;\u4060ilde;\u42dcond;\u62c4ferentialD;\u6146\u0470\u033d\0\0\0\u0342\u0354\0\u0405f;\uc000\ud835\udd3b\u0180;DE\u0348\u0349\u034d\u40a8ot;\u60dcqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03cf\u03e2\u03f8ontourIntegra\xec\u0239o\u0274\u0379\0\0\u037b\xbb\u0349nArrow;\u61d3\u0100eo\u0387\u03a4ft\u0180ART\u0390\u0396\u03a1rrow;\u61d0ightArrow;\u61d4e\xe5\u02cang\u0100LR\u03ab\u03c4eft\u0100AR\u03b3\u03b9rrow;\u67f8ightArrow;\u67faightArrow;\u67f9ight\u0100AT\u03d8\u03derrow;\u61d2ee;\u62a8p\u0241\u03e9\0\0\u03efrrow;\u61d1ownArrow;\u61d5erticalBar;\u6225n\u0300ABLRTa\u0412\u042a\u0430\u045e\u047f\u037crrow\u0180;BU\u041d\u041e\u0422\u6193ar;\u6913pArrow;\u61f5reve;\u4311eft\u02d2\u043a\0\u0446\0\u0450ightVector;\u6950eeVector;\u695eector\u0100;B\u0459\u045a\u61bdar;\u6956ight\u01d4\u0467\0\u0471eeVector;\u695fector\u0100;B\u047a\u047b\u61c1ar;\u6957ee\u0100;A\u0486\u0487\u62a4rrow;\u61a7\u0100ct\u0492\u0497r;\uc000\ud835\udc9frok;\u4110\u0800NTacdfglmopqstux\u04bd\u04c0\u04c4\u04cb\u04de\u04e2\u04e7\u04ee\u04f5\u0521\u052f\u0536\u0552\u055d\u0560\u0565G;\u414aH\u803b\xd0\u40d0cute\u803b\xc9\u40c9\u0180aiy\u04d2\u04d7\u04dcron;\u411arc\u803b\xca\u40ca;\u442dot;\u4116r;\uc000\ud835\udd08rave\u803b\xc8\u40c8ement;\u6208\u0100ap\u04fa\u04fecr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65fberySmallSquare;\u65ab\u0100gp\u0526\u052aon;\u4118f;\uc000\ud835\udd3csilon;\u4395u\u0100ai\u053c\u0549l\u0100;T\u0542\u0543\u6a75ilde;\u6242librium;\u61cc\u0100ci\u0557\u055ar;\u6130m;\u6a73a;\u4397ml\u803b\xcb\u40cb\u0100ip\u056a\u056fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058d\u05b2\u05ccy;\u4424r;\uc000\ud835\udd09lled\u0253\u0597\0\0\u05a3mallSquare;\u65fcerySmallSquare;\u65aa\u0370\u05ba\0\u05bf\0\0\u05c4f;\uc000\ud835\udd3dAll;\u6200riertrf;\u6131c\xf2\u05cb\u0600JTabcdfgorst\u05e8\u05ec\u05ef\u05fa\u0600\u0612\u0616\u061b\u061d\u0623\u066c\u0672cy;\u4403\u803b>\u403emma\u0100;d\u05f7\u05f8\u4393;\u43dcreve;\u411e\u0180eiy\u0607\u060c\u0610dil;\u4122rc;\u411c;\u4413ot;\u4120r;\uc000\ud835\udd0a;\u62d9pf;\uc000\ud835\udd3eeater\u0300EFGLST\u0635\u0644\u064e\u0656\u065b\u0666qual\u0100;L\u063e\u063f\u6265ess;\u62dbullEqual;\u6267reater;\u6aa2ess;\u6277lantEqual;\u6a7eilde;\u6273cr;\uc000\ud835\udca2;\u626b\u0400Aacfiosu\u0685\u068b\u0696\u069b\u069e\u06aa\u06be\u06caRDcy;\u442a\u0100ct\u0690\u0694ek;\u42c7;\u405eirc;\u4124r;\u610clbertSpace;\u610b\u01f0\u06af\0\u06b2f;\u610dizontalLine;\u6500\u0100ct\u06c3\u06c5\xf2\u06a9rok;\u4126mp\u0144\u06d0\u06d8ownHum\xf0\u012fqual;\u624f\u0700EJOacdfgmnostu\u06fa\u06fe\u0703\u0707\u070e\u071a\u071e\u0721\u0728\u0744\u0778\u078b\u078f\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803b\xcd\u40cd\u0100iy\u0713\u0718rc\u803b\xce\u40ce;\u4418ot;\u4130r;\u6111rave\u803b\xcc\uLine truncated
.split("")
.map((c) => c.charCodeAt(0)));
//# sourceMappingURL=decode-data-html.js.map
@@ -0,0 +1,28 @@
import { OB11EmitEventContent, OB11NetworkReloadType } from './index';
import { HttpServerConfig } from '../config/config';
import { IOB11NetworkAdapter } from '../network/adapter';
export declare class OB11HttpServerAdapter extends IOB11NetworkAdapter<HttpServerConfig> {
private app;
private server;
private wsServer?;
private wsClients;
private wsClientsMutex;
private heartbeatIntervalId;
private wsClientWithEvent;
get isActive(): boolean;
onEvent<T extends OB11EmitEventContent>(event: T): Promise<void>;
open(): void;
close(): Promise<void>;
private initializeServer;
private authorize;
createWSServer(newServer: any): void;
connectEvent(core: any, wsClient: any): void;
private startHeartbeat;
private stopHeartbeat;
private authorizeWS;
private checkStateAndReply;
private handleWSMessage;
httpApiRequest(req: any, res: any, request_sse?: boolean): Promise<express.Response<any, Record<string, any>>>;
handleRequest(req: any, res: any): Promise<void>;
reload(newConfig: HttpServerConfig): Promise<OB11NetworkReloadType.Normal | OB11NetworkReloadType.NetWorkReload | OB11NetworkReloadType.NetWorkClose | OB11NetworkReloadType.NetWorkOpen>;
}
@@ -0,0 +1,18 @@
This software is released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAIH,2DAA+C;AAG/C,IAAI,YAAiB,CAAC;AACtB,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC,eAAe,CAAC;CAC7D;KAAM;IACL,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,YAAY,CAAC;CACvD;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,KAAK,CAAC,IAAa,EAAE,IAAwB,EAAE,GAA8C;IAC3G,OAAO,IAAI,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;AAC3C,CAAC;AAFD,sBAEC;AAED,kBAAkB;AAClB,SAAgB,IAAI,CAAC,IAAa,EAAE,IAAwB,EAAE,GAA8C;IAC1G,OAAO,IAAI,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;AAC3C,CAAC;AAFD,oBAEC;AAED,kBAAkB;AAClB,SAAgB,cAAc,CAAC,IAAa,EAAE,IAAwB,EAAE,GAA8C;IACpH,OAAO,IAAI,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;AAC3C,CAAC;AAFD,wCAEC;AAED,SAAgB,IAAI,CAAC,OAAwB;IAC3C,OAAO,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC;AAFD,oBAEC;AAED;;;GAGG;AACU,QAAA,MAAM,GAAG,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,4BAAO,IAAI,2BAA2B,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,159 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// node_modules/.pnpm/tsup@8.5.0_jiti@2.5.1_postcss@8.4.40_typescript@5.9.3_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
// src/rules/predicates.ts
var commaFilter = { filter: (token) => token.value === "," };
var includeCommentsFilter = { includeComments: true };
function isUsedInJSDoc(identifierName, sourceCode) {
const comments = sourceCode.getAllComments();
const jsdocPattern = new RegExp(
// {@link Name} or @see Name
`(?:@(?:link|linkcode|linkplain|see)\\s+${identifierName}\\b)|(?:\\{@(?:link|linkcode|linkplain)\\s+${identifierName}\\b\\})|(?:[@{](?:type|typedef|param|returns?|template|augments|extends|implements)\\s+[^}]*\\b${identifierName}\\b)`
);
return comments.some((comment) => {
if (comment.type !== "Block") {
return false;
}
return jsdocPattern.test(comment.value);
});
}
function makePredicate(isImport, addFixer) {
return (problem, context) => {
const sourceCode = context.sourceCode || context.getSourceCode();
const node = _nullishCoalesce(problem.node, () => ( // typescript-eslint >= 7.8 sets a range instead of a node
sourceCode.getNodeByRangeIndex(sourceCode.getIndexFromLoc(problem.loc.start))));
const { parent } = node;
if (parent && /^Import(|Default|Namespace)Specifier$/.test(parent.type) && isImport) {
const identifierName = node.name;
if (identifierName && isUsedInJSDoc(identifierName, sourceCode)) {
return false;
}
}
return parent ? /^Import(|Default|Namespace)Specifier$/.test(parent.type) == isImport ? Object.assign(problem, _optionalChain([addFixer, 'optionalCall', _2 => _2(parent, sourceCode)])) : false : isImport ? false : problem;
};
}
var unusedVarsPredicate = makePredicate(false);
var unusedImportsPredicate = makePredicate(true, (parent, sourceCode) => ({
fix(fixer) {
const grandParent = parent.parent;
if (!grandParent) {
return null;
}
if (grandParent.specifiers.length === 1) {
const nextToken = sourceCode.getTokenAfter(grandParent, includeCommentsFilter);
const newLinesBetween = nextToken ? nextToken.loc.start.line - grandParent.loc.start.line : 0;
const endOfReplaceRange = nextToken ? nextToken.range[0] : grandParent.range[1];
const count = Math.max(0, newLinesBetween - 1);
return [
fixer.remove(grandParent),
fixer.replaceTextRange(
[grandParent.range[1], endOfReplaceRange],
"\n".repeat(count)
)
];
}
if (parent !== grandParent.specifiers[grandParent.specifiers.length - 1]) {
const comma = sourceCode.getTokenAfter(parent, commaFilter);
const prevNode = sourceCode.getTokenBefore(parent);
return [
fixer.removeRange([prevNode.range[1], parent.range[0]]),
fixer.remove(parent),
fixer.remove(comma)
];
}
if (grandParent.specifiers.filter((specifier) => specifier.type === "ImportSpecifier").length === 1) {
const start = sourceCode.getTokenBefore(parent, commaFilter);
const end = sourceCode.getTokenAfter(parent, {
filter: (token) => token.value === "}"
});
return fixer.removeRange([start.range[0], end.range[1]]);
}
return fixer.removeRange([
sourceCode.getTokenBefore(parent, commaFilter).range[0],
parent.range[1]
]);
}
}));
function createRuleWithPredicate(name, baseRule, predicate) {
return {
...baseRule,
meta: {
...baseRule.meta,
fixable: "code",
docs: {
..._optionalChain([baseRule, 'access', _3 => _3.meta, 'optionalAccess', _4 => _4.docs]),
url: `https://github.com/sweepline/eslint-plugin-unused-imports/blob/master/docs/rules/${name}.md`
}
},
create(context) {
return baseRule.create(
Object.create(context, {
report: {
enumerable: true,
value(problem) {
const result = predicate(problem, context);
if (result) {
context.report(result);
}
}
}
})
);
}
};
}
// src/rules/load-rule.ts
var _module = require('module');
var rule;
var require2 = _module.createRequire.call(void 0, importMetaUrl);
function getBaseRule() {
if (!rule) {
rule = _nullishCoalesce(_nullishCoalesce(getRuleFromTSLintPlugin(), () => ( getRuleFromTSLint())), () => ( getESLintBaseRule()));
}
return rule;
}
function getRuleFromTSLintPlugin() {
try {
const tslintPlugin = require2("@typescript-eslint/eslint-plugin");
return tslintPlugin.rules["no-unused-vars"];
} catch (_) {
return null;
}
}
function getRuleFromTSLint() {
try {
const tslint = require2("typescript-eslint");
return tslint.plugin.rules["no-unused-vars"];
} catch (_) {
return null;
}
}
function getESLintBaseRule() {
const eslint = require2("eslint");
return new eslint.Linter({ configType: "eslintrc" }).getRules().get("no-unused-vars");
}
// src/rules/no-unused-vars.ts
var no_unused_vars_default = createRuleWithPredicate("no-unused-vars", getBaseRule(), unusedVarsPredicate);
// src/rules/no-unused-imports.ts
var no_unused_imports_default = createRuleWithPredicate("no-unused-imports", getBaseRule(), unusedImportsPredicate);
// src/index.ts
var plugin = {
meta: {
name: "unused-imports"
},
rules: {
"no-unused-vars": no_unused_vars_default,
"no-unused-imports": no_unused_imports_default
}
};
var index_default = plugin;
exports.default = index_default;
module.exports = exports.default;
@@ -0,0 +1,468 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'unified-signatures',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow two overloads that could be unified into one with a union or an optional/rest parameter',
// too opinionated to be recommended
recommended: 'strict',
},
messages: {
omittingRestParameter: '{{failureStringStart}} with a rest parameter.',
omittingSingleParameter: '{{failureStringStart}} with an optional parameter.',
singleParameterDifference: '{{failureStringStart}} taking `{{type1}} | {{type2}}`.',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
ignoreDifferentlyNamedParameters: {
type: 'boolean',
description: 'Whether two parameters with different names at the same index should be considered different even if their types are the same.',
},
ignoreOverloadsWithDifferentJSDoc: {
type: 'boolean',
description: 'Whether two overloads with different JSDoc comments should be considered different even if their parameter and return types are the same.',
},
},
},
],
},
defaultOptions: [
{
ignoreDifferentlyNamedParameters: false,
ignoreOverloadsWithDifferentJSDoc: false,
},
],
create(context, [{ ignoreDifferentlyNamedParameters, ignoreOverloadsWithDifferentJSDoc }]) {
//----------------------------------------------------------------------
// Helpers
//----------------------------------------------------------------------
function failureStringStart(otherLine) {
// For only 2 overloads we don't need to specify which is the other one.
const overloads = otherLine == null
? 'These overloads'
: `This overload and the one on line ${otherLine}`;
return `${overloads} can be combined into one signature`;
}
function addFailures(failures) {
for (const failure of failures) {
const { only2, unify } = failure;
switch (unify.kind) {
case 'single-parameter-difference': {
const { p0, p1 } = unify;
const lineOfOtherOverload = only2 ? undefined : p0.loc.start.line;
const typeAnnotation0 = isTSParameterProperty(p0)
? p0.parameter.typeAnnotation
: p0.typeAnnotation;
const typeAnnotation1 = isTSParameterProperty(p1)
? p1.parameter.typeAnnotation
: p1.typeAnnotation;
context.report({
loc: p1.loc,
node: p1,
messageId: 'singleParameterDifference',
data: {
failureStringStart: failureStringStart(lineOfOtherOverload),
type1: context.sourceCode.getText(typeAnnotation0?.typeAnnotation),
type2: context.sourceCode.getText(typeAnnotation1?.typeAnnotation),
},
});
break;
}
case 'extra-parameter': {
const { extraParameter, otherSignature } = unify;
const lineOfOtherOverload = only2
? undefined
: otherSignature.loc.start.line;
context.report({
loc: extraParameter.loc,
node: extraParameter,
messageId: extraParameter.type === utils_1.AST_NODE_TYPES.RestElement
? 'omittingRestParameter'
: 'omittingSingleParameter',
data: {
failureStringStart: failureStringStart(lineOfOtherOverload),
},
});
}
}
}
}
function checkOverloads(signatures, typeParameters) {
const result = [];
const isTypeParameter = getIsTypeParameter(typeParameters);
for (const overloads of signatures) {
forEachPair(overloads, (a, b) => {
const signature0 = a.value ?? a;
const signature1 = b.value ?? b;
const unify = compareSignatures(signature0, signature1, isTypeParameter);
if (unify != null) {
result.push({ only2: overloads.length === 2, unify });
}
});
}
return result;
}
function compareSignatures(a, b, isTypeParameter) {
if (!signaturesCanBeUnified(a, b, isTypeParameter)) {
return undefined;
}
return a.params.length === b.params.length
? signaturesDifferBySingleParameter(a.params, b.params)
: signaturesDifferByOptionalOrRestParameter(a, b);
}
function signaturesCanBeUnified(a, b, isTypeParameter) {
// Must return the same type.
const aTypeParams = a.typeParameters != null ? a.typeParameters.params : undefined;
const bTypeParams = b.typeParameters != null ? b.typeParameters.params : undefined;
if (ignoreDifferentlyNamedParameters) {
const commonParamsLength = Math.min(a.params.length, b.params.length);
for (let i = 0; i < commonParamsLength; i += 1) {
if (a.params[i].type === b.params[i].type &&
getStaticParameterName(a.params[i]) !==
getStaticParameterName(b.params[i])) {
return false;
}
}
}
if (ignoreOverloadsWithDifferentJSDoc) {
const aComment = getBlockCommentForNode(getCommentTargetNode(a));
const bComment = getBlockCommentForNode(getCommentTargetNode(b));
if (aComment?.value !== bComment?.value) {
return false;
}
}
return (typesAreEqual(a.returnType, b.returnType) &&
// Must take the same type parameters.
// If one uses a type parameter (from outside) and the other doesn't, they shouldn't be joined.
(0, util_1.arraysAreEqual)(aTypeParams, bTypeParams, typeParametersAreEqual) &&
signatureUsesTypeParameter(a, isTypeParameter) ===
signatureUsesTypeParameter(b, isTypeParameter));
}
/** Detect `a(x: number, y: number, z: number)` and `a(x: number, y: string, z: number)`. */
function signaturesDifferBySingleParameter(types1, types2) {
const firstParam1 = types1[0];
const firstParam2 = types2[0];
// exempt signatures with `this: void` from the rule
if (isThisVoidParam(firstParam1) || isThisVoidParam(firstParam2)) {
return undefined;
}
const index = getIndexOfFirstDifference(types1, types2, parametersAreEqual);
if (index == null) {
return undefined;
}
// If remaining arrays are equal, the signatures differ by just one parameter type
if (!(0, util_1.arraysAreEqual)(types1.slice(index + 1), types2.slice(index + 1), parametersAreEqual)) {
return undefined;
}
const a = types1[index];
const b = types2[index];
// Can unify `a?: string` and `b?: number`. Can't unify `...args: string[]` and `...args: number[]`.
// See https://github.com/Microsoft/TypeScript/issues/5077
return parametersHaveEqualSigils(a, b) &&
a.type !== utils_1.AST_NODE_TYPES.RestElement
? { kind: 'single-parameter-difference', p0: a, p1: b }
: undefined;
}
function isThisParam(param) {
return (param != null &&
param.type === utils_1.AST_NODE_TYPES.Identifier &&
param.name === 'this');
}
function isThisVoidParam(param) {
return (isThisParam(param) &&
param.typeAnnotation?.typeAnnotation.type ===
utils_1.AST_NODE_TYPES.TSVoidKeyword);
}
/**
* Detect `a(): void` and `a(x: number): void`.
* Returns the parameter declaration (`x: number` in this example) that should be optional/rest, and overload it's a part of.
*/
function signaturesDifferByOptionalOrRestParameter(a, b) {
const sig1 = a.params;
const sig2 = b.params;
const minLength = Math.min(sig1.length, sig2.length);
const longer = sig1.length < sig2.length ? sig2 : sig1;
const shorter = sig1.length < sig2.length ? sig1 : sig2;
const shorterSig = sig1.length < sig2.length ? a : b;
const firstParam1 = sig1.at(0);
const firstParam2 = sig2.at(0);
// If one signature has explicit this type and another doesn't, they can't
// be unified.
if (isThisParam(firstParam1) !== isThisParam(firstParam2)) {
return undefined;
}
// exempt signatures with `this: void` from the rule
if (isThisVoidParam(firstParam1) || isThisVoidParam(firstParam2)) {
return undefined;
}
// If one is has 2+ parameters more than the other, they must all be optional/rest.
// Differ by optional parameters: f() and f(x), f() and f(x, ?y, ...z)
// Not allowed: f() and f(x, y)
for (let i = minLength + 1; i < longer.length; i++) {
if (!parameterMayBeMissing(longer[i])) {
return undefined;
}
}
for (let i = 0; i < minLength; i++) {
const sig1i = sig1[i];
const sig2i = sig2[i];
const typeAnnotation1 = isTSParameterProperty(sig1i)
? sig1i.parameter.typeAnnotation
: sig1i.typeAnnotation;
const typeAnnotation2 = isTSParameterProperty(sig2i)
? sig2i.parameter.typeAnnotation
: sig2i.typeAnnotation;
if (!typesAreEqual(typeAnnotation1, typeAnnotation2)) {
return undefined;
}
}
if (minLength > 0 &&
shorter[minLength - 1].type === utils_1.AST_NODE_TYPES.RestElement) {
return undefined;
}
return {
extraParameter: longer[longer.length - 1],
kind: 'extra-parameter',
otherSignature: shorterSig,
};
}
/** Given type parameters, returns a function to test whether a type is one of those parameters. */
function getIsTypeParameter(typeParameters) {
if (typeParameters == null) {
return (() => false);
}
const set = new Set();
for (const t of typeParameters.params) {
set.add(t.name.name);
}
return (typeName => set.has(typeName));
}
/** True if any of the outer type parameters are used in a signature. */
function signatureUsesTypeParameter(sig, isTypeParameter) {
return sig.params.some((p) => typeContainsTypeParameter(isTSParameterProperty(p)
? p.parameter.typeAnnotation
: p.typeAnnotation));
function typeContainsTypeParameter(type) {
if (!type) {
return false;
}
if (type.type === utils_1.AST_NODE_TYPES.TSTypeReference) {
const typeName = type.typeName;
if (isIdentifier(typeName) && isTypeParameter(typeName.name)) {
return true;
}
}
return typeContainsTypeParameter(type.typeAnnotation ??
type.elementType);
}
}
function isTSParameterProperty(node) {
return node.type === utils_1.AST_NODE_TYPES.TSParameterProperty;
}
function parametersAreEqual(a, b) {
const typeAnnotationA = isTSParameterProperty(a)
? a.parameter.typeAnnotation
: a.typeAnnotation;
const typeAnnotationB = isTSParameterProperty(b)
? b.parameter.typeAnnotation
: b.typeAnnotation;
return (parametersHaveEqualSigils(a, b) &&
typesAreEqual(typeAnnotationA, typeAnnotationB));
}
/** True for optional/rest parameters. */
function parameterMayBeMissing(p) {
const optional = isTSParameterProperty(p)
? p.parameter.optional
: p.optional;
return p.type === utils_1.AST_NODE_TYPES.RestElement || optional;
}
/** False if one is optional and the other isn't, or one is a rest parameter and the other isn't. */
function parametersHaveEqualSigils(a, b) {
const optionalA = isTSParameterProperty(a)
? a.parameter.optional
: a.optional;
const optionalB = isTSParameterProperty(b)
? b.parameter.optional
: b.optional;
return ((a.type === utils_1.AST_NODE_TYPES.RestElement) ===
(b.type === utils_1.AST_NODE_TYPES.RestElement) && optionalA === optionalB);
}
function typeParametersAreEqual(a, b) {
return (a.name.name === b.name.name &&
constraintsAreEqual(a.constraint, b.constraint));
}
function typesAreEqual(a, b) {
return (a === b ||
(a != null &&
b != null &&
context.sourceCode.getText(a.typeAnnotation) ===
context.sourceCode.getText(b.typeAnnotation)));
}
function constraintsAreEqual(a, b) {
return a === b || (a != null && b != null && a.type === b.type);
}
/* Returns the first index where `a` and `b` differ. */
function getIndexOfFirstDifference(a, b, equal) {
for (let i = 0; i < a.length && i < b.length; i++) {
if (!equal(a[i], b[i])) {
return i;
}
}
return undefined;
}
/** Calls `action` for every pair of values in `values`. */
function forEachPair(values, action) {
for (let i = 0; i < values.length; i++) {
for (let j = i + 1; j < values.length; j++) {
action(values[i], values[j]);
}
}
}
const scopes = [];
let currentScope = {
overloads: new Map(),
};
function createScope(parent, typeParameters) {
if (currentScope) {
scopes.push(currentScope);
}
currentScope = {
overloads: new Map(),
parent,
typeParameters,
};
}
function checkScope() {
const scope = (0, util_1.nullThrows)(currentScope, 'checkScope() called without a current scope');
const failures = checkOverloads([...scope.overloads.values()], scope.typeParameters);
addFailures(failures);
currentScope = scopes.pop();
}
/**
* @returns the first valid JSDoc comment annotating `node`
*/
function getBlockCommentForNode(node) {
return context.sourceCode
.getCommentsBefore(node)
.reverse()
.find(comment => comment.type === utils_1.AST_TOKEN_TYPES.Block);
}
function addOverload(signature, key, containingNode) {
key ??= getOverloadKey(signature);
if (currentScope &&
(containingNode ?? signature).parent === currentScope.parent) {
const overloads = currentScope.overloads.get(key);
if (overloads != null) {
overloads.push(signature);
}
else {
currentScope.overloads.set(key, [signature]);
}
}
}
//----------------------------------------------------------------------
// Public
//----------------------------------------------------------------------
return {
ClassDeclaration(node) {
createScope(node.body, node.typeParameters);
},
Program: createScope,
TSInterfaceDeclaration(node) {
createScope(node.body, node.typeParameters);
},
TSModuleBlock: createScope,
TSTypeLiteral: createScope,
// collect overloads
MethodDefinition(node) {
if (!node.value.body && !isGetterOrSetter(node)) {
addOverload(node);
}
},
TSAbstractMethodDefinition(node) {
if (!node.value.body && !isGetterOrSetter(node)) {
addOverload(node);
}
},
TSCallSignatureDeclaration: addOverload,
TSConstructSignatureDeclaration: addOverload,
TSDeclareFunction(node) {
const exportingNode = getExportingNode(node);
addOverload(node, node.id?.name ?? exportingNode?.type, exportingNode);
},
TSMethodSignature(node) {
if (!isGetterOrSetter(node)) {
addOverload(node);
}
},
// validate scopes
'ClassDeclaration:exit': checkScope,
'Program:exit': checkScope,
'TSInterfaceDeclaration:exit': checkScope,
'TSModuleBlock:exit': checkScope,
'TSTypeLiteral:exit': checkScope,
};
},
});
function getCommentTargetNode(node) {
if (node.type === utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) {
return node.parent;
}
return getExportingNode(node) ?? node;
}
function getExportingNode(node) {
return node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration ||
node.parent.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration
? node.parent
: undefined;
}
function getOverloadKey(node) {
const info = getOverloadInfo(node);
return ((node.computed ? '0' : '1') +
(node.static ? '0' : '1') +
info);
}
function getOverloadInfo(node) {
switch (node.type) {
case utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration:
return 'constructor';
case utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration:
return '()';
default: {
const { key } = node;
if (isPrivateIdentifier(key)) {
return `private_identifier_${key.name}`;
}
if (isIdentifier(key)) {
return `identifier_${key.name}`;
}
return key.raw;
}
}
}
function getStaticParameterName(param) {
switch (param.type) {
case utils_1.AST_NODE_TYPES.Identifier:
return param.name;
case utils_1.AST_NODE_TYPES.RestElement:
return getStaticParameterName(param.argument);
default:
return undefined;
}
}
function isIdentifier(node) {
return node.type === utils_1.AST_NODE_TYPES.Identifier;
}
function isPrivateIdentifier(node) {
return node.type === utils_1.AST_NODE_TYPES.PrivateIdentifier;
}
function isGetterOrSetter(node) {
return node.kind === 'get' || node.kind === 'set';
}
@@ -0,0 +1,78 @@
import type { Action, Dispatch } from 'redux'
import verifyPlainObject from '../utils/verifyPlainObject'
import { createInvalidArgFactory } from './invalidArgFactory'
import type { MergeProps } from './selectorFactory'
import type { EqualityFn } from '../types'
function defaultMergeProps<
TStateProps,
TDispatchProps,
TOwnProps,
TMergedProps,
>(
stateProps: TStateProps,
dispatchProps: TDispatchProps,
ownProps: TOwnProps,
): TMergedProps {
// @ts-ignore
return { ...ownProps, ...stateProps, ...dispatchProps }
}
function wrapMergePropsFunc<
TStateProps,
TDispatchProps,
TOwnProps,
TMergedProps,
>(
mergeProps: MergeProps<TStateProps, TDispatchProps, TOwnProps, TMergedProps>,
): (
dispatch: Dispatch<Action<string>>,
options: {
readonly displayName: string
readonly areMergedPropsEqual: EqualityFn<TMergedProps>
},
) => MergeProps<TStateProps, TDispatchProps, TOwnProps, TMergedProps> {
return function initMergePropsProxy(
dispatch,
{ displayName, areMergedPropsEqual },
) {
let hasRunOnce = false
let mergedProps: TMergedProps
return function mergePropsProxy(
stateProps: TStateProps,
dispatchProps: TDispatchProps,
ownProps: TOwnProps,
) {
const nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps)
if (hasRunOnce) {
if (!areMergedPropsEqual(nextMergedProps, mergedProps))
mergedProps = nextMergedProps
} else {
hasRunOnce = true
mergedProps = nextMergedProps
if (process.env.NODE_ENV !== 'production')
verifyPlainObject(mergedProps, displayName, 'mergeProps')
}
return mergedProps
}
}
}
export function mergePropsFactory<
TStateProps,
TDispatchProps,
TOwnProps,
TMergedProps,
>(
mergeProps?: MergeProps<TStateProps, TDispatchProps, TOwnProps, TMergedProps>,
) {
return !mergeProps
? () => defaultMergeProps
: typeof mergeProps === 'function'
? wrapMergePropsFunc(mergeProps)
: createInvalidArgFactory(mergeProps, 'mergeProps')
}
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,YAAM,CAAC;AACvC","sources":["packages/@react-aria/overlays/intl/fi-FI.json"],"sourcesContent":["{\n \"dismiss\": \"Hylkää\"\n}\n"],"names":[],"version":3,"file":"fi-FI.main.js.map"}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"A B","2":"K D E wC","132":"F"},B:{"1":"0 1 2 3 4 5 C L M G N O P Q H R S T U V W X Y Z 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"6 7 8 9 xC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB 0C 1C"},D:{"1":"0 1 2 3 4 5 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB"},E:{"1":"D E F A B C L M G 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","2":"J ZB K 2C ZC 3C 4C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z 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 HD ID NC uC JD OC","2":"F G N O P FD GD"},G:{"1":"E ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","2":"ZC KD vC LD MD"},H:{"1":"hD"},I:{"1":"I mD nD","2":"TC J iD jD kD lD vC"},J:{"1":"A","2":"D"},K:{"1":"B C H NC uC OC","2":"A"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"2D","2":"1D"}},B:4,C:"CSS background-repeat round and space",D:true};
@@ -0,0 +1,782 @@
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*/
"use strict"
const { CALL, CONSTRUCT, READ, ReferenceTracker } = require("eslint-utils")
const enumeratePropertyNames = require("../util/enumerate-property-names")
const getConfiguredNodeVersion = require("../util/get-configured-node-version")
const getSemverRange = require("../util/get-semver-range")
const modules = {
_linklist: {
[READ]: { since: "5.0.0", replacedBy: null },
},
//eslint-disable-next-line camelcase
_stream_wrap: {
[READ]: { since: "12.0.0", replacedBy: null },
},
//eslint-disable-next-line camelcase
async_hooks: {
currentId: {
[READ]: {
since: "8.2.0",
replacedBy: [
{
name: "'async_hooks.executionAsyncId()'",
supported: "8.1.0",
},
],
},
},
triggerId: {
[READ]: {
since: "8.2.0",
replacedBy: "'async_hooks.triggerAsyncId()'",
},
},
},
buffer: {
Buffer: {
[CONSTRUCT]: {
since: "6.0.0",
replacedBy: [
{ name: "'buffer.Buffer.alloc()'", supported: "5.10.0" },
{ name: "'buffer.Buffer.from()'", supported: "5.10.0" },
],
},
[CALL]: {
since: "6.0.0",
replacedBy: [
{ name: "'buffer.Buffer.alloc()'", supported: "5.10.0" },
{ name: "'buffer.Buffer.from()'", supported: "5.10.0" },
],
},
},
SlowBuffer: {
[READ]: {
since: "6.0.0",
replacedBy: [
{
name: "'buffer.Buffer.allocUnsafeSlow()'",
supported: "5.12.0",
},
],
},
},
},
constants: {
[READ]: {
since: "6.3.0",
replacedBy: "'constants' property of each module",
},
},
crypto: {
_toBuf: {
[READ]: { since: "11.0.0", replacedBy: null },
},
Credentials: {
[READ]: { since: "0.12.0", replacedBy: "'tls.SecureContext'" },
},
DEFAULT_ENCODING: {
[READ]: { since: "10.0.0", replacedBy: null },
},
createCipher: {
[READ]: {
since: "10.0.0",
replacedBy: [
{ name: "'crypto.createCipheriv()'", supported: "0.1.94" },
],
},
},
createCredentials: {
[READ]: {
since: "0.12.0",
replacedBy: [
{
name: "'tls.createSecureContext()'",
supported: "0.11.13",
},
],
},
},
createDecipher: {
[READ]: {
since: "10.0.0",
replacedBy: [
{
name: "'crypto.createDecipheriv()'",
supported: "0.1.94",
},
],
},
},
fips: {
[READ]: {
since: "10.0.0",
replacedBy: [
{
name: "'crypto.getFips()' and 'crypto.setFips()'",
supported: "10.0.0",
},
],
},
},
prng: {
[READ]: {
since: "11.0.0",
replacedBy: [
{ name: "'crypto.randomBytes()'", supported: "0.5.8" },
],
},
},
pseudoRandomBytes: {
[READ]: {
since: "11.0.0",
replacedBy: [
{ name: "'crypto.randomBytes()'", supported: "0.5.8" },
],
},
},
rng: {
[READ]: {
since: "11.0.0",
replacedBy: [
{ name: "'crypto.randomBytes()'", supported: "0.5.8" },
],
},
},
},
domain: {
[READ]: { since: "4.0.0", replacedBy: null },
},
events: {
EventEmitter: {
listenerCount: {
[READ]: {
since: "4.0.0",
replacedBy: [
{
name: "'events.EventEmitter#listenerCount()'",
supported: "3.2.0",
},
],
},
},
},
listenerCount: {
[READ]: {
since: "4.0.0",
replacedBy: [
{
name: "'events.EventEmitter#listenerCount()'",
supported: "3.2.0",
},
],
},
},
},
freelist: {
[READ]: { since: "4.0.0", replacedBy: null },
},
fs: {
SyncWriteStream: {
[READ]: { since: "4.0.0", replacedBy: null },
},
exists: {
[READ]: {
since: "4.0.0",
replacedBy: [
{ name: "'fs.stat()'", supported: "0.0.2" },
{ name: "'fs.access()'", supported: "0.11.15" },
],
},
},
lchmod: {
[READ]: { since: "0.4.0", replacedBy: null },
},
lchmodSync: {
[READ]: { since: "0.4.0", replacedBy: null },
},
},
http: {
createClient: {
[READ]: {
since: "0.10.0",
replacedBy: [{ name: "'http.request()'", supported: "0.3.6" }],
},
},
},
module: {
Module: {
createRequireFromPath: {
[READ]: {
since: "12.2.0",
replacedBy: [
{
name: "'module.createRequire()'",
supported: "12.2.0",
},
],
},
},
requireRepl: {
[READ]: {
since: "6.0.0",
replacedBy: "'require(\"repl\")'",
},
},
_debug: {
[READ]: { since: "9.0.0", replacedBy: null },
},
},
createRequireFromPath: {
[READ]: {
since: "12.2.0",
replacedBy: [
{
name: "'module.createRequire()'",
supported: "12.2.0",
},
],
},
},
requireRepl: {
[READ]: {
since: "6.0.0",
replacedBy: "'require(\"repl\")'",
},
},
_debug: {
[READ]: { since: "9.0.0", replacedBy: null },
},
},
net: {
_setSimultaneousAccepts: {
[READ]: { since: "12.0.0", replacedBy: null },
},
},
os: {
getNetworkInterfaces: {
[READ]: {
since: "0.6.0",
replacedBy: [
{ name: "'os.networkInterfaces()'", supported: "0.6.0" },
],
},
},
tmpDir: {
[READ]: {
since: "7.0.0",
replacedBy: [{ name: "'os.tmpdir()'", supported: "0.9.9" }],
},
},
},
path: {
_makeLong: {
[READ]: {
since: "9.0.0",
replacedBy: [
{ name: "'path.toNamespacedPath()'", supported: "9.0.0" },
],
},
},
},
process: {
EventEmitter: {
[READ]: {
since: "0.6.0",
replacedBy: "'require(\"events\")'",
},
},
assert: {
[READ]: {
since: "10.0.0",
replacedBy: "'require(\"assert\")'",
},
},
binding: {
[READ]: { since: "10.9.0", replacedBy: null },
},
env: {
NODE_REPL_HISTORY_FILE: {
[READ]: {
since: "4.0.0",
replacedBy: "'NODE_REPL_HISTORY'",
},
},
},
report: {
triggerReport: {
[READ]: {
since: "11.12.0",
replacedBy: "'process.report.writeReport()'",
},
},
},
},
punycode: {
[READ]: {
since: "7.0.0",
replacedBy: "'https://www.npmjs.com/package/punycode'",
},
},
readline: {
codePointAt: {
[READ]: { since: "4.0.0", replacedBy: null },
},
getStringWidth: {
[READ]: { since: "6.0.0", replacedBy: null },
},
isFullWidthCodePoint: {
[READ]: { since: "6.0.0", replacedBy: null },
},
stripVTControlCharacters: {
[READ]: { since: "6.0.0", replacedBy: null },
},
},
// safe-buffer.Buffer function/constructror is just a re-export of buffer.Buffer
// and should be deprecated likewise.
"safe-buffer": {
Buffer: {
[CONSTRUCT]: {
since: "6.0.0",
replacedBy: [
{ name: "'buffer.Buffer.alloc()'", supported: "5.10.0" },
{ name: "'buffer.Buffer.from()'", supported: "5.10.0" },
],
},
[CALL]: {
since: "6.0.0",
replacedBy: [
{ name: "'buffer.Buffer.alloc()'", supported: "5.10.0" },
{ name: "'buffer.Buffer.from()'", supported: "5.10.0" },
],
},
},
SlowBuffer: {
[READ]: {
since: "6.0.0",
replacedBy: [
{
name: "'buffer.Buffer.allocUnsafeSlow()'",
supported: "5.12.0",
},
],
},
},
},
sys: {
[READ]: {
since: "0.3.0",
replacedBy: "'util' module",
},
},
timers: {
enroll: {
[READ]: {
since: "10.0.0",
replacedBy: [
{ name: "'setTimeout()'", supported: "0.0.1" },
{ name: "'setInterval()'", supported: "0.0.1" },
],
},
},
unenroll: {
[READ]: {
since: "10.0.0",
replacedBy: [
{ name: "'clearTimeout()'", supported: "0.0.1" },
{ name: "'clearInterval()'", supported: "0.0.1" },
],
},
},
},
tls: {
CleartextStream: {
[READ]: { since: "0.10.0", replacedBy: null },
},
CryptoStream: {
[READ]: {
since: "0.12.0",
replacedBy: [{ name: "'tls.TLSSocket'", supported: "0.11.4" }],
},
},
SecurePair: {
[READ]: {
since: "6.0.0",
replacedBy: [{ name: "'tls.TLSSocket'", supported: "0.11.4" }],
},
},
convertNPNProtocols: {
[READ]: { since: "10.0.0", replacedBy: null },
},
createSecurePair: {
[READ]: {
since: "6.0.0",
replacedBy: [{ name: "'tls.TLSSocket'", supported: "0.11.4" }],
},
},
parseCertString: {
[READ]: {
since: "8.6.0",
replacedBy: [
{ name: "'querystring.parse()'", supported: "0.1.25" },
],
},
},
},
tty: {
setRawMode: {
[READ]: {
since: "0.10.0",
replacedBy:
"'tty.ReadStream#setRawMode()' (e.g. 'process.stdin.setRawMode()')",
},
},
},
url: {
parse: {
[READ]: {
since: "11.0.0",
replacedBy: [
{ name: "'url.URL' constructor", supported: "6.13.0" },
],
},
},
resolve: {
[READ]: {
since: "11.0.0",
replacedBy: [
{ name: "'url.URL' constructor", supported: "6.13.0" },
],
},
},
},
util: {
debug: {
[READ]: {
since: "0.12.0",
replacedBy: [
{ name: "'console.error()'", supported: "0.1.100" },
],
},
},
error: {
[READ]: {
since: "0.12.0",
replacedBy: [
{ name: "'console.error()'", supported: "0.1.100" },
],
},
},
isArray: {
[READ]: {
since: "4.0.0",
replacedBy: [
{ name: "'Array.isArray()'", supported: "0.1.100" },
],
},
},
isBoolean: {
[READ]: { since: "4.0.0", replacedBy: null },
},
isBuffer: {
[READ]: {
since: "4.0.0",
replacedBy: [
{ name: "'Buffer.isBuffer()'", supported: "0.1.101" },
],
},
},
isDate: {
[READ]: { since: "4.0.0", replacedBy: null },
},
isError: {
[READ]: { since: "4.0.0", replacedBy: null },
},
isFunction: {
[READ]: { since: "4.0.0", replacedBy: null },
},
isNull: {
[READ]: { since: "4.0.0", replacedBy: null },
},
isNullOrUndefined: {
[READ]: { since: "4.0.0", replacedBy: null },
},
isNumber: {
[READ]: { since: "4.0.0", replacedBy: null },
},
isObject: {
[READ]: { since: "4.0.0", replacedBy: null },
},
isPrimitive: {
[READ]: { since: "4.0.0", replacedBy: null },
},
isRegExp: {
[READ]: { since: "4.0.0", replacedBy: null },
},
isString: {
[READ]: { since: "4.0.0", replacedBy: null },
},
isSymbol: {
[READ]: { since: "4.0.0", replacedBy: null },
},
isUndefined: {
[READ]: { since: "4.0.0", replacedBy: null },
},
log: {
[READ]: { since: "6.0.0", replacedBy: "a third party module" },
},
print: {
[READ]: {
since: "0.12.0",
replacedBy: [{ name: "'console.log()'", supported: "0.1.100" }],
},
},
pump: {
[READ]: {
since: "0.10.0",
replacedBy: [
{ name: "'stream.Readable#pipe()'", supported: "0.9.4" },
],
},
},
puts: {
[READ]: {
since: "0.12.0",
replacedBy: [{ name: "'console.log()'", supported: "0.1.100" }],
},
},
_extend: {
[READ]: {
since: "6.0.0",
replacedBy: [{ name: "'Object.assign()'", supported: "4.0.0" }],
},
},
},
vm: {
runInDebugContext: {
[READ]: { since: "8.0.0", replacedBy: null },
},
},
}
const globals = {
Buffer: {
[CONSTRUCT]: {
since: "6.0.0",
replacedBy: [
{ name: "'Buffer.alloc()'", supported: "5.10.0" },
{ name: "'Buffer.from()'", supported: "5.10.0" },
],
},
[CALL]: {
since: "6.0.0",
replacedBy: [
{ name: "'Buffer.alloc()'", supported: "5.10.0" },
{ name: "'Buffer.from()'", supported: "5.10.0" },
],
},
},
COUNTER_NET_SERVER_CONNECTION: {
[READ]: { since: "11.0.0", replacedBy: null },
},
COUNTER_NET_SERVER_CONNECTION_CLOSE: {
[READ]: { since: "11.0.0", replacedBy: null },
},
COUNTER_HTTP_SERVER_REQUEST: {
[READ]: { since: "11.0.0", replacedBy: null },
},
COUNTER_HTTP_SERVER_RESPONSE: {
[READ]: { since: "11.0.0", replacedBy: null },
},
COUNTER_HTTP_CLIENT_REQUEST: {
[READ]: { since: "11.0.0", replacedBy: null },
},
COUNTER_HTTP_CLIENT_RESPONSE: {
[READ]: { since: "11.0.0", replacedBy: null },
},
GLOBAL: {
[READ]: {
since: "6.0.0",
replacedBy: [{ name: "'global'", supported: "0.1.27" }],
},
},
Intl: {
v8BreakIterator: {
[READ]: { since: "7.0.0", replacedBy: null },
},
},
require: {
extensions: {
[READ]: {
since: "0.12.0",
replacedBy: "compiling them ahead of time",
},
},
},
root: {
[READ]: {
since: "6.0.0",
replacedBy: [{ name: "'global'", supported: "0.1.27" }],
},
},
process: modules.process,
}
/**
* Makes a replacement message.
*
* @param {string|array|null} replacedBy - The text of substitute way.
* @param {Range} version - The configured version range
* @returns {string} Replacement message.
*/
function toReplaceMessage(replacedBy, version) {
let message = replacedBy
if (Array.isArray(replacedBy)) {
message = replacedBy
.filter(
({ supported }) =>
!version.intersects(getSemverRange(`<${supported}`))
)
.map(({ name }) => name)
.join(" or ")
}
return message ? `. Use ${message} instead` : ""
}
/**
* Convert a given path to name.
* @param {symbol} type The report type.
* @param {string[]} path The property access path.
* @returns {string} The name.
*/
function toName(type, path) {
const baseName = path.join(".")
return type === ReferenceTracker.CALL
? `${baseName}()`
: type === ReferenceTracker.CONSTRUCT
? `new ${baseName}()`
: baseName
}
/**
* Parses the options.
* @param {RuleContext} context The rule context.
* @returns {{version:Range,ignoredGlobalItems:Set<string>,ignoredModuleItems:Set<string>}} Parsed
* value.
*/
function parseOptions(context) {
const raw = context.options[0] || {}
const filePath = context.getFilename()
const version = getConfiguredNodeVersion(raw.version, filePath)
const ignoredModuleItems = new Set(raw.ignoreModuleItems || [])
const ignoredGlobalItems = new Set(raw.ignoreGlobalItems || [])
return Object.freeze({ version, ignoredGlobalItems, ignoredModuleItems })
}
module.exports = {
meta: {
docs: {
description: "disallow deprecated APIs",
category: "Best Practices",
recommended: true,
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-deprecated-api.md",
},
type: "problem",
fixable: null,
schema: [
{
type: "object",
properties: {
version: {
type: "string",
},
ignoreModuleItems: {
type: "array",
items: {
enum: Array.from(enumeratePropertyNames(modules)),
},
additionalItems: false,
uniqueItems: true,
},
ignoreGlobalItems: {
type: "array",
items: {
enum: Array.from(enumeratePropertyNames(globals)),
},
additionalItems: false,
uniqueItems: true,
},
// Deprecated since v4.2.0
ignoreIndirectDependencies: { type: "boolean" },
},
additionalProperties: false,
},
],
},
create(context) {
const {
ignoredModuleItems,
ignoredGlobalItems,
version,
} = parseOptions(context)
/**
* Reports a use of a deprecated API.
*
* @param {ASTNode} node - A node to report.
* @param {string} name - The name of a deprecated API.
* @param {{since: number, replacedBy: string}} info - Information of the API.
* @returns {void}
*/
function reportItem(node, name, info) {
context.report({
node,
loc: node.loc,
message:
"{{name}} was deprecated since v{{version}}{{replace}}.",
data: {
name,
version: info.since,
replace: toReplaceMessage(info.replacedBy, version),
},
})
}
return {
"Program:exit"() {
const tracker = new ReferenceTracker(context.getScope(), {
mode: "legacy",
})
for (const report of tracker.iterateGlobalReferences(globals)) {
const { node, path, type, info } = report
const name = toName(type, path)
if (!ignoredGlobalItems.has(name)) {
reportItem(node, `'${name}'`, info)
}
}
for (const report of [
...tracker.iterateCjsReferences(modules),
...tracker.iterateEsmReferences(modules),
]) {
const { node, path, type, info } = report
const name = toName(type, path)
const suffix = path.length === 1 ? " module" : ""
if (!ignoredModuleItems.has(name)) {
reportItem(node, `'${name}'${suffix}`, info)
}
}
},
}
},
}
@@ -0,0 +1,53 @@
/**
* @fileoverview Rule to flag octal escape sequences in string literals.
* @author Ian Christian Myers
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow octal escape sequences in string literals",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-octal-escape",
},
schema: [],
messages: {
octalEscapeSequence:
"Don't use octal: '\\{{sequence}}'. Use '\\u....' instead.",
},
},
create(context) {
return {
Literal(node) {
if (typeof node.value !== "string") {
return;
}
// \0 represents a valid NULL character if it isn't followed by a digit.
const match = node.raw.match(
/^(?:[^\\]|\\.)*?\\([0-3][0-7]{1,2}|[4-7][0-7]|0(?=[89])|[1-7])/su,
);
if (match) {
context.report({
node,
messageId: "octalEscapeSequence",
data: { sequence: match[1] },
});
}
},
};
},
};
@@ -0,0 +1,128 @@
const Minipass = require('minipass')
const EE = require('events')
const isStream = s => s && s instanceof EE && (
typeof s.pipe === 'function' || // readable
(typeof s.write === 'function' && typeof s.end === 'function') // writable
)
const _head = Symbol('_head')
const _tail = Symbol('_tail')
const _linkStreams = Symbol('_linkStreams')
const _setHead = Symbol('_setHead')
const _setTail = Symbol('_setTail')
const _onError = Symbol('_onError')
const _onData = Symbol('_onData')
const _onEnd = Symbol('_onEnd')
const _onDrain = Symbol('_onDrain')
const _streams = Symbol('_streams')
class Pipeline extends Minipass {
constructor (opts, ...streams) {
if (isStream(opts)) {
streams.unshift(opts)
opts = {}
}
super(opts)
this[_streams] = []
if (streams.length)
this.push(...streams)
}
[_linkStreams] (streams) {
// reduce takes (left,right), and we return right to make it the
// new left value.
return streams.reduce((src, dest) => {
src.on('error', er => dest.emit('error', er))
src.pipe(dest)
return dest
})
}
push (...streams) {
this[_streams].push(...streams)
if (this[_tail])
streams.unshift(this[_tail])
const linkRet = this[_linkStreams](streams)
this[_setTail](linkRet)
if (!this[_head])
this[_setHead](streams[0])
}
unshift (...streams) {
this[_streams].unshift(...streams)
if (this[_head])
streams.push(this[_head])
const linkRet = this[_linkStreams](streams)
this[_setHead](streams[0])
if (!this[_tail])
this[_setTail](linkRet)
}
destroy (er) {
// set fire to the whole thing.
this[_streams].forEach(s =>
typeof s.destroy === 'function' && s.destroy())
return super.destroy(er)
}
// readable interface -> tail
[_setTail] (stream) {
this[_tail] = stream
stream.on('error', er => this[_onError](stream, er))
stream.on('data', chunk => this[_onData](stream, chunk))
stream.on('end', () => this[_onEnd](stream))
stream.on('finish', () => this[_onEnd](stream))
}
// errors proxied down the pipeline
// they're considered part of the "read" interface
[_onError] (stream, er) {
if (stream === this[_tail])
this.emit('error', er)
}
[_onData] (stream, chunk) {
if (stream === this[_tail])
super.write(chunk)
}
[_onEnd] (stream) {
if (stream === this[_tail])
super.end()
}
pause () {
super.pause()
return this[_tail] && this[_tail].pause && this[_tail].pause()
}
// NB: Minipass calls its internal private [RESUME] method during
// pipe drains, to avoid hazards where stream.resume() is overridden.
// Thus, we need to listen to the resume *event*, not override the
// resume() method, and proxy *that* to the tail.
emit (ev, ...args) {
if (ev === 'resume' && this[_tail] && this[_tail].resume)
this[_tail].resume()
return super.emit(ev, ...args)
}
// writable interface -> head
[_setHead] (stream) {
this[_head] = stream
stream.on('drain', () => this[_onDrain](stream))
}
[_onDrain] (stream) {
if (stream === this[_head])
this.emit('drain')
}
write (chunk, enc, cb) {
return this[_head].write(chunk, enc, cb) &&
(this.flowing || this.buffer.length === 0)
}
end (chunk, enc, cb) {
this[_head].end(chunk, enc, cb)
return this
}
}
module.exports = Pipeline
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isNoAncestorBindingConstraintsWithTag = isNoAncestorBindingConstraintsWithTag;
const isBindingConstraintsWithTag_1 = require("./isBindingConstraintsWithTag");
const isNoAncestorBindingConstraints_1 = require("./isNoAncestorBindingConstraints");
function isNoAncestorBindingConstraintsWithTag(tag, value) {
return (0, isNoAncestorBindingConstraints_1.isNoAncestorBindingConstraints)((0, isBindingConstraintsWithTag_1.isBindingConstraintsWithTag)(tag, value));
}
//# sourceMappingURL=isNoAncestorBindingConstraintsWithTag.js.map
@@ -0,0 +1,42 @@
"use strict"
// external tooling
const resolve = require("resolve")
const moduleDirectories = ["web_modules", "node_modules"]
function resolveModule(id, opts) {
return new Promise((res, rej) => {
resolve(id, opts, (err, path) => (err ? rej(err) : res(path)))
})
}
module.exports = function (id, base, options) {
const paths = options.path
const resolveOpts = {
basedir: base,
moduleDirectory: moduleDirectories.concat(options.addModulesDirectories),
paths,
extensions: [".css"],
packageFilter: function processPackage(pkg) {
if (pkg.style) pkg.main = pkg.style
else if (!pkg.main || !/\.css$/.test(pkg.main)) pkg.main = "index.css"
return pkg
},
preserveSymlinks: false,
}
return resolveModule(`./${id}`, resolveOpts)
.catch(() => resolveModule(id, resolveOpts))
.catch(() => {
if (paths.indexOf(base) === -1) paths.unshift(base)
throw new Error(
`Failed to find '${id}'
in [
${paths.join(",\n ")}
]`
)
})
}
@@ -0,0 +1,3 @@
export { useDropAnimation, defaultDropAnimationConfiguration as defaultDropAnimation, defaultDropAnimationSideEffects, } from './useDropAnimation';
export type { DropAnimation, DropAnimationFunction, DropAnimationFunctionArguments, KeyframeResolver as DropAnimationKeyframeResolver, DropAnimationSideEffects, } from './useDropAnimation';
export { useKey } from './useKey';
@@ -0,0 +1,130 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/components/drawer.ts
var drawer_exports = {};
__export(drawer_exports, {
drawer: () => drawer
});
module.exports = __toCommonJS(drawer_exports);
// src/utils/tv.ts
var import_tailwind_variants = require("tailwind-variants");
// src/utils/tw-merge-config.ts
var COMMON_UNITS = ["small", "medium", "large"];
var twMergeConfig = {
theme: {
opacity: ["disabled"],
spacing: ["divider"],
borderWidth: COMMON_UNITS,
borderRadius: COMMON_UNITS
},
classGroups: {
shadow: [{ shadow: COMMON_UNITS }],
"font-size": [{ text: ["tiny", ...COMMON_UNITS] }],
"bg-image": [
"bg-stripe-gradient-default",
"bg-stripe-gradient-primary",
"bg-stripe-gradient-secondary",
"bg-stripe-gradient-success",
"bg-stripe-gradient-warning",
"bg-stripe-gradient-danger"
]
}
};
// src/utils/tv.ts
var tv = (options, config) => {
var _a, _b, _c;
return (0, import_tailwind_variants.tv)(options, {
...config,
twMerge: (_a = config == null ? void 0 : config.twMerge) != null ? _a : true,
twMergeConfig: {
...config == null ? void 0 : config.twMergeConfig,
theme: {
...(_b = config == null ? void 0 : config.twMergeConfig) == null ? void 0 : _b.theme,
...twMergeConfig.theme
},
classGroups: {
...(_c = config == null ? void 0 : config.twMergeConfig) == null ? void 0 : _c.classGroups,
...twMergeConfig.classGroups
}
}
});
};
// src/components/drawer.ts
var drawer = tv({
slots: {
base: ["absolute", "m-0", "sm:m-0", "overflow-y-auto"]
},
variants: {
size: {
xs: {
base: "max-w-xs max-h-[20rem]"
},
sm: {
base: "max-w-sm max-h-[24rem]"
},
md: {
base: "max-w-md max-h-[28rem]"
},
lg: {
base: "max-w-lg max-h-[32rem]"
},
xl: {
base: "max-w-xl max-h-[36rem]"
},
"2xl": {
base: "max-w-2xl max-h-[42rem]"
},
"3xl": {
base: "max-w-3xl max-h-[48rem]"
},
"4xl": {
base: "max-w-4xl max-h-[56rem]"
},
"5xl": {
base: "max-w-5xl max-h-[64rem]"
},
full: {
base: "max-w-full max-h-full h-[100dvh] !rounded-none"
}
},
placement: {
top: {
base: "inset-x-0 top-0 max-w-[none] rounded-t-none"
},
right: {
base: "inset-y-0 right-0 max-h-[none] rounded-r-none"
},
bottom: {
base: "inset-x-0 bottom-0 max-w-[none] rounded-b-none"
},
left: {
base: "inset-y-0 left-0 max-h-[none] rounded-l-none"
}
}
}
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
drawer
});
@@ -0,0 +1,52 @@
import _typeof from "./typeof.js";
import setPrototypeOf from "./setPrototypeOf.js";
import inherits from "./inherits.js";
function _wrapRegExp() {
_wrapRegExp = function _wrapRegExp(e, r) {
return new BabelRegExp(e, void 0, r);
};
var e = RegExp.prototype,
r = new WeakMap();
function BabelRegExp(e, t, p) {
var o = RegExp(e, t);
return r.set(o, p || r.get(e)), setPrototypeOf(o, BabelRegExp.prototype);
}
function buildGroups(e, t) {
var p = r.get(t);
return Object.keys(p).reduce(function (r, t) {
var o = p[t];
if ("number" == typeof o) r[t] = e[o];else {
for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++;
r[t] = e[o[i]];
}
return r;
}, Object.create(null));
}
return inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) {
var t = e.exec.call(this, r);
if (t) {
t.groups = buildGroups(t, this);
var p = t.indices;
p && (p.groups = buildGroups(p, this));
}
return t;
}, BabelRegExp.prototype[Symbol.replace] = function (t, p) {
if ("string" == typeof p) {
var o = r.get(this);
return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)(>|$)/g, function (e, r, t) {
if ("" === t) return e;
var p = o[r];
return Array.isArray(p) ? "$" + p.join("$") : "number" == typeof p ? "$" + p : "";
}));
}
if ("function" == typeof p) {
var i = this;
return e[Symbol.replace].call(this, t, function () {
var e = arguments;
return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e);
});
}
return e[Symbol.replace].call(this, t, p);
}, _wrapRegExp.apply(this, arguments);
}
export { _wrapRegExp as default };
@@ -0,0 +1,4 @@
{
"main": "../build/cjs/type/index.js",
"types": "../build/cjs/type/index.d.ts"
}
@@ -0,0 +1 @@
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAkBM,SAAS,0CAAY,KAAoB;IAC9C,OAAO;QACL,eAAe,MAAM,UAAU,GAAG,CAAC,IAAI;YACrC,WAAW,CAAA,GAAA,4CAAiB,EAAE,MAAM,SAAS;YAC7C,SAAS,CAAA,GAAA,4CAAiB,EAAE,MAAM,OAAO;QAC3C;IACF;AACF","sources":["packages/@react-aria/interactions/src/useKeyboard.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {createEventHandler} from './createEventHandler';\nimport {DOMAttributes, KeyboardEvents} from '@react-types/shared';\n\nexport interface KeyboardProps extends KeyboardEvents {\n /** Whether the keyboard events should be disabled. */\n isDisabled?: boolean\n}\n\nexport interface KeyboardResult {\n /** Props to spread onto the target element. */\n keyboardProps: DOMAttributes\n}\n\n/**\n * Handles keyboard interactions for a focusable element.\n */\nexport function useKeyboard(props: KeyboardProps): KeyboardResult {\n return {\n keyboardProps: props.isDisabled ? {} : {\n onKeyDown: createEventHandler(props.onKeyDown),\n onKeyUp: createEventHandler(props.onKeyUp)\n }\n };\n}\n"],"names":[],"version":3,"file":"useKeyboard.main.js.map"}
@@ -0,0 +1,102 @@
"use strict";
const taskManager = require("./managers/tasks");
const async_1 = require("./providers/async");
const stream_1 = require("./providers/stream");
const sync_1 = require("./providers/sync");
const settings_1 = require("./settings");
const utils = require("./utils");
async function FastGlob(source, options) {
assertPatternsInput(source);
const works = getWorks(source, async_1.default, options);
const result = await Promise.all(works);
return utils.array.flatten(result);
}
// https://github.com/typescript-eslint/typescript-eslint/issues/60
// eslint-disable-next-line no-redeclare
(function (FastGlob) {
FastGlob.glob = FastGlob;
FastGlob.globSync = sync;
FastGlob.globStream = stream;
FastGlob.async = FastGlob;
function sync(source, options) {
assertPatternsInput(source);
const works = getWorks(source, sync_1.default, options);
return utils.array.flatten(works);
}
FastGlob.sync = sync;
function stream(source, options) {
assertPatternsInput(source);
const works = getWorks(source, stream_1.default, options);
/**
* The stream returned by the provider cannot work with an asynchronous iterator.
* To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
* This affects performance (+25%). I don't see best solution right now.
*/
return utils.stream.merge(works);
}
FastGlob.stream = stream;
function generateTasks(source, options) {
assertPatternsInput(source);
const patterns = [].concat(source);
const settings = new settings_1.default(options);
return taskManager.generate(patterns, settings);
}
FastGlob.generateTasks = generateTasks;
function isDynamicPattern(source, options) {
assertPatternsInput(source);
const settings = new settings_1.default(options);
return utils.pattern.isDynamicPattern(source, settings);
}
FastGlob.isDynamicPattern = isDynamicPattern;
function escapePath(source) {
assertPatternsInput(source);
return utils.path.escape(source);
}
FastGlob.escapePath = escapePath;
function convertPathToPattern(source) {
assertPatternsInput(source);
return utils.path.convertPathToPattern(source);
}
FastGlob.convertPathToPattern = convertPathToPattern;
let posix;
(function (posix) {
function escapePath(source) {
assertPatternsInput(source);
return utils.path.escapePosixPath(source);
}
posix.escapePath = escapePath;
function convertPathToPattern(source) {
assertPatternsInput(source);
return utils.path.convertPosixPathToPattern(source);
}
posix.convertPathToPattern = convertPathToPattern;
})(posix = FastGlob.posix || (FastGlob.posix = {}));
let win32;
(function (win32) {
function escapePath(source) {
assertPatternsInput(source);
return utils.path.escapeWindowsPath(source);
}
win32.escapePath = escapePath;
function convertPathToPattern(source) {
assertPatternsInput(source);
return utils.path.convertWindowsPathToPattern(source);
}
win32.convertPathToPattern = convertPathToPattern;
})(win32 = FastGlob.win32 || (FastGlob.win32 = {}));
})(FastGlob || (FastGlob = {}));
function getWorks(source, _Provider, options) {
const patterns = [].concat(source);
const settings = new settings_1.default(options);
const tasks = taskManager.generate(patterns, settings);
const provider = new _Provider(settings);
return tasks.map(provider.read, provider);
}
function assertPatternsInput(input) {
const source = [].concat(input);
const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
if (!isValidSource) {
throw new TypeError('Patterns must be a string (non empty) or an array of strings');
}
}
module.exports = FastGlob;
@@ -0,0 +1,36 @@
"use strict"
const {
definePrototypeMethodHandler,
} = require("../util/define-prototype-method-handler")
module.exports = {
meta: {
docs: {
description: "disallow the `Set.prototype.isSupersetOf` method.",
category: "ES2025",
proposal: "set-methods",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-set-prototype-issupersetof.html",
},
fixable: null,
messages: {
forbidden: "ES2025 '{{name}}' method is forbidden.",
},
schema: [
{
type: "object",
properties: {
aggressive: { type: "boolean" },
},
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
return definePrototypeMethodHandler(context, {
Set: ["isSupersetOf"],
})
},
}
@@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var optionRole = {
abstract: false,
accessibleNameRequired: true,
baseConcepts: [],
childrenPresentational: true,
nameFrom: ['author', 'contents'],
prohibitedProps: [],
props: {
'aria-checked': null,
'aria-posinset': null,
'aria-setsize': null,
'aria-selected': 'false'
},
relatedConcepts: [{
concept: {
name: 'item'
},
module: 'XForms'
}, {
concept: {
name: 'listitem'
},
module: 'ARIA'
}, {
concept: {
name: 'option'
},
module: 'HTML'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {
'aria-selected': 'false'
},
superClass: [['roletype', 'widget', 'input']]
};
var _default = exports.default = optionRole;
@@ -0,0 +1,76 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.getContextualType = getContextualType;
const ts = __importStar(require("typescript"));
/**
* Returns the contextual type of a given node.
* Contextual type is the type of the target the node is going into.
* i.e. the type of a called function's parameter, or the defined type of a variable declaration
*/
function getContextualType(checker, node) {
const parent = node.parent;
if (ts.isCallExpression(parent) || ts.isNewExpression(parent)) {
if (node === parent.expression) {
// is the callee, so has no contextual type
return;
}
}
else if (ts.isVariableDeclaration(parent) ||
ts.isPropertyDeclaration(parent) ||
ts.isParameter(parent)) {
return parent.type ? checker.getTypeFromTypeNode(parent.type) : undefined;
}
else if (ts.isJsxExpression(parent)) {
return checker.getContextualType(parent);
}
else if (ts.isIdentifier(node) &&
(ts.isPropertyAssignment(parent) ||
ts.isShorthandPropertyAssignment(parent))) {
return checker.getContextualType(node);
}
else if (ts.isBinaryExpression(parent) &&
parent.operatorToken.kind === ts.SyntaxKind.EqualsToken &&
parent.right === node) {
// is RHS of assignment
return checker.getTypeAtLocation(parent.left);
}
else if (![ts.SyntaxKind.JsxExpression, ts.SyntaxKind.TemplateSpan].includes(parent.kind)) {
// parent is not something we know we can get the contextual type of
return;
}
// TODO - support return statement checking
return checker.getContextualType(node);
}
@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "defaults", {
enumerable: true,
get: function() {
return defaults;
}
});
function defaults(target, ...sources) {
for (let source of sources){
for(let k in source){
var _target_hasOwnProperty;
if (!(target === null || target === void 0 ? void 0 : (_target_hasOwnProperty = target.hasOwnProperty) === null || _target_hasOwnProperty === void 0 ? void 0 : _target_hasOwnProperty.call(target, k))) {
target[k] = source[k];
}
}
for (let k of Object.getOwnPropertySymbols(source)){
var _target_hasOwnProperty1;
if (!(target === null || target === void 0 ? void 0 : (_target_hasOwnProperty1 = target.hasOwnProperty) === null || _target_hasOwnProperty1 === void 0 ? void 0 : _target_hasOwnProperty1.call(target, k))) {
target[k] = source[k];
}
}
}
return target;
}
@@ -0,0 +1,308 @@
/**
* @file 解析glyf轮廓
* @author mengke01(kekee000@gmail.com)
*/
import glyFlag from '../../enum/glyFlag';
import componentFlag from '../../enum/componentFlag';
const MAX_INSTRUCTION_LENGTH = 5000; // 设置instructions阈值防止读取错误
const MAX_NUMBER_OF_COORDINATES = 20000; // 设置坐标最大个数阈值,防止glyf读取错误
/**
* 读取简单字形
*
* @param {Reader} reader Reader对象
* @param {Object} glyf 空glyf
* @return {Object} 解析后的glyf
*/
function parseSimpleGlyf(reader, glyf) {
const offset = reader.offset;
// 轮廓点个数
const numberOfCoordinates = glyf.endPtsOfContours[
glyf.endPtsOfContours.length - 1
] + 1;
// 判断坐标是否超过最大个数
if (numberOfCoordinates > MAX_NUMBER_OF_COORDINATES) {
console.warn('error read glyf coordinates:' + offset);
return glyf;
}
// 获取flag标志
let i;
let length;
const flags = [];
let flag;
i = 0;
while (i < numberOfCoordinates) {
flag = reader.readUint8();
flags.push(flag);
i++;
// 标志位3重复flag
if ((flag & glyFlag.REPEAT) && i < numberOfCoordinates) {
// 重复个数
const repeat = reader.readUint8();
for (let j = 0; j < repeat; j++) {
flags.push(flag);
i++;
}
}
}
// 坐标集合
const coordinates = [];
const xCoordinates = [];
let prevX = 0;
let x;
for (i = 0, length = flags.length; i < length; ++i) {
x = 0;
flag = flags[i];
// 标志位1
// If set, the corresponding y-coordinate is 1 byte long, not 2
if (flag & glyFlag.XSHORT) {
x = reader.readUint8();
// 标志位5
x = (flag & glyFlag.XSAME) ? x : -1 * x;
}
// 与上一值一致
else if (flag & glyFlag.XSAME) {
x = 0;
}
// 新值
else {
x = reader.readInt16();
}
prevX += x;
xCoordinates[i] = prevX;
coordinates[i] = {
x: prevX,
y: 0
};
if (flag & glyFlag.ONCURVE) {
coordinates[i].onCurve = true;
}
}
const yCoordinates = [];
let prevY = 0;
let y;
for (i = 0, length = flags.length; i < length; i++) {
y = 0;
flag = flags[i];
if (flag & glyFlag.YSHORT) {
y = reader.readUint8();
y = (flag & glyFlag.YSAME) ? y : -1 * y;
}
else if (flag & glyFlag.YSAME) {
y = 0;
}
else {
y = reader.readInt16();
}
prevY += y;
yCoordinates[i] = prevY;
if (coordinates[i]) {
coordinates[i].y = prevY;
}
}
// 计算轮廓集合
if (coordinates.length) {
const endPtsOfContours = glyf.endPtsOfContours;
const contours = [];
contours.push(coordinates.slice(0, endPtsOfContours[0] + 1));
for (i = 1, length = endPtsOfContours.length; i < length; i++) {
contours.push(coordinates.slice(endPtsOfContours[i - 1] + 1, endPtsOfContours[i] + 1));
}
glyf.contours = contours;
}
return glyf;
}
/**
* 读取复合字形
*
* @param {Reader} reader Reader对象
* @param {Object} glyf glyf对象
* @return {Object} glyf对象
*/
function parseCompoundGlyf(reader, glyf) {
glyf.compound = true;
glyf.glyfs = [];
let flags;
let g;
// 读取复杂字形
do {
flags = reader.readUint16();
g = {};
g.flags = flags;
g.glyphIndex = reader.readUint16();
let arg1 = 0;
let arg2 = 0;
let scaleX = 16384;
let scaleY = 16384;
let scale01 = 0;
let scale10 = 0;
if (componentFlag.ARG_1_AND_2_ARE_WORDS & flags) {
arg1 = reader.readInt16();
arg2 = reader.readInt16();
}
else {
arg1 = reader.readInt8();
arg2 = reader.readInt8();
}
if (componentFlag.ROUND_XY_TO_GRID & flags) {
arg1 = Math.round(arg1);
arg2 = Math.round(arg2);
}
if (componentFlag.WE_HAVE_A_SCALE & flags) {
scaleX = reader.readInt16();
scaleY = scaleX;
}
else if (componentFlag.WE_HAVE_AN_X_AND_Y_SCALE & flags) {
scaleX = reader.readInt16();
scaleY = reader.readInt16();
}
else if (componentFlag.WE_HAVE_A_TWO_BY_TWO & flags) {
scaleX = reader.readInt16();
scale01 = reader.readInt16();
scale10 = reader.readInt16();
scaleY = reader.readInt16();
}
if (componentFlag.ARGS_ARE_XY_VALUES & flags) {
g.useMyMetrics = !!flags & componentFlag.USE_MY_METRICS;
g.overlapCompound = !!flags & componentFlag.OVERLAP_COMPOUND;
g.transform = {
a: Math.round(10000 * scaleX / 16384) / 10000,
b: Math.round(10000 * scale01 / 16384) / 10000,
c: Math.round(10000 * scale10 / 16384) / 10000,
d: Math.round(10000 * scaleY / 16384) / 10000,
e: arg1,
f: arg2
};
}
else {
g.points = [arg1, arg2];
g.transform = {
a: Math.round(10000 * scaleX / 16384) / 10000,
b: Math.round(10000 * scale01 / 16384) / 10000,
c: Math.round(10000 * scale10 / 16384) / 10000,
d: Math.round(10000 * scaleY / 16384) / 10000,
e: 0,
f: 0
};
}
glyf.glyfs.push(g);
} while (componentFlag.MORE_COMPONENTS & flags);
if (componentFlag.WE_HAVE_INSTRUCTIONS & flags) {
const length = reader.readUint16();
if (length < MAX_INSTRUCTION_LENGTH) {
const instructions = [];
for (let i = 0; i < length; ++i) {
instructions.push(reader.readUint8());
}
glyf.instructions = instructions;
}
else {
console.warn(length);
}
}
return glyf;
}
/**
* 解析glyf轮廓
*
* @param {Reader} reader 读取器
* @param {Object} ttf ttf对象
* @param {number=} offset 偏移
* @return {Object} glyf对象
*/
export default function parseGlyf(reader, ttf, offset) {
if (null != offset) {
reader.seek(offset);
}
const glyf = {};
let i;
let length;
let instructions;
// 边界值
const numberOfContours = reader.readInt16();
glyf.xMin = reader.readInt16();
glyf.yMin = reader.readInt16();
glyf.xMax = reader.readInt16();
glyf.yMax = reader.readInt16();
// 读取简单字形
if (numberOfContours >= 0) {
// endPtsOfConturs
glyf.endPtsOfContours = [];
if (numberOfContours > 0) {
for (i = 0; i < numberOfContours; i++) {
glyf.endPtsOfContours.push(reader.readUint16());
}
}
else {
delete glyf.xMin;
delete glyf.yMin;
delete glyf.xMax;
delete glyf.yMax;
}
// instructions
length = reader.readUint16();
if (length) {
// range错误
if (length < MAX_INSTRUCTION_LENGTH) {
instructions = [];
for (i = 0; i < length; ++i) {
instructions.push(reader.readUint8());
}
glyf.instructions = instructions;
}
else {
console.warn(length);
}
}
parseSimpleGlyf(reader, glyf);
delete glyf.endPtsOfContours;
}
else {
parseCompoundGlyf(reader, glyf);
}
return glyf;
}
@@ -0,0 +1,6 @@
# undici-types
This package is a dual-publish of the [undici](https://www.npmjs.com/package/undici) library types. The `undici` package **still contains types**. This package is for users who _only_ need undici types (such as for `@types/node`). It is published alongside every release of `undici`, so you can always use the same version.
- [GitHub nodejs/undici](https://github.com/nodejs/undici)
- [Undici Documentation](https://undici.nodejs.org/#/)
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,oBAAoB,CAAC,+DAAyD,CAAC;AACnG","sources":["packages/@react-aria/menu/intl/da-DK.json"],"sourcesContent":["{\n \"longPressMessage\": \"Langt tryk eller tryk på Alt + pil ned for at åbne menuen\"\n}\n"],"names":[],"version":3,"file":"da-DK.module.js.map"}
@@ -0,0 +1,22 @@
"use strict";
module.exports = function (it) {
const { pluginId, plugins } = it;
let result = `ESLint couldn't determine the plugin "${pluginId}" uniquely.
`;
for (const { filePath, importerName } of plugins) {
result += `
- ${filePath} (loaded in "${importerName}")`;
}
result += `
Please remove the "plugins" setting from either config or remove either plugin installation.
If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting.
`;
return result;
};
@@ -0,0 +1,4 @@
import type { FieldPath, FieldValues } from '../types';
declare const _default: (object: FieldValues, path: FieldPath<FieldValues>, value?: unknown) => void;
export default _default;
//# sourceMappingURL=set.d.ts.map
@@ -0,0 +1,55 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you 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
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import clsx from 'clsx';
import {mergeProps} from '@react-aria/utils';
import React, {ReactElement} from 'react';
import {useFocusRing} from './useFocusRing';
export interface FocusRingProps {
/** Child element to apply CSS classes to. */
children: ReactElement,
/** CSS class to apply when the element is focused. */
focusClass?: string,
/** CSS class to apply when the element has keyboard focus. */
focusRingClass?: string,
/**
* Whether to show the focus ring when something
* inside the container element has focus (true), or
* only if the container itself has focus (false).
* @default false
*/
within?: boolean,
/** Whether the element is a text input. */
isTextInput?: boolean,
/** Whether the element will be auto focused. */
autoFocus?: boolean
}
/**
* A utility component that applies a CSS class when an element has keyboard focus.
* Focus rings are visible only when the user is interacting with a keyboard,
* not with a mouse, touch, or other input methods.
*/
export function FocusRing(props: FocusRingProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> {
let {children, focusClass, focusRingClass} = props;
let {isFocused, isFocusVisible, focusProps} = useFocusRing(props);
let child = React.Children.only(children);
return React.cloneElement(child, mergeProps(child.props as any, {
...focusProps,
className: clsx({
[focusClass || '']: isFocused,
[focusRingClass || '']: isFocusVisible
})
}));
}
@@ -0,0 +1,50 @@
// src/bold/align-vertically.tsx
import { jsx, jsxs } from "react/jsx-runtime";
var AlignVerticallyBoldIcon = (props) => /* @__PURE__ */ jsxs(
"svg",
{
"aria-hidden": "true",
fill: "none",
focusable: "false",
height: "1em",
role: "presentation",
viewBox: "0 0 24 24",
width: "1em",
...props,
children: [
/* @__PURE__ */ jsx(
"path",
{
d: "M17.4 19.25H6.6C5.1 19.25 4.5 18.61 4.5 17.02V15.98C4.5 14.39 5.1 13.75 6.6 13.75H17.4C18.9 13.75 19.5 14.39 19.5 15.98V17.02C19.5 18.61 18.9 19.25 17.4 19.25Z",
fill: "currentColor"
}
),
/* @__PURE__ */ jsx(
"path",
{
d: "M12.75 19.25V21.25C12.75 21.66 12.41 22 12 22C11.59 22 11.25 21.66 11.25 21.25V19.25H12.75Z",
fill: "currentColor"
}
),
/* @__PURE__ */ jsx("path", { d: "M12.75 10.75H11.25V13.75H12.75V10.75Z", fill: "currentColor" }),
/* @__PURE__ */ jsx(
"path",
{
d: "M12.75 2.75V5.25H11.25V2.75C11.25 2.34 11.59 2 12 2C12.41 2 12.75 2.34 12.75 2.75Z",
fill: "currentColor"
}
),
/* @__PURE__ */ jsx(
"path",
{
d: "M15.4 10.75H8.6C7.1 10.75 6.5 10.11 6.5 8.52V7.48C6.5 5.89 7.1 5.25 8.6 5.25H15.4C16.9 5.25 17.5 5.89 17.5 7.48V8.52C17.5 10.11 16.9 10.75 15.4 10.75Z",
fill: "currentColor"
}
)
]
}
);
export {
AlignVerticallyBoldIcon
};
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAoBM,MAAM;IAsBD,OAAO,IAAa,EAAW;QACvC,OAAO,KAAK,IAAI,KAAK;IACvB;IAEU,MAAM,IAAa,EAAW;QACtC,OAAO,KAAK,IAAI,KAAK,SAAS,KAAK,IAAI,KAAK;IAC9C;IAEQ,WAAW,IAAmB,EAAE;YACK;QAA3C,OAAO,IAAI,CAAC,gBAAgB,KAAK,SAAU,CAAA,EAAA,cAAA,KAAK,KAAK,cAAV,kCAAA,YAAY,UAAU,KAAI,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,GAAG,CAAA;IACrG;IAEU,gBAAgB,OAAa,EAAE,IAAiC,EAAc;QACtF,IAAI,MAAM,WAAW,OACjB,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,WAC7B,IAAI,CAAC,UAAU,CAAC,UAAU;QAE9B,MAAO,OAAO,KAAM;YAClB,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YACnC,IAAI,CAAC,MACH,OAAO;YAET,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAU,CAAA,CAAC,QAAQ,KAAK,KAAI,GAC/C,OAAO;YAGT,MAAM,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;QACrC;QACA,OAAO;IACT;IAEU,YAAY,OAAa,EAAE,IAAiC,EAAc;QAClF,IAAI,MAAM,WAAW,OACjB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,WAC5B,IAAI,CAAC,UAAU,CAAC,WAAW;QAE/B,MAAO,OAAO,KAAM;YAClB,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YACnC,IAAI,CAAC,MACH,OAAO;YAET,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAU,CAAA,CAAC,QAAQ,KAAK,KAAI,GAC/C,OAAO;YAGT,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;YAClC,IAAI,OAAO,MACT,OAAO;QAEX;QACA,OAAO;IACT;IAEU,0BAA0B,GAAQ,EAAE,QAAgB,CAAC,EAAc;QAC3E,IAAI,QAAQ,GACV,OAAO;QAGT,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACnC,IAAI,CAAC,MACH,OAAO;QAGT,IAAI,IAAI;QACR,KAAK,IAAI,SAAS,CAAA,GAAA,4CAAY,EAAE,MAAM,IAAI,CAAC,UAAU,EAA4B;gBAEtE;YADT,IAAI,MAAM,OAAO,IAAI,MAAM,OAAO,GAAG,IAAI,OACvC,OAAO,CAAA,aAAA,MAAM,GAAG,cAAT,wBAAA,aAAa;YAGtB,IAAI,MAAM,OAAO,EACf,IAAI,IAAI,MAAM,OAAO,GAAG;gBAIjB;YADT,IAAI,MAAM,OACR,OAAO,CAAA,cAAA,MAAM,GAAG,cAAT,yBAAA,cAAa;YAGtB;QACF;QACA,OAAO;IACT;IAEA,YAAY,OAAY,EAAc;QACpC,IAAI,MAAkB;QACtB,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACxC,IAAI,CAAC,WACH,OAAO;YAKD;QAFR,8DAA8D;QAC9D,IAAI,IAAI,CAAC,MAAM,CAAC,YACd,MAAM,CAAA,uBAAA,UAAU,SAAS,cAAnB,kCAAA,uBAAuB;QAE/B,IAAI,OAAO,MACT,OAAO;QAGT,qBAAqB;QACrB,MAAM,IAAI,CAAC,WAAW,CAAC,KAAM,CAAA,OAAQ,KAAK,IAAI,KAAK;QACnD,IAAI,OAAO,MAAM;YACf,8EAA8E;YAC9E,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY;gBAC1B,IAAI,aAAa,UAAU,QAAQ,GAAG,UAAU,QAAQ,GAAG,UAAU,KAAK;gBAC1E,OAAO,IAAI,CAAC,yBAAyB,CAAC,KAAK;YAC7C;YAEA,gCAAgC;YAChC,IAAI,IAAI,CAAC,SAAS,KAAK,OACrB,OAAO;QAEX;QACA,OAAO;IACT;IAEA,YAAY,OAAY,EAAc;QACpC,IAAI,MAAkB;QACtB,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACxC,IAAI,CAAC,WACH,OAAO;YAKD;QAFR,6DAA6D;QAC7D,IAAI,IAAI,CAAC,MAAM,CAAC,YACd,MAAM,CAAA,uBAAA,UAAU,SAAS,cAAnB,kCAAA,uBAAuB;QAE/B,IAAI,OAAO,MACT,OAAO;QAGT,yBAAyB;QACzB,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,CAAA,OAAQ,KAAK,IAAI,KAAK;QACtD,IAAI,OAAO,MAAM;YACf,kFAAkF;YAClF,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY;gBAC1B,IAAI,aAAa,UAAU,QAAQ,GAAG,UAAU,QAAQ,GAAG,UAAU,KAAK;gBAC1E,OAAO,IAAI,CAAC,yBAAyB,CAAC,KAAK;YAC7C;YAEA,oCAAoC;YACpC,IAAI,IAAI,CAAC,SAAS,KAAK,OACrB,OAAO;QAEX;QACA,OAAO;IACT;IAEA,cAAc,GAAQ,EAAc;QAClC,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACnC,IAAI,CAAC,MACH,OAAO;QAGT,oDAAoD;QACpD,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO;gBAGhB,cACA;YAHJ,IAAI,WAAW,CAAA,GAAA,4CAAY,EAAE,MAAM,IAAI,CAAC,UAAU;gBAC1C;YAAR,OAAO,CAAC,OAAA,IAAI,CAAC,SAAS,KAAK,SACvB,eAAA,CAAA,GAAA,0CAAU,EAAE,uBAAZ,mCAAA,aAAuB,GAAG,IAC1B,gBAAA,CAAA,GAAA,2CAAW,EAAE,uBAAb,oCAAA,cAAwB,GAAG,cAFvB,kBAAA,OAE4B;QACtC;QAEA,qDAAqD;QACrD,kCAAkC;QAClC,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS,IAAI,MAAM;YAC/C,IAAI,SAAS,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,SAAS;YACnD,IAAI,CAAC,QACH,OAAO;YAET,IAAI,WAAW,CAAA,GAAA,4CAAY,EAAE,QAAQ,IAAI,CAAC,UAAU;gBACxC;YAAZ,IAAI,OAAO,CAAC,QAAA,IAAI,CAAC,SAAS,KAAK,QAC3B,CAAA,GAAA,yCAAS,EAAE,UAAU,KAAK,KAAK,GAAG,KAClC,CAAA,GAAA,yCAAS,EAAE,UAAU,KAAK,KAAK,GAAG,gBAF1B,mBAAA,QAEiC;gBAGpC;YADT,IAAI,MACF,OAAO,CAAA,YAAA,KAAK,GAAG,cAAR,uBAAA,YAAY;gBAKZ;YAFT,4CAA4C;YAC5C,IAAI,IAAI,CAAC,SAAS,KAAK,OACrB,OAAO,CAAA,kBAAA,KAAK,SAAS,cAAd,6BAAA,kBAAkB;gBAGnB;YAAR,OAAO,CAAC,QAAA,IAAI,CAAC,SAAS,KAAK,QAAQ,IAAI,CAAC,WAAW,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,kBAAnE,mBAAA,QAA4E;QACtF;QACA,OAAO;IACT;IAEA,aAAa,GAAQ,EAAc;QACjC,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACnC,IAAI,CAAC,MACH,OAAO;QAGT,mDAAmD;QACnD,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO;gBAGhB,eACA;YAHJ,IAAI,WAAW,CAAA,GAAA,4CAAY,EAAE,MAAM,IAAI,CAAC,UAAU;gBAC1C;YAAR,OAAO,CAAC,OAAA,IAAI,CAAC,SAAS,KAAK,SACvB,gBAAA,CAAA,GAAA,2CAAW,EAAE,uBAAb,oCAAA,cAAwB,GAAG,IAC3B,eAAA,CAAA,GAAA,0CAAU,EAAE,uBAAZ,mCAAA,aAAuB,GAAG,cAFtB,kBAAA,OAE2B;QACrC;QAEA,yDAAyD;QACzD,kCAAkC;QAClC,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS,IAAI,MAAM;YAC/C,IAAI,SAAS,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,SAAS;YACnD,IAAI,CAAC,QACH,OAAO;YAET,IAAI,WAAW,CAAA,GAAA,4CAAY,EAAE,QAAQ,IAAI,CAAC,UAAU;gBACxC;YAAZ,IAAI,OAAO,CAAC,QAAA,IAAI,CAAC,SAAS,KAAK,QAC3B,CAAA,GAAA,yCAAS,EAAE,UAAU,KAAK,KAAK,GAAG,KAClC,CAAA,GAAA,yCAAS,EAAE,UAAU,KAAK,KAAK,GAAG,gBAF1B,mBAAA,QAEiC;gBAGpC;YADT,IAAI,MACF,OAAO,CAAA,YAAA,KAAK,GAAG,cAAR,uBAAA,YAAY;gBAKZ;YAFT,4CAA4C;YAC5C,IAAI,IAAI,CAAC,SAAS,KAAK,OACrB,OAAO,CAAA,kBAAA,KAAK,SAAS,cAAd,6BAAA,kBAAkB;gBAGnB;YAAR,OAAO,CAAC,QAAA,IAAI,CAAC,SAAS,KAAK,QAAQ,IAAI,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,kBAAnE,mBAAA,QAA4E;QACtF;QACA,OAAO;IACT;IAEA,YAAY,OAAa,EAAE,MAAgB,EAAc;QACvD,IAAI,MAAkB,oBAAA,qBAAA,UAAW;QACjC,IAAI;QACJ,IAAI,OAAO,MAAM;YACf,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YAC/B,IAAI,CAAC,MACH,OAAO;YAGT,8DAA8D;YAC9D,kDAAkD;YAClD,IAAI,IAAI,CAAC,MAAM,CAAC,SAALine truncated
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2019 Coveo Solutions Inc.
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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -0,0 +1,162 @@
/**
* Helpers.
*/
var s = 1000;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var w = d * 7;
var y = d * 365.25;
/**
* Parse or format the given `val`.
*
* Options:
*
* - `long` verbose formatting [false]
*
* @param {String|Number} val
* @param {Object} [options]
* @throws {Error} throw an error if val is not a non-empty string or a number
* @return {String|Number}
* @api public
*/
module.exports = function (val, options) {
options = options || {};
var type = typeof val;
if (type === 'string' && val.length > 0) {
return parse(val);
} else if (type === 'number' && isFinite(val)) {
return options.long ? fmtLong(val) : fmtShort(val);
}
throw new Error(
'val is not a non-empty string or a valid number. val=' +
JSON.stringify(val)
);
};
/**
* Parse the given `str` and return milliseconds.
*
* @param {String} str
* @return {Number}
* @api private
*/
function parse(str) {
str = String(str);
if (str.length > 100) {
return;
}
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
str
);
if (!match) {
return;
}
var n = parseFloat(match[1]);
var type = (match[2] || 'ms').toLowerCase();
switch (type) {
case 'years':
case 'year':
case 'yrs':
case 'yr':
case 'y':
return n * y;
case 'weeks':
case 'week':
case 'w':
return n * w;
case 'days':
case 'day':
case 'd':
return n * d;
case 'hours':
case 'hour':
case 'hrs':
case 'hr':
case 'h':
return n * h;
case 'minutes':
case 'minute':
case 'mins':
case 'min':
case 'm':
return n * m;
case 'seconds':
case 'second':
case 'secs':
case 'sec':
case 's':
return n * s;
case 'milliseconds':
case 'millisecond':
case 'msecs':
case 'msec':
case 'ms':
return n;
default:
return undefined;
}
}
/**
* Short format for `ms`.
*
* @param {Number} ms
* @return {String}
* @api private
*/
function fmtShort(ms) {
var msAbs = Math.abs(ms);
if (msAbs >= d) {
return Math.round(ms / d) + 'd';
}
if (msAbs >= h) {
return Math.round(ms / h) + 'h';
}
if (msAbs >= m) {
return Math.round(ms / m) + 'm';
}
if (msAbs >= s) {
return Math.round(ms / s) + 's';
}
return ms + 'ms';
}
/**
* Long format for `ms`.
*
* @param {Number} ms
* @return {String}
* @api private
*/
function fmtLong(ms) {
var msAbs = Math.abs(ms);
if (msAbs >= d) {
return plural(ms, msAbs, d, 'day');
}
if (msAbs >= h) {
return plural(ms, msAbs, h, 'hour');
}
if (msAbs >= m) {
return plural(ms, msAbs, m, 'minute');
}
if (msAbs >= s) {
return plural(ms, msAbs, s, 'second');
}
return ms + ' ms';
}
/**
* Pluralization helper.
*/
function plural(ms, msAbs, n, name) {
var isPlural = msAbs >= n * 1.5;
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
}
@@ -0,0 +1,3 @@
declare const RangeError: RangeErrorConstructor;
export = RangeError;
@@ -0,0 +1,44 @@
import compareAscending from './_compareAscending.js';
/**
* Used by `_.orderBy` to compare multiple properties of a value to another
* and stable sort them.
*
* If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
* specify an order of "desc" for descending or "asc" for ascending sort order
* of corresponding values.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {boolean[]|string[]} orders The order to sort by for each property.
* @returns {number} Returns the sort order indicator for `object`.
*/
function compareMultiple(object, other, orders) {
var index = -1,
objCriteria = object.criteria,
othCriteria = other.criteria,
length = objCriteria.length,
ordersLength = orders.length;
while (++index < length) {
var result = compareAscending(objCriteria[index], othCriteria[index]);
if (result) {
if (index >= ordersLength) {
return result;
}
var order = orders[index];
return result * (order == 'desc' ? -1 : 1);
}
}
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
// that causes it, under certain circumstances, to provide the same value for
// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
// for more details.
//
// This also ensures a stable sort in V8 and other engines.
// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
return object.index - other.index;
}
export default compareMultiple;
@@ -0,0 +1,305 @@
'use strict';
var utils = require('../utils.js');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
const SPACING = {
always: "always",
never: "never"
};
const SPACING_VALUES = [SPACING.always, SPACING.never];
const messages = {
noNewlineAfter: "There should be no newline after '{{token}}'",
noNewlineBefore: "There should be no newline before '{{token}}'",
noSpaceAfter: "There should be no space after '{{token}}'",
noSpaceBefore: "There should be no space before '{{token}}'",
spaceNeededAfter: "A space is required after '{{token}}'",
spaceNeededBefore: "A space is required before '{{token}}'"
};
var jsxCurlySpacing = utils.createRule({
name: "jsx-curly-spacing",
package: "jsx",
meta: {
type: "layout",
docs: {
description: "Enforce or disallow spaces inside of curly braces in JSX attributes and expressions"
},
fixable: "code",
messages,
schema: {
definitions: {
basicConfig: {
type: "object",
properties: {
when: {
type: "string",
enum: SPACING_VALUES
},
allowMultiline: {
type: "boolean"
},
spacing: {
type: "object",
properties: {
objectLiterals: {
type: "string",
enum: SPACING_VALUES
}
}
}
}
},
basicConfigOrBoolean: {
anyOf: [{
$ref: "#/definitions/basicConfig"
}, {
type: "boolean"
}]
}
},
type: "array",
items: [{
anyOf: [{
allOf: [{
$ref: "#/definitions/basicConfig"
}, {
type: "object",
properties: {
attributes: {
$ref: "#/definitions/basicConfigOrBoolean"
},
children: {
$ref: "#/definitions/basicConfigOrBoolean"
}
}
}]
}, {
type: "string",
enum: SPACING_VALUES
}]
}, {
type: "object",
properties: {
allowMultiline: {
type: "boolean"
},
spacing: {
type: "object",
properties: {
objectLiterals: {
type: "string",
enum: SPACING_VALUES
}
}
}
},
additionalProperties: false
}]
}
},
create(context) {
function normalizeConfig(configOrTrue, defaults, lastPass = false) {
const config = configOrTrue === true ? {} : configOrTrue;
const when = config.when || defaults.when;
const allowMultiline = "allowMultiline" in config ? config.allowMultiline : defaults.allowMultiline;
const spacing = config.spacing || {};
let objectLiteralSpaces = spacing.objectLiterals || defaults.objectLiteralSpaces;
if (lastPass) {
objectLiteralSpaces = objectLiteralSpaces || when;
}
return {
when,
allowMultiline,
objectLiteralSpaces
};
}
const DEFAULT_WHEN = SPACING.never;
const DEFAULT_ALLOW_MULTILINE = true;
const DEFAULT_ATTRIBUTES = true;
const DEFAULT_CHILDREN = false;
let originalConfig = context.options[0] || {};
if (SPACING_VALUES.includes(originalConfig))
originalConfig = Object.assign({ when: context.options[0] }, context.options[1]);
originalConfig = originalConfig;
const defaultConfig = normalizeConfig(originalConfig, {
when: DEFAULT_WHEN,
allowMultiline: DEFAULT_ALLOW_MULTILINE
});
const attributes = "attributes" in originalConfig ? originalConfig.attributes : DEFAULT_ATTRIBUTES;
const attributesConfig = attributes ? normalizeConfig(attributes, defaultConfig, true) : null;
const children = "children" in originalConfig ? originalConfig.children : DEFAULT_CHILDREN;
const childrenConfig = children ? normalizeConfig(children, defaultConfig, true) : null;
function isMultiline(left, right) {
return left.loc.end.line !== right.loc.start.line;
}
function fixByTrimmingWhitespace(fixer, fromLoc, toLoc, mode, spacing = "") {
let replacementText = context.sourceCode.text.slice(fromLoc, toLoc);
if (mode === "start")
replacementText = replacementText.replace(/^\s+/gm, "");
else
replacementText = replacementText.replace(/\s+$/gm, "");
if (spacing === SPACING.always) {
if (mode === "start")
replacementText += " ";
else
replacementText = ` ${replacementText}`;
}
return fixer.replaceTextRange([fromLoc, toLoc], replacementText);
}
function reportNoBeginningNewline(node, token, spacing) {
context.report({
node,
loc: token.loc.start,
messageId: "noNewlineAfter",
data: {
token: token.value
},
fix(fixer) {
const nextToken = context.sourceCode.getTokenAfter(token);
return fixByTrimmingWhitespace(fixer, token.range[1], nextToken.range[0], "start", spacing);
}
});
}
function reportNoEndingNewline(node, token, spacing) {
context.report({
node,
loc: token.loc.start,
messageId: "noNewlineBefore",
data: {
token: token.value
},
fix(fixer) {
const previousToken = context.sourceCode.getTokenBefore(token);
return fixByTrimmingWhitespace(fixer, previousToken.range[1], token.range[0], "end", spacing);
}
});
}
function reportNoBeginningSpace(node, token) {
context.report({
node,
loc: token.loc.start,
messageId: "noSpaceAfter",
data: {
token: token.value
},
fix(fixer) {
const sourceCode = context.sourceCode;
const nextToken = sourceCode.getTokenAfter(token);
const nextComment = sourceCode.getCommentsAfter(token);
if (nextComment.length > 0)
return fixByTrimmingWhitespace(fixer, token.range[1], Math.min(nextToken.range[0], nextComment[0].range[0]), "start");
return fixByTrimmingWhitespace(fixer, token.range[1], nextToken.range[0], "start");
}
});
}
function reportNoEndingSpace(node, token) {
context.report({
node,
loc: token.loc.start,
messageId: "noSpaceBefore",
data: {
token: token.value
},
fix(fixer) {
const sourceCode = context.sourceCode;
const previousToken = sourceCode.getTokenBefore(token);
const previousComment = sourceCode.getCommentsBefore(token);
if (previousComment.length > 0)
return fixByTrimmingWhitespace(fixer, Math.max(previousToken.range[1], previousComment[0].range[1]), token.range[0], "end");
return fixByTrimmingWhitespace(fixer, previousToken.range[1], token.range[0], "end");
}
});
}
function reportRequiredBeginningSpace(node, token) {
context.report({
node,
loc: token.loc.start,
messageId: "spaceNeededAfter",
data: {
token: token.value
},
fix(fixer) {
return fixer.insertTextAfter(token, " ");
}
});
}
function reportRequiredEndingSpace(node, token) {
context.report({
node,
loc: token.loc.start,
messageId: "spaceNeededBefore",
data: {
token: token.value
},
fix(fixer) {
return fixer.insertTextBefore(token, " ");
}
});
}
function validateBraceSpacing(node) {
let config;
switch (node.parent?.type) {
case "JSXAttribute":
case "JSXOpeningElement":
config = attributesConfig;
break;
case "JSXElement":
case "JSXFragment":
config = childrenConfig;
break;
default:
return;
}
if (config === null)
return;
const sourceCode = context.sourceCode;
const first = sourceCode.getFirstToken(node);
const last = sourceCode.getLastToken(node);
let second = sourceCode.getTokenAfter(first, { includeComments: true });
let penultimate = sourceCode.getTokenBefore(last, { includeComments: true });
if (!second) {
second = sourceCode.getTokenAfter(first);
const leadingComments = sourceCode.getCommentsBefore(second);
second = leadingComments ? leadingComments[0] : second;
}
if (!penultimate) {
penultimate = sourceCode.getTokenBefore(last);
const trailingComments = sourceCode.getCommentsAfter(penultimate);
penultimate = trailingComments ? trailingComments[trailingComments.length - 1] : penultimate;
}
const isObjectLiteral = first.value === second.value;
const spacing = isObjectLiteral ? config.objectLiteralSpaces : config.when;
if (spacing === SPACING.always) {
if (!sourceCode.isSpaceBetweenTokens(first, second))
reportRequiredBeginningSpace(node, first);
else if (!config.allowMultiline && isMultiline(first, second))
reportNoBeginningNewline(node, first, spacing);
if (!sourceCode.isSpaceBetweenTokens(penultimate, last))
reportRequiredEndingSpace(node, last);
else if (!config.allowMultiline && isMultiline(penultimate, last))
reportNoEndingNewline(node, last, spacing);
} else if (spacing === SPACING.never) {
if (isMultiline(first, second)) {
if (!config.allowMultiline)
reportNoBeginningNewline(node, first, spacing);
} else if (sourceCode.isSpaceBetweenTokens(first, second)) {
reportNoBeginningSpace(node, first);
}
if (isMultiline(penultimate, last)) {
if (!config.allowMultiline)
reportNoEndingNewline(node, last, spacing);
} else if (sourceCode.isSpaceBetweenTokens(penultimate, last)) {
reportNoEndingSpace(node, last);
}
}
}
return {
JSXExpressionContainer: validateBraceSpacing,
JSXSpreadAttribute: validateBraceSpacing
};
}
});
module.exports = jsxCurlySpacing;
@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildManagedMetadataFromMaybeManagedMetadata = buildManagedMetadataFromMaybeManagedMetadata;
const ClassElementMetadataKind_1 = require("../models/ClassElementMetadataKind");
const assertMetadataFromTypescriptIfManaged_1 = require("./assertMetadataFromTypescriptIfManaged");
function buildManagedMetadataFromMaybeManagedMetadata(metadata, kind, serviceIdentifier, options) {
(0, assertMetadataFromTypescriptIfManaged_1.assertMetadataFromTypescriptIfManaged)(metadata);
if (kind === ClassElementMetadataKind_1.ClassElementMetadataKind.multipleInjection) {
return {
...metadata,
chained: options?.chained ?? false,
kind,
value: serviceIdentifier,
};
}
else {
return {
...metadata,
kind,
value: serviceIdentifier,
};
}
}
//# sourceMappingURL=buildManagedMetadataFromMaybeManagedMetadata.js.map
@@ -0,0 +1,152 @@
import * as React from 'react';
import { RouterProviderProps as RouterProviderProps$1, RouterInit, unstable_ClientOnErrorFunction } from 'react-router';
import { u as unstable_ClientInstrumentation } from './instrumentation-iAqbU5Q4.js';
export { D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, R as unstable_RSCHydratedRouter, d as unstable_RSCManifestPayload, e as unstable_RSCPayload, f as unstable_RSCRenderPayload, c as unstable_createCallServer } from './browser-DM83uryY.js';
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
/**
* Props for the {@link dom.HydratedRouter} component.
*
* @category Types
*/
interface HydratedRouterProps {
/**
* Context factory function to be passed through to {@link createBrowserRouter}.
* This function will be called to create a fresh `context` instance on each
* navigation/fetch and made available to
* [`clientAction`](../../start/framework/route-module#clientAction)/[`clientLoader`](../../start/framework/route-module#clientLoader)
* functions.
*/
getContext?: RouterInit["getContext"];
/**
* Array of instrumentation objects allowing you to instrument the router and
* individual routes prior to router initialization (and on any subsequently
* added routes via `route.lazy` or `patchRoutesOnNavigation`). This is
* mostly useful for observability such as wrapping navigations, fetches,
* as well as route loaders/actions/middlewares with logging and/or performance
* tracing.
*
* ```tsx
* startTransition(() => {
* hydrateRoot(
* document,
* <HydratedRouter unstable_instrumentations={[logging]} />
* );
* });
*
* const logging = {
* router({ instrument }) {
* instrument({
* navigate: (impl, { to }) => logExecution(`navigate ${to}`, impl),
* fetch: (impl, { to }) => logExecution(`fetch ${to}`, impl)
* });
* },
* route({ instrument, id }) {
* instrument({
* middleware: (impl, { request }) => logExecution(
* `middleware ${request.url} (route ${id})`,
* impl
* ),
* loader: (impl, { request }) => logExecution(
* `loader ${request.url} (route ${id})`,
* impl
* ),
* action: (impl, { request }) => logExecution(
* `action ${request.url} (route ${id})`,
* impl
* ),
* })
* }
* };
*
* async function logExecution(label: string, impl: () => Promise<void>) {
* let start = performance.now();
* console.log(`start ${label}`);
* await impl();
* let duration = Math.round(performance.now() - start);
* console.log(`end ${label} (${duration}ms)`);
* }
* ```
*/
unstable_instrumentations?: unstable_ClientInstrumentation[];
/**
* An error handler function that will be called for any loader/action/render
* errors that are encountered in your application. This is useful for
* logging or reporting errors instead of the `ErrorBoundary` because it's not
* subject to re-rendering and will only run one time per error.
*
* The `errorInfo` parameter is passed along from
* [`componentDidCatch`](https://react.dev/reference/react/Component#componentdidcatch)
* and is only present for render errors.
*
* ```tsx
* <HydratedRouter unstable_onError={(error, errorInfo) => {
* console.error(error, errorInfo);
* reportToErrorService(error, errorInfo);
* }} />
* ```
*/
unstable_onError?: unstable_ClientOnErrorFunction;
}
/**
* Framework-mode router component to be used to hydrate a router from a
* {@link ServerRouter}. See [`entry.client.tsx`](../framework-conventions/entry.client.tsx).
*
* @public
* @category Framework Routers
* @mode framework
* @param props Props
* @param {dom.HydratedRouterProps.getContext} props.getContext n/a
* @param {dom.HydratedRouterProps.unstable_onError} props.unstable_onError n/a
* @returns A React element that represents the hydrated application.
*/
declare function HydratedRouter(props: HydratedRouterProps): React.JSX.Element;
declare global {
interface Window {
__FLIGHT_DATA: any[];
}
}
/**
* Get the prerendered [RSC](https://react.dev/reference/rsc/server-components)
* stream for hydration. Usually passed directly to your
* `react-server-dom-xyz/client`'s `createFromReadableStream`.
*
* @example
* import { startTransition, StrictMode } from "react";
* import { hydrateRoot } from "react-dom/client";
* import {
* unstable_getRSCStream as getRSCStream,
* unstable_RSCHydratedRouter as RSCHydratedRouter,
* } from "react-router";
* import type { unstable_RSCPayload as RSCPayload } from "react-router";
*
* createFromReadableStream(getRSCStream()).then(
* (payload: RSCServerPayload) => {
* startTransition(async () => {
* hydrateRoot(
* document,
* <StrictMode>
* <RSCHydratedRouter {...props} />
* </StrictMode>,
* {
* // Options
* }
* );
* });
* }
* );
*
* @name unstable_getRSCStream
* @public
* @category RSC
* @mode data
* @returns A [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream)
* that contains the [RSC](https://react.dev/reference/rsc/server-components)
* data for hydration.
*/
declare function getRSCStream(): ReadableStream;
export { HydratedRouter, type HydratedRouterProps, RouterProvider, type RouterProviderProps, getRSCStream as unstable_getRSCStream };
@@ -0,0 +1,37 @@
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
HOT_SPAN = 16;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeNow = Date.now;
/**
* Creates a function that'll short out and invoke `identity` instead
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
* milliseconds.
*
* @private
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new shortable function.
*/
function shortOut(func) {
var count = 0,
lastCalled = 0;
return function() {
var stamp = nativeNow(),
remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count >= HOT_COUNT) {
return arguments[0];
}
} else {
count = 0;
}
return func.apply(undefined, arguments);
};
}
module.exports = shortOut;
@@ -0,0 +1,824 @@
export default `flf2a$ 8 7 20 -1 6
Katakana.flf by Vinney Thai <ssfiit@eris.cs.umb.edu> Date: August 11, 1994
based on Banner by Ryan Youck <youck@cs.uregina.ca>
a-A i-B u-C e-D o-E ka-F ki-G ku-H ke-I ko-J sa-K shi-L su-M se-N so-O ta-P
chi-Q tsu-R te-S to-T na-U ni-V nu-W ne-X no-Y ha-Z hi-a fu-b he-c ho-d ma-e
mi-f mu-g me-h mo-i ya-j yu-k e-l yo-m ra-n ri-o ru-p re-q ro-r wa-s i-t wo-u
n-v
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@@
###$@
###$@
###$@
# $@
$@
###$@
###$@
$@@
### ###$@
### ###$@
# # $@
$ $@
$ $@
$@
$@
$@@
# # $@
# # $@
#######$@
# # $@
#######$@
# # $@
# # $@
$@@
##### $@
# # #$@
# # $@
##### $@
# #$@
# # #$@
##### $@
$@@
### #$@
# # # $@
### # $@
# $@
# ###$@
# # #$@
# ###$@
$@@
## $@
# # $@
## $@
### $@
# # #$@
# # $@
### #$@
$@@
###$@
###$@
# $@
# $@
$@
$@
$@
$@@
##$@
# $@
# $@
# $@
# $@
# $@
##$@
$@@
## $@
# $@
#$@
#$@
#$@
# $@
## $@
$@@
$@
# # $@
# # $@
#######$@
# # $@
# # $@
$@
$@@
$@
# $@
# $@
#####$@
# $@
# $@
$@
$@@
$@
$@
$@
$@
###$@
###$@
# $@
# $@@
$@
$@
$@
#####$@
$@
$@
$@
$@@
$@
$@
$@
$@
###$@
###$@
###$@
$@@
#$@
# $@
# $@
# $@
# $@
# $@
# $@
$@@
### $@
# # $@
# #$@
# #$@
# #$@
# # $@
### $@
$@@
# $@
## $@
# # $@
# $@
# $@
# $@
#####$@
$@@
##### $@
# #$@
#$@
##### $@
# $@
# $@
#######$@
$@@
##### $@
# #$@
#$@
##### $@
#$@
# #$@
##### $@
$@@
# $@
# # $@
# # $@
# # $@
#######$@
# $@
# $@
$@@
#######$@
# $@
# $@
###### $@
#$@
# #$@
##### $@
$@@
##### $@
# #$@
# $@
###### $@
# #$@
# #$@
##### $@
$@@
#######$@
# # $@
# $@
# $@
# $@
# $@
# $@
$@@
##### $@
# #$@
# #$@
##### $@
# #$@
# #$@
##### $@
$@@
##### $@
# #$@
# #$@
######$@
#$@
# #$@
##### $@
$@@
# $@
###$@
# $@
$@
# $@
###$@
# $@
$@@
$@
###$@
###$@
$@
###$@
###$@
# $@
# $@@
#$@
# $@
# $@
# $@
# $@
# $@
#$@
$@@
$@
$@
#####$@
$@
#####$@
$@
$@
$@@
# $@
# $@
# $@
#$@
# $@
# $@
# $@
$@@
##### $@
# #$@
#$@
### $@
# $@
$@
# $@
$@@
##### $@
# #$@
# ### #$@
# ### #$@
# #### $@
# $@
##### $@
$@@
##########$@
### $@
# $@
# $@
# $@
# $@
# $@
$@@
##$@
## $@
## # $@
## # $@
# $@
# $@
# $@
$@@
# $@
##########$@
# #$@
## $@
## $@
## $@
## $@
$@@
$@
####### $@
# $@
# $@
# $@
# $@
##########$@
$@@
# $@
##########$@
## $@
## # $@
## # $@
## ## $@
# $@
$@@
# $@
##########$@
# #$@
# #$@
# #$@
# # # $@
# # $@
$@@
# # $@
# # $@
# # # $@
# $@
# # $@
# # $@
#$@
$@@
# $@
########$@
# #$@
# ## $@
## $@
## $@
## $@
$@@
# $@
########$@
# # $@
# # $@
# $@
# $@
# $@
$@@
$@
##########$@
#$@
#$@
#$@
#$@
######### $@
$@@
# # $@
##########$@
# # $@
# $@
# $@
# $@
# $@
$@@
# #$@
# # # $@
# # $@
## $@
## $@
## $@
## $@
$@@
########$@
#$@
# $@
## $@
## # $@
## # $@
# #$@
$@@
# $@
# $@
##########$@
# # $@
# $@
# $@
###### $@
$@@
# #$@
# #$@
# $@
# $@
## $@
## $@
## $@
$@@
# $@
#######$@
# # $@
# # # $@
### $@
## $@
## $@
$@@
## $@
###### $@
# $@
##########$@
# $@
# $@
## $@
$@@
# # #$@
# # #$@
# $@
# $@
## $@
## $@
## $@
$@@
###### $@
$@
##########$@
# $@
# $@
# $@
## $@
$@@
# $@
# $@
## $@
# # $@
# #$@
# $@
# $@
$@@
# $@
##########$@
# $@
# $@
# $@
# $@
## $@
$@@
$@
$@
###### $@
$@
$@
##########$@
$@
$@@
##########$@
#$@
# # $@
# ## $@
## $@
## # $@
## # $@
$@@
# $@
##########$@
# $@
### $@
###### $@
## # ##$@
# $@
$@@
#$@
#$@
# $@
# $@
## $@
## $@
## $@
$@@
$@
$@
# # $@
# # $@
# #$@
# $@
$@
$@@
#####$@
# $@
# $@
# $@
# $@
# $@
#####$@
$@@
# $@
# $@
# $@
# $@
# $@
# $@
#$@
$@@
#####$@
#$@
#$@
#$@
#$@
#$@
#####$@
$@@
# $@
# # $@
# #$@
$@
$@
$@
$@
$@@
$@
$@
$@
$@
$@
$@
$@
#######$@@
###$@
###$@
# $@
#$@
$@
$@
$@
$@@
# $@
# ### $@
#### $@
# $@
# $@
# $@
#######$@
$@@
########$@
#$@
#$@
# $@
## $@
## $@
## $@
$@@
$@
$@
## $@
# ## $@
# ## $@
##$@
$@
$@@
# $@
##########$@
# $@
# # # $@
# # # $@
# ## #$@
# $@
$@@
$@
##########$@
# $@
# $@
# # $@
# $@
# $@
$@@
#### $@
##$@
### $@
###$@
$@
### $@
###$@
$@@
# $@
# $@
# $@
# $@
# # $@
######### $@
#$@
$@@
#$@
# $@
# # $@
# # $@
# $@
## # $@
## # $@
$@@
###### $@
# $@
##########$@
# $@
# $@
# $@
#### $@
$@@
# ## $@
# ## # $@
### $@
# # $@
# $@
# $@
# $@
$@@
$@
###### $@
# $@
# $@
# $@
##########$@
$@
$@@
$@
###### $@
# $@
# $@
# $@
##########$@
$@
$@@
#########$@
#$@
#$@
######## $@
# $@
# $@
######## $@
$@@
###### $@
$@
##########$@
# #$@
## $@
## $@
## $@
$@@
# #$@
# #$@
# #$@
# #$@
# $@
# $@
## $@
$@@
# # $@
# # $@
# # $@
# # #$@
# # # $@
# # # $@
# ## $@
$@@
# $@
# $@
# $@
# ##$@
# ## $@
# ## $@
## $@
$@@
$@
#########$@
# #$@
# #$@
# #$@
#########$@
$@
$@@
##########$@
# #$@
# $@
# $@
# $@
## $@
## $@
$@@
# $@
####### $@
# # $@
# # $@
##########$@
# $@
# $@
$@@
##########$@
#$@
# $@
######## $@
## $@
## $@
## $@
$@@
#$@
# #$@
# # $@
# $@
## $@
## $@
## $@
$@@
$@
$@
$@
$@
$@
$@
$@
$@@
$@
$@
$@
$@
$@
$@
$@
$@@
$@
$@
$@
$@
$@
$@
$@
$@@
$@
$@
$@
$@
$@
$@
$@
$@@
###$@
# $@
# $@
## $@
# $@
# $@
###$@
$@@
#$@
#$@
#$@
$@
#$@
#$@
#$@
$@@
### $@
# $@
# $@
##$@
# $@
# $@
### $@
$@@
## $@
# # #$@
## $@
$@
$@
$@
$@
$@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,9 @@
import { Newable } from '@inversifyjs/common';
import { InjectFromOptionsLifecycle } from './InjectFromOptionsLifecycle';
export interface InjectFromOptions {
extendConstructorArguments?: boolean | undefined;
extendProperties?: boolean | undefined;
lifecycle?: InjectFromOptionsLifecycle | undefined;
type: Newable;
}
//# sourceMappingURL=InjectFromOptions.d.ts.map
@@ -0,0 +1,2 @@
// @generated from regex-gen.ts
export var S_UNICODE_REGEX = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEE0-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF73\uDF80-\uDFD8\uDFE0-\uDFEB]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDD78\uDD7A-\uDDCB\uDDCD-\uDE53\uDE60-\uDE6D\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6\uDF00-\uDF92\uDF94-\uDFCA]/;
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more