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,83 @@
const t = require('tap')
const MPS = require('../')
t.test('ok if size checks out', t => {
const mps = new MPS({ size: 4 })
mps.write(Buffer.from('a').toString('hex'), 'hex')
mps.write(Buffer.from('sd'))
mps.end('f')
return mps.concat().then(data => t.equal(data.toString(), 'asdf'))
})
t.test('error if size exceeded', t => {
const mps = new MPS({ size: 1 })
mps.on('error', er => {
t.match(er, {
message: 'Bad data size: expected 1 bytes, but got 4',
found: 4,
expect: 1,
code: 'EBADSIZE',
name: 'SizeError',
})
t.end()
})
mps.write('asdf')
})
t.test('error if size is not met', t => {
const mps = new MPS({ size: 999 })
t.throws(() => mps.end(), {
message: 'Bad data size: expected 999 bytes, but got 0',
found: 0,
name: 'SizeError',
expect: 999,
code: 'EBADSIZE',
})
t.end()
})
t.test('error if non-string/buffer is written', t => {
const mps = new MPS({size:1})
mps.on('error', er => {
t.match(er, {
message: 'MinipassSized streams only work with string and buffer data'
})
t.end()
})
mps.write({some:'object'})
})
t.test('projectiles', t => {
t.throws(() => new MPS(), {
message: 'invalid expected size: undefined'
}, 'size is required')
t.throws(() => new MPS({size: true}), {
message: 'invalid expected size: true'
}, 'size must be number')
t.throws(() => new MPS({size: NaN}), {
message: 'invalid expected size: NaN'
}, 'size must not be NaN')
t.throws(() => new MPS({size:1.2}), {
message: 'invalid expected size: 1.2'
}, 'size must be integer')
t.throws(() => new MPS({size: Infinity}), {
message: 'invalid expected size: Infinity'
}, 'size must be finite')
t.throws(() => new MPS({size: -1}), {
message: 'invalid expected size: -1'
}, 'size must be positive')
t.throws(() => new MPS({objectMode: true}), {
message: 'MinipassSized streams only work with string and buffer data'
}, 'no objectMode')
t.throws(() => new MPS({size: Number.MAX_SAFE_INTEGER + 1000000}), {
message: 'invalid expected size: 9007199255740992'
})
t.end()
})
t.test('exports SizeError class', t => {
t.isa(MPS.SizeError, 'function')
t.isa(MPS.SizeError.prototype, Error)
t.end()
})
@@ -0,0 +1,18 @@
import BaseTheme, { BaseTooltip } from './base.js';
import type { Bounds } from '../core/selection.js';
import Quill from '../core/quill.js';
import type { ThemeOptions } from '../core/theme.js';
import type Toolbar from '../modules/toolbar.js';
declare class BubbleTooltip extends BaseTooltip {
static TEMPLATE: string;
constructor(quill: Quill, bounds?: HTMLElement);
listen(): void;
cancel(): void;
position(reference: Bounds): number;
}
declare class BubbleTheme extends BaseTheme {
tooltip: BubbleTooltip;
constructor(quill: Quill, options: ThemeOptions);
extendToolbar(toolbar: Toolbar): void;
}
export { BubbleTooltip, BubbleTheme as default };
@@ -0,0 +1,285 @@
/**
* @fileoverview Forbid target='_blank' attribute
* @author Kevin Miller
*/
'use strict';
const includes = require('array-includes');
const docsUrl = require('../util/docsUrl');
const linkComponentsUtil = require('../util/linkComponents');
const report = require('../util/report');
// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------
function findLastIndex(arr, condition) {
for (let i = arr.length - 1; i >= 0; i -= 1) {
if (condition(arr[i])) {
return i;
}
}
return -1;
}
function attributeValuePossiblyBlank(attribute) {
if (!attribute || !attribute.value) {
return false;
}
const value = attribute.value;
if (value.type === 'Literal') {
return typeof value.value === 'string' && value.value.toLowerCase() === '_blank';
}
if (value.type === 'JSXExpressionContainer') {
const expr = value.expression;
if (expr.type === 'Literal') {
return typeof expr.value === 'string' && expr.value.toLowerCase() === '_blank';
}
if (expr.type === 'ConditionalExpression') {
if (expr.alternate.type === 'Literal' && expr.alternate.value && expr.alternate.value.toLowerCase() === '_blank') {
return true;
}
if (expr.consequent.type === 'Literal' && expr.consequent.value && expr.consequent.value.toLowerCase() === '_blank') {
return true;
}
}
}
return false;
}
function hasExternalLink(node, linkAttributes, warnOnSpreadAttributes, spreadAttributeIndex) {
const linkIndex = findLastIndex(node.attributes, (attr) => attr.name && includes(linkAttributes, attr.name.name));
const foundExternalLink = linkIndex !== -1 && ((attr) => attr.value && attr.value.type === 'Literal' && /^(?:\w+:|\/\/)/.test(attr.value.value))(
node.attributes[linkIndex]);
return foundExternalLink || (warnOnSpreadAttributes && linkIndex < spreadAttributeIndex);
}
function hasDynamicLink(node, linkAttributes) {
const dynamicLinkIndex = findLastIndex(node.attributes, (attr) => attr.name
&& includes(linkAttributes, attr.name.name)
&& attr.value
&& attr.value.type === 'JSXExpressionContainer');
if (dynamicLinkIndex !== -1) {
return true;
}
}
/**
* Get the string(s) from a value
* @param {ASTNode} value The AST node being checked.
* @param {ASTNode} targetValue The AST node being checked.
* @returns {string | string[] | null} The string value, or null if not a string.
*/
function getStringFromValue(value, targetValue) {
if (value) {
if (value.type === 'Literal') {
return value.value;
}
if (value.type === 'JSXExpressionContainer') {
if (value.expression.type === 'TemplateLiteral') {
return value.expression.quasis[0].value.cooked;
}
const expr = value.expression;
if (expr && expr.type === 'ConditionalExpression') {
const relValues = [expr.consequent.value, expr.alternate.value];
if (targetValue.type === 'JSXExpressionContainer' && targetValue.expression && targetValue.expression.type === 'ConditionalExpression') {
const targetTestCond = targetValue.expression.test.name;
const relTestCond = value.expression.test.name;
if (targetTestCond === relTestCond) {
const targetBlankIndex = [targetValue.expression.consequent.value, targetValue.expression.alternate.value].indexOf('_blank');
return relValues[targetBlankIndex];
}
}
return relValues;
}
return expr.value;
}
}
return null;
}
function hasSecureRel(node, allowReferrer, warnOnSpreadAttributes, spreadAttributeIndex) {
const relIndex = findLastIndex(node.attributes, (attr) => (attr.type === 'JSXAttribute' && attr.name.name === 'rel'));
const targetIndex = findLastIndex(node.attributes, (attr) => (attr.type === 'JSXAttribute' && attr.name.name === 'target'));
if (relIndex === -1 || (warnOnSpreadAttributes && relIndex < spreadAttributeIndex)) {
return false;
}
const relAttribute = node.attributes[relIndex];
const targetAttributeValue = node.attributes[targetIndex] && node.attributes[targetIndex].value;
const value = getStringFromValue(relAttribute.value, targetAttributeValue);
return [].concat(value).every((item) => {
const tags = typeof item === 'string' ? item.toLowerCase().split(' ') : false;
const noreferrer = tags && tags.indexOf('noreferrer') >= 0;
if (noreferrer) {
return true;
}
const noopener = tags && tags.indexOf('noopener') >= 0;
return allowReferrer && noopener;
});
}
const messages = {
noTargetBlankWithoutNoreferrer: 'Using target="_blank" without rel="noreferrer" (which implies rel="noopener") is a security risk in older browsers: see https://mathiasbynens.github.io/rel-noopener/#recommendations',
noTargetBlankWithoutNoopener: 'Using target="_blank" without rel="noreferrer" or rel="noopener" (the former implies the latter and is preferred due to wider support) is a security risk: see https://mathiasbynens.github.io/rel-noopener/#recommendations',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
fixable: 'code',
docs: {
description: 'Disallow `target="_blank"` attribute without `rel="noreferrer"`',
category: 'Best Practices',
recommended: true,
url: docsUrl('jsx-no-target-blank'),
},
messages,
schema: [{
type: 'object',
properties: {
allowReferrer: {
type: 'boolean',
},
enforceDynamicLinks: {
enum: ['always', 'never'],
},
warnOnSpreadAttributes: {
type: 'boolean',
},
links: {
type: 'boolean',
default: true,
},
forms: {
type: 'boolean',
default: false,
},
},
additionalProperties: false,
}],
},
create(context) {
const configuration = Object.assign(
{
allowReferrer: false,
warnOnSpreadAttributes: false,
links: true,
forms: false,
},
context.options[0]
);
const allowReferrer = configuration.allowReferrer;
const warnOnSpreadAttributes = configuration.warnOnSpreadAttributes;
const enforceDynamicLinks = configuration.enforceDynamicLinks || 'always';
const linkComponents = linkComponentsUtil.getLinkComponents(context);
const formComponents = linkComponentsUtil.getFormComponents(context);
return {
JSXOpeningElement(node) {
const targetIndex = findLastIndex(node.attributes, (attr) => attr.name && attr.name.name === 'target');
const spreadAttributeIndex = findLastIndex(node.attributes, (attr) => (attr.type === 'JSXSpreadAttribute'));
if (linkComponents.has(node.name.name)) {
if (!attributeValuePossiblyBlank(node.attributes[targetIndex])) {
const hasSpread = spreadAttributeIndex >= 0;
if (warnOnSpreadAttributes && hasSpread) {
// continue to check below
} else if ((hasSpread && targetIndex < spreadAttributeIndex) || !hasSpread || !warnOnSpreadAttributes) {
return;
}
}
const linkAttributes = linkComponents.get(node.name.name);
const hasDangerousLink = hasExternalLink(node, linkAttributes, warnOnSpreadAttributes, spreadAttributeIndex)
|| (enforceDynamicLinks === 'always' && hasDynamicLink(node, linkAttributes));
if (hasDangerousLink && !hasSecureRel(node, allowReferrer, warnOnSpreadAttributes, spreadAttributeIndex)) {
const messageId = allowReferrer ? 'noTargetBlankWithoutNoopener' : 'noTargetBlankWithoutNoreferrer';
const relValue = allowReferrer ? 'noopener' : 'noreferrer';
report(context, messages[messageId], messageId, {
node,
fix(fixer) {
// eslint 5 uses `node.attributes`; eslint 6+ uses `node.parent.attributes`
const nodeWithAttrs = node.parent.attributes ? node.parent : node;
// eslint 5 does not provide a `name` property on JSXSpreadElements
const relAttribute = nodeWithAttrs.attributes.find((attr) => attr.name && attr.name.name === 'rel');
if (targetIndex < spreadAttributeIndex || (spreadAttributeIndex >= 0 && !relAttribute)) {
return null;
}
if (!relAttribute) {
return fixer.insertTextAfter(nodeWithAttrs.attributes.slice(-1)[0], ` rel="${relValue}"`);
}
if (!relAttribute.value) {
return fixer.insertTextAfter(relAttribute, `="${relValue}"`);
}
if (relAttribute.value.type === 'Literal') {
const parts = relAttribute.value.value
.split('noreferrer')
.filter(Boolean);
return fixer.replaceText(relAttribute.value, `"${parts.concat('noreferrer').join(' ')}"`);
}
if (relAttribute.value.type === 'JSXExpressionContainer') {
if (relAttribute.value.expression.type === 'Literal') {
if (typeof relAttribute.value.expression.value === 'string') {
const parts = relAttribute.value.expression.value
.split('noreferrer')
.filter(Boolean);
return fixer.replaceText(relAttribute.value.expression, `"${parts.concat('noreferrer').join(' ')}"`);
}
// for undefined, boolean, number, symbol, bigint, and null
return fixer.replaceText(relAttribute.value, '"noreferrer"');
}
}
return null;
},
});
}
}
if (formComponents.has(node.name.name)) {
if (!attributeValuePossiblyBlank(node.attributes[targetIndex])) {
const hasSpread = spreadAttributeIndex >= 0;
if (warnOnSpreadAttributes && hasSpread) {
// continue to check below
} else if (
(hasSpread && targetIndex < spreadAttributeIndex)
|| !hasSpread
|| !warnOnSpreadAttributes
) {
return;
}
}
if (!configuration.forms || hasSecureRel(node)) {
return;
}
const formAttributes = formComponents.get(node.name.name);
if (
hasExternalLink(node, formAttributes)
|| (enforceDynamicLinks === 'always' && hasDynamicLink(node, formAttributes))
) {
const messageId = allowReferrer ? 'noTargetBlankWithoutNoopener' : 'noTargetBlankWithoutNoreferrer';
report(context, messages[messageId], messageId, {
node,
});
}
}
},
};
},
};
@@ -0,0 +1,164 @@
# jiti
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![bundle][bundle-src]][bundle-href]
[![License][license-src]][license-href]
Runtime Typescript and ESM support for Node.js.
> [!IMPORTANT]
> This is the support branch for jiti v1. Check out [jiti/main](https://github.com/unjs/jiti/tree/main) for the latest version and [unjs/jiti#174](https://github.com/unjs/jiti/issues/174) for the roadmap.
## Features
- Seamless typescript and ESM syntax support
- Seamless interoperability between ESM and CommonJS
- Synchronous API to replace `require`
- Super slim and zero dependency
- Smart syntax detection to avoid extra transforms
- CommonJS cache integration
- Filesystem transpile hard cache
- V8 compile cache
- Custom resolve alias
## Usage
### Programmatic
```js
const jiti = require("jiti")(__filename);
jiti("./path/to/file.ts");
```
You can also pass options as second argument:
```js
const jiti = require("jiti")(__filename, { debug: true });
```
### CLI
```bash
jiti index.ts
# or npx jiti index.ts
```
### Register require hook
```bash
node -r jiti/register index.ts
```
Alternatively, you can register `jiti` as a require hook programmatically:
```js
const jiti = require("jiti")();
const unregister = jiti.register();
```
## Options
### `debug`
- Type: Boolean
- Default: `false`
- Environment Variable: `JITI_DEBUG`
Enable debug to see which files are transpiled
### `cache`
- Type: Boolean | String
- Default: `true`
- Environment Variable: `JITI_CACHE`
Use transpile cache
If set to `true` will use `node_modules/.cache/jiti` (if exists) or `{TMP_DIR}/node-jiti`
### `esmResolve`
- Type: Boolean | String
- Default: `false`
- Environment Variable: `JITI_ESM_RESOLVE`
Using esm resolution algorithm to support `import` condition.
### `transform`
- Type: Function
- Default: Babel (lazy loaded)
Transform function. See [src/babel](./src/babel.ts) for more details
### `sourceMaps`
- Type: Boolean
- Default `false`
- Environment Variable: `JITI_SOURCE_MAPS`
Add inline source map to transformed source for better debugging.
### `interopDefault`
- Type: Boolean
- Default: `false`
Return the `.default` export of a module at the top-level.
### `alias`
- Type: Object
- Default: -
- Environment Variable: `JITI_ALIAS`
Custom alias map used to resolve ids.
### `nativeModules`
- Type: Array
- Default: ['typescript`]
- Environment Variable: `JITI_NATIVE_MODULES`
List of modules (within `node_modules`) to always use native require for them.
### `transformModules`
- Type: Array
- Default: []
- Environment Variable: `JITI_TRANSFORM_MODULES`
List of modules (within `node_modules`) to transform them regardless of syntax.
### `experimentalBun`
- Type: Boolean
- Default: Enabled if `process.versions.bun` exists (Bun runtime)
- Environment Variable: `JITI_EXPERIMENTAL_BUN`
Enable experimental native Bun support for transformations.
## Development
- Clone this repository
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
- Install dependencies using `pnpm install`
- Run `pnpm dev`
- Run `pnpm jiti ./test/path/to/file.ts`
## License
MIT. Made with 💖
<!-- Badged -->
[npm-version-src]: https://img.shields.io/npm/v/jiti?style=flat&colorA=18181B&colorB=F0DB4F
[npm-version-href]: https://npmjs.com/package/jiti
[npm-downloads-src]: https://img.shields.io/npm/dm/jiti?style=flat&colorA=18181B&colorB=F0DB4F
[npm-downloads-href]: https://npmjs.com/package/jiti
[bundle-src]: https://img.shields.io/bundlephobia/minzip/jiti?style=flat&colorA=18181B&colorB=F0DB4F
[bundle-href]: https://bundlephobia.com/result?p=h3
[license-src]: https://img.shields.io/github/license/unjs/jiti.svg?style=flat&colorA=18181B&colorB=F0DB4F
[license-href]: https://github.com/unjs/jiti/blob/main/LICENSE
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,uFAAuF;AACvF,gGAAgG;;;;;AASzF,SAAS,yCAAc,IAAiB;IAC7C,OAAO,0CAAW,MAAM,IAAI,CAAA,GAAA,2CAAgB;IAC5C,IAAI,OAAO,CAAA,GAAA,yCAAc,EAAE,KAAK,GAAG,EAAE,KAAK,IAAI;IAC9C,OAAO,qCAAe,MAAM,KAAK,KAAK,EAAE,KAAK,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW;AACzG;AAEA,SAAS,qCAAe,IAAY,EAAE,KAAa,EAAE,GAAW,EAAE,IAAY,EAAE,MAAc,EAAE,MAAc,EAAE,WAAmB;IACjI,sEAAsE;IACtE,gCAAgC;IAChC,IAAI,OAAO,IAAI;IACf,KAAK,WAAW,CAAC,MAAM,QAAQ,QAAQ;IACvC,KAAK,cAAc,CAAC,MAAM,QAAQ,GAAG;IACrC,OAAO,KAAK,OAAO;AACrB;AAEO,SAAS,0CAAkB,EAAU,EAAE,QAAgB;IAC5D,qBAAqB;IACrB,IAAI,aAAa,OACf,OAAO;IAGT,6DAA6D;IAC7D,IAAI,KAAK,KAAK,aAAa,CAAA,GAAA,0CAAe,KACxC,OAAO,IAAI,KAAK,IAAI,iBAAiB,KAA9B;IAGT,IAAI,QAAC,IAAI,SAAE,KAAK,OAAE,GAAG,QAAE,IAAI,UAAE,MAAM,UAAE,MAAM,EAAC,GAAG,uCAAiB,IAAI;IACpE,IAAI,MAAM,qCAAe,MAAM,OAAO,KAAK,MAAM,QAAQ,QAAQ;IACjE,OAAO,MAAM,KAAK,KAAK,CAAC,KAAK,QAAQ;AACvC;AAEA,MAAM,6CAAuB,IAAI;AAEjC,SAAS,uCAAiB,EAAU,EAAE,QAAgB;IACpD,IAAI,YAAY,2CAAqB,GAAG,CAAC;IACzC,IAAI,CAAC,WAAW;QACd,YAAY,IAAI,KAAK,cAAc,CAAC,SAAS;sBAC3C;YACA,QAAQ;YACR,KAAK;YACL,MAAM;YACN,OAAO;YACP,KAAK;YACL,MAAM;YACN,QAAQ;YACR,QAAQ;QACV;QAEA,2CAAqB,GAAG,CAAC,UAAU;IACrC;IAEA,IAAI,QAAQ,UAAU,aAAa,CAAC,IAAI,KAAK;IAC7C,IAAI,aAAuC,CAAC;IAC5C,KAAK,IAAI,QAAQ,MACf,IAAI,KAAK,IAAI,KAAK,WAChB,UAAU,CAAC,KAAK,IAAI,CAAC,GAAG,KAAK,KAAK;IAKtC,OAAO;QACL,0FAA0F;QAC1F,MAAM,WAAW,GAAG,KAAK,QAAQ,WAAW,GAAG,KAAK,MAAM,CAAC,WAAW,IAAI,GAAG,IAAI,CAAC,WAAW,IAAI;QACjG,OAAO,CAAC,WAAW,KAAK;QACxB,KAAK,CAAC,WAAW,GAAG;QACpB,MAAM,WAAW,IAAI,KAAK,OAAO,IAAI,CAAC,WAAW,IAAI;QACrD,QAAQ,CAAC,WAAW,MAAM;QAC1B,QAAQ,CAAC,WAAW,MAAM;IAC5B;AACF;AAEA,MAAM,kCAAY;AAEX,SAAS,0CAAkB,IAAsB,EAAE,QAAgB;IACxE,IAAI,KAAK,yCAAc;IACvB,IAAI,UAAU,KAAK,0CAAkB,KAAK,iCAAW;IACrD,IAAI,QAAQ,KAAK,0CAAkB,KAAK,iCAAW;IACnD,OAAO,wCAAkB,MAAM,UAAU,SAAS;AACpD;AAEA,SAAS,wCAAkB,IAAsB,EAAE,QAAgB,EAAE,OAAe,EAAE,KAAa;IACjG,IAAI,QAAQ,YAAY,QAAQ;QAAC;KAAQ,GAAG;QAAC;QAAS;KAAM;IAC5D,OAAO,MAAM,MAAM,CAAC,CAAA,WAAY,sCAAgB,MAAM,UAAU;AAClE;AAEA,SAAS,sCAAgB,IAAsB,EAAE,QAAgB,EAAE,QAAgB;IACjF,IAAI,QAAQ,uCAAiB,UAAU;IACvC,OAAO,KAAK,IAAI,KAAK,MAAM,IAAI,IAC1B,KAAK,KAAK,KAAK,MAAM,KAAK,IAC1B,KAAK,GAAG,KAAK,MAAM,GAAG,IACtB,KAAK,IAAI,KAAK,MAAM,IAAI,IACxB,KAAK,MAAM,KAAK,MAAM,MAAM,IAC5B,KAAK,MAAM,KAAK,MAAM,MAAM;AACnC;AAEO,SAAS,0CAAW,IAAqC,EAAE,QAAgB,EAAE,iBAAiC,YAAY;IAC/H,IAAI,WAAW,0CAAmB;IAElC,uDAAuD;IACvD,IAAI,aAAa,OACf,OAAO,yCAAc;IAGvB,uGAAuG;IACvG,IAAI,aAAa,CAAA,GAAA,0CAAe,OAAO,mBAAmB,cAAc;QACtE,WAAW,0CAAW,UAAU,IAAI,CAAA,GAAA,2CAAgB;QAEpD,+FAA+F;QAC/F,IAAI,OAAO,IAAI;QACf,IAAI,OAAO,CAAA,GAAA,yCAAc,EAAE,SAAS,GAAG,EAAE,SAAS,IAAI;QACtD,KAAK,WAAW,CAAC,MAAM,SAAS,KAAK,GAAG,GAAG,SAAS,GAAG;QACvD,KAAK,QAAQ,CAAC,SAAS,IAAI,EAAE,SAAS,MAAM,EAAE,SAAS,MAAM,EAAE,SAAS,WAAW;QACnF,OAAO,KAAK,OAAO;IACrB;IAEA,IAAI,KAAK,yCAAc;IACvB,IAAI,eAAe,0CAAkB,KAAK,iCAAW;IACrD,IAAI,cAAc,0CAAkB,KAAK,iCAAW;IACpD,IAAI,QAAQ,wCAAkB,UAAU,UAAU,KAAK,cAAc,KAAK;IAE1E,IAAI,MAAM,MAAM,KAAK,GACnB,OAAO,KAAK,CAAC,EAAE;IAGjB,IAAI,MAAM,MAAM,GAAG,GACjB,OAAQ;QACN,2DAA2D;QAC3D,KAAK;QACL,KAAK;YACH,OAAO,KAAK,CAAC,EAAE;QACjB,KAAK;YACH,OAAO,KAAK,CAAC,MAAM,MAAM,GAAG,EAAE;QAChC,KAAK;YACH,MAAM,IAAI,WAAW;IACzB;IAGF,OAAQ;QACN,KAAK;YACH,OAAO,KAAK,GAAG,CAAC,KAAK,cAAc,KAAK;QAC1C,8DAA8D;QAC9D,KAAK;QACL,KAAK;YACH,OAAO,KAAK,GAAG,CAAC,KAAK,cAAc,KAAK;QAC1C,KAAK;YACH,MAAM,IAAI,WAAW;IACzB;AACF;AAEO,SAAS,0CAAO,QAAyC,EAAE,QAAgB,EAAE,iBAAiC,YAAY;IAC/H,OAAO,IAAI,KAAK,0CAAW,UAAU,UAAU;AACjD;AAKO,SAAS,0CAAa,EAAU,EAAE,QAAgB;IACvD,IAAI,SAAS,0CAAkB,IAAI;IACnC,IAAI,OAAO,IAAI,KAAK,KAAK;IACzB,IAAI,OAAO,KAAK,cAAc;IAC9B,IAAI,QAAQ,KAAK,WAAW,KAAK;IACjC,IAAI,MAAM,KAAK,UAAU;IACzB,IAAI,OAAO,KAAK,WAAW;IAC3B,IAAI,SAAS,KAAK,aAAa;IAC/B,IAAI,SAAS,KAAK,aAAa;IAC/B,IAAI,cAAc,KAAK,kBAAkB;IAEzC,OAAO,IAAI,CAAA,GAAA,uCAAY,EAAE,OAAO,IAAI,OAAO,MAAM,OAAO,IAAI,CAAC,OAAO,IAAI,MAAM,OAAO,KAAK,UAAU,QAAQ,MAAM,QAAQ,QAAQ;AACpI;AAKO,SAAS,0CAAS,IAAU,EAAE,QAAgB;IACnD,OAAO,0CAAa,KAAK,OAAO,IAAI;AACtC;AAEO,SAAS,0CAAgB,IAAU;IACxC,OAAO,0CAAS,MAAM,CAAA,GAAA,0CAAe;AACvC;AAGO,SAAS,0CAAe,QAAyB;IACtD,OAAO,IAAI,CAAA,GAAA,sCAAW,EAAE,SAAS,QAAQ,EAAE,SAAS,GAAG,EAAE,SAAS,IAAI,EAAE,SAAS,KAAK,EAAE,SAAS,GAAG;AACtG;AAEO,SAAS,0CAAa,IAAqB;IAChD,OAAO;QACL,KAAK,KAAK,GAAG;QACb,MAAM,KAAK,IAAI;QACf,OAAO,KAAK,KAAK;QACjB,KAAK,KAAK,GAAG;IACf;AACF;AAEO,SAAS,0CAAa,IAAa;IACxC,OAAO;QACL,MAAM,KAAK,IAAI;QACf,QAAQ,KAAK,MAAM;QACnB,QAAQ,KAAK,MAAM;QACnB,aAAa,KAAK,WAAW;IAC/B;AACF;AAMO,SAAS,0CAAmB,IAAqD,EAAE,IAAc;IACtG,IAAI,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,cAAc;IACpD,IAAI,cAAc,MACf,CAAA,QAAC,IAAI,UAAE,MAAM,UAAE,MAAM,eAAE,WAAW,EAAC,GAAG,IAAG;SACrC,IAAI,UAAU,QAAQ,CAAC,MAC5B,OAAO;IAGT,IAAI,MACD,CAAA,QAAC,IAAI,UAAE,MAAM,UAAE,MAAM,eAAE,WAAW,EAAC,GAAG,IAAG;IAG5C,OAAO,IAAI,CAAA,GAAA,0CAAe,EACxB,KAAK,QAAQ,EACb,KAAK,GAAG,EACR,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,GAAG,EACR,MACA,QACA,QACA;AAEJ;AAGO,SAAS,0CAAO,QAA0C;IAC/D,OAAO,IAAI,CAAA,GAAA,8BAAG,EAAE,SAAS,IAAI,EAAE,SAAS,MAAM,EAAE,SAAS,MAAM,EAAE,SAAS,WAAW;AACvF;AAGO,SAAS,0CAAsC,IAAO,EAAE,QAAkB;IAC/E,IAAI,KAAK,QAAQ,CAAC,UAAU,KAAK,SAAS,UAAU,EAClD,OAAO;IAGT,IAAI,eAAe,SAAS,aAAa,CAAC,KAAK,QAAQ,CAAC,WAAW,CAAC;IACpE,IAAI,OAAmB,KAAK,IAAI;IAChC,KAAK,QALine truncated
@@ -0,0 +1,3 @@
declare const _exports: import('eslint').Rule.RuleModule;
export = _exports;
//# sourceMappingURL=jsx-one-expression-per-line.d.ts.map
@@ -0,0 +1,31 @@
"use client";
// src/table-row-group.tsx
import { forwardRef } from "react";
import { useDOMRef } from "@heroui/react-utils";
import { clsx, mergeProps } from "@heroui/shared-utils";
import { useTableRowGroup } from "@react-aria/table";
import { jsx } from "react/jsx-runtime";
var TableRowGroup = forwardRef((props, ref) => {
var _a;
const { as, className, children, slots, classNames, ...otherProps } = props;
const Component = as || "thead";
const domRef = useDOMRef(ref);
const { rowGroupProps } = useTableRowGroup();
const theadStyles = clsx(classNames == null ? void 0 : classNames.thead, className);
return /* @__PURE__ */ jsx(
Component,
{
ref: domRef,
className: (_a = slots.thead) == null ? void 0 : _a.call(slots, { class: theadStyles }),
...mergeProps(rowGroupProps, otherProps),
children
}
);
});
TableRowGroup.displayName = "HeroUI.TableRowGroup";
var table_row_group_default = TableRowGroup;
export {
table_row_group_default
};
@@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var graphicsObjectRole = {
abstract: false,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author', 'contents'],
prohibitedProps: [],
props: {
'aria-errormessage': null,
'aria-expanded': null,
'aria-haspopup': null,
'aria-invalid': null
},
relatedConcepts: [{
module: 'GRAPHICS',
concept: {
name: 'graphics-document'
}
}, {
module: 'ARIA',
concept: {
name: 'group'
}
}, {
module: 'ARIA',
concept: {
name: 'img'
}
}, {
module: 'GRAPHICS',
concept: {
name: 'graphics-symbol'
}
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'structure', 'section', 'group']]
};
var _default = exports.default = graphicsObjectRole;
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_non_iterable_spread.cjs",
"module": "../../esm/_non_iterable_spread.js"
}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('invokeMap', require('../invokeMap'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,2 @@
/** Returns a clone of the given value */
export declare function Clone<T extends unknown>(value: T): T;
@@ -0,0 +1,11 @@
import { a as absFloor } from "./absFloor-BlD_nfEw.mjs";
import { M as MS_IN_DAY } from "./constants-BuFquuHl.mjs";
import parse from "./parse.mjs";
function diffInDays(date, input, asFloat) {
const parsed = parse(input);
const output = (+date - +parsed) / MS_IN_DAY;
return asFloat ? output : absFloor(output);
}
export {
diffInDays as default
};
@@ -0,0 +1,28 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $Number = GetIntrinsic('%Number%');
var $BigInt = GetIntrinsic('%BigInt%', true);
module.exports = function integerToNBytes(intValue, n, isLittleEndian) {
var Z = typeof intValue === 'bigint' ? $BigInt : $Number;
/*
if (intValue >= 0) { // step 3.d
// Let rawBytes be a List containing the n-byte binary encoding of intValue. If isLittleEndian is false, the bytes are ordered in big endian order. Otherwise, the bytes are ordered in little endian order.
} else { // step 3.e
// Let rawBytes be a List containing the n-byte binary 2's complement encoding of intValue. If isLittleEndian is false, the bytes are ordered in big endian order. Otherwise, the bytes are ordered in little endian order.
}
*/
if (intValue < 0) {
intValue >>>= 0; // eslint-disable-line no-param-reassign
}
var rawBytes = [];
for (var i = 0; i < n; i++) {
rawBytes[isLittleEndian ? i : n - 1 - i] = $Number(intValue & Z(0xFF));
intValue >>= Z(8); // eslint-disable-line no-param-reassign
}
return rawBytes; // step 4
};
@@ -0,0 +1,3 @@
import type { TSESLint } from '@typescript-eslint/utils';
declare const _default: TSESLint.RuleModule<"preferConstAssertion" | "variableConstAssertion" | "variableSuggest", [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener>;
export default _default;
@@ -0,0 +1,68 @@
'use strict';
const isObject = value => typeof value === 'object' && value !== null;
const mapObjectSkip = Symbol('skip');
// Customized for this use-case
const isObjectCustom = value =>
isObject(value) &&
!(value instanceof RegExp) &&
!(value instanceof Error) &&
!(value instanceof Date);
const mapObject = (object, mapper, options, isSeen = new WeakMap()) => {
options = {
deep: false,
target: {},
...options
};
if (isSeen.has(object)) {
return isSeen.get(object);
}
isSeen.set(object, options.target);
const {target} = options;
delete options.target;
const mapArray = array => array.map(element => isObjectCustom(element) ? mapObject(element, mapper, options, isSeen) : element);
if (Array.isArray(object)) {
return mapArray(object);
}
for (const [key, value] of Object.entries(object)) {
const mapResult = mapper(key, value, object);
if (mapResult === mapObjectSkip) {
continue;
}
let [newKey, newValue, {shouldRecurse = true} = {}] = mapResult;
// Drop `__proto__` keys.
if (newKey === '__proto__') {
continue;
}
if (options.deep && shouldRecurse && isObjectCustom(newValue)) {
newValue = Array.isArray(newValue) ?
mapArray(newValue) :
mapObject(newValue, mapper, options, isSeen);
}
target[newKey] = newValue;
}
return target;
};
module.exports = (object, mapper, options) => {
if (!isObject(object)) {
throw new TypeError(`Expected an object, got \`${object}\` (${typeof object})`);
}
return mapObject(object, mapper, options);
};
module.exports.mapObjectSkip = mapObjectSkip;
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/es-iterator-helpers
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,43 @@
# has-property-descriptors <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
Does the environment have full property descriptor support? Handles IE 8's broken defineProperty/gOPD.
## Example
```js
var hasPropertyDescriptors = require('has-property-descriptors');
var assert = require('assert');
assert.equal(hasPropertyDescriptors(), true); // will be `false` in IE 6-8, and ES5 engines
// Arrays can not have their length `[[Defined]]` in some engines
assert.equal(hasPropertyDescriptors.hasArrayLengthDefineBug(), false); // will be `true` in Firefox 4-22, and node v0.6
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/has-property-descriptors
[npm-version-svg]: https://versionbadg.es/inspect-js/has-property-descriptors.svg
[deps-svg]: https://david-dm.org/inspect-js/has-property-descriptors.svg
[deps-url]: https://david-dm.org/inspect-js/has-property-descriptors
[dev-deps-svg]: https://david-dm.org/inspect-js/has-property-descriptors/dev-status.svg
[dev-deps-url]: https://david-dm.org/inspect-js/has-property-descriptors#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/has-property-descriptors.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/has-property-descriptors.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/has-property-descriptors.svg
[downloads-url]: https://npm-stat.com/charts.html?package=has-property-descriptors
[codecov-image]: https://codecov.io/gh/inspect-js/has-property-descriptors/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/has-property-descriptors/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-property-descriptors
[actions-url]: https://github.com/inspect-js/has-property-descriptors/actions
@@ -0,0 +1,6 @@
import {
AlignTopBoldIcon
} from "../chunk-4CUIXA2N.mjs";
export {
AlignTopBoldIcon
};
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getInstanceNodeBinding = getInstanceNodeBinding;
function getInstanceNodeBinding(node) {
return node.binding;
}
//# sourceMappingURL=getInstanceNodeBinding.js.map
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
function isFunction(value) {
return typeof value === "function";
}
exports.isFunction = isFunction;
@@ -0,0 +1,11 @@
import {
divider_default
} from "./chunk-IHO36JMK.mjs";
import {
useDivider
} from "./chunk-TS7K35D7.mjs";
import "./chunk-D2EG5U3Q.mjs";
export {
divider_default as Divider,
useDivider
};
@@ -0,0 +1,134 @@
import {getOffset as $ab71dadb03a6fb2e$export$622cea445a1c5b7d} from "./getOffset.mjs";
import {useRef as $1rnCS$useRef} 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.
*/ /* eslint-disable rulesdir/pure-render */
// Keep track of elements that we are currently handling dragging for via useDrag1D.
// If there's an ancestor and a descendant both using useDrag1D(), and the user starts
// dragging the descendant, we don't want useDrag1D events to fire for the ancestor.
const $9cc09df9fd7676be$var$draggingElements = [];
function $9cc09df9fd7676be$export$7bbed75feba39706(props) {
console.warn('useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html');
let { containerRef: containerRef, reverse: reverse, orientation: orientation, onHover: onHover, onDrag: onDrag, onPositionChange: onPositionChange, onIncrement: onIncrement, onDecrement: onDecrement, onIncrementToMax: onIncrementToMax, onDecrementToMin: onDecrementToMin, onCollapseToggle: onCollapseToggle } = props;
let getPosition = (e)=>orientation === 'horizontal' ? e.clientX : e.clientY;
let getNextOffset = (e)=>{
let containerOffset = (0, $ab71dadb03a6fb2e$export$622cea445a1c5b7d)(containerRef.current, reverse, orientation);
let mouseOffset = getPosition(e);
let nextOffset = reverse ? containerOffset - mouseOffset : mouseOffset - containerOffset;
return nextOffset;
};
let dragging = (0, $1rnCS$useRef)(false);
let prevPosition = (0, $1rnCS$useRef)(0);
// Keep track of the current handlers in a ref so that the events can access them.
let handlers = (0, $1rnCS$useRef)({
onPositionChange: onPositionChange,
onDrag: onDrag
});
handlers.current.onDrag = onDrag;
handlers.current.onPositionChange = onPositionChange;
let onMouseDragged = (e)=>{
e.preventDefault();
let nextOffset = getNextOffset(e);
if (!dragging.current) {
dragging.current = true;
if (handlers.current.onDrag) handlers.current.onDrag(true);
if (handlers.current.onPositionChange) handlers.current.onPositionChange(nextOffset);
}
if (prevPosition.current === nextOffset) return;
prevPosition.current = nextOffset;
if (onPositionChange) onPositionChange(nextOffset);
};
let onMouseUp = (e)=>{
const target = e.target;
dragging.current = false;
let nextOffset = getNextOffset(e);
if (handlers.current.onDrag) handlers.current.onDrag(false);
if (handlers.current.onPositionChange) handlers.current.onPositionChange(nextOffset);
$9cc09df9fd7676be$var$draggingElements.splice($9cc09df9fd7676be$var$draggingElements.indexOf(target), 1);
window.removeEventListener('mouseup', onMouseUp, false);
window.removeEventListener('mousemove', onMouseDragged, false);
};
let onMouseDown = (e)=>{
const target = e.currentTarget;
// If we're already handling dragging on a descendant with useDrag1D, then
// we don't want to handle the drag motion on this target as well.
if ($9cc09df9fd7676be$var$draggingElements.some((elt)=>target.contains(elt))) return;
$9cc09df9fd7676be$var$draggingElements.push(target);
window.addEventListener('mousemove', onMouseDragged, false);
window.addEventListener('mouseup', onMouseUp, false);
};
let onMouseEnter = ()=>{
if (onHover) onHover(true);
};
let onMouseOut = ()=>{
if (onHover) onHover(false);
};
let onKeyDown = (e)=>{
switch(e.key){
case 'Left':
case 'ArrowLeft':
if (orientation === 'horizontal') {
e.preventDefault();
if (onDecrement && !reverse) onDecrement();
else if (onIncrement && reverse) onIncrement();
}
break;
case 'Up':
case 'ArrowUp':
if (orientation === 'vertical') {
e.preventDefault();
if (onDecrement && !reverse) onDecrement();
else if (onIncrement && reverse) onIncrement();
}
break;
case 'Right':
case 'ArrowRight':
if (orientation === 'horizontal') {
e.preventDefault();
if (onIncrement && !reverse) onIncrement();
else if (onDecrement && reverse) onDecrement();
}
break;
case 'Down':
case 'ArrowDown':
if (orientation === 'vertical') {
e.preventDefault();
if (onIncrement && !reverse) onIncrement();
else if (onDecrement && reverse) onDecrement();
}
break;
case 'Home':
e.preventDefault();
if (onDecrementToMin) onDecrementToMin();
break;
case 'End':
e.preventDefault();
if (onIncrementToMax) onIncrementToMax();
break;
case 'Enter':
e.preventDefault();
if (onCollapseToggle) onCollapseToggle();
break;
}
};
return {
onMouseDown: onMouseDown,
onMouseEnter: onMouseEnter,
onMouseOut: onMouseOut,
onKeyDown: onKeyDown
};
}
export {$9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D};
//# sourceMappingURL=useDrag1D.module.js.map
@@ -0,0 +1,28 @@
'use strict';
/**
* Syntactic sugar for invoking a function and expanding an array for arguments.
*
* Common use case would be to use `Function.prototype.apply`.
*
* ```js
* function f(x, y, z) {}
* var args = [1, 2, 3];
* f.apply(null, args);
* ```
*
* With `spread` this example can be re-written.
*
* ```js
* spread(function(x, y, z) {})([1, 2, 3]);
* ```
*
* @param {Function} callback
*
* @returns {Function}
*/
export default function spread(callback) {
return function wrap(arr) {
return callback.apply(null, arr);
};
}
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/is-symbol
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,44 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { getRegExpCalls } = require("../utils")
module.exports = {
meta: {
docs: {
description: "disallow RegExp `y` flag.",
category: "ES2015",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-regexp-y-flag.html",
},
fixable: null,
messages: {
forbidden: "ES2015 RegExp 'y' flag is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Literal[regex]"(node) {
if (node.regex.flags.includes("y")) {
context.report({ node, messageId: "forbidden" })
}
},
"Program:exit"() {
const scope = context.getScope()
for (const { node, flags } of getRegExpCalls(scope)) {
if (flags && flags.includes("y")) {
context.report({ node, messageId: "forbidden" })
}
}
},
}
},
}
@@ -0,0 +1,192 @@
import {CamelCase, PascalCase} from 'type-fest';
// eslint-disable-next-line @typescript-eslint/ban-types
type EmptyTuple = [];
/**
Return a default type if input type is nil.
@template T - Input type.
@template U - Default type.
*/
type WithDefault<T, U extends T> = T extends undefined | void | null ? U : T;
/**
Check if an element is included in a tuple.
TODO: Remove this once https://github.com/sindresorhus/type-fest/pull/217 is merged.
*/
type IsInclude<List extends readonly unknown[], Target> = List extends undefined
? false
: List extends Readonly<EmptyTuple>
? false
: List extends readonly [infer First, ...infer Rest]
? First extends Target
? true
: IsInclude<Rest, Target>
: boolean;
/**
Append a segment to dot-notation path.
*/
type AppendPath<S extends string, Last extends string> = S extends ''
? Last
: `${S}.${Last}`;
/**
Convert keys of an object to camelcase strings.
*/
type CamelCaseKeys<
T extends Record<string, any> | readonly any[],
Deep extends boolean,
IsPascalCase extends boolean,
Exclude extends readonly unknown[],
StopPaths extends readonly string[],
Path extends string = ''
> = T extends readonly any[]
// Handle arrays or tuples.
? {
[P in keyof T]: CamelCaseKeys<
T[P],
Deep,
IsPascalCase,
Exclude,
StopPaths
>;
}
: T extends Record<string, any>
// Handle objects.
? {
[P in keyof T & string as [IsInclude<Exclude, P>] extends [true]
? P
: [IsPascalCase] extends [true]
? PascalCase<P>
: CamelCase<P>]: [IsInclude<StopPaths, AppendPath<Path, P>>] extends [
true
]
? T[P]
: [Deep] extends [true]
? CamelCaseKeys<
T[P],
Deep,
IsPascalCase,
Exclude,
StopPaths,
AppendPath<Path, P>
>
: T[P];
}
// Return anything else as-is.
: T;
declare namespace camelcaseKeys {
interface Options {
/**
Recurse nested objects and objects in arrays.
@default false
*/
readonly deep?: boolean;
/**
Exclude keys from being camel-cased.
If this option can be statically determined, it's recommended to add `as const` to it.
@default []
*/
readonly exclude?: ReadonlyArray<string | RegExp>;
/**
Exclude children at the given object paths in dot-notation from being camel-cased. For example, with an object like `{a: {b: '🦄'}}`, the object path to reach the unicorn is `'a.b'`.
If this option can be statically determined, it's recommended to add `as const` to it.
@default []
@example
```
camelcaseKeys({
a_b: 1,
a_c: {
c_d: 1,
c_e: {
e_f: 1
}
}
}, {
deep: true,
stopPaths: [
'a_c.c_e'
]
}),
// {
// aB: 1,
// aC: {
// cD: 1,
// cE: {
// e_f: 1
// }
// }
// }
```
*/
readonly stopPaths?: readonly string[];
/**
Uppercase the first character as in `bye-bye` → `ByeBye`.
@default false
*/
readonly pascalCase?: boolean;
}
}
/**
Convert object keys to camel case using [`camelcase`](https://github.com/sindresorhus/camelcase).
@param input - Object or array of objects to camel-case.
@example
```
import camelcaseKeys = require('camelcase-keys');
// Convert an object
camelcaseKeys({'foo-bar': true});
//=> {fooBar: true}
// Convert an array of objects
camelcaseKeys([{'foo-bar': true}, {'bar-foo': false}]);
//=> [{fooBar: true}, {barFoo: false}]
camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true});
//=> {fooBar: true, nested: {unicornRainbow: true}}
// Convert object keys to pascal case
camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true, pascalCase: true});
//=> {FooBar: true, Nested: {UnicornRainbow: true}}
import minimist = require('minimist');
const argv = minimist(process.argv.slice(2));
//=> {_: [], 'foo-bar': true}
camelcaseKeys(argv);
//=> {_: [], fooBar: true}
```
*/
declare function camelcaseKeys<
T extends Record<string, any> | readonly any[],
Options extends camelcaseKeys.Options = camelcaseKeys.Options
>(
input: T,
options?: Options
): CamelCaseKeys<
T,
WithDefault<Options['deep'], false>,
WithDefault<Options['pascalCase'], false>,
WithDefault<Options['exclude'], EmptyTuple>,
WithDefault<Options['stopPaths'], EmptyTuple>
>;
export = camelcaseKeys;
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from './types.mjs';
import 'react';
declare const SelectorIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { SelectorIcon };
@@ -0,0 +1,102 @@
{
"name": "arraybuffer.prototype.slice",
"version": "1.0.4",
"description": "ES spec-compliant shim for ArrayBuffer.prototype.slice",
"author": "Jordan Harband <ljharb@gmail.com>",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"main": "index.js",
"exports": {
".": "./index.js",
"./auto": "./auto.js",
"./polyfill": "./polyfill.js",
"./implementation": "./implementation.js",
"./shim": "./shim.js",
"./package.json": "./package.json"
},
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"pretest": "npm run lint",
"test": "npm run tests-only",
"posttest": "npx npm@'>=10.2' audit --production",
"tests-only": "nyc tape 'test/**/*.js'",
"prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')",
"lint": "eslint --ext=js,mjs .",
"postlint": "evalmd README.md && es-shim-api --bound",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/es-shims/ArrayBuffer.prototype.slice.git"
},
"homepage": "https://github.com/es-shims/ArrayBuffer.prototype.slice#readme",
"bugs": {
"url": "https://github.com/es-shims/ArrayBuffer.prototype.slice/issues"
},
"keywords": [
"javascript",
"ecmascript",
"ArrayBuffer.prototype.slice",
"polyfill",
"shim",
"ArrayBuffer",
"array",
"buffer",
"ArrayBuffer#slice",
"slice",
"typed array",
"es-shim API"
],
"dependencies": {
"array-buffer-byte-length": "^1.0.1",
"call-bind": "^1.0.8",
"define-properties": "^1.2.1",
"es-abstract": "^1.23.5",
"es-errors": "^1.3.0",
"get-intrinsic": "^1.2.6",
"is-array-buffer": "^3.0.4"
},
"devDependencies": {
"@es-shims/api": "^2.5.1",
"@ljharb/eslint-config": "^21.1.1",
"auto-changelog": "^2.5.0",
"eclint": "^2.8.1",
"encoding": "^0.1.13",
"es-value-fixtures": "^1.5.0",
"eslint": "=8.8.0",
"evalmd": "^0.0.19",
"for-each": "^0.3.3",
"functions-have-names": "^1.2.3",
"has-strict-mode": "^1.0.1",
"in-publish": "^2.0.1",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"object-inspect": "^1.13.3",
"safe-publish-latest": "^2.0.0",
"tape": "^5.9.0"
},
"testling": {
"files": "test/index.js"
},
"engines": {
"node": ">= 0.4"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows"
]
}
}
@@ -0,0 +1,78 @@
# Gitignore to Minimatch Utility
by [Nicholas C. Zakas](https://humanwhocodes.com)
If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate).
## Description
A function that converts a [gitignore](https://git-scm.com/docs/gitignore#_pattern_format) pattern into a [minimatch](https://github.com/isaacs/minimatch) pattern. There are subtle differences between these two formats, and depending on the utilities you're using, you may need one or the other.
## Usage
### Node.js
Install using [npm][npm] or [yarn][yarn]:
```
npm install @humanwhocodes/gitignore-to-minimatch --save
# or
yarn add @humanwhocodes/gitignore-to-minimatch
```
Import into your Node.js project:
```js
// CommonJS
const { gitignoreToMinimatch } = require("@humanwhocodes/gitignore-to-minimatch");
// ESM
import { gitignoreToMinimatch } from "@humanwhocodes/gitignore-to-minimatch";
```
### Deno
Import into your Deno project:
```js
import { gitignoreToMinimatch } from "https://cdn.skypack.dev/@humanwhocodes/gitignore-to-minimatch?dts";
```
### Browser
It's recommended to import the minified version to save bandwidth:
```js
import { gitignoreToMinimatch } from "https://cdn.skypack.dev/@humanwhocodes/gitignore-to-minimatch?min";
```
However, you can also import the unminified version for debugging purposes:
```js
import { gitignoreToMinimatch } from "https://cdn.skypack.dev/@humanwhocodes/gitignore-to-minimatch";
```
## API
After importing, call `gitignoreToMinimatch` with a string argument, like this:
```js
const minimatchPattern = gitignoreToMinimatch("foo");
console.log(minimatchPattern); // "**/foo"
```
## Developer Setup
1. Fork the repository
2. Clone your fork
3. Run `npm install` to setup dependencies
4. Run `npm test` to run tests
## License
Apache 2.0
[npm]: https://npmjs.com/
[yarn]: https://yarnpkg.com/
@@ -0,0 +1,101 @@
'use strict';
var $TypeError = require('es-errors/type');
var AdvanceStringIndex = require('es-abstract/2024/AdvanceStringIndex');
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 GetMethod = require('es-abstract/2024/GetMethod');
var IsArray = require('es-abstract/2024/IsArray');
var IteratorCloseAll = require('../aos/IteratorCloseAll');
var IteratorStepValue = require('es-abstract/2024/IteratorStepValue');
var Type = require('es-abstract/2024/Type');
var forEach = require('es-abstract/helpers/forEach');
var getIteratorMethod = require('es-abstract/helpers/getIteratorMethod');
var iterHelperProto = require('../IteratorHelperPrototype');
var SLOT = require('internal-slot');
module.exports = function concat() {
if (this instanceof concat) {
throw new $TypeError('`Iterator.concat` is not a constructor');
}
var iterables = []; // step 1
forEach(arguments, function (item) { // step 2
if (Type(item) !== 'Object') {
throw new $TypeError('`Iterator.concat` requires all arguments to be objects'); // step 2.1
}
// var method = GetMethod(item, Symbol.iterator); // step 2.2
var method = getIteratorMethod(
{
AdvanceStringIndex: AdvanceStringIndex,
GetMethod: GetMethod,
IsArray: IsArray
},
item
);
if (typeof method === 'undefined') {
throw new $TypeError('`Iterator.concat` requires all arguments to be iterable'); // step 2.3
}
iterables[iterables.length] = { '[[OpenMethod]]': method, '[[Iterable]]': item }; // step 2.4
});
var sentinel = {};
var iterablesIndex = 0;
var iteratorRecord;
var innerAlive = false;
var closure = function () { // step 3
if (iterablesIndex >= iterables.length) {
return sentinel;
}
var iterable = iterables[iterablesIndex]; // step 3.a
if (!innerAlive) {
var iter = Call(iterable['[[OpenMethod]]'], iterable['[[Iterable]]']); // step 3.a.i
if (Type(iter) !== 'Object') {
throw new $TypeError('`Iterator.concat` iterator method did not return an object'); // step 3.a.ii
}
iteratorRecord = GetIteratorDirect(iter); // step 3.a.iii
innerAlive = true; // step 3.a.iv
}
if (innerAlive) { // step 3.a.v
var innerValue = IteratorStepValue(iteratorRecord); // step 3.a.v.1
if (iteratorRecord['[[Done]]']) { // step 3.a.v.2
innerAlive = false; // step 3.a.v.2.a
} else { // step 3.a.v.3
// 1. Let completion be Completion(Yield(innerValue)).
return innerValue; // step 3.a.v.3.a
}
}
iterablesIndex += 1;
return closure();
};
var closeIfAbrupt = function (abruptCompletion) {
if (!(abruptCompletion instanceof CompletionRecord)) {
throw new $TypeError('`abruptCompletion` must be a Completion Record');
}
iterablesIndex = iterables.length;
innerAlive = false;
if (iteratorRecord) {
IteratorCloseAll(
[iteratorRecord],
abruptCompletion
);
}
};
SLOT.set(closure, '[[Sentinel]]', sentinel); // for the userland implementation
SLOT.set(closure, '[[CloseIfAbrupt]]', closeIfAbrupt); // for the userland implementation
var gen = CreateIteratorFromClosure(closure, 'Iterator Helper', iterHelperProto, ['[[UnderlyingIterators]]']); // step 5
SLOT.set(gen, '[[UnderlyingIterators]]', []); // step 6
return gen; // step 7
};
@@ -0,0 +1,243 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const ignore_1 = __importDefault(require("ignore"));
const util_1 = require("../util");
const getESLintCoreRule_1 = require("../util/getESLintCoreRule");
const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-restricted-imports');
// In some versions of eslint, the base rule has a completely incompatible schema
// This helper function is to safely try to get parts of the schema. If it's not
// possible, we'll fallback to less strict checks.
const tryAccess = (getter, fallback) => {
try {
return getter();
}
catch {
return fallback;
}
};
const baseSchema = baseRule.meta.schema;
const allowTypeImportsOptionSchema = {
allowTypeImports: {
type: 'boolean',
description: 'Whether to allow type-only imports for a path.',
},
};
const arrayOfStringsOrObjects = {
type: 'array',
items: {
anyOf: [
{ type: 'string' },
{
type: 'object',
additionalProperties: false,
properties: {
...tryAccess(() => baseSchema.anyOf[1].items[0].properties.paths.items.anyOf[1]
.properties, undefined),
...allowTypeImportsOptionSchema,
},
required: tryAccess(() => baseSchema.anyOf[1].items[0].properties.paths.items.anyOf[1]
.required, undefined),
},
],
},
uniqueItems: true,
};
const arrayOfStringsOrObjectPatterns = {
anyOf: [
{
type: 'array',
items: {
type: 'string',
},
uniqueItems: true,
},
{
type: 'array',
items: {
type: 'object',
additionalProperties: false,
properties: {
...tryAccess(() => baseSchema.anyOf[1].items[0].properties.patterns.anyOf[1].items
.properties, undefined),
...allowTypeImportsOptionSchema,
},
required: tryAccess(() => baseSchema.anyOf[1].items[0].properties.patterns.anyOf[1].items
.required, []),
},
uniqueItems: true,
},
],
};
const schema = {
anyOf: [
arrayOfStringsOrObjects,
{
type: 'array',
additionalItems: false,
items: [
{
type: 'object',
additionalProperties: false,
properties: {
paths: arrayOfStringsOrObjects,
patterns: arrayOfStringsOrObjectPatterns,
},
},
],
},
],
};
function isObjectOfPaths(obj) {
return !!obj && Object.hasOwn(obj, 'paths');
}
function isObjectOfPatterns(obj) {
return !!obj && Object.hasOwn(obj, 'patterns');
}
function isOptionsArrayOfStringOrObject(options) {
if (isObjectOfPaths(options[0])) {
return false;
}
if (isObjectOfPatterns(options[0])) {
return false;
}
return true;
}
function getRestrictedPaths(options) {
if (isOptionsArrayOfStringOrObject(options)) {
return options;
}
if (isObjectOfPaths(options[0])) {
return options[0].paths;
}
return [];
}
function getRestrictedPatterns(options) {
if (isObjectOfPatterns(options[0])) {
return options[0].patterns;
}
return [];
}
function shouldCreateRule(baseRules, options) {
if (Object.keys(baseRules).length === 0 || options.length === 0) {
return false;
}
if (!isOptionsArrayOfStringOrObject(options)) {
return !!(options[0].paths?.length || options[0].patterns?.length);
}
return true;
}
exports.default = (0, util_1.createRule)({
name: 'no-restricted-imports',
meta: {
type: 'suggestion',
// defaultOptions, -- base rule does not use defaultOptions
docs: {
description: 'Disallow specified modules when loaded by `import`',
extendsBaseRule: true,
},
fixable: baseRule.meta.fixable,
messages: baseRule.meta.messages,
schema,
},
defaultOptions: [],
create(context) {
const rules = baseRule.create(context);
const { options } = context;
if (!shouldCreateRule(rules, options)) {
return {};
}
const restrictedPaths = getRestrictedPaths(options);
const allowedTypeImportPathNameSet = new Set();
for (const restrictedPath of restrictedPaths) {
if (typeof restrictedPath === 'object' &&
restrictedPath.allowTypeImports) {
allowedTypeImportPathNameSet.add(restrictedPath.name);
}
}
function isAllowedTypeImportPath(importSource) {
return allowedTypeImportPathNameSet.has(importSource);
}
const restrictedPatterns = getRestrictedPatterns(options);
const allowedImportTypeMatchers = [];
const allowedImportTypeRegexMatchers = [];
for (const restrictedPattern of restrictedPatterns) {
if (typeof restrictedPattern === 'object' &&
restrictedPattern.allowTypeImports) {
// Following how ignore is configured in the base rule
if (restrictedPattern.group) {
allowedImportTypeMatchers.push((0, ignore_1.default)({
allowRelativePaths: true,
ignoreCase: !restrictedPattern.caseSensitive,
}).add(restrictedPattern.group));
}
if (restrictedPattern.regex) {
allowedImportTypeRegexMatchers.push(new RegExp(restrictedPattern.regex, restrictedPattern.caseSensitive ? 'u' : 'iu'));
}
}
}
function isAllowedTypeImportPattern(importSource) {
return (
// As long as there's one matching pattern that allows type import
allowedImportTypeMatchers.some(matcher => matcher.ignores(importSource)) ||
allowedImportTypeRegexMatchers.some(regex => regex.test(importSource)));
}
function checkImportNode(node) {
if (node.importKind === 'type' ||
(node.specifiers.length > 0 &&
node.specifiers.every(specifier => specifier.type === utils_1.AST_NODE_TYPES.ImportSpecifier &&
specifier.importKind === 'type'))) {
const importSource = node.source.value.trim();
if (!isAllowedTypeImportPath(importSource) &&
!isAllowedTypeImportPattern(importSource)) {
return rules.ImportDeclaration(node);
}
}
else {
return rules.ImportDeclaration(node);
}
}
return {
ExportAllDeclaration: rules.ExportAllDeclaration,
'ExportNamedDeclaration[source]'(node) {
if (node.exportKind === 'type' ||
(node.specifiers.length > 0 &&
node.specifiers.every(specifier => specifier.exportKind === 'type'))) {
const importSource = node.source.value.trim();
if (!isAllowedTypeImportPath(importSource) &&
!isAllowedTypeImportPattern(importSource)) {
return rules.ExportNamedDeclaration(node);
}
}
else {
return rules.ExportNamedDeclaration(node);
}
},
ImportDeclaration: checkImportNode,
TSImportEqualsDeclaration(node) {
if (node.moduleReference.type === utils_1.AST_NODE_TYPES.TSExternalModuleReference) {
const synthesizedImport = {
...node,
type: utils_1.AST_NODE_TYPES.ImportDeclaration,
assertions: [],
attributes: [],
source: node.moduleReference.expression,
specifiers: [
{
...node.id,
type: utils_1.AST_NODE_TYPES.ImportDefaultSpecifier,
local: node.id,
// @ts-expect-error -- parent types are incompatible but it's fine for the purposes of this extension
parent: node.id.parent,
},
],
};
return checkImportNode(synthesizedImport);
}
},
};
},
});
@@ -0,0 +1,166 @@
/**
* @fileoverview Rule to enforce line breaks between arguments of a function call
* @author Alexey Gonchar <https://github.com/finico>
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "function-call-argument-newline",
url: "https://eslint.style/rules/function-call-argument-newline",
},
},
],
},
type: "layout",
docs: {
description:
"Enforce line breaks between arguments of a function call",
recommended: false,
url: "https://eslint.org/docs/latest/rules/function-call-argument-newline",
},
fixable: "whitespace",
schema: [
{
enum: ["always", "never", "consistent"],
},
],
messages: {
unexpectedLineBreak: "There should be no line break here.",
missingLineBreak:
"There should be a line break after this argument.",
},
},
create(context) {
const sourceCode = context.sourceCode;
const checkers = {
unexpected: {
messageId: "unexpectedLineBreak",
check: (prevToken, currentToken) =>
prevToken.loc.end.line !== currentToken.loc.start.line,
createFix: (token, tokenBefore) => fixer =>
fixer.replaceTextRange(
[tokenBefore.range[1], token.range[0]],
" ",
),
},
missing: {
messageId: "missingLineBreak",
check: (prevToken, currentToken) =>
prevToken.loc.end.line === currentToken.loc.start.line,
createFix: (token, tokenBefore) => fixer =>
fixer.replaceTextRange(
[tokenBefore.range[1], token.range[0]],
"\n",
),
},
};
/**
* Check all arguments for line breaks in the CallExpression
* @param {CallExpression} node node to evaluate
* @param {{ messageId: string, check: Function }} checker selected checker
* @returns {void}
* @private
*/
function checkArguments(node, checker) {
for (let i = 1; i < node.arguments.length; i++) {
const prevArgToken = sourceCode.getLastToken(
node.arguments[i - 1],
);
const currentArgToken = sourceCode.getFirstToken(
node.arguments[i],
);
if (checker.check(prevArgToken, currentArgToken)) {
const tokenBefore = sourceCode.getTokenBefore(
currentArgToken,
{ includeComments: true },
);
const hasLineCommentBefore = tokenBefore.type === "Line";
context.report({
node,
loc: {
start: tokenBefore.loc.end,
end: currentArgToken.loc.start,
},
messageId: checker.messageId,
fix: hasLineCommentBefore
? null
: checker.createFix(currentArgToken, tokenBefore),
});
}
}
}
/**
* Check if open space is present in a function name
* @param {CallExpression} node node to evaluate
* @returns {void}
* @private
*/
function check(node) {
if (node.arguments.length < 2) {
return;
}
const option = context.options[0] || "always";
if (option === "never") {
checkArguments(node, checkers.unexpected);
} else if (option === "always") {
checkArguments(node, checkers.missing);
} else if (option === "consistent") {
const firstArgToken = sourceCode.getLastToken(
node.arguments[0],
);
const secondArgToken = sourceCode.getFirstToken(
node.arguments[1],
);
if (
firstArgToken.loc.end.line === secondArgToken.loc.start.line
) {
checkArguments(node, checkers.unexpected);
} else {
checkArguments(node, checkers.missing);
}
}
}
return {
CallExpression: check,
NewExpression: check,
};
},
};
@@ -0,0 +1,257 @@
var clone = (function() {
'use strict';
function _instanceof(obj, type) {
return type != null && obj instanceof type;
}
var nativeMap;
try {
nativeMap = Map;
} catch(_) {
// maybe a reference error because no `Map`. Give it a dummy value that no
// value will ever be an instanceof.
nativeMap = function() {};
}
var nativeSet;
try {
nativeSet = Set;
} catch(_) {
nativeSet = function() {};
}
var nativePromise;
try {
nativePromise = Promise;
} catch(_) {
nativePromise = function() {};
}
/**
* Clones (copies) an Object using deep copying.
*
* This function supports circular references by default, but if you are certain
* there are no circular references in your object, you can save some CPU time
* by calling clone(obj, false).
*
* Caution: if `circular` is false and `parent` contains circular references,
* your program may enter an infinite loop and crash.
*
* @param `parent` - the object to be cloned
* @param `circular` - set to true if the object to be cloned may contain
* circular references. (optional - true by default)
* @param `depth` - set to a number if the object is only to be cloned to
* a particular depth. (optional - defaults to Infinity)
* @param `prototype` - sets the prototype to be used when cloning an object.
* (optional - defaults to parent prototype).
* @param `includeNonEnumerable` - set to true if the non-enumerable properties
* should be cloned as well. Non-enumerable properties on the prototype
* chain will be ignored. (optional - false by default)
*/
function clone(parent, circular, depth, prototype, includeNonEnumerable) {
if (typeof circular === 'object') {
depth = circular.depth;
prototype = circular.prototype;
includeNonEnumerable = circular.includeNonEnumerable;
circular = circular.circular;
}
// maintain two arrays for circular references, where corresponding parents
// and children have the same index
var allParents = [];
var allChildren = [];
var useBuffer = typeof Buffer != 'undefined';
if (typeof circular == 'undefined')
circular = true;
if (typeof depth == 'undefined')
depth = Infinity;
// recurse this function so we don't reset allParents and allChildren
function _clone(parent, depth) {
// cloning null always returns null
if (parent === null)
return null;
if (depth === 0)
return parent;
var child;
var proto;
if (typeof parent != 'object') {
return parent;
}
if (_instanceof(parent, nativeMap)) {
child = new nativeMap();
} else if (_instanceof(parent, nativeSet)) {
child = new nativeSet();
} else if (_instanceof(parent, nativePromise)) {
child = new nativePromise(function (resolve, reject) {
parent.then(function(value) {
resolve(_clone(value, depth - 1));
}, function(err) {
reject(_clone(err, depth - 1));
});
});
} else if (clone.__isArray(parent)) {
child = [];
} else if (clone.__isRegExp(parent)) {
child = new RegExp(parent.source, __getRegExpFlags(parent));
if (parent.lastIndex) child.lastIndex = parent.lastIndex;
} else if (clone.__isDate(parent)) {
child = new Date(parent.getTime());
} else if (useBuffer && Buffer.isBuffer(parent)) {
if (Buffer.allocUnsafe) {
// Node.js >= 4.5.0
child = Buffer.allocUnsafe(parent.length);
} else {
// Older Node.js versions
child = new Buffer(parent.length);
}
parent.copy(child);
return child;
} else if (_instanceof(parent, Error)) {
child = Object.create(parent);
} else {
if (typeof prototype == 'undefined') {
proto = Object.getPrototypeOf(parent);
child = Object.create(proto);
}
else {
child = Object.create(prototype);
proto = prototype;
}
}
if (circular) {
var index = allParents.indexOf(parent);
if (index != -1) {
return allChildren[index];
}
allParents.push(parent);
allChildren.push(child);
}
if (_instanceof(parent, nativeMap)) {
parent.forEach(function(value, key) {
var keyChild = _clone(key, depth - 1);
var valueChild = _clone(value, depth - 1);
child.set(keyChild, valueChild);
});
}
if (_instanceof(parent, nativeSet)) {
parent.forEach(function(value) {
var entryChild = _clone(value, depth - 1);
child.add(entryChild);
});
}
for (var i in parent) {
var attrs;
if (proto) {
attrs = Object.getOwnPropertyDescriptor(proto, i);
}
if (attrs && attrs.set == null) {
continue;
}
child[i] = _clone(parent[i], depth - 1);
}
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(parent);
for (var i = 0; i < symbols.length; i++) {
// Don't need to worry about cloning a symbol because it is a primitive,
// like a number or string.
var symbol = symbols[i];
var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);
if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
continue;
}
child[symbol] = _clone(parent[symbol], depth - 1);
if (!descriptor.enumerable) {
Object.defineProperty(child, symbol, {
enumerable: false
});
}
}
}
if (includeNonEnumerable) {
var allPropertyNames = Object.getOwnPropertyNames(parent);
for (var i = 0; i < allPropertyNames.length; i++) {
var propertyName = allPropertyNames[i];
var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);
if (descriptor && descriptor.enumerable) {
continue;
}
child[propertyName] = _clone(parent[propertyName], depth - 1);
Object.defineProperty(child, propertyName, {
enumerable: false
});
}
}
return child;
}
return _clone(parent, depth);
}
/**
* Simple flat clone using prototype, accepts only objects, usefull for property
* override on FLAT configuration object (no nested props).
*
* USE WITH CAUTION! This may not behave as you wish if you do not know how this
* works.
*/
clone.clonePrototype = function clonePrototype(parent) {
if (parent === null)
return null;
var c = function () {};
c.prototype = parent;
return new c();
};
// private utility functions
function __objToStr(o) {
return Object.prototype.toString.call(o);
}
clone.__objToStr = __objToStr;
function __isDate(o) {
return typeof o === 'object' && __objToStr(o) === '[object Date]';
}
clone.__isDate = __isDate;
function __isArray(o) {
return typeof o === 'object' && __objToStr(o) === '[object Array]';
}
clone.__isArray = __isArray;
function __isRegExp(o) {
return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
}
clone.__isRegExp = __isRegExp;
function __getRegExpFlags(re) {
var flags = '';
if (re.global) flags += 'g';
if (re.ignoreCase) flags += 'i';
if (re.multiline) flags += 'm';
return flags;
}
clone.__getRegExpFlags = __getRegExpFlags;
return clone;
})();
if (typeof module === 'object' && module.exports) {
module.exports = clone;
}
@@ -0,0 +1,43 @@
# data-view-byte-offset <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
Get the `byteOffset` out of a DataView, robustly.
This will work in node <= 0.10 and < 0.11.4, where there's no prototype accessor, only a nonconfigurable own property.
It will also work in modern engines where `DataView.prototype.byteOffset` has been deleted after this module has loaded.
## Example
```js
const dataViewByteOffset = require('data-view-byte-offset');
const assert = require('assert');
const ab = new ArrayBuffer(42);
const dv = new DataView(ab, 2);
assert.equal(dataViewByteOffset(dv), 2);
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/data-view-byte-offset
[npm-version-svg]: https://versionbadg.es/inspect-js/data-view-byte-offset.svg
[deps-svg]: https://david-dm.org/inspect-js/data-view-byte-offset.svg
[deps-url]: https://david-dm.org/inspect-js/data-view-byte-offset
[dev-deps-svg]: https://david-dm.org/inspect-js/data-view-byte-offset/dev-status.svg
[dev-deps-url]: https://david-dm.org/inspect-js/data-view-byte-offset#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/data-view-byte-offset.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/data-view-byte-offset.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/data-view-byte-offset.svg
[downloads-url]: https://npm-stat.com/charts.html?package=data-view-byte-offset
[codecov-image]: https://codecov.io/gh/inspect-js/data-view-byte-offset/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/data-view-byte-offset/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/data-view-byte-offset
[actions-url]: https://github.com/inspect-js/data-view-byte-offset/actions
@@ -0,0 +1,30 @@
import freeGlobal from './_freeGlobal.js';
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;
/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
try {
// Use `util.types` for Node.js 10+.
var types = freeModule && freeModule.require && freeModule.require('util').types;
if (types) {
return types;
}
// Legacy `process.binding('util')` for Node.js < 10.
return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}());
export default nodeUtil;
@@ -0,0 +1,29 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
module.exports = {
meta: {
docs: {
description: "disallow optional `catch` binding.",
category: "ES2019",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-optional-catch-binding.html",
},
fixable: null,
messages: {
forbidden: "ES2019 optional 'catch' binding is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"CatchClause[param=null]"(node) {
context.report({ node, messageId: "forbidden" })
},
}
},
}
@@ -0,0 +1 @@
{"name":"@react-types/overlays","version":"3.9.2","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532106435,"integrity":"sha512-cil7stSp3ik41Hdv2Dj+GMcbvUfs1q+MZ2Yte0804py9i6oJJN/diCiIr/brcQOZ5ZqwAI6dgaHA7l8FZheQBw==","mode":420,"size":11335},"package.json":{"checkedAt":1794532106435,"integrity":"sha512-1sWsZOBtKEMdEtuKQmoZttr0WOC/SEvqMo6DjK2xdESuUjGkTyHccwDGhXEw1HeKtuGA2QYIY5Hj4w/9rFAShQ==","mode":420,"size":526},"README.md":{"checkedAt":1794532106435,"integrity":"sha512-j7JOylbFKDGc3Q3jWoxuL67gEo57GLudjCCqTBWaryGEMzWYaoPQkWdsc5xpdMwINW+SYXx9ftc3F+VDdYxVOA==","mode":420,"size":139},"src/index.d.ts":{"checkedAt":1794532106435,"integrity":"sha512-PP9chqz+Ogp38E8OIEaYmmIk+d930TimyX2m0Av15UHW2QWTmiTlR2AgkP+4mnr3ixbNhKDg0ccFqrpoasUWxQ==","mode":420,"size":3852}}}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('stubObject', require('../stubObject'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1 @@
{"name":"encodeurl","version":"2.0.0","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532089603,"integrity":"sha512-dFopY1mmM4PKVCEb5BHg1vYZE7GEmzJMaZYbPr7EDE4srhZsXjX+FK6S0StWxUcrIiKSEfiK+tiHQQpjicbhyA==","mode":420,"size":1089},"index.js":{"checkedAt":1794532089603,"integrity":"sha512-CbHyWQ10JunVFCsF2QP34xCO2XMSgHMufPEt7SpbW5hLRJhojzT1GFrk31EYhCJLj2eHt+CdJBv1AVWnE8venw==","mode":420,"size":1578},"package.json":{"checkedAt":1794532089603,"integrity":"sha512-7jeMgh32jEF0VWB+4ttm+74IdVnmhDyz44cMuCEWSOpIDlz4Wa8Ng1FDT6iKWstxiBdlPmvAT3Dolh05mfZygA==","mode":420,"size":1092},"README.md":{"checkedAt":1794532089604,"integrity":"sha512-uEqKVkycAenCX4TzsBIIHRkkpLI4AX+7RKxgkmhEZpnAhN59j8o2kYFbRkfFJlib9q6s3iaLr2FyFBIDV/w3jg==","mode":420,"size":3221}}}
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (C) 2015 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,38 @@
import debug from 'debug';
const log = debug('eslint-plugin-import-x:utils:ModuleCache');
export class ModuleCache {
constructor(map = new Map()) {
this.map = map;
}
set(cacheKey, result) {
this.map.set(cacheKey, {
result,
lastSeen: process.hrtime(),
});
log('setting entry for', cacheKey);
return result;
}
get(cacheKey, settings) {
const cache = this.map.get(cacheKey);
if (cache) {
if (process.hrtime(cache.lastSeen)[0] < settings.lifetime) {
return cache.result;
}
}
else {
log('cache miss for', cacheKey);
}
}
static getSettings(settings) {
const cacheSettings = {
lifetime: 30,
...settings['import-x/cache'],
};
if (typeof cacheSettings.lifetime === 'string' &&
['∞', 'Infinity'].includes(cacheSettings.lifetime)) {
cacheSettings.lifetime = Number.POSITIVE_INFINITY;
}
return cacheSettings;
}
}
//# sourceMappingURL=module-cache.js.map
@@ -0,0 +1 @@
{"version":3,"file":"require.js","sourceRoot":"","sources":["../src/require.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAI3C,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAA;AAErC,MAAM,CAAC,MAAM,UAAU,GAAe,aAAa;IACjD,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC;IAC9B,CAAC,CAA4B,OAAO,CAAA"}
@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PartitionNumberRangePattern = PartitionNumberRangePattern;
var utils_1 = require("../utils");
var CollapseNumberRange_1 = require("./CollapseNumberRange");
var FormatApproximately_1 = require("./FormatApproximately");
var FormatNumeric_1 = require("./FormatNumeric");
var PartitionNumberPattern_1 = require("./PartitionNumberPattern");
/**
* https://tc39.es/ecma402/#sec-partitionnumberrangepattern
*/
function PartitionNumberRangePattern(numberFormat, x, y, _a) {
var getInternalSlots = _a.getInternalSlots;
// 1. Assert: x and y are both mathematical values.
(0, utils_1.invariant)(!x.isNaN() && !y.isNaN(), 'Input must be a number', RangeError);
var internalSlots = getInternalSlots(numberFormat);
// 3. Let xResult be ? PartitionNumberPattern(numberFormat, x).
var xResult = (0, PartitionNumberPattern_1.PartitionNumberPattern)(internalSlots, x);
// 4. Let yResult be ? PartitionNumberPattern(numberFormat, y).
var yResult = (0, PartitionNumberPattern_1.PartitionNumberPattern)(internalSlots, y);
if ((0, FormatNumeric_1.FormatNumeric)(internalSlots, x) === (0, FormatNumeric_1.FormatNumeric)(internalSlots, y)) {
var appxResult = (0, FormatApproximately_1.FormatApproximately)(internalSlots, xResult);
appxResult.forEach(function (el) {
el.source = 'shared';
});
return appxResult;
}
var result = [];
xResult.forEach(function (el) {
el.source = 'startRange';
result.push(el);
});
// 9. Let symbols be internalSlots.[[dataLocaleData]].[[numbers]].[[symbols]][internalSlots.[[numberingSystem]]].
var rangeSeparator = internalSlots.dataLocaleData.numbers.symbols[internalSlots.numberingSystem]
.rangeSign;
result.push({ type: 'literal', value: rangeSeparator, source: 'shared' });
yResult.forEach(function (el) {
el.source = 'endRange';
result.push(el);
});
// 13. Return ? CollapseNumberRange(numberFormat, result).
return (0, CollapseNumberRange_1.CollapseNumberRange)(numberFormat, result, { getInternalSlots: getInternalSlots });
}
@@ -0,0 +1,553 @@
/**
* @fileoverview Main CLI object.
* @author Nicholas C. Zakas
*/
"use strict";
/*
* NOTE: The CLI object should *not* call process.exit() directly. It should only return
* exit codes. This allows other programs to use the CLI object and still control
* when the program exits.
*/
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const fs = require("node:fs"),
{ mkdir, stat, writeFile } = require("node:fs/promises"),
path = require("node:path"),
{ pathToFileURL } = require("node:url"),
{ LegacyESLint } = require("./eslint"),
{
ESLint,
shouldUseFlatConfig,
locateConfigFileToUse,
} = require("./eslint/eslint"),
createCLIOptions = require("./options"),
log = require("./shared/logging"),
RuntimeInfo = require("./shared/runtime-info"),
translateOptions = require("./shared/translate-cli-options");
const { getCacheFile } = require("./eslint/eslint-helpers");
const { SuppressionsService } = require("./services/suppressions-service");
const debug = require("debug")("eslint:cli");
//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------
/** @typedef {import("./options").ParsedCLIOptions} ParsedCLIOptions */
/** @typedef {import("./types").ESLint.LintResult} LintResult */
/** @typedef {import("./types").ESLint.ResultsMeta} ResultsMeta */
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Count error messages.
* @param {LintResult[]} results The lint results.
* @returns {{errorCount:number;fatalErrorCount:number,warningCount:number}} The number of error messages.
*/
function countErrors(results) {
let errorCount = 0;
let fatalErrorCount = 0;
let warningCount = 0;
for (const result of results) {
errorCount += result.errorCount;
fatalErrorCount += result.fatalErrorCount;
warningCount += result.warningCount;
}
return { errorCount, fatalErrorCount, warningCount };
}
/**
* Creates an options module from the provided CLI options and encodes it as a data URL.
* @param {ParsedCLIOptions} options The CLI options.
* @returns {URL} The URL of the options module.
*/
function createOptionsModule(options) {
const translateOptionsFileURL = new URL(
"./shared/translate-cli-options.js",
pathToFileURL(__filename),
).href;
const optionsSrc =
`import translateOptions from ${JSON.stringify(translateOptionsFileURL)};\n` +
`export default await translateOptions(${JSON.stringify(options)}, "flat");\n`;
// Base64 encoding is typically shorter than URL encoding
return new URL(
`data:text/javascript;base64,${Buffer.from(optionsSrc).toString("base64")}`,
);
}
/**
* Check if a given file path is a directory or not.
* @param {string} filePath The path to a file to check.
* @returns {Promise<boolean>} `true` if the given path is a directory.
*/
async function isDirectory(filePath) {
try {
return (await stat(filePath)).isDirectory();
} catch (error) {
if (error.code === "ENOENT" || error.code === "ENOTDIR") {
return false;
}
throw error;
}
}
/**
* Outputs the results of the linting.
* @param {ESLint} engine The ESLint instance to use.
* @param {LintResult[]} results The results to print.
* @param {string} format The name of the formatter to use or the path to the formatter.
* @param {string} outputFile The path for the output file.
* @param {ResultsMeta} resultsMeta Warning count and max threshold.
* @returns {Promise<boolean>} True if the printing succeeds, false if not.
* @private
*/
async function printResults(engine, results, format, outputFile, resultsMeta) {
let formatter;
try {
formatter = await engine.loadFormatter(format);
} catch (e) {
log.error(e.message);
return false;
}
const output = await formatter.format(results, resultsMeta);
if (outputFile) {
const filePath = path.resolve(process.cwd(), outputFile);
if (await isDirectory(filePath)) {
log.error(
"Cannot write to output file path, it is a directory: %s",
outputFile,
);
return false;
}
try {
await mkdir(path.dirname(filePath), { recursive: true });
await writeFile(filePath, output);
} catch (ex) {
log.error("There was a problem writing the output file:\n%s", ex);
return false;
}
} else if (output) {
log.info(output);
}
return true;
}
/**
* Validates the `--concurrency` flag value.
* @param {string} concurrency The `--concurrency` flag value to validate.
* @returns {void}
* @throws {Error} If the `--concurrency` flag value is invalid.
*/
function validateConcurrency(concurrency) {
if (
concurrency === void 0 ||
concurrency === "auto" ||
concurrency === "off"
) {
return;
}
const concurrencyValue = Number(concurrency);
if (!Number.isInteger(concurrencyValue) || concurrencyValue < 1) {
throw new Error(
`Option concurrency: '${concurrency}' is not a positive integer, 'auto' or 'off'.`,
);
}
}
//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------
/**
* Encapsulates all CLI behavior for eslint. Makes it easier to test as well as
* for other Node.js programs to effectively run the CLI.
*/
const cli = {
/**
* Calculates the command string for the --inspect-config operation.
* @param {string} configFile The path to the config file to inspect.
* @returns {Promise<string>} The command string to execute.
*/
async calculateInspectConfigFlags(configFile) {
// find the config file
const { configFilePath, basePath } = await locateConfigFileToUse({
cwd: process.cwd(),
configFile,
});
return ["--config", configFilePath, "--basePath", basePath];
},
/**
* Executes the CLI based on an array of arguments that is passed in.
* @param {string|Array|Object} args The arguments to process.
* @param {string} [text] The text to lint (used for TTY).
* @param {boolean} [allowFlatConfig=true] Whether or not to allow flat config.
* @returns {Promise<number>} The exit code for the operation.
*/
async execute(args, text, allowFlatConfig = true) {
if (Array.isArray(args)) {
debug("CLI args: %o", args.slice(2));
}
/*
* Before doing anything, we need to see if we are using a
* flat config file. If so, then we need to change the way command
* line args are parsed. This is temporary, and when we fully
* switch to flat config we can remove this logic.
*/
const usingFlatConfig =
allowFlatConfig && (await shouldUseFlatConfig());
debug("Using flat config?", usingFlatConfig);
if (allowFlatConfig && !usingFlatConfig) {
const { WarningService } = require("./services/warning-service");
new WarningService().emitESLintRCWarning();
}
const CLIOptions = createCLIOptions(usingFlatConfig);
/** @type {ParsedCLIOptions} */
let options;
try {
options = CLIOptions.parse(args);
validateConcurrency(options.concurrency);
} catch (error) {
debug("Error parsing CLI options:", error.message);
let errorMessage = error.message;
if (usingFlatConfig) {
errorMessage +=
"\nYou're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details.";
}
log.error(errorMessage);
return 2;
}
const files = options._;
const useStdin = typeof text === "string";
if (options.help) {
log.info(CLIOptions.generateHelp());
return 0;
}
if (options.version) {
log.info(RuntimeInfo.version());
return 0;
}
if (options.envInfo) {
try {
log.info(RuntimeInfo.environment());
return 0;
} catch (err) {
debug("Error retrieving environment info");
log.error(err.message);
return 2;
}
}
if (options.printConfig) {
if (files.length) {
log.error(
"The --print-config option must be used with exactly one file name.",
);
return 2;
}
if (useStdin) {
log.error(
"The --print-config option is not available for piped-in code.",
);
return 2;
}
const engine = usingFlatConfig
? new ESLint(await translateOptions(options, "flat"))
: new LegacyESLint(await translateOptions(options));
const fileConfig = await engine.calculateConfigForFile(
options.printConfig,
);
log.info(JSON.stringify(fileConfig, null, " "));
return 0;
}
if (options.inspectConfig) {
log.info(
"You can also run this command directly using 'npx @eslint/config-inspector@latest' in the same directory as your configuration file.",
);
try {
const flatOptions = await translateOptions(options, "flat");
const spawn = require("cross-spawn");
const flags = await cli.calculateInspectConfigFlags(
flatOptions.overrideConfigFile,
);
spawn.sync(
"npx",
["@eslint/config-inspector@latest", ...flags],
{ encoding: "utf8", stdio: "inherit" },
);
} catch (error) {
log.error(error);
return 2;
}
return 0;
}
debug(`Running on ${useStdin ? "text" : "files"}`);
if (options.fix && options.fixDryRun) {
log.error(
"The --fix option and the --fix-dry-run option cannot be used together.",
);
return 2;
}
if (useStdin && options.fix) {
log.error(
"The --fix option is not available for piped-in code; use --fix-dry-run instead.",
);
return 2;
}
if (options.fixType && !options.fix && !options.fixDryRun) {
log.error(
"The --fix-type option requires either --fix or --fix-dry-run.",
);
return 2;
}
if (
options.reportUnusedDisableDirectives &&
options.reportUnusedDisableDirectivesSeverity !== void 0
) {
log.error(
"The --report-unused-disable-directives option and the --report-unused-disable-directives-severity option cannot be used together.",
);
return 2;
}
if (usingFlatConfig && options.ext) {
// Passing `--ext ""` results in `options.ext` being an empty array.
if (options.ext.length === 0) {
log.error("The --ext option value cannot be empty.");
return 2;
}
// Passing `--ext ,ts` results in an empty string at index 0. Passing `--ext ts,,tsx` results in an empty string at index 1.
const emptyStringIndex = options.ext.indexOf("");
if (emptyStringIndex >= 0) {
log.error(
`The --ext option arguments cannot be empty strings. Found an empty string at index ${emptyStringIndex}.`,
);
return 2;
}
}
if (options.suppressAll && options.suppressRule) {
log.error(
"The --suppress-all option and the --suppress-rule option cannot be used together.",
);
return 2;
}
if (options.suppressAll && options.pruneSuppressions) {
log.error(
"The --suppress-all option and the --prune-suppressions option cannot be used together.",
);
return 2;
}
if (options.suppressRule && options.pruneSuppressions) {
log.error(
"The --suppress-rule option and the --prune-suppressions option cannot be used together.",
);
return 2;
}
if (
useStdin &&
(options.suppressAll ||
options.suppressRule ||
options.pruneSuppressions)
) {
log.error(
"The --suppress-all, --suppress-rule, and --prune-suppressions options cannot be used with piped-in code.",
);
return 2;
}
const ActiveESLint = usingFlatConfig ? ESLint : LegacyESLint;
/** @type {ESLint|LegacyESLint} */
let engine;
if (options.concurrency && options.concurrency !== "off") {
const optionsURL = createOptionsModule(options);
engine = await ESLint.fromOptionsModule(optionsURL);
} else {
const eslintOptions = await translateOptions(
options,
usingFlatConfig ? "flat" : "eslintrc",
);
engine = new ActiveESLint(eslintOptions);
}
let results;
if (useStdin) {
results = await engine.lintText(text, {
filePath: options.stdinFilename,
// flatConfig respects CLI flag and constructor warnIgnored, eslintrc forces true for backwards compatibility
warnIgnored: usingFlatConfig ? void 0 : true,
});
} else {
results = await engine.lintFiles(files);
}
if (options.fix) {
debug("Fix mode enabled - applying fixes");
await ActiveESLint.outputFixes(results);
}
let unusedSuppressions = {};
if (!useStdin) {
const suppressionsFileLocation = getCacheFile(
options.suppressionsLocation || "eslint-suppressions.json",
process.cwd(),
{
prefix: "suppressions_",
},
);
if (
options.suppressionsLocation &&
!fs.existsSync(suppressionsFileLocation) &&
!options.suppressAll &&
!options.suppressRule
) {
log.error(
"The suppressions file does not exist. Please run the command with `--suppress-all` or `--suppress-rule` to create it.",
);
return 2;
}
if (
options.suppressAll ||
options.suppressRule ||
options.pruneSuppressions ||
fs.existsSync(suppressionsFileLocation)
) {
const suppressions = new SuppressionsService({
filePath: suppressionsFileLocation,
cwd: process.cwd(),
});
if (options.suppressAll || options.suppressRule) {
await suppressions.suppress(results, options.suppressRule);
}
if (options.pruneSuppressions) {
await suppressions.prune(results);
}
const suppressionResults = suppressions.applySuppressions(
results,
await suppressions.load(),
);
results = suppressionResults.results;
unusedSuppressions = suppressionResults.unused;
}
}
let resultsToPrint = results;
if (options.quiet) {
debug("Quiet mode enabled - filtering out warnings");
resultsToPrint = ActiveESLint.getErrorResults(resultsToPrint);
}
const resultCounts = countErrors(results);
const tooManyWarnings =
options.maxWarnings >= 0 &&
resultCounts.warningCount > options.maxWarnings;
const resultsMeta = tooManyWarnings
? {
maxWarningsExceeded: {
maxWarnings: options.maxWarnings,
foundWarnings: resultCounts.warningCount,
},
}
: {};
if (
await printResults(
engine,
resultsToPrint,
options.format,
options.outputFile,
resultsMeta,
)
) {
// Errors and warnings from the original unfiltered results should determine the exit code
const shouldExitForFatalErrors =
options.exitOnFatalError && resultCounts.fatalErrorCount > 0;
if (!resultCounts.errorCount && tooManyWarnings) {
log.error(
"ESLint found too many warnings (maximum: %s).",
options.maxWarnings,
);
}
if (!options.passOnUnprunedSuppressions) {
const unusedSuppressionsCount =
Object.keys(unusedSuppressions).length;
if (unusedSuppressionsCount > 0) {
log.error(
"There are suppressions left that do not occur anymore. Consider re-running the command with `--prune-suppressions`.",
);
debug(JSON.stringify(unusedSuppressions, null, 2));
return 2;
}
}
if (shouldExitForFatalErrors) {
return 2;
}
return resultCounts.errorCount || tooManyWarnings ? 1 : 0;
}
return 2;
},
};
module.exports = cli;
@@ -0,0 +1 @@
{"version":3,"file":"scroll.js","names":["ContainerBlot","LeafBlot","Scope","ScrollBlot","Delta","AttributeMap","Op","Emitter","Block","BlockEmbed","bubbleFormats","Break","Container","isLine","blot","isUpdatable","updateContent","Scroll","blotName","className","tagName","defaultChild","allowedChildren","constructor","registry","domNode","_ref","emitter","batch","optimize","enable","addEventListener","e","handleDragStart","batchStart","Array","isArray","batchEnd","mutations","update","emitMount","emit","events","SCROLL_BLOT_MOUNT","emitUnmount","SCROLL_BLOT_UNMOUNT","emitEmbedUpdate","change","SCROLL_EMBED_UPDATE","deleteAt","index","length","first","offset","line","last","ref","children","head","moveChildren","remove","enabled","arguments","undefined","setAttribute","formatAt","format","value","insertAt","def","scroll","query","BLOCK","create","statics","appendChild","endsWith","slice","embed","insertBefore","scope","INLINE_BLOT","wrapper","insertContents","delta","renderBlocks","deltaToRenderBlocks","concat","insert","pop","shift","shouldInsertNewlineChar","type","descendant","key","insertInlineContents","newlineCharLength","lineEndIndex","formats","attributes","diff","Object","keys","forEach","name","refBlot","refBlotOffset","find","split","renderBlock","block","createBlock","blockEmbed","isEnabled","getAttribute","leaf","path","lines","Number","MAX_VALUE","getLines","blotIndex","blotLength","lengthLeft","forEachAt","child","childIndex","childLength","push","context","SCROLL_OPTIMIZE","source","sources","USER","observer","takeRecords","filter","_ref2","target","SCROLL_BEFORE_UPDATE","SCROLL_UPDATE","updateEmbedAt","b","event","preventDefault","currentBlockDelta","op","splitted","text","INLINE","entries","_ref3","isBlockBlot","BLOT","_ref4","parent","inlineContents","reduce","isInlineEmbed"],"sources":["../../src/blots/scroll.ts"],"sourcesContent":["import { ContainerBlot, LeafBlot, Scope, ScrollBlot } from 'parchment';\nimport type { Blot, Parent, EmbedBlot, ParentBlot, Registry } from 'parchment';\nimport Delta, { AttributeMap, Op } from 'quill-delta';\nimport Emitter from '../core/emitter.js';\nimport type { EmitterSource } from '../core/emitter.js';\nimport Block, { BlockEmbed, bubbleFormats } from './block.js';\nimport Break from './break.js';\nimport Container from './container.js';\n\ntype RenderBlock =\n | {\n type: 'blockEmbed';\n attributes: AttributeMap;\n key: string;\n value: unknown;\n }\n | { type: 'block'; attributes: AttributeMap; delta: Delta };\n\nfunction isLine(blot: unknown): blot is Block | BlockEmbed {\n return blot instanceof Block || blot instanceof BlockEmbed;\n}\n\ninterface UpdatableEmbed {\n updateContent(change: unknown): void;\n}\n\nfunction isUpdatable(blot: Blot): blot is Blot & UpdatableEmbed {\n return typeof (blot as unknown as any).updateContent === 'function';\n}\n\nclass Scroll extends ScrollBlot {\n static blotName = 'scroll';\n static className = 'ql-editor';\n static tagName = 'DIV';\n static defaultChild = Block;\n static allowedChildren = [Block, BlockEmbed, Container];\n\n emitter: Emitter;\n batch: false | MutationRecord[];\n\n constructor(\n registry: Registry,\n domNode: HTMLDivElement,\n { emitter }: { emitter: Emitter },\n ) {\n super(registry, domNode);\n this.emitter = emitter;\n this.batch = false;\n this.optimize();\n this.enable();\n this.domNode.addEventListener('dragstart', (e) => this.handleDragStart(e));\n }\n\n batchStart() {\n if (!Array.isArray(this.batch)) {\n this.batch = [];\n }\n }\n\n batchEnd() {\n if (!this.batch) return;\n const mutations = this.batch;\n this.batch = false;\n this.update(mutations);\n }\n\n emitMount(blot: Blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_MOUNT, blot);\n }\n\n emitUnmount(blot: Blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_UNMOUNT, blot);\n }\n\n emitEmbedUpdate(blot: Blot, change: unknown) {\n this.emitter.emit(Emitter.events.SCROLL_EMBED_UPDATE, blot, change);\n }\n\n deleteAt(index: number, length: number) {\n const [first, offset] = this.line(index);\n const [last] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof BlockEmbed || last instanceof BlockEmbed) {\n this.optimize();\n return;\n }\n const ref =\n last.children.head instanceof Break ? null : last.children.head;\n // @ts-expect-error\n first.moveChildren(last, ref);\n // @ts-expect-error\n first.remove();\n }\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled ? 'true' : 'false');\n }\n\n formatAt(index: number, length: number, format: string, value: unknown) {\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n Line truncated
@@ -0,0 +1,41 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("eslint-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `WeakSet` class.",
category: "ES2015",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-weak-set.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' class is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"() {
const tracker = new ReferenceTracker(context.getScope())
for (const { node, path } of tracker.iterateGlobalReferences({
WeakSet: { [READ]: true },
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1,46 @@
"use strict"
const {
definePrototypeMethodHandler,
} = require("../util/define-prototype-method-handler")
module.exports = {
meta: {
docs: {
description: "disallow the `Array.prototype.toSorted` method.",
category: "ES2023",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-array-prototype-tosorted.html",
},
fixable: null,
messages: {
forbidden: "ES2023 '{{name}}' method is forbidden.",
},
schema: [
{
type: "object",
properties: {
aggressive: { type: "boolean" },
},
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
return definePrototypeMethodHandler(context, {
Array: ["toSorted"],
Int8Array: ["toSorted"],
Uint8Array: ["toSorted"],
Uint8ClampedArray: ["toSorted"],
Int16Array: ["toSorted"],
Uint16Array: ["toSorted"],
Int32Array: ["toSorted"],
Uint32Array: ["toSorted"],
Float32Array: ["toSorted"],
Float64Array: ["toSorted"],
BigInt64Array: ["toSorted"],
BigUint64Array: ["toSorted"],
})
},
}
@@ -0,0 +1,17 @@
var $b6b1503b17b2254d$exports = {};
$b6b1503b17b2254d$exports = {
"deselectedItem": (args)=>`${args.item} n\xe3o selecionado.`,
"longPressToSelect": `Prima continuamente para entrar no modo de sele\xe7\xe3o.`,
"select": `Selecionar`,
"selectedAll": `Todos os itens selecionados.`,
"selectedCount": (args, formatter)=>`${formatter.plural(args.count, {
"=0": `Nenhum item selecionado`,
one: ()=>`${formatter.number(args.count)} item selecionado`,
other: ()=>`${formatter.number(args.count)} itens selecionados`
})}.`,
"selectedItem": (args)=>`${args.item} selecionado.`
};
export {$b6b1503b17b2254d$exports as default};
//# sourceMappingURL=pt-PT.module.js.map
@@ -0,0 +1,19 @@
import type { BlockScope } from './BlockScope';
import type { CatchScope } from './CatchScope';
import type { ClassFieldInitializerScope } from './ClassFieldInitializerScope';
import type { ClassScope } from './ClassScope';
import type { ClassStaticBlockScope } from './ClassStaticBlockScope';
import type { ConditionalTypeScope } from './ConditionalTypeScope';
import type { ForScope } from './ForScope';
import type { FunctionExpressionNameScope } from './FunctionExpressionNameScope';
import type { FunctionScope } from './FunctionScope';
import type { FunctionTypeScope } from './FunctionTypeScope';
import type { GlobalScope } from './GlobalScope';
import type { MappedTypeScope } from './MappedTypeScope';
import type { ModuleScope } from './ModuleScope';
import type { SwitchScope } from './SwitchScope';
import type { TSEnumScope } from './TSEnumScope';
import type { TSModuleScope } from './TSModuleScope';
import type { TypeScope } from './TypeScope';
import type { WithScope } from './WithScope';
export type Scope = BlockScope | CatchScope | ClassFieldInitializerScope | ClassScope | ClassStaticBlockScope | ConditionalTypeScope | ForScope | FunctionExpressionNameScope | FunctionScope | FunctionTypeScope | GlobalScope | MappedTypeScope | ModuleScope | SwitchScope | TSEnumScope | TSModuleScope | TypeScope | WithScope;
@@ -0,0 +1,18 @@
'use strict';
var callBind = require('call-bind');
var define = require('define-properties');
var implementation = require('./implementation');
var getPolyfill = require('./polyfill');
var shim = require('./shim');
var bound = callBind(getPolyfill(), typeof Reflect === 'object' ? Reflect : Object);
define(bound, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = bound;
@@ -0,0 +1,10 @@
import * as React from "react";
export interface IconContext {
color?: string;
size?: string;
className?: string;
style?: React.CSSProperties;
attr?: React.SVGAttributes<SVGElement>;
}
export declare const DefaultContext: IconContext;
export declare const IconContext: React.Context<IconContext>;
@@ -0,0 +1 @@
{"version":3,"file":"BindingConstraintsImplementation.spec.d.ts","sourceRoot":"","sources":["../../../../src/binding/models/BindingConstraintsImplementation.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_read_only_error.cjs",
"module": "../../esm/_read_only_error.js"
}
@@ -0,0 +1,52 @@
declare enum PaginationItemType {
DOTS = "dots",
PREV = "prev",
NEXT = "next"
}
interface UsePaginationProps {
/**
* The total number of pages.
*/
total: number;
/**
* The selected page on initial render.
* @default 1
*/
initialPage?: number;
/**
* The controlled selected page.
*/
page?: number;
/**
* The number of pages to show on each side of the current page.
* @default 1
*/
siblings?: number;
/**
* The number of pages to show at the beginning and end of the pagination.
* @default 1
*/
boundaries?: number;
/**
* If `true`, the range will include "prev" and "next" buttons.
* @default false
*/
showControls?: boolean;
/**
* Callback fired when the page changes.
*/
onChange?: (page: number) => void;
}
type PaginationItemValue = number | PaginationItemType;
declare function usePagination(props: UsePaginationProps): {
range: PaginationItemValue[];
activePage: number;
setPage: (pageNumber: number) => void;
next: () => void;
previous: () => void;
first: () => void;
last: () => void;
};
type UsePaginationReturn = ReturnType<typeof usePagination>;
export { PaginationItemType, type PaginationItemValue, type UsePaginationProps, type UsePaginationReturn, usePagination };
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('spreadFrom', require('../spread'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,731 @@
flf2a$ 7 6 13 -1 16 0 7999 0
Author : LG Beard
Date : 2004/10/1 15:09:40
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
---
Font modified June 17, 2007 by patorjk
This was to widen the space character and for spacing in characters like "&"
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $##
.`( #
\_ ) #
)\ #
\( #
_ #
`.( #
##
_ _ #
).').' #
#
#
#
#
##
##
#
#
#
#
#
##
)\.-. #
( ,_.' #
`-.`-. #
.'/_\ \ #
'.__, ) #
\( #
##
%#
#
#
#
#
#
##
&#
#
#
#
#
#
##
'#
#
#
#
#
#
##
)'. #
( / #
) / #
(oO) #
) \ #
( \ #
).' ##
.`( #
\ ) #
\ ( #
(Oo) #
/ ( #
/ ) #
`.( ##
*#
#
#
#
#
#
##
)`. #
( / #
.- -. #
'- -' #
/ ) #
'.( #
##
#
#
#
_)/ #
/ ) #
'.( #
##
#
/( #
) \/(.-,, #
( _ )#
`._.-' \( #
#
##
#
#
#
,_ #
( \ #
).' #
##
)\ #
\ ) #
// #
(( #
// #
/( #
)/ ##
,,-,, #
/,--, \ #
/ \ ( \ #
\ ) \ / #
\ `--`( #
``-`)/ #
##
.'( #
/_ ) #
) ( #
\ ) #
_) \_ #
)__,__/ #
##
.```./( #
)_,-, ) #
.-'.-' #
( (.-., #
/ ) #
)/`._.' #
##
.---./( #
(_.-, ) #
,-` / #
_'-, ( #
)`-' ) #
`._..( #
##
.'`( #
//`. ) #
//__/( #
`--, ) #
) \ #
)/ #
##
)\.--. #
( ._. #
`-.`. #
,_ \ \ #
) '.,/ / #
'._,_.' #
##
)`. #
( ( _ #
) `' `. #
( .-. ( #
`. - / #
\,-' #
##
.```./( #
)_,-, ) #
/ ( #
_) / #
/ / #
'./ #
##
,-,-. #
,' _ ) #
( '-' ( #
) _ ) #
( '-' / #
)/._.' #
##
.-'\ #
/ _ `, #
) `-` ) #
`._., ( #
` ) #
\( #
##
.'( #
\_ ) #
#
_ #
/ ) #
'.( #
##
_ #
).' #
#
_)/ #
/ ) #
'.( #
##
#
#
/(_ #
) _( #
\( #
#
##
,,-. #
( `-._ #
`._.-._.' #
.-,, #
_.-' ) #
`._.-._.' #
##
#
#
_)\ #
)_ ( #
)/ #
#
##
.```./( #
( ,-, ) #
`-` / / #
)/ #
_ #
).' #
##
@#
#
#
#
#
#
##
/`-. #
,' _ \ #
( '-' ( #
) _ ) #
( ,' ) \ #
)/ )/ #
##
/(,-. #
,' _ ) #
( '-' ( #
) _ ) #
( '-' / #
)/._.' #
##
)\.-. #
,' ,-,_) #
( . _ #
) '..' ) #
( , ( #
)/'._.' #
##
)\.-. #
,' ) #
( .-, ( #
) '._\ ) #
( , ( #
)/ ._.' #
##
)\.---. #
( ,-._( #
\ '-, #
) ,-` #
( ``-. #
)..-.( #
##
)`-.--. #
) ,-._( #
\ `-._ #
) ,_( #
( \ #
).' #
##
)\.-. #
,' ,-,_) #
( . __ #
) '._\ _) #
( , ( #
)/'._.' #
##
.'( #
,') \ ) #
( '-' ( #
) .-. ) #
( , ) \ #
)/ )/ #
##
.'( #
\ ) #
) ( #
\ ) #
) \ #
)/ #
##
.-,.-.,-.#
).-, ,-.(#
)) #
.-._(( #
( ) #
'._.\( #
##
.'( #
,')\ ) #
( '/ / #
) ( #
( .\ \ #
)/ )/ #
##
.') #
( / #
)) #
)'._.-. #
( ) #
)/,__.' #
##
)\ )\ #
( ',/ / #
) ( #
( \(\ \ #
`.) / ) #
'.( #
##
)\ )\ #
( \, / #
) \ ( #
( ( \ \ #
`.)/ ) #
'.( #
##
.-./( #
,' ) #
( .-, ( #
) '._\ ) #
( , ( #
)/ ._.' #
##
/`-. #
,' _ \ #
( '-' ( #
) ,._.' #
( ' #
)/ #
##
,.-. #
/ `, #
) ,-. ) #
( /_.` ( #
) , ) #
'._. \( #
##
/`-. #
,' _ \ #
( '-' ( #
) ,_ .' #
( ' ) \ #
)/ )/ #
##
)\.--. #
( ._.' #
`-.`. #
,_ ( \ #
( '.) ) #
'._,_.' #
##
.-,.-.,-. #
) ,, ,. ( #
\( |( )/ #
) \ #
\ ( #
)/ #
##
.-. #
,' / ) #
( ) | ( #
) '._\ ) #
( , ( #
)/ ._.' #
##
.-. #
,' / ) #
( ) | ( #
) './ / #
( , ( #
)/..' #
##
.'( #
,') \ ) #
( /(/ / #
) ( #
( .'\ \ #
)/ )/ #
##
.'( #
,') \ ) #
( '/ / #
) ) #
( .'\ \ #
)/ )/ #
##
)\ /( #
\ (_.' / #
) _.' #
/ / #
( \ #
).' #
##
.```./( #
)_,-, ) #
/ / _ #
/ `-` ) #
( ( #
).',,' #
##
)'. #
( _/ #
/( #
< > #
\(_ #
( \ #
).' ##
/( #
( / #
\\ #
)) #
\\ #
)\ #
\( ##
.'( #
\_ ) #
)\ #
< > #
_)/ #
/ ) #
'.( ##
)\ #
/_ \ #
/ )\ \ #
\( )/ #
#
#
##
#
)\ #
,,-.)\/ ( #
( _ )#
)/ `-._.' #
#
##
`#
#
#
#
#
#
##
/`-. #
,' _ \ #
( '-' ( #
) _ ) #
( ,' ) \ #
)/ )/ #
##
/(,-. #
,' _ ) #
( '-' ( #
) _ ) #
( '-' / #
)/._.' #
##
)\.-. #
,' ,-,_) #
( . _ #
) '..' ) #
( , ( #
)/'._.' #
##
)\.-. #
,' ) #
( .-, ( #
) '._\ ) #
( , ( #
)/ ._.' #
##
)\.---. #
( ,-._( #
\ '-, #
) ,-` #
( ``-. #
)..-.( #
##
)`-.--. #
) ,-._( #
\ `-._ #
) ,_( #
( \ #
).' #
##
)\.-. #
,' ,-,_) #
( . __ #
) '._\ _) #
( , ( #
)/'._.' #
##
.'( #
,') \ ) #
( '-' ( #
) .-. ) #
( , ) \ #
)/ )/ #
##
.'( #
\ ) #
) ( #
\ ) #
) \ #
)/ #
##
.-,.-.,-.#
).-, ,-.(#
)) #
.-._(( #
( ) #
'._.\( #
##
.'( #
,')\ ) #
( '/ / #
) ( #
( .\ \ #
)/ )/ #
##
.') #
( / #
)) #
)'._.-. #
( ) #
)/,__.' #
##
)\ )\ #
( ',/ / #
) ( #
( \(\ \ #
`.) / ) #
'.( #
##
)\ )\ #
( \, / #
) \ ( #
( ( \ \ #
`.)/ ) #
'.( #
##
.-./( #
,' ) #
( .-, ( #
) '._\ ) #
( , ( #
)/ ._.' #
##
/`-. #
,' _ \ #
( '-' ( #
) ,._.' #
( ' #
)/ #
##
,.-. #
/ `, #
) ,-. ) #
( /_.` ( #
) , ) #
'._. \( #
##
/`-. #
,' _ \ #
( '-' ( #
) ,_ .' #
( ' ) \ #
)/ )/ #
##
)\.--. #
( ._.' #
`-.`. #
,_ ( \ #
( '.) ) #
'._,_.' #
##
.-,.-.,-. #
) ,, ,. ( #
\( |( )/ #
) \ #
\ ( #
)/ #
##
.-. #
,' / ) #
( ) | ( #
) '._\ ) #
( , ( #
)/ ._.' #
##
.-. #
,' / ) #
( ) | ( #
) './ / #
( , ( #
)/..' #
##
.'( #
,') \ ) #
( /(/ / #
) ( #
( .'\ \ #
)/ )/ #
##
.'( #
,') \ ) #
( '/ / #
) ) #
( .'\ \ #
)/ )/ #
##
)\ /( #
\ (_.' / #
) _.' #
/ / #
( \ #
).' #
##
.```./( #
)_,-, ) #
/ / _ #
/ `-` ) #
( ( #
).',,' #
##
)\ #
( / #
/( #
< > #
\( #
( \ #
)/ ##
|#
#
#
#
#
#
##
/( #
\ ) #
)\ #
< > #
)/ #
/ ) #
\( ##
~#
#
#
#
#
#
##
/`-. #
,' _ \ #
( '-' ( #
) _ ) #
( ,' ) \ #
)/ )/ #
##
.-./( #
,' ) #
( .-, ( #
) '._\ ) #
( , ( #
)/ ._.' #
##
.-. #
,' / ) #
( ) | ( #
) '._\ ) #
( , ( #
)/ ._.' #
##
/`-. #
,' _ \ #
( '-' ( #
) _ ) #
( ,' ) \ #
)/ )/ #
##
.-./( #
,' ) #
( .-, ( #
) '._\ ) #
( , ( #
)/ ._.' #
##
.-. #
,' / ) #
( ) | ( #
) '._\ ) #
( , ( #
)/ ._.' #
##
ß#
#
#
#
#
#
##
@@ -0,0 +1,43 @@
"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/utilities/scrollbar-hide.ts
var scrollbar_hide_exports = {};
__export(scrollbar_hide_exports, {
default: () => scrollbar_hide_default
});
module.exports = __toCommonJS(scrollbar_hide_exports);
var scrollbar_hide_default = {
".scrollbar-hide": {
"-ms-overflow-style": "none",
"scrollbar-width": "none",
"&::-webkit-scrollbar": {
display: "none"
}
},
".scrollbar-default": {
"-ms-overflow-style": "auto",
"scrollbar-width": "auto",
"&::-webkit-scrollbar": {
display: "block"
}
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {});
@@ -0,0 +1,9 @@
{
'targets': [
{
'target_name': 'nothing',
'type': 'static_library',
'sources': [ 'nothing.c' ]
}
]
}
@@ -0,0 +1,9 @@
/**
* Extractor function for a ThisExpression type value node.
* A this expression is using `this` as an identifier.
*
* @returns - 'this' as a string.
*/
export default function extractValueFromThisExpression() {
return 'this';
}
@@ -0,0 +1,18 @@
{
"name": "streamifier",
"version": "0.1.1",
"description": "Converts a Buffer/String into a readable stream",
"keywords": [
"string",
"buffer",
"readable",
"stream"
],
"author": "Gabriel Llamas <gagle@outlook.com>",
"repository": "git://github.com/gagle/node-streamifier.git",
"engines": {
"node": ">=0.10"
},
"license": "MIT",
"main": "lib"
}
@@ -0,0 +1,8 @@
import isBrowser from '../../../utils/isBrowser';
var isOnline = function () {
if (isBrowser && typeof navigator.onLine !== 'undefined') {
return navigator.onLine;
}
return true;
};
export default isOnline;
@@ -0,0 +1,6 @@
function isLeapYear(year) {
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
}
export {
isLeapYear as i
};
@@ -0,0 +1,3 @@
import CryptoJS = require("./index");
export = CryptoJS.pad.Pkcs7;
@@ -0,0 +1,484 @@
/**
* Performance benchmarking script for RTKQ tag invalidation
*
* Run with:
* tsx packages/toolkit/src/query/tests/performance-invalidation.ts
*
* Or with Node.js built-in type stripping (Node 22.6+):
* node --experimental-strip-types packages/toolkit/src/query/tests/performance-invalidation.ts
*
* For CPU profiling with pprof:
* node --prof tsx packages/toolkit/src/query/tests/performance-invalidation.ts
* node --prof-process isolate-*.log > profile.txt
*/
import { createApi, fakeBaseQuery } from '@reduxjs/toolkit/query'
import { configureStore } from '@reduxjs/toolkit'
process.env.NODE_ENV = 'production' // Ensure production mode for performance testing
// Test Configuration
const NUM_ENDPOINTS = 10
const NUM_TAGS = 5
const NUM_CACHE_ENTRIES = 300
const TAG_TO_INVALIDATE = 'Tag2' // Will affect ~60 entries (20% of cache)
// Tag types for the test
const tagTypes = Array.from({ length: NUM_TAGS }, (_, i) => `Tag${i}`) as [
string,
...string[],
]
// Helper to create a store with the API
function setupStore(api: any) {
const store = configureStore({
reducer: {
[api.reducerPath]: api.reducer,
},
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware({
serializableCheck: false,
immutableCheck: false,
}).concat(api.middleware),
})
return store
}
// Helper for assertions
function assert(condition: boolean, message: string) {
if (!condition) {
throw new Error(`Assertion failed: ${message}`)
}
}
// Helper to create subscriptions for cache entries
// This ensures entries aren't removed during invalidation
function createSubscriptions(
store: any,
api: any,
entries: Array<{ endpointName: string; arg: any }>,
) {
for (const { endpointName, arg } of entries) {
// Call initiate with forceRefetch: false to just add subscription without refetching
store.dispatch(
(api.endpoints as any)[endpointName].initiate(arg, {
subscribe: true,
forceRefetch: false,
}),
)
}
}
async function test1_fullInvalidationFlow() {
console.log('\n=== Test 1: Full Invalidation Flow ===')
// 1. Create API with multiple endpoints
const api = createApi({
reducerPath: 'api',
baseQuery: fakeBaseQuery(),
tagTypes,
endpoints: (build) => {
const endpoints: any = {}
// Create 10 endpoints, each providing different tag combinations
for (let i = 0; i < NUM_ENDPOINTS; i++) {
endpoints[`endpoint${i}`] = build.query({
queryFn: (id: number) => ({ data: { id, endpoint: i } }),
providesTags: (result: any, error: any, id: number) => {
// Each endpoint provides 2-3 tags based on ID
const tags: any[] = [
`Tag${id % NUM_TAGS}`,
{ type: `Tag${(id + 1) % NUM_TAGS}`, id },
]
if (id % 3 === 0) {
tags.push({ type: `Tag${(id + 2) % NUM_TAGS}`, id: 'LIST' })
}
return tags
},
})
}
// Add mutation that invalidates a specific tag
endpoints.invalidateTag = build.mutation({
queryFn: (tag: string) => ({ data: { tag } }),
invalidatesTags: (result: any, error: any, tag: string) => [tag],
})
return endpoints
},
})
const store = setupStore(api)
// 2. Populate cache with 300 entries using upsertQueryEntries
const startSetup = performance.now()
const entries = []
for (let endpointIdx = 0; endpointIdx < NUM_ENDPOINTS; endpointIdx++) {
for (let id = 0; id < NUM_CACHE_ENTRIES / NUM_ENDPOINTS; id++) {
entries.push({
endpointName: `endpoint${endpointIdx}`,
arg: id + endpointIdx * 100,
value: {
id: id + endpointIdx * 100,
endpoint: endpointIdx,
data: `Sample data ${id}`,
},
})
}
}
// Batch upsert all entries at once
store.dispatch(api.util.upsertQueryEntries(entries as any))
// Create subscriptions for all entries to prevent removal during invalidation
createSubscriptions(store, api, entries)
const setupTime = performance.now() - startSetup
console.log(
`Setup time (${NUM_CACHE_ENTRIES} entries + subscriptions): ${setupTime.toFixed(2)}ms`,
)
// 3. Verify cache is populated
const state = store.getState()
const cacheSize = Object.keys(state.api.queries).length
assert(
cacheSize === NUM_CACHE_ENTRIES,
`Expected ${NUM_CACHE_ENTRIES} cache entries, got ${cacheSize}`,
)
console.log(`✓ Cache populated with ${cacheSize} entries`)
// 4. Count how many entries will be affected by invalidation
const affectedEntries = api.util.selectInvalidatedBy(state, [
TAG_TO_INVALIDATE,
])
console.log(
`Entries affected by invalidating ${TAG_TO_INVALIDATE}: ${affectedEntries.length}`,
)
// 5. Measure invalidation performance
const startInvalidation = performance.now()
await store.dispatch(
(api.endpoints as any).invalidateTag.initiate(TAG_TO_INVALIDATE),
)
const invalidationTime = performance.now() - startInvalidation
console.log(`Invalidation time: ${invalidationTime.toFixed(2)}ms`)
// 6. Performance checks
assert(
setupTime < 200,
`Setup time ${setupTime.toFixed(2)}ms exceeded 200ms threshold`,
)
assert(
invalidationTime < 100,
`Invalidation time ${invalidationTime.toFixed(2)}ms exceeded 100ms threshold`,
)
console.log('✓ Performance within acceptable thresholds')
// 7. Verify invalidation worked
const newState = store.getState()
const invalidatedCount = affectedEntries.filter(({ queryCacheKey }) => {
const entry = newState.api.queries[queryCacheKey]
return entry?.status === 'pending' // Should be refetching
}).length
console.log(`Entries refetching after invalidation: ${invalidatedCount}`)
console.log('✓ Test 1 completed successfully\n')
}
async function test2_selectorPerformance() {
console.log('\n=== Test 2: Selector Performance ===')
// Similar setup but focuses on selector performance
const api = createApi({
reducerPath: 'api',
baseQuery: fakeBaseQuery(),
tagTypes,
endpoints: (build) => ({
// Simplified endpoint for this test
getData: build.query({
queryFn: (id: number) => ({ data: { id } }),
providesTags: (result: any, error: any, id: number) => [
`Tag${id % NUM_TAGS}`,
{ type: `Tag${(id + 1) % NUM_TAGS}` as any, id },
{ type: `Tag${(id + 2) % NUM_TAGS}` as any, id: 'LIST' },
],
}),
}),
})
const store = setupStore(api)
// Populate cache
const entries = Array.from({ length: NUM_CACHE_ENTRIES }, (_, i) => ({
endpointName: 'getData',
arg: i,
value: { id: i, data: `Data ${i}` },
}))
store.dispatch(api.util.upsertQueryEntries(entries as any))
// Create subscriptions to prevent removal during invalidation
createSubscriptions(store, api, entries)
const state = store.getState()
// Test different invalidation patterns
const patterns = [
{ name: 'Single type tag', tags: ['Tag0'] },
{ name: 'Multiple type tags', tags: ['Tag0', 'Tag1', 'Tag2'] },
{ name: 'Specific ID tag', tags: [{ type: 'Tag0', id: 5 }] },
{ name: 'LIST tag', tags: [{ type: 'Tag0', id: 'LIST' }] },
{
name: 'Mixed tags',
tags: ['Tag0', { type: 'Tag1', id: 10 }, { type: 'Tag2', id: 'LIST' }],
},
]
patterns.forEach(({ name, tags }) => {
const start = performance.now()
const affected = api.util.selectInvalidatedBy(state, tags as any)
const duration = performance.now() - start
console.log(
`${name}: ${affected.length} entries in ${duration.toFixed(3)}ms`,
)
assert(
duration < 20,
`${name} took ${duration.toFixed(3)}ms, exceeded 20ms threshold`,
)
})
console.log('✓ All selector patterns within acceptable thresholds')
console.log('✓ Test 2 completed successfully\n')
}
async function test3_hasPendingRequestsPerformance() {
console.log('\n=== Test 3: hasPendingRequests Performance ===')
// This test specifically targets the hasPendingRequests optimization opportunity
const api = createApi({
reducerPath: 'api',
baseQuery: fakeBaseQuery(),
tagTypes,
endpoints: (build) => ({
getData: build.query({
queryFn: (id: number) => ({ data: { id } }),
providesTags: ['Tag0'],
}),
invalidateAll: build.mutation({
queryFn: () => ({ data: {} }),
invalidatesTags: ['Tag0'],
}),
}),
})
const store = setupStore(api)
// Populate with many entries
const entries = Array.from({ length: NUM_CACHE_ENTRIES }, (_, i) => ({
endpointName: 'getData',
arg: i,
value: { id: i },
}))
store.dispatch(api.util.upsertQueryEntries(entries as any))
// Create subscriptions to prevent removal during invalidation
createSubscriptions(store, api, entries)
// Trigger invalidation which will cause hasPendingRequests to be called repeatedly
const start = performance.now()
await store.dispatch(api.endpoints.invalidateAll.initiate(undefined) as any)
const duration = performance.now() - start
console.log(
`Invalidation triggering hasPendingRequests: ${duration.toFixed(2)}ms`,
)
// This should highlight the O(n) iteration issue if it exists
assert(
duration < 200,
`hasPendingRequests test took ${duration.toFixed(2)}ms, exceeded 200ms threshold`,
)
console.log('✓ Test 3 completed successfully\n')
}
async function test4_tagCalculationPerformance() {
console.log('\n=== Test 4: Tag Calculation Performance ===')
// This test measures the performance of calculateProvidedBy
const api = createApi({
reducerPath: 'api',
baseQuery: fakeBaseQuery(),
tagTypes,
endpoints: (build) => ({
getComplexData: build.query({
queryFn: (id: number) => ({ data: { id } }),
providesTags: (result: any, error: any, id: number) => {
// Complex tag calculation that returns many tags
const tags: any[] = []
for (let i = 0; i < NUM_TAGS; i++) {
tags.push(`Tag${i}`)
tags.push({ type: `Tag${i}`, id })
if (id % 2 === 0) {
tags.push({ type: `Tag${i}`, id: 'LIST' })
}
}
return tags
},
}),
}),
})
const store = setupStore(api)
// Measure time to populate cache with complex tag calculations
const entries = Array.from({ length: 100 }, (_, i) => ({
endpointName: 'getComplexData',
arg: i,
value: { id: i, data: `Complex data ${i}` },
}))
const start = performance.now()
store.dispatch(api.util.upsertQueryEntries(entries as any))
// Create subscriptions to prevent removal during invalidation
createSubscriptions(store, api, entries)
const duration = performance.now() - start
console.log(
`Tag calculation for 100 entries with ${NUM_TAGS * 3} tags each: ${duration.toFixed(2)}ms`,
)
// Verify tags were calculated correctly
const state = store.getState()
const providedTags = state.api.provided
// Count total tag subscriptions
let totalSubscriptions = 0
Object.values(providedTags.tags).forEach((tagIds: any) => {
Object.values(tagIds).forEach((cacheKeys: any) => {
totalSubscriptions += cacheKeys.length
})
})
console.log(`Total tag subscriptions created: ${totalSubscriptions}`)
assert(totalSubscriptions > 0, 'Expected tag subscriptions to be created')
assert(
duration < 100,
`Tag calculation took ${duration.toFixed(2)}ms, exceeded 100ms threshold`,
)
console.log('✓ Test 4 completed successfully\n')
}
async function test5_repeatedInvalidations() {
console.log('\n=== Test 5: Repeated Invalidations Performance ===')
// This test simulates a scenario where multiple mutations invalidate tags rapidly
const api = createApi({
reducerPath: 'api',
baseQuery: fakeBaseQuery(),
tagTypes,
endpoints: (build) => ({
getData: build.query({
queryFn: (id: number) => ({ data: { id } }),
providesTags: (result: any, error: any, id: number) => [
`Tag${id % NUM_TAGS}`,
],
}),
updateData: build.mutation({
queryFn: (id: number) => ({ data: { id } }),
invalidatesTags: (result: any, error: any, id: number) => [
`Tag${id % NUM_TAGS}`,
],
}),
}),
})
const store = setupStore(api)
// Populate cache
const entries = Array.from({ length: 200 }, (_, i) => ({
endpointName: 'getData',
arg: i,
value: { id: i },
}))
store.dispatch(api.util.upsertQueryEntries(entries as any))
// Create subscriptions to prevent removal during invalidation
createSubscriptions(store, api, entries)
// Perform multiple rapid invalidations
const numInvalidations = 10
const start = performance.now()
const promises = []
for (let i = 0; i < numInvalidations; i++) {
promises.push(
store.dispatch(api.endpoints.updateData.initiate(i % NUM_TAGS) as any),
)
}
await Promise.all(promises)
const duration = performance.now() - start
const avgPerInvalidation = duration / numInvalidations
console.log(
`${numInvalidations} rapid invalidations: ${duration.toFixed(2)}ms total, ${avgPerInvalidation.toFixed(2)}ms avg`,
)
assert(
avgPerInvalidation < 50,
`Average invalidation time ${avgPerInvalidation.toFixed(2)}ms exceeded 50ms threshold`,
)
console.log('✓ Test 5 completed successfully\n')
}
// Main execution
async function runAllTests() {
console.log('='.repeat(60))
console.log('RTKQ Tag Invalidation Performance Benchmarks')
console.log('='.repeat(60))
for (const test of [
test1_fullInvalidationFlow,
test2_selectorPerformance,
test3_hasPendingRequestsPerformance,
test4_tagCalculationPerformance,
test5_repeatedInvalidations,
]) {
console.log(`\nStarting ${test.name}...`)
try {
await test()
} catch (error) {
console.error(`\n❌ ${test.name} failed:`, error)
}
}
// try {
// await test1_fullInvalidationFlow()
// await test2_selectorPerformance()
// await test3_hasPendingRequestsPerformance()
// await test4_tagCalculationPerformance()
// await test5_repeatedInvalidations()
// console.log('='.repeat(60))
// console.log('✓ All tests completed successfully!')
// console.log('='.repeat(60))
// } catch (error) {
// console.error('\n❌ Test failed:', error)
// process.exit(1)
// }
process.exit(0)
}
// Run the tests
runAllTests()
@@ -0,0 +1,92 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $SyntaxError = require('es-errors/syntax');
var $TypeError = require('es-errors/type');
var isInteger = require('math-intrinsics/isInteger');
var $Uint8Array = GetIntrinsic('%Uint8Array%', true);
var IsBigIntElementType = require('./IsBigIntElementType');
var IsDetachedBuffer = require('./IsDetachedBuffer');
var NumericToRawBytes = require('./NumericToRawBytes');
var isArrayBuffer = require('is-array-buffer');
var isSharedArrayBuffer = require('is-shared-array-buffer');
var hasOwn = require('hasown');
var tableTAO = require('./tables/typed-array-objects');
var defaultEndianness = require('../helpers/defaultEndianness');
var forEach = require('../helpers/forEach');
// https://262.ecma-international.org/12.0/#sec-setvalueinbuffer
/* eslint max-params: 0 */
module.exports = function SetValueInBuffer(arrayBuffer, byteIndex, type, value, isTypedArray, order) {
var isSAB = isSharedArrayBuffer(arrayBuffer);
if (!isArrayBuffer(arrayBuffer) && !isSAB) {
throw new $TypeError('Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer');
}
if (!isInteger(byteIndex) || byteIndex < 0) {
throw new $TypeError('Assertion failed: `byteIndex` must be a non-negative integer');
}
if (typeof type !== 'string' || !hasOwn(tableTAO.size, '$' + type)) {
throw new $TypeError('Assertion failed: `type` must be one of ' + tableTAO.choices);
}
if (typeof value !== 'number' && typeof value !== 'bigint') {
throw new $TypeError('Assertion failed: `value` must be a Number or a BigInt');
}
if (typeof isTypedArray !== 'boolean') {
throw new $TypeError('Assertion failed: `isTypedArray` must be a boolean');
}
if (order !== 'SeqCst' && order !== 'Unordered' && order !== 'Init') {
throw new $TypeError('Assertion failed: `order` must be `"SeqCst"`, `"Unordered"`, or `"Init"`');
}
if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
throw new $TypeError('Assertion failed: `isLittleEndian` must be a boolean, if present');
}
if (IsDetachedBuffer(arrayBuffer)) {
throw new $TypeError('Assertion failed: ArrayBuffer is detached'); // step 1
}
// 2. Assert: There are sufficient bytes in arrayBuffer starting at byteIndex to represent a value of type.
if (IsBigIntElementType(type) ? typeof value !== 'bigint' : typeof value !== 'number') { // step 3
throw new $TypeError('Assertion failed: `value` must be a BigInt if type is BigInt64 or BigUint64, otherwise a Number');
}
// 4. Let block be arrayBuffer’s [[ArrayBufferData]] internal slot.
var elementSize = tableTAO.size['$' + type]; // step 5
// 6. If isLittleEndian is not present, set isLittleEndian to either true or false. The choice is implementation dependent and should be the alternative that is most efficient for the implementation. An implementation must use the same value each time this step is executed and the same value must be used for the corresponding step in the GetValueFromBuffer abstract operation.
var isLittleEndian = arguments.length > 6 ? arguments[6] : defaultEndianness === 'little'; // step 6
var rawBytes = NumericToRawBytes(type, value, isLittleEndian); // step 7
if (isSAB) { // step 8
/*
Let execution be the [[CandidateExecution]] field of the surrounding agent's Agent Record.
Let eventList be the [[EventList]] field of the element in execution.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
If isTypedArray is true and IsNoTearConfiguration(type, order) is true, let noTear be true; otherwise let noTear be false.
Append WriteSharedMemory { [[Order]]: order, [[NoTear]]: noTear, [[Block]]: block, [[ByteIndex]]: byteIndex, [[ElementSize]]: elementSize, [[Payload]]: rawBytes } to eventList.
*/
throw new $SyntaxError('SharedArrayBuffer is not supported by this implementation');
} else {
// 9. Store the individual bytes of rawBytes into block, in order, starting at block[byteIndex].
var arr = new $Uint8Array(arrayBuffer, byteIndex, elementSize);
forEach(rawBytes, function (rawByte, i) {
arr[i] = rawByte;
});
}
// 10. Return NormalCompletion(undefined).
};
@@ -0,0 +1,97 @@
export {};
interface AddEventListenerOptions extends EventListenerOptions {
once?: boolean;
passive?: boolean;
signal?: AbortSignal;
}
type _CustomEvent<T = any> = typeof globalThis extends { onmessage: any } ? {} : CustomEvent<T>;
interface CustomEvent<T = any> extends Event {
readonly detail: T;
}
interface CustomEventInit<T = any> extends EventInit {
detail?: T;
}
type _Event = typeof globalThis extends { onmessage: any } ? {} : Event;
interface Event {
readonly bubbles: boolean;
cancelBubble: boolean;
readonly cancelable: boolean;
readonly composed: boolean;
readonly currentTarget: EventTarget | null;
readonly defaultPrevented: boolean;
readonly eventPhase: 0 | 2;
readonly isTrusted: boolean;
returnValue: boolean;
readonly srcElement: EventTarget | null;
readonly target: EventTarget | null;
readonly timeStamp: number;
readonly type: string;
composedPath(): [EventTarget?];
initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
preventDefault(): void;
stopImmediatePropagation(): void;
stopPropagation(): void;
}
interface EventInit {
bubbles?: boolean;
cancelable?: boolean;
composed?: boolean;
}
interface EventListener {
(evt: Event): void;
}
interface EventListenerObject {
handleEvent(object: Event): void;
}
type _EventListenerOptions = typeof globalThis extends { onmessage: any } ? {} : EventListenerOptions;
interface EventListenerOptions {
capture?: boolean;
}
type _EventTarget = typeof globalThis extends { onmessage: any } ? {} : EventTarget;
interface EventTarget {
addEventListener(
type: string,
listener: EventListener | EventListenerObject,
options?: AddEventListenerOptions | boolean,
): void;
dispatchEvent(event: Event): boolean;
removeEventListener(
type: string,
listener: EventListener | EventListenerObject,
options?: EventListenerOptions | boolean,
): void;
}
declare global {
interface CustomEvent<T = any> extends _CustomEvent<T> {}
var CustomEvent: typeof globalThis extends { onmessage: any; CustomEvent: infer T } ? T
: {
prototype: CustomEvent;
new<T>(type: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
};
interface Event extends _Event {}
var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T
: {
prototype: Event;
new(type: string, eventInitDict?: EventInit): Event;
};
interface EventListenerOptions extends _EventListenerOptions {}
interface EventTarget extends _EventTarget {}
var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T
: {
prototype: EventTarget;
new(): EventTarget;
};
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L M G N O P"},C:{"2":"0 1 2 3 4 5 6 7 8 9 xC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB 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 0C 1C"},D:{"1":"0 1 2 3 4 5 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB","66":"tB uB vB","129":"wB xB yB zB 0B 1B"},E:{"2":"J ZB K D E F A B C L M G 2C ZC 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED"},F:{"1":"0 1 2 3 4 5 qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"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 FD GD HD ID NC uC JD OC"},G:{"1":"bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","2":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD"},H:{"2":"hD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"2":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB qD rD sD aC tD uD vD wD xD QC RC SC yD","2":"J oD pD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"2":"1D 2D"}},B:5,C:"Credential Management API",D:true};
@@ -0,0 +1,92 @@
import { statsBuffer } from '../stats/buffer.mjs';
function createRenderStep(runNextFrame, stepName) {
/**
* We create and reuse two queues, one to queue jobs for the current frame
* and one for the next. We reuse to avoid triggering GC after x frames.
*/
let thisFrame = new Set();
let nextFrame = new Set();
/**
* Track whether we're currently processing jobs in this step. This way
* we can decide whether to schedule new jobs for this frame or next.
*/
let isProcessing = false;
let flushNextFrame = false;
/**
* A set of processes which were marked keepAlive when scheduled.
*/
const toKeepAlive = new WeakSet();
let latestFrameData = {
delta: 0.0,
timestamp: 0.0,
isProcessing: false,
};
let numCalls = 0;
function triggerCallback(callback) {
if (toKeepAlive.has(callback)) {
step.schedule(callback);
runNextFrame();
}
numCalls++;
callback(latestFrameData);
}
const step = {
/**
* Schedule a process to run on the next frame.
*/
schedule: (callback, keepAlive = false, immediate = false) => {
const addToCurrentFrame = immediate && isProcessing;
const queue = addToCurrentFrame ? thisFrame : nextFrame;
if (keepAlive)
toKeepAlive.add(callback);
if (!queue.has(callback))
queue.add(callback);
return callback;
},
/**
* Cancel the provided callback from running on the next frame.
*/
cancel: (callback) => {
nextFrame.delete(callback);
toKeepAlive.delete(callback);
},
/**
* Execute all schedule callbacks.
*/
process: (frameData) => {
latestFrameData = frameData;
/**
* If we're already processing we've probably been triggered by a flushSync
* inside an existing process. Instead of executing, mark flushNextFrame
* as true and ensure we flush the following frame at the end of this one.
*/
if (isProcessing) {
flushNextFrame = true;
return;
}
isProcessing = true;
[thisFrame, nextFrame] = [nextFrame, thisFrame];
// Execute this frame
thisFrame.forEach(triggerCallback);
/**
* If we're recording stats then
*/
if (stepName && statsBuffer.value) {
statsBuffer.value.frameloop[stepName].push(numCalls);
}
numCalls = 0;
// Clear the frame so no callbacks remain. This is to avoid
// memory leaks should this render step not run for a while.
thisFrame.clear();
isProcessing = false;
if (flushNextFrame) {
flushNextFrame = false;
step.process(frameData);
}
},
};
return step;
}
export { createRenderStep };
@@ -0,0 +1,11 @@
"use strict";
var _to_primitive = require("./_to_primitive.cjs");
var _type_of = require("./_type_of.cjs");
function _to_property_key(arg) {
var key = _to_primitive._(arg, "string");
return _type_of._(key) === "symbol" ? key : String(key);
}
exports._ = _to_property_key;
@@ -0,0 +1,190 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
function getBelarusianPlural(count, one, few, many) {
const absCount = Math.abs(count);
const lastDigit = absCount % 10;
const lastTwoDigits = absCount % 100;
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
return many;
}
if (lastDigit === 1) {
return one;
}
if (lastDigit >= 2 && lastDigit <= 4) {
return few;
}
return many;
}
const error = () => {
const Sizable = {
string: {
unit: {
one: "сімвал",
few: "сімвалы",
many: "сімвалаў",
},
verb: "мець",
},
array: {
unit: {
one: "элемент",
few: "элементы",
many: "элементаў",
},
verb: "мець",
},
set: {
unit: {
one: "элемент",
few: "элементы",
many: "элементаў",
},
verb: "мець",
},
file: {
unit: {
one: "байт",
few: "байты",
many: "байтаў",
},
verb: "мець",
},
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "лік";
}
case "object": {
if (Array.isArray(data)) {
return "масіў";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "увод",
email: "email адрас",
url: "URL",
emoji: "эмодзі",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO дата і час",
date: "ISO дата",
time: "ISO час",
duration: "ISO працягласць",
ipv4: "IPv4 адрас",
ipv6: "IPv6 адрас",
cidrv4: "IPv4 дыяпазон",
cidrv6: "IPv6 дыяпазон",
base64: "радок у фармаце base64",
base64url: "радок у фармаце base64url",
json_string: "JSON радок",
e164: "нумар E.164",
jwt: "JWT",
template_literal: "увод",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Няправільны ўвод: чакаўся ${issue.expected}, атрымана ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Няправільны ўвод: чакалася ${util.stringifyPrimitive(issue.values[0])}`;
return `Няправільны варыянт: чакаўся адзін з ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
const maxValue = Number(issue.maximum);
const unit = getBelarusianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
return `Занадта вялікі: чакалася, што ${issue.origin ?? "значэнне"} павінна ${sizing.verb} ${adj}${issue.maximum.toString()} ${unit}`;
}
return `Занадта вялікі: чакалася, што ${issue.origin ?? "значэнне"} павінна быць ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
const minValue = Number(issue.minimum);
const unit = getBelarusianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
return `Занадта малы: чакалася, што ${issue.origin} павінна ${sizing.verb} ${adj}${issue.minimum.toString()} ${unit}`;
}
return `Занадта малы: чакалася, што ${issue.origin} павінна быць ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Няправільны радок: павінен пачынацца з "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Няправільны радок: павінен заканчвацца на "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Няправільны радок: павінен змяшчаць "${_issue.includes}"`;
if (_issue.format === "regex")
return `Няправільны радок: павінен адпавядаць шаблону ${_issue.pattern}`;
return `Няправільны ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Няправільны лік: павінен быць кратным ${issue.divisor}`;
case "unrecognized_keys":
return `Нераспазнаны ${issue.keys.length > 1 ? "ключы" : "ключ"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Няправільны ключ у ${issue.origin}`;
case "invalid_union":
return "Няправільны ўвод";
case "invalid_element":
return `Няправільнае значэнне ў ${issue.origin}`;
default:
return `Няправільны ўвод`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
@@ -0,0 +1,28 @@
var parse = require('./parse')
var walk = require('./walk')
var stringify = require('./stringify')
function ValueParser(value) {
if (this instanceof ValueParser) {
this.nodes = parse(value)
return this
}
return new ValueParser(value)
}
ValueParser.prototype.toString = function () {
return Array.isArray(this.nodes) ? stringify(this.nodes) : ''
}
ValueParser.prototype.walk = function (cb, bubble) {
walk(this.nodes, cb, bubble)
return this
}
ValueParser.unit = require('./unit')
ValueParser.walk = walk
ValueParser.stringify = stringify
module.exports = ValueParser
@@ -0,0 +1,56 @@
declare const _default: {
extends: string[];
rules: {
'@typescript-eslint/await-thenable': "error";
'@typescript-eslint/ban-ts-comment': "error";
'no-array-constructor': "off";
'@typescript-eslint/no-array-constructor': "error";
'@typescript-eslint/no-array-delete': "error";
'@typescript-eslint/no-base-to-string': "error";
'@typescript-eslint/no-duplicate-enum-values': "error";
'@typescript-eslint/no-duplicate-type-constituents': "error";
'@typescript-eslint/no-empty-object-type': "error";
'@typescript-eslint/no-explicit-any': "error";
'@typescript-eslint/no-extra-non-null-assertion': "error";
'@typescript-eslint/no-floating-promises': "error";
'@typescript-eslint/no-for-in-array': "error";
'no-implied-eval': "off";
'@typescript-eslint/no-implied-eval': "error";
'@typescript-eslint/no-misused-new': "error";
'@typescript-eslint/no-misused-promises': "error";
'@typescript-eslint/no-namespace': "error";
'@typescript-eslint/no-non-null-asserted-optional-chain': "error";
'@typescript-eslint/no-redundant-type-constituents': "error";
'@typescript-eslint/no-require-imports': "error";
'@typescript-eslint/no-this-alias': "error";
'@typescript-eslint/no-unnecessary-type-assertion': "error";
'@typescript-eslint/no-unnecessary-type-constraint': "error";
'@typescript-eslint/no-unsafe-argument': "error";
'@typescript-eslint/no-unsafe-assignment': "error";
'@typescript-eslint/no-unsafe-call': "error";
'@typescript-eslint/no-unsafe-declaration-merging': "error";
'@typescript-eslint/no-unsafe-enum-comparison': "error";
'@typescript-eslint/no-unsafe-function-type': "error";
'@typescript-eslint/no-unsafe-member-access': "error";
'@typescript-eslint/no-unsafe-return': "error";
'@typescript-eslint/no-unsafe-unary-minus': "error";
'no-unused-expressions': "off";
'@typescript-eslint/no-unused-expressions': "error";
'no-unused-vars': "off";
'@typescript-eslint/no-unused-vars': "error";
'@typescript-eslint/no-wrapper-object-types': "error";
'no-throw-literal': "off";
'@typescript-eslint/only-throw-error': "error";
'@typescript-eslint/prefer-as-const': "error";
'@typescript-eslint/prefer-namespace-keyword': "error";
'prefer-promise-reject-errors': "off";
'@typescript-eslint/prefer-promise-reject-errors': "error";
'require-await': "off";
'@typescript-eslint/require-await': "error";
'@typescript-eslint/restrict-plus-operands': "error";
'@typescript-eslint/restrict-template-expressions': "error";
'@typescript-eslint/triple-slash-reference': "error";
'@typescript-eslint/unbound-method': "error";
};
};
export = _default;
@@ -0,0 +1,32 @@
{
'targets': [
{
'target_name': 'node_addon_api',
'type': 'none',
'sources': [ 'napi.h', 'napi-inl.h' ],
'direct_dependent_settings': {
'include_dirs': [ '.' ],
'includes': ['noexcept.gypi'],
}
},
{
'target_name': 'node_addon_api_except',
'type': 'none',
'sources': [ 'napi.h', 'napi-inl.h' ],
'direct_dependent_settings': {
'include_dirs': [ '.' ],
'includes': ['except.gypi'],
}
},
{
'target_name': 'node_addon_api_maybe',
'type': 'none',
'sources': [ 'napi.h', 'napi-inl.h' ],
'direct_dependent_settings': {
'include_dirs': [ '.' ],
'includes': ['noexcept.gypi'],
'defines': ['NODE_ADDON_API_ENABLE_MAYBE']
}
},
]
}
@@ -0,0 +1 @@
{"name":"minimist-options","version":"4.1.0","requiresBuild":false,"files":{"license":{"checkedAt":1794532119361,"integrity":"sha512-+vIW8/whDgBA4sx86ZEcfFrIjDZCclmwbbyZSc35VIG/f4Dbw4I4Dff5qcvn2y5kBfXwcA3UnPxsgThYanTUsg==","mode":420,"size":1115},"index.js":{"checkedAt":1794532119361,"integrity":"sha512-OTGqJ3dYFE5KLlRUHnA3vyCxaRhfkuH3ARq5zHOGnRUvnhBNac9awLec0kwx3TkvnyDGAzUISn5X3M+z9YITPw==","mode":420,"size":2780},"package.json":{"checkedAt":1794532119361,"integrity":"sha512-Sie3ajTz/D9mhbooTrYZ2eIxMN1uF/GWxGRIAKcy570Zh6CaOmfbcF9FYhmozkc3YGsk5RKDsjRholk2UqrH5g==","mode":420,"size":661},"readme.md":{"checkedAt":1794532119362,"integrity":"sha512-05IARb05dTggK5CS3ekQFsTjCDQmjrWXRsbBdw1+EPWpoOCcPL4yl7GxHwyeRoqjyNvy6kUb4DcsTZPckXT8OQ==","mode":420,"size":2278},"index.d.ts":{"checkedAt":1794532119362,"integrity":"sha512-Na5pskVU2/RXXEu4rVpQnOjFKXWHRzhHa1Nb2jHbcu4t3H6JA/8LEshFqHdeNpARzMPs0AmIz0PhpzGEZlOl1g==","mode":420,"size":1696}}}
@@ -0,0 +1,2 @@
export function association(node: import("mdast").Association): string;
//# sourceMappingURL=association.d.ts.map
@@ -0,0 +1,2 @@
import "./react-textarea-autosize.development.cjs.js";
export { _default as default } from "./react-textarea-autosize.development.cjs.default.js";
@@ -0,0 +1,18 @@
/**
* Decodes a base64 string to a byte array.
*
* - ignores white-space, including line breaks and tabs
* - allows inner padding (can decode concatenated base64 strings)
* - does not require padding
* - understands base64url encoding:
* "-" instead of "+",
* "_" instead of "/",
* no padding
*/
export declare function base64decode(base64Str: string): Uint8Array;
/**
* Encodes a byte array to a base64 string.
* Adds padding at the end.
* Does not insert newlines.
*/
export declare function base64encode(bytes: Uint8Array): string;
@@ -0,0 +1 @@
export { _ as default } from "../esm/_class_apply_descriptor_set.js";
@@ -0,0 +1,73 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.merge = merge;
exports.normalizeReplacements = normalizeReplacements;
exports.validate = validate;
const _excluded = ["placeholderWhitelist", "placeholderPattern", "preserveComments", "syntacticPlaceholders"];
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
function merge(a, b) {
const {
placeholderWhitelist = a.placeholderWhitelist,
placeholderPattern = a.placeholderPattern,
preserveComments = a.preserveComments,
syntacticPlaceholders = a.syntacticPlaceholders
} = b;
return {
parser: Object.assign({}, a.parser, b.parser),
placeholderWhitelist,
placeholderPattern,
preserveComments,
syntacticPlaceholders
};
}
function validate(opts) {
if (opts != null && typeof opts !== "object") {
throw new Error("Unknown template options.");
}
const _ref = opts || {},
{
placeholderWhitelist,
placeholderPattern,
preserveComments,
syntacticPlaceholders
} = _ref,
parser = _objectWithoutPropertiesLoose(_ref, _excluded);
if (placeholderWhitelist != null && !(placeholderWhitelist instanceof Set)) {
throw new Error("'.placeholderWhitelist' must be a Set, null, or undefined");
}
if (placeholderPattern != null && !(placeholderPattern instanceof RegExp) && placeholderPattern !== false) {
throw new Error("'.placeholderPattern' must be a RegExp, false, null, or undefined");
}
if (preserveComments != null && typeof preserveComments !== "boolean") {
throw new Error("'.preserveComments' must be a boolean, null, or undefined");
}
if (syntacticPlaceholders != null && typeof syntacticPlaceholders !== "boolean") {
throw new Error("'.syntacticPlaceholders' must be a boolean, null, or undefined");
}
if (syntacticPlaceholders === true && (placeholderWhitelist != null || placeholderPattern != null)) {
throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" + " with '.syntacticPlaceholders: true'");
}
return {
parser,
placeholderWhitelist: placeholderWhitelist || undefined,
placeholderPattern: placeholderPattern == null ? undefined : placeholderPattern,
preserveComments: preserveComments == null ? undefined : preserveComments,
syntacticPlaceholders: syntacticPlaceholders == null ? undefined : syntacticPlaceholders
};
}
function normalizeReplacements(replacements) {
if (Array.isArray(replacements)) {
return replacements.reduce((acc, replacement, i) => {
acc["$" + i] = replacement;
return acc;
}, {});
} else if (typeof replacements === "object" || replacements == null) {
return replacements || undefined;
}
throw new Error("Template replacements must be an array, object, null, or undefined");
}
//# sourceMappingURL=options.js.map
@@ -0,0 +1,14 @@
import { CRLNumber } from "./crl_number";
/**
* ```asn1
* id-ce-deltaCRLIndicator OBJECT IDENTIFIER ::= { id-ce 27 }
* ```
*/
export declare const id_ce_deltaCRLIndicator = "2.5.29.27";
/**
* ```asn1
* BaseCRLNumber ::= CRLNumber
* ```
*/
export declare class BaseCRLNumber extends CRLNumber {
}
@@ -0,0 +1,9 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var index = require('./loader/index.js');
exports.default = index.default;
@@ -0,0 +1 @@
{"version":3,"file":"source-map-tree.d.ts","sourceRoot":"","sources":["../src/source-map-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgD,MAAM,yBAAyB,CAAC;AAGnG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,IAAI,CAAC;IACV,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,QAAQ,CAAC;IACd,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG,SAAS,CAAC;AA8CjD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,SAAS,CAEtE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,MAAM,EAAE,OAAO,GACd,cAAc,CAEhB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,UAAU,CAyCzD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,sBAAsB,GAAG,IAAI,CAmB/B"}
@@ -0,0 +1,13 @@
<svg viewbox="0 0 18 18">
<path class="ql-fill" d="M15.707,7l1.146-1.146a0.5,0.5,0,1,0-.707-0.707L15,6.293,13.854,5.146a0.5,0.5,0,0,0-.707.707L14.293,7,13.146,8.146a0.5,0.5,0,1,0,.707.707L15,7.707l1.146,1.146a0.5,0.5,0,1,0,.707-0.707Z"></path>
<path class="ql-fill" d="M6,5H3A1,1,0,0,0,2,6V8A1,1,0,0,0,3,9H6V5Z"></path>
<path class="ql-fill" d="M10,5H7V9h3a1,1,0,0,0,1-1V6A1,1,0,0,0,10,5Z"></path>
<g class="ql-fill ql-transparent">
<path d="M8,11h4V9a1,1,0,0,0-1-1H8v3Z"></path>
<path d="M7,11V8H4A1,1,0,0,0,3,9v2H7Z"></path>
<path d="M7,12H3v2a1,1,0,0,0,1,1H7V12Z"></path>
<path d="M8,12v3h3a1,1,0,0,0,1-1V12H8Z"></path>
<path d="M8,6h3a1,1,0,0,0,1-1V3a1,1,0,0,0-1-1H8V6Z"></path>
<path d="M4,6H7V2H4A1,1,0,0,0,3,3V5A1,1,0,0,0,4,6Z"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 788 B

@@ -0,0 +1,135 @@
'use strict';
const os = require('os');
const tty = require('tty');
const hasFlag = require('has-flag');
const {env} = process;
let forceColor;
if (hasFlag('no-color') ||
hasFlag('no-colors') ||
hasFlag('color=false') ||
hasFlag('color=never')) {
forceColor = 0;
} else if (hasFlag('color') ||
hasFlag('colors') ||
hasFlag('color=true') ||
hasFlag('color=always')) {
forceColor = 1;
}
if ('FORCE_COLOR' in env) {
if (env.FORCE_COLOR === 'true') {
forceColor = 1;
} else if (env.FORCE_COLOR === 'false') {
forceColor = 0;
} else {
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
}
}
function translateLevel(level) {
if (level === 0) {
return false;
}
return {
level,
hasBasic: true,
has256: level >= 2,
has16m: level >= 3
};
}
function supportsColor(haveStream, streamIsTTY) {
if (forceColor === 0) {
return 0;
}
if (hasFlag('color=16m') ||
hasFlag('color=full') ||
hasFlag('color=truecolor')) {
return 3;
}
if (hasFlag('color=256')) {
return 2;
}
if (haveStream && !streamIsTTY && forceColor === undefined) {
return 0;
}
const min = forceColor || 0;
if (env.TERM === 'dumb') {
return min;
}
if (process.platform === 'win32') {
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
const osRelease = os.release().split('.');
if (
Number(osRelease[0]) >= 10 &&
Number(osRelease[2]) >= 10586
) {
return Number(osRelease[2]) >= 14931 ? 3 : 2;
}
return 1;
}
if ('CI' in env) {
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
return 1;
}
return min;
}
if ('TEAMCITY_VERSION' in env) {
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
}
if (env.COLORTERM === 'truecolor') {
return 3;
}
if ('TERM_PROGRAM' in env) {
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
switch (env.TERM_PROGRAM) {
case 'iTerm.app':
return version >= 3 ? 3 : 2;
case 'Apple_Terminal':
return 2;
// No default
}
}
if (/-256(color)?$/i.test(env.TERM)) {
return 2;
}
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
return 1;
}
if ('COLORTERM' in env) {
return 1;
}
return min;
}
function getSupportLevel(stream) {
const level = supportsColor(stream, stream && stream.isTTY);
return translateLevel(level);
}
module.exports = {
supportsColor: getSupportLevel,
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
};
@@ -0,0 +1,27 @@
import type { JsonValue } from "./json-typings";
import type { JsonWriteOptions } from "./json-format-contract";
import type { EnumInfo, FieldInfo, PartialMessageInfo } from "./reflection-info";
import { ScalarType } from "./reflection-info";
import type { IMessageType } from "./message-type-contract";
/**
* Writes proto3 messages in canonical JSON format using reflection
* information.
*
* https://developers.google.com/protocol-buffers/docs/proto3#json
*/
export declare class ReflectionJsonWriter {
private readonly fields;
constructor(info: PartialMessageInfo);
/**
* Converts the message to a JSON object, based on the field descriptors.
*/
write<T extends object>(message: T, options: JsonWriteOptions): JsonValue;
field(field: FieldInfo, value: unknown, options: JsonWriteOptions): JsonValue | undefined;
/**
* Returns `null` as the default for google.protobuf.NullValue.
*/
enum(type: EnumInfo, value: unknown, fieldName: string, optional: boolean, emitDefaultValues: boolean, enumAsInteger: boolean): JsonValue | undefined;
message(type: IMessageType<any>, value: unknown, fieldName: string, options: JsonWriteOptions): JsonValue | undefined;
scalar(type: ScalarType, value: unknown, fieldName: string, optional: false, emitDefaultValues: boolean): JsonValue;
scalar(type: ScalarType, value: unknown, fieldName: string, optional: boolean, emitDefaultValues: boolean): JsonValue | undefined;
}
@@ -0,0 +1,2 @@
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
module.exports = require("./data/plugins.json");
@@ -0,0 +1,221 @@
/**
* @fileoverview Rule to flag consistent return values
* @author Nicholas C. Zakas
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
const { upperCaseFirst } = require("../shared/string-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Checks all segments in a set and returns true if all are unreachable.
* @param {Set<CodePathSegment>} segments The segments to check.
* @returns {boolean} True if all segments are unreachable; false otherwise.
*/
function areAllSegmentsUnreachable(segments) {
for (const segment of segments) {
if (segment.reachable) {
return false;
}
}
return true;
}
/**
* Checks whether a given node is a `constructor` method in an ES6 class
* @param {ASTNode} node A node to check
* @returns {boolean} `true` if the node is a `constructor` method
*/
function isClassConstructor(node) {
return (
node.type === "FunctionExpression" &&
node.parent &&
node.parent.type === "MethodDefinition" &&
node.parent.kind === "constructor"
);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"Require `return` statements to either always or never specify values",
recommended: false,
url: "https://eslint.org/docs/latest/rules/consistent-return",
},
schema: [
{
type: "object",
properties: {
treatUndefinedAsUnspecified: {
type: "boolean",
},
},
additionalProperties: false,
},
],
defaultOptions: [{ treatUndefinedAsUnspecified: false }],
messages: {
missingReturn: "Expected to return a value at the end of {{name}}.",
missingReturnValue: "{{name}} expected a return value.",
unexpectedReturnValue: "{{name}} expected no return value.",
},
},
create(context) {
const [{ treatUndefinedAsUnspecified }] = context.options;
let funcInfo = null;
/**
* Checks whether of not the implicit returning is consistent if the last
* code path segment is reachable.
* @param {ASTNode} node A program/function node to check.
* @returns {void}
*/
function checkLastSegment(node) {
let loc, name;
/*
* Skip if it expected no return value or unreachable.
* When unreachable, all paths are returned or thrown.
*/
if (
!funcInfo.hasReturnValue ||
areAllSegmentsUnreachable(funcInfo.currentSegments) ||
astUtils.isES5Constructor(node) ||
isClassConstructor(node)
) {
return;
}
// Adjust a location and a message.
if (node.type === "Program") {
// The head of program.
loc = { line: 1, column: 0 };
name = "program";
} else if (node.type === "ArrowFunctionExpression") {
// `=>` token
loc = context.sourceCode.getTokenBefore(
node.body,
astUtils.isArrowToken,
).loc;
} else if (
node.parent.type === "MethodDefinition" ||
(node.parent.type === "Property" && node.parent.method)
) {
// Method name.
loc = node.parent.key.loc;
} else {
// Function name or `function` keyword.
loc = (node.id || context.sourceCode.getFirstToken(node)).loc;
}
if (!name) {
name = astUtils.getFunctionNameWithKind(node);
}
// Reports.
context.report({
node,
loc,
messageId: "missingReturn",
data: { name },
});
}
return {
// Initializes/Disposes state of each code path.
onCodePathStart(codePath, node) {
funcInfo = {
upper: funcInfo,
codePath,
hasReturn: false,
hasReturnValue: false,
messageId: "",
node,
currentSegments: new Set(),
};
},
onCodePathEnd() {
funcInfo = funcInfo.upper;
},
onUnreachableCodePathSegmentStart(segment) {
funcInfo.currentSegments.add(segment);
},
onUnreachableCodePathSegmentEnd(segment) {
funcInfo.currentSegments.delete(segment);
},
onCodePathSegmentStart(segment) {
funcInfo.currentSegments.add(segment);
},
onCodePathSegmentEnd(segment) {
funcInfo.currentSegments.delete(segment);
},
// Reports a given return statement if it's inconsistent.
ReturnStatement(node) {
const argument = node.argument;
let hasReturnValue = Boolean(argument);
if (treatUndefinedAsUnspecified && hasReturnValue) {
hasReturnValue =
!astUtils.isSpecificId(argument, "undefined") &&
argument.operator !== "void";
}
if (!funcInfo.hasReturn) {
funcInfo.hasReturn = true;
funcInfo.hasReturnValue = hasReturnValue;
funcInfo.messageId = hasReturnValue
? "missingReturnValue"
: "unexpectedReturnValue";
funcInfo.data = {
name:
funcInfo.node.type === "Program"
? "Program"
: upperCaseFirst(
astUtils.getFunctionNameWithKind(
funcInfo.node,
),
),
};
} else if (funcInfo.hasReturnValue !== hasReturnValue) {
context.report({
node,
messageId: funcInfo.messageId,
data: funcInfo.data,
});
}
},
// Reports a given program/function if the implicit returning is not consistent.
"Program:exit": checkLastSegment,
"FunctionDeclaration:exit": checkLastSegment,
"FunctionExpression:exit": checkLastSegment,
"ArrowFunctionExpression:exit": checkLastSegment,
};
},
};
@@ -0,0 +1,4 @@
[flake8]
max-complexity = 101
max-line-length = 88
extend-ignore = E203 # whitespace before ':' to agree with psf/black
@@ -0,0 +1,48 @@
{
"name": "@tanstack/virtual-core",
"version": "3.11.3",
"description": "Headless UI for virtualizing scrollable elements in TS/JS + Frameworks",
"author": "Tanner Linsley",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/TanStack/virtual.git",
"directory": "packages/virtual-core"
},
"homepage": "https://tanstack.com/virtual",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"keywords": [
"react",
"vue",
"solid",
"virtual",
"virtual-core",
"datagrid"
],
"type": "module",
"types": "dist/esm/index.d.ts",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
}
},
"./package.json": "./package.json"
},
"sideEffects": false,
"files": [
"dist",
"src"
],
"scripts": {}
}
@@ -0,0 +1,99 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {DOMAttributes} from '@react-types/shared';
import {mergeProps} from '@react-aria/utils';
import React, {CSSProperties, JSX, JSXElementConstructor, ReactNode, useMemo, useState} from 'react';
import {useFocusWithin} from '@react-aria/interactions';
export interface VisuallyHiddenProps extends DOMAttributes {
/** The content to visually hide. */
children?: ReactNode,
/**
* The element type for the container.
* @default 'div'
*/
elementType?: string | JSXElementConstructor<any>,
/** Whether the element should become visible on focus, for example skip links. */
isFocusable?: boolean
}
const styles: CSSProperties = {
border: 0,
clip: 'rect(0 0 0 0)',
clipPath: 'inset(50%)',
height: '1px',
margin: '-1px',
overflow: 'hidden',
padding: 0,
position: 'absolute',
width: '1px',
whiteSpace: 'nowrap'
};
export interface VisuallyHiddenAria {
visuallyHiddenProps: DOMAttributes
}
/**
* Provides props for an element that hides its children visually
* but keeps content visible to assistive technology.
*/
export function useVisuallyHidden(props: VisuallyHiddenProps = {}): VisuallyHiddenAria {
let {
style,
isFocusable
} = props;
let [isFocused, setFocused] = useState(false);
let {focusWithinProps} = useFocusWithin({
isDisabled: !isFocusable,
onFocusWithinChange: (val) => setFocused(val)
});
// If focused, don't hide the element.
let combinedStyles = useMemo(() => {
if (isFocused) {
return style;
} else if (style) {
return {...styles, ...style};
} else {
return styles;
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isFocused]);
return {
visuallyHiddenProps: {
...focusWithinProps,
style: combinedStyles
}
};
}
/**
* VisuallyHidden hides its children visually, while keeping content visible
* to screen readers.
*/
export function VisuallyHidden(props: VisuallyHiddenProps): JSX.Element {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
let {children, elementType: Element = 'div', isFocusable, style, ...otherProps} = props;
let {visuallyHiddenProps} = useVisuallyHidden(props);
return (
<Element {...mergeProps(otherProps, visuallyHiddenProps)}>
{children}
</Element>
);
}
@@ -0,0 +1,3 @@
import {should} from './index.js';
globalThis.should = should();
@@ -0,0 +1,6 @@
import Inline from '../blots/inline.js';
declare class Underline extends Inline {
static blotName: string;
static tagName: string;
}
export default Underline;
@@ -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.es2017_date = void 0;
const base_config_1 = require("./base-config");
exports.es2017_date = {
libs: [],
variables: [['DateConstructor', base_config_1.TYPE]],
};
@@ -0,0 +1,4 @@
export { AST_NODE_TYPES, AST_TOKEN_TYPES } from './generated/ast-spec';
export * from './lib';
export * from './parser-options';
export * from './ts-estree';
@@ -0,0 +1,6 @@
import { MetadataTag } from '../../metadata/models/MetadataTag';
export interface GetPlanOptionsTagConstraint {
key: MetadataTag;
value: unknown;
}
//# sourceMappingURL=GetPlanOptionsTagConstraint.d.ts.map
@@ -0,0 +1,8 @@
require('thenify-all').withCallback(
require('child_process'),
exports, [
'exec',
'execFile',
]
)
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more