docs: 仓库链接指向本镜像仓库
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s

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,34 @@
{
"name": "caniuse-lite",
"version": "1.0.30001754",
"description": "A smaller version of caniuse-db, with only the essentials!",
"main": "dist/unpacker/index.js",
"files": [
"data",
"dist"
],
"keywords": [
"support"
],
"author": {
"name": "Ben Briggs",
"email": "beneb.info@gmail.com",
"url": "http://beneb.info"
},
"repository": "browserslist/caniuse-lite",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "CC-BY-4.0"
}
@@ -0,0 +1,341 @@
<h1 align="center">
<br>
<br>
<img width="320" src="media/logo.svg" alt="Chalk">
<br>
<br>
<br>
</h1>
> Terminal string styling done right
[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) [![run on repl.it](https://repl.it/badge/github/chalk/chalk)](https://repl.it/github/chalk/chalk)
<img src="https://cdn.jsdelivr.net/gh/chalk/ansi-styles@8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
<br>
---
<div align="center">
<p>
<p>
<sup>
Sindre Sorhus' open source work is supported by the community on <a href="https://github.com/sponsors/sindresorhus">GitHub Sponsors</a> and <a href="https://stakes.social/0x44d871aebF0126Bf646753E2C976Aa7e68A66c15">Dev</a>
</sup>
</p>
<sup>Special thanks to:</sup>
<br>
<br>
<a href="https://standardresume.co/tech">
<img src="https://sindresorhus.com/assets/thanks/standard-resume-logo.svg" width="160"/>
</a>
<br>
<br>
<a href="https://retool.com/?utm_campaign=sindresorhus">
<img src="https://sindresorhus.com/assets/thanks/retool-logo.svg" width="230"/>
</a>
<br>
<br>
<a href="https://doppler.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=chalk&utm_source=github">
<div>
<img src="https://dashboard.doppler.com/imgs/logo-long.svg" width="240" alt="Doppler">
</div>
<b>All your environment variables, in one place</b>
<div>
<span>Stop struggling with scattered API keys, hacking together home-brewed tools,</span>
<br>
<span>and avoiding access controls. Keep your team and servers in sync with Doppler.</span>
</div>
</a>
<br>
<a href="https://uibakery.io/?utm_source=chalk&utm_medium=sponsor&utm_campaign=github">
<div>
<img src="https://sindresorhus.com/assets/thanks/uibakery-logo.jpg" width="270" alt="UI Bakery">
</div>
</a>
</p>
</div>
---
<br>
## Highlights
- Expressive API
- Highly performant
- Ability to nest styles
- [256/Truecolor color support](#256-and-truecolor-color-support)
- Auto-detects color support
- Doesn't extend `String.prototype`
- Clean and focused
- Actively maintained
- [Used by ~50,000 packages](https://www.npmjs.com/browse/depended/chalk) as of January 1, 2020
## Install
```console
$ npm install chalk
```
## Usage
```js
const chalk = require('chalk');
console.log(chalk.blue('Hello world!'));
```
Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
```js
const chalk = require('chalk');
const log = console.log;
// Combine styled and normal strings
log(chalk.blue('Hello') + ' World' + chalk.red('!'));
// Compose multiple styles using the chainable API
log(chalk.blue.bgRed.bold('Hello world!'));
// Pass in multiple arguments
log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'));
// Nest styles
log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));
// Nest styles of the same type even (color, underline, background)
log(chalk.green(
'I am a green line ' +
chalk.blue.underline.bold('with a blue substring') +
' that becomes green again!'
));
// ES2015 template literal
log(`
CPU: ${chalk.red('90%')}
RAM: ${chalk.green('40%')}
DISK: ${chalk.yellow('70%')}
`);
// ES2015 tagged template literal
log(chalk`
CPU: {red ${cpu.totalPercent}%}
RAM: {green ${ram.used / ram.total * 100}%}
DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
`);
// Use RGB colors in terminal emulators that support it.
log(chalk.keyword('orange')('Yay for orange colored text!'));
log(chalk.rgb(123, 45, 67).underline('Underlined reddish color'));
log(chalk.hex('#DEADED').bold('Bold gray!'));
```
Easily define your own themes:
```js
const chalk = require('chalk');
const error = chalk.bold.red;
const warning = chalk.keyword('orange');
console.log(error('Error!'));
console.log(warning('Warning!'));
```
Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args):
```js
const name = 'Sindre';
console.log(chalk.green('Hello %s'), name);
//=> 'Hello Sindre'
```
## API
### chalk.`<style>[.<style>...](string, [string...])`
Example: `chalk.red.bold.underline('Hello', 'world');`
Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
Multiple arguments will be separated by space.
### chalk.level
Specifies the level of color support.
Color support is automatically detected, but you can override it by setting the `level` property. You should however only do this in your own code as it applies globally to all Chalk consumers.
If you need to change this in a reusable module, create a new instance:
```js
const ctx = new chalk.Instance({level: 0});
```
| Level | Description |
| :---: | :--- |
| `0` | All colors disabled |
| `1` | Basic color support (16 colors) |
| `2` | 256 color support |
| `3` | Truecolor support (16 million colors) |
### chalk.supportsColor
Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
### chalk.stderr and chalk.stderr.supportsColor
`chalk.stderr` contains a separate instance configured with color support detected for `stderr` stream instead of `stdout`. Override rules from `chalk.supportsColor` apply to this too. `chalk.stderr.supportsColor` is exposed for convenience.
## Styles
### Modifiers
- `reset` - Resets the current color chain.
- `bold` - Make text bold.
- `dim` - Emitting only a small amount of light.
- `italic` - Make text italic. *(Not widely supported)*
- `underline` - Make text underline. *(Not widely supported)*
- `inverse`- Inverse background and foreground colors.
- `hidden` - Prints the text, but makes it invisible.
- `strikethrough` - Puts a horizontal line through the center of the text. *(Not widely supported)*
- `visible`- Prints the text only when Chalk has a color level > 0. Can be useful for things that are purely cosmetic.
### Colors
- `black`
- `red`
- `green`
- `yellow`
- `blue`
- `magenta`
- `cyan`
- `white`
- `blackBright` (alias: `gray`, `grey`)
- `redBright`
- `greenBright`
- `yellowBright`
- `blueBright`
- `magentaBright`
- `cyanBright`
- `whiteBright`
### Background colors
- `bgBlack`
- `bgRed`
- `bgGreen`
- `bgYellow`
- `bgBlue`
- `bgMagenta`
- `bgCyan`
- `bgWhite`
- `bgBlackBright` (alias: `bgGray`, `bgGrey`)
- `bgRedBright`
- `bgGreenBright`
- `bgYellowBright`
- `bgBlueBright`
- `bgMagentaBright`
- `bgCyanBright`
- `bgWhiteBright`
## Tagged template literal
Chalk can be used as a [tagged template literal](https://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).
```js
const chalk = require('chalk');
const miles = 18;
const calculateFeet = miles => miles * 5280;
console.log(chalk`
There are {bold 5280 feet} in a mile.
In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}.
`);
```
Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`).
Template styles are chained exactly like normal Chalk styles. The following three statements are equivalent:
```js
console.log(chalk.bold.rgb(10, 100, 200)('Hello!'));
console.log(chalk.bold.rgb(10, 100, 200)`Hello!`);
console.log(chalk`{bold.rgb(10,100,200) Hello!}`);
```
Note that function styles (`rgb()`, `hsl()`, `keyword()`, etc.) may not contain spaces between parameters.
All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped.
## 256 and Truecolor color support
Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps.
Colors are downsampled from 16 million RGB values to an ANSI color format that is supported by the terminal emulator (or by specifying `{level: n}` as a Chalk option). For example, Chalk configured to run at level 1 (basic color support) will downsample an RGB value of #FF0000 (red) to 31 (ANSI escape for red).
Examples:
- `chalk.hex('#DEADED').underline('Hello, world!')`
- `chalk.keyword('orange')('Some orange text')`
- `chalk.rgb(15, 100, 204).inverse('Hello!')`
Background versions of these models are prefixed with `bg` and the first level of the module capitalized (e.g. `keyword` for foreground colors and `bgKeyword` for background colors).
- `chalk.bgHex('#DEADED').underline('Hello, world!')`
- `chalk.bgKeyword('orange')('Some orange text')`
- `chalk.bgRgb(15, 100, 204).inverse('Hello!')`
The following color models can be used:
- [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')`
- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
- [`keyword`](https://www.w3.org/wiki/CSS/Properties/color/keywords) (CSS keywords) - Example: `chalk.keyword('orange').bold('Orange!')`
- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')`
- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')`
- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')`
- [`ansi`](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) - Example: `chalk.ansi(31).bgAnsi(93)('red on yellowBright')`
- [`ansi256`](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) - Example: `chalk.bgAnsi256(194)('Honeydew, more or less')`
## Windows
If you're on Windows, do yourself a favor and use [Windows Terminal](https://github.com/microsoft/terminal) instead of `cmd.exe`.
## Origin story
[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.
## chalk for enterprise
Available as part of the Tidelift Subscription.
The maintainers of chalk and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-chalk?utm_source=npm-chalk&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
## Related
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Strip ANSI escape codes from a stream
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
- [color-convert](https://github.com/qix-/color-convert) - Converts colors between different models
- [chalk-animation](https://github.com/bokub/chalk-animation) - Animate strings in the terminal
- [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings
- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)
@@ -0,0 +1,53 @@
# path-dirname [![Build Status](https://travis-ci.org/es128/path-dirname.svg?branch=master)](https://travis-ci.org/es128/path-dirname)
> Node.js [`path.dirname()`](https://nodejs.org/api/path.html#path_path_dirname_path) [ponyfill](https://ponyfill.com)
This was needed in order to expose `path.posix.dirname()` on Node.js v0.10
## Install
```
$ npm install --save path-dirname
```
## Usage
```js
const pathDirname = require('path-dirname');
pathDirname('/home/foo');
//=> '/home'
pathDirname('C:\\Users\\foo');
//=> 'C:\\Users'
pathDirname('foo');
//=> '.'
pathDirname('foo/bar');
//=> 'foo'
//Using posix version for consistent output when dealing with glob escape chars
pathDirname.win32('C:\\Users\\foo/\\*bar');
//=> 'C:\\Users\\foo/'
pathDirname.posix('C:\\Users\\foo/\\*bar');
//=> 'C:\\Users\\foo'
```
## API
See the [`path.dirname()` docs](https://nodejs.org/api/path.html#path_path_dirname_path).
### pathDirname(path)
### pathDirname.posix(path)
POSIX specific version.
### pathDirname.win32(path)
Windows specific version.
## License
MIT
@@ -0,0 +1,20 @@
import coreJsData from './_coreJsData.js';
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
export default isMasked;
@@ -0,0 +1,14 @@
import { Right } from '@inversifyjs/common';
import { Binding } from '../../binding/models/Binding';
import { bindingScopeValues } from '../../binding/models/BindingScope';
import { BindingType } from '../../binding/models/BindingType';
import { ScopedBinding } from '../../binding/models/ScopedBinding';
import { DeactivationParams } from '../models/DeactivationParams';
import { Resolved } from '../models/Resolved';
declare const CACHE_KEY_TYPE: keyof ScopedBinding<BindingType, typeof bindingScopeValues.Singleton, unknown>;
type CachedSingletonScopedBinding<TResolved> = Binding & ScopedBinding<BindingType, typeof bindingScopeValues.Singleton, TResolved> & {
[CACHE_KEY_TYPE]: Right<Resolved<TResolved>>;
};
export declare function resolveBindingPreDestroy<TResolved>(params: DeactivationParams, binding: CachedSingletonScopedBinding<TResolved>): void | Promise<void>;
export {};
//# sourceMappingURL=resolveBindingPreDestroy.d.ts.map
@@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright (C) 2014 Wei Fanzhe
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,13 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const baseLogFactory = require("base-log-factory");
const colors = {
[baseLogFactory.Level.FATAL]: "magenta",
[baseLogFactory.Level.ERROR]: "red",
[baseLogFactory.Level.WARN]: "yellow",
[baseLogFactory.Level.INFO]: "green",
[baseLogFactory.Level.DEBUG]: "cyan",
[baseLogFactory.Level.TRACE]: "blue",
[baseLogFactory.Level.OFF]: "reset"
};
exports.colors = colors;
@@ -0,0 +1,21 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes } from "@peculiar/asn1-schema";
import { AttrSpec } from "./attr_spec";
export class AAControls {
constructor(params = {}) {
this.permitUnSpecified = true;
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.Integer, optional: true })
], AAControls.prototype, "pathLenConstraint", void 0);
__decorate([
AsnProp({ type: AttrSpec, implicit: true, context: 0, optional: true })
], AAControls.prototype, "permittedAttrs", void 0);
__decorate([
AsnProp({ type: AttrSpec, implicit: true, context: 1, optional: true })
], AAControls.prototype, "excludedAttrs", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Boolean, defaultValue: true })
], AAControls.prototype, "permitUnSpecified", void 0);
@@ -0,0 +1,53 @@
import {decodeNamedCharacterReference} from 'decode-named-character-reference'
import {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'
import {codes, constants} from 'micromark-util-symbol'
const characterEscapeOrReference =
/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi
/**
* Decode markdown strings (which occur in places such as fenced code info
* strings, destinations, labels, and titles).
*
* The “string” content type allows character escapes and -references.
* This decodes those.
*
* @param {string} value
* Value to decode.
* @returns {string}
* Decoded value.
*/
export function decodeString(value) {
return value.replace(characterEscapeOrReference, decode)
}
/**
* @param {string} $0
* Match.
* @param {string} $1
* Character escape.
* @param {string} $2
* Character reference.
* @returns {string}
* Decoded value
*/
function decode($0, $1, $2) {
if ($1) {
// Escape.
return $1
}
// Reference.
const head = $2.charCodeAt(0)
if (head === codes.numberSign) {
const head = $2.charCodeAt(1)
const hex = head === codes.lowercaseX || head === codes.uppercaseX
return decodeNumericCharacterReference(
$2.slice(hex ? 2 : 1),
hex ? constants.numericBaseHexadecimal : constants.numericBaseDecimal
)
}
return decodeNamedCharacterReference($2) || $0
}
@@ -0,0 +1,662 @@
import { TransformEncode, TransformDecode, HasTransform, TransformDecodeCheckError, TransformEncodeCheckError } from '../value/transform/index.mjs';
import { Errors } from '../errors/index.mjs';
import { TypeSystemPolicy } from '../system/index.mjs';
import { TypeBoxError } from '../type/error/index.mjs';
import { Deref } from '../value/deref/index.mjs';
import { Hash } from '../value/hash/index.mjs';
import { Kind } from '../type/symbols/index.mjs';
import { TypeRegistry, FormatRegistry } from '../type/registry/index.mjs';
import { KeyOfPattern } from '../type/keyof/index.mjs';
import { ExtendsUndefinedCheck } from '../type/extends/extends-undefined.mjs';
import { Never } from '../type/never/index.mjs';
import { Ref } from '../type/ref/index.mjs';
// ------------------------------------------------------------------
// ValueGuard
// ------------------------------------------------------------------
import { IsArray, IsString, IsNumber, IsBigInt } from '../value/guard/index.mjs';
// ------------------------------------------------------------------
// TypeGuard
// ------------------------------------------------------------------
import { IsSchema } from '../type/guard/type.mjs';
// ------------------------------------------------------------------
// TypeCheck
// ------------------------------------------------------------------
export class TypeCheck {
constructor(schema, references, checkFunc, code) {
this.schema = schema;
this.references = references;
this.checkFunc = checkFunc;
this.code = code;
this.hasTransform = HasTransform(schema, references);
}
/** Returns the generated assertion code used to validate this type. */
Code() {
return this.code;
}
/** Returns the schema type used to validate */
Schema() {
return this.schema;
}
/** Returns reference types used to validate */
References() {
return this.references;
}
/** Returns an iterator for each error in this value. */
Errors(value) {
return Errors(this.schema, this.references, value);
}
/** Returns true if the value matches the compiled type. */
Check(value) {
return this.checkFunc(value);
}
/** Decodes a value or throws if error */
Decode(value) {
if (!this.checkFunc(value))
throw new TransformDecodeCheckError(this.schema, value, this.Errors(value).First());
return (this.hasTransform ? TransformDecode(this.schema, this.references, value) : value);
}
/** Encodes a value or throws if error */
Encode(value) {
const encoded = this.hasTransform ? TransformEncode(this.schema, this.references, value) : value;
if (!this.checkFunc(encoded))
throw new TransformEncodeCheckError(this.schema, value, this.Errors(value).First());
return encoded;
}
}
// ------------------------------------------------------------------
// Character
// ------------------------------------------------------------------
var Character;
(function (Character) {
function DollarSign(code) {
return code === 36;
}
Character.DollarSign = DollarSign;
function IsUnderscore(code) {
return code === 95;
}
Character.IsUnderscore = IsUnderscore;
function IsAlpha(code) {
return (code >= 65 && code <= 90) || (code >= 97 && code <= 122);
}
Character.IsAlpha = IsAlpha;
function IsNumeric(code) {
return code >= 48 && code <= 57;
}
Character.IsNumeric = IsNumeric;
})(Character || (Character = {}));
// ------------------------------------------------------------------
// MemberExpression
// ------------------------------------------------------------------
var MemberExpression;
(function (MemberExpression) {
function IsFirstCharacterNumeric(value) {
if (value.length === 0)
return false;
return Character.IsNumeric(value.charCodeAt(0));
}
function IsAccessor(value) {
if (IsFirstCharacterNumeric(value))
return false;
for (let i = 0; i < value.length; i++) {
const code = value.charCodeAt(i);
const check = Character.IsAlpha(code) || Character.IsNumeric(code) || Character.DollarSign(code) || Character.IsUnderscore(code);
if (!check)
return false;
}
return true;
}
function EscapeHyphen(key) {
return key.replace(/'/g, "\\'");
}
function Encode(object, key) {
return IsAccessor(key) ? `${object}.${key}` : `${object}['${EscapeHyphen(key)}']`;
}
MemberExpression.Encode = Encode;
})(MemberExpression || (MemberExpression = {}));
// ------------------------------------------------------------------
// Identifier
// ------------------------------------------------------------------
var Identifier;
(function (Identifier) {
function Encode($id) {
const buffer = [];
for (let i = 0; i < $id.length; i++) {
const code = $id.charCodeAt(i);
if (Character.IsNumeric(code) || Character.IsAlpha(code)) {
buffer.push($id.charAt(i));
}
else {
buffer.push(`_${code}_`);
}
}
return buffer.join('').replace(/__/g, '_');
}
Identifier.Encode = Encode;
})(Identifier || (Identifier = {}));
// ------------------------------------------------------------------
// LiteralString
// ------------------------------------------------------------------
var LiteralString;
(function (LiteralString) {
function Escape(content) {
return content.replace(/'/g, "\\'");
}
LiteralString.Escape = Escape;
})(LiteralString || (LiteralString = {}));
// ------------------------------------------------------------------
// Errors
// ------------------------------------------------------------------
export class TypeCompilerUnknownTypeError extends TypeBoxError {
constructor(schema) {
super('Unknown type');
this.schema = schema;
}
}
export class TypeCompilerTypeGuardError extends TypeBoxError {
constructor(schema) {
super('Preflight validation check failed to guard for the given schema');
this.schema = schema;
}
}
// ------------------------------------------------------------------
// Policy
// ------------------------------------------------------------------
export var Policy;
(function (Policy) {
function IsExactOptionalProperty(value, key, expression) {
return TypeSystemPolicy.ExactOptionalPropertyTypes ? `('${key}' in ${value} ? ${expression} : true)` : `(${MemberExpression.Encode(value, key)} !== undefined ? ${expression} : true)`;
}
Policy.IsExactOptionalProperty = IsExactOptionalProperty;
function IsObjectLike(value) {
return !TypeSystemPolicy.AllowArrayObject ? `(typeof ${value} === 'object' && ${value} !== null && !Array.isArray(${value}))` : `(typeof ${value} === 'object' && ${value} !== null)`;
}
Policy.IsObjectLike = IsObjectLike;
function IsRecordLike(value) {
return !TypeSystemPolicy.AllowArrayObject
? `(typeof ${value} === 'object' && ${value} !== null && !Array.isArray(${value}) && !(${value} instanceof Date) && !(${value} instanceof Uint8Array))`
: `(typeof ${value} === 'object' && ${value} !== null && !(${value} instanceof Date) && !(${value} instanceof Uint8Array))`;
}
Policy.IsRecordLike = IsRecordLike;
function IsNumberLike(value) {
return TypeSystemPolicy.AllowNaN ? `typeof ${value} === 'number'` : `Number.isFinite(${value})`;
}
Policy.IsNumberLike = IsNumberLike;
function IsVoidLike(value) {
return TypeSystemPolicy.AllowNullVoid ? `(${value} === undefined || ${value} === null)` : `${value} === undefined`;
}
Policy.IsVoidLike = IsVoidLike;
})(Policy || (Policy = {}));
/** Compiles Types for Runtime Type Checking */
export var TypeCompiler;
(function (TypeCompiler) {
// ----------------------------------------------------------------
// Guards
// ----------------------------------------------------------------
function IsAnyOrUnknown(schema) {
return schema[Kind] === 'Any' || schema[Kind] === 'Unknown';
}
// ----------------------------------------------------------------
// Types
// ----------------------------------------------------------------
function* FromAny(schema, references, value) {
yield 'true';
}
function* FromArgument(schema, references, value) {
yield 'true';
}
function* FromArray(schema, references, value) {
yield `Array.isArray(${value})`;
const [parameter, accumulator] = [CreateParameter('value', 'any'), CreateParameter('acc', 'number')];
if (IsNumber(schema.maxItems))
yield `${value}.length <= ${schema.maxItems}`;
if (IsNumber(schema.minItems))
yield `${value}.length >= ${schema.minItems}`;
const elementExpression = CreateExpression(schema.items, references, 'value');
yield `${value}.every((${parameter}) => ${elementExpression})`;
if (IsSchema(schema.contains) || IsNumber(schema.minContains) || IsNumber(schema.maxContains)) {
const containsSchema = IsSchema(schema.contains) ? schema.contains : Never();
const checkExpression = CreateExpression(containsSchema, references, 'value');
const checkMinContains = IsNumber(schema.minContains) ? [`(count >= ${schema.minContains})`] : [];
const checkMaxContains = IsNumber(schema.maxContains) ? [`(count <= ${schema.maxContains})`] : [];
const checkCount = `const count = value.reduce((${accumulator}, ${parameter}) => ${checkExpression} ? acc + 1 : acc, 0)`;
const check = [`(count > 0)`, ...checkMinContains, ...checkMaxContains].join(' && ');
yield `((${parameter}) => { ${checkCount}; return ${check}})(${value})`;
}
if (schema.uniqueItems === true) {
const check = `const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true`;
const block = `const set = new Set(); for(const element of value) { ${check} }`;
yield `((${parameter}) => { ${block} )(${value})`;
}
}
function* FromAsyncIterator(schema, references, value) {
yield `(typeof value === 'object' && Symbol.asyncIterator in ${value})`;
}
function* FromBigInt(schema, references, value) {
yield `(typeof ${value} === 'bigint')`;
if (IsBigInt(schema.exclusiveMaximum))
yield `${value} < BigInt(${schema.exclusiveMaximum})`;
if (IsBigInt(schema.exclusiveMinimum))
yield `${value} > BigInt(${schema.exclusiveMinimum})`;
if (IsBigInt(schema.maximum))
yield `${value} <= BigInt(${schema.maximum})`;
if (IsBigInt(schema.minimum))
yield `${value} >= BigInt(${schema.minimum})`;
if (IsBigInt(schema.multipleOf))
yield `(${value} % BigInt(${schema.multipleOf})) === 0`;
}
function* FromBoolean(schema, references, value) {
yield `(typeof ${value} === 'boolean')`;
}
function* FromConstructor(schema, references, value) {
yield* Visit(schema.returns, references, `${value}.prototype`);
}
function* FromDate(schema, references, value) {
yield `(${value} instanceof Date) && Number.isFinite(${value}.getTime())`;
if (IsNumber(schema.exclusiveMaximumTimestamp))
yield `${value}.getTime() < ${schema.exclusiveMaximumTimestamp}`;
if (IsNumber(schema.exclusiveMinimumTimestamp))
yield `${value}.getTime() > ${schema.exclusiveMinimumTimestamp}`;
if (IsNumber(schema.maximumTimestamp))
yield `${value}.getTime() <= ${schema.maximumTimestamp}`;
if (IsNumber(schema.minimumTimestamp))
yield `${value}.getTime() >= ${schema.minimumTimestamp}`;
if (IsNumber(schema.multipleOfTimestamp))
yield `(${value}.getTime() % ${schema.multipleOfTimestamp}) === 0`;
}
function* FromFunction(schema, references, value) {
yield `(typeof ${value} === 'function')`;
}
function* FromImport(schema, references, value) {
const members = globalThis.Object.getOwnPropertyNames(schema.$defs).reduce((result, key) => {
return [...result, schema.$defs[key]];
}, []);
yield* Visit(Ref(schema.$ref), [...references, ...members], value);
}
function* FromInteger(schema, references, value) {
yield `Number.isInteger(${value})`;
if (IsNumber(schema.exclusiveMaximum))
yield `${value} < ${schema.exclusiveMaximum}`;
if (IsNumber(schema.exclusiveMinimum))
yield `${value} > ${schema.exclusiveMinimum}`;
if (IsNumber(schema.maximum))
yield `${value} <= ${schema.maximum}`;
if (IsNumber(schema.minimum))
yield `${value} >= ${schema.minimum}`;
if (IsNumber(schema.multipleOf))
yield `(${value} % ${schema.multipleOf}) === 0`;
}
function* FromIntersect(schema, references, value) {
const check1 = schema.allOf.map((schema) => CreateExpression(schema, references, value)).join(' && ');
if (schema.unevaluatedProperties === false) {
const keyCheck = CreateVariable(`${new RegExp(KeyOfPattern(schema))};`);
const check2 = `Object.getOwnPropertyNames(${value}).every(key => ${keyCheck}.test(key))`;
yield `(${check1} && ${check2})`;
}
else if (IsSchema(schema.unevaluatedProperties)) {
const keyCheck = CreateVariable(`${new RegExp(KeyOfPattern(schema))};`);
const check2 = `Object.getOwnPropertyNames(${value}).every(key => ${keyCheck}.test(key) || ${CreateExpression(schema.unevaluatedProperties, references, `${value}[key]`)})`;
yield `(${check1} && ${check2})`;
}
else {
yield `(${check1})`;
}
}
function* FromIterator(schema, references, value) {
yield `(typeof value === 'object' && Symbol.iterator in ${value})`;
}
function* FromLiteral(schema, references, value) {
if (typeof schema.const === 'number' || typeof schema.const === 'boolean') {
yield `(${value} === ${schema.const})`;
}
else {
yield `(${value} === '${LiteralString.Escape(schema.const)}')`;
}
}
function* FromNever(schema, references, value) {
yield `false`;
}
function* FromNot(schema, references, value) {
const expression = CreateExpression(schema.not, references, value);
yield `(!${expression})`;
}
function* FromNull(schema, references, value) {
yield `(${value} === null)`;
}
function* FromNumber(schema, references, value) {
yield Policy.IsNumberLike(value);
if (IsNumber(schema.exclusiveMaximum))
yield `${value} < ${schema.exclusiveMaximum}`;
if (IsNumber(schema.exclusiveMinimum))
yield `${value} > ${schema.exclusiveMinimum}`;
if (IsNumber(schema.maximum))
yield `${value} <= ${schema.maximum}`;
if (IsNumber(schema.minimum))
yield `${value} >= ${schema.minimum}`;
if (IsNumber(schema.multipleOf))
yield `(${value} % ${schema.multipleOf}) === 0`;
}
function* FromObject(schema, references, value) {
yield Policy.IsObjectLike(value);
if (IsNumber(schema.minProperties))
yield `Object.getOwnPropertyNames(${value}).length >= ${schema.minProperties}`;
if (IsNumber(schema.maxProperties))
yield `Object.getOwnPropertyNames(${value}).length <= ${schema.maxProperties}`;
const knownKeys = Object.getOwnPropertyNames(schema.properties);
for (const knownKey of knownKeys) {
const memberExpression = MemberExpression.Encode(value, knownKey);
const property = schema.properties[knownKey];
if (schema.required && schema.required.includes(knownKey)) {
yield* Visit(property, references, memberExpression);
if (ExtendsUndefinedCheck(property) || IsAnyOrUnknown(property))
yield `('${knownKey}' in ${value})`;
}
else {
const expression = CreateExpression(property, references, memberExpression);
yield Policy.IsExactOptionalProperty(value, knownKey, expression);
}
}
if (schema.additionalProperties === false) {
if (schema.required && schema.required.length === knownKeys.length) {
yield `Object.getOwnPropertyNames(${value}).length === ${knownKeys.length}`;
}
else {
const keys = `[${knownKeys.map((key) => `'${key}'`).join(', ')}]`;
yield `Object.getOwnPropertyNames(${value}).every(key => ${keys}.includes(key))`;
}
}
if (typeof schema.additionalProperties === 'object') {
const expression = CreateExpression(schema.additionalProperties, references, `${value}[key]`);
const keys = `[${knownKeys.map((key) => `'${key}'`).join(', ')}]`;
yield `(Object.getOwnPropertyNames(${value}).every(key => ${keys}.includes(key) || ${expression}))`;
}
}
function* FromPromise(schema, references, value) {
yield `${value} instanceof Promise`;
}
function* FromRecord(schema, references, value) {
yield Policy.IsRecordLike(value);
if (IsNumber(schema.minProperties))
yield `Object.getOwnPropertyNames(${value}).length >= ${schema.minProperties}`;
if (IsNumber(schema.maxProperties))
yield `Object.getOwnPropertyNames(${value}).length <= ${schema.maxProperties}`;
const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0];
const variable = CreateVariable(`${new RegExp(patternKey)}`);
const check1 = CreateExpression(patternSchema, references, 'value');
const check2 = IsSchema(schema.additionalProperties) ? CreateExpression(schema.additionalProperties, references, value) : schema.additionalProperties === false ? 'false' : 'true';
const expression = `(${variable}.test(key) ? ${check1} : ${check2})`;
yield `(Object.entries(${value}).every(([key, value]) => ${expression}))`;
}
function* FromRef(schema, references, value) {
const target = Deref(schema, references);
// Reference: If we have seen this reference before we can just yield and return the function call.
// If this isn't the case we defer to visit to generate and set the function for subsequent passes.
if (state.functions.has(schema.$ref))
return yield `${CreateFunctionName(schema.$ref)}(${value})`;
yield* Visit(target, references, value);
}
function* FromRegExp(schema, references, value) {
const variable = CreateVariable(`${new RegExp(schema.source, schema.flags)};`);
yield `(typeof ${value} === 'string')`;
if (IsNumber(schema.maxLength))
yield `${value}.length <= ${schema.maxLength}`;
if (IsNumber(schema.minLength))
yield `${value}.length >= ${schema.minLength}`;
yield `${variable}.test(${value})`;
}
function* FromString(schema, references, value) {
yield `(typeof ${value} === 'string')`;
if (IsNumber(schema.maxLength))
yield `${value}.length <= ${schema.maxLength}`;
if (IsNumber(schema.minLength))
yield `${value}.length >= ${schema.minLength}`;
if (schema.pattern !== undefined) {
const variable = CreateVariable(`${new RegExp(schema.pattern)};`);
yield `${variable}.test(${value})`;
}
if (schema.format !== undefined) {
yield `format('${schema.format}', ${value})`;
}
}
function* FromSymbol(schema, references, value) {
yield `(typeof ${value} === 'symbol')`;
}
function* FromTemplateLiteral(schema, references, value) {
yield `(typeof ${value} === 'string')`;
const variable = CreateVariable(`${new RegExp(schema.pattern)};`);
yield `${variable}.test(${value})`;
}
function* FromThis(schema, references, value) {
// Note: This types are assured to be hoisted prior to this call. Just yield the function.
yield `${CreateFunctionName(schema.$ref)}(${value})`;
}
function* FromTuple(schema, references, value) {
yield `Array.isArray(${value})`;
if (schema.items === undefined)
return yield `${value}.length === 0`;
yield `(${value}.length === ${schema.maxItems})`;
for (let i = 0; i < schema.items.length; i++) {
const expression = CreateExpression(schema.items[i], references, `${value}[${i}]`);
yield `${expression}`;
}
}
function* FromUndefined(schema, references, value) {
yield `${value} === undefined`;
}
function* FromUnion(schema, references, value) {
const expressions = schema.anyOf.map((schema) => CreateExpression(schema, references, value));
yield `(${expressions.join(' || ')})`;
}
function* FromUint8Array(schema, references, value) {
yield `${value} instanceof Uint8Array`;
if (IsNumber(schema.maxByteLength))
yield `(${value}.length <= ${schema.maxByteLength})`;
if (IsNumber(schema.minByteLength))
yield `(${value}.length >= ${schema.minByteLength})`;
}
function* FromUnknown(schema, references, value) {
yield 'true';
}
function* FromVoid(schema, references, value) {
yield Policy.IsVoidLike(value);
}
function* FromKind(schema, references, value) {
const instance = state.instances.size;
state.instances.set(instance, schema);
yield `kind('${schema[Kind]}', ${instance}, ${value})`;
}
function* Visit(schema, references, value, useHoisting = true) {
const references_ = IsString(schema.$id) ? [...references, schema] : references;
const schema_ = schema;
// --------------------------------------------------------------
// Hoisting
// --------------------------------------------------------------
if (useHoisting && IsString(schema.$id)) {
const functionName = CreateFunctionName(schema.$id);
if (state.functions.has(functionName)) {
return yield `${functionName}(${value})`;
}
else {
// Note: In the case of cyclic types, we need to create a 'functions' record
// to prevent infinitely re-visiting the CreateFunction. Subsequent attempts
// to visit will be caught by the above condition.
state.functions.set(functionName, '<deferred>');
const functionCode = CreateFunction(functionName, schema, references, 'value', false);
state.functions.set(functionName, functionCode);
return yield `${functionName}(${value})`;
}
}
switch (schema_[Kind]) {
case 'Any':
return yield* FromAny(schema_, references_, value);
case 'Argument':
return yield* FromArgument(schema_, references_, value);
case 'Array':
return yield* FromArray(schema_, references_, value);
case 'AsyncIterator':
return yield* FromAsyncIterator(schema_, references_, value);
case 'BigInt':
return yield* FromBigInt(schema_, references_, value);
case 'Boolean':
return yield* FromBoolean(schema_, references_, value);
case 'Constructor':
return yield* FromConstructor(schema_, references_, value);
case 'Date':
return yield* FromDate(schema_, references_, value);
case 'Function':
return yield* FromFunction(schema_, references_, value);
case 'Import':
return yield* FromImport(schema_, references_, value);
case 'Integer':
return yield* FromInteger(schema_, references_, value);
case 'Intersect':
return yield* FromIntersect(schema_, references_, value);
case 'Iterator':
return yield* FromIterator(schema_, references_, value);
case 'Literal':
return yield* FromLiteral(schema_, references_, value);
case 'Never':
return yield* FromNever(schema_, references_, value);
case 'Not':
return yield* FromNot(schema_, references_, value);
case 'Null':
return yield* FromNull(schema_, references_, value);
case 'Number':
return yield* FromNumber(schema_, references_, value);
case 'Object':
return yield* FromObject(schema_, references_, value);
case 'Promise':
return yield* FromPromise(schema_, references_, value);
case 'Record':
return yield* FromRecord(schema_, references_, value);
case 'Ref':
return yield* FromRef(schema_, references_, value);
case 'RegExp':
return yield* FromRegExp(schema_, references_, value);
case 'String':
return yield* FromString(schema_, references_, value);
case 'Symbol':
return yield* FromSymbol(schema_, references_, value);
case 'TemplateLiteral':
return yield* FromTemplateLiteral(schema_, references_, value);
case 'This':
return yield* FromThis(schema_, references_, value);
case 'Tuple':
return yield* FromTuple(schema_, references_, value);
case 'Undefined':
return yield* FromUndefined(schema_, references_, value);
case 'Union':
return yield* FromUnion(schema_, references_, value);
case 'Uint8Array':
return yield* FromUint8Array(schema_, references_, value);
case 'Unknown':
return yield* FromUnknown(schema_, references_, value);
case 'Void':
return yield* FromVoid(schema_, references_, value);
default:
if (!TypeRegistry.Has(schema_[Kind]))
throw new TypeCompilerUnknownTypeError(schema);
return yield* FromKind(schema_, references_, value);
}
}
// ----------------------------------------------------------------
// Compiler State
// ----------------------------------------------------------------
// prettier-ignore
const state = {
language: 'javascript', // target language
functions: new Map(), // local functions
variables: new Map(), // local variables
instances: new Map() // exterior kind instances
};
// ----------------------------------------------------------------
// Compiler Factory
// ----------------------------------------------------------------
function CreateExpression(schema, references, value, useHoisting = true) {
return `(${[...Visit(schema, references, value, useHoisting)].join(' && ')})`;
}
function CreateFunctionName($id) {
return `check_${Identifier.Encode($id)}`;
}
function CreateVariable(expression) {
const variableName = `local_${state.variables.size}`;
state.variables.set(variableName, `const ${variableName} = ${expression}`);
return variableName;
}
function CreateFunction(name, schema, references, value, useHoisting = true) {
const [newline, pad] = ['\n', (length) => ''.padStart(length, ' ')];
const parameter = CreateParameter('value', 'any');
const returns = CreateReturns('boolean');
const expression = [...Visit(schema, references, value, useHoisting)].map((expression) => `${pad(4)}${expression}`).join(` &&${newline}`);
return `function ${name}(${parameter})${returns} {${newline}${pad(2)}return (${newline}${expression}${newline}${pad(2)})\n}`;
}
function CreateParameter(name, type) {
const annotation = state.language === 'typescript' ? `: ${type}` : '';
return `${name}${annotation}`;
}
function CreateReturns(type) {
return state.language === 'typescript' ? `: ${type}` : '';
}
// ----------------------------------------------------------------
// Compile
// ----------------------------------------------------------------
function Build(schema, references, options) {
const functionCode = CreateFunction('check', schema, references, 'value'); // will populate functions and variables
const parameter = CreateParameter('value', 'any');
const returns = CreateReturns('boolean');
const functions = [...state.functions.values()];
const variables = [...state.variables.values()];
// prettier-ignore
const checkFunction = IsString(schema.$id) // ensure top level schemas with $id's are hoisted
? `return function check(${parameter})${returns} {\n return ${CreateFunctionName(schema.$id)}(value)\n}`
: `return ${functionCode}`;
return [...variables, ...functions, checkFunction].join('\n');
}
/** Generates the code used to assert this type and returns it as a string */
function Code(...args) {
const defaults = { language: 'javascript' };
// prettier-ignore
const [schema, references, options] = (args.length === 2 && IsArray(args[1]) ? [args[0], args[1], defaults] :
args.length === 2 && !IsArray(args[1]) ? [args[0], [], args[1]] :
args.length === 3 ? [args[0], args[1], args[2]] :
args.length === 1 ? [args[0], [], defaults] :
[null, [], defaults]);
// compiler-reset
state.language = options.language;
state.variables.clear();
state.functions.clear();
state.instances.clear();
if (!IsSchema(schema))
throw new TypeCompilerTypeGuardError(schema);
for (const schema of references)
if (!IsSchema(schema))
throw new TypeCompilerTypeGuardError(schema);
return Build(schema, references, options);
}
TypeCompiler.Code = Code;
/** Compiles a TypeBox type for optimal runtime type checking. Types must be valid TypeBox types of TSchema */
function Compile(schema, references = []) {
const generatedCode = Code(schema, references, { language: 'javascript' });
const compiledFunction = globalThis.Function('kind', 'format', 'hash', generatedCode);
const instances = new Map(state.instances);
function typeRegistryFunction(kind, instance, value) {
if (!TypeRegistry.Has(kind) || !instances.has(instance))
return false;
const checkFunc = TypeRegistry.Get(kind);
const schema = instances.get(instance);
return checkFunc(schema, value);
}
function formatRegistryFunction(format, value) {
if (!FormatRegistry.Has(format))
return false;
const checkFunc = FormatRegistry.Get(format);
return checkFunc(value);
}
function hashFunction(value) {
return Hash(value);
}
const checkFunction = compiledFunction(typeRegistryFunction, formatRegistryFunction, hashFunction);
return new TypeCheck(schema, references, checkFunction, generatedCode);
}
TypeCompiler.Compile = Compile;
})(TypeCompiler || (TypeCompiler = {}));
@@ -0,0 +1,6 @@
/**
* @deprecated The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
*/
declare const module: any
export = module
@@ -0,0 +1,38 @@
# isarray
`Array#isArray` for older browsers and deprecated Node.js versions.
[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray)
[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray)
[![browser support](https://ci.testling.com/juliangruber/isarray.png)
](https://ci.testling.com/juliangruber/isarray)
__Just use Array.isArray directly__, unless you need to support those older versions.
## Usage
```js
var isArray = require('isarray');
console.log(isArray([])); // => true
console.log(isArray({})); // => false
```
## Installation
With [npm](https://npmjs.org) do
```bash
$ npm install isarray
```
Then bundle for the browser with
[browserify](https://github.com/substack/node-browserify).
## Sponsors
This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!
Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!
@@ -0,0 +1 @@
{"name":"micromark-factory-space","version":"2.0.1","requiresBuild":false,"files":{"license":{"checkedAt":1794532113178,"integrity":"sha512-ic4iF2Ap25Sn5T9MMw7nJ9C20WL6V01rybBBQi2Qx8cQC9/ERFEqGnove1HT65tK2TIKM30PZoOV3Qbz2FE//A==","mode":420,"size":1094},"dev/index.js":{"checkedAt":1794532113179,"integrity":"sha512-58hT+i7Rlh3DTWojwRW691p6aBeBwjj1wCrpCN41U8yaewqxuzqABUF+3musFzSDA6E/8TyIFdIHvG2L5fx8dQ==","mode":420,"size":1505},"index.js":{"checkedAt":1794532113179,"integrity":"sha512-1hq4uxlgiHZGcZ+6ga8Pnycedvr0SL6KXS5i7brC/b6ihOhmkf8z0yn6jxGbgCn/By9xNUw61d1//M47SoK0RQ==","mode":420,"size":1514},"package.json":{"checkedAt":1794532113179,"integrity":"sha512-HOtbG6YJSvqW5wnq10bbPIFdv9CapyAyE2MsMbnbhQeKm/F70mWXtXQX+5B/OVA4zkgD27ubQCakP9zwKOvfOQ==","mode":420,"size":1287},"dev/index.d.ts.map":{"checkedAt":1794532113179,"integrity":"sha512-xEGLALuVZCd3w59auToi0Hq3RAo+ZJrCda3GBKpFzF/3LULn3wDhlGEDueo4j3Nsdh08c2ktmvfxwcuD4gYkcg==","mode":420,"size":254},"index.d.ts.map":{"checkedAt":1794532113179,"integrity":"sha512-xEGLALuVZCd3w59auToi0Hq3RAo+ZJrCda3GBKpFzF/3LULn3wDhlGEDueo4j3Nsdh08c2ktmvfxwcuD4gYkcg==","mode":420,"size":254},"readme.md":{"checkedAt":1794532113179,"integrity":"sha512-zWewI/mY53bs89R5ukS3jHzNTI44RYf9N9RBOgVaHRt8ZqVh7DfLiOBgEOC1TmanNGImLdBwL5syciBWFA7m1g==","mode":420,"size":5671},"dev/index.d.ts":{"checkedAt":1794532113179,"integrity":"sha512-ZcvDuLQHlfCfXeJKfui//oeCve49es3Wt+3Rpa4i/dWBsZSJmH9hCyd5gvP01qE4tLQiH+2+mskoDdpBizfQTQ==","mode":420,"size":1087},"index.d.ts":{"checkedAt":1794532113179,"integrity":"sha512-ZcvDuLQHlfCfXeJKfui//oeCve49es3Wt+3Rpa4i/dWBsZSJmH9hCyd5gvP01qE4tLQiH+2+mskoDdpBizfQTQ==","mode":420,"size":1087}}}
@@ -0,0 +1,107 @@
'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _contextCompat = require('eslint-module-utils/contextCompat');
var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}
function getEmptyBlockRange(tokens, index) {
var token = tokens[index];
var nextToken = tokens[index + 1];
var prevToken = tokens[index - 1];
var start = token.range[0];
var end = nextToken.range[1];
// Remove block tokens and the previous comma
if (prevToken.value === ',' || prevToken.value === 'type' || prevToken.value === 'typeof') {
start = prevToken.range[0];
}
return [start, end];
}
module.exports = {
meta: {
type: 'suggestion',
docs: {
category: 'Helpful warnings',
description: 'Forbid empty named import blocks.',
url: (0, _docsUrl2['default'])('no-empty-named-blocks') },
fixable: 'code',
schema: [],
hasSuggestions: true },
create: function () {function create(context) {
var importsWithoutNameds = [];
return {
ImportDeclaration: function () {function ImportDeclaration(node) {
if (!node.specifiers.some(function (x) {return x.type === 'ImportSpecifier';})) {
importsWithoutNameds.push(node);
}
}return ImportDeclaration;}(),
'Program:exit': function () {function ProgramExit(program) {
var importsTokens = importsWithoutNameds.map(function (node) {return [node, program.tokens.filter(function (x) {return x.range[0] >= node.range[0] && x.range[1] <= node.range[1];})];});
importsTokens.forEach(function (_ref) {var _ref2 = _slicedToArray(_ref, 2),node = _ref2[0],tokens = _ref2[1];
tokens.forEach(function (token) {
var idx = program.tokens.indexOf(token);
var nextToken = program.tokens[idx + 1];
if (nextToken && token.value === '{' && nextToken.value === '}') {
var hasOtherIdentifiers = tokens.some(function (token) {return token.type === 'Identifier' &&
token.value !== 'from' &&
token.value !== 'type' &&
token.value !== 'typeof';});
// If it has no other identifiers it's the only thing in the import, so we can either remove the import
// completely or transform it in a side-effects only import
if (!hasOtherIdentifiers) {
context.report({
node: node,
message: 'Unexpected empty named import block',
suggest: [
{
desc: 'Remove unused import',
fix: function () {function fix(fixer) {
// Remove the whole import
return fixer.remove(node);
}return fix;}() },
{
desc: 'Remove empty import block',
fix: function () {function fix(fixer) {
// Remove the empty block and the 'from' token, leaving the import only for its side
// effects, e.g. `import 'mod'`
var sourceCode = (0, _contextCompat.getSourceCode)(context);
var fromToken = program.tokens.find(function (t) {return t.value === 'from';});
var importToken = program.tokens.find(function (t) {return t.value === 'import';});
var hasSpaceAfterFrom = sourceCode.isSpaceBetween(fromToken, sourceCode.getTokenAfter(fromToken));
var hasSpaceAfterImport = sourceCode.isSpaceBetween(importToken, sourceCode.getTokenAfter(fromToken));var _getEmptyBlockRange =
getEmptyBlockRange(program.tokens, idx),_getEmptyBlockRange2 = _slicedToArray(_getEmptyBlockRange, 1),start = _getEmptyBlockRange2[0];var _fromToken$range = _slicedToArray(
fromToken.range, 2),end = _fromToken$range[1];
var range = [start, hasSpaceAfterFrom ? end + 1 : end];
return fixer.replaceTextRange(range, hasSpaceAfterImport ? '' : ' ');
}return fix;}() }] });
} else {
context.report({
node: node,
message: 'Unexpected empty named import block',
fix: function () {function fix(fixer) {
return fixer.removeRange(getEmptyBlockRange(program.tokens, idx));
}return fix;}() });
}
}
});
});
}return ProgramExit;}() };
}return create;}() };
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1lbXB0eS1uYW1lZC1ibG9ja3MuanMiXSwibmFtZXMiOlsiZ2V0RW1wdHlCbG9ja1JhbmdlIiwidG9rZW5zIiwiaW5kZXgiLCJ0b2tlbiIsIm5leHRUb2tlbiIsInByZXZUb2tlbiIsInN0YXJ0IiwicmFuZ2UiLCJlbmQiLCJ2YWx1ZSIsIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJjYXRlZ29yeSIsImRlc2NyaXB0aW9uIiwidXJsIiwiZml4YWJsZSIsInNjaGVtYSIsImhhc1N1Z2dlc3Rpb25zIiwiY3JlYXRlIiwiY29udGV4dCIsImltcG9ydHNXaXRob3V0TmFtZWRzIiwiSW1wb3J0RGVjbGFyYXRpb24iLCJub2RlIiwic3BlY2lmaWVycyIsInNvbWUiLCJ4IiwicHVzaCIsInByb2dyYW0iLCJpbXBvcnRzVG9rZW5zIiwibWFwIiwiZmlsdGVyIiwiZm9yRWFjaCIsImlkeCIsImluZGV4T2YiLCJoYXNPdGhlcklkZW50aWZpZXJzIiwicmVwb3J0IiwibWVzc2FnZSIsInN1Z2dlc3QiLCJkZXNjIiwiZml4IiwiZml4ZXIiLCJyZW1vdmUiLCJzb3VyY2VDb2RlIiwiZnJvbVRva2VuIiwiZmluZCIsInQiLCJpbXBvcnRUb2tlbiIsImhhc1NwYWNlQWZ0ZXJGcm9tIiwiaXNTcGFjZUJldHdlZW4iLCJnZXRUb2tlbkFmdGVyIiwiaGFzU3BhY2VBZnRlckltcG9ydCIsInJlcGxhY2VUZXh0UmFuZ2UiLCJyZW1vdmVSYW5nZSJdLCJtYXBwaW5ncyI6InFvQkFBQTs7QUFFQSxxQzs7QUFFQSxTQUFTQSxrQkFBVCxDQUE0QkMsTUFBNUIsRUFBb0NDLEtBQXBDLEVBQTJDO0FBQ3pDLE1BQU1DLFFBQVFGLE9BQU9DLEtBQVAsQ0FBZDtBQUNBLE1BQU1FLFlBQVlILE9BQU9DLFFBQVEsQ0FBZixDQUFsQjtBQUNBLE1BQU1HLFlBQVlKLE9BQU9DLFFBQVEsQ0FBZixDQUFsQjtBQUNBLE1BQUlJLFFBQVFILE1BQU1JLEtBQU4sQ0FBWSxDQUFaLENBQVo7QUFDQSxNQUFNQyxNQUFNSixVQUFVRyxLQUFWLENBQWdCLENBQWhCLENBQVo7O0FBRUE7QUFDQSxNQUFJRixVQUFVSSxLQUFWLEtBQW9CLEdBQXBCLElBQTJCSixVQUFVSSxLQUFWLEtBQW9CLE1BQS9DLElBQXlESixVQUFVSSxLQUFWLEtBQW9CLFFBQWpGLEVBQTJGO0FBQ3pGSCxZQUFRRCxVQUFVRSxLQUFWLENBQWdCLENBQWhCLENBQVI7QUFDRDs7QUFFRCxTQUFPLENBQUNELEtBQUQsRUFBUUUsR0FBUixDQUFQO0FBQ0Q7O0FBRURFLE9BQU9DLE9BQVAsR0FBaUI7QUFDZkMsUUFBTTtBQUNKQyxVQUFNLFlBREY7QUFFSkMsVUFBTTtBQUNKQyxnQkFBVSxrQkFETjtBQUVKQyxtQkFBYSxtQ0FGVDtBQUdKQyxXQUFLLDBCQUFRLHVCQUFSLENBSEQsRUFGRjs7QUFPSkMsYUFBUyxNQVBMO0FBUUpDLFlBQVEsRUFSSjtBQVNKQyxvQkFBZ0IsSUFUWixFQURTOzs7QUFhZkMsUUFiZSwrQkFhUkMsT0FiUSxFQWFDO0FBQ2QsVUFBTUMsdUJBQXVCLEVBQTdCOztBQUVBLGFBQU87QUFDTEMseUJBREssMENBQ2FDLElBRGIsRUFDbUI7QUFDdEIsZ0JBQUksQ0FBQ0EsS0FBS0MsVUFBTCxDQUFnQkMsSUFBaEIsQ0FBcUIsVUFBQ0MsQ0FBRCxVQUFPQSxFQUFFZixJQUFGLEtBQVcsaUJBQWxCLEVBQXJCLENBQUwsRUFBZ0U7QUFDOURVLG1DQUFxQk0sSUFBckIsQ0FBMEJKLElBQTFCO0FBQ0Q7QUFDRixXQUxJOztBQU9MLHNCQVBLLG9DQU9VSyxPQVBWLEVBT21CO0FBQ3RCLGdCQUFNQyxnQkFBZ0JSLHFCQUFxQlMsR0FBckIsQ0FBeUIsVUFBQ1AsSUFBRCxVQUFVLENBQUNBLElBQUQsRUFBT0ssUUFBUTdCLE1BQVIsQ0FBZWdDLE1BQWYsQ0FBc0IsVUFBQ0wsQ0FBRCxVQUFPQSxFQUFFckIsS0FBRixDQUFRLENBQVIsS0FBY2tCLEtBQUtsQixLQUFMLENBQVcsQ0FBWCxDQUFkLElBQStCcUIsRUFBRXJCLEtBQUYsQ0FBUSxDQUFSLEtBQWNrQixLQUFLbEIsS0FBTCxDQUFXLENBQVgsQ0FBcEQsRUFBdEIsQ0FBUCxDQUFWLEVBQXpCLENBQXRCOztBQUVBd0IsMEJBQWNHLE9BQWQsQ0FBc0IsZ0JBQW9CLHFDQUFsQlQsSUFBa0IsWUFBWnhCLE1BQVk7QUFDeENBLHFCQUFPaUMsT0FBUCxDQUFlLFVBQUMvQixLQUFELEVBQVc7QUFDeEIsb0JBQU1nQyxNQUFNTCxRQUFRN0IsTUFBUixDQUFlbUMsT0FBZixDQUF1QmpDLEtBQXZCLENBQVo7QUFDQSxvQkFBTUMsWUFBWTBCLFFBQVE3QixNQUFSLENBQWVrQyxNQUFNLENBQXJCLENBQWxCOztBQUVBLG9CQUFJL0IsYUFBYUQsTUFBTU0sS0FBTixLQUFnQixHQUE3QixJQUFvQ0wsVUFBVUssS0FBVixLQUFvQixHQUE1RCxFQUFpRTtBQUMvRCxzQkFBTTRCLHNCQUFzQnBDLE9BQU8wQixJQUFQLENBQVksVUFBQ3hCLEtBQUQsVUFBV0EsTUFBTVUsSUFBTixLQUFlLFlBQWY7QUFDNUNWLDBCQUFNTSxLQUFOLEtBQWdCLE1BRDRCO0FBRTVDTiwwQkFBTU0sS0FBTixLQUFnQixNQUY0QjtBQUc1Q04sMEJBQU1NLEtBQU4sS0FBZ0IsUUFIaUIsRUFBWixDQUE1Qjs7O0FBTUE7QUFDQTtBQUNBLHNCQUFJLENBQUM0QixtQkFBTCxFQUEwQjtBQUN4QmYsNEJBQVFnQixNQUFSLENBQWU7QUFDYmIsZ0NBRGE7QUFFYmMsK0JBQVMscUNBRkk7QUFHYkMsK0JBQVM7QUFDUDtBQUNFQyw4QkFBTSxzQkFEUjtBQUVFQywyQkFGRiw0QkFFTUMsS0FGTixFQUVhO0FBQ1Q7QUFDQSxtQ0FBT0EsTUFBTUMsTUFBTixDQUFhbkIsSUFBYixDQUFQO0FBQ0QsMkJBTEgsZ0JBRE87O0FBUVA7QUFDRWdCLDhCQUFNLDJCQURSO0FBRUVDLDJCQUZGLDRCQUVNQyxLQUZOLEVBRWE7QUFDVDtBQUNBO0FBQ0EsZ0NBQU1FLGFBQWEsa0NBQWN2QixPQUFkLENBQW5CO0FBQ0EsZ0NBQU13QixZQUFZaEIsUUFBUTdCLE1BQVIsQ0FBZThDLElBQWYsQ0FBb0IsVUFBQ0MsQ0FBRCxVQUFPQSxFQUFFdkMsS0FBRixLQUFZLE1BQW5CLEVBQXBCLENBQWxCO0FBQ0EsZ0NBQU13QyxjQUFjbkIsUUFBUTdCLE1BQVIsQ0FBZThDLElBQWYsQ0FBb0IsVUFBQ0MsQ0FBRCxVQUFPQSxFQUFFdkMsS0FBRixLQUFZLFFBQW5CLEVBQXBCLENBQXBCO0FBQ0EsZ0NBQU15QyxvQkFBb0JMLFdBQVdNLGNBQVgsQ0FBMEJMLFNBQTFCLEVBQXFDRCxXQUFXTyxhQUFYLENBQXlCTixTQUF6QixDQUFyQyxDQUExQjtBQUNBLGdDQUFNTyxzQkFBc0JSLFdBQVdNLGNBQVgsQ0FBMEJGLFdBQTFCLEVBQXVDSixXQUFXTyxhQUFYLENBQXlCTixTQUF6QixDQUF2QyxDQUE1QixDQVBTOztBQVNPOUMsK0NBQW1COEIsUUFBUTdCLE1BQTNCLEVBQW1Da0MsR0FBbkMsQ0FUUCwrREFTRjdCLEtBVEU7QUFVT3dDLHNDQUFVdkMsS0FWakIsS0FVQUMsR0FWQTtBQVdULGdDQUFNRCxRQUFRLENBQUNELEtBQUQsRUFBUTRDLG9CQUFvQjFDLE1BQU0sQ0FBMUIsR0FBOEJBLEdBQXRDLENBQWQ7O0FBRUEsbUNBQU9tQyxNQUFNVyxnQkFBTixDQUF1Qi9DLEtBQXZCLEVBQThCOEMsc0JBQXNCLEVBQXRCLEdBQTJCLEdBQXpELENBQVA7QUFDRCwyQkFoQkgsZ0JBUk8sQ0FISSxFQUFmOzs7O0FBK0JELG1CQWhDRCxNQWdDTztBQUNML0IsNEJBQVFnQixNQUFSLENBQWU7QUFDYmIsZ0NBRGE7QUFFYmMsK0JBQVMscUNBRkk7QUFHYkcseUJBSGEsNEJBR1RDLEtBSFMsRUFHRjtBQUNULGlDQUFPQSxNQUFNWSxXQUFOLENBQWtCdkQsbUJBQW1COEIsUUFBUTdCLE1BQTNCLEVBQW1Da0MsR0FBbkMsQ0FBbEIsQ0FBUDtBQUNELHlCQUxZLGdCQUFmOztBQU9EO0FBQ0Y7QUFDRixlQXZERDtBQXdERCxhQXpERDtBQTBERCxXQXBFSSx3QkFBUDs7QUFzRUQsS0F0RmMsbUJBQWpCIiwiZmlsZSI6Im5vLWVtcHR5LW5hbWVkLWJsb2Nrcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGdldFNLine truncated
@@ -0,0 +1,62 @@
# @npmcli/fs
polyfills, and extensions, of the core `fs` module.
## Features
- all exposed functions return promises
- `fs.rm` polyfill for node versions < 14.14.0
- `fs.mkdir` polyfill adding support for the `recursive` and `force` options in node versions < 10.12.0
- `fs.copyFile` extended to accept an `owner` option
- `fs.mkdir` extended to accept an `owner` option
- `fs.mkdtemp` extended to accept an `owner` option
- `fs.writeFile` extended to accept an `owner` option
- `fs.withTempDir` added
- `fs.withOwner` added
- `fs.withOwnerSync` added
- `fs.cp` polyfill for node < 16.7.0
## The `owner` option
The `copyFile`, `mkdir`, `mkdtemp`, `writeFile`, and `withTempDir` functions
all accept a new `owner` property in their options. It can be used in two ways:
- `{ owner: { uid: 100, gid: 100 } }` - set the `uid` and `gid` explicitly
- `{ owner: 100 }` - use one value, will set both `uid` and `gid` the same
The special string `'inherit'` may be passed instead of a number, which will
cause this module to automatically determine the correct `uid` and/or `gid`
from the nearest existing parent directory of the target.
## `fs.withTempDir(root, fn, options) -> Promise`
### Parameters
- `root`: the directory in which to create the temporary directory
- `fn`: a function that will be called with the path to the temporary directory
- `options`
- `tmpPrefix`: a prefix to be used in the generated directory name
### Usage
The `withTempDir` function creates a temporary directory, runs the provided
function (`fn`), then removes the temporary directory and resolves or rejects
based on the result of `fn`.
```js
const fs = require('@npmcli/fs')
const os = require('os')
// this function will be called with the full path to the temporary directory
// it is called with `await` behind the scenes, so can be async if desired.
const myFunction = async (tempPath) => {
return 'done!'
}
const main = async () => {
const result = await fs.withTempDir(os.tmpdir(), myFunction)
// result === 'done!'
}
main()
```
@@ -0,0 +1,287 @@
/**
* The `timer` module exposes a global API for scheduling functions to
* be called at some future period of time. Because the timer functions are
* globals, there is no need to import `node:timers` to use the API.
*
* The timer functions within Node.js implement a similar API as the timers API
* provided by Web Browsers but use a different internal implementation that is
* built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/timers.js)
*/
declare module "timers" {
import { Abortable } from "node:events";
import * as promises from "node:timers/promises";
export interface TimerOptions extends Abortable {
/**
* Set to `false` to indicate that the scheduled `Timeout`
* should not require the Node.js event loop to remain active.
* @default true
*/
ref?: boolean | undefined;
}
global {
namespace NodeJS {
/**
* This object is created internally and is returned from `setImmediate()`. It
* can be passed to `clearImmediate()` in order to cancel the scheduled
* actions.
*
* By default, when an immediate is scheduled, the Node.js event loop will continue
* running as long as the immediate is active. The `Immediate` object returned by
* `setImmediate()` exports both `immediate.ref()` and `immediate.unref()`
* functions that can be used to control this default behavior.
*/
interface Immediate extends RefCounted, Disposable {
/**
* If true, the `Immediate` object will keep the Node.js event loop active.
* @since v11.0.0
*/
hasRef(): boolean;
/**
* When called, requests that the Node.js event loop _not_ exit so long as the
* `Immediate` is active. Calling `immediate.ref()` multiple times will have no
* effect.
*
* By default, all `Immediate` objects are "ref'ed", making it normally unnecessary
* to call `immediate.ref()` unless `immediate.unref()` had been called previously.
* @since v9.7.0
* @returns a reference to `immediate`
*/
ref(): this;
/**
* When called, the active `Immediate` object will not require the Node.js event
* loop to remain active. If there is no other activity keeping the event loop
* running, the process may exit before the `Immediate` object's callback is
* invoked. Calling `immediate.unref()` multiple times will have no effect.
* @since v9.7.0
* @returns a reference to `immediate`
*/
unref(): this;
/**
* Cancels the immediate. This is similar to calling `clearImmediate()`.
* @since v20.5.0, v18.18.0
* @experimental
*/
[Symbol.dispose](): void;
_onImmediate(...args: any[]): void;
}
// Legacy interface used in Node.js v9 and prior
// TODO: remove in a future major version bump
/** @deprecated Use `NodeJS.Timeout` instead. */
interface Timer extends RefCounted {
hasRef(): boolean;
refresh(): this;
[Symbol.toPrimitive](): number;
}
/**
* This object is created internally and is returned from `setTimeout()` and
* `setInterval()`. It can be passed to either `clearTimeout()` or
* `clearInterval()` in order to cancel the scheduled actions.
*
* By default, when a timer is scheduled using either `setTimeout()` or
* `setInterval()`, the Node.js event loop will continue running as long as the
* timer is active. Each of the `Timeout` objects returned by these functions
* export both `timeout.ref()` and `timeout.unref()` functions that can be used to
* control this default behavior.
*/
interface Timeout extends RefCounted, Disposable, Timer {
/**
* Cancels the timeout.
* @since v0.9.1
* @legacy Use `clearTimeout()` instead.
* @returns a reference to `timeout`
*/
close(): this;
/**
* If true, the `Timeout` object will keep the Node.js event loop active.
* @since v11.0.0
*/
hasRef(): boolean;
/**
* When called, requests that the Node.js event loop _not_ exit so long as the
* `Timeout` is active. Calling `timeout.ref()` multiple times will have no effect.
*
* By default, all `Timeout` objects are "ref'ed", making it normally unnecessary
* to call `timeout.ref()` unless `timeout.unref()` had been called previously.
* @since v0.9.1
* @returns a reference to `timeout`
*/
ref(): this;
/**
* Sets the timer's start time to the current time, and reschedules the timer to
* call its callback at the previously specified duration adjusted to the current
* time. This is useful for refreshing a timer without allocating a new
* JavaScript object.
*
* Using this on a timer that has already called its callback will reactivate the
* timer.
* @since v10.2.0
* @returns a reference to `timeout`
*/
refresh(): this;
/**
* When called, the active `Timeout` object will not require the Node.js event loop
* to remain active. If there is no other activity keeping the event loop running,
* the process may exit before the `Timeout` object's callback is invoked. Calling
* `timeout.unref()` multiple times will have no effect.
* @since v0.9.1
* @returns a reference to `timeout`
*/
unref(): this;
/**
* Coerce a `Timeout` to a primitive. The primitive can be used to
* clear the `Timeout`. The primitive can only be used in the
* same thread where the timeout was created. Therefore, to use it
* across `worker_threads` it must first be passed to the correct
* thread. This allows enhanced compatibility with browser
* `setTimeout()` and `setInterval()` implementations.
* @since v14.9.0, v12.19.0
*/
[Symbol.toPrimitive](): number;
/**
* Cancels the timeout.
* @since v20.5.0, v18.18.0
* @experimental
*/
[Symbol.dispose](): void;
_onTimeout(...args: any[]): void;
}
}
/**
* Schedules the "immediate" execution of the `callback` after I/O events'
* callbacks.
*
* When multiple calls to `setImmediate()` are made, the `callback` functions are
* queued for execution in the order in which they are created. The entire callback
* queue is processed every event loop iteration. If an immediate timer is queued
* from inside an executing callback, that timer will not be triggered until the
* next event loop iteration.
*
* If `callback` is not a function, a `TypeError` will be thrown.
*
* This method has a custom variant for promises that is available using
* `timersPromises.setImmediate()`.
* @since v0.9.1
* @param callback The function to call at the end of this turn of
* the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout)
* @param args Optional arguments to pass when the `callback` is called.
* @returns for use with `clearImmediate()`
*/
function setImmediate<TArgs extends any[]>(
callback: (...args: TArgs) => void,
...args: TArgs
): NodeJS.Immediate;
// Allow a single void-accepting argument to be optional in arguments lists.
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
function setImmediate(callback: (_: void) => void): NodeJS.Immediate;
namespace setImmediate {
import __promisify__ = promises.setImmediate;
export { __promisify__ };
}
/**
* Schedules repeated execution of `callback` every `delay` milliseconds.
*
* When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
* will be set to `1`. Non-integer delays are truncated to an integer.
*
* If `callback` is not a function, a `TypeError` will be thrown.
*
* This method has a custom variant for promises that is available using
* `timersPromises.setInterval()`.
* @since v0.0.1
* @param callback The function to call when the timer elapses.
* @param delay The number of milliseconds to wait before calling the
* `callback`. **Default:** `1`.
* @param args Optional arguments to pass when the `callback` is called.
* @returns for use with `clearInterval()`
*/
function setInterval<TArgs extends any[]>(
callback: (...args: TArgs) => void,
delay?: number,
...args: TArgs
): NodeJS.Timeout;
// Allow a single void-accepting argument to be optional in arguments lists.
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
function setInterval(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
/**
* Schedules execution of a one-time `callback` after `delay` milliseconds.
*
* The `callback` will likely not be invoked in precisely `delay` milliseconds.
* Node.js makes no guarantees about the exact timing of when callbacks will fire,
* nor of their ordering. The callback will be called as close as possible to the
* time specified.
*
* When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
* will be set to `1`. Non-integer delays are truncated to an integer.
*
* If `callback` is not a function, a `TypeError` will be thrown.
*
* This method has a custom variant for promises that is available using
* `timersPromises.setTimeout()`.
* @since v0.0.1
* @param callback The function to call when the timer elapses.
* @param delay The number of milliseconds to wait before calling the
* `callback`. **Default:** `1`.
* @param args Optional arguments to pass when the `callback` is called.
* @returns for use with `clearTimeout()`
*/
function setTimeout<TArgs extends any[]>(
callback: (...args: TArgs) => void,
delay?: number,
...args: TArgs
): NodeJS.Timeout;
// Allow a single void-accepting argument to be optional in arguments lists.
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
function setTimeout(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
namespace setTimeout {
import __promisify__ = promises.setTimeout;
export { __promisify__ };
}
/**
* Cancels an `Immediate` object created by `setImmediate()`.
* @since v0.9.1
* @param immediate An `Immediate` object as returned by `setImmediate()`.
*/
function clearImmediate(immediate: NodeJS.Immediate | undefined): void;
/**
* Cancels a `Timeout` object created by `setInterval()`.
* @since v0.0.1
* @param timeout A `Timeout` object as returned by `setInterval()`
* or the primitive of the `Timeout` object as a string or a number.
*/
function clearInterval(timeout: NodeJS.Timeout | string | number | undefined): void;
/**
* Cancels a `Timeout` object created by `setTimeout()`.
* @since v0.0.1
* @param timeout A `Timeout` object as returned by `setTimeout()`
* or the primitive of the `Timeout` object as a string or a number.
*/
function clearTimeout(timeout: NodeJS.Timeout | string | number | undefined): void;
/**
* The `queueMicrotask()` method queues a microtask to invoke `callback`. If
* `callback` throws an exception, the `process` object `'uncaughtException'`
* event will be emitted.
*
* The microtask queue is managed by V8 and may be used in a similar manner to
* the `process.nextTick()` queue, which is managed by Node.js. The
* `process.nextTick()` queue is always processed before the microtask queue
* within each turn of the Node.js event loop.
* @since v11.0.0
* @param callback Function to be queued.
*/
function queueMicrotask(callback: () => void): void;
}
import clearImmediate = globalThis.clearImmediate;
import clearInterval = globalThis.clearInterval;
import clearTimeout = globalThis.clearTimeout;
import setImmediate = globalThis.setImmediate;
import setInterval = globalThis.setInterval;
import setTimeout = globalThis.setTimeout;
export { clearImmediate, clearInterval, clearTimeout, promises, setImmediate, setInterval, setTimeout };
}
declare module "node:timers" {
export * from "timers";
}
@@ -0,0 +1,777 @@
"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/index.ts
var src_exports = {};
__export(src_exports, {
createSelector: () => createSelector,
createSelectorCreator: () => createSelectorCreator,
createStructuredSelector: () => createStructuredSelector,
lruMemoize: () => lruMemoize,
referenceEqualityCheck: () => referenceEqualityCheck,
setGlobalDevModeChecks: () => setGlobalDevModeChecks,
unstable_autotrackMemoize: () => autotrackMemoize,
weakMapMemoize: () => weakMapMemoize
});
module.exports = __toCommonJS(src_exports);
// src/devModeChecks/identityFunctionCheck.ts
var runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => {
if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) {
let isInputSameAsOutput = false;
try {
const emptyObject = {};
if (resultFunc(emptyObject) === emptyObject)
isInputSameAsOutput = true;
} catch {
}
if (isInputSameAsOutput) {
let stack = void 0;
try {
throw new Error();
} catch (e) {
;
({ stack } = e);
}
console.warn(
"The result function returned its own inputs without modification. e.g\n`createSelector([state => state.todos], todos => todos)`\nThis could lead to inefficient memoization and unnecessary re-renders.\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.",
{ stack }
);
}
}
};
// src/devModeChecks/inputStabilityCheck.ts
var runInputStabilityCheck = (inputSelectorResultsObject, options, inputSelectorArgs) => {
const { memoize, memoizeOptions } = options;
const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject;
const createAnEmptyObject = memoize(() => ({}), ...memoizeOptions);
const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy);
if (!areInputSelectorResultsEqual) {
let stack = void 0;
try {
throw new Error();
} catch (e) {
;
({ stack } = e);
}
console.warn(
"An input selector returned a different result when passed same arguments.\nThis means your output selector will likely run more frequently than intended.\nAvoid returning a new reference inside your input selector, e.g.\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`",
{
arguments: inputSelectorArgs,
firstInputs: inputSelectorResults,
secondInputs: inputSelectorResultsCopy,
stack
}
);
}
};
// src/devModeChecks/setGlobalDevModeChecks.ts
var globalDevModeChecks = {
inputStabilityCheck: "once",
identityFunctionCheck: "once"
};
var setGlobalDevModeChecks = (devModeChecks) => {
Object.assign(globalDevModeChecks, devModeChecks);
};
// src/utils.ts
var NOT_FOUND = /* @__PURE__ */ Symbol("NOT_FOUND");
function assertIsFunction(func, errorMessage = `expected a function, instead received ${typeof func}`) {
if (typeof func !== "function") {
throw new TypeError(errorMessage);
}
}
function assertIsObject(object, errorMessage = `expected an object, instead received ${typeof object}`) {
if (typeof object !== "object") {
throw new TypeError(errorMessage);
}
}
function assertIsArrayOfFunctions(array, errorMessage = `expected all items to be functions, instead received the following types: `) {
if (!array.every((item) => typeof item === "function")) {
const itemTypes = array.map(
(item) => typeof item === "function" ? `function ${item.name || "unnamed"}()` : typeof item
).join(", ");
throw new TypeError(`${errorMessage}[${itemTypes}]`);
}
}
var ensureIsArray = (item) => {
return Array.isArray(item) ? item : [item];
};
function getDependencies(createSelectorArgs) {
const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs;
assertIsArrayOfFunctions(
dependencies,
`createSelector expects all input-selectors to be functions, but received the following types: `
);
return dependencies;
}
function collectInputSelectorResults(dependencies, inputSelectorArgs) {
const inputSelectorResults = [];
const { length } = dependencies;
for (let i = 0; i < length; i++) {
inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs));
}
return inputSelectorResults;
}
var getDevModeChecksExecutionInfo = (firstRun, devModeChecks) => {
const { identityFunctionCheck, inputStabilityCheck } = {
...globalDevModeChecks,
...devModeChecks
};
return {
identityFunctionCheck: {
shouldRun: identityFunctionCheck === "always" || identityFunctionCheck === "once" && firstRun,
run: runIdentityFunctionCheck
},
inputStabilityCheck: {
shouldRun: inputStabilityCheck === "always" || inputStabilityCheck === "once" && firstRun,
run: runInputStabilityCheck
}
};
};
// src/autotrackMemoize/autotracking.ts
var $REVISION = 0;
var CURRENT_TRACKER = null;
var Cell = class {
revision = $REVISION;
_value;
_lastValue;
_isEqual = tripleEq;
constructor(initialValue, isEqual = tripleEq) {
this._value = this._lastValue = initialValue;
this._isEqual = isEqual;
}
// Whenever a storage value is read, it'll add itself to the current tracker if
// one exists, entangling its state with that cache.
get value() {
CURRENT_TRACKER?.add(this);
return this._value;
}
// Whenever a storage value is updated, we bump the global revision clock,
// assign the revision for this storage to the new value, _and_ we schedule a
// rerender. This is important, and it's what makes autotracking _pull_
// based. We don't actively tell the caches which depend on the storage that
// anything has happened. Instead, we recompute the caches when needed.
set value(newValue) {
if (this.value === newValue)
return;
this._value = newValue;
this.revision = ++$REVISION;
}
};
function tripleEq(a, b) {
return a === b;
}
var TrackingCache = class {
_cachedValue;
_cachedRevision = -1;
_deps = [];
hits = 0;
fn;
constructor(fn) {
this.fn = fn;
}
clear() {
this._cachedValue = void 0;
this._cachedRevision = -1;
this._deps = [];
this.hits = 0;
}
get value() {
if (this.revision > this._cachedRevision) {
const { fn } = this;
const currentTracker = /* @__PURE__ */ new Set();
const prevTracker = CURRENT_TRACKER;
CURRENT_TRACKER = currentTracker;
this._cachedValue = fn();
CURRENT_TRACKER = prevTracker;
this.hits++;
this._deps = Array.from(currentTracker);
this._cachedRevision = this.revision;
}
CURRENT_TRACKER?.add(this);
return this._cachedValue;
}
get revision() {
return Math.max(...this._deps.map((d) => d.revision), 0);
}
};
function getValue(cell) {
if (!(cell instanceof Cell)) {
console.warn("Not a valid cell! ", cell);
}
return cell.value;
}
function setValue(storage, value) {
if (!(storage instanceof Cell)) {
throw new TypeError(
"setValue must be passed a tracked store created with `createStorage`."
);
}
storage.value = storage._lastValue = value;
}
function createCell(initialValue, isEqual = tripleEq) {
return new Cell(initialValue, isEqual);
}
function createCache(fn) {
assertIsFunction(
fn,
"the first parameter to `createCache` must be a function"
);
return new TrackingCache(fn);
}
// src/autotrackMemoize/tracking.ts
var neverEq = (a, b) => false;
function createTag() {
return createCell(null, neverEq);
}
function dirtyTag(tag, value) {
setValue(tag, value);
}
var consumeCollection = (node) => {
let tag = node.collectionTag;
if (tag === null) {
tag = node.collectionTag = createTag();
}
getValue(tag);
};
var dirtyCollection = (node) => {
const tag = node.collectionTag;
if (tag !== null) {
dirtyTag(tag, null);
}
};
// src/autotrackMemoize/proxy.ts
var REDUX_PROXY_LABEL = Symbol();
var nextId = 0;
var proto = Object.getPrototypeOf({});
var ObjectTreeNode = class {
constructor(value) {
this.value = value;
this.value = value;
this.tag.value = value;
}
proxy = new Proxy(this, objectProxyHandler);
tag = createTag();
tags = {};
children = {};
collectionTag = null;
id = nextId++;
};
var objectProxyHandler = {
get(node, key) {
function calculateResult() {
const { value } = node;
const childValue = Reflect.get(value, key);
if (typeof key === "symbol") {
return childValue;
}
if (key in proto) {
return childValue;
}
if (typeof childValue === "object" && childValue !== null) {
let childNode = node.children[key];
if (childNode === void 0) {
childNode = node.children[key] = createNode(childValue);
}
if (childNode.tag) {
getValue(childNode.tag);
}
return childNode.proxy;
} else {
let tag = node.tags[key];
if (tag === void 0) {
tag = node.tags[key] = createTag();
tag.value = childValue;
}
getValue(tag);
return childValue;
}
}
const res = calculateResult();
return res;
},
ownKeys(node) {
consumeCollection(node);
return Reflect.ownKeys(node.value);
},
getOwnPropertyDescriptor(node, prop) {
return Reflect.getOwnPropertyDescriptor(node.value, prop);
},
has(node, prop) {
return Reflect.has(node.value, prop);
}
};
var ArrayTreeNode = class {
constructor(value) {
this.value = value;
this.value = value;
this.tag.value = value;
}
proxy = new Proxy([this], arrayProxyHandler);
tag = createTag();
tags = {};
children = {};
collectionTag = null;
id = nextId++;
};
var arrayProxyHandler = {
get([node], key) {
if (key === "length") {
consumeCollection(node);
}
return objectProxyHandler.get(node, key);
},
ownKeys([node]) {
return objectProxyHandler.ownKeys(node);
},
getOwnPropertyDescriptor([node], prop) {
return objectProxyHandler.getOwnPropertyDescriptor(node, prop);
},
has([node], prop) {
return objectProxyHandler.has(node, prop);
}
};
function createNode(value) {
if (Array.isArray(value)) {
return new ArrayTreeNode(value);
}
return new ObjectTreeNode(value);
}
function updateNode(node, newValue) {
const { value, tags, children } = node;
node.value = newValue;
if (Array.isArray(value) && Array.isArray(newValue) && value.length !== newValue.length) {
dirtyCollection(node);
} else {
if (value !== newValue) {
let oldKeysSize = 0;
let newKeysSize = 0;
let anyKeysAdded = false;
for (const _key in value) {
oldKeysSize++;
}
for (const key in newValue) {
newKeysSize++;
if (!(key in value)) {
anyKeysAdded = true;
break;
}
}
const isDifferent = anyKeysAdded || oldKeysSize !== newKeysSize;
if (isDifferent) {
dirtyCollection(node);
}
}
}
for (const key in tags) {
const childValue = value[key];
const newChildValue = newValue[key];
if (childValue !== newChildValue) {
dirtyCollection(node);
dirtyTag(tags[key], newChildValue);
}
if (typeof newChildValue === "object" && newChildValue !== null) {
delete tags[key];
}
}
for (const key in children) {
const childNode = children[key];
const newChildValue = newValue[key];
const childValue = childNode.value;
if (childValue === newChildValue) {
continue;
} else if (typeof newChildValue === "object" && newChildValue !== null) {
updateNode(childNode, newChildValue);
} else {
deleteNode(childNode);
delete children[key];
}
}
}
function deleteNode(node) {
if (node.tag) {
dirtyTag(node.tag, null);
}
dirtyCollection(node);
for (const key in node.tags) {
dirtyTag(node.tags[key], null);
}
for (const key in node.children) {
deleteNode(node.children[key]);
}
}
// src/lruMemoize.ts
function createSingletonCache(equals) {
let entry;
return {
get(key) {
if (entry && equals(entry.key, key)) {
return entry.value;
}
return NOT_FOUND;
},
put(key, value) {
entry = { key, value };
},
getEntries() {
return entry ? [entry] : [];
},
clear() {
entry = void 0;
}
};
}
function createLruCache(maxSize, equals) {
let entries = [];
function get(key) {
const cacheIndex = entries.findIndex((entry) => equals(key, entry.key));
if (cacheIndex > -1) {
const entry = entries[cacheIndex];
if (cacheIndex > 0) {
entries.splice(cacheIndex, 1);
entries.unshift(entry);
}
return entry.value;
}
return NOT_FOUND;
}
function put(key, value) {
if (get(key) === NOT_FOUND) {
entries.unshift({ key, value });
if (entries.length > maxSize) {
entries.pop();
}
}
}
function getEntries() {
return entries;
}
function clear() {
entries = [];
}
return { get, put, getEntries, clear };
}
var referenceEqualityCheck = (a, b) => a === b;
function createCacheKeyComparator(equalityCheck) {
return function areArgumentsShallowlyEqual(prev, next) {
if (prev === null || next === null || prev.length !== next.length) {
return false;
}
const { length } = prev;
for (let i = 0; i < length; i++) {
if (!equalityCheck(prev[i], next[i])) {
return false;
}
}
return true;
};
}
function lruMemoize(func, equalityCheckOrOptions) {
const providedOptions = typeof equalityCheckOrOptions === "object" ? equalityCheckOrOptions : { equalityCheck: equalityCheckOrOptions };
const {
equalityCheck = referenceEqualityCheck,
maxSize = 1,
resultEqualityCheck
} = providedOptions;
const comparator = createCacheKeyComparator(equalityCheck);
let resultsCount = 0;
const cache = maxSize <= 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator);
function memoized() {
let value = cache.get(arguments);
if (value === NOT_FOUND) {
value = func.apply(null, arguments);
resultsCount++;
if (resultEqualityCheck) {
const entries = cache.getEntries();
const matchingEntry = entries.find(
(entry) => resultEqualityCheck(entry.value, value)
);
if (matchingEntry) {
value = matchingEntry.value;
resultsCount !== 0 && resultsCount--;
}
}
cache.put(arguments, value);
}
return value;
}
memoized.clearCache = () => {
cache.clear();
memoized.resetResultsCount();
};
memoized.resultsCount = () => resultsCount;
memoized.resetResultsCount = () => {
resultsCount = 0;
};
return memoized;
}
// src/autotrackMemoize/autotrackMemoize.ts
function autotrackMemoize(func) {
const node = createNode(
[]
);
let lastArgs = null;
const shallowEqual = createCacheKeyComparator(referenceEqualityCheck);
const cache = createCache(() => {
const res = func.apply(null, node.proxy);
return res;
});
function memoized() {
if (!shallowEqual(lastArgs, arguments)) {
updateNode(node, arguments);
lastArgs = arguments;
}
return cache.value;
}
memoized.clearCache = () => {
return cache.clear();
};
return memoized;
}
// src/weakMapMemoize.ts
var StrongRef = class {
constructor(value) {
this.value = value;
}
deref() {
return this.value;
}
};
var Ref = typeof WeakRef !== "undefined" ? WeakRef : StrongRef;
var UNTERMINATED = 0;
var TERMINATED = 1;
function createCacheNode() {
return {
s: UNTERMINATED,
v: void 0,
o: null,
p: null
};
}
function weakMapMemoize(func, options = {}) {
let fnNode = createCacheNode();
const { resultEqualityCheck } = options;
let lastResult;
let resultsCount = 0;
function memoized() {
let cacheNode = fnNode;
const { length } = arguments;
for (let i = 0, l = length; i < l; i++) {
const arg = arguments[i];
if (typeof arg === "function" || typeof arg === "object" && arg !== null) {
let objectCache = cacheNode.o;
if (objectCache === null) {
cacheNode.o = objectCache = /* @__PURE__ */ new WeakMap();
}
const objectNode = objectCache.get(arg);
if (objectNode === void 0) {
cacheNode = createCacheNode();
objectCache.set(arg, cacheNode);
} else {
cacheNode = objectNode;
}
} else {
let primitiveCache = cacheNode.p;
if (primitiveCache === null) {
cacheNode.p = primitiveCache = /* @__PURE__ */ new Map();
}
const primitiveNode = primitiveCache.get(arg);
if (primitiveNode === void 0) {
cacheNode = createCacheNode();
primitiveCache.set(arg, cacheNode);
} else {
cacheNode = primitiveNode;
}
}
}
const terminatedNode = cacheNode;
let result;
if (cacheNode.s === TERMINATED) {
result = cacheNode.v;
} else {
result = func.apply(null, arguments);
resultsCount++;
if (resultEqualityCheck) {
const lastResultValue = lastResult?.deref?.() ?? lastResult;
if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) {
result = lastResultValue;
resultsCount !== 0 && resultsCount--;
}
const needsWeakRef = typeof result === "object" && result !== null || typeof result === "function";
lastResult = needsWeakRef ? new Ref(result) : result;
}
}
terminatedNode.s = TERMINATED;
terminatedNode.v = result;
return result;
}
memoized.clearCache = () => {
fnNode = createCacheNode();
memoized.resetResultsCount();
};
memoized.resultsCount = () => resultsCount;
memoized.resetResultsCount = () => {
resultsCount = 0;
};
return memoized;
}
// src/createSelectorCreator.ts
function createSelectorCreator(memoizeOrOptions, ...memoizeOptionsFromArgs) {
const createSelectorCreatorOptions = typeof memoizeOrOptions === "function" ? {
memoize: memoizeOrOptions,
memoizeOptions: memoizeOptionsFromArgs
} : memoizeOrOptions;
const createSelector2 = (...createSelectorArgs) => {
let recomputations = 0;
let dependencyRecomputations = 0;
let lastResult;
let directlyPassedOptions = {};
let resultFunc = createSelectorArgs.pop();
if (typeof resultFunc === "object") {
directlyPassedOptions = resultFunc;
resultFunc = createSelectorArgs.pop();
}
assertIsFunction(
resultFunc,
`createSelector expects an output function after the inputs, but received: [${typeof resultFunc}]`
);
const combinedOptions = {
...createSelectorCreatorOptions,
...directlyPassedOptions
};
const {
memoize,
memoizeOptions = [],
argsMemoize = weakMapMemoize,
argsMemoizeOptions = [],
devModeChecks = {}
} = combinedOptions;
const finalMemoizeOptions = ensureIsArray(memoizeOptions);
const finalArgsMemoizeOptions = ensureIsArray(argsMemoizeOptions);
const dependencies = getDependencies(createSelectorArgs);
const memoizedResultFunc = memoize(function recomputationWrapper() {
recomputations++;
return resultFunc.apply(
null,
arguments
);
}, ...finalMemoizeOptions);
let firstRun = true;
const selector = argsMemoize(function dependenciesChecker() {
dependencyRecomputations++;
const inputSelectorResults = collectInputSelectorResults(
dependencies,
arguments
);
lastResult = memoizedResultFunc.apply(null, inputSelectorResults);
if (process.env.NODE_ENV !== "production") {
const { identityFunctionCheck, inputStabilityCheck } = getDevModeChecksExecutionInfo(firstRun, devModeChecks);
if (identityFunctionCheck.shouldRun) {
identityFunctionCheck.run(
resultFunc,
inputSelectorResults,
lastResult
);
}
if (inputStabilityCheck.shouldRun) {
const inputSelectorResultsCopy = collectInputSelectorResults(
dependencies,
arguments
);
inputStabilityCheck.run(
{ inputSelectorResults, inputSelectorResultsCopy },
{ memoize, memoizeOptions: finalMemoizeOptions },
arguments
);
}
if (firstRun)
firstRun = false;
}
return lastResult;
}, ...finalArgsMemoizeOptions);
return Object.assign(selector, {
resultFunc,
memoizedResultFunc,
dependencies,
dependencyRecomputations: () => dependencyRecomputations,
resetDependencyRecomputations: () => {
dependencyRecomputations = 0;
},
lastResult: () => lastResult,
recomputations: () => recomputations,
resetRecomputations: () => {
recomputations = 0;
},
memoize,
argsMemoize
});
};
Object.assign(createSelector2, {
withTypes: () => createSelector2
});
return createSelector2;
}
var createSelector = /* @__PURE__ */ createSelectorCreator(weakMapMemoize);
// src/createStructuredSelector.ts
var createStructuredSelector = Object.assign(
(inputSelectorsObject, selectorCreator = createSelector) => {
assertIsObject(
inputSelectorsObject,
`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof inputSelectorsObject}`
);
const inputSelectorKeys = Object.keys(inputSelectorsObject);
const dependencies = inputSelectorKeys.map(
(key) => inputSelectorsObject[key]
);
const structuredSelector = selectorCreator(
dependencies,
(...inputSelectorResults) => {
return inputSelectorResults.reduce((composition, value, index) => {
composition[inputSelectorKeys[index]] = value;
return composition;
}, {});
}
);
return structuredSelector;
},
{ withTypes: () => createStructuredSelector }
);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
createSelector,
createSelectorCreator,
createStructuredSelector,
lruMemoize,
referenceEqualityCheck,
setGlobalDevModeChecks,
unstable_autotrackMemoize,
weakMapMemoize
});
//# sourceMappingURL=reselect.cjs.map
@@ -0,0 +1,161 @@
/**
* @since v17.0.0
*/
declare module "readline/promises" {
import { Abortable } from "node:events";
import {
CompleterResult,
Direction,
Interface as _Interface,
ReadLineOptions as _ReadLineOptions,
} from "node:readline";
/**
* Instances of the `readlinePromises.Interface` class are constructed using the `readlinePromises.createInterface()` method. Every instance is associated with a
* single `input` `Readable` stream and a single `output` `Writable` stream.
* The `output` stream is used to print prompts for user input that arrives on,
* and is read from, the `input` stream.
* @since v17.0.0
*/
class Interface extends _Interface {
/**
* The `rl.question()` method displays the `query` by writing it to the `output`,
* waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument.
*
* When called, `rl.question()` will resume the `input` stream if it has been
* paused.
*
* If the `Interface` was created with `output` set to `null` or `undefined` the `query` is not written.
*
* If the question is called after `rl.close()`, it returns a rejected promise.
*
* Example usage:
*
* ```js
* const answer = await rl.question('What is your favorite food? ');
* console.log(`Oh, so your favorite food is ${answer}`);
* ```
*
* Using an `AbortSignal` to cancel a question.
*
* ```js
* const signal = AbortSignal.timeout(10_000);
*
* signal.addEventListener('abort', () => {
* console.log('The food question timed out');
* }, { once: true });
*
* const answer = await rl.question('What is your favorite food? ', { signal });
* console.log(`Oh, so your favorite food is ${answer}`);
* ```
* @since v17.0.0
* @param query A statement or query to write to `output`, prepended to the prompt.
* @return A promise that is fulfilled with the user's input in response to the `query`.
*/
question(query: string): Promise<string>;
question(query: string, options: Abortable): Promise<string>;
}
/**
* @since v17.0.0
*/
class Readline {
/**
* @param stream A TTY stream.
*/
constructor(
stream: NodeJS.WritableStream,
options?: {
autoCommit?: boolean | undefined;
},
);
/**
* The `rl.clearLine()` method adds to the internal list of pending action an
* action that clears current line of the associated `stream` in a specified
* direction identified by `dir`.
* Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
* @since v17.0.0
* @return this
*/
clearLine(dir: Direction): this;
/**
* The `rl.clearScreenDown()` method adds to the internal list of pending action an
* action that clears the associated stream from the current position of the
* cursor down.
* Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
* @since v17.0.0
* @return this
*/
clearScreenDown(): this;
/**
* The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions.
* @since v17.0.0
*/
commit(): Promise<void>;
/**
* The `rl.cursorTo()` method adds to the internal list of pending action an action
* that moves cursor to the specified position in the associated `stream`.
* Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
* @since v17.0.0
* @return this
*/
cursorTo(x: number, y?: number): this;
/**
* The `rl.moveCursor()` method adds to the internal list of pending action an
* action that moves the cursor _relative_ to its current position in the
* associated `stream`.
* Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
* @since v17.0.0
* @return this
*/
moveCursor(dx: number, dy: number): this;
/**
* The `rl.rollback` methods clears the internal list of pending actions without
* sending it to the associated `stream`.
* @since v17.0.0
* @return this
*/
rollback(): this;
}
type Completer = (line: string) => CompleterResult | Promise<CompleterResult>;
interface ReadLineOptions extends Omit<_ReadLineOptions, "completer"> {
/**
* An optional function used for Tab autocompletion.
*/
completer?: Completer | undefined;
}
/**
* The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance.
*
* ```js
* import readlinePromises from 'node:readline/promises';
* const rl = readlinePromises.createInterface({
* input: process.stdin,
* output: process.stdout,
* });
* ```
*
* Once the `readlinePromises.Interface` instance is created, the most common case
* is to listen for the `'line'` event:
*
* ```js
* rl.on('line', (line) => {
* console.log(`Received: ${line}`);
* });
* ```
*
* If `terminal` is `true` for this instance then the `output` stream will get
* the best compatibility if it defines an `output.columns` property and emits
* a `'resize'` event on the `output` if or when the columns ever change
* (`process.stdout` does this automatically when it is a TTY).
* @since v17.0.0
*/
function createInterface(
input: NodeJS.ReadableStream,
output?: NodeJS.WritableStream,
completer?: Completer,
terminal?: boolean,
): Interface;
function createInterface(options: ReadLineOptions): Interface;
}
declare module "node:readline/promises" {
export * from "readline/promises";
}
@@ -0,0 +1,24 @@
var create = require('../diagnostics');
/**
* Create a new diagnostics logger.
*
* @param {String} namespace The namespace it should enable.
* @param {Object} options Additional options.
* @returns {Function} The logger.
* @public
*/
var diagnostics = create(function prod(namespace, options) {
options = options || {};
options.namespace = namespace;
options.prod = true;
options.dev = false;
if (!(options.force || prod.force)) return prod.nope(options);
return prod.yep(options);
});
//
// Expose the diagnostics logger.
//
module.exports = diagnostics;
@@ -0,0 +1,118 @@
'use strict';
var $TypeError = require('es-errors/type');
var Call = require('es-abstract/2024/Call');
var CompletionRecord = require('es-abstract/2024/CompletionRecord');
var CreateIteratorFromClosure = require('../aos/CreateIteratorFromClosure');
var GetIteratorDirect = require('../aos/GetIteratorDirect');
var GetIteratorFlattenable = require('../aos/GetIteratorFlattenable');
var IsCallable = require('es-abstract/2024/IsCallable');
var IteratorClose = require('es-abstract/2024/IteratorClose');
var IteratorStepValue = require('es-abstract/2024/IteratorStepValue');
var ThrowCompletion = require('es-abstract/2024/ThrowCompletion');
var Type = require('es-abstract/2024/Type');
var iterHelperProto = require('../IteratorHelperPrototype');
var SLOT = require('internal-slot');
module.exports = function flatMap(mapper) {
if (this instanceof flatMap) {
throw new $TypeError('`flatMap` is not a constructor');
}
var O = this; // step 1
if (Type(O) !== 'Object') {
throw new $TypeError('`this` value must be an Object'); // step 2
}
if (!IsCallable(mapper)) {
throw new $TypeError('`mapper` must be a function'); // step 3
}
var iterated = GetIteratorDirect(O); // step 4
var sentinel = { sentinel: true };
var innerIterator = sentinel;
var closeIfAbrupt = function (abruptCompletion) {
if (!(abruptCompletion instanceof CompletionRecord)) {
throw new $TypeError('`abruptCompletion` must be a Completion Record');
}
try {
if (innerIterator !== sentinel) {
IteratorClose(
innerIterator,
abruptCompletion
);
}
} finally {
innerIterator = sentinel;
IteratorClose(
iterated,
abruptCompletion
);
}
};
var counter = 0; // step 5.a
var innerAlive = false;
var closure = function () {
// while (true) { // step 5.b
if (innerIterator === sentinel) {
var value = IteratorStepValue(iterated); // step 5.b.i
if (iterated['[[Done]]']) {
innerAlive = false;
innerIterator = sentinel;
// return void undefined; // step 5.b.ii
return sentinel;
}
}
if (innerIterator === sentinel) {
innerAlive = true; // step 5.b.viii
try {
var mapped = Call(mapper, void undefined, [value, counter]); // step 5.b.iv
// yield mapped // step 5.b.vi
innerIterator = GetIteratorFlattenable(mapped, 'REJECT-STRINGS'); // step 5.b.vi
} catch (e) {
innerAlive = false;
innerIterator = sentinel;
closeIfAbrupt(ThrowCompletion(e)); // steps 5.b.v, 5.b.vii
} finally {
counter += 1; // step 5.b.x
}
}
// while (innerAlive) { // step 5.b.ix
if (innerAlive) {
// step 5.b.ix.4
var innerValue;
try {
innerValue = IteratorStepValue(innerIterator); // step 5.b.ix.4.a
} catch (e) {
innerAlive = false;
innerIterator = sentinel;
closeIfAbrupt(ThrowCompletion(e)); // step 5.b.ix.4.b
}
if (innerIterator['[[Done]]']) {
innerAlive = false;
innerIterator = sentinel;
return closure();
}
return innerValue; // step 5.b.ix.4.c
}
// }
// return void undefined;
return sentinel;
};
SLOT.set(closure, '[[Sentinel]]', sentinel); // for the userland implementation
SLOT.set(closure, '[[CloseIfAbrupt]]', closeIfAbrupt); // for the userland implementation
var result = CreateIteratorFromClosure(closure, 'Iterator Helper', iterHelperProto, ['[[UnderlyingIterators]]']); // step 7
SLOT.set(result, '[[UnderlyingIterators]]', [iterated]); // step 8
return result; // step 9
};
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Jordan Harband
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,732 @@
flf2a$ 7 7 11 -1 16 0 0 0
Author :myflix
Date : 2006/4/6 7:38:43
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
---
Font modified May 26, 2012 by patorjk
Made modifications to the "JK" characters.
$ #
$ #
$ #
$ #
$ #
$ #
$ ##
__ #
| | #
| | #
| | #
|__| #
__ #
|__| ##
_ _ #
| || | #
|_||_| #
#
#
#
##
##
#
#
#
#
#
##
$#
#
#
#
#
#
##
%#
#
#
#
#
#
##
&#
#
#
#
#
#
##
__ #
| | #
|__| #
#
#
#
##
____ #
| | #
| _| #
| | #
| | #
| |_ #
|____| ##
____ #
| | #
|_ | #
| | #
| | #
_| | #
|____| ##
*#
#
#
#
#
#
##
_ #
_| |_ #
|_ _| #
|_| #
#
#
##
#
#
#
#
___ #
|_ | #
|_| ##
#
#
____ #
|____| #
#
#
##
#
#
#
#
___ #
| | #
|___| ##
/#
#
#
#
#
#
##
_______ #
| _ |#
| | | |#
| | | |#
| |_| |#
| |#
|_______|##
____ #
| | #
| | #
| | #
| | #
| | #
|___| ##
_______ #
| |#
|____ |#
____| |#
| ______|#
| |_____ #
|_______|##
_______ #
| |#
|___ |#
___| |#
|___ |#
___| |#
|_______|##
_ ___ #
| | | |#
| |_| |#
| |#
|___ |#
| |#
|___|##
_______ #
| |#
| ____|#
| |____ #
|_____ |#
_____| |#
|_______|##
___ #
| | #
| |___ #
| _ |#
| | | |#
| |_| |#
|_______|##
_______ #
| |#
|___ |#
| |#
| |#
| |#
|___|##
_____ #
| _ | #
| |_| | #
| _ |#
| | | |#
| |_| |#
|_______|##
_______ #
| _ |#
| | | |#
| |_| |#
|___ |#
| |#
|___|##
___ #
| | #
|___| #
___ #
| | #
|___| #
##
___ #
| | #
|___| #
___ #
|_ | #
|_| #
##
<#
#
#
#
#
#
##
____ #
|____| #
____ #
|____| #
#
#
##
>#
#
#
#
#
#
##
______ #
| | #
|___ | #
__| | #
|_____| #
__ #
|__| ##
@#
#
#
#
#
#
##
_______ #
| _ |#
| |_| |#
| |#
| |#
| _ |#
|__| |__|##
_______ #
| _ |#
| |_| |#
| |#
| _ | #
| |_| |#
|_______|##
_______ #
| |#
| |#
| |#
| _|#
| |_ #
|_______|##
______ #
| | #
| _ |#
| | | |#
| |_| |#
| |#
|______| ##
_______ #
| |#
| ___|#
| |___ #
| ___|#
| |___ #
|_______|##
_______ #
| |#
| ___|#
| |___ #
| ___|#
| | #
|___| ##
_______ #
| |#
| ___|#
| | __ #
| || |#
| |_| |#
|_______|##
__ __ #
| | | |#
| |_| |#
| |#
| |#
| _ |#
|__| |__|##
___ #
| | #
| | #
| | #
| | #
| | #
|___| ##
___ #
| |#
| |#
| |#
___| |#
| |#
|_______|##
___ _ #
| | | |#
| |_| |#
| _|#
| |_ #
| _ |#
|___| |_|##
___ #
| | #
| | #
| | #
| |___ #
| |#
|_______|##
__ __ #
| |_| |#
| |#
| |#
| |#
| ||_|| |#
|_| |_|##
__ _ #
| | | |#
| |_| |#
| |#
| _ |#
| | | |#
|_| |__|##
_______ #
| |#
| _ |#
| | | |#
| |_| |#
| |#
|_______|##
_______ #
| |#
| _ |#
| |_| |#
| ___|#
| | #
|___| ##
_______ #
| |#
| _ |#
| | | |#
| |_| |#
| | #
|____||_|##
______ #
| _ | #
| | || #
| |_||_ #
| __ |#
| | | |#
|___| |_|##
_______ #
| |#
| _____|#
| |_____ #
|_____ |#
_____| |#
|_______|##
_______ #
| |#
|_ _|#
| | #
| | #
| | #
|___| ##
__ __ #
| | | |#
| | | |#
| |_| |#
| |#
| |#
|_______|##
__ __ #
| | | |#
| |_| |#
| |#
| |#
| | #
|___| ##
_ _ #
| | _ | |#
| || || |#
| |#
| |#
| _ |#
|__| |__|##
__ __ #
| |_| |#
| |#
| |#
| | #
| _ |#
|__| |__|##
__ __ #
| | | |#
| |_| |#
| |#
|_ _|#
| | #
|___| ##
_______ #
| |#
|____ |#
____| |#
| ______|#
| |_____ #
|_______|##
_____ #
| | #
| _| #
| | #
| | #
| |_ #
|_____| ##
\#
#
#
#
#
#
##
_____ #
| | #
|_ | #
| | #
| | #
_| | #
|_____| ##
___ #
| | #
| _ | #
|_| |_| #
#
#
##
#
#
#
#
#
_____ #
|_____| ##
___ #
| | #
|_ | #
|__| #
#
#
##
_______ #
| _ |#
| |_| |#
| |#
| |#
| _ |#
|__| |__|##
_______ #
| _ |#
| |_| |#
| |#
| _ | #
| |_| |#
|_______|##
_______ #
| |#
| |#
| |#
| _|#
| |_ #
|_______|##
______ #
| | #
| _ |#
| | | |#
| |_| |#
| |#
|______| ##
_______ #
| |#
| ___|#
| |___ #
| ___|#
| |___ #
|_______|##
_______ #
| |#
| ___|#
| |___ #
| ___|#
| | #
|___| ##
_______ #
| |#
| ___|#
| | __ #
| || |#
| |_| |#
|_______|##
__ __ #
| | | |#
| |_| |#
| |#
| |#
| _ |#
|__| |__|##
___ #
| | #
| | #
| | #
| | #
| | #
|___| ##
___ #
| |#
| |#
| |#
___| |#
| |#
|_______|##
___ _ #
| | | |#
| |_| |#
| _|#
| |_ #
| _ |#
|___| |_|##
___ #
| | #
| | #
| | #
| |___ #
| |#
|_______|##
__ __ #
| |_| |#
| |#
| |#
| |#
| ||_|| |#
|_| |_|##
__ _ #
| | | |#
| |_| |#
| |#
| _ |#
| | | |#
|_| |__|##
_______ #
| |#
| _ |#
| | | |#
| |_| |#
| |#
|_______|##
_______ #
| |#
| _ |#
| |_| |#
| ___|#
| | #
|___| ##
_______ #
| |#
| _ |#
| | | |#
| |_| |#
| | #
|____||_|##
______ #
| _ | #
| | || #
| |_||_ #
| __ |#
| | | |#
|___| |_|##
_______ #
| |#
| _____|#
| |_____ #
|_____ |#
_____| |#
|_______|##
_______ #
| |#
|_ _|#
| | #
| | #
| | #
|___| ##
__ __ #
| | | |#
| | | |#
| |_| |#
| |#
| |#
|_______|##
__ __ #
| | | |#
| |_| |#
| |#
| |#
| | #
|___| ##
_ _ #
| | _ | |#
| || || |#
| |#
| |#
| _ |#
|__| |__|##
__ __ #
| |_| |#
| |#
| |#
| | #
| _ |#
|__| |__|##
__ __ #
| | | |#
| |_| |#
| |#
|_ _|#
| | #
|___| ##
_______ #
| |#
|____ |#
____| |#
| ______|#
| |_____ #
|_______|##
{#
#
#
#
#
#
##
|#
#
#
#
#
#
##
}#
#
#
#
#
#
##
~#
#
#
#
#
#
##
_______ #
| _ |#
| |_| |#
| |#
| |#
| _ |#
|__| |__|##
_______ #
| |#
| _ |#
| | | |#
| |_| |#
| |#
|_______|##
__ __ #
| | | |#
| | | |#
| |_| |#
| |#
| |#
|_______|##
_______ #
| _ |#
| |_| |#
| |#
| |#
| _ |#
|__| |__|##
_______ #
| |#
| _ |#
| | | |#
| |_| |#
| |#
|_______|##
__ __ #
| | | |#
| | | |#
| |_| |#
| |#
| |#
|_______|##
ß#
#
#
#
#
#
##
@@ -0,0 +1,68 @@
const DIRECTIONS = new Set(['normal', 'reverse', 'alternate', 'alternate-reverse'])
const PLAY_STATES = new Set(['running', 'paused'])
const FILL_MODES = new Set(['none', 'forwards', 'backwards', 'both'])
const ITERATION_COUNTS = new Set(['infinite'])
const TIMINGS = new Set([
'linear',
'ease',
'ease-in',
'ease-out',
'ease-in-out',
'step-start',
'step-end',
])
const TIMING_FNS = ['cubic-bezier', 'steps']
const COMMA = /\,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubic-bezier(a, b, c)` these don't count.
const SPACE = /\ +(?![^(]*\))/g // Similar to the one above, but with spaces instead.
const TIME = /^(-?[\d.]+m?s)$/
const DIGIT = /^(\d+)$/
export default function parseAnimationValue(input) {
let animations = input.split(COMMA)
return animations.map((animation) => {
let value = animation.trim()
let result = { value }
let parts = value.split(SPACE)
let seen = new Set()
for (let part of parts) {
if (!seen.has('DIRECTIONS') && DIRECTIONS.has(part)) {
result.direction = part
seen.add('DIRECTIONS')
} else if (!seen.has('PLAY_STATES') && PLAY_STATES.has(part)) {
result.playState = part
seen.add('PLAY_STATES')
} else if (!seen.has('FILL_MODES') && FILL_MODES.has(part)) {
result.fillMode = part
seen.add('FILL_MODES')
} else if (
!seen.has('ITERATION_COUNTS') &&
(ITERATION_COUNTS.has(part) || DIGIT.test(part))
) {
result.iterationCount = part
seen.add('ITERATION_COUNTS')
} else if (!seen.has('TIMING_FUNCTION') && TIMINGS.has(part)) {
result.timingFunction = part
seen.add('TIMING_FUNCTION')
} else if (!seen.has('TIMING_FUNCTION') && TIMING_FNS.some((f) => part.startsWith(`${f}(`))) {
result.timingFunction = part
seen.add('TIMING_FUNCTION')
} else if (!seen.has('DURATION') && TIME.test(part)) {
result.duration = part
seen.add('DURATION')
} else if (!seen.has('DELAY') && TIME.test(part)) {
result.delay = part
seen.add('DELAY')
} else if (!seen.has('NAME')) {
result.name = part
seen.add('NAME')
} else {
if (!result.unknown) result.unknown = []
result.unknown.push(part)
}
}
return result
})
}
@@ -0,0 +1,10 @@
import type { TSESLint } from '@typescript-eslint/utils';
export interface NormalizedOptions {
allowPrimitiveModules?: boolean;
allowRequire?: boolean;
allowConditionalRequire?: boolean;
}
export type Options = 'allow-primitive-modules' | NormalizedOptions;
type MessageId = 'export' | 'import';
declare const _default: TSESLint.RuleModule<MessageId, [(Options | undefined)?], import("../utils/create-rule.ts").ImportXPluginDocs, TSESLint.RuleListener>;
export default _default;
@@ -0,0 +1,24 @@
# @heroui/navbar
A responsive navigation header positioned on top side of your page that includes support for branding, links, navigation, collapse menu and more.
Please refer to the [documentation](https://heroui.com/docs/components/navbar) for more information.
## Installation
```sh
yarn add @heroui/navbar
# or
npm i @heroui/navbar
```
## Contribution
Yes please! See the
[contributing guidelines](https://github.com/frontio-ai/heroui/blob/master/CONTRIBUTING.md)
for details.
## License
This project is licensed under the terms of the
[MIT license](https://github.com/frontio-ai/heroui/blob/master/LICENSE).
@@ -0,0 +1,78 @@
/**
* @fileoverview Default configuration
* @author Nicholas C. Zakas
*/
"use strict";
//-----------------------------------------------------------------------------
// Requirements
//-----------------------------------------------------------------------------
const Rules = require("../rules");
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const sharedDefaultConfig = [
// intentionally empty config to ensure these files are globbed by default
{
files: ["**/*.js", "**/*.mjs"],
},
{
files: ["**/*.cjs"],
languageOptions: {
sourceType: "commonjs",
ecmaVersion: "latest",
},
},
];
exports.defaultConfig = Object.freeze([
{
plugins: {
"@": {
languages: {
js: require("../languages/js"),
},
/*
* Because we try to delay loading rules until absolutely
* necessary, a proxy allows us to hook into the lazy-loading
* aspect of the rules map while still keeping all of the
* relevant configuration inside of the config array.
*/
rules: new Proxy(
{},
{
get(target, property) {
return Rules.get(property);
},
has(target, property) {
return Rules.has(property);
},
},
),
},
},
language: "@/js",
linterOptions: {
reportUnusedDisableDirectives: 1,
},
},
// default ignores are listed here
{
ignores: ["**/node_modules/", ".git/"],
},
...sharedDefaultConfig,
]);
exports.defaultRuleTesterConfig = Object.freeze([
{ files: ["**"] }, // Make sure the default config matches for all files
...sharedDefaultConfig,
]);
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"F A B","2":"K D E wC"},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 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 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 0C 1C"},D:{"1":"0 1 2 3 4 5 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","132":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB"},E:{"1":"F A B C L M G 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":"2C","4":"ZC","132":"J ZB K D E 3C 4C 5C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 F B C 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 FD GD HD ID NC uC JD OC"},G:{"1":"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","132":"E ZC KD vC LD MD ND OD"},H:{"1":"hD"},I:{"1":"I mD nD","2":"iD jD kD","132":"TC J lD vC"},J:{"1":"D A"},K:{"1":"A B C H NC uC OC"},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":"1D 2D"}},B:1,C:"SVG in HTML img element",D:true};
@@ -0,0 +1,718 @@
flf2a$ 7 7 8 0 3 0 64 0
Font Author: Diamond Planet
FIGFont created with: http://patorjk.com/figfont-editor
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
▗█▄▖@
▐▌█ @
▝█▚▖@
▗▄█▞▘@
▀ @
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
▄$@
▞$@
@
@
@
@
@@
@
@
@
@
@
@
@@
▄$@
@
@
@
@
@
@@
▄▀$@
█ @
▄▀ @
@
@
@
@@
▄▀▀▚▖@
█ ▐▌@
█ ▐▌@
▀▄▄▞▘@
@
@
@@
█$@
█$@
█$@
█$@
@
@
@@
▄▄▄▄$@
█$@
█▀▀▀$@
█▄▄▄$@
@
@
@@
▄▄▄▄$@
█$@
▀▀▀█$@
▄▄▄█$@
@
@
@@
▄ ▗▖@
█ ▐▌@
▀▀▀▜▌@
▐▌@
@
@
@@
▄▄▄▄$@
█ @
▀▀▀█$@
▄▄▄█$@
@
@
@@
▄▄▄▄$@
█ @
█▀▀█$@
█▄▄█$@
@
@
@@
▗▄▄▄▖@
▐▌@
▐▌@
▐▌@
@
@
@@
▄▄▄▄$@
█ █$@
█▀▀█$@
█▄▄█$@
@
@
@@
▄▄▄▄$@
█ █$@
▀▀▀█$@
▄▄▄█$@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
▗▄▖ @
▐▌ ▐▌@
▐▛▀▜▌@
▐▌ ▐▌@
@
@
@@
▗▄▄▖ @
▐▌ ▐▌@
▐▛▀▚▖@
▐▙▄▞▘@
@
@
@@
▗▄▄▖@
▐▌ @
▐▌ @
▝▚▄▄▖@
@
@
@@
▗▄▄▄ @
▐▌ █$@
▐▌ █$@
▐▙▄▄▀$@
@
@
@@
▗▄▄▄▖@
▐▌ @
▐▛▀▀▘@
▐▙▄▄▖@
@
@
@@
▗▄▄▄▖@
▐▌ @
▐▛▀▀▘@
▐▌ @
@
@
@@
▗▄▄▖@
▐▌ @
▐▌▝▜▌@
▝▚▄▞▘@
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▛▀▜▌@
▐▌ ▐▌@
@
@
@@
▗▄▄▄▖@
█ @
█ @
▗▄█▄▖@
@
@
@@
▗▖@
▐▌@
▐▌@
▗▄▄▞▘@
@
@
@@
▗▖ ▗▖@
▐▌▗▞▘@
▐▛▚▖ @
▐▌ ▐▌@
@
@
@@
▗▖ @
▐▌ @
▐▌ @
▐▙▄▄▖@
@
@
@@
▗▖ ▗▖@
▐▛▚▞▜▌@
▐▌ ▐▌@
▐▌ ▐▌@
@
@
@@
▗▖ ▗▖@
▐▛▚▖▐▌@
▐▌ ▝▜▌@
▐▌ ▐▌@
@
@
@@
▗▄▖ @
▐▌ ▐▌@
▐▌ ▐▌@
▝▚▄▞▘@
@
@
@@
▗▄▄▖ @
▐▌ ▐▌@
▐▛▀▘ @
▐▌ @
@
@
@@
▗▄▄▄▖ @
▐▌ ▐▌ @
▐▌ ▐▌ @
▐▙▄▟▙▖@
@
@
@@
▗▄▄▖ @
▐▌ ▐▌@
▐▛▀▚▖@
▐▌ ▐▌@
@
@
@@
▗▄▄▖@
▐▌ @
▝▀▚▖@
▗▄▄▞▘@
@
@
@@
▗▄▄▄▖@
█ @
█ @
█ @
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▌ ▐▌@
▝▚▄▞▘@
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▌ ▐▌@
▝▚▞▘ @
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▌ ▐▌@
▐▙█▟▌@
@
@
@@
▗▖ ▗▖@
▝▚▞▘ @
▐▌ @
▗▞▘▝▚▖@
@
@
@@
▗▖ ▗▖@
▝▚▞▘ @
▐▌ @
▐▌ @
@
@
@@
▗▄▄▄▄▖@
▗▞▘@
▗▞▘ @
▐▙▄▄▄▖@
@
@
@@
▗▄▄▖ @
▐▌ @
▐▌ @
■ @
■■■$@
@
@@
@
@
@
@
@
@
@@
▗▄▄▖ @
▐▌ @
▐▌ @
■$@
■■■$@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
▗▞▀▜▌@
▝▚▄▟▌@
@
@
@
@
$ @@
▗▖ @
▐▌ @
▐▛▀▚▖@
▐▙▄▞▘@
@
@
@@
▗▞▀▘@
▝▚▄▖@
@
@
@
@
$ @@
▐▌@
▐▌@
▗▞▀▜▌@
▝▚▄▟▌@
@
@
@@
▗▞▀▚▖@
▐▛▀▀▘@
▝▚▄▄▖@
@
@
@
@@
▗▞▀▀▘@
▐▌ @
▐▛▀▘ @
▐▌ @
@
@
$ @@
$ @
@
@
▗▄▖ @
▐▌ ▐▌@
▝▀▜▌@
▐▙▄▞▘@@
▐▌ @
▐▌ @
▐▛▀▚▖@
▐▌ ▐▌@
@
@
$ @@
▄$@
▄$@
█$@
█$@
@
@
@@
▗▖@
▗▖@
▄ ▐▌@
▀▄▄▞▘@
@
@
$ @@
█ ▄$@
█▄▀ @
█ ▀▄$@
█ █$@
@
@
$ @@
█$@
█$@
█$@
█$@
@
@
@@
▄▄▄▄ @
█ █ █$@
█ █$@
@
@
@
$ @@
▄▄▄▄ @
█ █$@
█ █$@
@
@
@
$ @@
▄▄▄ @
█ █$@
▀▄▄▄▀$@
@
@
@
$ @@
▄▄▄▄ @
█ █$@
█▄▄▄▀$@
█ @
▀ @
@
$ @@
▄▄▄▄$@
█ █$@
▀▄▄▄█$@
█$@
▀$@
@
@@
▄▄▄$@
█ @
█ @
@
@
@
$ @@
▄▄▄$@
▀▄▄ @
▄▄▄▀$@
@
@
@
$ @@
■ @
▗▄▟▙▄▖@
▐▌ @
▐▌ @
▐▌ @
@
@@
█ ▐▌@
▀▄▄▞▘@
@
@
@
@
$ @@
▄ ▄$@
█ █$@
▀▄▀ @
@
@
@
$ @@
▄ ▄$@
█ ▄ █$@
█▄█▄█$@
@
@
@
$ @@
▄ ▄$@
▀▄▀ @
▄▀ ▀▄$@
@
@
@
$ @@
▄ ▄$@
█ █$@
▀▀▀█$@
▄ █$@
▀▀▀$ @
@
@@
▄▄▄▄▄$@
▄▄▄▀$@
█▄▄▄▄$@
@
@
@
$ @@
▗▞▘@
▗▞▘ @
▐▌ @
▝▘@
@
@
$ @@
@
@
@
@
@
@
@@
■ @
■ @
■ @
■$@
■ @
■ @
■ @@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,WAAW,CAAC,QAAQ,CAAC;AACzC","sources":["packages/@react-aria/overlays/intl/ro-RO.json"],"sourcesContent":["{\n \"dismiss\": \"Revocare\"\n}\n"],"names":[],"version":3,"file":"ro-RO.module.js.map"}
@@ -0,0 +1,12 @@
import type { TSchema, SchemaOptions } from '../schema/index';
import type { TProperties } from '../object/index';
import { type TMappedResult, type TMappedKey } from '../mapped/index';
import { type TPick } from './pick';
type TFromPropertyKey<Type extends TSchema, Key extends PropertyKey> = {
[_ in Key]: TPick<Type, [Key]>;
};
type TFromPropertyKeys<Type extends TSchema, PropertyKeys extends PropertyKey[], Result extends TProperties = {}> = (PropertyKeys extends [infer LeftKey extends PropertyKey, ...infer RightKeys extends PropertyKey[]] ? TFromPropertyKeys<Type, RightKeys, Result & TFromPropertyKey<Type, LeftKey>> : Result);
type TFromMappedKey<Type extends TSchema, MappedKey extends TMappedKey> = (TFromPropertyKeys<Type, MappedKey['keys']>);
export type TPickFromMappedKey<Type extends TSchema, MappedKey extends TMappedKey, Properties extends TProperties = TFromMappedKey<Type, MappedKey>> = (TMappedResult<Properties>);
export declare function PickFromMappedKey<Type extends TSchema, MappedKey extends TMappedKey, Properties extends TProperties = TFromMappedKey<Type, MappedKey>>(type: Type, mappedKey: MappedKey, options?: SchemaOptions): TMappedResult<Properties>;
export {};
@@ -0,0 +1,40 @@
/**
* @fileoverview Types for object-schema package.
*/
/**
* Built-in validation strategies.
*/
export type BuiltInValidationStrategy = "array" | "boolean" | "number" | "object" | "object?" | "string" | "string!";
/**
* Built-in merge strategies.
*/
export type BuiltInMergeStrategy = "assign" | "overwrite" | "replace";
/**
* Property definition.
*/
export interface PropertyDefinition {
/**
* Indicates if the property is required.
*/
required: boolean;
/**
* The other properties that must be present when this property is used.
*/
requires?: string[];
/**
* The strategy to merge the property.
*/
merge: BuiltInMergeStrategy | ((target: any, source: any) => any);
/**
* The strategy to validate the property.
*/
validate: BuiltInValidationStrategy | ((value: any) => void);
/**
* The schema for the object value of this property.
*/
schema?: ObjectDefinition;
}
/**
* Object definition.
*/
export type ObjectDefinition = Record<string, PropertyDefinition>;
@@ -0,0 +1,11 @@
import { CollectionBase } from '@react-types/shared';
import { ReactNode, ReactElement } from 'react';
export { PartialNode } from '@react-stately/collections';
interface CollectionProps<T> extends Omit<CollectionBase<T>, "children" | "items"> {
items?: T[];
/** The contents of the collection. */
children?: ReactNode | ((item: T) => ReactElement);
}
export type { CollectionProps };
@@ -0,0 +1,2 @@
declare const useIsomorphicLayoutEffectWithTarget: (effect: import("react").EffectCallback, deps: import("react").DependencyList, target: import("./domTarget").BasicTarget<any> | import("./domTarget").BasicTarget<any>[]) => void;
export default useIsomorphicLayoutEffectWithTarget;
@@ -0,0 +1,69 @@
import { htmlTrie } from "./generated/encode-html.js";
import { xmlReplacer, getCodePoint } from "./escape.js";
const htmlReplacer = /[\t\n\f!-,./:-@[-`{-}\u0080-\uFFFF]/g;
/**
* Encodes all characters in the input using HTML entities. This includes
* characters that are valid ASCII characters in HTML documents, such as `#`.
*
* To get a more compact output, consider using the `encodeNonAsciiHTML`
* function, which will only encode characters that are not valid in HTML
* documents, as well as non-ASCII characters.
*
* If a character has no equivalent entity, a numeric hexadecimal reference
* (eg. `&#xfc;`) will be used.
*/
export function encodeHTML(input) {
return encodeHTMLTrieRe(htmlReplacer, input);
}
/**
* Encodes all non-ASCII characters, as well as characters not valid in HTML
* documents using HTML entities. This function will not encode characters that
* are valid in HTML documents, such as `#`.
*
* If a character has no equivalent entity, a numeric hexadecimal reference
* (eg. `&#xfc;`) will be used.
*/
export function encodeNonAsciiHTML(input) {
return encodeHTMLTrieRe(xmlReplacer, input);
}
function encodeHTMLTrieRe(regExp, input) {
let returnValue = "";
let lastIndex = 0;
let match;
while ((match = regExp.exec(input)) !== null) {
const { index } = match;
returnValue += input.substring(lastIndex, index);
const char = input.charCodeAt(index);
let next = htmlTrie.get(char);
if (typeof next === "object") {
// We are in a branch. Try to match the next char.
if (index + 1 < input.length) {
const nextChar = input.charCodeAt(index + 1);
const value = typeof next.n === "number"
? next.n === nextChar
? next.o
: undefined
: next.n.get(nextChar);
if (value !== undefined) {
returnValue += value;
lastIndex = regExp.lastIndex += 1;
continue;
}
}
next = next.v;
}
// We might have a tree node without a value; skip and use a numeric entity.
if (next === undefined) {
const cp = getCodePoint(input, index);
returnValue += `&#x${cp.toString(16)};`;
// Increase by 1 if we have a surrogate pair
lastIndex = regExp.lastIndex += Number(cp !== char);
}
else {
returnValue += next;
lastIndex = index + 1;
}
}
return returnValue + input.substr(lastIndex);
}
//# sourceMappingURL=encode.js.map
@@ -0,0 +1,325 @@
tlf2a 3 3 8 -1 18 0 0 0
===============================================================================
This is emboss.tlf, or “Emboss”, by Sam Hocevar <sam@hocevar.net>. It was
created on September 30th, 2006.
This font is free software. It comes without any warranty, to the extent
permitted by applicable law. You can redistribute it and/or modify it under
the terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more
details.
Missing characters: # $ % , ; < >
To create emboss2.tlf, use the following command:
$ sed '/@@/,$y/━┃┏┓┗┛/═║╔╗╚╝/' < emboss.tlf > emboss2.tlf
This font is part of TOIlet’s official distribution. More information
on the TOIlet website at http://caca.zoy.org/wiki/toilet
===============================================================================
@
@
@@
┃!
┛!
┛!!
┛┛"
"
""
@
@
#@@
@
@
$@@
@
@
%@@
┏┛┃ &
┃━┏┛&
━━┛ &&
┛'
'
''
┛(
┃ (
┛((
━ )
┃)
━ ))
┛ ┛*
━┏┛*
┛ ┛**
┃ +
━┏┛+
┛ ++
@
@
,@@
-
━┛-
--
.
.
┛..
┛/
┛ /
┛ //
┏━┃0
┃┛┃0
━━┛00
━┃ 1
┃ 1
━━┛11
━━┃2
┏━┛2
━━┛22
━━┃3
━━┃3
━━┛33
┃ ┃4
━━┃4
┛44
┏━┛5
━━┃5
━━┛55
┏━┛6
┏━┃6
━━┛66
┏━┃7
┃7
┛77
┏━┃8
┏━┃8
━━┛88
┏━┃9
━━┃9
━━┛99
:
┛:
┛::
@
@
;@@
@
@
<@@
=
━━┛=
━━┛==
@
@
>@@
┏━┃?
┛?
┛ ??
┏━┃@
┃┛┛@
━━┛@@
┏━┃A
┏━┃A
┛ ┛AA
┏━ B
┏━┃B
━━ BB
┏━┛C
┃ C
━━┛CC
┏━ D
┃ ┃D
━━ DD
┏━┛E
┏━┛E
━━┛EE
┏━┛F
┏━┛F
┛ FF
┏━┛G
┃ ┃G
━━┛GG
┃ ┃H
┏━┃H
┛ ┛HH
┛I
┃I
┛II
┛J
┃J
━┛JJ
┃ ┃K
┏┛ K
┛ ┛KK
┃ L
┃ L
━━┛LL
┏┏ M
┃┃┃M
┛┛┛MM
┏━ N
┃ ┃N
┛ ┛NN
┏━┃O
┃ ┃O
━━┛OO
┏━┃p
┏━┛P
┛ PP
┏━┃ Q
┃ ┃ Q
━━━┛QQ
┏━┃R
┏┏┛R
┛ ┛RR
┏━┛S
━━┃S
━━┛SS
━┏┛T
┃ T
┛ TT
┃ ┃U
┃ ┃U
━━┛UU
┃ ┃V
┃ ┃V
┛ VV
┃┃┃W
┃┃┃W
━━┛WW
┃ ┃X
┛ X
┛ ┛XX
┃ ┃Y
━┏┛Y
┛ YY
━━┃Z
┏┛ Z
━━┛ZZ
┏┛[
┃ [
━┛[[
┛ \
┛ \
┛\\
━┃]
┃]
━┛]]
┛ ^
┛ ┛^
^^
_
_
━━┛__
┛ `
┛`
``
┏━┃a
┏━┃a
┛ ┛aa
┏━ b
┏━┃b
━━ bb
┏━┛c
┃ c
━━┛cc
┏━ d
┃ ┃d
━━ dd
┏━┛e
┏━┛e
━━┛ee
┏━┛f
┏━┛f
┛ ff
┏━┛g
┃ ┃g
━━┛gg
┃ ┃h
┏━┃h
┛ ┛hh
┛i
┃i
┛ii
┛j
┃j
━┛jj
┃ ┃k
┏┛ k
┛ ┛kk
┃ l
┃ l
━━┛ll
┏┏ m
┃┃┃m
┛┛┛mm
┏━ n
┃ ┃n
┛ ┛nn
┏━┃o
┃ ┃o
━━┛oo
┏━┃p
┏━┛p
┛ pp
┏━┃ q
┃ ┃ q
━━━┛qq
┏━┃r
┏┏┛r
┛ ┛rr
┏━┛s
━━┃s
━━┛ss
━┏┛t
┃ t
┛ tt
┃ ┃u
┃ ┃u
━━┛uu
┃ ┃v
┃ ┃v
┛ vv
┃┃┃w
┃┃┃w
━━┛ww
┃ ┃x
┛ x
┛ ┛xx
┃ ┃y
━┏┛y
┛ yy
━━┃z
┏┛ z
━━┛zz
┏┛{
━┃ {
━┛{{
┃|
┃|
┛||
━┃ }
┏┛}
━┛ }}
┛ ┛~
┛ ┛ ~
~~
┏━┃┏━┛Ä
┏━┃┏━┛Ä
┛ ┛━━┛ÄÄ
┏━┃┏━┛Ö
┃ ┃┏━┛Ö
━━┛━━┛ÖÖ
┃ ┃┏━┛Ü
┃ ┃┏━┛Ü
━━┛━━┛ÜÜ
┏━┃┏━┛ä
┏━┃┏━┛ä
┛ ┛━━┛ää
┏━┃┏━┛ö
┃ ┃┏━┛ö
━━┛━━┛öö
┃ ┃┏━┛ü
┃ ┃┏━┛ü
━━┛━━┛üü
┏━┛┏━┛ß
━━┃━━┃ß
━━┛━━┛ßß
@@ -0,0 +1,45 @@
{
"name": "@peculiar/asn1-x509",
"version": "2.6.0",
"description": "ASN.1 schema of `Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile` (RFC5280)",
"files": [
"build/**/*.{js,d.ts}",
"LICENSE",
"README.md"
],
"bugs": {
"url": "https://github.com/PeculiarVentures/asn1-schema/issues"
},
"homepage": "https://github.com/PeculiarVentures/asn1-schema/tree/master/packages/x509#readme",
"keywords": [
"asn",
"rfc",
"rfc5280",
"x509"
],
"author": "PeculiarVentures, LLC",
"license": "MIT",
"main": "build/cjs/index.js",
"module": "build/es2015/index.js",
"types": "build/types/index.d.ts",
"publishConfig": {
"access": "public"
},
"scripts": {
"clear": "rimraf build",
"build": "npm run build:module && npm run build:types",
"build:module": "npm run build:cjs && npm run build:es2015",
"build:cjs": "tsc -p tsconfig.compile.json --removeComments --module commonjs --outDir build/cjs",
"build:es2015": "tsc -p tsconfig.compile.json --removeComments --module ES2015 --outDir build/es2015",
"prebuild:types": "rimraf build/types",
"build:types": "tsc -p tsconfig.compile.json --outDir build/types --declaration --emitDeclarationOnly",
"rebuild": "npm run clear && npm run build"
},
"dependencies": {
"@peculiar/asn1-schema": "^2.6.0",
"asn1js": "^3.0.6",
"pvtsutils": "^1.3.6",
"tslib": "^2.8.1"
},
"gitHead": "84379a0671b1312b01fd3b9f1ef038d10560ea4a"
}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('sample', require('../sample'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1 @@
{"version":3,"names":["_addComments","require","addComment","node","type","content","line","addComments","value"],"sources":["../../src/comments/addComment.ts"],"sourcesContent":["import addComments from \"./addComments.ts\";\nimport type * as t from \"../index.ts\";\n\n/**\n * Add comment of certain type to a node.\n */\nexport default function addComment<T extends t.Node>(\n node: T,\n type: t.CommentTypeShorthand,\n content: string,\n line?: boolean,\n): T {\n return addComments(node, type, [\n {\n type: line ? \"CommentLine\" : \"CommentBlock\",\n value: content,\n } as t.Comment,\n ]);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMe,SAASC,UAAUA,CAChCC,IAAO,EACPC,IAA4B,EAC5BC,OAAe,EACfC,IAAc,EACX;EACH,OAAO,IAAAC,oBAAW,EAACJ,IAAI,EAAEC,IAAI,EAAE,CAC7B;IACEA,IAAI,EAAEE,IAAI,GAAG,aAAa,GAAG,cAAc;IAC3CE,KAAK,EAAEH;EACT,CAAC,CACF,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,91 @@
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
import {flushSync as $jJMAe$flushSync} from "react-dom";
import {useState as $jJMAe$useState, useCallback as $jJMAe$useCallback} from "react";
/*
* 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.
*/
function $d3f049242431219c$export$6d3443f2c48bfc20(ref, isReady = true) {
let [isEntering, setEntering] = (0, $jJMAe$useState)(true);
let isAnimationReady = isEntering && isReady;
// There are two cases for entry animations:
// 1. CSS @keyframes. The `animation` property is set during the isEntering state, and it is removed after the animation finishes.
// 2. CSS transitions. The initial styles are applied during the isEntering state, and removed immediately, causing the transition to occur.
//
// In the second case, cancel any transitions that were triggered prior to the isEntering = false state (when the transition is supposed to start).
// This can happen when isReady starts as false (e.g. popovers prior to placement calculation).
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (isAnimationReady && ref.current && 'getAnimations' in ref.current) {
for (let animation of ref.current.getAnimations())if (animation instanceof CSSTransition) animation.cancel();
}
}, [
ref,
isAnimationReady
]);
$d3f049242431219c$var$useAnimation(ref, isAnimationReady, (0, $jJMAe$useCallback)(()=>setEntering(false), []));
return isAnimationReady;
}
function $d3f049242431219c$export$45fda7c47f93fd48(ref, isOpen) {
let [exitState, setExitState] = (0, $jJMAe$useState)(isOpen ? 'open' : 'closed');
switch(exitState){
case 'open':
// If isOpen becomes false, set the state to exiting.
if (!isOpen) setExitState('exiting');
break;
case 'closed':
case 'exiting':
// If we are exiting and isOpen becomes true, the animation was interrupted.
// Reset the state to open.
if (isOpen) setExitState('open');
break;
}
let isExiting = exitState === 'exiting';
$d3f049242431219c$var$useAnimation(ref, isExiting, (0, $jJMAe$useCallback)(()=>{
// Set the state to closed, which will cause the element to be unmounted.
setExitState((state)=>state === 'exiting' ? 'closed' : state);
}, []));
return isExiting;
}
function $d3f049242431219c$var$useAnimation(ref, isActive, onEnd) {
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (isActive && ref.current) {
if (!('getAnimations' in ref.current)) {
// JSDOM
onEnd();
return;
}
let animations = ref.current.getAnimations();
if (animations.length === 0) {
onEnd();
return;
}
let canceled = false;
Promise.all(animations.map((a)=>a.finished)).then(()=>{
if (!canceled) (0, $jJMAe$flushSync)(()=>{
onEnd();
});
}).catch(()=>{});
return ()=>{
canceled = true;
};
}
}, [
ref,
isActive,
onEnd
]);
}
export {$d3f049242431219c$export$6d3443f2c48bfc20 as useEnterAnimation, $d3f049242431219c$export$45fda7c47f93fd48 as useExitAnimation};
//# sourceMappingURL=animation.module.js.map
@@ -0,0 +1,12 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2019_intl = void 0;
const base_config_1 = require("./base-config");
exports.es2019_intl = {
libs: [],
variables: [['Intl', base_config_1.TYPE_VALUE]],
};
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var TableHeaderContainerRole = {
relatedConcepts: [],
type: 'structure'
};
var _default = TableHeaderContainerRole;
exports.default = _default;
@@ -0,0 +1,11 @@
import 'reflect-metadata';
import { NapCatCore } from '../..';
import { TypedEventEmitter } from './typeEvent';
export declare const container: any;
export declare const ReceiverServiceRegistry: Map<string, new (...args: any[]) => ServiceBase>;
export declare abstract class ServiceBase {
get core(): NapCatCore;
get event(): TypedEventEmitter<Record<string, any>>;
abstract handler(seq: number, hex_data: string): Promise<void> | void;
}
export declare function ReceiveService(serviceName: string): <T extends new (...args: any[]) => ServiceBase>(constructor: T) => T;
@@ -0,0 +1,21 @@
/*! (c) Andrea Giammarchi - ISC */
import {deserialize} from './deserialize.js';
import {serialize} from './serialize.js';
const {parse: $parse, stringify: $stringify} = JSON;
const options = {json: true, lossy: true};
/**
* Revive a previously stringified structured clone.
* @param {string} str previously stringified data as string.
* @returns {any} whatever was previously stringified as clone.
*/
export const parse = str => deserialize($parse(str));
/**
* Represent a structured clone value as string.
* @param {any} any some clone-able value to stringify.
* @returns {string} the value stringified.
*/
export const stringify = any => $stringify(serialize(any, options));
@@ -0,0 +1 @@
{"version":3,"file":"createFormControl.d.ts","sourceRoot":"","sources":["../../src/logic/createFormControl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAaV,WAAW,EAiBX,YAAY,EAIZ,aAAa,EAUd,MAAM,UAAU,CAAC;AAqDlB,wBAAgB,iBAAiB,CAC/B,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,QAAQ,GAAG,GAAG,EACd,kBAAkB,GAAG,YAAY,EAEjC,KAAK,GAAE,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAM,GACnE,IAAI,CACL,aAAa,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,EACzD,WAAW,CACZ,GAAG;IACF,WAAW,EAAE,IAAI,CACf,aAAa,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,EACzD,WAAW,CACZ,CAAC;CACH,CA27CA"}
@@ -0,0 +1,19 @@
/**
* Copyright (c) 2019, Microsoft Corporation (MIT License).
*
* This module fetches the console process list for a particular PID. It must be
* called from a different process (child_process.fork) as there can only be a
* single console attached to a process.
*/
let getConsoleProcessList: any;
try {
getConsoleProcessList = require('../build/Release/conpty_console_list.node').getConsoleProcessList;
} catch (err) {
getConsoleProcessList = require('../build/Debug/conpty_console_list.node').getConsoleProcessList;
}
const shellPid = parseInt(process.argv[2], 10);
const consoleProcessList = getConsoleProcessList(shellPid);
process.send!({ consoleProcessList });
process.exit(0);
@@ -0,0 +1,41 @@
import { Q, M, D } from '../../constant';
export default (function (o, c) {
var proto = c.prototype;
proto.quarter = function (quarter) {
if (!this.$utils().u(quarter)) {
return this.month(this.month() % 3 + (quarter - 1) * 3);
}
return Math.ceil((this.month() + 1) / 3);
};
var oldAdd = proto.add;
proto.add = function (number, units) {
number = Number(number); // eslint-disable-line no-param-reassign
var unit = this.$utils().p(units);
if (unit === Q) {
return this.add(number * 3, M);
}
return oldAdd.bind(this)(number, units);
};
var oldStartOf = proto.startOf;
proto.startOf = function (units, startOf) {
var utils = this.$utils();
var isStartOf = !utils.u(startOf) ? startOf : true;
var unit = utils.p(units);
if (unit === Q) {
var quarter = this.quarter() - 1;
return isStartOf ? this.month(quarter * 3).startOf(M).startOf(D) : this.month(quarter * 3 + 2).endOf(M).endOf(D);
}
return oldStartOf.bind(this)(units, startOf);
};
});
@@ -0,0 +1,9 @@
"use client";
import {
useBreadcrumbs
} from "./chunk-GM7QV6YH.mjs";
import "./chunk-W2E7RG4O.mjs";
import "./chunk-QRIBVF72.mjs";
export {
useBreadcrumbs
};
@@ -0,0 +1,225 @@
# micromark-factory-space
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]
[micromark][] factory to parse [markdown space][markdown-space] (found in lots
of places).
## Contents
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`factorySpace(…)`](#factoryspace)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This package exposes states to parse spaces and/or tabs.
## When should I use this?
This package is useful when you are making your own micromark extensions.
## Install
This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:
```sh
npm install micromark-factory-space
```
In Deno with [`esm.sh`][esmsh]:
```js
import {factorySpace} from 'https://esm.sh/micromark-factory-space@1'
```
In browsers with [`esm.sh`][esmsh]:
```html
<script type="module">
import {factorySpace} from 'https://esm.sh/micromark-factory-space@1?bundle'
</script>
```
## Use
```js
import {factorySpace} from 'micromark-factory-space'
import {codes, types} from 'micromark-util-symbol'
// A micromark tokenizer that uses the factory:
/**
* @this {TokenizeContext}
* Context.
* @type {Tokenizer}
*/
function tokenizeCodeFenced(effects, ok, nok) {
return start
// …
/** @type {State} */
function info(code) {
if (code === codes.eof || markdownLineEndingOrSpace(code)) {
effects.exit(types.chunkString)
effects.exit(types.codeFencedFenceInfo)
return factorySpace(effects, infoAfter, types.whitespace)(code)
}
if (code === codes.graveAccent && code === marker) return nok(code)
effects.consume(code)
return info
}
// …
}
```
## API
This module exports the identifier [`factorySpace`][api-factory-space].
There is no default export.
### `factorySpace(…)`
Parse spaces and tabs.
There is no `nok` parameter:
* spaces in markdown are often optional, in which case this factory can be
used and `ok` will be switched to whether spaces were found or not
* one line ending or space can be detected with `markdownSpace(code)` right
before using `factorySpace`
###### Examples
Where `␉` represents a tab (plus how much it expands) and `␠` represents a
single space.
```markdown
␉
␠␠␠␠
␉␠
```
###### Parameters
* `effects` (`Effects`)
— context
* `ok` (`State`)
— state switched to when successful
* `type` (`string`)
— type (`' \t'`)
* `max` (`number`, default: `Infinity`)
— max (exclusive)
###### Returns
Start state (`State`).
## Types
This package is fully typed with [TypeScript][].
It exports no additional types.
## Compatibility
Projects maintained by the unified collective are compatible with maintained
versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-factory-space@2`, compatible with Node.js 16.
This package works with `micromark@3`.
## Security
This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.
## Contribute
See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.
This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg
[build]: https://github.com/micromark/micromark/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg
[coverage]: https://codecov.io/github/micromark/micromark
[downloads-badge]: https://img.shields.io/npm/dm/micromark-factory-space.svg
[downloads]: https://www.npmjs.com/package/micromark-factory-space
[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-factory-space
[bundle-size]: https://bundlejs.com/?q=micromark-factory-space
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
[opencollective]: https://opencollective.com/unified
[npm]: https://docs.npmjs.com/cli/install
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[esmsh]: https://esm.sh
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
[chat]: https://github.com/micromark/micromark/discussions
[license]: https://github.com/micromark/micromark/blob/main/license
[author]: https://wooorm.com
[health]: https://github.com/micromark/.github
[securitymd]: https://github.com/micromark/.github/blob/main/security.md
[contributing]: https://github.com/micromark/.github/blob/main/contributing.md
[support]: https://github.com/micromark/.github/blob/main/support.md
[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
[markdown-space]: https://github.com/micromark/micromark/tree/main/packages/micromark-util-character#markdownspacecode
[typescript]: https://www.typescriptlang.org
[micromark]: https://github.com/micromark/micromark
[api-factory-space]: #factoryspace
@@ -0,0 +1 @@
{"name":"color2k","version":"2.0.3","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532104366,"integrity":"sha512-PQnZNobykmSj+jUP53VzO0SPDfDg0DauG70um5Yrfzr3D/0EdiTLcqirBQgeYEnR05dphENjowGm40+djOASZw==","mode":420,"size":1068},"dist/index.exports.require.cjs.js":{"checkedAt":1794532104366,"integrity":"sha512-0nR5fovEUWaZeD8qpOT7ch7awq9M4fkV0AAsVQejRlAi8pq26D4RThqtTP7mwiMBvPSU9ecry8VBxmROzXWdiQ==","mode":420,"size":16301},"dist/index.main.cjs.js":{"checkedAt":1794532104366,"integrity":"sha512-Rf3O3T46r6OS7X735LxEf9iI6DaO4yWrCaIAwMzofNl88jQ17trFbWwv8vAGWJH52Y8WlcmuUO837H1vIEe8Sg==","mode":420,"size":26107},"dist/index.module.es.js":{"checkedAt":1794532104367,"integrity":"sha512-KSYKPqO5UuLt38G1I4azIpWRGZLV3kNiSJTEHzQwbYKJOeEWQxE6wez8/JBeumlAwasUTEc3W552p/5veVROPw==","mode":420,"size":15844},"dist/index.unpkg.umd.js":{"checkedAt":1794532104367,"integrity":"sha512-BQcSLOuFzJo676IZLf6TBURRFi36d5RYwanLQlyYKO/0hmsxEB4b9b5Ee9JgDcpUj0NT5+WPuIJWo6PHOO/jWQ==","mode":420,"size":17718},"package.json":{"checkedAt":1794532104367,"integrity":"sha512-4gYZcSTpeKkc6UusaUMgXYZX46vdWntiv+rKzdYa+8wggI3EAwFkjYHhIEUREeNTg7pjCFw5Sg2QSxZz7eRdSQ==","mode":420,"size":2241},"dist/index.exports.import.es.mjs.map":{"checkedAt":1794532104367,"integrity":"sha512-BL2dbZ8ojM7RvJmxElkAU5u4vWTzo2361CoNf8zdZna8tSWbz+Yz6S9wDAUl/dR3KZ2ZXf384BYJSW4c/OG3zw==","mode":420,"size":35898},"dist/index.exports.require.cjs.js.map":{"checkedAt":1794532104367,"integrity":"sha512-NQl5GsUDx3FHrbcMbYEwDvkQqF1BRjftGa7sFKqE89tghJcxymM+q1JP2wPozrb1DMmI/zd8IzlthvwPeUG8lg==","mode":420,"size":35923},"dist/index.main.cjs.js.map":{"checkedAt":1794532104367,"integrity":"sha512-ZoAIiYe4QyWtnsutLbFcUrFYRIiRyh+fLA+hRZlJxO02fubZ5amMgVdMUqRfvl3HEr27vllm0pQKKgdvgOIa+w==","mode":420,"size":39605},"dist/index.module.es.js.map":{"checkedAt":1794532104368,"integrity":"sha512-dWbOHy5vTXWNgd9cB5h3B0vHU5xAQUV0BDMLO8HWpxrqSGjO8ib/4DhR3s4tj/nl0n6nQ1byDjZhrUu20xkJAw==","mode":420,"size":35889},"dist/index.unpkg.umd.js.map":{"checkedAt":1794532104368,"integrity":"sha512-JEJnBwETIDVYmlIB3fbubBOpfWLPBVWx8U0ZAGBfwelEYGM7wR8TzOUIJUYvgmALETNLR+aTHjViJEOfrCZZEA==","mode":420,"size":36405},"README.md":{"checkedAt":1794532104368,"integrity":"sha512-1doE9nYaJFitFL353VtZXrtBM0Pjg2QcFIxSDsvZ3XW8cTr+vl3WFbiQXmdfFppCKp7BkjkKfygKE8UTLdEMyg==","mode":420,"size":3822},"dist/index.exports.import.es.mjs":{"checkedAt":1794532104368,"integrity":"sha512-PhgzqMgglvEq9QgYy2BLSwtOT2bWKhi3C40WNXFVWfY1S2Zbp3UX1EqhFK+BUvWdxitGwDfD4vUfJmKxA7O4zw==","mode":420,"size":15853},"rollup.config.mjs":{"checkedAt":1794532104368,"integrity":"sha512-btYp8yivVM71WakCBXeRZ+IyMoBwgDUyy7L2bwycokC+zdOH0VVp4A+eA40MTYYpw9WHMf0XVtkJphVWFGv1Iw==","mode":420,"size":2725},"dist/adjustHue.d.ts":{"checkedAt":1794532104369,"integrity":"sha512-LLSENzwdkAighTXv3uxaq5hAJWbByIsPTqgSyNzVGIiasz58rCJmgVcuTqCZ/m7geTRXLbyAKRh3hZ11q//elQ==","mode":420,"size":345},"dist/ColorError.d.ts":{"checkedAt":1794532104369,"integrity":"sha512-5g4g2D5qFgUExGaTUD+uWMjTPXMj/p295FL1q+pe/ejRFj8DusNOHdwH5MxYgMbJcHfOYcmmYxhe2yJbi6W5IQ==","mode":420,"size":102},"dist/darken.d.ts":{"checkedAt":1794532104369,"integrity":"sha512-xcBuxuNn8gm0i1kIR3Yy4Nv3ARyb7hnrjeBjoDyiCDoE0KEULdQ6xr5ZQCse6sKFMwhWDRZiSpdwLrzAtBAzSg==","mode":420,"size":270},"dist/desaturate.d.ts":{"checkedAt":1794532104369,"integrity":"sha512-OtVre5UqCEoZWurQWaYoAVThoalZHas19aq48JS+QrBmAgjv0X9Wpce21CDnc4xr3CR7ypznrRx42YqRTSwO7Q==","mode":420,"size":278},"dist/getContrast.d.ts":{"checkedAt":1794532104369,"integrity":"sha512-E6tbGvoKSBj9vrpMoZBZmuBwuUa7x3DDgzi8sn91Hc7ZqNibEdB4MMrZWezsq2wVFtPNx+xnhz/M7/E3SpaHwA==","mode":420,"size":269},"dist/getLuminance.d.ts":{"checkedAt":1794532104369,"integrity":"sha512-3lYanwYvlSIiNDwhpgAFLdP5fzNTuuduxzW6/Q/o3xAwCRmv1I9UrHp6GMzCnoq/+GPDk8TaGq9XeuIjQFm1uQ==","mode":420,"size":158},"dist/getScale.d.ts":{"checkedAt":1794532104369,"integrity":"sha512-fXVL0ZpIctGuWANREqjuaye8rMV8TYlK3y9awCWlvmNe5USpR8u6eNG5aKciCkvX3G7bDUpb3QqF5GTFoDsHVQ==","mode":420,"size":882},"dist/guard.d.ts":{"checkedAt":1794532104369,"integrity":"sha512-AY4JW+SYQhJqZ4LNW7ofOil2kPnwS6LndjscmsVEcz6MJSraHTVAYriM+dGN3imddvM/2OYvn0yXLOZQ3rt0pg==","mode":420,"size":191},"dist/hasBadContrast.d.ts":{"checkedAt":1794532104370,"integrity":"sha512-wsxMHV5tMYQmP4Z/kLuy+moMWZARaCIEyHsMpB0v109RMMeKPIjq8EqMl/epf0ZEkFr96caPIRXxoKK5SRJszA==","mode":420,"size":276},"dist/hsla.d.ts":{"checkedAt":1794532104370,"integrity":"sha512-Ga+LxHJsMcZZc4jkiRLwqtD7mQdjyiHtNOKgNvID9Q713JE270HDvpJpCyRNu9hZpT2aC/gtuVTdjnVUxSV7hA==","mode":420,"size":513},"dist/index.d.ts":{"checkedAt":1794532104370,"integrity":"sha512-3rqqp1ZQhJnGdBjNWbBesQ+3Ddzw4oGhi7tZJOROkCI6ESGLtOF7JfOZxNlOrG5L+vMqAmA8W6tXRDIFUNroug==","mode":420,"size":1190},"dist/lighten.d.ts":{"checkedAt":1794532104370,"integrity":"sha512-ZlgI0tDNDjB0h5AdeLezqqxmsg7qNphSPMSfq9r2l2ksL2kQOzr8eUjkIw9Fw/EwI5F/OkTL+xFmuvzCQxa5PQ==","mode":420,"size":263},"dist/mix.d.ts":{"checkedAt":1794532104370,"integrity":"sha512-tIKe5i2BsCio65vs7fGfQoXAGTPEfK1gbnbwAm2h2wZUfHt3VZAG7VLine truncated
@@ -0,0 +1,56 @@
#!/usr/bin/env node
var nopt = require('../lib/nopt')
var path = require('path')
var types = { num: Number,
bool: Boolean,
help: Boolean,
list: Array,
'num-list': [Number, Array],
'str-list': [String, Array],
'bool-list': [Boolean, Array],
str: String,
clear: Boolean,
config: Boolean,
length: Number,
file: path,
}
var shorthands = { s: ['--str', 'astring'],
b: ['--bool'],
nb: ['--no-bool'],
tft: ['--bool-list', '--no-bool-list', '--bool-list', 'true'],
'?': ['--help'],
h: ['--help'],
H: ['--help'],
n: ['--num', '125'],
c: ['--config'],
l: ['--length'],
f: ['--file'],
}
var parsed = nopt(types
, shorthands
, process.argv
, 2)
console.log('parsed', parsed)
if (parsed.help) {
console.log('')
console.log('nopt cli tester')
console.log('')
console.log('types')
console.log(Object.keys(types).map(function M (t) {
var type = types[t]
if (Array.isArray(type)) {
return [t, type.map(function (mappedType) {
return mappedType.name
})]
}
return [t, type && type.name]
}).reduce(function (s, i) {
s[i[0]] = i[1]
return s
}, {}))
console.log('')
console.log('shorthands')
console.log(shorthands)
}
@@ -0,0 +1,33 @@
var baseIteratee = require('./_baseIteratee'),
baseSum = require('./_baseSum');
/**
* This method is like `_.sum` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the value to be summed.
* The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the sum.
* @example
*
* var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
*
* _.sumBy(objects, function(o) { return o.n; });
* // => 20
*
* // The `_.property` iteratee shorthand.
* _.sumBy(objects, 'n');
* // => 20
*/
function sumBy(array, iteratee) {
return (array && array.length)
? baseSum(array, baseIteratee(iteratee, 2))
: 0;
}
module.exports = sumBy;
@@ -0,0 +1,17 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
import ts = require("./typescript.js");
export = ts;
@@ -0,0 +1,218 @@
import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f, Time as $35ea8db9cb2ccb90$export$680ea196effce5f, ZonedDateTime as $35ea8db9cb2ccb90$export$d3b7288e7994edea} from "./CalendarDate.mjs";
import {constrain as $735220c2d4774dd3$export$c4e2ecac49351ef2} from "./manipulation.mjs";
import {getExtendedYear as $3b62074eb05584b2$export$c36e0ecb2d4fa69d, GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from "./GregorianCalendar.mjs";
import {getLocalTimeZone as $14e0f24ef4ac5c92$export$aa8b41735afcabd2} from "./queries.mjs";
/*
* 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.
*/ // Portions of the code in this file are based on code from the TC39 Temporal proposal.
// Original licensing can be found in the NOTICE file in the root directory of this source tree.
function $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) {
date = $11d87f3f76e88657$export$b4a036af3fc0b032(date, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());
let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(date.era, date.year);
return $11d87f3f76e88657$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
}
function $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
// Note: Date.UTC() interprets one and two-digit years as being in the
// 20th century, so don't use it
let date = new Date();
date.setUTCHours(hour, minute, second, millisecond);
date.setUTCFullYear(year, month - 1, day);
return date.getTime();
}
function $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone) {
// Fast path for UTC.
if (timeZone === 'UTC') return 0;
// Fast path: for local timezone after 1970, use native Date.
if (ms > 0 && timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)()) return new Date(ms).getTimezoneOffset() * -60000;
let { year: year, month: month, day: day, hour: hour, minute: minute, second: second } = $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone);
let utc = $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, 0);
return utc - Math.floor(ms / 1000) * 1000;
}
const $11d87f3f76e88657$var$formattersByTimeZone = new Map();
function $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone) {
let formatter = $11d87f3f76e88657$var$formattersByTimeZone.get(timeZone);
if (!formatter) {
formatter = new Intl.DateTimeFormat('en-US', {
timeZone: timeZone,
hour12: false,
era: 'short',
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric'
});
$11d87f3f76e88657$var$formattersByTimeZone.set(timeZone, formatter);
}
let parts = formatter.formatToParts(new Date(ms));
let namedParts = {};
for (let part of parts)if (part.type !== 'literal') namedParts[part.type] = part.value;
return {
// Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
year: namedParts.era === 'BC' || namedParts.era === 'B' ? -namedParts.year + 1 : +namedParts.year,
month: +namedParts.month,
day: +namedParts.day,
hour: namedParts.hour === '24' ? 0 : +namedParts.hour,
minute: +namedParts.minute,
second: +namedParts.second
};
}
const $11d87f3f76e88657$var$DAYMILLIS = 86400000;
function $11d87f3f76e88657$export$136f38efe7caf549(date, timeZone) {
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date);
let earlier = ms - $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);
let later = ms - $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);
return $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later);
}
function $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later) {
let found = earlier === later ? [
earlier
] : [
earlier,
later
];
return found.filter((absolute)=>$11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute));
}
function $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute) {
let parts = $11d87f3f76e88657$var$getTimeZoneParts(absolute, timeZone);
return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;
}
function $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation = 'compatible') {
let dateTime = $11d87f3f76e88657$export$b21e0b124e224484(date);
// Fast path: if the time zone is UTC, use native Date.
if (timeZone === 'UTC') return $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
// Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.
if (timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)() && disambiguation === 'compatible') {
dateTime = $11d87f3f76e88657$export$b4a036af3fc0b032(dateTime, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());
// Don't use Date constructor here because two-digit years are interpreted in the 20th century.
let date = new Date();
let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);
date.setFullYear(year, dateTime.month - 1, dateTime.day);
date.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
return date.getTime();
}
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
let offsetBefore = $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);
let offsetAfter = $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);
let valid = $11d87f3f76e88657$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
if (valid.length === 1) return valid[0];
if (valid.length > 1) switch(disambiguation){
// 'compatible' means 'earlier' for "fall back" transitions
case 'compatible':
case 'earlier':
return valid[0];
case 'later':
return valid[valid.length - 1];
case 'reject':
throw new RangeError('Multiple possible absolute times found');
}
switch(disambiguation){
case 'earlier':
return Math.min(ms - offsetBefore, ms - offsetAfter);
// 'compatible' means 'later' for "spring forward" transitions
case 'compatible':
case 'later':
return Math.max(ms - offsetBefore, ms - offsetAfter);
case 'reject':
throw new RangeError('No such absolute time found');
}
}
function $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = 'compatible') {
return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
}
function $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone) {
let offset = $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone);
let date = new Date(ms + offset);
let year = date.getUTCFullYear();
let month = date.getUTCMonth() + 1;
let day = date.getUTCDate();
let hour = date.getUTCHours();
let minute = date.getUTCMinutes();
let second = date.getUTCSeconds();
let millisecond = date.getUTCMilliseconds();
return new (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)(year < 1 ? 'BC' : 'AD', year < 1 ? -year + 1 : year, month, day, timeZone, offset, hour, minute, second, millisecond);
}
function $11d87f3f76e88657$export$e57ff100d91bd4b9(date, timeZone) {
return $11d87f3f76e88657$export$1b96692a1ba042ac(date.getTime(), timeZone);
}
function $11d87f3f76e88657$export$d7f92bcd3596b086(date) {
return $11d87f3f76e88657$export$e57ff100d91bd4b9(date, (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)());
}
function $11d87f3f76e88657$export$93522d1a439f3617(dateTime) {
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);
}
function $11d87f3f76e88657$export$6f4d78149f3f53ac(date) {
return {
era: date.era,
year: date.year,
month: date.month,
day: date.day
};
}
function $11d87f3f76e88657$export$4d0393e732857be5(date) {
return {
hour: date.hour,
minute: date.minute,
second: date.second,
millisecond: date.millisecond
};
}
function $11d87f3f76e88657$export$b21e0b124e224484(date, time) {
let hour = 0, minute = 0, second = 0, millisecond = 0;
if ('timeZone' in date) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = date);
else if ('hour' in date && !time) return date;
if (time) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = time);
return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
}
function $11d87f3f76e88657$export$d33f79e3ffc3dc83(dateTime) {
return new (0, $35ea8db9cb2ccb90$export$680ea196effce5f)(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
}
function $11d87f3f76e88657$export$b4a036af3fc0b032(date, calendar) {
if (date.calendar.identifier === calendar.identifier) return date;
let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
let copy = date.copy();
copy.calendar = calendar;
copy.era = calendarDate.era;
copy.year = calendarDate.year;
copy.month = calendarDate.month;
copy.day = calendarDate.day;
(0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(copy);
return copy;
}
function $11d87f3f76e88657$export$84c95a83c799e074(date, timeZone, disambiguation) {
if (date instanceof (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)) {
if (date.timeZone === timeZone) return date;
return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);
}
let ms = $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation);
return $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone);
}
function $11d87f3f76e88657$export$83aac07b4c37b25(date) {
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
return new Date(ms);
}
function $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone) {
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone), date.calendar);
}
function $11d87f3f76e88657$export$d9b67bc93c097491(date) {
return $11d87f3f76e88657$export$538b00033cc11c75(date, (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)());
}
export {$11d87f3f76e88657$export$bd4fb2bc8bb06fb as epochFromDate, $11d87f3f76e88657$export$b4a036af3fc0b032 as toCalendar, $11d87f3f76e88657$export$59c99f3515d3493f as getTimeZoneOffset, $11d87f3f76e88657$export$136f38efe7caf549 as possibleAbsolutes, $11d87f3f76e88657$export$5107c82f94518f5c as toAbsolute, $11d87f3f76e88657$export$b21e0b124e224484 as toCalendarDateTime, $11d87f3f76e88657$export$e67a095c620b86fe as toDate, $11d87f3f76e88657$export$1b96692a1ba042ac as fromAbsolute, $11d87f3f76e88657$export$e57ff100d91bd4b9 as fromDate, $11d87f3f76e88657$export$d7f92bcd3596b086 as fromDateToLocal, $11d87f3f76e88657$export$93522d1a439f3617 as toCalendarDate, $11d87f3f76e88657$export$6f4d78149f3f53ac as toDateFields, $11d87f3f76e88657$export$4d0393e732857be5 as toTimeFields, $11d87f3f76e88657$export$d33f79e3ffc3dc83 as toTime, $11d87f3f76e88657$export$84c95a83c799e074 as toZoned, $11d87f3f76e88657$export$538b00033cc11c75 as toTimeZone, $11d87f3f76e88657$export$83aac07b4c37b25 as zonedToDate, $11d87f3f76e88657$export$d9b67bc93c097491 as toLocalTimeZone};
//# sourceMappingURL=conversion.module.js.map
@@ -0,0 +1,24 @@
/**
* Check if the value is an Error object
*
* 校验是否是错误对象
*
* @example
* ```js
* import { isError } from 'is-what-type';
*
* isError(new Error()); // true
* isError(new TypeError()); // true
* isError({}); // false
* isError({ name: 'CustomError' }); // true
* isError({ name: 'NotAnError' }); // false
* isError(null); // false
* isError(undefined); // false
* isError('string'); // false
* isError(123); // false
* ```
*
* @param value - The value to check
* @returns `true` if the value is an Error object, else `false`
*/
export declare function isError(value: unknown): value is Error;
@@ -0,0 +1,39 @@
import { OneBotAction } from '../../action/OneBotAction';
import { Peer } from '../../../napcat-core/types';
import { Static } from '@sinclair/typebox';
export declare const GoCQHTTPUploadPrivateFilePayloadSchema: import("@sinclair/typebox").TObject<{
user_id: import("@sinclair/typebox").TString;
file: import("@sinclair/typebox").TString;
name: import("@sinclair/typebox").TString;
upload_file: import("@sinclair/typebox").TBoolean;
}>;
export type GoCQHTTPUploadPrivateFilePayload = Static<typeof GoCQHTTPUploadPrivateFilePayloadSchema>;
export declare const GoCQHTTPUploadPrivateFileReturnSchema: import("@sinclair/typebox").TObject<{
file_id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
}>;
export type GoCQHTTPUploadPrivateFileResponse = Static<typeof GoCQHTTPUploadPrivateFileReturnSchema>;
export default class GoCQHTTPUploadPrivateFile extends OneBotAction<GoCQHTTPUploadPrivateFilePayload, GoCQHTTPUploadPrivateFileResponse> {
actionName: "upload_private_file";
payloadSchema: import("@sinclair/typebox").TObject<{
user_id: import("@sinclair/typebox").TString;
file: import("@sinclair/typebox").TString;
name: import("@sinclair/typebox").TString;
upload_file: import("@sinclair/typebox").TBoolean;
}>;
returnSchema: import("@sinclair/typebox").TObject<{
file_id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
}>;
actionSummary: string;
actionDescription: string;
actionTags: string[];
payloadExample: {
user_id: string;
file: string;
name: string;
};
returnExample: {
file_id: string;
};
getPeer(payload: GoCQHTTPUploadPrivateFilePayload): Promise<Peer>;
_handle(payload: GoCQHTTPUploadPrivateFilePayload): Promise<GoCQHTTPUploadPrivateFileResponse>;
}
@@ -0,0 +1,423 @@
export default `flf2a$ 4 3 10 -1 13 1
mshebrew210.flf by Michael 'msh210' Hamm 2-5 Nov 2000 for FIGWin.
Copyright (c) 2000 Michael Hamm. Note: uses Gedaliah Friedenberg's
Jerusalem font's keyboard map. www.crosswinds.net/~msh210/ has
msh210 contact info. Okay to modify this font iff modifier's name
is on a comment line. msh210's first font: have heart, suggestions
Keyboard map (see note above):
alef = t | vav = u | chaf = f | nun = b | fe = p | kuf = e
ves = c | zayin = z | \`final = l | \`final = i | \`final = ; | resh = r
gimel = d | ches = j | lamed = k | samach = x | tzadi = m | shin = a
daled = s | tes = y | mem = n | ayin = g | \`final = . | saf = ,
he = v | yud = h | \`final = o | period = /
$@
$@
$@
$@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
|""|@
_| |@
@@
@
@
@
@@
@
\\ |@
\\/ @
$\\ @@
@
@
o@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
["|@
|@
|@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
|/ |@
|_/ @
@@
@
$|@
_|@
@@
@
""| @
__|_@
@@
@
\\ @
/\\@
@@
@
""|@
| '@
|$ @@
@
""|@
__|@
@@
@
\\ |@
\\/ @
-'$ @@
@
|@
$@
@@
@
|@
|@
|@@
@
|""|@
| |@
@@
|$ @
""|@
/ @
@@
@
""|@
|@
|@@
@
\\/@
_\\@
@@
@
Y"\\ @
| _|@
@@
@
|""|@
|__|@
@@
@
["|@
__|@
@@
@
@
@
@@
@
""|@
|@
$@@
@
""|'@
| @
$ @@
@
\\>@
L\\@
@@
@
|@
|@
$@@
@
""|@
| |@
$@@
@
@
@
@@
@
|""|@
\\/ @
@@
@
| /|@
|__|@
@@
@
\`(\`@
)@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
`
@@ -0,0 +1,5 @@
@rem Copyright (c) 2009 Google Inc. All rights reserved.
@rem Use of this source code is governed by a BSD-style license that can be
@rem found in the LICENSE file.
@python "%~dp0gyp_main.py" %*
@@ -0,0 +1,180 @@
/**
* @fileoverview Rule to flag adding properties to native object's prototypes.
* @author David Nelson
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [{ exceptions: [] }],
docs: {
description: "Disallow extending native types",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-extend-native",
},
schema: [
{
type: "object",
properties: {
exceptions: {
type: "array",
items: {
type: "string",
},
uniqueItems: true,
},
},
additionalProperties: false,
},
],
messages: {
unexpected:
"{{builtin}} prototype is read only, properties should not be added.",
},
},
create(context) {
const sourceCode = context.sourceCode;
const exceptions = new Set(context.options[0].exceptions);
const modifiedBuiltins = new Set(
Object.keys(astUtils.ECMASCRIPT_GLOBALS)
.filter(builtin => builtin[0].toUpperCase() === builtin[0])
.filter(builtin => !exceptions.has(builtin)),
);
/**
* Reports a lint error for the given node.
* @param {ASTNode} node The node to report.
* @param {string} builtin The name of the native builtin being extended.
* @returns {void}
*/
function reportNode(node, builtin) {
context.report({
node,
messageId: "unexpected",
data: {
builtin,
},
});
}
/**
* Check to see if the `prototype` property of the given object
* identifier node is being accessed.
* @param {ASTNode} identifierNode The Identifier representing the object
* to check.
* @returns {boolean} True if the identifier is the object of a
* MemberExpression and its `prototype` property is being accessed,
* false otherwise.
*/
function isPrototypePropertyAccessed(identifierNode) {
return Boolean(
identifierNode &&
identifierNode.parent &&
identifierNode.parent.type === "MemberExpression" &&
identifierNode.parent.object === identifierNode &&
astUtils.getStaticPropertyName(identifierNode.parent) ===
"prototype",
);
}
/**
* Check if it's an assignment to the property of the given node.
* Example: `*.prop = 0` // the `*` is the given node.
* @param {ASTNode} node The node to check.
* @returns {boolean} True if an assignment to the property of the node.
*/
function isAssigningToPropertyOf(node) {
return (
node.parent.type === "MemberExpression" &&
node.parent.object === node &&
node.parent.parent.type === "AssignmentExpression" &&
node.parent.parent.left === node.parent
);
}
/**
* Checks if the given node is at the first argument of the method call of `Object.defineProperty()` or `Object.defineProperties()`.
* @param {ASTNode} node The node to check.
* @returns {boolean} True if the node is at the first argument of the method call of `Object.defineProperty()` or `Object.defineProperties()`.
*/
function isInDefinePropertyCall(node) {
return (
node.parent.type === "CallExpression" &&
node.parent.arguments[0] === node &&
astUtils.isSpecificMemberAccess(
node.parent.callee,
"Object",
/^definePropert(?:y|ies)$/u,
)
);
}
/**
* Check to see if object prototype access is part of a prototype
* extension. There are three ways a prototype can be extended:
* 1. Assignment to prototype property (Object.prototype.foo = 1)
* 2. Object.defineProperty()/Object.defineProperties() on a prototype
* If prototype extension is detected, report the AssignmentExpression
* or CallExpression node.
* @param {ASTNode} identifierNode The Identifier representing the object
* which prototype is being accessed and possibly extended.
* @returns {void}
*/
function checkAndReportPrototypeExtension(identifierNode) {
if (!isPrototypePropertyAccessed(identifierNode)) {
return; // This is not `*.prototype` access.
}
/*
* `identifierNode.parent` is a MemberExpression `*.prototype`.
* If it's an optional member access, it may be wrapped by a `ChainExpression` node.
*/
const prototypeNode =
identifierNode.parent.parent.type === "ChainExpression"
? identifierNode.parent.parent
: identifierNode.parent;
if (isAssigningToPropertyOf(prototypeNode)) {
// `*.prototype` -> MemberExpression -> AssignmentExpression
reportNode(prototypeNode.parent.parent, identifierNode.name);
} else if (isInDefinePropertyCall(prototypeNode)) {
// `*.prototype` -> CallExpression
reportNode(prototypeNode.parent, identifierNode.name);
}
}
return {
"Program:exit"(node) {
const globalScope = sourceCode.getScope(node);
modifiedBuiltins.forEach(builtin => {
const builtinVar = globalScope.set.get(builtin);
if (builtinVar && builtinVar.references) {
builtinVar.references
.map(ref => ref.identifier)
.forEach(checkAndReportPrototypeExtension);
}
});
},
};
},
};
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('last', require('../last'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = getImplicitRoleForH5;
/**
* Returns the implicit role for an h5 tag.
*/
function getImplicitRoleForH5() {
return 'heading';
}
module.exports = exports.default;
@@ -0,0 +1,12 @@
import { PluginFunc } from 'dayjs'
declare const plugin: PluginFunc
export = plugin
declare module 'dayjs' {
interface Dayjs {
week(): number
week(value : number): Dayjs
}
}
@@ -0,0 +1,33 @@
import baseIteratee from './_baseIteratee.js';
import basePullAll from './_basePullAll.js';
/**
* This method is like `_.pullAll` except that it accepts `iteratee` which is
* invoked for each element of `array` and `values` to generate the criterion
* by which they're compared. The iteratee is invoked with one argument: (value).
*
* **Note:** Unlike `_.differenceBy`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns `array`.
* @example
*
* var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
*
* _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
* console.log(array);
* // => [{ 'x': 2 }]
*/
function pullAllBy(array, values, iteratee) {
return (array && array.length && values && values.length)
? basePullAll(array, values, baseIteratee(iteratee, 2))
: array;
}
export default pullAllBy;
@@ -0,0 +1,11 @@
'use strict'
const debug = (
typeof process === 'object' &&
process.env &&
process.env.NODE_DEBUG &&
/\bsemver\b/i.test(process.env.NODE_DEBUG)
) ? (...args) => console.error('SEMVER', ...args)
: () => {}
module.exports = debug
@@ -0,0 +1,30 @@
{
"name": "@types/use-sync-external-store",
"version": "0.0.6",
"description": "TypeScript definitions for use-sync-external-store",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/use-sync-external-store",
"license": "MIT",
"contributors": [
{
"name": "eps1lon",
"githubUsername": "eps1lon",
"url": "https://github.com/eps1lon"
},
{
"name": "Mark Erikson",
"githubUsername": "markerikson",
"url": "https://github.com/markerikson"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/use-sync-external-store"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "c048e9b12d49a82481404fb3bc099a0aa28adff9fc0d9755b69bbc54901ea2fb",
"typeScriptVersion": "4.5"
}
@@ -0,0 +1 @@
{"name":"memoize-one","version":"5.2.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532115586,"integrity":"sha512-YQ81JgMbh4C4M11XqhLbjquhzU+iriZsQM/AWWXIc+btXLFYiBf+gzF6vufgppGHP9cCz5GU37jxll1JInIabw==","mode":420,"size":1073},"dist/memoize-one.cjs.js.flow":{"checkedAt":1794532115586,"integrity":"sha512-ODyH34NUrKE3qD4vv+P2L1lZ/9QxE64pQZ8SFz4O4aO4NKFGvbGCKuWTAytbK/oMpGciH/R+mGwcykhDqZe4fw==","mode":420,"size":231},"src/memoize-one.js.flow":{"checkedAt":1794532115586,"integrity":"sha512-ODyH34NUrKE3qD4vv+P2L1lZ/9QxE64pQZ8SFz4O4aO4NKFGvbGCKuWTAytbK/oMpGciH/R+mGwcykhDqZe4fw==","mode":420,"size":231},"dist/memoize-one.cjs.js":{"checkedAt":1794532115586,"integrity":"sha512-cceWgAbrPEjDpvfylCafZABJl5gkoYGCuY+A2ofSjH0ruLPHTt5c6dYuQjTpHZJ0iv0RF8spZ6Frk4nQFftJyw==","mode":420,"size":1305},"dist/memoize-one.esm.js":{"checkedAt":1794532115586,"integrity":"sha512-JInZnnCjtlG86yGbWO1FlD9ISAKrro7ce11hLjY3sB7GSh0+wX/Riq6Y4q/xkh3hq57YTrjeA36bY0vdJqAIlA==","mode":420,"size":1288},"dist/memoize-one.js":{"checkedAt":1794532115586,"integrity":"sha512-ZvO0o45mBybAjrrnmHzEZe6h2LU82nuNNRzhA8013PYl9gpFVtzZdmy99135C2pLZTiedsNnXKlIAtFYyglMMg==","mode":420,"size":1717},"dist/memoize-one.min.js":{"checkedAt":1794532115586,"integrity":"sha512-r3Fa8BmW1P0w+qd3iLZaawwHGnURs4Vnqtvv2whKhsoFgxty0zk0it/S3+fOUQpC6LBgVlv+rTLW92CmvirpXQ==","mode":420,"size":647},"package.json":{"checkedAt":1794532115586,"integrity":"sha512-0Dtezq+rhaqSWfeH2S+YLxL8wMSBXFCofu8wuq9RGiWNYYwe5Zf/y4uzEU8ke6S/FlilSZrOFPtaaMSnMOcAJA==","mode":420,"size":2729},"README.md":{"checkedAt":1794532115587,"integrity":"sha512-R4ZHxOpIKgKjcq005FpSSiKY9ogDXG8q8nlBbJjyoiCH1UubRnel0I8RdcsOOJ/6CfYqxo9r/5ckprlsyiYIfA==","mode":420,"size":9747},"dist/are-inputs-equal.d.ts":{"checkedAt":1794532115587,"integrity":"sha512-pL7zVnr2+XytQiN18JxR5XBAxNSbkwmg3UCZah7uENsh8j8MNgjm9eXy9CXm+iiNOlNEllihVL6+vozcSIuhpA==","mode":420,"size":112},"src/are-inputs-equal.ts":{"checkedAt":1794532115587,"integrity":"sha512-QId57uMZlZgW4IdF3cSo5uPhfbX4TZ61sd4DVVQ0gHMZbFULoBphI7L/Wh1kJNlG5K2Rnm5eqDWVxc2lGoJSjQ==","mode":420,"size":1042},"dist/memoize-one.d.ts":{"checkedAt":1794532115587,"integrity":"sha512-GY2YElUhSA9sk91v9bV9VsFac77v/4Fid1dlDomu4AXGBBBCQObG7oY6E4XPryyMACktDe3im4SU0Vj1v91ppg==","mode":420,"size":260},"src/memoize-one.ts":{"checkedAt":1794532115587,"integrity":"sha512-xC5h1tBQ8kznnKLmX/jfi4lb16YaWpGYx7qVBMalbgHv2VyP5IuqHJxSJIV9286TGoAp3D/Vip7mJBhl2dbDxg==","mode":420,"size":1388}}}
@@ -0,0 +1,22 @@
'use strict';
var test = require('tape');
var hasSymbols = require('../');
var runSymbolTests = require('./tests');
test('interface', function (t) {
t.equal(typeof hasSymbols, 'function', 'is a function');
t.equal(typeof hasSymbols(), 'boolean', 'returns a boolean');
t.end();
});
test('Symbols are supported', { skip: !hasSymbols() }, function (t) {
runSymbolTests(t);
t.end();
});
test('Symbols are not supported', { skip: hasSymbols() }, function (t) {
t.equal(typeof Symbol, 'undefined', 'global Symbol is undefined');
t.equal(typeof Object.getOwnPropertySymbols, 'undefined', 'Object.getOwnPropertySymbols does not exist');
t.end();
});
@@ -0,0 +1 @@
{"version":3,"file":"buildArrayMetadataWithIndex.js","sourceRoot":"","sources":["../../../../src/reflectMetadata/utils/buildArrayMetadataWithIndex.ts"],"names":[],"mappings":";;AAAA,kEASC;AATD,SAAgB,2BAA2B,CACzC,WAAc,EACd,KAAa;IAEb,OAAO,CAAC,aAAkB,EAAO,EAAE;QACjC,aAAa,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC;QAEnC,OAAO,aAAa,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
/**
* Adds a specified number of hours to a date.
* 向日期添加指定数量的小时。
*
* @param date - The date to add hours to. (要添加小时的日期。)
* @param hours - The number of hours to add. (要添加的小时数。)
* @returns A new date with the added hours. (添加小时后的新日期。)
* @example
* ```ts
* // Adding 3 hours to a date (向日期添加3小时)
* const originalDate = new Date('2023-10-01T12:00:00');
* addHours(originalDate, 3);
* console.log(originalDate.toISOString()); // Outputs: '2023-10-01T15:00:00.000Z' (输出: '2023-10-01T15:00:00.000Z')
* ```
*/
export default function addHours(date: Date, hours: number): Date;
@@ -0,0 +1,21 @@
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
## Glob Logo
Glob's logo created by Tanya Brassie <http://tanyabrassie.com/>, licensed
under a Creative Commons Attribution-ShareAlike 4.0 International License
https://creativecommons.org/licenses/by-sa/4.0/
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InversifyCoreError = void 0;
const isAppErrorSymbol = Symbol.for('@inversifyjs/core/InversifyCoreError');
class InversifyCoreError extends Error {
[isAppErrorSymbol];
kind;
constructor(kind, message, options) {
super(message, options);
this[isAppErrorSymbol] = true;
this.kind = kind;
}
static is(value) {
return (typeof value === 'object' &&
value !== null &&
value[isAppErrorSymbol] === true);
}
static isErrorOfKind(value, kind) {
return InversifyCoreError.is(value) && value.kind === kind;
}
}
exports.InversifyCoreError = InversifyCoreError;
//# sourceMappingURL=InversifyCoreError.js.map
@@ -0,0 +1,16 @@
/**
* @param {CompileOptions | null | undefined} [options]
* @returns {Compile}
*/
export function compile(options?: CompileOptions | null | undefined): Compile;
export type Media = {
image?: boolean | undefined;
labelId?: string | undefined;
label?: string | undefined;
referenceId?: string | undefined;
destination?: string | undefined;
title?: string | undefined;
};
import type { CompileOptions } from 'micromark-util-types';
import type { Compile } from 'micromark-util-types';
//# sourceMappingURL=compile.d.ts.map
@@ -0,0 +1,50 @@
'use strict';
var test = require('tape');
var setDunderProto = require('../set');
test('setDunderProto', { skip: !setDunderProto }, function (t) {
if (!setDunderProto) {
throw 'should never happen; this is just for type narrowing'; // eslint-disable-line no-throw-literal
}
// @ts-expect-error
t['throws'](function () { setDunderProto(); }, TypeError, 'throws if no arguments');
// @ts-expect-error
t['throws'](function () { setDunderProto(undefined); }, TypeError, 'throws with undefined and nothing');
// @ts-expect-error
t['throws'](function () { setDunderProto(undefined, undefined); }, TypeError, 'throws with undefined and undefined');
// @ts-expect-error
t['throws'](function () { setDunderProto(null); }, TypeError, 'throws with null and undefined');
// @ts-expect-error
t['throws'](function () { setDunderProto(null, undefined); }, TypeError, 'throws with null and undefined');
/** @type {{ inherited?: boolean }} */
var obj = {};
t.ok('toString' in obj, 'object initially has toString');
setDunderProto(obj, null);
t.notOk('toString' in obj, 'object no longer has toString');
t.notOk('inherited' in obj, 'object lacks inherited property');
setDunderProto(obj, { inherited: true });
t.equal(obj.inherited, true, 'object has inherited property');
t.end();
});
test('no dunder proto', { skip: !!setDunderProto }, function (t) {
if ('__proto__' in Object.prototype) {
t['throws'](
// @ts-expect-error
function () { ({}).__proto__ = null; }, // eslint-disable-line no-proto
Error,
'throws when setting Object.prototype.__proto__'
);
} else {
t.notOk('__proto__' in Object.prototype, 'no __proto__ in Object.prototype');
}
t.end();
});
@@ -0,0 +1,636 @@
// A simple implementation of make-array
function makeArray (subject) {
return Array.isArray(subject)
? subject
: [subject]
}
const EMPTY = ''
const SPACE = ' '
const ESCAPE = '\\'
const REGEX_TEST_BLANK_LINE = /^\s+$/
const REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/
const REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/
const REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/
const REGEX_SPLITALL_CRLF = /\r?\n/g
// /foo,
// ./foo,
// ../foo,
// .
// ..
const REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/
const SLASH = '/'
// Do not use ternary expression here, since "istanbul ignore next" is buggy
let TMP_KEY_IGNORE = 'node-ignore'
/* istanbul ignore else */
if (typeof Symbol !== 'undefined') {
TMP_KEY_IGNORE = Symbol.for('node-ignore')
}
const KEY_IGNORE = TMP_KEY_IGNORE
const define = (object, key, value) =>
Object.defineProperty(object, key, {value})
const REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g
const RETURN_FALSE = () => false
// Sanitize the range of a regular expression
// The cases are complicated, see test cases for details
const sanitizeRange = range => range.replace(
REGEX_REGEXP_RANGE,
(match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0)
? match
// Invalid range (out of order) which is ok for gitignore rules but
// fatal for JavaScript regular expression, so eliminate it.
: EMPTY
)
// See fixtures #59
const cleanRangeBackSlash = slashes => {
const {length} = slashes
return slashes.slice(0, length - length % 2)
}
// > If the pattern ends with a slash,
// > it is removed for the purpose of the following description,
// > but it would only find a match with a directory.
// > In other words, foo/ will match a directory foo and paths underneath it,
// > but will not match a regular file or a symbolic link foo
// > (this is consistent with the way how pathspec works in general in Git).
// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`'
// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call
// you could use option `mark: true` with `glob`
// '`foo/`' should not continue with the '`..`'
const REPLACERS = [
[
// remove BOM
// TODO:
// Other similar zero-width characters?
/^\uFEFF/,
() => EMPTY
],
// > Trailing spaces are ignored unless they are quoted with backslash ("\")
[
// (a\ ) -> (a )
// (a ) -> (a)
// (a ) -> (a)
// (a \ ) -> (a )
/((?:\\\\)*?)(\\?\s+)$/,
(_, m1, m2) => m1 + (
m2.indexOf('\\') === 0
? SPACE
: EMPTY
)
],
// replace (\ ) with ' '
// (\ ) -> ' '
// (\\ ) -> '\\ '
// (\\\ ) -> '\\ '
[
/(\\+?)\s/g,
(_, m1) => {
const {length} = m1
return m1.slice(0, length - length % 2) + SPACE
}
],
// Escape metacharacters
// which is written down by users but means special for regular expressions.
// > There are 12 characters with special meanings:
// > - the backslash \,
// > - the caret ^,
// > - the dollar sign $,
// > - the period or dot .,
// > - the vertical bar or pipe symbol |,
// > - the question mark ?,
// > - the asterisk or star *,
// > - the plus sign +,
// > - the opening parenthesis (,
// > - the closing parenthesis ),
// > - and the opening square bracket [,
// > - the opening curly brace {,
// > These special characters are often called "metacharacters".
[
/[\\$.|*+(){^]/g,
match => `\\${match}`
],
[
// > a question mark (?) matches a single character
/(?!\\)\?/g,
() => '[^/]'
],
// leading slash
[
// > A leading slash matches the beginning of the pathname.
// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
// A leading slash matches the beginning of the pathname
/^\//,
() => '^'
],
// replace special metacharacter slash after the leading slash
[
/\//g,
() => '\\/'
],
[
// > A leading "**" followed by a slash means match in all directories.
// > For example, "**/foo" matches file or directory "foo" anywhere,
// > the same as pattern "foo".
// > "**/foo/bar" matches file or directory "bar" anywhere that is directly
// > under directory "foo".
// Notice that the '*'s have been replaced as '\\*'
/^\^*\\\*\\\*\\\//,
// '**/foo' <-> 'foo'
() => '^(?:.*\\/)?'
],
// starting
[
// there will be no leading '/'
// (which has been replaced by section "leading slash")
// If starts with '**', adding a '^' to the regular expression also works
/^(?=[^^])/,
function startingReplacer () {
// If has a slash `/` at the beginning or middle
return !/\/(?!$)/.test(this)
// > Prior to 2.22.1
// > If the pattern does not contain a slash /,
// > Git treats it as a shell glob pattern
// Actually, if there is only a trailing slash,
// git also treats it as a shell glob pattern
// After 2.22.1 (compatible but clearer)
// > If there is a separator at the beginning or middle (or both)
// > of the pattern, then the pattern is relative to the directory
// > level of the particular .gitignore file itself.
// > Otherwise the pattern may also match at any level below
// > the .gitignore level.
? '(?:^|\\/)'
// > Otherwise, Git treats the pattern as a shell glob suitable for
// > consumption by fnmatch(3)
: '^'
}
],
// two globstars
[
// Use lookahead assertions so that we could match more than one `'/**'`
/\\\/\\\*\\\*(?=\\\/|$)/g,
// Zero, one or several directories
// should not use '*', or it will be replaced by the next replacer
// Check if it is not the last `'/**'`
(_, index, str) => index + 6 < str.length
// case: /**/
// > A slash followed by two consecutive asterisks then a slash matches
// > zero or more directories.
// > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.
// '/**/'
? '(?:\\/[^\\/]+)*'
// case: /**
// > A trailing `"/**"` matches everything inside.
// #21: everything inside but it should not include the current folder
: '\\/.+'
],
// normal intermediate wildcards
[
// Never replace escaped '*'
// ignore rule '\*' will match the path '*'
// 'abc.*/' -> go
// 'abc.*' -> skip this rule,
// coz trailing single wildcard will be handed by [trailing wildcard]
/(^|[^\\]+)(\\\*)+(?=.+)/g,
// '*.js' matches '.js'
// '*.js' doesn't match 'abc'
(_, p1, p2) => {
// 1.
// > An asterisk "*" matches anything except a slash.
// 2.
// > Other consecutive asterisks are considered regular asterisks
// > and will match according to the previous rules.
const unescaped = p2.replace(/\\\*/g, '[^\\/]*')
return p1 + unescaped
}
],
[
// unescape, revert step 3 except for back slash
// For example, if a user escape a '\\*',
// after step 3, the result will be '\\\\\\*'
/\\\\\\(?=[$.|*+(){^])/g,
() => ESCAPE
],
[
// '\\\\' -> '\\'
/\\\\/g,
() => ESCAPE
],
[
// > The range notation, e.g. [a-zA-Z],
// > can be used to match one of the characters in a range.
// `\` is escaped by step 3
/(\\)?\[([^\]/]*?)(\\*)($|\])/g,
(match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE
// '\\[bar]' -> '\\\\[bar\\]'
? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}`
: close === ']'
? endEscape.length % 2 === 0
// A normal case, and it is a range notation
// '[bar]'
// '[bar\\\\]'
? `[${sanitizeRange(range)}${endEscape}]`
// Invalid range notaton
// '[bar\\]' -> '[bar\\\\]'
: '[]'
: '[]'
],
// ending
[
// 'js' will not match 'js.'
// 'ab' will not match 'abc'
/(?:[^*])$/,
// WTF!
// https://git-scm.com/docs/gitignore
// changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
// which re-fixes #24, #38
// > If there is a separator at the end of the pattern then the pattern
// > will only match directories, otherwise the pattern can match both
// > files and directories.
// 'js*' will not match 'a.js'
// 'js/' will not match 'a.js'
// 'js' will match 'a.js' and 'a.js/'
match => /\/$/.test(match)
// foo/ will not match 'foo'
? `${match}$`
// foo matches 'foo' and 'foo/'
: `${match}(?=$|\\/$)`
],
// trailing wildcard
[
/(\^|\\\/)?\\\*$/,
(_, p1) => {
const prefix = p1
// '\^':
// '/*' does not match EMPTY
// '/*' does not match everything
// '\\\/':
// 'abc/*' does not match 'abc/'
? `${p1}[^/]+`
// 'a*' matches 'a'
// 'a*' matches 'aa'
: '[^/]*'
return `${prefix}(?=$|\\/$)`
}
],
]
// A simple cache, because an ignore rule only has only one certain meaning
const regexCache = Object.create(null)
// @param {pattern}
const makeRegex = (pattern, ignoreCase) => {
let source = regexCache[pattern]
if (!source) {
source = REPLACERS.reduce(
(prev, [matcher, replacer]) =>
prev.replace(matcher, replacer.bind(pattern)),
pattern
)
regexCache[pattern] = source
}
return ignoreCase
? new RegExp(source, 'i')
: new RegExp(source)
}
const isString = subject => typeof subject === 'string'
// > A blank line matches no files, so it can serve as a separator for readability.
const checkPattern = pattern => pattern
&& isString(pattern)
&& !REGEX_TEST_BLANK_LINE.test(pattern)
&& !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern)
// > A line starting with # serves as a comment.
&& pattern.indexOf('#') !== 0
const splitPattern = pattern => pattern.split(REGEX_SPLITALL_CRLF)
class IgnoreRule {
constructor (
origin,
pattern,
negative,
regex
) {
this.origin = origin
this.pattern = pattern
this.negative = negative
this.regex = regex
}
}
const createRule = (pattern, ignoreCase) => {
const origin = pattern
let negative = false
// > An optional prefix "!" which negates the pattern;
if (pattern.indexOf('!') === 0) {
negative = true
pattern = pattern.substr(1)
}
pattern = pattern
// > Put a backslash ("\") in front of the first "!" for patterns that
// > begin with a literal "!", for example, `"\!important!.txt"`.
.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!')
// > Put a backslash ("\") in front of the first hash for patterns that
// > begin with a hash.
.replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#')
const regex = makeRegex(pattern, ignoreCase)
return new IgnoreRule(
origin,
pattern,
negative,
regex
)
}
const throwError = (message, Ctor) => {
throw new Ctor(message)
}
const checkPath = (path, originalPath, doThrow) => {
if (!isString(path)) {
return doThrow(
`path must be a string, but got \`${originalPath}\``,
TypeError
)
}
// We don't know if we should ignore EMPTY, so throw
if (!path) {
return doThrow(`path must not be empty`, TypeError)
}
// Check if it is a relative path
if (checkPath.isNotRelative(path)) {
const r = '`path.relative()`d'
return doThrow(
`path should be a ${r} string, but got "${originalPath}"`,
RangeError
)
}
return true
}
const isNotRelative = path => REGEX_TEST_INVALID_PATH.test(path)
checkPath.isNotRelative = isNotRelative
checkPath.convert = p => p
class Ignore {
constructor ({
ignorecase = true,
ignoreCase = ignorecase,
allowRelativePaths = false
} = {}) {
define(this, KEY_IGNORE, true)
this._rules = []
this._ignoreCase = ignoreCase
this._allowRelativePaths = allowRelativePaths
this._initCache()
}
_initCache () {
this._ignoreCache = Object.create(null)
this._testCache = Object.create(null)
}
_addPattern (pattern) {
// #32
if (pattern && pattern[KEY_IGNORE]) {
this._rules = this._rules.concat(pattern._rules)
this._added = true
return
}
if (checkPattern(pattern)) {
const rule = createRule(pattern, this._ignoreCase)
this._added = true
this._rules.push(rule)
}
}
// @param {Array<string> | string | Ignore} pattern
add (pattern) {
this._added = false
makeArray(
isString(pattern)
? splitPattern(pattern)
: pattern
).forEach(this._addPattern, this)
// Some rules have just added to the ignore,
// making the behavior changed.
if (this._added) {
this._initCache()
}
return this
}
// legacy
addPattern (pattern) {
return this.add(pattern)
}
// | ignored : unignored
// negative | 0:0 | 0:1 | 1:0 | 1:1
// -------- | ------- | ------- | ------- | --------
// 0 | TEST | TEST | SKIP | X
// 1 | TESTIF | SKIP | TEST | X
// - SKIP: always skip
// - TEST: always test
// - TESTIF: only test if checkUnignored
// - X: that never happen
// @param {boolean} whether should check if the path is unignored,
// setting `checkUnignored` to `false` could reduce additional
// path matching.
// @returns {TestResult} true if a file is ignored
_testOne (path, checkUnignored) {
let ignored = false
let unignored = false
this._rules.forEach(rule => {
const {negative} = rule
if (
unignored === negative && ignored !== unignored
|| negative && !ignored && !unignored && !checkUnignored
) {
return
}
const matched = rule.regex.test(path)
if (matched) {
ignored = !negative
unignored = negative
}
})
return {
ignored,
unignored
}
}
// @returns {TestResult}
_test (originalPath, cache, checkUnignored, slices) {
const path = originalPath
// Supports nullable path
&& checkPath.convert(originalPath)
checkPath(
path,
originalPath,
this._allowRelativePaths
? RETURN_FALSE
: throwError
)
return this._t(path, cache, checkUnignored, slices)
}
_t (path, cache, checkUnignored, slices) {
if (path in cache) {
return cache[path]
}
if (!slices) {
// path/to/a.js
// ['path', 'to', 'a.js']
slices = path.split(SLASH)
}
slices.pop()
// If the path has no parent directory, just test it
if (!slices.length) {
return cache[path] = this._testOne(path, checkUnignored)
}
const parent = this._t(
slices.join(SLASH) + SLASH,
cache,
checkUnignored,
slices
)
// If the path contains a parent directory, check the parent first
return cache[path] = parent.ignored
// > It is not possible to re-include a file if a parent directory of
// > that file is excluded.
? parent
: this._testOne(path, checkUnignored)
}
ignores (path) {
return this._test(path, this._ignoreCache, false).ignored
}
createFilter () {
return path => !this.ignores(path)
}
filter (paths) {
return makeArray(paths).filter(this.createFilter())
}
// @returns {TestResult}
test (path) {
return this._test(path, this._testCache, true)
}
}
const factory = options => new Ignore(options)
const isPathValid = path =>
checkPath(path && checkPath.convert(path), path, RETURN_FALSE)
factory.isPathValid = isPathValid
// Fixes typescript
factory.default = factory
module.exports = factory
// Windows
// --------------------------------------------------------------
/* istanbul ignore if */
if (
// Detect `process` so that it can run in browsers.
typeof process !== 'undefined'
&& (
process.env && process.env.IGNORE_TEST_WIN32
|| process.platform === 'win32'
)
) {
/* eslint no-control-regex: "off" */
const makePosix = str => /^\\\\\?\\/.test(str)
|| /["<>|\u0000-\u001F]+/u.test(str)
? str
: str.replace(/\\/g, '/')
checkPath.convert = makePosix
// 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/'
// 'd:\\foo'
const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i
checkPath.isNotRelative = path =>
REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path)
|| isNotRelative(path)
}
@@ -0,0 +1,48 @@
/**
* 最大触摸时间
*/
export declare const maxTouchTime = 200;
/**
* 默认动画速度
*/
export declare const defaultSpeed = 400;
/**
* 默认动画函数
*/
export declare const defaultEasing = "cubic-bezier(0.25, 0.8, 0.25, 1)";
/**
* 最大滑动切换图片距离
*/
export declare const maxMoveOffset = 40;
/**
* 图片的间隔
*/
export declare const horizontalOffset = 20;
/**
* 最小初始响应距离
*/
export declare const minStartTouchOffset = 20;
/**
* 默认背景透明度
*/
export declare const defaultOpacity = 1;
/**
* 最小缩放度
*/
export declare const minScale = 1;
/**
* 最大缩放度(若图片足够大,则会超出)
*/
export declare const maxScale = 6;
/**
* 最小长图模式比例
*/
export declare const longModeRatio = 3;
/**
* 缩放弹性缓冲
*/
export declare const scaleBuffer = 0.2;
/**
* 最大等待动画时间
*/
export declare const maxWaitAnimationTime = 250;
@@ -0,0 +1,25 @@
var arrayPush = require('./_arrayPush'),
getPrototype = require('./_getPrototype'),
getSymbols = require('./_getSymbols'),
stubArray = require('./stubArray');
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* Creates an array of the own and inherited enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
object = getPrototype(object);
}
return result;
};
module.exports = getSymbolsIn;
@@ -0,0 +1,4 @@
/** @type {Construct} */
export const thematicBreak: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=thematic-break.d.ts.map
@@ -0,0 +1,7 @@
"use client";
import {
scaleInOut
} from "./chunk-I7NTTF2N.mjs";
export {
scaleInOut
};
@@ -0,0 +1,56 @@
{
"name": "unc-path-regex",
"description": "Regular expression for testing if a file path is a windows UNC file path. Can also be used as a component of another regexp via the `.source` property.",
"version": "0.1.2",
"homepage": "https://github.com/regexhq/unc-path-regex",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"repository": {
"type" : "git",
"url": "https://github.com/regexhq/unc-path-regex.git"
},
"bugs": {
"url": "https://github.com/regexhq/unc-path-regex/issues"
},
"license": "MIT",
"files": [
"index.js"
],
"main": "index.js",
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "mocha"
},
"devDependencies": {
"mocha": "*"
},
"keywords": [
"absolute",
"expression",
"file",
"filepath",
"match",
"matching",
"path",
"regex",
"regexp",
"regular",
"unc",
"win",
"windows"
],
"verb": {
"related": {
"list": [
"dotfile-regex",
"is-unc-path",
"unc-path-regex",
"dotdir-regex",
"path-regex",
"dirname-regex",
"is-glob"
]
}
}
}
@@ -0,0 +1,29 @@
const {showInvisibles, generateDifferences} = require('..');
const assert = require('assert');
describe('showInvisibles', () => {
it('shows invisibles', () => {
assert.strictEqual(showInvisibles('1 2\n3\t4\r5'), '1·2⏎3↹4␍5');
});
});
describe('generateDifferences', () => {
it('operation: insert', () => {
const differences = generateDifferences('abc', 'abcdef');
assert.deepStrictEqual(differences, [
{operation: 'insert', offset: 3, insertText: 'def'},
]);
});
it('operation: delete', () => {
const differences = generateDifferences('abcdef', 'abc');
assert.deepStrictEqual(differences, [
{operation: 'delete', offset: 3, deleteText: 'def'},
]);
});
it('operation: replace', () => {
const differences = generateDifferences('abc', 'def');
assert.deepStrictEqual(differences, [
{operation: 'replace', offset: 0, deleteText: 'abc', insertText: 'def'},
]);
});
});
@@ -0,0 +1,23 @@
// src/index.ts
import { useEffect, useRef } from "react";
var useUpdateEffect = (effect, deps) => {
const renderCycleRef = useRef(false);
const effectCycleRef = useRef(false);
useEffect(() => {
const isMounted = renderCycleRef.current;
const shouldRun = isMounted && effectCycleRef.current;
if (shouldRun) {
return effect();
}
effectCycleRef.current = true;
}, deps);
useEffect(() => {
renderCycleRef.current = true;
return () => {
renderCycleRef.current = false;
};
}, []);
};
export {
useUpdateEffect
};
@@ -0,0 +1 @@
{"name":"ansi-styles","version":"4.3.0","requiresBuild":false,"files":{"license":{"checkedAt":1794532093863,"integrity":"sha512-nIst73auX/5NY2Fmv5Y116vWnNrEv4GaIUX3lpZG05rpXJY2S8EX+fpUS5hRjClCM0VdT2Za9DDHXXB5jdSrEw==","mode":420,"size":1109},"index.js":{"checkedAt":1794532093863,"integrity":"sha512-NN25IIkUrFPtfA5xYvdNAxOo80jzTbgkQUAoMTwD3mdJlayYu/hW9SGdRNGvFFX6QWeOsU28RjlWe5In7xHKMQ==","mode":420,"size":4139},"package.json":{"checkedAt":1794532093863,"integrity":"sha512-TZllXr06wJQwq2vrQx1PlfcbrEjIf2fRDP4mFPd7IGVaR+7Llz2hNV4VEENE3EaIpsffEoUUAF2b1UYsjtxiww==","mode":420,"size":1054},"readme.md":{"checkedAt":1794532093864,"integrity":"sha512-SnSiNWeK8yC+9cpXRtMfMfucXAGsPaSZAYwvQhaDSlMJbhBDAJEbIrgOFsK7JdZzyt5tc8TogH7xfxLnVp0+Jg==","mode":420,"size":4327},"index.d.ts":{"checkedAt":1794532093864,"integrity":"sha512-aMh/+pjt6z2J6FBf5er5SXdZH2a5eiWFgayCMy6HQgE7qUeUJvpxPsZgRE67W0LdiunJkpBMAo+RpVwK72TMyQ==","mode":420,"size":6349}}}
@@ -0,0 +1,80 @@
// ------------------------------------------------------------------
// Infrastructure
// ------------------------------------------------------------------
export * from './type/clone/index.mjs';
export * from './type/create/index.mjs';
export * from './type/error/index.mjs';
export * from './type/guard/index.mjs';
export * from './type/helpers/index.mjs';
export * from './type/patterns/index.mjs';
export * from './type/registry/index.mjs';
export * from './type/sets/index.mjs';
export * from './type/symbols/index.mjs';
// ------------------------------------------------------------------
// Types
// ------------------------------------------------------------------
export * from './type/any/index.mjs';
export * from './type/array/index.mjs';
export * from './type/argument/index.mjs';
export * from './type/async-iterator/index.mjs';
export * from './type/awaited/index.mjs';
export * from './type/bigint/index.mjs';
export * from './type/boolean/index.mjs';
export * from './type/composite/index.mjs';
export * from './type/const/index.mjs';
export * from './type/constructor/index.mjs';
export * from './type/constructor-parameters/index.mjs';
export * from './type/date/index.mjs';
export * from './type/enum/index.mjs';
export * from './type/exclude/index.mjs';
export * from './type/extends/index.mjs';
export * from './type/extract/index.mjs';
export * from './type/function/index.mjs';
export * from './type/indexed/index.mjs';
export * from './type/instance-type/index.mjs';
export * from './type/instantiate/index.mjs';
export * from './type/integer/index.mjs';
export * from './type/intersect/index.mjs';
export * from './type/iterator/index.mjs';
export * from './type/intrinsic/index.mjs';
export * from './type/keyof/index.mjs';
export * from './type/literal/index.mjs';
export * from './type/module/index.mjs';
export * from './type/mapped/index.mjs';
export * from './type/never/index.mjs';
export * from './type/not/index.mjs';
export * from './type/null/index.mjs';
export * from './type/number/index.mjs';
export * from './type/object/index.mjs';
export * from './type/omit/index.mjs';
export * from './type/optional/index.mjs';
export * from './type/parameters/index.mjs';
export * from './type/partial/index.mjs';
export * from './type/pick/index.mjs';
export * from './type/promise/index.mjs';
export * from './type/readonly/index.mjs';
export * from './type/readonly-optional/index.mjs';
export * from './type/record/index.mjs';
export * from './type/recursive/index.mjs';
export * from './type/ref/index.mjs';
export * from './type/regexp/index.mjs';
export * from './type/required/index.mjs';
export * from './type/rest/index.mjs';
export * from './type/return-type/index.mjs';
export * from './type/schema/index.mjs';
export * from './type/static/index.mjs';
export * from './type/string/index.mjs';
export * from './type/symbol/index.mjs';
export * from './type/template-literal/index.mjs';
export * from './type/transform/index.mjs';
export * from './type/tuple/index.mjs';
export * from './type/uint8array/index.mjs';
export * from './type/undefined/index.mjs';
export * from './type/union/index.mjs';
export * from './type/unknown/index.mjs';
export * from './type/unsafe/index.mjs';
export * from './type/void/index.mjs';
// ------------------------------------------------------------------
// Type.*
// ------------------------------------------------------------------
export * from './type/type/index.mjs';
@@ -0,0 +1,88 @@
"use strict";
function padLeft(val, len) {
return String(val).padStart(len || 2, "0");
}
function dateTimeFormat(date, opts) {
return new Intl.DateTimeFormat("en-US", opts).format(date);
}
function getOrdinalSuffix(day) {
if (day > 3 && day < 21) {
return "th";
}
switch (day % 10) {
case 1:
return "st";
case 2:
return "nd";
case 3:
return "rd";
default:
return "th";
}
}
function timezone(date, together) {
let offset = date.getTimezoneOffset();
let prefix;
if (offset <= 0) {
prefix = "+";
offset = Math.abs(offset);
} else {
prefix = "-";
}
return `${prefix}${padLeft(Math.floor(offset / 60))}${together ? "" : ":"}${padLeft(Math.floor(offset % 60))}`;
}
const FORMAT_MAP = {
// 年份
yyyy: (d) => d.getFullYear(),
YYYY: (d) => d.getFullYear(),
YY: (d) => padLeft(d.getFullYear() % 100),
// 月份
MMMM: (d) => dateTimeFormat(d, { month: "long" }),
MMM: (d) => dateTimeFormat(d, { month: "short" }),
MM: (d) => padLeft(d.getMonth() + 1),
M: (d) => d.getMonth() + 1,
// 日期
DD: (d) => padLeft(d.getDate()),
D: (d) => d.getDate(),
Do: (d) => {
const day = d.getDate();
return String(day) + getOrdinalSuffix(day);
},
// 星期
dddd: (d) => dateTimeFormat(d, { weekday: "long" }),
ddd: (d) => dateTimeFormat(d, { weekday: "short" }),
dd: (d) => dateTimeFormat(d, { weekday: "narrow" }),
// 时间
HH: (d) => padLeft(d.getHours()),
H: (d) => d.getHours(),
hh: (d) => padLeft(d.getHours() % 12 || 12),
h: (d) => d.getHours() % 12 || 12,
mm: (d) => padLeft(d.getMinutes()),
m: (d) => d.getMinutes(),
ss: (d) => padLeft(d.getSeconds()),
s: (d) => d.getSeconds(),
SSS: (d) => padLeft(d.getMilliseconds(), 3),
// 其他
A: (d) => d.getHours() >= 12 ? "PM" : "AM",
a: (d) => d.getHours() >= 12 ? "pm" : "am",
Z: (d) => timezone(d),
ZZ: (d) => timezone(d, true)
};
const tokens = Object.keys(FORMAT_MAP).sort((a, b) => b.length - a.length).join("|");
const pattern = new RegExp(
`${tokens}|\\[([^\\]]*)]`,
"g"
);
function format(date, formatString) {
if (!formatString || formatString === "ISO") {
return date.toISOString();
}
return formatString.replace(pattern, (match, escapeContent) => {
if (escapeContent) {
return escapeContent;
}
const formatter = FORMAT_MAP[match];
return formatter ? formatter(date) : match;
});
}
module.exports = format;
@@ -0,0 +1,28 @@
import { GetPacketStatusDepends } from '../../action/packet/GetPacketStatus';
import { Static } from '@sinclair/typebox';
declare const PayloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
}>;
type PayloadType = Static<typeof PayloadSchema>;
declare const ReturnSchema: import("@sinclair/typebox").TVoid;
type ReturnType = Static<typeof ReturnSchema>;
declare class SetGroupSignBase extends GetPacketStatusDepends<PayloadType, ReturnType> {
payloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
}>;
returnSchema: import("@sinclair/typebox").TVoid;
actionSummary: string;
actionTags: string[];
payloadExample: {
group_id: string;
};
returnExample: null;
_handle(payload: PayloadType): Promise<void>;
}
export declare class SetGroupSign extends SetGroupSignBase {
actionName: "set_group_sign";
}
export declare class SendGroupSign extends SetGroupSignBase {
actionName: "send_group_sign";
}
export {};
@@ -0,0 +1,636 @@
flf2a$ 6 5 15 -1 23
bell.flf
Lower case letters, punctuation, and miscellaneous changes by Kent Nassen,
kentn@cyberspace.org
Last change: 10/11/94
Upper case letters originally by Joshua Bell:
Newsgroups: alt.ascii-art
From: jsbell@acs.ucalgary.ca (Joshua Bell)
Subject: Yet Another Non-Figlet Font
Message-ID: <Mar13.073432.23373@acs.ucalgary.ca>
Date: Sun, 13 Mar 1994 07:34:32 GMT
Organization: The University of Calgary
Lines: 30
Status: RO
I've had this kicking around for a while. If anyone wants to add
in other characters and Figlet-ize it, go right ahead.
Joshua
--
| "Has it been a bad year, or what?" - Meriadoc Brandybuck, |
| upon returning to the Shire after the War of the Ring. |
| jsbell@acs.ucalgary.ca Academic Computing Services, University of Calgary |
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
$/@
$|@
$|@
$|@
$`@
$'@@
$,,@
$//@
$ $@
$ $@
$ $@
$ $@@
$ . . $@
$ -|--|--@
$ | | $@
$--|--|-$@
$ ' ' $@
$ $@@
@
@
@
@
@
@@
$ _ ,$@
$/ \ / $@
$\_// _$@
$ / / \@
$ / \_/@
$' $@@
@
@
@
@
@
@@
,@
/@
$@
$@
$@
$@@
$ ,@
$/ @
$| @
$| @
$. @
$ `@@
$. @
$ \@
$ |@
$ |@
$ ,@
$' @@
$ . @
$`. | /@
$ \-' @
$ ,|\ @
$/ | \ @
$ $@@
$ , $@
$ | $@
$.----'@
$ | $@
$ ` $@
$ $@@
$$@
$$@
$$@
$$@
$,@
$/@@
$ $@
$ $@
$.---'@
$ $@
$ $@
$ $@@
$$@
$$@
$$@
$$@
$/@
$$@@
$ $@
$ /@
$ /$@
$ ,'$@
$, $@
$ $@@
$ ___/@
$.' /\@
$| / |@
$|,' |@
$/`---'@
$ $@@
$ .$@
$/|$@
$ |$@
$ |$@
$_|_@
$ $@@
$ ___$@
$/ \@
$ _-'@
$ / @
$/___,@
$ @@
$ ___$@
$/ \@
$ _-'@
$ \ @
$\___)@
$ @@
$ $@
$| |$@
$`.__|$@
$ |$@
$ |$@
$ $@@
$ ____@
$| @
$`---.@
$ |@
$\__.'@
$ $@@
$ __$@
$.' @
$|---.@
$| |@
$`._.'@
$ $@@
$ ___$@
$' \@
$ __/@
$ /`@
$ / $@
$ $@@
$ ___ @
$/ \@
$>---<@
$' `@
$`---'@
$ $@@
$ ___ @
$/ \@
$`---|@
$ |@
$`---'@
$ $@@
$$@
$$@
$/@
$$@
$/@
$$@@
$$@
$$@
$/@
$$@
$,@
$/@@
@
@
@
@
@
@@
$ $@
$ $@
$,-----'@
$ $@
$,-----'@
$ $@@
@
@
@
@
@
@@
$ __ $@
$/ `.@
$` '@
$ /$@
$ , $@
$ ' $@@
_____ @
/ __. \@
| / | |@
| \__| |@
| `-'@
`----- @@
. @
/| @
/ \ @
/---'\ @
,' \@
@@
$____ $@
$/ \ @
$|,_-< @
$| `@
$`----'@
$ $@@
$ ___ @
$.' \@
$| @
$| @
$ `.__,@
$ @@
$.___ $@
$/ ` @
$| |@
$| |@
$/---/ @
$ $@@
$.____$@
$/ $@
$|__. $@
$| $@
$/----/@
$ @@
$.____@
$/ @
$|__. @
$| @
$/ @
$ @@
$ ___ $@
$.' \$@
$| $@
$| _$@
$ `.___|@
$ @@
$__ __@
$| | @
$|___| @
$| | @
$/ / @
$ $@@
$_@
$|@
$|@
$|@
$/@
$$@@
$ _______@
$' / @
$ | @
$ | @
$ `--/ @
$ $@@
$. @
$/ /@
$|_-' @
$| \ @
$/ \@
$ @@
$. @
$/ @
$| @
$| @
$/---/@
$ @@
$__ __@
$| | @
$|\ /| @
$| \/ | @
$/ / @
$ @@
$__ _@
$|\ | @
$| \ | @
$| \ | @
$| \| @
$ @@
$ ___ @
$.' `.@
$| |@
$| |@
$ `.__.'@
$ @@
$.___ @
$/ \@
$|,_-'@
$| @
$/ @
$ @@
$ ___ @
$.' `. @
$| | @
$| ,_ | @
$ `._.`-.@
$ @@
$.___ @
$/ \@
$|__-'@
$| \ @
$/ \@
$ @@
$ _____@
$ ( @
$ `--. @
$ | @
$\___.' @
$ @@
$ _______@
$' / @
$ | @
$ | @
$ / @
$ @@
$. .@
$/ /@
$| |@
$| |@
$ `._.' @
$ @@
$__ __@
$| | @
$ \ / @
$ \ / @
$ \/ @
$ @@
$. __@
$/ | @
$| | @
$| /\ / @
$|,' \,' @
$ @@
$_ _@
$`. / @
$ \,' @
$ ,'\ @
$/ \ @
$ @@
$_ _@
$ `. / @
$ `./ @
$ ,' @
$_-' @
$ @@
$ _______ @
$' / @
$ .--' @
$ / @
$,'______/@
$ @@
$__@
$| @
$| @
$| @
$| @
$--@@
$ @
$\ @
$ \ @
$ `. @
$ `.@
$ @@
$__@
$ |@
$ |@
$ |@
$ |@
$--@@
@
@
@
@
@
@@
$ $@
$ $@
$ $@
$ $@
$______,@
$' $@@
$,@
$\@
$$@
$$@
$$@
$$@@
$ $@
$ ___$@
$ / `@
$| |@
$`.__/|@
$ $@@
$_ $@
$\ ___ @
$|/ \@
$| `@
$`___,'@
$ $@@
$ $@
$ ___ @
$.' `@
$| @
$ `._.'@
$ $@@
$ _@
$ ___/@
$ / |@
$,' |@
$`___,'@
$ `@@
$ $@
$ ___$@
$.' `@
$|----'@
$`.___,@
$ $@@
$,__$@
$/ `@
$|__$@
$| $@
$| $@
$/ $@@
$ @
$ ___.@
$.' `@
$| |@
$ `---|@
$ \___/@@
$_ $@
$/ @
$|,---.@
$|' `@
$/ |@
$ $@@
$ @
$`@
$|@
$|@
$/@
$$@@
$ $@
$ .$@
$ \$@
$ |$@
$/` |$@
$\___/`@@
$\ $@
$| ,@
$| / @
$|-< @
$/ \_@
$ $@@
$ . @
$ | @
$ | @
$ | @
$/\__@
$ @@
$ $@
$, _ , _ $@
$|' `|' `.@
$| | |@
$/ ' /@
$ $@@
$ $@
$, __ $@
$|' `.@
$| |@
$/ |@
$ $@@
$ $@
$ __. @
$.' \@
$| |@
$ `._.'@
$ $@@
$ $@
$\,___,@
$| \@
$| |@
$|`---'@
$\ $@@
$ $@
$ ___.$@
$.' `$@
$| |$@
$ `---|.@
$ |/@@
$ $@
$.___$@
$/ \@
$| '@
$/ $@
$ $@@
$ $@
$ ____@
$ ( @
$ `--.$@
$\___.'@
$ $@@
$ . $@
$_/_ @
$ | @
$ | @
$ \__/@
$ $@@
$ $@
$, .@
$| |@
$| |@
$`._/|@
$ $@@
$ $@
$_ __@
$| / @
$` / $@
$ \/ $@
$ $@@
$ @
$, _ /@
$| | |@
$` ^ '@
$ \/ \/$@
$ $@@
$ $@
$_ .-@
$ \,'$@
$ /\ $@
$/ \$@
$ $@@
$ $@
$, .$@
$| `$@
$| |$@
$ `---|.@
$ \___/$@@
$ $@
$____$@
$ /$@
$ ,/ $@
$/__.'@
$` $@@
$ _@
$/ @
_| @
$| @
$\_@
$ $@@
$.@
$|@
$|@
$|@
$|@
$`@@
_ $@
\$@
|_@
|$@
_/$@
$ $@@
@
@
@
@
@
~@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@@ -0,0 +1 @@
{"version":3,"file":"BaseDecoratorInfo.d.ts","sourceRoot":"","sources":["../../../../src/decorator/models/BaseDecoratorInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB,CAAC,KAAK;IACtC,IAAI,EAAE,KAAK,CAAC;IAEZ,WAAW,EAAE,QAAQ,CAAC;CACvB"}
@@ -0,0 +1,28 @@
"use strict";
/**
* Copyright (c) 2019, Microsoft Corporation (MIT License).
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.pollUntil = void 0;
function pollUntil(cb, timeout, interval) {
return new Promise(function (resolve, reject) {
var intervalId = setInterval(function () {
if (cb()) {
clearInterval(intervalId);
clearTimeout(timeoutId);
resolve();
}
}, interval);
var timeoutId = setTimeout(function () {
clearInterval(intervalId);
if (cb()) {
resolve();
}
else {
reject();
}
}, timeout);
});
}
exports.pollUntil = pollUntil;
//# sourceMappingURL=testUtils.test.js.map
@@ -0,0 +1 @@
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],s):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ca=s(e.dayjs)}(this,(function(e){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=s(e),_={name:"ca",weekdays:"Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"),weekdaysShort:"Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),months:"Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"),monthsShort:"Gen._Febr._Març_Abr._Maig_Juny_Jul._Ag._Set._Oct._Nov._Des.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",ll:"D MMM YYYY",lll:"D MMM YYYY, H:mm",llll:"ddd D MMM YYYY, H:mm"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:function(e){return""+e+(1===e||3===e?"r":2===e?"n":4===e?"t":"è")}};return t.default.locale(_,null,!0),_}));
@@ -0,0 +1,79 @@
# once
Only call a function once.
## usage
```javascript
var once = require('once')
function load (file, cb) {
cb = once(cb)
loader.load('file')
loader.once('load', cb)
loader.once('error', cb)
}
```
Or add to the Function.prototype in a responsible way:
```javascript
// only has to be done once
require('once').proto()
function load (file, cb) {
cb = cb.once()
loader.load('file')
loader.once('load', cb)
loader.once('error', cb)
}
```
Ironically, the prototype feature makes this module twice as
complicated as necessary.
To check whether you function has been called, use `fn.called`. Once the
function is called for the first time the return value of the original
function is saved in `fn.value` and subsequent calls will continue to
return this value.
```javascript
var once = require('once')
function load (cb) {
cb = once(cb)
var stream = createStream()
stream.once('data', cb)
stream.once('end', function () {
if (!cb.called) cb(new Error('not found'))
})
}
```
## `once.strict(func)`
Throw an error if the function is called twice.
Some functions are expected to be called only once. Using `once` for them would
potentially hide logical errors.
In the example below, the `greet` function has to call the callback only once:
```javascript
function greet (name, cb) {
// return is missing from the if statement
// when no name is passed, the callback is called twice
if (!name) cb('Hello anonymous')
cb('Hello ' + name)
}
function log (msg) {
console.log(msg)
}
// this will print 'Hello anonymous' but the logical error will be missed
greet(null, once(msg))
// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time
greet(null, once.strict(msg))
```
@@ -0,0 +1 @@
{"name":"@babel/plugin-transform-react-jsx-source","version":"7.27.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532116386,"integrity":"sha512-KYRMN3MVTuiy5XkFDHd5PnQmHaQnt3z16nsBDePxZ9YNmq7IFlslpBBlR3UI+zvlbEemzowOYeKil9a0ZkOYxQ==","mode":420,"size":1106},"README.md":{"checkedAt":1794532117565,"integrity":"sha512-ftA3P2SXNB7lshNdCYCAjNQKwodkfj5mN8X7ig3YqnYpqv8x5HAwjzIDZWApwuOmcgXRGi2tQd8MMSQ9PwOfMw==","mode":420,"size":415},"lib/index.js":{"checkedAt":1794532117565,"integrity":"sha512-xAzZFdwB0rq1ugzbuJxZuItguFj6tcttDhqwAvpxWKWLp0AdNIezKP5UF0vGPoFSC5PfE4CGsxgHJT2Yub3/Wg==","mode":420,"size":1838},"lib/index.js.map":{"checkedAt":1794532117565,"integrity":"sha512-+ZT2uPJ/5H3P2QafhuupiNXa+8P3lZ7/JvZ54fSeHYPKfAme3s/tw/welc0brrbJqNrLry85LNlXVdKenFI0aQ==","mode":420,"size":4906},"package.json":{"checkedAt":1794532117566,"integrity":"sha512-S//0rfxhYwQlUfGhY5EvGmuEXJwvAkxyZi36YF43U8G714dtOBKuxxCgU5Z3gktQY5Dx7k927h0mc2NUfSahig==","mode":420,"size":921}}}
@@ -0,0 +1 @@
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAIM,SAAS,0CAAgB,IAAa,EAAE,gBAA0B;IACvE,IAAI,iBAAiC;IACrC,IAAI,CAAA,GAAA,sCAAW,EAAE,gBAAgB,mBAC/B,iBAAiB,eAAe,aAAa;IAG/C,MAAO,kBAAkB,CAAC,CAAA,GAAA,sCAAW,EAAE,gBAAgB,kBACrD,iBAAiB,eAAe,aAAa;IAG/C,OAAO,kBAAkB,SAAS,gBAAgB,IAAI,SAAS,eAAe;AAChF","sources":["packages/@react-aria/utils/src/getScrollParent.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 {isScrollable} from './isScrollable';\n\nexport function getScrollParent(node: Element, checkForOverflow?: boolean): Element {\n let scrollableNode: Element | null = node;\n if (isScrollable(scrollableNode, checkForOverflow)) {\n scrollableNode = scrollableNode.parentElement;\n }\n\n while (scrollableNode && !isScrollable(scrollableNode, checkForOverflow)) {\n scrollableNode = scrollableNode.parentElement;\n }\n\n return scrollableNode || document.scrollingElement || document.documentElement;\n}\n\n"],"names":[],"version":3,"file":"getScrollParent.main.js.map"}
@@ -0,0 +1 @@
{"version":3,"file":"container_module.int.spec.d.ts","sourceRoot":"","sources":["../../../../src/test/container/container_module.int.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,69 @@
/*
@license
Rollup.js v4.53.2
Mon, 10 Nov 2025 08:56:08 GMT - commit d8b0150971681d9efa4f173de5edd2c79a6e03d9
https://github.com/rollup/rollup
Released under the MIT License.
*/
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const getLogFilter = filters => {
if (filters.length === 0)
return () => true;
const normalizedFilters = filters.map(filter => filter.split('&').map(subFilter => {
const inverted = subFilter[0] === '!';
if (inverted)
subFilter = subFilter.slice(1);
const [key, ...value] = subFilter.split(':');
return { inverted, key: key.split('.'), parts: value.join(':').split('*') };
}));
return (log) => {
nextIntersectedFilter: for (const intersectedFilters of normalizedFilters) {
for (const { inverted, key, parts } of intersectedFilters) {
const isFilterSatisfied = testFilter(log, key, parts);
if (inverted ? isFilterSatisfied : !isFilterSatisfied) {
continue nextIntersectedFilter;
}
}
return true;
}
return false;
};
};
const testFilter = (log, key, parts) => {
let rawValue = log;
for (let index = 0; index < key.length; index++) {
if (!rawValue) {
return false;
}
const part = key[index];
if (!(part in rawValue)) {
return false;
}
rawValue = rawValue[part];
}
let value = typeof rawValue === 'object' ? JSON.stringify(rawValue) : String(rawValue);
if (parts.length === 1) {
return value === parts[0];
}
if (!value.startsWith(parts[0])) {
return false;
}
const lastPartIndex = parts.length - 1;
for (let index = 1; index < lastPartIndex; index++) {
const part = parts[index];
const position = value.indexOf(part);
if (position === -1) {
return false;
}
value = value.slice(position + part.length);
}
return value.endsWith(parts[lastPartIndex]);
};
exports.getLogFilter = getLogFilter;
//# sourceMappingURL=getLogFilter.js.map
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more