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 @@
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["stream.js"],"names":[],"mappings":"AA6BA;;;;;;;;;;;;;;GAcG;AACH,iCALW,OAAO,GAAG,IAAI,GAAG,SAAS,GAExB,aAAa,CAoOzB;sBAxQY,OAAO,sBAAsB,EAAE,OAAO;;;;6BAMtC,SAAS;;;;;;;;UAKR,OAAO,GAAG,IAAI,GAAG,SAAS;;;;;4BAG3B,IAAI,CAAC,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC"}
@@ -0,0 +1,70 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $SyntaxError = require('es-errors/syntax');
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var $Promise = GetIntrinsic('%Promise%', true);
var Call = require('./Call');
var CompletionRecord = require('./CompletionRecord');
var GetMethod = require('./GetMethod');
var isIteratorRecord = require('../helpers/records/iterator-record');
var callBound = require('call-bound');
var $then = callBound('Promise.prototype.then', true);
// https://262.ecma-international.org/15.0/#sec-asynciteratorclose
module.exports = function AsyncIteratorClose(iteratorRecord, completion) {
if (!isIteratorRecord(iteratorRecord)) {
throw new $TypeError('Assertion failed: `iteratorRecord` must be an Iterator Record'); // step 1
}
if (!(completion instanceof CompletionRecord)) {
throw new $TypeError('Assertion failed: completion is not a Completion Record instance'); // step 2
}
if (!$then) {
throw new $SyntaxError('This environment does not support Promises.');
}
var iterator = iteratorRecord['[[Iterator]]']; // step 3
return $then(
$then(
$then(
new $Promise(function (resolve) {
resolve(GetMethod(iterator, 'return')); // step 4
// resolve(Call(ret, iterator, [])); // step 6
}),
function (returnV) { // step 5.a
if (typeof returnV === 'undefined') {
return completion; // step 5.b
}
return Call(returnV, iterator); // step 5.c, 5.d.
}
),
null,
function (e) {
if (completion.type() === 'throw') {
completion['?'](); // step 6
} else {
throw e; // step 7
}
}
),
function (innerResult) { // step 8
if (completion.type() === 'throw') {
completion['?'](); // step 6
}
if (!isObject(innerResult)) {
throw new $TypeError('`innerResult` must be an Object'); // step 10
}
return completion;
}
);
};
@@ -0,0 +1,15 @@
import type { Active, Over } from '../../store';
export interface Arguments {
active: Active;
over: Over | null;
}
export interface Announcements {
onDragStart({ active }: Pick<Arguments, 'active'>): string | undefined;
onDragMove?({ active, over }: Arguments): string | undefined;
onDragOver({ active, over }: Arguments): string | undefined;
onDragEnd({ active, over }: Arguments): string | undefined;
onDragCancel({ active, over }: Arguments): string | undefined;
}
export interface ScreenReaderInstructions {
draggable: string;
}
@@ -0,0 +1 @@
{"version":3,"file":"isNoAncestorBindingConstraints.js","sourceRoot":"","sources":["../../../../src/binding/calculations/isNoAncestorBindingConstraints.ts"],"names":[],"mappings":";;AAIA,wEAUC;AAZD,uFAAoF;AAEpF,SAAgB,8BAA8B,CAC5C,SAAuD;IAEvD,MAAM,yCAAyC,GAEhC,IAAA,iEAA+B,EAAC,SAAS,CAAC,CAAC;IAE1D,OAAO,CAAC,WAA+B,EAAW,EAAE;QAClD,OAAO,CAAC,yCAAyC,CAAC,WAAW,CAAC,CAAC;IACjE,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
'use strict';
var modulo = require('./modulo');
var ToNumber = require('./ToNumber');
var truncate = require('./truncate');
var isFinite = require('math-intrinsics/isFinite');
// https://262.ecma-international.org/14.0/#sec-toint16
var two16 = 0x10000; // Math.pow(2, 16);
module.exports = function ToInt16(argument) {
var number = ToNumber(argument);
if (!isFinite(number) || number === 0) {
return 0;
}
var int = truncate(number);
var int16bit = modulo(int, two16);
return int16bit >= 0x8000 ? int16bit - two16 : int16bit;
};
@@ -0,0 +1,20 @@
Copyright (c) 2013 Fractal <contact@wearefractal.com>
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,7 @@
/**
* DON'T EDIT THIS FILE.
* This file was generated by "scripts/update-lib-configs.js" script.
*/
"use strict"
module.exports = { extends: [require.resolve("./no-new-in-es2023-intl-api")] }
@@ -0,0 +1,332 @@
import Delta from 'quill-delta';
import { ClassAttributor, Scope } from 'parchment';
import Inline from '../blots/inline.js';
import Quill from '../core/quill.js';
import Module from '../core/module.js';
import { blockDelta } from '../blots/block.js';
import BreakBlot from '../blots/break.js';
import CursorBlot from '../blots/cursor.js';
import TextBlot, { escapeText } from '../blots/text.js';
import CodeBlock, { CodeBlockContainer } from '../formats/code.js';
import { traverse } from './clipboard.js';
const TokenAttributor = new ClassAttributor('code-token', 'hljs', {
scope: Scope.INLINE
});
class CodeToken extends Inline {
static formats(node, scroll) {
while (node != null && node !== scroll.domNode) {
if (node.classList && node.classList.contains(CodeBlock.className)) {
// @ts-expect-error
return super.formats(node, scroll);
}
// @ts-expect-error
node = node.parentNode;
}
return undefined;
}
constructor(scroll, domNode, value) {
// @ts-expect-error
super(scroll, domNode, value);
TokenAttributor.add(this.domNode, value);
}
format(format, value) {
if (format !== CodeToken.blotName) {
super.format(format, value);
} else if (value) {
TokenAttributor.add(this.domNode, value);
} else {
TokenAttributor.remove(this.domNode);
this.domNode.classList.remove(this.statics.className);
}
}
optimize() {
// @ts-expect-error
super.optimize(...arguments);
if (!TokenAttributor.value(this.domNode)) {
this.unwrap();
}
}
}
CodeToken.blotName = 'code-token';
CodeToken.className = 'ql-token';
class SyntaxCodeBlock extends CodeBlock {
static create(value) {
const domNode = super.create(value);
if (typeof value === 'string') {
domNode.setAttribute('data-language', value);
}
return domNode;
}
static formats(domNode) {
// @ts-expect-error
return domNode.getAttribute('data-language') || 'plain';
}
static register() {} // Syntax module will register
format(name, value) {
if (name === this.statics.blotName && value) {
// @ts-expect-error
this.domNode.setAttribute('data-language', value);
} else {
super.format(name, value);
}
}
replaceWith(name, value) {
this.formatAt(0, this.length(), CodeToken.blotName, false);
return super.replaceWith(name, value);
}
}
class SyntaxCodeBlockContainer extends CodeBlockContainer {
attach() {
super.attach();
this.forceNext = false;
// @ts-expect-error
this.scroll.emitMount(this);
}
format(name, value) {
if (name === SyntaxCodeBlock.blotName) {
this.forceNext = true;
this.children.forEach(child => {
// @ts-expect-error
child.format(name, value);
});
}
}
formatAt(index, length, name, value) {
if (name === SyntaxCodeBlock.blotName) {
this.forceNext = true;
}
super.formatAt(index, length, name, value);
}
highlight(highlight) {
let forced = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (this.children.head == null) return;
const nodes = Array.from(this.domNode.childNodes).filter(node => node !== this.uiNode);
const text = `${nodes.map(node => node.textContent).join('\n')}\n`;
const language = SyntaxCodeBlock.formats(this.children.head.domNode);
if (forced || this.forceNext || this.cachedText !== text) {
if (text.trim().length > 0 || this.cachedText == null) {
const oldDelta = this.children.reduce((delta, child) => {
// @ts-expect-error
return delta.concat(blockDelta(child, false));
}, new Delta());
const delta = highlight(text, language);
oldDelta.diff(delta).reduce((index, _ref) => {
let {
retain,
attributes
} = _ref;
// Should be all retains
if (!retain) return index;
if (attributes) {
Object.keys(attributes).forEach(format => {
if ([SyntaxCodeBlock.blotName, CodeToken.blotName].includes(format)) {
// @ts-expect-error
this.formatAt(index, retain, format, attributes[format]);
}
});
}
// @ts-expect-error
return index + retain;
}, 0);
}
this.cachedText = text;
this.forceNext = false;
}
}
html(index, length) {
const [codeBlock] = this.children.find(index);
const language = codeBlock ? SyntaxCodeBlock.formats(codeBlock.domNode) : 'plain';
return `<pre data-language="${language}">\n${escapeText(this.code(index, length))}\n</pre>`;
}
optimize(context) {
super.optimize(context);
if (this.parent != null && this.children.head != null && this.uiNode != null) {
const language = SyntaxCodeBlock.formats(this.children.head.domNode);
// @ts-expect-error
if (language !== this.uiNode.value) {
// @ts-expect-error
this.uiNode.value = language;
}
}
}
}
SyntaxCodeBlockContainer.allowedChildren = [SyntaxCodeBlock];
SyntaxCodeBlock.requiredContainer = SyntaxCodeBlockContainer;
SyntaxCodeBlock.allowedChildren = [CodeToken, CursorBlot, TextBlot, BreakBlot];
const highlight = (lib, language, text) => {
if (typeof lib.versionString === 'string') {
const majorVersion = lib.versionString.split('.')[0];
if (parseInt(majorVersion, 10) >= 11) {
return lib.highlight(text, {
language
}).value;
}
}
return lib.highlight(language, text).value;
};
class Syntax extends Module {
static register() {
Quill.register(CodeToken, true);
Quill.register(SyntaxCodeBlock, true);
Quill.register(SyntaxCodeBlockContainer, true);
}
constructor(quill, options) {
super(quill, options);
if (this.options.hljs == null) {
throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');
}
// @ts-expect-error Fix me later
this.languages = this.options.languages.reduce((memo, _ref2) => {
let {
key
} = _ref2;
memo[key] = true;
return memo;
}, {});
this.highlightBlot = this.highlightBlot.bind(this);
this.initListener();
this.initTimer();
}
initListener() {
this.quill.on(Quill.events.SCROLL_BLOT_MOUNT, blot => {
if (!(blot instanceof SyntaxCodeBlockContainer)) return;
const select = this.quill.root.ownerDocument.createElement('select');
// @ts-expect-error Fix me later
this.options.languages.forEach(_ref3 => {
let {
key,
label
} = _ref3;
const option = select.ownerDocument.createElement('option');
option.textContent = label;
option.setAttribute('value', key);
select.appendChild(option);
});
select.addEventListener('change', () => {
blot.format(SyntaxCodeBlock.blotName, select.value);
this.quill.root.focus(); // Prevent scrolling
this.highlight(blot, true);
});
if (blot.uiNode == null) {
blot.attachUI(select);
if (blot.children.head) {
select.value = SyntaxCodeBlock.formats(blot.children.head.domNode);
}
}
});
}
initTimer() {
let timer = null;
this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(() => {
this.highlight();
timer = null;
}, this.options.interval);
});
}
highlight() {
let blot = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (this.quill.selection.composing) return;
this.quill.update(Quill.sources.USER);
const range = this.quill.getSelection();
const blots = blot == null ? this.quill.scroll.descendants(SyntaxCodeBlockContainer) : [blot];
blots.forEach(container => {
container.highlight(this.highlightBlot, force);
});
this.quill.update(Quill.sources.SILENT);
if (range != null) {
this.quill.setSelection(range, Quill.sources.SILENT);
}
}
highlightBlot(text) {
let language = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'plain';
language = this.languages[language] ? language : 'plain';
if (language === 'plain') {
return escapeText(text).split('\n').reduce((delta, line, i) => {
if (i !== 0) {
delta.insert('\n', {
[CodeBlock.blotName]: language
});
}
return delta.insert(line);
}, new Delta());
}
const container = this.quill.root.ownerDocument.createElement('div');
container.classList.add(CodeBlock.className);
container.innerHTML = highlight(this.options.hljs, language, text);
return traverse(this.quill.scroll, container, [(node, delta) => {
// @ts-expect-error
const value = TokenAttributor.value(node);
if (value) {
return delta.compose(new Delta().retain(delta.length(), {
[CodeToken.blotName]: value
}));
}
return delta;
}], [(node, delta) => {
// @ts-expect-error
return node.data.split('\n').reduce((memo, nodeText, i) => {
if (i !== 0) memo.insert('\n', {
[CodeBlock.blotName]: language
});
return memo.insert(nodeText);
}, delta);
}], new WeakMap());
}
}
Syntax.DEFAULTS = {
hljs: (() => {
return window.hljs;
})(),
interval: 1000,
languages: [{
key: 'plain',
label: 'Plain'
}, {
key: 'bash',
label: 'Bash'
}, {
key: 'cpp',
label: 'C++'
}, {
key: 'cs',
label: 'C#'
}, {
key: 'css',
label: 'CSS'
}, {
key: 'diff',
label: 'Diff'
}, {
key: 'xml',
label: 'HTML/XML'
}, {
key: 'java',
label: 'Java'
}, {
key: 'javascript',
label: 'JavaScript'
}, {
key: 'markdown',
label: 'Markdown'
}, {
key: 'php',
label: 'PHP'
}, {
key: 'python',
label: 'Python'
}, {
key: 'ruby',
label: 'Ruby'
}, {
key: 'sql',
label: 'SQL'
}]
};
export { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default };
//# sourceMappingURL=syntax.js.map
@@ -0,0 +1,55 @@
'use strict';
const kDone = Symbol('kDone');
const kRun = Symbol('kRun');
/**
* A very simple job queue with adjustable concurrency. Adapted from
* https://github.com/STRML/async-limiter
*/
class Limiter {
/**
* Creates a new `Limiter`.
*
* @param {Number} [concurrency=Infinity] The maximum number of jobs allowed
* to run concurrently
*/
constructor(concurrency) {
this[kDone] = () => {
this.pending--;
this[kRun]();
};
this.concurrency = concurrency || Infinity;
this.jobs = [];
this.pending = 0;
}
/**
* Adds a job to the queue.
*
* @param {Function} job The job to run
* @public
*/
add(job) {
this.jobs.push(job);
this[kRun]();
}
/**
* Removes a job from the queue and runs it if possible.
*
* @private
*/
[kRun]() {
if (this.pending === this.concurrency) return;
if (this.jobs.length) {
const job = this.jobs.shift();
this.pending++;
job(this[kDone]);
}
}
}
module.exports = Limiter;
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AA+BM,SAAS,0CAAQ,KAAsB,EAAE,GAAuC;IACrF,IAAI,eACF,cAAc,cACd,OAAO,gBACP,YAAY,cACZ,UAAU,EACV,aAAa;IACb,SAAS,iBAAiB,cAC1B,UAAU,EACV,GAAG,YACJ,GAAG;IAEJ,IAAI,YAA2B,CAAC;IAChC,IAAI,gBAAgB,KAClB,YAAY;QACV,MAAM;QACN,UAAU,CAAC,aAAa,IAAI;IAC9B;IAEF,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,kCAAW,EAAE,OAAO;IAC3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;iBAAC;sBAAS;oBAAc;oBAAY;aAAY;IAAG;IAC1F,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,YAAY;QAAC,WAAW;IAAI;IAC1D,IAAI,sBAAsB,CAAA,GAAA,gCAAS,EAAE,gBAAgB;IACrD,IAAI,SAAS,CAAA,GAAA,+BAAQ;IACrB,IAAI,kBAAkB,CAAA,GAAA,kCAAW,EAAE;IAEnC,OAAO;mBACL;QACA,WAAW,CAAA,GAAA,gCAAS,EAAE,UAAU,iBAAiB;YAC/C,GAAG,mBAAmB;YACtB,GAAG,SAAS;YACZ,iBAAiB,cAAc;YAC/B,gBAAgB,KAAK,CAAC,eAAe;YACrC,SAAS,CAAC;oBACR;iBAAA,sBAAA,WAAW,OAAO,cAAlB,0CAAA,yBAAA,YAAqB;gBACrB,IAAI,mBAAmB;oBACrB,kBAAkB;oBAClB,QAAQ,IAAI,CAAC;gBACf;gBAEA,mGAAmG;gBACnG,IACE,CAAC,OAAO,QAAQ,IAChB,EAAE,aAAa,YAAY,qBAC3B,EAAE,aAAa,CAAC,IAAI,IACpB,0FAA0F;gBAC1F,CAAC,EAAE,kBAAkB,MACrB,CAAA,GAAA,0CAAmB,EAAE,EAAE,aAAa,EAAE,MACtC,MAAM,IAAI,EACV;oBACA,EAAE,cAAc;oBAChB,OAAO,IAAI,CAAC,EAAE,aAAa,EAAE,GAAG,MAAM,IAAI,EAAE,MAAM,aAAa;gBACjE;YACF;QACF;IACF;AACF","sources":["packages/@react-aria/link/src/useLink.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLinkProps} from '@react-types/link';\nimport {DOMAttributes, FocusableElement, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, shouldClientNavigate, useLinkProps, useRouter} from '@react-aria/utils';\nimport React from 'react';\nimport {useFocusable} from '@react-aria/focus';\nimport {usePress} from '@react-aria/interactions';\n\nexport interface AriaLinkOptions extends AriaLinkProps {\n /** Whether the link is disabled. */\n isDisabled?: boolean,\n /**\n * The HTML element used to render the link, e.g. 'a', or 'span'.\n * @default 'a'\n */\n elementType?: string\n}\n\nexport interface LinkAria {\n /** Props for the link element. */\n linkProps: DOMAttributes,\n /** Whether the link is currently pressed. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a link component.\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport function useLink(props: AriaLinkOptions, ref: RefObject<FocusableElement | null>): LinkAria {\n let {\n elementType = 'a',\n onPress,\n onPressStart,\n onPressEnd,\n // @ts-ignore\n onClick: deprecatedOnClick,\n isDisabled,\n ...otherProps\n } = props;\n\n let linkProps: DOMAttributes = {};\n if (elementType !== 'a') {\n linkProps = {\n role: 'link',\n tabIndex: !isDisabled ? 0 : undefined\n };\n }\n let {focusableProps} = useFocusable(props, ref);\n let {pressProps, isPressed} = usePress({onPress, onPressStart, onPressEnd, isDisabled, ref});\n let domProps = filterDOMProps(otherProps, {labelable: true});\n let interactionHandlers = mergeProps(focusableProps, pressProps);\n let router = useRouter();\n let routerLinkProps = useLinkProps(props);\n\n return {\n isPressed, // Used to indicate press state for visual\n linkProps: mergeProps(domProps, routerLinkProps, {\n ...interactionHandlers,\n ...linkProps,\n 'aria-disabled': isDisabled || undefined,\n 'aria-current': props['aria-current'],\n onClick: (e: React.MouseEvent<HTMLAnchorElement>) => {\n pressProps.onClick?.(e);\n if (deprecatedOnClick) {\n deprecatedOnClick(e);\n console.warn('onClick is deprecated, please use onPress');\n }\n\n // If a custom router is provided, prevent default and forward if this link should client navigate.\n if (\n !router.isNative &&\n e.currentTarget instanceof HTMLAnchorElement &&\n e.currentTarget.href &&\n // If props are applied to a router Link component, it may have already prevented default.\n !e.isDefaultPrevented() &&\n shouldClientNavigate(e.currentTarget, e) &&\n props.href\n ) {\n e.preventDefault();\n router.open(e.currentTarget, e, props.href, props.routerOptions);\n }\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"useLink.main.js.map"}
@@ -0,0 +1,158 @@
/**
* @fileoverview Rule to enforce spacing around colons of switch statements.
* @author Toru Nagashima
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// 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: "switch-colon-spacing",
url: "https://eslint.style/rules/switch-colon-spacing",
},
},
],
},
type: "layout",
docs: {
description: "Enforce spacing around colons of switch statements",
recommended: false,
url: "https://eslint.org/docs/latest/rules/switch-colon-spacing",
},
schema: [
{
type: "object",
properties: {
before: { type: "boolean", default: false },
after: { type: "boolean", default: true },
},
additionalProperties: false,
},
],
fixable: "whitespace",
messages: {
expectedBefore: "Expected space(s) before this colon.",
expectedAfter: "Expected space(s) after this colon.",
unexpectedBefore: "Unexpected space(s) before this colon.",
unexpectedAfter: "Unexpected space(s) after this colon.",
},
},
create(context) {
const sourceCode = context.sourceCode;
const options = context.options[0] || {};
const beforeSpacing = options.before === true; // false by default
const afterSpacing = options.after !== false; // true by default
/**
* Check whether the spacing between the given 2 tokens is valid or not.
* @param {Token} left The left token to check.
* @param {Token} right The right token to check.
* @param {boolean} expected The expected spacing to check. `true` if there should be a space.
* @returns {boolean} `true` if the spacing between the tokens is valid.
*/
function isValidSpacing(left, right, expected) {
return (
astUtils.isClosingBraceToken(right) ||
!astUtils.isTokenOnSameLine(left, right) ||
sourceCode.isSpaceBetweenTokens(left, right) === expected
);
}
/**
* Check whether comments exist between the given 2 tokens.
* @param {Token} left The left token to check.
* @param {Token} right The right token to check.
* @returns {boolean} `true` if comments exist between the given 2 tokens.
*/
function commentsExistBetween(left, right) {
return (
sourceCode.getFirstTokenBetween(left, right, {
includeComments: true,
filter: astUtils.isCommentToken,
}) !== null
);
}
/**
* Fix the spacing between the given 2 tokens.
* @param {RuleFixer} fixer The fixer to fix.
* @param {Token} left The left token of fix range.
* @param {Token} right The right token of fix range.
* @param {boolean} spacing The spacing style. `true` if there should be a space.
* @returns {Fix|null} The fix object.
*/
function fix(fixer, left, right, spacing) {
if (commentsExistBetween(left, right)) {
return null;
}
if (spacing) {
return fixer.insertTextAfter(left, " ");
}
return fixer.removeRange([left.range[1], right.range[0]]);
}
return {
SwitchCase(node) {
const colonToken = astUtils.getSwitchCaseColonToken(
node,
sourceCode,
);
const beforeToken = sourceCode.getTokenBefore(colonToken);
const afterToken = sourceCode.getTokenAfter(colonToken);
if (!isValidSpacing(beforeToken, colonToken, beforeSpacing)) {
context.report({
node,
loc: colonToken.loc,
messageId: beforeSpacing
? "expectedBefore"
: "unexpectedBefore",
fix: fixer =>
fix(fixer, beforeToken, colonToken, beforeSpacing),
});
}
if (!isValidSpacing(colonToken, afterToken, afterSpacing)) {
context.report({
node,
loc: colonToken.loc,
messageId: afterSpacing
? "expectedAfter"
: "unexpectedAfter",
fix: fixer =>
fix(fixer, colonToken, afterToken, afterSpacing),
});
}
},
};
},
};
@@ -0,0 +1,48 @@
{
"name": "unique-filename",
"version": "2.0.1",
"description": "Generate a unique filename for use in temporary directories or caches.",
"main": "lib/index.js",
"scripts": {
"test": "tap",
"lint": "eslint \"**/*.js\"",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"snap": "tap",
"posttest": "npm run lint"
},
"repository": {
"type": "git",
"url": "https://github.com/npm/unique-filename.git"
},
"keywords": [],
"author": "GitHub Inc.",
"license": "ISC",
"bugs": {
"url": "https://github.com/iarna/unique-filename/issues"
},
"homepage": "https://github.com/iarna/unique-filename",
"devDependencies": {
"@npmcli/eslint-config": "^3.1.0",
"@npmcli/template-oss": "3.5.0",
"tap": "^16.3.0"
},
"dependencies": {
"unique-slug": "^3.0.0"
},
"files": [
"bin/",
"lib/"
],
"engines": {
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "3.5.0"
}
}
@@ -0,0 +1,75 @@
import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f} from "./CalendarDate.mjs";
import {fromExtendedYear as $3b62074eb05584b2$export$4475b7e617eb123c, getExtendedYear as $3b62074eb05584b2$export$c36e0ecb2d4fa69d, GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from "./GregorianCalendar.mjs";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // Portions of the code in this file are based on code from ICU.
// Original licensing can be found in the NOTICE file in the root directory of this source tree.
const $5f31bd6f0c8940b2$var$TAIWAN_ERA_START = 1911;
function $5f31bd6f0c8940b2$var$gregorianYear(date) {
return date.era === 'minguo' ? date.year + $5f31bd6f0c8940b2$var$TAIWAN_ERA_START : 1 - date.year + $5f31bd6f0c8940b2$var$TAIWAN_ERA_START;
}
function $5f31bd6f0c8940b2$var$gregorianToTaiwan(year) {
let y = year - $5f31bd6f0c8940b2$var$TAIWAN_ERA_START;
if (y > 0) return [
'minguo',
y
];
else return [
'before_minguo',
1 - y
];
}
class $5f31bd6f0c8940b2$export$65e01080afcb0799 extends (0, $3b62074eb05584b2$export$80ee6245ec4f29ec) {
fromJulianDay(jd) {
let date = super.fromJulianDay(jd);
let extendedYear = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(date.era, date.year);
let [era, year] = $5f31bd6f0c8940b2$var$gregorianToTaiwan(extendedYear);
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, era, year, date.month, date.day);
}
toJulianDay(date) {
return super.toJulianDay($5f31bd6f0c8940b2$var$toGregorian(date));
}
getEras() {
return [
'before_minguo',
'minguo'
];
}
balanceDate(date) {
let [era, year] = $5f31bd6f0c8940b2$var$gregorianToTaiwan($5f31bd6f0c8940b2$var$gregorianYear(date));
date.era = era;
date.year = year;
}
isInverseEra(date) {
return date.era === 'before_minguo';
}
getDaysInMonth(date) {
return super.getDaysInMonth($5f31bd6f0c8940b2$var$toGregorian(date));
}
getYearsInEra(date) {
return date.era === 'before_minguo' ? 9999 : 9999 - $5f31bd6f0c8940b2$var$TAIWAN_ERA_START;
}
constructor(...args){
super(...args), this.identifier = 'roc' // Republic of China
;
}
}
function $5f31bd6f0c8940b2$var$toGregorian(date) {
let [era, year] = (0, $3b62074eb05584b2$export$4475b7e617eb123c)($5f31bd6f0c8940b2$var$gregorianYear(date));
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(era, year, date.month, date.day);
}
export {$5f31bd6f0c8940b2$export$65e01080afcb0799 as TaiwanCalendar};
//# sourceMappingURL=TaiwanCalendar.module.js.map
@@ -0,0 +1,46 @@
let Declaration = require('../declaration')
let flexSpec = require('./flex-spec')
class AlignItems extends Declaration {
/**
* Return property name by final spec
*/
normalize() {
return 'align-items'
}
/**
* Change property name for 2009 and 2012 specs
*/
prefixed(prop, prefix) {
let spec
;[spec, prefix] = flexSpec(prefix)
if (spec === 2009) {
return prefix + 'box-align'
}
if (spec === 2012) {
return prefix + 'flex-align'
}
return super.prefixed(prop, prefix)
}
/**
* Change value for 2009 and 2012 specs
*/
set(decl, prefix) {
let spec = flexSpec(prefix)[0]
if (spec === 2009 || spec === 2012) {
decl.value = AlignItems.oldValues[decl.value] || decl.value
}
return super.set(decl, prefix)
}
}
AlignItems.names = ['align-items', 'flex-align', 'box-align']
AlignItems.oldValues = {
'flex-end': 'end',
'flex-start': 'start'
}
module.exports = AlignItems
@@ -0,0 +1,19 @@
"use client";
import { useRef } from 'react';
/**
* Creates a constant value over the lifecycle of a component.
*
* Even if `useMemo` is provided an empty array as its final argument, it doesn't offer
* a guarantee that it won't re-run for performance reasons later on. By using `useConstant`
* you can ensure that initialisers don't execute twice or more.
*/
function useConstant(init) {
const ref = useRef(null);
if (ref.current === null) {
ref.current = init();
}
return ref.current;
}
export { useConstant };
@@ -0,0 +1,90 @@
/**
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
* @license MIT
*/
import type { Terminal, ITerminalAddon } from '@xterm/xterm';
import type { FitAddon as IFitApi } from '@xterm/addon-fit';
import { IRenderDimensions } from 'browser/renderer/shared/Types';
interface ITerminalDimensions {
/**
* The number of rows in the terminal.
*/
rows: number;
/**
* The number of columns in the terminal.
*/
cols: number;
}
const MINIMUM_COLS = 2;
const MINIMUM_ROWS = 1;
export class FitAddon implements ITerminalAddon , IFitApi {
private _terminal: Terminal | undefined;
public activate(terminal: Terminal): void {
this._terminal = terminal;
}
public dispose(): void {}
public fit(): void {
const dims = this.proposeDimensions();
if (!dims || !this._terminal || isNaN(dims.cols) || isNaN(dims.rows)) {
return;
}
// TODO: Remove reliance on private API
const core = (this._terminal as any)._core;
// Force a full render
if (this._terminal.rows !== dims.rows || this._terminal.cols !== dims.cols) {
core._renderService.clear();
this._terminal.resize(dims.cols, dims.rows);
}
}
public proposeDimensions(): ITerminalDimensions | undefined {
if (!this._terminal) {
return undefined;
}
if (!this._terminal.element || !this._terminal.element.parentElement) {
return undefined;
}
// TODO: Remove reliance on private API
const core = (this._terminal as any)._core;
const dims: IRenderDimensions = core._renderService.dimensions;
if (dims.css.cell.width === 0 || dims.css.cell.height === 0) {
return undefined;
}
const scrollbarWidth = this._terminal.options.scrollback === 0 ?
0 : core.viewport.scrollBarWidth;
const parentElementStyle = window.getComputedStyle(this._terminal.element.parentElement);
const parentElementHeight = parseInt(parentElementStyle.getPropertyValue('height'));
const parentElementWidth = Math.max(0, parseInt(parentElementStyle.getPropertyValue('width')));
const elementStyle = window.getComputedStyle(this._terminal.element);
const elementPadding = {
top: parseInt(elementStyle.getPropertyValue('padding-top')),
bottom: parseInt(elementStyle.getPropertyValue('padding-bottom')),
right: parseInt(elementStyle.getPropertyValue('padding-right')),
left: parseInt(elementStyle.getPropertyValue('padding-left'))
};
const elementPaddingVer = elementPadding.top + elementPadding.bottom;
const elementPaddingHor = elementPadding.right + elementPadding.left;
const availableHeight = parentElementHeight - elementPaddingVer;
const availableWidth = parentElementWidth - elementPaddingHor - scrollbarWidth;
const geometry = {
cols: Math.max(MINIMUM_COLS, Math.floor(availableWidth / dims.css.cell.width)),
rows: Math.max(MINIMUM_ROWS, Math.floor(availableHeight / dims.css.cell.height))
};
return geometry;
}
}
@@ -0,0 +1,8 @@
"use client";
// src/collections/item.ts
import { Item } from "@react-stately/collections";
export {
Item
};
@@ -0,0 +1,8 @@
var $173e9fb4d14fe309$exports = {};
$173e9fb4d14fe309$exports = {
"breadcrumbs": `Atpaka\u{13C}ce\u{13C}i`
};
export {$173e9fb4d14fe309$exports as default};
//# sourceMappingURL=lv-LV.module.js.map
@@ -0,0 +1,682 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const scope_manager_1 = require("@typescript-eslint/scope-manager");
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
const referenceContainsTypeQuery_1 = require("../util/referenceContainsTypeQuery");
exports.default = (0, util_1.createRule)({
name: 'no-unused-vars',
meta: {
type: 'problem',
docs: {
description: 'Disallow unused variables',
extendsBaseRule: true,
recommended: 'recommended',
},
messages: {
unusedVar: "'{{varName}}' is {{action}} but never used{{additional}}.",
usedIgnoredVar: "'{{varName}}' is marked as ignored but is used{{additional}}.",
usedOnlyAsType: "'{{varName}}' is {{action}} but only used as a type{{additional}}.",
},
schema: [
{
oneOf: [
{
type: 'string',
description: 'Broad setting for unused variables to target.',
enum: ['all', 'local'],
},
{
type: 'object',
additionalProperties: false,
properties: {
args: {
type: 'string',
description: 'Whether to check all, some, or no arguments.',
enum: ['all', 'after-used', 'none'],
},
argsIgnorePattern: {
type: 'string',
description: 'Regular expressions of argument names to not check for usage.',
},
caughtErrors: {
type: 'string',
description: 'Whether to check catch block arguments.',
enum: ['all', 'none'],
},
caughtErrorsIgnorePattern: {
type: 'string',
description: 'Regular expressions of catch block argument names to not check for usage.',
},
destructuredArrayIgnorePattern: {
type: 'string',
description: 'Regular expressions of destructured array variable names to not check for usage.',
},
ignoreClassWithStaticInitBlock: {
type: 'boolean',
description: 'Whether to ignore classes with at least one static initialization block.',
},
ignoreRestSiblings: {
type: 'boolean',
description: 'Whether to ignore sibling properties in `...` destructurings.',
},
ignoreUsingDeclarations: {
type: 'boolean',
description: 'Whether to ignore using or await using declarations.',
},
reportUsedIgnorePattern: {
type: 'boolean',
description: 'Whether to report variables that match any of the valid ignore pattern options if they have been used.',
},
vars: {
type: 'string',
description: 'Whether to check all variables or only locally-declared variables.',
enum: ['all', 'local'],
},
varsIgnorePattern: {
type: 'string',
description: 'Regular expressions of variable names to not check for usage.',
},
},
},
],
},
],
},
defaultOptions: [{}],
create(context, [firstOption]) {
const MODULE_DECL_CACHE = new Map();
const options = (() => {
const options = {
args: 'after-used',
caughtErrors: 'all',
ignoreClassWithStaticInitBlock: false,
ignoreRestSiblings: false,
ignoreUsingDeclarations: false,
reportUsedIgnorePattern: false,
vars: 'all',
};
if (typeof firstOption === 'string') {
options.vars = firstOption;
}
else {
options.vars = firstOption.vars ?? options.vars;
options.args = firstOption.args ?? options.args;
options.ignoreRestSiblings =
firstOption.ignoreRestSiblings ?? options.ignoreRestSiblings;
options.ignoreUsingDeclarations =
firstOption.ignoreUsingDeclarations ??
options.ignoreUsingDeclarations;
options.caughtErrors = firstOption.caughtErrors ?? options.caughtErrors;
options.ignoreClassWithStaticInitBlock =
firstOption.ignoreClassWithStaticInitBlock ??
options.ignoreClassWithStaticInitBlock;
options.reportUsedIgnorePattern =
firstOption.reportUsedIgnorePattern ??
options.reportUsedIgnorePattern;
if (firstOption.varsIgnorePattern) {
options.varsIgnorePattern = new RegExp(firstOption.varsIgnorePattern, 'u');
}
if (firstOption.argsIgnorePattern) {
options.argsIgnorePattern = new RegExp(firstOption.argsIgnorePattern, 'u');
}
if (firstOption.caughtErrorsIgnorePattern) {
options.caughtErrorsIgnorePattern = new RegExp(firstOption.caughtErrorsIgnorePattern, 'u');
}
if (firstOption.destructuredArrayIgnorePattern) {
options.destructuredArrayIgnorePattern = new RegExp(firstOption.destructuredArrayIgnorePattern, 'u');
}
}
return options;
})();
/**
* Determines what variable type a def is.
* @param def the declaration to check
* @returns a simple name for the types of variables that this rule supports
*/
function defToVariableType(def) {
/*
* This `destructuredArrayIgnorePattern` error report works differently from the catch
* clause and parameter error reports. _Both_ the `varsIgnorePattern` and the
* `destructuredArrayIgnorePattern` will be checked for array destructuring. However,
* for the purposes of the report, the currently defined behavior is to only inform the
* user of the `destructuredArrayIgnorePattern` if it's present (regardless of the fact
* that the `varsIgnorePattern` would also apply). If it's not present, the user will be
* informed of the `varsIgnorePattern`, assuming that's present.
*/
if (options.destructuredArrayIgnorePattern &&
def.name.parent.type === utils_1.AST_NODE_TYPES.ArrayPattern) {
return 'array-destructure';
}
switch (def.type) {
case scope_manager_1.DefinitionType.CatchClause:
return 'catch-clause';
case scope_manager_1.DefinitionType.Parameter:
return 'parameter';
default:
return 'variable';
}
}
/**
* Gets a given variable's description and configured ignore pattern
* based on the provided variableType
* @param variableType a simple name for the types of variables that this rule supports
* @returns the given variable's description and
* ignore pattern
*/
function getVariableDescription(variableType) {
switch (variableType) {
case 'array-destructure':
return {
pattern: options.destructuredArrayIgnorePattern?.toString(),
variableDescription: 'elements of array destructuring',
};
case 'catch-clause':
return {
pattern: options.caughtErrorsIgnorePattern?.toString(),
variableDescription: 'caught errors',
};
case 'parameter':
return {
pattern: options.argsIgnorePattern?.toString(),
variableDescription: 'args',
};
case 'variable':
return {
pattern: options.varsIgnorePattern?.toString(),
variableDescription: 'vars',
};
}
}
/**
* Generates the message data about the variable being defined and unused,
* including the ignore pattern if configured.
* @param unusedVar eslint-scope variable object.
* @returns The message data to be used with this unused variable.
*/
function getDefinedMessageData(unusedVar) {
const def = unusedVar.defs.at(0);
let additionalMessageData = '';
if (def) {
const { pattern, variableDescription } = getVariableDescription(defToVariableType(def));
if (pattern && variableDescription) {
additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`;
}
}
return {
action: 'defined',
additional: additionalMessageData,
varName: unusedVar.name,
};
}
/**
* Generate the warning message about the variable being
* assigned and unused, including the ignore pattern if configured.
* @param unusedVar eslint-scope variable object.
* @returns The message data to be used with this unused variable.
*/
function getAssignedMessageData(unusedVar) {
const def = unusedVar.defs.at(0);
let additionalMessageData = '';
if (def) {
const { pattern, variableDescription } = getVariableDescription(defToVariableType(def));
if (pattern && variableDescription) {
additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`;
}
}
return {
action: 'assigned a value',
additional: additionalMessageData,
varName: unusedVar.name,
};
}
/**
* Generate the warning message about a variable being used even though
* it is marked as being ignored.
* @param variable eslint-scope variable object
* @param variableType a simple name for the types of variables that this rule supports
* @returns The message data to be used with this used ignored variable.
*/
function getUsedIgnoredMessageData(variable, variableType) {
const { pattern, variableDescription } = getVariableDescription(variableType);
let additionalMessageData = '';
if (pattern && variableDescription) {
additionalMessageData = `. Used ${variableDescription} must not match ${pattern}`;
}
return {
additional: additionalMessageData,
varName: variable.name,
};
}
function collectUnusedVariables() {
/**
* Checks whether a node is a sibling of the rest property or not.
* @param node a node to check
* @returns True if the node is a sibling of the rest property, otherwise false.
*/
function hasRestSibling(node) {
return (node.type === utils_1.AST_NODE_TYPES.Property &&
node.parent.type === utils_1.AST_NODE_TYPES.ObjectPattern &&
node.parent.properties[node.parent.properties.length - 1].type ===
utils_1.AST_NODE_TYPES.RestElement);
}
/**
* Determines if a variable has a sibling rest property
* @param variable eslint-scope variable object.
* @returns True if the variable is exported, false if not.
*/
function hasRestSpreadSibling(variable) {
if (options.ignoreRestSiblings) {
const hasRestSiblingDefinition = variable.defs.some(def => hasRestSibling(def.name.parent));
const hasRestSiblingReference = variable.references.some(ref => hasRestSibling(ref.identifier.parent));
return hasRestSiblingDefinition || hasRestSiblingReference;
}
return false;
}
/**
* Checks whether the given variable is after the last used parameter.
* @param variable The variable to check.
* @returns `true` if the variable is defined after the last used parameter.
*/
function isAfterLastUsedArg(variable) {
const def = variable.defs[0];
const params = context.sourceCode.getDeclaredVariables(def.node);
const posteriorParams = params.slice(params.indexOf(variable) + 1);
// If any used parameters occur after this parameter, do not report.
return !posteriorParams.some(v => v.references.length > 0 || v.eslintUsed);
}
const analysisResults = (0, util_1.collectVariables)(context);
const variables = [
...Array.from(analysisResults.unusedVariables, variable => ({
used: false,
variable,
})),
...Array.from(analysisResults.usedVariables, variable => ({
used: true,
variable,
})),
];
const unusedVariablesReturn = [];
for (const { used, variable } of variables) {
// explicit global variables don't have definitions.
if (variable.defs.length === 0) {
if (!used) {
unusedVariablesReturn.push(variable);
}
continue;
}
const def = variable.defs[0];
if (variable.scope.type === utils_1.TSESLint.Scope.ScopeType.global &&
options.vars === 'local') {
// skip variables in the global scope if configured to
continue;
}
const refUsedInArrayPatterns = variable.references.some(ref => ref.identifier.parent.type === utils_1.AST_NODE_TYPES.ArrayPattern);
// skip elements of array destructuring patterns
if ((def.name.parent.type === utils_1.AST_NODE_TYPES.ArrayPattern ||
refUsedInArrayPatterns) &&
def.name.type === utils_1.AST_NODE_TYPES.Identifier &&
options.destructuredArrayIgnorePattern?.test(def.name.name)) {
if (options.reportUsedIgnorePattern && used) {
context.report({
node: def.name,
messageId: 'usedIgnoredVar',
data: getUsedIgnoredMessageData(variable, 'array-destructure'),
});
}
continue;
}
if (def.type === utils_1.TSESLint.Scope.DefinitionType.ClassName) {
const hasStaticBlock = def.node.body.body.some(node => node.type === utils_1.AST_NODE_TYPES.StaticBlock);
if (options.ignoreClassWithStaticInitBlock && hasStaticBlock) {
continue;
}
}
// skip catch variables
if (def.type === utils_1.TSESLint.Scope.DefinitionType.CatchClause) {
if (options.caughtErrors === 'none') {
continue;
}
// skip ignored parameters
if (def.name.type === utils_1.AST_NODE_TYPES.Identifier &&
options.caughtErrorsIgnorePattern?.test(def.name.name)) {
if (options.reportUsedIgnorePattern && used) {
context.report({
node: def.name,
messageId: 'usedIgnoredVar',
data: getUsedIgnoredMessageData(variable, 'catch-clause'),
});
}
continue;
}
}
else if (def.type === utils_1.TSESLint.Scope.DefinitionType.Parameter) {
// if "args" option is "none", skip any parameter
if (options.args === 'none') {
continue;
}
// skip ignored parameters
if (def.name.type === utils_1.AST_NODE_TYPES.Identifier &&
options.argsIgnorePattern?.test(def.name.name)) {
if (options.reportUsedIgnorePattern && used) {
context.report({
node: def.name,
messageId: 'usedIgnoredVar',
data: getUsedIgnoredMessageData(variable, 'parameter'),
});
}
continue;
}
// if "args" option is "after-used", skip used variables
if (options.args === 'after-used' &&
(0, util_1.isFunction)(def.name.parent) &&
!isAfterLastUsedArg(variable)) {
continue;
}
}
// skip ignored variables
else if (def.name.type === utils_1.AST_NODE_TYPES.Identifier &&
options.varsIgnorePattern?.test(def.name.name)) {
if (options.reportUsedIgnorePattern &&
used &&
/* enum members are always marked as 'used' by `collectVariables`, but in reality they may be used or
unused. either way, don't complain about their naming. */
def.type !== utils_1.TSESLint.Scope.DefinitionType.TSEnumMember) {
context.report({
node: def.name,
messageId: 'usedIgnoredVar',
data: getUsedIgnoredMessageData(variable, 'variable'),
});
}
continue;
}
if (def.type === utils_1.TSESLint.Scope.DefinitionType.Variable &&
options.ignoreUsingDeclarations &&
(def.parent.kind === 'await using' || def.parent.kind === 'using')) {
continue;
}
if (hasRestSpreadSibling(variable)) {
continue;
}
// in case another rule has run and used the collectUnusedVariables,
// we want to ensure our selectors that marked variables as used are respected
if (variable.eslintUsed) {
continue;
}
if (!used) {
unusedVariablesReturn.push(variable);
}
}
return unusedVariablesReturn;
}
return {
// top-level declaration file handling
[ambientDeclarationSelector(utils_1.AST_NODE_TYPES.Program)](node) {
if (!(0, util_1.isDefinitionFile)(context.filename)) {
return;
}
const moduleDecl = (0, util_1.nullThrows)(node.parent, util_1.NullThrowsReasons.MissingParent);
if (checkForOverridingExportStatements(moduleDecl)) {
return;
}
markDeclarationChildAsUsed(node);
},
// children of a namespace that is a child of a declared namespace are auto-exported
[ambientDeclarationSelector('TSModuleDeclaration[declare = true] > TSModuleBlock TSModuleDeclaration > TSModuleBlock')](node) {
const moduleDecl = (0, util_1.nullThrows)(node.parent.parent, util_1.NullThrowsReasons.MissingParent);
if (checkForOverridingExportStatements(moduleDecl)) {
return;
}
markDeclarationChildAsUsed(node);
},
// declared namespace handling
[ambientDeclarationSelector('TSModuleDeclaration[declare = true] > TSModuleBlock')](node) {
const moduleDecl = (0, util_1.nullThrows)(node.parent.parent, util_1.NullThrowsReasons.MissingParent);
if (checkForOverridingExportStatements(moduleDecl)) {
return;
}
markDeclarationChildAsUsed(node);
},
// namespace handling in definition files
[ambientDeclarationSelector('TSModuleDeclaration > TSModuleBlock')](node) {
if (!(0, util_1.isDefinitionFile)(context.filename)) {
return;
}
const moduleDecl = (0, util_1.nullThrows)(node.parent.parent, util_1.NullThrowsReasons.MissingParent);
if (checkForOverridingExportStatements(moduleDecl)) {
return;
}
markDeclarationChildAsUsed(node);
},
// collect
'Program:exit'(programNode) {
const unusedVars = collectUnusedVariables();
for (const unusedVar of unusedVars) {
// Report the first declaration.
if (unusedVar.defs.length > 0) {
const usedOnlyAsType = unusedVar.references.some(ref => (0, referenceContainsTypeQuery_1.referenceContainsTypeQuery)(ref.identifier));
const isImportUsedOnlyAsType = usedOnlyAsType &&
unusedVar.defs.some(def => def.type === scope_manager_1.DefinitionType.ImportBinding);
if (isImportUsedOnlyAsType) {
continue;
}
const writeReferences = unusedVar.references.filter(ref => ref.isWrite() &&
ref.from.variableScope === unusedVar.scope.variableScope);
const id = writeReferences.length
? writeReferences[writeReferences.length - 1].identifier
: unusedVar.identifiers[0];
const messageId = usedOnlyAsType ? 'usedOnlyAsType' : 'unusedVar';
const { start } = id.loc;
const idLength = id.name.length;
const loc = {
start,
end: {
column: start.column + idLength,
line: start.line,
},
};
context.report({
loc,
messageId,
data: unusedVar.references.some(ref => ref.isWrite())
? getAssignedMessageData(unusedVar)
: getDefinedMessageData(unusedVar),
});
// If there are no regular declaration, report the first `/*globals*/` comment directive.
}
else if ('eslintExplicitGlobalComments' in unusedVar &&
unusedVar.eslintExplicitGlobalComments) {
const directiveComment = unusedVar.eslintExplicitGlobalComments[0];
context.report({
loc: (0, util_1.getNameLocationInGlobalDirectiveComment)(context.sourceCode, directiveComment, unusedVar.name),
node: programNode,
messageId: 'unusedVar',
data: getDefinedMessageData(unusedVar),
});
}
}
},
};
function checkForOverridingExportStatements(node) {
const cached = MODULE_DECL_CACHE.get(node);
if (cached != null) {
return cached;
}
const body = getStatementsOfNode(node);
if (hasOverridingExportStatement(body)) {
MODULE_DECL_CACHE.set(node, true);
return true;
}
MODULE_DECL_CACHE.set(node, false);
return false;
}
function ambientDeclarationSelector(parent) {
return [
// Types are ambiently exported
`${parent} > :matches(${[
utils_1.AST_NODE_TYPES.TSInterfaceDeclaration,
utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration,
].join(', ')})`,
// Value things are ambiently exported if they are "declare"d
`${parent} > :matches(${[
utils_1.AST_NODE_TYPES.ClassDeclaration,
utils_1.AST_NODE_TYPES.TSDeclareFunction,
utils_1.AST_NODE_TYPES.TSEnumDeclaration,
utils_1.AST_NODE_TYPES.TSModuleDeclaration,
utils_1.AST_NODE_TYPES.VariableDeclaration,
].join(', ')})`,
].join(', ');
}
function markDeclarationChildAsUsed(node) {
const identifiers = [];
switch (node.type) {
case utils_1.AST_NODE_TYPES.TSInterfaceDeclaration:
case utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration:
case utils_1.AST_NODE_TYPES.ClassDeclaration:
case utils_1.AST_NODE_TYPES.FunctionDeclaration:
case utils_1.AST_NODE_TYPES.TSDeclareFunction:
case utils_1.AST_NODE_TYPES.TSEnumDeclaration:
case utils_1.AST_NODE_TYPES.TSModuleDeclaration:
if (node.id?.type === utils_1.AST_NODE_TYPES.Identifier) {
identifiers.push(node.id);
}
break;
case utils_1.AST_NODE_TYPES.VariableDeclaration:
for (const declaration of node.declarations) {
visitPattern(declaration, pattern => {
identifiers.push(pattern);
});
}
break;
}
let scope = context.sourceCode.getScope(node);
const shouldUseUpperScope = [
utils_1.AST_NODE_TYPES.TSDeclareFunction,
utils_1.AST_NODE_TYPES.TSModuleDeclaration,
].includes(node.type);
if (scope.variableScope !== scope) {
scope = scope.variableScope;
}
else if (shouldUseUpperScope && scope.upper) {
scope = scope.upper;
}
for (const id of identifiers) {
const superVar = scope.set.get(id.name);
if (superVar) {
superVar.eslintUsed = true;
}
}
}
function visitPattern(node, cb) {
const visitor = new scope_manager_1.PatternVisitor({}, node, cb);
visitor.visit(node);
}
},
});
function hasOverridingExportStatement(body) {
for (const statement of body) {
if ((statement.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration &&
statement.declaration == null) ||
statement.type === utils_1.AST_NODE_TYPES.ExportAllDeclaration ||
statement.type === utils_1.AST_NODE_TYPES.TSExportAssignment) {
return true;
}
if (statement.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration &&
statement.declaration.type === utils_1.AST_NODE_TYPES.Identifier) {
return true;
}
}
return false;
}
function getStatementsOfNode(block) {
if (block.type === utils_1.AST_NODE_TYPES.Program) {
return block.body;
}
return block.body.body;
}
/*
###### TODO ######
Edge cases that aren't currently handled due to laziness and them being super edgy edge cases
--- function params referenced in typeof type refs in the function declaration ---
--- NOTE - TS gets these cases wrong
function _foo(
arg: number // arg should be unused
): typeof arg {
return 1 as any;
}
function _bar(
arg: number, // arg should be unused
_arg2: typeof arg,
) {}
--- function names referenced in typeof type refs in the function declaration ---
--- NOTE - TS gets these cases right
function foo( // foo should be unused
): typeof foo {
return 1 as any;
}
function bar( // bar should be unused
_arg: typeof bar
) {}
--- if an interface is merged into a namespace ---
--- NOTE - TS gets these cases wrong
namespace Test {
interface Foo { // Foo should be unused here
a: string;
}
export namespace Foo {
export type T = 'b';
}
}
type T = Test.Foo; // Error: Namespace 'Test' has no exported member 'Foo'.
namespace Test {
export interface Foo {
a: string;
}
namespace Foo { // Foo should be unused here
export type T = 'b';
}
}
type T = Test.Foo.T; // Error: Namespace 'Test' has no exported member 'Foo'.
---
These cases are mishandled because the base rule assumes that each variable has one def, but type-value shadowing
creates a variable with two defs
--- type-only or value-only references to type/value shadowed variables ---
--- NOTE - TS gets these cases wrong
type T = 1;
const T = 2; // this T should be unused
type U = T; // this U should be unused
const U = 3;
const _V = U;
--- partially exported type/value shadowed variables ---
--- NOTE - TS gets these cases wrong
export interface Foo {}
const Foo = 1; // this Foo should be unused
interface Bar {} // this Bar should be unused
export const Bar = 1;
*/
@@ -0,0 +1 @@
{"version":3,"file":"ResolutionContext.js","sourceRoot":"","sources":["../../../../src/resolution/models/ResolutionContext.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
'use strict';
var $Iterator = require('../Iterator/polyfill')();
module.exports = $Iterator;
@@ -0,0 +1,3 @@
# `@swc/core-linux-x64-gnu`
This is the **x86_64-unknown-linux-gnu** binary for `@swc/core`
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('isUndefined', require('../isUndefined'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,274 @@
import {AriaSliderThumbProps} from '@react-types/slider';
import {clamp, focusWithoutScrolling, mergeProps, useFormReset, useGlobalListeners} from '@react-aria/utils';
import {DOMAttributes, RefObject} from '@react-types/shared';
import {getSliderThumbId, sliderData} from './utils';
import React, {ChangeEvent, InputHTMLAttributes, LabelHTMLAttributes, useCallback, useEffect, useRef} from 'react';
import {SliderState} from '@react-stately/slider';
import {useFocusable} from '@react-aria/focus';
import {useKeyboard, useMove} from '@react-aria/interactions';
import {useLabel} from '@react-aria/label';
import {useLocale} from '@react-aria/i18n';
export interface SliderThumbAria {
/** Props for the root thumb element; handles the dragging motion. */
thumbProps: DOMAttributes,
/** Props for the visually hidden range input element. */
inputProps: InputHTMLAttributes<HTMLInputElement>,
/** Props for the label element for this thumb (optional). */
labelProps: LabelHTMLAttributes<HTMLLabelElement>,
/** Whether this thumb is currently being dragged. */
isDragging: boolean,
/** Whether the thumb is currently focused. */
isFocused: boolean,
/** Whether the thumb is disabled. */
isDisabled: boolean
}
export interface AriaSliderThumbOptions extends AriaSliderThumbProps {
/** A ref to the track element. */
trackRef: RefObject<Element | null>,
/** A ref to the thumb input element. */
inputRef: RefObject<HTMLInputElement | null>
}
/**
* Provides behavior and accessibility for a thumb of a slider component.
*
* @param opts Options for this Slider thumb.
* @param state Slider state, created via `useSliderState`.
*/
export function useSliderThumb(
opts: AriaSliderThumbOptions,
state: SliderState
): SliderThumbAria {
let {
index = 0,
isRequired,
validationState,
isInvalid,
trackRef,
inputRef,
orientation = state.orientation,
name
} = opts;
let isDisabled = opts.isDisabled || state.isDisabled;
let isVertical = orientation === 'vertical';
let {direction} = useLocale();
let {addGlobalListener, removeGlobalListener} = useGlobalListeners();
let data = sliderData.get(state)!;
const {labelProps, fieldProps} = useLabel({
...opts,
id: getSliderThumbId(state, index),
'aria-labelledby': `${data.id} ${opts['aria-labelledby'] ?? ''}`.trim()
});
const value = state.values[index];
const focusInput = useCallback(() => {
if (inputRef.current) {
focusWithoutScrolling(inputRef.current);
}
}, [inputRef]);
const isFocused = state.focusedThumb === index;
useEffect(() => {
if (isFocused) {
focusInput();
}
}, [isFocused, focusInput]);
let reverseX = direction === 'rtl';
let currentPosition = useRef<number>(null);
let {keyboardProps} = useKeyboard({
onKeyDown(e) {
let {
getThumbMaxValue,
getThumbMinValue,
decrementThumb,
incrementThumb,
setThumbValue,
setThumbDragging,
pageSize
} = state;
// these are the cases that useMove or useSlider don't handle
if (!/^(PageUp|PageDown|Home|End)$/.test(e.key)) {
e.continuePropagation();
return;
}
// same handling as useMove, stopPropagation to prevent useSlider from handling the event as well.
e.preventDefault();
// remember to set this so that onChangeEnd is fired
setThumbDragging(index, true);
switch (e.key) {
case 'PageUp':
incrementThumb(index, pageSize);
break;
case 'PageDown':
decrementThumb(index, pageSize);
break;
case 'Home':
setThumbValue(index, getThumbMinValue(index));
break;
case 'End':
setThumbValue(index, getThumbMaxValue(index));
break;
}
setThumbDragging(index, false);
}
});
let {moveProps} = useMove({
onMoveStart() {
currentPosition.current = null;
state.setThumbDragging(index, true);
},
onMove({deltaX, deltaY, pointerType, shiftKey}) {
const {
getThumbPercent,
setThumbPercent,
decrementThumb,
incrementThumb,
step,
pageSize
} = state;
if (!trackRef.current) {
return;
}
let {width, height} = trackRef.current.getBoundingClientRect();
let size = isVertical ? height : width;
if (currentPosition.current == null) {
currentPosition.current = getThumbPercent(index) * size;
}
if (pointerType === 'keyboard') {
if ((deltaX > 0 && reverseX) || (deltaX < 0 && !reverseX) || deltaY > 0) {
decrementThumb(index, shiftKey ? pageSize : step);
} else {
incrementThumb(index, shiftKey ? pageSize : step);
}
} else {
let delta = isVertical ? deltaY : deltaX;
if (isVertical || reverseX) {
delta = -delta;
}
currentPosition.current += delta;
setThumbPercent(index, clamp(currentPosition.current / size, 0, 1));
}
},
onMoveEnd() {
state.setThumbDragging(index, false);
}
});
// Immediately register editability with the state
state.setThumbEditable(index, !isDisabled);
const {focusableProps} = useFocusable(
mergeProps(opts, {
onFocus: () => state.setFocusedThumb(index),
onBlur: () => state.setFocusedThumb(undefined)
}),
inputRef
);
let currentPointer = useRef<number | undefined>(undefined);
let onDown = (id?: number) => {
focusInput();
currentPointer.current = id;
state.setThumbDragging(index, true);
addGlobalListener(window, 'mouseup', onUp, false);
addGlobalListener(window, 'touchend', onUp, false);
addGlobalListener(window, 'pointerup', onUp, false);
};
let onUp = (e) => {
let id = e.pointerId ?? e.changedTouches?.[0].identifier;
if (id === currentPointer.current) {
focusInput();
state.setThumbDragging(index, false);
removeGlobalListener(window, 'mouseup', onUp, false);
removeGlobalListener(window, 'touchend', onUp, false);
removeGlobalListener(window, 'pointerup', onUp, false);
}
};
let thumbPosition = state.getThumbPercent(index);
if (isVertical || direction === 'rtl') {
thumbPosition = 1 - thumbPosition;
}
let interactions = !isDisabled ? mergeProps(
keyboardProps,
moveProps,
{
onMouseDown: (e: React.MouseEvent) => {
if (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey) {
return;
}
onDown();
},
onPointerDown: (e: React.PointerEvent) => {
if (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey) {
return;
}
onDown(e.pointerId);
},
onTouchStart: (e: React.TouchEvent) => {onDown(e.changedTouches[0].identifier);}
}
) : {};
useFormReset(inputRef, value, (v) => {
state.setThumbValue(index, v);
});
// We install mouse handlers for the drag motion on the thumb div, but
// not the key handler for moving the thumb with the slider. Instead,
// we focus the range input, and let the browser handle the keyboard
// interactions; we then listen to input's onChange to update state.
return {
inputProps: mergeProps(focusableProps, fieldProps, {
type: 'range',
tabIndex: !isDisabled ? 0 : undefined,
min: state.getThumbMinValue(index),
max: state.getThumbMaxValue(index),
step: state.step,
value: value,
name,
disabled: isDisabled,
'aria-orientation': orientation,
'aria-valuetext': state.getThumbValueLabel(index),
'aria-required': isRequired || undefined,
'aria-invalid': isInvalid || validationState === 'invalid' || undefined,
'aria-errormessage': opts['aria-errormessage'],
'aria-describedby': [data['aria-describedby'], opts['aria-describedby']].filter(Boolean).join(' '),
'aria-details': [data['aria-details'], opts['aria-details']].filter(Boolean).join(' '),
onChange: (e: ChangeEvent<HTMLInputElement>) => {
state.setThumbValue(index, parseFloat(e.target.value));
}
}),
thumbProps: {
...interactions,
style: {
position: 'absolute',
[isVertical ? 'top' : 'left']: `${thumbPosition * 100}%`,
transform: 'translate(-50%, -50%)',
touchAction: 'none'
}
},
labelProps,
isDragging: state.isThumbDragging(index),
isDisabled,
isFocused
};
}
@@ -0,0 +1,7 @@
"use client";
import {
useAccordionItem
} from "./chunk-S4YBHMUB.mjs";
export {
useAccordionItem
};
@@ -0,0 +1,37 @@
{
"name": "@react-stately/tabs",
"version": "3.7.0",
"description": "Spectrum UI components in React",
"license": "Apache-2.0",
"main": "dist/main.js",
"module": "dist/module.js",
"exports": {
"types": "./dist/types.d.ts",
"import": "./dist/import.mjs",
"require": "./dist/main.js"
},
"types": "dist/types.d.ts",
"source": "src/index.ts",
"files": [
"dist",
"src"
],
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/adobe/react-spectrum"
},
"dependencies": {
"@react-stately/list": "^3.11.1",
"@react-types/shared": "^3.26.0",
"@react-types/tabs": "^3.3.11",
"@swc/helpers": "^0.5.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
},
"publishConfig": {
"access": "public"
},
"gitHead": "71f0ef23053f9e03ee7e97df736e8b083e006849"
}
@@ -0,0 +1,14 @@
/**
* DON'T EDIT THIS FILE.
* This file was generated by "scripts/update-lib-configs.js" script.
*/
"use strict"
module.exports = {
extends: [
require.resolve("./no-new-in-es2023"),
require.resolve("./no-new-in-es2022"),
require.resolve("./no-new-in-es2021"),
require.resolve("./no-new-in-es2020"),
],
}
@@ -0,0 +1,31 @@
import React from "react";
import Dropzone from "../../";
export class Events extends React.Component {
render() {
return (
<section>
<div className="dropzone">
<Dropzone
onDrop={(acceptedFiles, fileRejections, event) =>
console.log(acceptedFiles, fileRejections, event)
}
onDragEnter={(event) => console.log(event)}
onDragOver={(event) => console.log(event)}
onDragLeave={(event) => console.log(event)}
>
{({ getRootProps, getInputProps }) => (
<div {...getRootProps()}>
<input {...getInputProps()} />
<p>
Try dropping some files here, or click to select files to
upload.
</p>
</div>
)}
</Dropzone>
</div>
</section>
);
}
}
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from './types.js';
import 'react';
declare const ArrowRightIcon: ({ strokeWidth, ...otherProps }: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { ArrowRightIcon };
@@ -0,0 +1,55 @@
// Bulgarian [bg]
import dayjs from '../index';
var locale = {
name: 'bg',
weekdays: 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),
weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),
monthsShort: 'яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
weekStart: 1,
ordinal: function ordinal(n) {
var last2Digits = n % 100;
if (last2Digits > 10 && last2Digits < 20) {
return n + "-\u0442\u0438";
}
var lastDigit = n % 10;
if (lastDigit === 1) {
return n + "-\u0432\u0438";
} else if (lastDigit === 2) {
return n + "-\u0440\u0438";
} else if (lastDigit === 7 || lastDigit === 8) {
return n + "-\u043C\u0438";
}
return n + "-\u0442\u0438";
},
formats: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'D.MM.YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY H:mm',
LLLL: 'dddd, D MMMM YYYY H:mm'
},
relativeTime: {
future: 'след %s',
past: 'преди %s',
s: 'няколко секунди',
m: 'минута',
mm: '%d минути',
h: 'час',
hh: '%d часа',
d: 'ден',
dd: '%d дена',
M: 'месец',
MM: '%d месеца',
y: 'година',
yy: '%d години'
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,181 @@
/**
* @fileoverview Rule to disallow use of Object.prototype builtins on objects
* @author Andrew Levine
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Returns true if the node or any of the objects
* to the left of it in the member/call chain is optional.
*
* e.g. `a?.b`, `a?.b.c`, `a?.()`, `a()?.()`
* @param {ASTNode} node The expression to check
* @returns {boolean} `true` if there is a short-circuiting optional `?.`
* in the same option chain to the left of this call or member expression,
* or the node itself is an optional call or member `?.`.
*/
function isAfterOptional(node) {
let leftNode;
if (node.type === "MemberExpression") {
leftNode = node.object;
} else if (node.type === "CallExpression") {
leftNode = node.callee;
} else {
return false;
}
if (node.optional) {
return true;
}
return isAfterOptional(leftNode);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
docs: {
description:
"Disallow calling some `Object.prototype` methods directly on objects",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-prototype-builtins",
},
hasSuggestions: true,
schema: [],
messages: {
prototypeBuildIn:
"Do not access Object.prototype method '{{prop}}' from target object.",
callObjectPrototype: "Call Object.prototype.{{prop}} explicitly.",
},
},
create(context) {
const DISALLOWED_PROPS = new Set([
"hasOwnProperty",
"isPrototypeOf",
"propertyIsEnumerable",
]);
/**
* Reports if a disallowed property is used in a CallExpression
* @param {ASTNode} node The CallExpression node.
* @returns {void}
*/
function disallowBuiltIns(node) {
const callee = astUtils.skipChainExpression(node.callee);
if (callee.type !== "MemberExpression") {
return;
}
const propName = astUtils.getStaticPropertyName(callee);
if (propName !== null && DISALLOWED_PROPS.has(propName)) {
context.report({
messageId: "prototypeBuildIn",
loc: callee.property.loc,
data: { prop: propName },
node,
suggest: [
{
messageId: "callObjectPrototype",
data: { prop: propName },
fix(fixer) {
const sourceCode = context.sourceCode;
/*
* A call after an optional chain (e.g. a?.b.hasOwnProperty(c))
* must be fixed manually because the call can be short-circuited
*/
if (isAfterOptional(node)) {
return null;
}
/*
* A call on a ChainExpression (e.g. (a?.hasOwnProperty)(c)) will trigger
* no-unsafe-optional-chaining which should be fixed before this suggestion
*/
if (node.callee.type === "ChainExpression") {
return null;
}
const objectVariable =
astUtils.getVariableByName(
sourceCode.getScope(node),
"Object",
);
/*
* We can't use Object if the global Object was shadowed,
* or Object does not exist in the global scope for some reason
*/
if (
!objectVariable ||
objectVariable.scope.type !== "global" ||
objectVariable.defs.length > 0
) {
return null;
}
let objectText = sourceCode.getText(
callee.object,
);
if (
astUtils.getPrecedence(callee.object) <=
astUtils.getPrecedence({
type: "SequenceExpression",
})
) {
objectText = `(${objectText})`;
}
const openParenToken = sourceCode.getTokenAfter(
node.callee,
astUtils.isOpeningParenToken,
);
const isEmptyParameters =
node.arguments.length === 0;
const delim = isEmptyParameters ? "" : ", ";
const fixes = [
fixer.replaceText(
callee,
`Object.prototype.${propName}.call`,
),
fixer.insertTextAfter(
openParenToken,
objectText + delim,
),
];
return fixes;
},
},
],
});
}
}
return {
CallExpression: disallowBuiltIns,
};
},
};
@@ -0,0 +1,4 @@
declare const useInterval: (fn: () => void, delay?: number, options?: {
immediate?: boolean;
}) => () => void;
export default useInterval;
@@ -0,0 +1,48 @@
var $f4V3v$intlmessageformat = require("intl-messageformat");
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "MessageFormatter", () => $7a31ee9993c13f0b$export$526ebc05ff964723);
/*
* 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.
*/
class $7a31ee9993c13f0b$export$526ebc05ff964723 {
format(key, variables) {
let message = this.cache[key];
if (!message) {
let msg = this.messages.getStringForLocale(key, this.locale);
if (!msg) throw new Error(`Could not find intl message ${key} in ${this.locale} locale`);
message = new (0, ($parcel$interopDefault($f4V3v$intlmessageformat)))(msg, this.locale);
this.cache[key] = message;
}
let varCopy;
if (variables) varCopy = Object.keys(variables).reduce((acc, key)=>{
acc[key] = variables[key] == null ? false : variables[key];
return acc;
}, {});
return message.format(varCopy);
}
constructor(locale, messages){
this.locale = locale;
this.messages = messages;
this.cache = {};
}
}
//# sourceMappingURL=MessageFormatter.main.js.map
@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const fsStat = require("@nodelib/fs.stat");
const utils = require("../utils");
class Reader {
constructor(_settings) {
this._settings = _settings;
this._fsStatSettings = new fsStat.Settings({
followSymbolicLink: this._settings.followSymbolicLinks,
fs: this._settings.fs,
throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
});
}
_getFullEntryPath(filepath) {
return path.resolve(this._settings.cwd, filepath);
}
_makeEntry(stats, pattern) {
const entry = {
name: pattern,
path: pattern,
dirent: utils.fs.createDirentFromStats(pattern, stats)
};
if (this._settings.stats) {
entry.stats = stats;
}
return entry;
}
_isFatalError(error) {
return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
}
}
exports.default = Reader;
@@ -0,0 +1,491 @@
# body-parser
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Build Status][ci-image]][ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]
[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer]
Node.js body parsing middleware.
Parse incoming request bodies in a middleware before your handlers, available
under the `req.body` property.
**Note** As `req.body`'s shape is based on user-controlled input, all
properties and values in this object are untrusted and should be validated
before trusting. For example, `req.body.foo.toString()` may fail in multiple
ways, for example the `foo` property may not be there or may not be a string,
and `toString` may not be a function and instead a string or other user input.
[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/).
_This does not handle multipart bodies_, due to their complex and typically
large nature. For multipart bodies, you may be interested in the following
modules:
* [busboy](https://www.npmjs.org/package/busboy#readme) and
[connect-busboy](https://www.npmjs.org/package/connect-busboy#readme)
* [multiparty](https://www.npmjs.org/package/multiparty#readme) and
[connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme)
* [formidable](https://www.npmjs.org/package/formidable#readme)
* [multer](https://www.npmjs.org/package/multer#readme)
This module provides the following parsers:
* [JSON body parser](#bodyparserjsonoptions)
* [Raw body parser](#bodyparserrawoptions)
* [Text body parser](#bodyparsertextoptions)
* [URL-encoded form body parser](#bodyparserurlencodedoptions)
Other body parsers you might be interested in:
- [body](https://www.npmjs.org/package/body#readme)
- [co-body](https://www.npmjs.org/package/co-body#readme)
## Installation
```sh
$ npm install body-parser
```
## API
```js
const bodyParser = require('body-parser')
```
The `bodyParser` object exposes various factories to create middlewares. All
middlewares will populate the `req.body` property with the parsed body when
the `Content-Type` request header matches the `type` option.
The various errors returned by this module are described in the
[errors section](#errors).
### bodyParser.json([options])
Returns middleware that only parses `json` and only looks at requests where
the `Content-Type` header matches the `type` option. This parser accepts any
Unicode encoding of the body and supports automatic inflation of `gzip`,
`br` (brotli) and `deflate` encodings.
A new `body` object containing the parsed data is populated on the `request`
object after the middleware (i.e. `req.body`).
#### Options
The `json` function takes an optional `options` object that may contain any of
the following keys:
##### inflate
When set to `true`, then deflated (compressed) bodies will be inflated; when
`false`, deflated bodies are rejected. Defaults to `true`.
##### limit
Controls the maximum request body size. If this is a number, then the value
specifies the number of bytes; if it is a string, the value is passed to the
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
to `'100kb'`.
##### reviver
The `reviver` option is passed directly to `JSON.parse` as the second
argument. You can find more information on this argument
[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter).
##### strict
When set to `true`, will only accept arrays and objects; when `false` will
accept anything `JSON.parse` accepts. Defaults to `true`.
##### type
The `type` option is used to determine what media type the middleware will
parse. This option can be a string, array of strings, or a function. If not a
function, `type` option is passed directly to the
[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
be an extension name (like `json`), a mime type (like `application/json`), or
a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type`
option is called as `fn(req)` and the request is parsed if it returns a truthy
value. Defaults to `application/json`.
##### verify
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
where `buf` is a `Buffer` of the raw request body and `encoding` is the
encoding of the request. The parsing can be aborted by throwing an error.
### bodyParser.raw([options])
Returns middleware that parses all bodies as a `Buffer` and only looks at
requests where the `Content-Type` header matches the `type` option. This
parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate`
encodings.
A new `body` object containing the parsed data is populated on the `request`
object after the middleware (i.e. `req.body`). This will be a `Buffer` object
of the body.
#### Options
The `raw` function takes an optional `options` object that may contain any of
the following keys:
##### inflate
When set to `true`, then deflated (compressed) bodies will be inflated; when
`false`, deflated bodies are rejected. Defaults to `true`.
##### limit
Controls the maximum request body size. If this is a number, then the value
specifies the number of bytes; if it is a string, the value is passed to the
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
to `'100kb'`.
##### type
The `type` option is used to determine what media type the middleware will
parse. This option can be a string, array of strings, or a function.
If not a function, `type` option is passed directly to the
[type-is](https://www.npmjs.org/package/type-is#readme) library and this
can be an extension name (like `bin`), a mime type (like
`application/octet-stream`), or a mime type with a wildcard (like `*/*` or
`application/*`). If a function, the `type` option is called as `fn(req)`
and the request is parsed if it returns a truthy value. Defaults to
`application/octet-stream`.
##### verify
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
where `buf` is a `Buffer` of the raw request body and `encoding` is the
encoding of the request. The parsing can be aborted by throwing an error.
### bodyParser.text([options])
Returns middleware that parses all bodies as a string and only looks at
requests where the `Content-Type` header matches the `type` option. This
parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate`
encodings.
A new `body` string containing the parsed data is populated on the `request`
object after the middleware (i.e. `req.body`). This will be a string of the
body.
#### Options
The `text` function takes an optional `options` object that may contain any of
the following keys:
##### defaultCharset
Specify the default character set for the text content if the charset is not
specified in the `Content-Type` header of the request. Defaults to `utf-8`.
##### inflate
When set to `true`, then deflated (compressed) bodies will be inflated; when
`false`, deflated bodies are rejected. Defaults to `true`.
##### limit
Controls the maximum request body size. If this is a number, then the value
specifies the number of bytes; if it is a string, the value is passed to the
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
to `'100kb'`.
##### type
The `type` option is used to determine what media type the middleware will
parse. This option can be a string, array of strings, or a function. If not
a function, `type` option is passed directly to the
[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
be an extension name (like `txt`), a mime type (like `text/plain`), or a mime
type with a wildcard (like `*/*` or `text/*`). If a function, the `type`
option is called as `fn(req)` and the request is parsed if it returns a
truthy value. Defaults to `text/plain`.
##### verify
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
where `buf` is a `Buffer` of the raw request body and `encoding` is the
encoding of the request. The parsing can be aborted by throwing an error.
### bodyParser.urlencoded([options])
Returns middleware that only parses `urlencoded` bodies and only looks at
requests where the `Content-Type` header matches the `type` option. This
parser accepts only UTF-8 encoding of the body and supports automatic
inflation of `gzip`, `br` (brotli) and `deflate` encodings.
A new `body` object containing the parsed data is populated on the `request`
object after the middleware (i.e. `req.body`). This object will contain
key-value pairs, where the value can be a string or array (when `extended` is
`false`), or any type (when `extended` is `true`).
#### Options
The `urlencoded` function takes an optional `options` object that may contain
any of the following keys:
##### extended
The "extended" syntax allows for rich objects and arrays to be encoded into the
URL-encoded format, allowing for a JSON-like experience with URL-encoded. For
more information, please [see the qs
library](https://www.npmjs.org/package/qs#readme).
Defaults to `false`.
##### inflate
When set to `true`, then deflated (compressed) bodies will be inflated; when
`false`, deflated bodies are rejected. Defaults to `true`.
##### limit
Controls the maximum request body size. If this is a number, then the value
specifies the number of bytes; if it is a string, the value is passed to the
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
to `'100kb'`.
##### parameterLimit
The `parameterLimit` option controls the maximum number of parameters that
are allowed in the URL-encoded data. If a request contains more parameters
than this value, a 413 will be returned to the client. Defaults to `1000`.
##### type
The `type` option is used to determine what media type the middleware will
parse. This option can be a string, array of strings, or a function. If not
a function, `type` option is passed directly to the
[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
be an extension name (like `urlencoded`), a mime type (like
`application/x-www-form-urlencoded`), or a mime type with a wildcard (like
`*/x-www-form-urlencoded`). If a function, the `type` option is called as
`fn(req)` and the request is parsed if it returns a truthy value. Defaults
to `application/x-www-form-urlencoded`.
##### verify
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
where `buf` is a `Buffer` of the raw request body and `encoding` is the
encoding of the request. The parsing can be aborted by throwing an error.
##### defaultCharset
The default charset to parse as, if not specified in content-type. Must be
either `utf-8` or `iso-8859-1`. Defaults to `utf-8`.
##### charsetSentinel
Whether to let the value of the `utf8` parameter take precedence as the charset
selector. It requires the form to contain a parameter named `utf8` with a value
of `✓`. Defaults to `false`.
##### interpretNumericEntities
Whether to decode numeric entities such as `&#9786;` when parsing an iso-8859-1
form. Defaults to `false`.
#### depth
The `depth` option is used to configure the maximum depth of the `qs` library when `extended` is `true`. This allows you to limit the amount of keys that are parsed and can be useful to prevent certain types of abuse. Defaults to `32`. It is recommended to keep this value as low as possible.
## Errors
The middlewares provided by this module create errors using the
[`http-errors` module](https://www.npmjs.com/package/http-errors). The errors
will typically have a `status`/`statusCode` property that contains the suggested
HTTP response code, an `expose` property to determine if the `message` property
should be displayed to the client, a `type` property to determine the type of
error without matching against the `message`, and a `body` property containing
the read body, if available.
The following are the common errors created, though any error can come through
for various reasons.
### content encoding unsupported
This error will occur when the request had a `Content-Encoding` header that
contained an encoding but the "inflation" option was set to `false`. The
`status` property is set to `415`, the `type` property is set to
`'encoding.unsupported'`, and the `charset` property will be set to the
encoding that is unsupported.
### entity parse failed
This error will occur when the request contained an entity that could not be
parsed by the middleware. The `status` property is set to `400`, the `type`
property is set to `'entity.parse.failed'`, and the `body` property is set to
the entity value that failed parsing.
### entity verify failed
This error will occur when the request contained an entity that could not be
failed verification by the defined `verify` option. The `status` property is
set to `403`, the `type` property is set to `'entity.verify.failed'`, and the
`body` property is set to the entity value that failed verification.
### request aborted
This error will occur when the request is aborted by the client before reading
the body has finished. The `received` property will be set to the number of
bytes received before the request was aborted and the `expected` property is
set to the number of expected bytes. The `status` property is set to `400`
and `type` property is set to `'request.aborted'`.
### request entity too large
This error will occur when the request body's size is larger than the "limit"
option. The `limit` property will be set to the byte limit and the `length`
property will be set to the request body's length. The `status` property is
set to `413` and the `type` property is set to `'entity.too.large'`.
### request size did not match content length
This error will occur when the request's length did not match the length from
the `Content-Length` header. This typically occurs when the request is malformed,
typically when the `Content-Length` header was calculated based on characters
instead of bytes. The `status` property is set to `400` and the `type` property
is set to `'request.size.invalid'`.
### stream encoding should not be set
This error will occur when something called the `req.setEncoding` method prior
to this middleware. This module operates directly on bytes only and you cannot
call `req.setEncoding` when using this module. The `status` property is set to
`500` and the `type` property is set to `'stream.encoding.set'`.
### stream is not readable
This error will occur when the request is no longer readable when this middleware
attempts to read it. This typically means something other than a middleware from
this module read the request body already and the middleware was also configured to
read the same request. The `status` property is set to `500` and the `type`
property is set to `'stream.not.readable'`.
### too many parameters
This error will occur when the content of the request exceeds the configured
`parameterLimit` for the `urlencoded` parser. The `status` property is set to
`413` and the `type` property is set to `'parameters.too.many'`.
### unsupported charset "BOGUS"
This error will occur when the request had a charset parameter in the
`Content-Type` header, but the `iconv-lite` module does not support it OR the
parser does not support it. The charset is contained in the message as well
as in the `charset` property. The `status` property is set to `415`, the
`type` property is set to `'charset.unsupported'`, and the `charset` property
is set to the charset that is unsupported.
### unsupported content encoding "bogus"
This error will occur when the request had a `Content-Encoding` header that
contained an unsupported encoding. The encoding is contained in the message
as well as in the `encoding` property. The `status` property is set to `415`,
the `type` property is set to `'encoding.unsupported'`, and the `encoding`
property is set to the encoding that is unsupported.
### The input exceeded the depth
This error occurs when using `bodyParser.urlencoded` with the `extended` property set to `true` and the input exceeds the configured `depth` option. The `status` property is set to `400`. It is recommended to review the `depth` option and evaluate if it requires a higher value. When the `depth` option is set to `32` (default value), the error will not be thrown.
## Examples
### Express/Connect top-level generic
This example demonstrates adding a generic JSON and URL-encoded parser as a
top-level middleware, which will parse the bodies of all incoming requests.
This is the simplest setup.
```js
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded())
// parse application/json
app.use(bodyParser.json())
app.use(function (req, res) {
res.setHeader('Content-Type', 'text/plain')
res.write('you posted:\n')
res.end(String(JSON.stringify(req.body, null, 2)))
})
```
### Express route-specific
This example demonstrates adding body parsers specifically to the routes that
need them. In general, this is the most recommended way to use body-parser with
Express.
```js
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
// create application/json parser
const jsonParser = bodyParser.json()
// create application/x-www-form-urlencoded parser
const urlencodedParser = bodyParser.urlencoded()
// POST /login gets urlencoded bodies
app.post('/login', urlencodedParser, function (req, res) {
if (!req.body || !req.body.username) res.sendStatus(400)
res.send('welcome, ' + req.body.username)
})
// POST /api/users gets JSON bodies
app.post('/api/users', jsonParser, function (req, res) {
if (!req.body) res.sendStatus(400)
// create user in req.body
})
```
### Change accepted type for parsers
All the parsers accept a `type` option which allows you to change the
`Content-Type` that the middleware will parse.
```js
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
// parse various different custom JSON types as JSON
app.use(bodyParser.json({ type: 'application/*+json' }))
// parse some custom thing into a Buffer
app.use(bodyParser.raw({ type: 'application/vnd.custom-type' }))
// parse an HTML body into a string
app.use(bodyParser.text({ type: 'text/html' }))
```
## License
[MIT](LICENSE)
[ci-image]: https://badgen.net/github/checks/expressjs/body-parser/master?label=ci
[ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml
[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/body-parser/master
[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master
[node-version-image]: https://badgen.net/npm/node/body-parser
[node-version-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/body-parser
[npm-url]: https://npmjs.org/package/body-parser
[npm-version-image]: https://badgen.net/npm/v/body-parser
[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/body-parser/badge
[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/body-parser
@@ -0,0 +1,315 @@
flf2a$ 3 2 8 -1 8
Short and sweet by Sub-Zero (bodom@ugly.ucs.indiana.edu)
Completed and ported to figlet by Juan Car (jc@juguete.quim.ucm.es)
Improved again by Sub-Zero
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$$@
$$@
$$@@
|@
.@
@@
''@
@
@@
||@
||@
@@
(|`@
_|)@
@@
o/@
/o@
@@
()@
(X@
@@
,@
@
@@
/@
\@
@@
\@
/@
@@
\|/@
/|\@
@@
_|_@
| @
@@
@
,@
@@
__@
@
@@
@
.@
@@
/@
/ @
@@
/\@
\/@
@@
'| @
_|_@
@@
')@
/_@
@@
')@
.)@
@@
/| @
~|~@
@@
|~@
_)@
@@
/ @
(_)@
@@
~/@
/ @
@@
(~)@
(_)@
@@
(~)@
/ @
@@
.@
.@
@@
.@
/@
@@
/@
\@
@@
_@
-@
@@
\@
/@
@@
~)@
| @
@@
_ @
(\)@
~~@@
/|@
/-|@
@@
|)@
|)@
@@
/`@
\,@
@@
|\@
|/@
@@
[~@
[_@
@@
[~@
| @
@@
/~ @
\_|@
@@
|_|@
| |@
@@
|@
|@
@@
|@
_|@
@@
|/@
|\@
@@
| @
|_@
@@
|\/|@
| |@
@@
|\ |@
| \|@
@@
/\@
\/@
@@
|)@
| @
@@
/\@
\X@
@@
|)@
|\@
@@
(`@
_)@
@@
~|~@
| @
@@
| |@
|_|@
@@
| /@
|/ @
@@
| | |@
\|\|@
@@
\/@
/\@
@@
\ /@
| @
@@
~/@
/_@
@@
|~@
|_@
@@
\ @
\@
@@
~|@
_|@
@@
/\@
@
@@
@
__@
@@
\@
@
@@
@
(|@
@@
| @
|)@
@@
_@
(_@
@@
|@
(|@
@@
_ @
(/_@
@@
[`@
|$@
@@
@
(|@
_|@@
|_@
||@
@@
.@
|@
@@
.@
|@
_|@@
| @
|<@
@@
|@
|@
@@
,_ @
|||@
@@
,_@
||@
@@
@
()@
@@
@
|)@
| @@
@
(|@
|@@
@
|`@
@@
_@
_\@
@@
|-@
|_@
@@
@
L|@
@@
@
\/@
@@
@
LL|@
@@
@
><@
@@
@
\/@
/ @@
_ @
/_@
@@
|~@
< @
|_@@
|@
|@
@@
~|@
>@
_|@@
nu@
@
@@
..@
(|@
@@
..@
()@
@@
..@
L|@
@@
..@
(|@
@@
..@
()@
@@
..@
L|@
@@
|)@
;)@
@@
@@ -0,0 +1,825 @@
flf2a$ 8 7 20 -1 8
ARROWS by Ron Fritz 8/94
Figlet Release 2.0
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
>=>@
>=>@
>=>@
>>$@
>>$@
@
>=>@
@@
>> >>@
>> >>@
@
@
@
@
@
@@
@
>=> >=>$$$@
>=====>>===>$@
>=> >=>$$$@
>=> >=>$$$@
>=====>>===>$@
>=> >=>$$$@
@@
>=> $@
>=>>=>$@
>=> $@
>=> $@
>=> $@
>=>>==>$@
>=> $@
@@
@
>=> >=>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> >=>$@
@@
>> $@
>=>>=>$@
>=> $@
>==> $@
>=> $@
>=>>=>$@
>> $@
@@
>=>$@
>>$@
@
@
@
@
@
@@
>=>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=>$@
@@
>=> $@
>=> $@
>=>$@
>=>$@
>=>$@
>=> $@
>=> $@
@@
>=> $@
>> >=> >> $@
> >=> > $@
>===>>=>>===>$@
> >=> > $@
>> >=> >> $@
>=> $@
@@
@
>=> $@
>=> $@
>==> >====>$@
>=> $@
>=> $@
@
@@
@
@
@
@
@
@
>=>$@
>>$@@
@
@
@
>====>$@
@
@
@
@@
@
@
@
@
@
@
>=>$@
@@
>=>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
@@
@
>=> $@
>=> >=> $@
>=> >=> $@
>=> >=>$@
>=> >=> $@
>==> $@
@@
@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>===>$@
@@
@
>=>>=> $@
>> >=>$@
>=> $@
>=> $@
>=> $@
>======>$@
@@
@
>=>>=> $@
>=> $@
>=> $@
>=> $@
>=>$@
>====> $@
@@
@
>=> $@
>>=> $@
> >=> $@
>=> >=> $@
>===>>=>>=>$@
>=> $@
$@@
@
>=>>==> $@
>=> $@
>==> $@
>=> $@
>=>$@
>==>>=> $@
@@
@
>=> $@
>=> $@
>=> $@
>=> >=> $@
>=> >=>$@
>=>>=> $@
@@
@
>====>>=>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
@@
@
>=> $@
>> >=>$@
>> >>$@
>=>>=> $@
>> >>$@
>====> $@
@@
@
>> >=> $@
>=> >=>$@
>> >=>$@
>=> >=> $@
>=> $@
>=> $@
@@
@
@
@
@
>=>$@
$@
>=>$@
@@
@
@
@
@
>=>$@
$@
>=>$@
>>$@@
>=>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=>$@
@@
$@
$@
>=====>$@
$@
>=====>$@
$@
$@
@@
>=> $@
>=> $@
>=> $@
>=>$@
>=> $@
>=> $@
>=> $@
@@
>==> $@
>=> $@
>=>$@
>=> $@
>=> $@
$@
>=> $@
@@
$@
>==> $@
>> >=> $@
>> >=> >=>$@
>=> >==> >=>$@
>=> ``` $@
>=> $@
@@
>> $@
>>=> $@
>> >=> $@
>=> >=> $@
>=====>>=> $@
>=> >=> $@
>=> >=>$@
@@
>=>>=> $@
>> >=> $@
>> >=>$@
>==>>=> $@
>> >=>$@
>> >>$@
>===>>=> $@
@@
>=> $@
>=> >=>$@
>=> $@
>=> $@
>=> $@
>=> >=>$@
>===> $@
@@
>====> $@
>=> >=> $@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> >=> $@
>====> $@
@@
>=======>$@
>=> $@
>=> $@
>=====> $@
>=> $@
>=> $@
>=======>$@
@@
>=======>$@
>=> $@
>=> $@
>=====> $@
>=> $@
>=> $@
>=> $@
@@
>===> $@
>> >=> $@
>=> $@
>=> $@
>=> >===>$@
>=> >> $@
>====> $@
@@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=====>>=>$@
>=> >=>$@
>=> >=>$@
>=> >=>$@
@@
>=>$@
>=>$@
>=>$@
>=>$@
>=>$@
>=>$@
>=>$@
@@
>=>$@
>=>$@
>=>$@
>=>$@
>=>$@
>> >=>$@
>===> $@
@@
>=> >=> $@
>=> >=> $@
>=> >=> $@
>>=>> $@
>=> >=> $@
>=> >=> $@
>=> >=>$@
@@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=======>$@
@@
>=> >=>$@
>> >=> >>=>$@
>=> >=> > >=>$@
>=> >=> >=>$@
>=> >> >=>$@
>=> >=>$@
>=> >=>$@
@@
>==> >=>$@
>> >=> >=>$@
>=> >=> >=>$@
>=> >=>>=>$@
>=> > >=>$@
>=> >>=>$@
>=> >=>$@
@@
>===> $@
>=> >=> $@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> >=> $@
>===> $@
@@
>======> $@
>=> >=>$@
>=> >=>$@
>======> $@
>=> $@
>=> $@
>=> $@
@@
>===> $@
>=> >=> $@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> >> >=> $@
>= >>=> $@
>> @@
>======> $@
>=> >=> $@
>=> >=> $@
>> >==> $@
>=> >=> $@
>=> >=> $@
>=> >=>$@
@@
>=>>=> $@
>=> >=>$@
>=> $@
>=> $@
>=> $@
>=> >=>$@
>=>>=> $@
@@
>===>>=====>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
@@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>====> $@
@@
>=> >=>$@
>=> >=> $@
>=> >=> $@
>=> >=> $@
>=> >=> $@
>===> $@
>=> $@
@@
>=> >=>$@
>=> >=>$@
>=> >> >=>$@
>=> >=> >=>$@
>=> >> >=> >=>$@
>> >> >===>$@
>=> >=>$@
@@
>=> >=>$@
>=> >=> $@
>=> >=> $@
>=> $@
>=> >=> $@
>=> >=> $@
>=> >=>$@
@@
>=> >=>$@
>=> >=> $@
>=> >=> $@
>=> $@
>=> $@
>=> $@
>=> $@
@@
>=======>>=>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>==========>$@
@@
>===>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>===>$@
@@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=>$@
@@
>===>$@
>=>$@
>=>$@
>=>$@
>=>$@
>=>$@
>===>$@
@@
>=> $@
>=> >=> $@
>=> >=>$@
$@
$@
$@
$@
@@
$@
$@
$@
$@
$@
$@
$@
>====>$@@
>=>$@
>> $@
$@
$@
$@
$@
$@
@@
$@
$@
>=> >=> $@
>=> >=> $@
>=> >=> $@
>=> >=> $@
>==>>>==>$@
@@
>=> $@
>=> $@
>=> $@
>=>>==> $@
>=> >=>$@
>=> >=>$@
>=>>==> $@
@@
$@
$@
>==>$@
>=> $@
>=> $@
>=> $@
>==>$@
@@
>=>$@
>=>$@
>=>$@
>=>>=>$@
>> >=>$@
>> >=>$@
>=>>=>$@
@@
$@
$@
>==> $@
>> >=> $@
>>===>>=>$@
>> $@
>====> $@
@@
>=>$@
>> $@
>=>> >>$@
>=> $@
>=> $@
>=> $@
>=> $@
@@
$@
$@
>=> $@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> $@
>=> $@@
$@
>=> $@
>=> $@
>=>>=> $@
>=> >=>$@
>> >=>$@
>=> >=>$@
@@
$@
>>$@
$@
>=>$@
>=>$@
>=>$@
>=>$@
@@
$@
>=>$@
$@
>=>$@
>=>$@
>=>$@
>=>$@
>==> $@@
>=> $@
>=> $@
>=> >=>$@
>=> >=> $@
>=>=> $@
>=> >=> $@
>=> >=>$@
@@
>=>$@
>=>$@
>=>$@
>=>$@
>=>$@
>=>$@
>==>$@
@@
$@
$@
>===>>=>>==> $@
>=> >> >=>$@
>=> >> >=>$@
>=> >> >=>$@
>==> >> >=>$@
@@
$@
$@
>==>>==> $@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>==> >=>$@
@@
$@
$@
>=> $@
>=> >=> $@
>=> >=>$@
>=> >=> $@
>=> $@
@@
$@
$@
>=> >=> $@
>> >=>$@
>> >=>$@
>=> >=> $@
>=> $@
>=> $@@
$@
$@
>=> $@
>> >=> $@
>> >=> $@
>==>=> $@
>=> $@
>==>$@@
$@
$@
>> >==>$@
>=> $@
>=> $@
>=> $@
>==> $@
@@
$@
$@
>===> $@
>=> $@
>==> $@
>=>$@
>=> >=>$@
@@
>=> $@
>=> $@
>=>>==>$@
>=> $@
>=> $@
>=> $@
>=> $@
@@
$@
$@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>==>=>$@
@@
$@
$@
>=> >=>$@
>=> >=> $@
>=> >=> $@
>=>=> $@
>=> $@
@@
$@
$@
>=> >=>$@
>=> > >=>$@
>=> >> >=>$@
>=>> >=>=>$@
>==> >==>$@
@@
$@
$@
>=> >=>$@
>> >=> $@
>> $@
>> >=> $@
>=> >=>$@
@@
$@
$@
>=> >=>$@
>=> >=> $@
>==> $@
>=> $@
>=> $@
>=> $@@
$@
$@
>====>>=>$@
>=> $@
>=> $@
>=> $@
>=======>$@
@@
<=<$@
<=< $@
<=< $@
<=< $@
<=< $@
<=< $@
<=<$@
@@
>>$@
>>$@
>>$@
$@
>>$@
>>$@
>>$@
@@
>=> $@
>=> $@
>=> $@
>=>$@
>=> $@
>=> $@
>=> $@
@@
>=> >> $@
>> >=>$@
$@
$@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@@ -0,0 +1 @@
export { _ as default } from "../esm/_class_private_field_destructure.js";
@@ -0,0 +1,7 @@
import { LazyServiceIdentifier, ServiceIdentifier } from '@inversifyjs/common';
import { ClassElementMetadata } from '../models/ClassElementMetadata';
import { ClassElementMetadataKind } from '../models/ClassElementMetadataKind';
import { MaybeClassElementMetadata } from '../models/MaybeClassElementMetadata';
import { MultiInjectOptions } from '../models/MultiInjectOptions';
export declare const buildManagedMetadataFromMaybeClassElementMetadata: ((kind: ClassElementMetadataKind.singleInjection, serviceIdentifier: ServiceIdentifier | LazyServiceIdentifier) => (metadata: MaybeClassElementMetadata | undefined) => ClassElementMetadata) & ((kind: ClassElementMetadataKind.multipleInjection, serviceIdentifier: ServiceIdentifier | LazyServiceIdentifier, options: MultiInjectOptions | undefined) => (metadata: MaybeClassElementMetadata | undefined) => ClassElementMetadata);
//# sourceMappingURL=buildManagedMetadataFromMaybeClassElementMetadata.d.ts.map
@@ -0,0 +1,5 @@
import classPrivateFieldGet2 from "./classPrivateFieldGet2.js";
function _classExtractFieldDescriptor(e, t) {
return classPrivateFieldGet2(t, e);
}
export { _classExtractFieldDescriptor as default };
@@ -0,0 +1,316 @@
import { __assign } from "tslib";
import { WHITE_SPACE_REGEX } from './regex.generated';
export function parseNumberSkeletonFromString(skeleton) {
if (skeleton.length === 0) {
throw new Error('Number skeleton cannot be empty');
}
// Parse the skeleton
var stringTokens = skeleton
.split(WHITE_SPACE_REGEX)
.filter(function (x) { return x.length > 0; });
var tokens = [];
for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {
var stringToken = stringTokens_1[_i];
var stemAndOptions = stringToken.split('/');
if (stemAndOptions.length === 0) {
throw new Error('Invalid number skeleton');
}
var stem = stemAndOptions[0], options = stemAndOptions.slice(1);
for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {
var option = options_1[_a];
if (option.length === 0) {
throw new Error('Invalid number skeleton');
}
}
tokens.push({ stem: stem, options: options });
}
return tokens;
}
function icuUnitToEcma(unit) {
return unit.replace(/^(.*?)-/, '');
}
var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g;
var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;
var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;
function parseSignificantPrecision(str) {
var result = {};
if (str[str.length - 1] === 'r') {
result.roundingPriority = 'morePrecision';
}
else if (str[str.length - 1] === 's') {
result.roundingPriority = 'lessPrecision';
}
str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {
// @@@ case
if (typeof g2 !== 'string') {
result.minimumSignificantDigits = g1.length;
result.maximumSignificantDigits = g1.length;
}
// @@@+ case
else if (g2 === '+') {
result.minimumSignificantDigits = g1.length;
}
// .### case
else if (g1[0] === '#') {
result.maximumSignificantDigits = g1.length;
}
// .@@## or .@@@ case
else {
result.minimumSignificantDigits = g1.length;
result.maximumSignificantDigits =
g1.length + (typeof g2 === 'string' ? g2.length : 0);
}
return '';
});
return result;
}
function parseSign(str) {
switch (str) {
case 'sign-auto':
return {
signDisplay: 'auto',
};
case 'sign-accounting':
case '()':
return {
currencySign: 'accounting',
};
case 'sign-always':
case '+!':
return {
signDisplay: 'always',
};
case 'sign-accounting-always':
case '()!':
return {
signDisplay: 'always',
currencySign: 'accounting',
};
case 'sign-except-zero':
case '+?':
return {
signDisplay: 'exceptZero',
};
case 'sign-accounting-except-zero':
case '()?':
return {
signDisplay: 'exceptZero',
currencySign: 'accounting',
};
case 'sign-never':
case '+_':
return {
signDisplay: 'never',
};
}
}
function parseConciseScientificAndEngineeringStem(stem) {
// Engineering
var result;
if (stem[0] === 'E' && stem[1] === 'E') {
result = {
notation: 'engineering',
};
stem = stem.slice(2);
}
else if (stem[0] === 'E') {
result = {
notation: 'scientific',
};
stem = stem.slice(1);
}
if (result) {
var signDisplay = stem.slice(0, 2);
if (signDisplay === '+!') {
result.signDisplay = 'always';
stem = stem.slice(2);
}
else if (signDisplay === '+?') {
result.signDisplay = 'exceptZero';
stem = stem.slice(2);
}
if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {
throw new Error('Malformed concise eng/scientific notation');
}
result.minimumIntegerDigits = stem.length;
}
return result;
}
function parseNotationOptions(opt) {
var result = {};
var signOpts = parseSign(opt);
if (signOpts) {
return signOpts;
}
return result;
}
/**
* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options
*/
export function parseNumberSkeleton(tokens) {
var result = {};
for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {
var token = tokens_1[_i];
switch (token.stem) {
case 'percent':
case '%':
result.style = 'percent';
continue;
case '%x100':
result.style = 'percent';
result.scale = 100;
continue;
case 'currency':
result.style = 'currency';
result.currency = token.options[0];
continue;
case 'group-off':
case ',_':
result.useGrouping = false;
continue;
case 'precision-integer':
case '.':
result.maximumFractionDigits = 0;
continue;
case 'measure-unit':
case 'unit':
result.style = 'unit';
result.unit = icuUnitToEcma(token.options[0]);
continue;
case 'compact-short':
case 'K':
result.notation = 'compact';
result.compactDisplay = 'short';
continue;
case 'compact-long':
case 'KK':
result.notation = 'compact';
result.compactDisplay = 'long';
continue;
case 'scientific':
result = __assign(__assign(__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));
continue;
case 'engineering':
result = __assign(__assign(__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));
continue;
case 'notation-simple':
result.notation = 'standard';
continue;
// https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
case 'unit-width-narrow':
result.currencyDisplay = 'narrowSymbol';
result.unitDisplay = 'narrow';
continue;
case 'unit-width-short':
result.currencyDisplay = 'code';
result.unitDisplay = 'short';
continue;
case 'unit-width-full-name':
result.currencyDisplay = 'name';
result.unitDisplay = 'long';
continue;
case 'unit-width-iso-code':
result.currencyDisplay = 'symbol';
continue;
case 'scale':
result.scale = parseFloat(token.options[0]);
continue;
case 'rounding-mode-floor':
result.roundingMode = 'floor';
continue;
case 'rounding-mode-ceiling':
result.roundingMode = 'ceil';
continue;
case 'rounding-mode-down':
result.roundingMode = 'trunc';
continue;
case 'rounding-mode-up':
result.roundingMode = 'expand';
continue;
case 'rounding-mode-half-even':
result.roundingMode = 'halfEven';
continue;
case 'rounding-mode-half-down':
result.roundingMode = 'halfTrunc';
continue;
case 'rounding-mode-half-up':
result.roundingMode = 'halfExpand';
continue;
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
case 'integer-width':
if (token.options.length > 1) {
throw new RangeError('integer-width stems only accept a single optional option');
}
token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) {
if (g1) {
result.minimumIntegerDigits = g2.length;
}
else if (g3 && g4) {
throw new Error('We currently do not support maximum integer digits');
}
else if (g5) {
throw new Error('We currently do not support exact integer digits');
}
return '';
});
continue;
}
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {
result.minimumIntegerDigits = token.stem.length;
continue;
}
if (FRACTION_PRECISION_REGEX.test(token.stem)) {
// Precision
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision
// precision-integer case
if (token.options.length > 1) {
throw new RangeError('Fraction-precision stems only accept a single optional option');
}
token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) {
// .000* case (before ICU67 it was .000+)
if (g2 === '*') {
result.minimumFractionDigits = g1.length;
}
// .### case
else if (g3 && g3[0] === '#') {
result.maximumFractionDigits = g3.length;
}
// .00## case
else if (g4 && g5) {
result.minimumFractionDigits = g4.length;
result.maximumFractionDigits = g4.length + g5.length;
}
else {
result.minimumFractionDigits = g1.length;
result.maximumFractionDigits = g1.length;
}
return '';
});
var opt = token.options[0];
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
if (opt === 'w') {
result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });
}
else if (opt) {
result = __assign(__assign({}, result), parseSignificantPrecision(opt));
}
continue;
}
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision
if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {
result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));
continue;
}
var signOpts = parseSign(token.stem);
if (signOpts) {
result = __assign(__assign({}, result), signOpts);
}
var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);
if (conciseScientificAndEngineeringOpts) {
result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts);
}
}
return result;
}
@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015 Charlie Robbins & the contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_is_native_reflect_construct.cjs",
"module": "../../esm/_is_native_reflect_construct.js"
}
@@ -0,0 +1 @@
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAOM,MAAM,kDAAiC,CAAA,GAAA,2BAAmB;IAErD,OAAO,IAAa,EAAW;QACvC,OAAO,KAAK,IAAI,KAAK,UAAU,KAAK,IAAI,KAAK,eAAe,KAAK,IAAI,KAAK;IAC5E;IAEA,YAAY,GAAQ,EAAc;QAChC,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACxC,IAAI,CAAC,WACH,OAAO;QAGT,sEAAsE;QACtE,mDAAmD;QACnD,IAAI,UAAU,IAAI,KAAK,UAAU;YAC/B,IAAI,QAAQ,CAAA,GAAA,mBAAW,EAAE,CAAA,GAAA,oBAAY,EAAE,WAAW,IAAI,CAAC,UAAU;YACjE,IAAI,OACF,OAAO,MAAM,GAAG;YAGlB,IAAI,WAAW,IAAI,CAAC,WAAW;YAC/B,IAAI,YAAY,MACd,OAAO;YAGT,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YACxC,IAAI,CAAC,WACH,OAAO;YAGT,OAAO,KAAK,CAAC,0BAA0B,UAAU,UAAU,KAAK;QAClE;QAEA,OAAO,KAAK,CAAC,YAAY;IAC3B;IAEA,YAAY,GAAQ,EAAc;QAChC,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACxC,IAAI,CAAC,WACH,OAAO;QAGT,2DAA2D;QAC3D,IAAI,UAAU,IAAI,KAAK,UAAU;YAC/B,IAAI,SAAS,UAAU,SAAS,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,SAAS,IAAI;YAC1F,IAAI,UAAU,OAAO,IAAI,KAAK,UAC5B,OAAO,OAAO,GAAG;YAGnB,OAAO;QACT;QAEA,8CAA8C;QAC9C,IAAI,WAAW,KAAK,CAAC,YAAY;QACjC,IAAI,YAAY,YAAY,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,YAAY;QACvE,IAAI,aAAa,UAAU,IAAI,KAAK,aAClC,OAAO;QAGT,gEAAgE;QAChE,+BAA+B;QAC/B,IAAI,IAAI,CAAC,MAAM,CAAC,YACd,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,KAAK,CAAC,CAAC,GAAG;QAGrD,6DAA6D;QAC7D,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG;IACvC;IAEQ,kBAAkB,MAAe,EAAc;QACrD,2BAA2B;QAC3B,IAAI,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,GAAG,EAAE,CAAA,OAAQ,KAAK,IAAI,KAAK;QAC7D,IAAI,OAAO,MACT,OAAO;QAGT,kCAAkC;QAClC,IAAI,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,KAAK,CAAC;QAClD,KAAK,IAAI,QAAQ,CAAA,GAAA,oBAAY,EAAE,KAAK,IAAI,CAAC,UAAU,EAAG;YACpD,IAAI,KAAK,IAAI,KAAK,UAChB,OAAO,KAAK,GAAG;QAEnB;QAEA,OAAO;IACT;IAEQ,sBAAsB,MAAe,EAAc;QACzD,0BAA0B;QAC1B,IAAI,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,GAAG,EAAE,CAAA,OAAQ,KAAK,IAAI,KAAK;QACjE,IAAI,OAAO,MACT,OAAO;QAGT,iCAAiC;QACjC,IAAI,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,KAAK,CAAC;QAClD,IAAI,aAAa;eAAI,CAAA,GAAA,oBAAY,EAAE,KAAK,IAAI,CAAC,UAAU;SAAE;QACzD,IAAK,IAAI,IAAI,WAAW,MAAM,GAAG,GAAG,KAAK,GAAG,IAAK;YAC/C,IAAI,OAAO,UAAU,CAAC,EAAE;YACxB,IAAI,KAAK,IAAI,KAAK,UAChB,OAAO,KAAK,GAAG;QAEnB;QAEA,OAAO;IACT;IAEA,cAAc,GAAQ,EAAc;QAClC,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACnC,IAAI,CAAC,MACH,OAAO;QAGT,uDAAuD;QACvD,IAAI,KAAK,IAAI,KAAK,UAChB,OAAO,IAAI,CAAC,SAAS,KAAK,QACtB,IAAI,CAAC,qBAAqB,CAAC,QAC3B,IAAI,CAAC,iBAAiB,CAAC;QAG7B,OAAO,KAAK,CAAC,cAAc;IAC7B;IAEA,aAAa,GAAQ,EAAc;QACjC,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACnC,IAAI,CAAC,MACH,OAAO;QAGT,2DAA2D;QAC3D,IAAI,KAAK,IAAI,KAAK,UAChB,OAAO,IAAI,CAAC,SAAS,KAAK,QACtB,IAAI,CAAC,iBAAiB,CAAC,QACvB,IAAI,CAAC,qBAAqB,CAAC;QAGjC,OAAO,KAAK,CAAC,aAAa;IAC5B;IAEA,gBAAgB,MAAc,EAAE,OAAa,EAAc;QACzD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAChB,OAAO;QAGT,IAAI,aAAa,IAAI,CAAC,UAAU;QAChC,IAAI,MAAM,oBAAA,qBAAA,UAAW,IAAI,CAAC,WAAW;QACrC,IAAI,OAAO,MACT,OAAO;QAGT,6DAA6D;QAC7D,IAAI,YAAY,WAAW,OAAO,CAAC;YAE3B;QADR,IAAI,CAAA,sBAAA,gCAAA,UAAW,IAAI,MAAK,QACtB,MAAM,CAAA,uBAAA,UAAU,SAAS,cAAnB,kCAAA,uBAAuB;QAG/B,IAAI,aAAa;QACjB,MAAO,OAAO,KAAM;YAClB,IAAI,OAAO,WAAW,OAAO,CAAC;YAC9B,IAAI,CAAC,MACH,OAAO;YAGT,IAAI,KAAK,SAAS,EAAE;gBAClB,IAAI,YAAY,KAAK,SAAS,CAAC,KAAK,CAAC,GAAG,OAAO,MAAM;gBACrD,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,YAAY,GAC/C,OAAO,KAAK,GAAG;YAEnB;YAEA,6DAA6D;YAC7D,KAAK,IAAI,QAAQ,CAAA,GAAA,oBAAY,EAAE,MAAM,IAAI,CAAC,UAAU,EAAG;gBACrD,IAAI,SAAS,WAAW,OAAO,CAAC,KAAK,KAAK,CAAC;gBAC3C,IAAI,WAAW,mBAAmB,CAAC,GAAG,CAAC,OAAO,GAAG,KAAK,KAAK,SAAS,EAAE;oBACpE,IAAI,YAAY,KAAK,SAAS,CAAC,KAAK,CAAC,GAAG,OAAO,MAAM;oBACrD,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,YAAY,GAAG;wBAClD,gFAAgF;wBAChF,IAAI,WAAW,WAAW,OAAO,WAAW,OAAO,CAAC,WAAW;wBAC/D,OAAO,CAAA,qBAAA,+BAAA,SAAU,IAAI,MAAK,SACtB,KAAK,GAAG,GACR,KAAK,GAAG;oBACd;gBACF;YACF;YAEA,MAAM,IAAI,CAAC,WAAW,CAAC;YAEvB,sDAAsD;YACtD,IAAI,OAAO,QAAQ,CAAC,YAAY;gBAC9B,MAAM,IAAI,CAAC,WAAW;gBACtB,aAAa;YACf;QACF;QAEA,OAAO;IACT;AACF","sources":["packages/@react-aria/table/src/TableKeyboardDelegate.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getChildNodes, getFirstItem} from '@react-stately/collections';\nimport {GridKeyboardDelegate} from '@react-aria/grid';\nimport {Key, Node} from '@react-types/shared';\nimport {TableCollection} from '@react-types/table';\n\nexport class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableCollection<T>> {\n\n protected isCell(node: Node<T>): boolean {\n return node.type === 'cell' || node.type === 'rowheader' || node.type === 'column';\n }\n\n getKeyBelow(key: Key): Key | null {\n let startItem = this.collection.getItem(key);\n iLine truncated
@@ -0,0 +1,5 @@
/**
* https://tc39.es/ecma402/#sec-iswellformedunitidentifier
* @param unit
*/
export declare function IsWellFormedUnitIdentifier(unit: string): boolean;
@@ -0,0 +1,393 @@
/*!
* MIT License
*
* Copyright (c) 2017-2024 Peculiar Ventures, LLC
*
* 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.
*
*/
const ARRAY_BUFFER_NAME = "[object ArrayBuffer]";
class BufferSourceConverter {
static isArrayBuffer(data) {
return Object.prototype.toString.call(data) === ARRAY_BUFFER_NAME;
}
static toArrayBuffer(data) {
if (this.isArrayBuffer(data)) {
return data;
}
if (data.byteLength === data.buffer.byteLength) {
return data.buffer;
}
if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
return data.buffer;
}
return this.toUint8Array(data.buffer)
.slice(data.byteOffset, data.byteOffset + data.byteLength)
.buffer;
}
static toUint8Array(data) {
return this.toView(data, Uint8Array);
}
static toView(data, type) {
if (data.constructor === type) {
return data;
}
if (this.isArrayBuffer(data)) {
return new type(data);
}
if (this.isArrayBufferView(data)) {
return new type(data.buffer, data.byteOffset, data.byteLength);
}
throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");
}
static isBufferSource(data) {
return this.isArrayBufferView(data)
|| this.isArrayBuffer(data);
}
static isArrayBufferView(data) {
return ArrayBuffer.isView(data)
|| (data && this.isArrayBuffer(data.buffer));
}
static isEqual(a, b) {
const aView = BufferSourceConverter.toUint8Array(a);
const bView = BufferSourceConverter.toUint8Array(b);
if (aView.length !== bView.byteLength) {
return false;
}
for (let i = 0; i < aView.length; i++) {
if (aView[i] !== bView[i]) {
return false;
}
}
return true;
}
static concat(...args) {
let buffers;
if (Array.isArray(args[0]) && !(args[1] instanceof Function)) {
buffers = args[0];
}
else if (Array.isArray(args[0]) && args[1] instanceof Function) {
buffers = args[0];
}
else {
if (args[args.length - 1] instanceof Function) {
buffers = args.slice(0, args.length - 1);
}
else {
buffers = args;
}
}
let size = 0;
for (const buffer of buffers) {
size += buffer.byteLength;
}
const res = new Uint8Array(size);
let offset = 0;
for (const buffer of buffers) {
const view = this.toUint8Array(buffer);
res.set(view, offset);
offset += view.length;
}
if (args[args.length - 1] instanceof Function) {
return this.toView(res, args[args.length - 1]);
}
return res.buffer;
}
}
const STRING_TYPE = "string";
const HEX_REGEX = /^[0-9a-f\s]+$/i;
const BASE64_REGEX = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
const BASE64URL_REGEX = /^[a-zA-Z0-9-_]+$/;
class Utf8Converter {
static fromString(text) {
const s = unescape(encodeURIComponent(text));
const uintArray = new Uint8Array(s.length);
for (let i = 0; i < s.length; i++) {
uintArray[i] = s.charCodeAt(i);
}
return uintArray.buffer;
}
static toString(buffer) {
const buf = BufferSourceConverter.toUint8Array(buffer);
let encodedString = "";
for (let i = 0; i < buf.length; i++) {
encodedString += String.fromCharCode(buf[i]);
}
const decodedString = decodeURIComponent(escape(encodedString));
return decodedString;
}
}
class Utf16Converter {
static toString(buffer, littleEndian = false) {
const arrayBuffer = BufferSourceConverter.toArrayBuffer(buffer);
const dataView = new DataView(arrayBuffer);
let res = "";
for (let i = 0; i < arrayBuffer.byteLength; i += 2) {
const code = dataView.getUint16(i, littleEndian);
res += String.fromCharCode(code);
}
return res;
}
static fromString(text, littleEndian = false) {
const res = new ArrayBuffer(text.length * 2);
const dataView = new DataView(res);
for (let i = 0; i < text.length; i++) {
dataView.setUint16(i * 2, text.charCodeAt(i), littleEndian);
}
return res;
}
}
class Convert {
static isHex(data) {
return typeof data === STRING_TYPE
&& HEX_REGEX.test(data);
}
static isBase64(data) {
return typeof data === STRING_TYPE
&& BASE64_REGEX.test(data);
}
static isBase64Url(data) {
return typeof data === STRING_TYPE
&& BASE64URL_REGEX.test(data);
}
static ToString(buffer, enc = "utf8") {
const buf = BufferSourceConverter.toUint8Array(buffer);
switch (enc.toLowerCase()) {
case "utf8":
return this.ToUtf8String(buf);
case "binary":
return this.ToBinary(buf);
case "hex":
return this.ToHex(buf);
case "base64":
return this.ToBase64(buf);
case "base64url":
return this.ToBase64Url(buf);
case "utf16le":
return Utf16Converter.toString(buf, true);
case "utf16":
case "utf16be":
return Utf16Converter.toString(buf);
default:
throw new Error(`Unknown type of encoding '${enc}'`);
}
}
static FromString(str, enc = "utf8") {
if (!str) {
return new ArrayBuffer(0);
}
switch (enc.toLowerCase()) {
case "utf8":
return this.FromUtf8String(str);
case "binary":
return this.FromBinary(str);
case "hex":
return this.FromHex(str);
case "base64":
return this.FromBase64(str);
case "base64url":
return this.FromBase64Url(str);
case "utf16le":
return Utf16Converter.fromString(str, true);
case "utf16":
case "utf16be":
return Utf16Converter.fromString(str);
default:
throw new Error(`Unknown type of encoding '${enc}'`);
}
}
static ToBase64(buffer) {
const buf = BufferSourceConverter.toUint8Array(buffer);
if (typeof btoa !== "undefined") {
const binary = this.ToString(buf, "binary");
return btoa(binary);
}
else {
return Buffer.from(buf).toString("base64");
}
}
static FromBase64(base64) {
const formatted = this.formatString(base64);
if (!formatted) {
return new ArrayBuffer(0);
}
if (!Convert.isBase64(formatted)) {
throw new TypeError("Argument 'base64Text' is not Base64 encoded");
}
if (typeof atob !== "undefined") {
return this.FromBinary(atob(formatted));
}
else {
return new Uint8Array(Buffer.from(formatted, "base64")).buffer;
}
}
static FromBase64Url(base64url) {
const formatted = this.formatString(base64url);
if (!formatted) {
return new ArrayBuffer(0);
}
if (!Convert.isBase64Url(formatted)) {
throw new TypeError("Argument 'base64url' is not Base64Url encoded");
}
return this.FromBase64(this.Base64Padding(formatted.replace(/\-/g, "+").replace(/\_/g, "/")));
}
static ToBase64Url(data) {
return this.ToBase64(data).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, "");
}
static FromUtf8String(text, encoding = Convert.DEFAULT_UTF8_ENCODING) {
switch (encoding) {
case "ascii":
return this.FromBinary(text);
case "utf8":
return Utf8Converter.fromString(text);
case "utf16":
case "utf16be":
return Utf16Converter.fromString(text);
case "utf16le":
case "usc2":
return Utf16Converter.fromString(text, true);
default:
throw new Error(`Unknown type of encoding '${encoding}'`);
}
}
static ToUtf8String(buffer, encoding = Convert.DEFAULT_UTF8_ENCODING) {
switch (encoding) {
case "ascii":
return this.ToBinary(buffer);
case "utf8":
return Utf8Converter.toString(buffer);
case "utf16":
case "utf16be":
return Utf16Converter.toString(buffer);
case "utf16le":
case "usc2":
return Utf16Converter.toString(buffer, true);
default:
throw new Error(`Unknown type of encoding '${encoding}'`);
}
}
static FromBinary(text) {
const stringLength = text.length;
const resultView = new Uint8Array(stringLength);
for (let i = 0; i < stringLength; i++) {
resultView[i] = text.charCodeAt(i);
}
return resultView.buffer;
}
static ToBinary(buffer) {
const buf = BufferSourceConverter.toUint8Array(buffer);
let res = "";
for (let i = 0; i < buf.length; i++) {
res += String.fromCharCode(buf[i]);
}
return res;
}
static ToHex(buffer) {
const buf = BufferSourceConverter.toUint8Array(buffer);
let result = "";
const len = buf.length;
for (let i = 0; i < len; i++) {
const byte = buf[i];
if (byte < 16) {
result += "0";
}
result += byte.toString(16);
}
return result;
}
static FromHex(hexString) {
let formatted = this.formatString(hexString);
if (!formatted) {
return new ArrayBuffer(0);
}
if (!Convert.isHex(formatted)) {
throw new TypeError("Argument 'hexString' is not HEX encoded");
}
if (formatted.length % 2) {
formatted = `0${formatted}`;
}
const res = new Uint8Array(formatted.length / 2);
for (let i = 0; i < formatted.length; i = i + 2) {
const c = formatted.slice(i, i + 2);
res[i / 2] = parseInt(c, 16);
}
return res.buffer;
}
static ToUtf16String(buffer, littleEndian = false) {
return Utf16Converter.toString(buffer, littleEndian);
}
static FromUtf16String(text, littleEndian = false) {
return Utf16Converter.fromString(text, littleEndian);
}
static Base64Padding(base64) {
const padCount = 4 - (base64.length % 4);
if (padCount < 4) {
for (let i = 0; i < padCount; i++) {
base64 += "=";
}
}
return base64;
}
static formatString(data) {
return (data === null || data === void 0 ? void 0 : data.replace(/[\n\r\t ]/g, "")) || "";
}
}
Convert.DEFAULT_UTF8_ENCODING = "utf8";
function assign(target, ...sources) {
const res = arguments[0];
for (let i = 1; i < arguments.length; i++) {
const obj = arguments[i];
for (const prop in obj) {
res[prop] = obj[prop];
}
}
return res;
}
function combine(...buf) {
const totalByteLength = buf.map((item) => item.byteLength).reduce((prev, cur) => prev + cur);
const res = new Uint8Array(totalByteLength);
let currentPos = 0;
buf.map((item) => new Uint8Array(item)).forEach((arr) => {
for (const item2 of arr) {
res[currentPos++] = item2;
}
});
return res.buffer;
}
function isEqual(bytes1, bytes2) {
if (!(bytes1 && bytes2)) {
return false;
}
if (bytes1.byteLength !== bytes2.byteLength) {
return false;
}
const b1 = new Uint8Array(bytes1);
const b2 = new Uint8Array(bytes2);
for (let i = 0; i < bytes1.byteLength; i++) {
if (b1[i] !== b2[i]) {
return false;
}
}
return true;
}
export { BufferSourceConverter, Convert, assign, combine, isEqual };
@@ -0,0 +1,11 @@
import { IOutput } from '../interfaces';
export declare class Output implements IOutput {
private verb;
debug: (message: string, obj?: unknown) => void;
constructor(verb?: boolean, debugMode?: boolean);
set verbose(value: boolean);
info(message: string): void;
error(message: string, exitProcess?: boolean): void;
clear(): void;
assert(claim: unknown, message: string): void;
}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('remove', require('../remove'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1 @@
{"version":3,"names":["transformFile","exports","filename","opts","callback","Error","transformFileSync","transformFileAsync","Promise","reject"],"sources":["../src/transform-file-browser.ts"],"sourcesContent":["/* c8 ignore start */\n\n// duplicated from transform-file so we do not have to import anything here\ntype TransformFile = {\n (filename: string, callback: (error: Error, file: null) => void): void;\n (\n filename: string,\n opts: any,\n callback: (error: Error, file: null) => void,\n ): void;\n};\n\nexport const transformFile: TransformFile = function transformFile(\n filename,\n opts,\n callback?: (error: Error, file: null) => void,\n) {\n if (typeof opts === \"function\") {\n callback = opts;\n }\n\n callback(new Error(\"Transforming files is not supported in browsers\"), null);\n};\n\nexport function transformFileSync(): never {\n throw new Error(\"Transforming files is not supported in browsers\");\n}\n\nexport function transformFileAsync() {\n return Promise.reject(\n new Error(\"Transforming files is not supported in browsers\"),\n );\n}\n"],"mappings":";;;;;;;;AAYO,MAAMA,aAA4B,GAAAC,OAAA,CAAAD,aAAA,GAAG,SAASA,aAAaA,CAChEE,QAAQ,EACRC,IAAI,EACJC,QAA6C,EAC7C;EACA,IAAI,OAAOD,IAAI,KAAK,UAAU,EAAE;IAC9BC,QAAQ,GAAGD,IAAI;EACjB;EAEAC,QAAQ,CAAC,IAAIC,KAAK,CAAC,iDAAiD,CAAC,EAAE,IAAI,CAAC;AAC9E,CAAC;AAEM,SAASC,iBAAiBA,CAAA,EAAU;EACzC,MAAM,IAAID,KAAK,CAAC,iDAAiD,CAAC;AACpE;AAEO,SAASE,kBAAkBA,CAAA,EAAG;EACnC,OAAOC,OAAO,CAACC,MAAM,CACnB,IAAIJ,KAAK,CAAC,iDAAiD,CAC7D,CAAC;AACH;AAAC","ignoreList":[]}
@@ -0,0 +1 @@
{"name":"@babel/helpers","version":"7.28.4","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532117489,"integrity":"sha512-lUIQMtW5+7LSsZDCOgfJMiFBgS/djgDDq6p/4PZyzVdV6c6q6W3nc5JylESDm/YcXrv1yPzdvIe8eV/DBG9WUg==","mode":420,"size":1189},"README.md":{"checkedAt":1794532117489,"integrity":"sha512-gYmPMmnKdHWH5iZK+b0pNGQxJnx2+72eg0hMW0+oH2xsGcPIJ1katyMbISntiFFncsL/QhKlDuK+OljuZkwg8g==","mode":420,"size":302},"lib/helpers-generated.js":{"checkedAt":1794532117489,"integrity":"sha512-xthSHmOIJ8VqhLWVSEV1NHISyEq+cvbGTtloS9rVZlHIxnPgso0Plb3jqcqn+0ksUeL8RTRvt74rcbhlrWefdw==","mode":420,"size":114294},"lib/helpers-generated.js.map":{"checkedAt":1794532117490,"integrity":"sha512-LeGplqxS3Sw1OxC3dg5FYr0VIALfD6kQY4sJjZgwqSuQx/eUIPylLNEPQMHIBC5a7BqyoPxM6p8anEA3udhp9w==","mode":420,"size":174738},"lib/helpers/AwaitValue.js":{"checkedAt":1794532117490,"integrity":"sha512-Yl7AIzwv2cgr73l0tDxfCPvXLYxmjbh6kLR5DyZBFNFoieT1cV+x+LsFNfbS/R4kTO27+J+FWlkK1W8ViAn5aA==","mode":420,"size":207},"lib/helpers/AwaitValue.js.map":{"checkedAt":1794532117490,"integrity":"sha512-0BbDhwUZ6+AgkrxUrQ+ne7IeWBZnYy/KyX7BnYQ83RpxRG4iqw7UGwCQib4g6zYVKzmRr2ZmV7i2ZbZOrR3fBQ==","mode":420,"size":357},"lib/helpers/OverloadYield.js":{"checkedAt":1794532117491,"integrity":"sha512-UNaE/MnK3AJi7TiprzOu8JpykU0rt+Zp1UGAIX+IXMpBf3kpW/GgnuI0XCM2b8dI8NKCMBRwWyV6GE0rcI/dTg==","mode":420,"size":233},"lib/helpers/OverloadYield.js.map":{"checkedAt":1794532117491,"integrity":"sha512-20svIsa4ioPF8kn86UlIeYz4/vHu/6xDvwXMSqfIglXxln/S4cNdJOy8Txya7XAMU9ITRhgbJiw5nr2XyPfU+w==","mode":420,"size":838},"lib/helpers/applyDecoratedDescriptor.js":{"checkedAt":1794532117491,"integrity":"sha512-wqDIyRcseIsI7kuIEU2IEacGXlmgoInDHNboIxgwC/zez5n+9YEf2sRpFmFNEColAW6TNrzyZTmOc0E4Tv5Obg==","mode":420,"size":957},"lib/helpers/applyDecoratedDescriptor.js.map":{"checkedAt":1794532117492,"integrity":"sha512-9czmNzgFbLhVtx3HCzrIJv5MXfga185wQf4wIXqlcdwj4YqzUyaBypqldHt8SeE+hqoAvShQg5noOZrYOHyqYg==","mode":420,"size":2700},"lib/helpers/applyDecs.js":{"checkedAt":1794532117492,"integrity":"sha512-jGV/krZXjlzt6aZDEpQv5tHHgYbYQdAZWDpptTqTjt+5CwybieK+8bihmVSVEwQLAoRkbG2YFOwI01n9C9pSeg==","mode":420,"size":14143},"lib/helpers/applyDecs.js.map":{"checkedAt":1794532117492,"integrity":"sha512-E2c1G6o83bXxbrMcmWzfmzcjuQ/Y3RfYbmkb2XLStC6jeayxx521sIoRbYs2SORqvJuz+XztrEHb69chWip7DA==","mode":420,"size":36388},"lib/helpers/applyDecs2203.js":{"checkedAt":1794532117492,"integrity":"sha512-EcbQPCM8kdn/6QRM0ryi3Wif+sn4fhSxHf7GFEIw3AZhkVXsEQhqgM85QQO1ErAahfBAx4I+s2ifztaJJh3G/Q==","mode":420,"size":10589},"lib/helpers/applyDecs2203.js.map":{"checkedAt":1794532117492,"integrity":"sha512-Xgs8SPfxkX9BYGX84LRpLxDkqf6kOuXsi2VuePcpOkcKr00jKwSD3cU9/OZwvwNZYHSr9AhrYzxq/ln6f+QM3A==","mode":420,"size":27607},"lib/helpers/applyDecs2203R.js":{"checkedAt":1794532117493,"integrity":"sha512-K3NNn5dVctJiwqwG669nxP2ywTxUs7SN8mGW/gUjnlMxQvUYSfZuhhLjYP9Q7AnFT92duGk2QlqnX2wyLiG8tQ==","mode":420,"size":10961},"lib/helpers/applyDecs2203R.js.map":{"checkedAt":1794532117493,"integrity":"sha512-bTrEFGAG2aqkmjaghS/oZ2I9rhlEn+vxiblZSHICmGAeM0bR3pB9iclW4ELYXZsOL5RxV9uVe74CBDTW7Pqxgw==","mode":420,"size":28626},"lib/helpers/applyDecs2301.js":{"checkedAt":1794532117493,"integrity":"sha512-34r34dq6az9hCEqeZtuZfyFGGPZzsdXLXS1inDVmqvaVd7Mkv1JqnDX9kjZktb4KgMxIzHlhfnNg8WxGPRSGwQ==","mode":420,"size":12508},"lib/helpers/applyDecs2301.js.map":{"checkedAt":1794532117493,"integrity":"sha512-hIQ17pgigK78EQEOhXRyiKF3MvcTHMb1uabHa6FKdzuFnS9trGTPyYExf84fOqnNGBvS2uUblSlOMY2ZDYzdtQ==","mode":420,"size":32243},"lib/helpers/applyDecs2305.js":{"checkedAt":1794532117494,"integrity":"sha512-AH/9BTRIkPKaV4kwmepKkQvP0wSnI0CIrctimthbeIVmWoiMuLqHjn5CcWttvPWTXbSEBs7Q+zs/z0rc3qEKCQ==","mode":420,"size":8645},"lib/helpers/applyDecs2305.js.map":{"checkedAt":1794532117494,"integrity":"sha512-/a9odZN7eEc/M2rvNDqMZSdLl+/tGWDXwxd7rnTB5zjFPGQeNUyPqzWy0qFjEu/kscYhzrOsswBhOoSLy0mQGg==","mode":420,"size":25216},"lib/helpers/applyDecs2311.js":{"checkedAt":1794532117494,"integrity":"sha512-p7NTTaKCDD7rMDrqOo3zJ0OzTmHqccTdOf/QHi2YuNiBaF6RLdZNY8S9gsAC2PqMiQE1ciFtkFjS28TDWgfwgA==","mode":420,"size":8551},"lib/helpers/applyDecs2311.js.map":{"checkedAt":1794532117494,"integrity":"sha512-KTfyusOqrcNSWbu17UjcTBZA3oEepIU+qmx5aXFFQK2SvNNdOAOiRdWJddzM8jJHek1rDypgm/E7W+SBZsP4Vg==","mode":420,"size":26723},"lib/helpers/arrayLikeToArray.js":{"checkedAt":1794532117495,"integrity":"sha512-SOJWmvK+fv7K6BcgDLxVtA2x5Pfa30eLzHiOhAUBx5uNk+EMHI+zjn+2aa+4wc/uGdfXIROClE7GfenksS7Yjg==","mode":420,"size":349},"lib/helpers/arrayLikeToArray.js.map":{"checkedAt":1794532117495,"integrity":"sha512-05QApsoFDZ2HT0Ca/sUZOQZqQf4kQbld85WooSSfRdMW2hKQT7XZO1TdZui6Pjr9ICER+tfKpe2ZluSY1X/Svg==","mode":420,"size":803},"lib/helpers/arrayWithHoles.js":{"checkedAt":1794532117495,"integrity":"sha512-kGHB4wiAB7POLSARN9Eq6JZnfYCUUeszWhjwJhXcDwS5U6NXmdrWXVcdUKg37+ASTgHfegiE/qXpPuMc/NrKew==","mode":420,"size":231},"lib/helpers/arrayWithHoles.js.map":{"checkedAt":1794532117495,"integrity":"sha512-Cfr+obk8g+3GX8sRmazRrPcLine truncated
@@ -0,0 +1,27 @@
import * as _heroui_system from '@heroui/system';
import { HTMLHeroUIProps } from '@heroui/system';
import { ValuesType } from './use-table.js';
import '@react-types/table';
import 'react';
import '@heroui/theme';
import '@react-stately/virtualizer';
import '@react-types/shared';
import '@react-stately/table';
import '@react-aria/table';
import '@heroui/react-utils';
import '@heroui/checkbox';
interface TableBodyProps extends HTMLHeroUIProps<"tbody"> {
slots: ValuesType["slots"];
collection: ValuesType["collection"];
state: ValuesType["state"];
isSelectable: ValuesType["isSelectable"];
color: ValuesType["color"];
disableAnimation: ValuesType["disableAnimation"];
checkboxesProps: ValuesType["checkboxesProps"];
selectionMode: ValuesType["selectionMode"];
classNames?: ValuesType["classNames"];
}
declare const TableBody: _heroui_system.InternalForwardRefRenderFunction<"tbody", TableBodyProps, never>;
export { type TableBodyProps, TableBody as default };
@@ -0,0 +1,18 @@
import { Literal } from '../literal/index.mjs';
import { Kind, Hint } from '../symbols/index.mjs';
import { Union } from '../union/index.mjs';
// ------------------------------------------------------------------
// ValueGuard
// ------------------------------------------------------------------
import { IsUndefined } from '../guard/value.mjs';
/** `[Json]` Creates a Enum type */
export function Enum(item, options) {
if (IsUndefined(item))
throw new Error('Enum undefined or empty');
const values1 = globalThis.Object.getOwnPropertyNames(item)
.filter((key) => isNaN(key))
.map((key) => item[key]);
const values2 = [...new Set(values1)];
const anyOf = values2.map((value) => Literal(value));
return Union(anyOf, { ...options, [Hint]: 'Enum' });
}
@@ -0,0 +1 @@
{"version":3,"names":["_t","require","_infererReference","_util","BOOLEAN_BINARY_OPERATORS","BOOLEAN_UNARY_OPERATORS","NUMBER_BINARY_OPERATORS","NUMBER_UNARY_OPERATORS","STRING_UNARY_OPERATORS","anyTypeAnnotation","arrayTypeAnnotation","booleanTypeAnnotation","buildMatchMemberExpression","genericTypeAnnotation","identifier","nullLiteralTypeAnnotation","numberTypeAnnotation","stringTypeAnnotation","tupleTypeAnnotation","unionTypeAnnotation","voidTypeAnnotation","isIdentifier","VariableDeclarator","get","getTypeAnnotation","TypeCastExpression","node","typeAnnotation","validParent","TSAsExpression","TSNonNullExpression","NewExpression","callee","type","TemplateLiteral","UnaryExpression","operator","includes","BinaryExpression","right","left","isBaseType","LogicalExpression","argumentTypes","createUnionType","ConditionalExpression","SequenceExpression","pop","ParenthesizedExpression","AssignmentExpression","UpdateExpression","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","RegExpLiteral","ObjectExpression","ArrayExpression","RestElement","Func","isArrayFrom","isObjectKeys","isObjectValues","isObjectEntries","CallExpression","name","resolveCall","TaggedTemplateExpression","resolve","isFunction","async","generator","returnType"],"sources":["../../../src/path/inference/inferers.ts"],"sourcesContent":["import {\n BOOLEAN_BINARY_OPERATORS,\n BOOLEAN_UNARY_OPERATORS,\n NUMBER_BINARY_OPERATORS,\n NUMBER_UNARY_OPERATORS,\n STRING_UNARY_OPERATORS,\n anyTypeAnnotation,\n arrayTypeAnnotation,\n booleanTypeAnnotation,\n buildMatchMemberExpression,\n genericTypeAnnotation,\n identifier,\n nullLiteralTypeAnnotation,\n numberTypeAnnotation,\n stringTypeAnnotation,\n tupleTypeAnnotation,\n unionTypeAnnotation,\n voidTypeAnnotation,\n isIdentifier,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\nexport { default as Identifier } from \"./inferer-reference.ts\";\n\nimport { createUnionType } from \"./util.ts\";\nimport type NodePath from \"../index.ts\";\n\nexport function VariableDeclarator(this: NodePath<t.VariableDeclarator>) {\n if (!this.get(\"id\").isIdentifier()) return;\n return this.get(\"init\").getTypeAnnotation();\n}\n\nexport function TypeCastExpression(node: t.TypeCastExpression) {\n return node.typeAnnotation;\n}\n\nTypeCastExpression.validParent = true;\n\nexport function TSAsExpression(node: t.TSAsExpression) {\n return node.typeAnnotation;\n}\n\nTSAsExpression.validParent = true;\n\nexport function TSNonNullExpression(this: NodePath<t.TSNonNullExpression>) {\n return this.get(\"expression\").getTypeAnnotation();\n}\n\nexport function NewExpression(\n this: NodePath<t.NewExpression>,\n node: t.NewExpression,\n) {\n if (node.callee.type === \"Identifier\") {\n // only resolve identifier callee\n return genericTypeAnnotation(node.callee);\n }\n}\n\nexport function TemplateLiteral() {\n return stringTypeAnnotation();\n}\n\nexport function UnaryExpression(node: t.UnaryExpression) {\n const operator = node.operator;\n\n if (operator === \"void\") {\n return voidTypeAnnotation();\n } else if (NUMBER_UNARY_OPERATORS.includes(operator)) {\n return numberTypeAnnotation();\n } else if (STRING_UNARY_OPERATORS.includes(operator)) {\n return stringTypeAnnotation();\n } else if (BOOLEAN_UNARY_OPERATORS.includes(operator)) {\n return booleanTypeAnnotation();\n }\n}\n\nexport function BinaryExpression(\n this: NodePath<t.BinaryExpression>,\n node: t.BinaryExpression,\n) {\n const operator = node.operator;\n\n if (NUMBER_BINARY_OPERATORS.includes(operator)) {\n return numberTypeAnnotation();\n } else if (BOOLEAN_BINARY_OPERATORS.includes(operator)) {\n return booleanTypeAnnotation();\n } else if (operator === \"+\") {\n const right = this.get(\"right\");\n const left = this.get(\"left\");\n\n if (left.isBaseType(\"number\") && right.isBaseType(\"number\")) {\n // both numbers so this will be a number\n return numberTypeAnnotation();\n } else if (left.isBaseType(\"string\") || right.isBaseType(\"string\")) {\n // one is a string so the result will be a string\n return stringTypeAnnotation();\n }\n\n // unsure if left and right are strings or numbers so stay on the safe side\n return unionTypeAnnotation([\n stringTypeAnnotation(),\n numberTypeAnnotation(),\n ]);\n }\n}\n\nexport function LogicalExpression(this: NodePath<t.LogicalExpression>) {\n const argumentTypes = [\n this.get(\"left\").getTypeAnnotation(),\n this.get(\"right\").getTypeAnnotation(),\n ];\n\n return createUnionType(argumentTypes);\n}\n\nexport function ConditionalExpression(this: NodePath<t.ConditionalExpression>) {\n const argumentTypes = [\n this.get(\"consequent\").getTypeAnnotation(),\n this.get(\"alternate\").getTypeAnnotation(),\n ];\n\n return createUnionType(argumentTypes);\n}\n\nexport function SequenceExpression(this: NodePath<t.SequenceExpression>) {\n return this.get(\"expresLine truncated
@@ -0,0 +1,49 @@
{
"name": "autoprefixer",
"version": "10.4.22",
"description": "Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website",
"engines": {
"node": "^10 || ^12 || >=14"
},
"keywords": [
"autoprefixer",
"css",
"prefix",
"postcss",
"postcss-plugin"
],
"main": "lib/autoprefixer.js",
"bin": "bin/autoprefixer",
"types": "lib/autoprefixer.d.ts",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/autoprefixer"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"author": "Andrey Sitnik <andrey@sitnik.ru>",
"license": "MIT",
"repository": "postcss/autoprefixer",
"bugs": {
"url": "https://github.com/postcss/autoprefixer/issues"
},
"peerDependencies": {
"postcss": "^8.1.0"
},
"dependencies": {
"browserslist": "^4.27.0",
"caniuse-lite": "^1.0.30001754",
"fraction.js": "^5.3.4",
"normalize-range": "^0.1.2",
"picocolors": "^1.1.1",
"postcss-value-parser": "^4.2.0"
}
}
@@ -0,0 +1,42 @@
{
"name": "@react-aria/tabs",
"version": "3.9.8",
"description": "Spectrum UI components in React",
"license": "Apache-2.0",
"main": "dist/main.js",
"module": "dist/module.js",
"exports": {
"types": "./dist/types.d.ts",
"import": "./dist/import.mjs",
"require": "./dist/main.js"
},
"types": "dist/types.d.ts",
"source": "src/index.ts",
"files": [
"dist",
"src"
],
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/adobe/react-spectrum"
},
"dependencies": {
"@react-aria/focus": "^3.19.0",
"@react-aria/i18n": "^3.12.4",
"@react-aria/selection": "^3.21.0",
"@react-aria/utils": "^3.26.0",
"@react-stately/tabs": "^3.7.0",
"@react-types/shared": "^3.26.0",
"@react-types/tabs": "^3.3.11",
"@swc/helpers": "^0.5.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
},
"publishConfig": {
"access": "public"
},
"gitHead": "71f0ef23053f9e03ee7e97df736e8b083e006849"
}
@@ -0,0 +1,68 @@
# @polka/url [![npm](https://badgen.now.sh/npm/v/@polka/url)](https://npmjs.org/package/@polka/url) [![licenses](https://licenses.dev/b/npm/%40polka%2Furl)](https://licenses.dev/npm/%40polka%2Furl)
> Super fast, memoized `req.url` parser; _not_ limited to [Polka][polka]!
Parses the `url` from a [`IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage) request. The returned object will always only contain the following keys: `search`, `query`, `pathname`, and `raw`.
> **Note:** This library does not process `protocol`, `hostname`, `port`, etc.<br>This is because the incoming `req.url` value only begins with the path information.
Parsed requests will be mutated with a `_parsedUrl` key, containing the returned output. This is used for future memoization, avoiding the need to fully parse the same `url` value multiple times.
## Install
```
$ npm install --save @polka/url
```
## Usage
```js
const parse = require('@polka/url');
let req = {
url: '/foo/bar?fizz=buzz'
};
let output = parse(req);
//=> {
//=> pathname: '/foo/bar',
//=> raw: '/foo/bar?fizz=buzz',
//=> search: '?fizz=buzz',
//=> query: {
//=> fizz: 'buzz'
//=> },
//=> }
// Attaches result for future memoization
assert.deepEqual(output, req._parsedUrl); //=> true
```
## API
### url(req)
Returns: `Object` or `undefined`
> **Important:** The `req` must have a `url` key, otherwise `undefined` will be returned.<br>If no input is provided at all, a `TypeError` will be thrown.
#### req
Type: `IncomingMessage` or `{ url: string }`
The incoming HTTP request (`req`) or a plain `Object` with a `url` key.
> **Note:** In Node.js servers, the [`req.url`](https://nodejs.org/api/http.html#http_message_url) begins with a pathname & does not include a `hash`.
## Benchmarks
Check out the [`bench`](/bench) directory for in-depth benchmark results and comparisons.
## Support
Any issues or questions can be sent to the [Polka][polka] repository.<br>However, please specify that your inquiry is about `@polka/url` specifically.
## License
MIT © [Luke Edwards](https://lukeed.com)
[polka]: https://github.com/lukeed/polka
@@ -0,0 +1,190 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createCachedDescriptors = createCachedDescriptors;
exports.createDescriptor = createDescriptor;
exports.createUncachedDescriptors = createUncachedDescriptors;
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
var _functional = require("../gensync-utils/functional.js");
var _index = require("./files/index.js");
var _item = require("./item.js");
var _caching = require("./caching.js");
var _resolveTargets = require("./resolve-targets.js");
function isEqualDescriptor(a, b) {
var _a$file, _b$file, _a$file2, _b$file2;
return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && ((_a$file = a.file) == null ? void 0 : _a$file.request) === ((_b$file = b.file) == null ? void 0 : _b$file.request) && ((_a$file2 = a.file) == null ? void 0 : _a$file2.resolved) === ((_b$file2 = b.file) == null ? void 0 : _b$file2.resolved);
}
function* handlerOf(value) {
return value;
}
function optionsWithResolvedBrowserslistConfigFile(options, dirname) {
if (typeof options.browserslistConfigFile === "string") {
options.browserslistConfigFile = (0, _resolveTargets.resolveBrowserslistConfigFile)(options.browserslistConfigFile, dirname);
}
return options;
}
function createCachedDescriptors(dirname, options, alias) {
const {
plugins,
presets,
passPerPreset
} = options;
return {
options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => handlerOf([]),
presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => handlerOf([])
};
}
function createUncachedDescriptors(dirname, options, alias) {
return {
options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
plugins: (0, _functional.once)(() => createPluginDescriptors(options.plugins || [], dirname, alias)),
presets: (0, _functional.once)(() => createPresetDescriptors(options.presets || [], dirname, alias, !!options.passPerPreset))
};
}
const PRESET_DESCRIPTOR_CACHE = new WeakMap();
const createCachedPresetDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
const dirname = cache.using(dir => dir);
return (0, _caching.makeStrongCacheSync)(alias => (0, _caching.makeStrongCache)(function* (passPerPreset) {
const descriptors = yield* createPresetDescriptors(items, dirname, alias, passPerPreset);
return descriptors.map(desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc));
}));
});
const PLUGIN_DESCRIPTOR_CACHE = new WeakMap();
const createCachedPluginDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
const dirname = cache.using(dir => dir);
return (0, _caching.makeStrongCache)(function* (alias) {
const descriptors = yield* createPluginDescriptors(items, dirname, alias);
return descriptors.map(desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc));
});
});
const DEFAULT_OPTIONS = {};
function loadCachedDescriptor(cache, desc) {
const {
value,
options = DEFAULT_OPTIONS
} = desc;
if (options === false) return desc;
let cacheByOptions = cache.get(value);
if (!cacheByOptions) {
cacheByOptions = new WeakMap();
cache.set(value, cacheByOptions);
}
let possibilities = cacheByOptions.get(options);
if (!possibilities) {
possibilities = [];
cacheByOptions.set(options, possibilities);
}
if (!possibilities.includes(desc)) {
const matches = possibilities.filter(possibility => isEqualDescriptor(possibility, desc));
if (matches.length > 0) {
return matches[0];
}
possibilities.push(desc);
}
return desc;
}
function* createPresetDescriptors(items, dirname, alias, passPerPreset) {
return yield* createDescriptors("preset", items, dirname, alias, passPerPreset);
}
function* createPluginDescriptors(items, dirname, alias) {
return yield* createDescriptors("plugin", items, dirname, alias);
}
function* createDescriptors(type, items, dirname, alias, ownPass) {
const descriptors = yield* _gensync().all(items.map((item, index) => createDescriptor(item, dirname, {
type,
alias: `${alias}$${index}`,
ownPass: !!ownPass
})));
assertNoDuplicates(descriptors);
return descriptors;
}
function* createDescriptor(pair, dirname, {
type,
alias,
ownPass
}) {
const desc = (0, _item.getItemDescriptor)(pair);
if (desc) {
return desc;
}
let name;
let options;
let value = pair;
if (Array.isArray(value)) {
if (value.length === 3) {
[value, options, name] = value;
} else {
[value, options] = value;
}
}
let file = undefined;
let filepath = null;
if (typeof value === "string") {
if (typeof type !== "string") {
throw new Error("To resolve a string-based item, the type of item must be given");
}
const resolver = type === "plugin" ? _index.loadPlugin : _index.loadPreset;
const request = value;
({
filepath,
value
} = yield* resolver(value, dirname));
file = {
request,
resolved: filepath
};
}
if (!value) {
throw new Error(`Unexpected falsy value: ${String(value)}`);
}
if (typeof value === "object" && value.__esModule) {
if (value.default) {
value = value.default;
} else {
throw new Error("Must export a default export when using ES6 modules.");
}
}
if (typeof value !== "object" && typeof value !== "function") {
throw new Error(`Unsupported format: ${typeof value}. Expected an object or a function.`);
}
if (filepath !== null && typeof value === "object" && value) {
throw new Error(`Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`);
}
return {
name,
alias: filepath || alias,
value,
options,
dirname,
ownPass,
file
};
}
function assertNoDuplicates(items) {
const map = new Map();
for (const item of items) {
if (typeof item.value !== "function") continue;
let nameMap = map.get(item.value);
if (!nameMap) {
nameMap = new Set();
map.set(item.value, nameMap);
}
if (nameMap.has(item.name)) {
const conflicts = items.filter(i => i.value === item.value);
throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, ` plugins: [`, ` ['some-plugin', {}],`, ` ['some-plugin', {}, 'some unique name'],`, ` ]`, ``, `Duplicates detected are:`, `${JSON.stringify(conflicts, null, 2)}`].join("\n"));
}
nameMap.add(item.name);
}
}
0 && 0;
//# sourceMappingURL=config-descriptors.js.map
@@ -0,0 +1,44 @@
import { Transition, Target, TargetAndTransition } from 'framer-motion';
type WithMotionState<P> = Partial<Record<"enter" | "exit", P>>;
type TransitionConfig = WithMotionState<Transition>;
type TransitionEndConfig = WithMotionState<Target>;
type TransitionProperties = {
/**
* Custom `transition` definition for `enter` and `exit`
*/
transition?: TransitionConfig;
/**
* Custom `transitionEnd` definition for `enter` and `exit`
*/
transitionEnd?: TransitionEndConfig;
};
type TargetResolver<P = {}> = (props: P & TransitionProperties) => TargetAndTransition;
type Variant<P = {}> = TargetAndTransition | TargetResolver<P>;
type Variants<P = {}> = Record<string, {
enter: Variant<P>;
exit: Variant<P>;
initial?: Variant<P>;
}>;
declare const TRANSITION_EASINGS: {
readonly ease: readonly [0.36, 0.66, 0.4, 1];
readonly easeIn: readonly [0.4, 0, 1, 1];
readonly easeOut: readonly [0, 0, 0.2, 1];
readonly easeInOut: readonly [0.4, 0, 0.2, 1];
readonly spring: readonly [0.155, 1.105, 0.295, 1.12];
readonly springOut: readonly [0.57, -0.15, 0.62, 0.07];
readonly softSpring: readonly [0.16, 1.11, 0.3, 1.02];
};
declare const TRANSITION_DEFAULTS: {
readonly enter: {
readonly duration: 0.2;
readonly ease: readonly [0, 0, 0.2, 1];
};
readonly exit: {
readonly duration: 0.1;
readonly ease: readonly [0.4, 0, 1, 1];
};
};
declare const TRANSITION_VARIANTS: Variants;
export { TRANSITION_DEFAULTS, TRANSITION_EASINGS, TRANSITION_VARIANTS, type TransitionConfig, type TransitionEndConfig, type TransitionProperties, type Variants };
@@ -0,0 +1,9 @@
"use strict";
module.exports = {
parserOptions: {
ecmaFeatures: {
jsx: true
}
}
};
@@ -0,0 +1 @@
{"name":"array-union","version":"2.1.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532102732,"integrity":"sha512-AuRtcKI1Kv9ach9/tTTBguvkz8HmotwgPCk75nJd3uc9DMq3LYvS5fT+xMNAszcyhAhGjXFesyy9VXxm2IJryQ==","mode":420,"size":634},"index.d.ts":{"checkedAt":1794532102732,"integrity":"sha512-6ZMlAokU8Z1ETadXunQcvCRfJ4pf4q3OQ0w0w8wuzbJqV/0pp+7FBLjbUjpgxJkFKzOjhVBffV0toBiSV+gqPQ==","mode":420,"size":609},"index.js":{"checkedAt":1794532102732,"integrity":"sha512-L1yCGAsT9bY0xUoZ0hkUQsBig7CQdgnT/nVKwNy1adxyTSNUmZBF+crF4u+2l2jTpT9vcCEKGoJrd8zxbJ7W0w==","mode":420,"size":104},"license":{"checkedAt":1794532093346,"integrity":"sha512-nIst73auX/5NY2Fmv5Y116vWnNrEv4GaIUX3lpZG05rpXJY2S8EX+fpUS5hRjClCM0VdT2Za9DDHXXB5jdSrEw==","mode":420,"size":1109},"readme.md":{"checkedAt":1794532102732,"integrity":"sha512-c1htb3usQ3z3EbbeAbbIxA7tQWt7v3/fIcgaBMA8dPV4Fv4iBPV6S3/A5smSEOC+IkiElR8YuL3U6Zeqd1+zvg==","mode":420,"size":713}}}
@@ -0,0 +1,6 @@
module.exports = {
"longPressMessage": `\u{957F}\u{6309}\u{6216}\u{6309} Alt + \u{5411}\u{4E0B}\u{65B9}\u{5411}\u{952E}\u{4EE5}\u{6253}\u{5F00}\u{83DC}\u{5355}`
};
//# sourceMappingURL=zh-CN.main.js.map
@@ -0,0 +1,25 @@
import createFind from './_createFind.js';
import findLastIndex from './findLastIndex.js';
/**
* This method is like `_.find` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=collection.length-1] The index to search from.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* _.findLast([1, 2, 3, 4], function(n) {
* return n % 2 == 1;
* });
* // => 3
*/
var findLast = createFind(findLastIndex);
export default findLast;
@@ -0,0 +1,3 @@
declare function isString(value: unknown): value is string | String;
export = isString;
@@ -0,0 +1,101 @@
import {focusSafely as $3ad3f6e1647bc98d$export$80f3e147d781571c} from "./focusSafely.mjs";
import {useFocus as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6} from "./useFocus.mjs";
import {useKeyboard as $46d819fcbaf35654$export$8f71654801c2f7cd} from "./useKeyboard.mjs";
import {useSyncRef as $fcPuG$useSyncRef, useObjectRef as $fcPuG$useObjectRef, mergeProps as $fcPuG$mergeProps, getOwnerWindow as $fcPuG$getOwnerWindow, isFocusable as $fcPuG$isFocusable, mergeRefs as $fcPuG$mergeRefs} from "@react-aria/utils";
import $fcPuG$react, {useContext as $fcPuG$useContext, useRef as $fcPuG$useRef, useEffect as $fcPuG$useEffect, forwardRef as $fcPuG$forwardRef} 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.
*/
let $f645667febf57a63$export$f9762fab77588ecb = /*#__PURE__*/ (0, $fcPuG$react).createContext(null);
function $f645667febf57a63$var$useFocusableContext(ref) {
let context = (0, $fcPuG$useContext)($f645667febf57a63$export$f9762fab77588ecb) || {};
(0, $fcPuG$useSyncRef)(context, ref);
// eslint-disable-next-line
let { ref: _, ...otherProps } = context;
return otherProps;
}
const $f645667febf57a63$export$13f3202a3e5ddd5 = /*#__PURE__*/ (0, $fcPuG$react).forwardRef(function FocusableProvider(props, ref) {
let { children: children, ...otherProps } = props;
let objRef = (0, $fcPuG$useObjectRef)(ref);
let context = {
...otherProps,
ref: objRef
};
return /*#__PURE__*/ (0, $fcPuG$react).createElement($f645667febf57a63$export$f9762fab77588ecb.Provider, {
value: context
}, children);
});
function $f645667febf57a63$export$4c014de7c8940b4c(props, domRef) {
let { focusProps: focusProps } = (0, $a1ea59d68270f0dd$export$f8168d8dd8fd66e6)(props);
let { keyboardProps: keyboardProps } = (0, $46d819fcbaf35654$export$8f71654801c2f7cd)(props);
let interactions = (0, $fcPuG$mergeProps)(focusProps, keyboardProps);
let domProps = $f645667febf57a63$var$useFocusableContext(domRef);
let interactionProps = props.isDisabled ? {} : domProps;
let autoFocusRef = (0, $fcPuG$useRef)(props.autoFocus);
(0, $fcPuG$useEffect)(()=>{
if (autoFocusRef.current && domRef.current) (0, $3ad3f6e1647bc98d$export$80f3e147d781571c)(domRef.current);
autoFocusRef.current = false;
}, [
domRef
]);
// Always set a tabIndex so that Safari allows focusing native buttons and inputs.
let tabIndex = props.excludeFromTabOrder ? -1 : 0;
if (props.isDisabled) tabIndex = undefined;
return {
focusableProps: (0, $fcPuG$mergeProps)({
...interactions,
tabIndex: tabIndex
}, interactionProps)
};
}
const $f645667febf57a63$export$35a3bebf7ef2d934 = /*#__PURE__*/ (0, $fcPuG$forwardRef)(({ children: children, ...props }, ref)=>{
ref = (0, $fcPuG$useObjectRef)(ref);
let { focusableProps: focusableProps } = $f645667febf57a63$export$4c014de7c8940b4c(props, ref);
let child = (0, $fcPuG$react).Children.only(children);
(0, $fcPuG$useEffect)(()=>{
if (process.env.NODE_ENV === 'production') return;
let el = ref.current;
if (!el || !(el instanceof (0, $fcPuG$getOwnerWindow)(el).Element)) {
console.error('<Focusable> child must forward its ref to a DOM element.');
return;
}
if (!props.isDisabled && !(0, $fcPuG$isFocusable)(el)) {
console.warn('<Focusable> child must be focusable. Please ensure the tabIndex prop is passed through.');
return;
}
if (el.localName !== 'button' && el.localName !== 'input' && el.localName !== 'select' && el.localName !== 'textarea' && el.localName !== 'a' && el.localName !== 'area' && el.localName !== 'summary' && el.localName !== 'img' && el.localName !== 'svg') {
let role = el.getAttribute('role');
if (!role) console.warn('<Focusable> child must have an interactive ARIA role.');
else if (// https://w3c.github.io/aria/#widget_roles
role !== 'application' && role !== 'button' && role !== 'checkbox' && role !== 'combobox' && role !== 'gridcell' && role !== 'link' && role !== 'menuitem' && role !== 'menuitemcheckbox' && role !== 'menuitemradio' && role !== 'option' && role !== 'radio' && role !== 'searchbox' && role !== 'separator' && role !== 'slider' && role !== 'spinbutton' && role !== 'switch' && role !== 'tab' && role !== 'tabpanel' && role !== 'textbox' && role !== 'treeitem' && // aria-describedby is also announced on these roles
role !== 'img' && role !== 'meter' && role !== 'progressbar') console.warn(`<Focusable> child must have an interactive ARIA role. Got "${role}".`);
}
}, [
ref,
props.isDisabled
]);
// @ts-ignore
let childRef = parseInt((0, $fcPuG$react).version, 10) < 19 ? child.ref : child.props.ref;
return /*#__PURE__*/ (0, $fcPuG$react).cloneElement(child, {
...(0, $fcPuG$mergeProps)(focusableProps, child.props),
// @ts-ignore
ref: (0, $fcPuG$mergeRefs)(childRef, ref)
});
});
export {$f645667febf57a63$export$f9762fab77588ecb as FocusableContext, $f645667febf57a63$export$13f3202a3e5ddd5 as FocusableProvider, $f645667febf57a63$export$4c014de7c8940b4c as useFocusable, $f645667febf57a63$export$35a3bebf7ef2d934 as Focusable};
//# sourceMappingURL=useFocusable.module.js.map
@@ -0,0 +1,77 @@
import {getRowLabelledBy as $2140fb2337097f2d$export$85069b70317f543} from "./utils.mjs";
import {getLastItem as $2K6sg$getLastItem} from "@react-stately/collections";
import {useGridRow as $2K6sg$useGridRow} from "@react-aria/grid";
import {useSyntheticLinkProps as $2K6sg$useSyntheticLinkProps, mergeProps as $2K6sg$mergeProps} from "@react-aria/utils";
import {tableNestedRows as $2K6sg$tableNestedRows} from "@react-stately/flags";
import {useLocale as $2K6sg$useLocale} from "@react-aria/i18n";
/*
* 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.
*/
const $b2db214c022798eb$var$EXPANSION_KEYS = {
expand: {
ltr: 'ArrowRight',
rtl: 'ArrowLeft'
},
'collapse': {
ltr: 'ArrowLeft',
rtl: 'ArrowRight'
}
};
function $b2db214c022798eb$export$7f2f6ae19e707aa5(props, state, ref) {
let { node: node, isVirtualized: isVirtualized } = props;
let { rowProps: rowProps, ...states } = (0, $2K6sg$useGridRow)(props, state, ref);
let { direction: direction } = (0, $2K6sg$useLocale)();
if (isVirtualized && !((0, $2K6sg$tableNestedRows)() && 'expandedKeys' in state)) rowProps['aria-rowindex'] = node.index + 1 + state.collection.headerRows.length; // aria-rowindex is 1 based
else delete rowProps['aria-rowindex'];
let treeGridRowProps = {};
if ((0, $2K6sg$tableNestedRows)() && 'expandedKeys' in state) {
let treeNode = state.keyMap.get(node.key);
if (treeNode != null) {
var _treeNode_props, _treeNode_props_children, _treeNode_props1, _getLastItem, _state_keyMap_get, _getLastItem1;
let hasChildRows = ((_treeNode_props = treeNode.props) === null || _treeNode_props === void 0 ? void 0 : _treeNode_props.UNSTABLE_childItems) || ((_treeNode_props1 = treeNode.props) === null || _treeNode_props1 === void 0 ? void 0 : (_treeNode_props_children = _treeNode_props1.children) === null || _treeNode_props_children === void 0 ? void 0 : _treeNode_props_children.length) > state.userColumnCount;
var _treeNode_indexOfType, _state_keyMap_get_childNodes, _getLastItem_indexOfType, _getLastItem_indexOfType1;
treeGridRowProps = {
onKeyDown: (e)=>{
if (e.key === $b2db214c022798eb$var$EXPANSION_KEYS['expand'][direction] && state.selectionManager.focusedKey === treeNode.key && hasChildRows && state.expandedKeys !== 'all' && !state.expandedKeys.has(treeNode.key)) {
state.toggleKey(treeNode.key);
e.stopPropagation();
} else if (e.key === $b2db214c022798eb$var$EXPANSION_KEYS['collapse'][direction] && state.selectionManager.focusedKey === treeNode.key && hasChildRows && (state.expandedKeys === 'all' || state.expandedKeys.has(treeNode.key))) {
state.toggleKey(treeNode.key);
e.stopPropagation();
}
},
'aria-expanded': hasChildRows ? state.expandedKeys === 'all' || state.expandedKeys.has(node.key) : undefined,
'aria-level': treeNode.level,
'aria-posinset': ((_treeNode_indexOfType = treeNode.indexOfType) !== null && _treeNode_indexOfType !== void 0 ? _treeNode_indexOfType : 0) + 1,
'aria-setsize': treeNode.level > 1 ? ((_getLastItem_indexOfType = (_getLastItem = (0, $2K6sg$getLastItem)((_state_keyMap_get_childNodes = (_state_keyMap_get = state.keyMap.get(treeNode.parentKey)) === null || _state_keyMap_get === void 0 ? void 0 : _state_keyMap_get.childNodes) !== null && _state_keyMap_get_childNodes !== void 0 ? _state_keyMap_get_childNodes : [])) === null || _getLastItem === void 0 ? void 0 : _getLastItem.indexOfType) !== null && _getLastItem_indexOfType !== void 0 ? _getLastItem_indexOfType : 0) + 1 : ((_getLastItem_indexOfType1 = (_getLastItem1 = (0, $2K6sg$getLastItem)(state.collection.body.childNodes)) === null || _getLastItem1 === void 0 ? void 0 : _getLastItem1.indexOfType) !== null && _getLastItem_indexOfType1 !== void 0 ? _getLastItem_indexOfType1 : 0) + 1
};
}
}
let syntheticLinkProps = (0, $2K6sg$useSyntheticLinkProps)(node.props);
let linkProps = states.hasAction ? syntheticLinkProps : {};
return {
rowProps: {
...(0, $2K6sg$mergeProps)(rowProps, treeGridRowProps, linkProps),
'aria-labelledby': (0, $2140fb2337097f2d$export$85069b70317f543)(state, node.key)
},
...states
};
}
export {$b2db214c022798eb$export$7f2f6ae19e707aa5 as useTableRow};
//# sourceMappingURL=useTableRow.module.js.map
@@ -0,0 +1 @@
"use strict";const a=new Set(["Custom ESM Loaders is an experimental feature. This feature could change at any time","Custom ESM Loaders is an experimental feature and might change at any time","Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js."]),{emit:n}=process;process.emit=function(e,t){if(!(e==="warning"&&a.has(t.message)))return Reflect.apply(n,this,arguments)};
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=curryBuildPlanServiceNodeFromClassElementMetadata.spec.d.ts.map
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"B","2":"K D E F A wC"},B:{"1":"0 1 2 3 4 5 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"xC TC J ZB K D E F 0C 1C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC"},E:{"1":"J ZB K D E F A B C L M G 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","2":"2C ZC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z NC uC JD OC","2":"F FD GD HD ID","16":"B"},G:{"1":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"1":"hD"},I:{"1":"TC J I iD jD kD lD vC mD nD"},J:{"1":"D A"},K:{"1":"H","16":"A B C NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"B","2":"A"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:1,C:"console.time and console.timeEnd",D:true};
@@ -0,0 +1 @@
module.exports={C:{"90":0.01519,"115":0.04557,"125":0.02279,"127":0.03038,"128":0.0076,"140":0.02279,"141":0.01519,"142":0.03038,"143":1.76204,"144":0.27342,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 126 129 130 131 132 133 134 135 136 137 138 139 145 146 147 3.5 3.6"},D:{"39":0.0076,"40":0.0076,"41":0.0076,"42":0.0076,"43":0.0076,"44":0.0076,"45":0.0076,"46":0.0076,"47":0.0076,"48":0.0076,"49":0.0076,"50":0.0076,"51":0.0076,"52":0.0076,"53":0.0076,"54":0.0076,"55":0.0076,"56":0.0076,"57":0.0076,"58":0.0076,"59":0.0076,"60":0.0076,"79":0.10633,"87":0.01519,"88":0.0076,"99":0.0076,"101":0.0076,"102":0.1595,"103":0.03038,"104":0.0076,"105":0.03038,"106":0.0076,"109":0.71393,"112":3.69877,"116":0.0076,"117":0.0076,"119":0.01519,"120":0.0076,"121":0.0076,"122":0.01519,"123":0.0076,"125":46.29912,"126":0.34937,"128":0.01519,"129":0.02279,"130":0.03038,"131":0.02279,"132":0.0076,"133":0.0076,"134":0.01519,"135":0.01519,"136":0.11393,"137":0.03038,"138":0.10633,"139":0.58482,"140":2.69623,"141":9.49375,"142":0.10633,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 83 84 85 86 89 90 91 92 93 94 95 96 97 98 100 107 108 110 111 113 114 115 118 124 127 143 144 145"},F:{"67":0.0076,"79":0.0076,"85":0.0076,"86":0.0076,"92":0.01519,"95":0.11393,"120":0.12912,"121":0.03038,"122":0.71393,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 87 88 89 90 91 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.0076,"114":0.3114,"122":0.0076,"130":0.0076,"138":0.0076,"139":0.01519,"140":0.25823,"141":1.66331,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 117 118 119 120 121 123 124 125 126 127 128 129 131 132 133 134 135 136 137 142"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 18.0 18.1 26.1 26.2","15.6":0.06076,"16.6":0.0076,"17.0":0.0076,"17.1":0.0076,"17.2":0.02279,"17.3":0.03038,"17.4":0.03798,"17.5":0.02279,"17.6":0.06836,"18.2":0.08355,"18.3":0.09874,"18.4":0.09114,"18.5-18.6":0.1519,"26.0":0.56203},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00046,"5.0-5.1":0,"6.0-6.1":0.00185,"7.0-7.1":0.00139,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00417,"10.0-10.2":0.00046,"10.3":0.00787,"11.0-11.2":0.11673,"11.3-11.4":0.00278,"12.0-12.1":0.00093,"12.2-12.5":0.0227,"13.0-13.1":0,"13.2":0.00232,"13.3":0.00093,"13.4-13.7":0.00371,"14.0-14.4":0.00787,"14.5-14.8":0.00834,"15.0-15.1":0.00787,"15.2-15.3":0.00602,"15.4":0.00695,"15.5":0.00787,"15.6-15.8":0.10283,"16.0":0.0139,"16.1":0.02594,"16.2":0.01343,"16.3":0.02409,"16.4":0.00602,"16.5":0.01065,"16.6-16.7":0.13757,"17.0":0.00973,"17.1":0.01482,"17.2":0.01065,"17.3":0.01575,"17.4":0.02779,"17.5":0.04771,"17.6-17.7":0.12043,"18.0":0.02733,"18.1":0.05651,"18.2":0.03057,"18.3":0.0982,"18.4":0.05049,"18.5-18.6":2.57448,"26.0":0.31822,"26.1":0.01158},P:{"22":0.01049,"23":0.01049,"24":0.01049,"25":0.04196,"26":0.02098,"27":0.04196,"28":0.32519,"29":0.03147,_:"4 20 21 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0.0048,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0.21164,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.06975},Q:{"14.9":0.03127},O:{"0":0.12506},H:{"0":0},L:{"0":19.87601}};
@@ -0,0 +1,492 @@
'use strict'
const tape = require('tape')
const BufferList = require('../')
const { Buffer } = require('buffer')
tape('indexOf single byte needle', (t) => {
const bl = new BufferList(['abcdefg', 'abcdefg', '12345'])
t.equal(bl.indexOf('e'), 4)
t.equal(bl.indexOf('e', 5), 11)
t.equal(bl.indexOf('e', 12), -1)
t.equal(bl.indexOf('5'), 18)
t.end()
})
tape('indexOf multiple byte needle', (t) => {
const bl = new BufferList(['abcdefg', 'abcdefg'])
t.equal(bl.indexOf('ef'), 4)
t.equal(bl.indexOf('ef', 5), 11)
t.end()
})
tape('indexOf multiple byte needles across buffer boundaries', (t) => {
const bl = new BufferList(['abcdefg', 'abcdefg'])
t.equal(bl.indexOf('fgabc'), 5)
t.end()
})
tape('indexOf takes a Uint8Array search', (t) => {
const bl = new BufferList(['abcdefg', 'abcdefg'])
const search = new Uint8Array([102, 103, 97, 98, 99]) // fgabc
t.equal(bl.indexOf(search), 5)
t.end()
})
tape('indexOf takes a buffer list search', (t) => {
const bl = new BufferList(['abcdefg', 'abcdefg'])
const search = new BufferList('fgabc')
t.equal(bl.indexOf(search), 5)
t.end()
})
tape('indexOf a zero byte needle', (t) => {
const b = new BufferList('abcdef')
const bufEmpty = Buffer.from('')
t.equal(b.indexOf(''), 0)
t.equal(b.indexOf('', 1), 1)
t.equal(b.indexOf('', b.length + 1), b.length)
t.equal(b.indexOf('', Infinity), b.length)
t.equal(b.indexOf(bufEmpty), 0)
t.equal(b.indexOf(bufEmpty, 1), 1)
t.equal(b.indexOf(bufEmpty, b.length + 1), b.length)
t.equal(b.indexOf(bufEmpty, Infinity), b.length)
t.end()
})
tape('indexOf buffers smaller and larger than the needle', (t) => {
const bl = new BufferList(['abcdefg', 'a', 'bcdefg', 'a', 'bcfgab'])
t.equal(bl.indexOf('fgabc'), 5)
t.equal(bl.indexOf('fgabc', 6), 12)
t.equal(bl.indexOf('fgabc', 13), -1)
t.end()
})
// only present in node 6+
;(process.version.substr(1).split('.')[0] >= 6) && tape('indexOf latin1 and binary encoding', (t) => {
const b = new BufferList('abcdef')
// test latin1 encoding
t.equal(
new BufferList(Buffer.from(b.toString('latin1'), 'latin1'))
.indexOf('d', 0, 'latin1'),
3
)
t.equal(
new BufferList(Buffer.from(b.toString('latin1'), 'latin1'))
.indexOf(Buffer.from('d', 'latin1'), 0, 'latin1'),
3
)
t.equal(
new BufferList(Buffer.from('aa\u00e8aa', 'latin1'))
.indexOf('\u00e8', 'latin1'),
2
)
t.equal(
new BufferList(Buffer.from('\u00e8', 'latin1'))
.indexOf('\u00e8', 'latin1'),
0
)
t.equal(
new BufferList(Buffer.from('\u00e8', 'latin1'))
.indexOf(Buffer.from('\u00e8', 'latin1'), 'latin1'),
0
)
// test binary encoding
t.equal(
new BufferList(Buffer.from(b.toString('binary'), 'binary'))
.indexOf('d', 0, 'binary'),
3
)
t.equal(
new BufferList(Buffer.from(b.toString('binary'), 'binary'))
.indexOf(Buffer.from('d', 'binary'), 0, 'binary'),
3
)
t.equal(
new BufferList(Buffer.from('aa\u00e8aa', 'binary'))
.indexOf('\u00e8', 'binary'),
2
)
t.equal(
new BufferList(Buffer.from('\u00e8', 'binary'))
.indexOf('\u00e8', 'binary'),
0
)
t.equal(
new BufferList(Buffer.from('\u00e8', 'binary'))
.indexOf(Buffer.from('\u00e8', 'binary'), 'binary'),
0
)
t.end()
})
tape('indexOf the entire nodejs10 buffer test suite', (t) => {
const b = new BufferList('abcdef')
const bufA = Buffer.from('a')
const bufBc = Buffer.from('bc')
const bufF = Buffer.from('f')
const bufZ = Buffer.from('z')
const stringComparison = 'abcdef'
t.equal(b.indexOf('a'), 0)
t.equal(b.indexOf('a', 1), -1)
t.equal(b.indexOf('a', -1), -1)
t.equal(b.indexOf('a', -4), -1)
t.equal(b.indexOf('a', -b.length), 0)
t.equal(b.indexOf('a', NaN), 0)
t.equal(b.indexOf('a', -Infinity), 0)
t.equal(b.indexOf('a', Infinity), -1)
t.equal(b.indexOf('bc'), 1)
t.equal(b.indexOf('bc', 2), -1)
t.equal(b.indexOf('bc', -1), -1)
t.equal(b.indexOf('bc', -3), -1)
t.equal(b.indexOf('bc', -5), 1)
t.equal(b.indexOf('bc', NaN), 1)
t.equal(b.indexOf('bc', -Infinity), 1)
t.equal(b.indexOf('bc', Infinity), -1)
t.equal(b.indexOf('f'), b.length - 1)
t.equal(b.indexOf('z'), -1)
// empty search tests
t.equal(b.indexOf(bufA), 0)
t.equal(b.indexOf(bufA, 1), -1)
t.equal(b.indexOf(bufA, -1), -1)
t.equal(b.indexOf(bufA, -4), -1)
t.equal(b.indexOf(bufA, -b.length), 0)
t.equal(b.indexOf(bufA, NaN), 0)
t.equal(b.indexOf(bufA, -Infinity), 0)
t.equal(b.indexOf(bufA, Infinity), -1)
t.equal(b.indexOf(bufBc), 1)
t.equal(b.indexOf(bufBc, 2), -1)
t.equal(b.indexOf(bufBc, -1), -1)
t.equal(b.indexOf(bufBc, -3), -1)
t.equal(b.indexOf(bufBc, -5), 1)
t.equal(b.indexOf(bufBc, NaN), 1)
t.equal(b.indexOf(bufBc, -Infinity), 1)
t.equal(b.indexOf(bufBc, Infinity), -1)
t.equal(b.indexOf(bufF), b.length - 1)
t.equal(b.indexOf(bufZ), -1)
t.equal(b.indexOf(0x61), 0)
t.equal(b.indexOf(0x61, 1), -1)
t.equal(b.indexOf(0x61, -1), -1)
t.equal(b.indexOf(0x61, -4), -1)
t.equal(b.indexOf(0x61, -b.length), 0)
t.equal(b.indexOf(0x61, NaN), 0)
t.equal(b.indexOf(0x61, -Infinity), 0)
t.equal(b.indexOf(0x61, Infinity), -1)
t.equal(b.indexOf(0x0), -1)
// test offsets
t.equal(b.indexOf('d', 2), 3)
t.equal(b.indexOf('f', 5), 5)
t.equal(b.indexOf('f', -1), 5)
t.equal(b.indexOf('f', 6), -1)
t.equal(b.indexOf(Buffer.from('d'), 2), 3)
t.equal(b.indexOf(Buffer.from('f'), 5), 5)
t.equal(b.indexOf(Buffer.from('f'), -1), 5)
t.equal(b.indexOf(Buffer.from('f'), 6), -1)
t.equal(Buffer.from('ff').indexOf(Buffer.from('f'), 1, 'ucs2'), -1)
// test invalid and uppercase encoding
t.equal(b.indexOf('b', 'utf8'), 1)
t.equal(b.indexOf('b', 'UTF8'), 1)
t.equal(b.indexOf('62', 'HEX'), 1)
t.throws(() => b.indexOf('bad', 'enc'), TypeError)
// test hex encoding
t.equal(
Buffer.from(b.toString('hex'), 'hex')
.indexOf('64', 0, 'hex'),
3
)
t.equal(
Buffer.from(b.toString('hex'), 'hex')
.indexOf(Buffer.from('64', 'hex'), 0, 'hex'),
3
)
// test base64 encoding
t.equal(
Buffer.from(b.toString('base64'), 'base64')
.indexOf('ZA==', 0, 'base64'),
3
)
t.equal(
Buffer.from(b.toString('base64'), 'base64')
.indexOf(Buffer.from('ZA==', 'base64'), 0, 'base64'),
3
)
// test ascii encoding
t.equal(
Buffer.from(b.toString('ascii'), 'ascii')
.indexOf('d', 0, 'ascii'),
3
)
t.equal(
Buffer.from(b.toString('ascii'), 'ascii')
.indexOf(Buffer.from('d', 'ascii'), 0, 'ascii'),
3
)
// test optional offset with passed encoding
t.equal(Buffer.from('aaaa0').indexOf('30', 'hex'), 4)
t.equal(Buffer.from('aaaa00a').indexOf('3030', 'hex'), 4)
{
// test usc2 encoding
const twoByteString = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2')
t.equal(8, twoByteString.indexOf('\u0395', 4, 'ucs2'))
t.equal(6, twoByteString.indexOf('\u03a3', -4, 'ucs2'))
t.equal(4, twoByteString.indexOf('\u03a3', -6, 'ucs2'))
t.equal(4, twoByteString.indexOf(
Buffer.from('\u03a3', 'ucs2'), -6, 'ucs2'))
t.equal(-1, twoByteString.indexOf('\u03a3', -2, 'ucs2'))
}
const mixedByteStringUcs2 =
Buffer.from('\u039a\u0391abc\u03a3\u03a3\u0395', 'ucs2')
t.equal(6, mixedByteStringUcs2.indexOf('bc', 0, 'ucs2'))
t.equal(10, mixedByteStringUcs2.indexOf('\u03a3', 0, 'ucs2'))
t.equal(-1, mixedByteStringUcs2.indexOf('\u0396', 0, 'ucs2'))
t.equal(
6, mixedByteStringUcs2.indexOf(Buffer.from('bc', 'ucs2'), 0, 'ucs2'))
t.equal(
10, mixedByteStringUcs2.indexOf(Buffer.from('\u03a3', 'ucs2'), 0, 'ucs2'))
t.equal(
-1, mixedByteStringUcs2.indexOf(Buffer.from('\u0396', 'ucs2'), 0, 'ucs2'))
{
const twoByteString = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2')
// Test single char pattern
t.equal(0, twoByteString.indexOf('\u039a', 0, 'ucs2'))
let index = twoByteString.indexOf('\u0391', 0, 'ucs2')
t.equal(2, index, `Alpha - at index ${index}`)
index = twoByteString.indexOf('\u03a3', 0, 'ucs2')
t.equal(4, index, `First Sigma - at index ${index}`)
index = twoByteString.indexOf('\u03a3', 6, 'ucs2')
t.equal(6, index, `Second Sigma - at index ${index}`)
index = twoByteString.indexOf('\u0395', 0, 'ucs2')
t.equal(8, index, `Epsilon - at index ${index}`)
index = twoByteString.indexOf('\u0392', 0, 'ucs2')
t.equal(-1, index, `Not beta - at index ${index}`)
// Test multi-char pattern
index = twoByteString.indexOf('\u039a\u0391', 0, 'ucs2')
t.equal(0, index, `Lambda Alpha - at index ${index}`)
index = twoByteString.indexOf('\u0391\u03a3', 0, 'ucs2')
t.equal(2, index, `Alpha Sigma - at index ${index}`)
index = twoByteString.indexOf('\u03a3\u03a3', 0, 'ucs2')
t.equal(4, index, `Sigma Sigma - at index ${index}`)
index = twoByteString.indexOf('\u03a3\u0395', 0, 'ucs2')
t.equal(6, index, `Sigma Epsilon - at index ${index}`)
}
const mixedByteStringUtf8 = Buffer.from('\u039a\u0391abc\u03a3\u03a3\u0395')
t.equal(5, mixedByteStringUtf8.indexOf('bc'))
t.equal(5, mixedByteStringUtf8.indexOf('bc', 5))
t.equal(5, mixedByteStringUtf8.indexOf('bc', -8))
t.equal(7, mixedByteStringUtf8.indexOf('\u03a3'))
t.equal(-1, mixedByteStringUtf8.indexOf('\u0396'))
// Test complex string indexOf algorithms. Only trigger for long strings.
// Long string that isn't a simple repeat of a shorter string.
let longString = 'A'
for (let i = 66; i < 76; i++) { // from 'B' to 'K'
longString = longString + String.fromCharCode(i) + longString
}
const longBufferString = Buffer.from(longString)
// pattern of 15 chars, repeated every 16 chars in long
let pattern = 'ABACABADABACABA'
for (let i = 0; i < longBufferString.length - pattern.length; i += 7) {
const index = longBufferString.indexOf(pattern, i)
t.equal((i + 15) & ~0xf, index,
`Long ABACABA...-string at index ${i}`)
}
let index = longBufferString.indexOf('AJABACA')
t.equal(510, index, `Long AJABACA, First J - at index ${index}`)
index = longBufferString.indexOf('AJABACA', 511)
t.equal(1534, index, `Long AJABACA, Second J - at index ${index}`)
pattern = 'JABACABADABACABA'
index = longBufferString.indexOf(pattern)
t.equal(511, index, `Long JABACABA..., First J - at index ${index}`)
index = longBufferString.indexOf(pattern, 512)
t.equal(
1535, index, `Long JABACABA..., Second J - at index ${index}`)
// Search for a non-ASCII string in a pure ASCII string.
const asciiString = Buffer.from(
'somethingnotatallsinisterwhichalsoworks')
t.equal(-1, asciiString.indexOf('\x2061'))
t.equal(3, asciiString.indexOf('eth', 0))
// Search in string containing many non-ASCII chars.
const allCodePoints = []
for (let i = 0; i < 65536; i++) {
allCodePoints[i] = i
}
const allCharsString = String.fromCharCode.apply(String, allCodePoints)
const allCharsBufferUtf8 = Buffer.from(allCharsString)
const allCharsBufferUcs2 = Buffer.from(allCharsString, 'ucs2')
// Search for string long enough to trigger complex search with ASCII pattern
// and UC16 subject.
t.equal(-1, allCharsBufferUtf8.indexOf('notfound'))
t.equal(-1, allCharsBufferUcs2.indexOf('notfound'))
// Needle is longer than haystack, but only because it's encoded as UTF-16
t.equal(Buffer.from('aaaa').indexOf('a'.repeat(4), 'ucs2'), -1)
t.equal(Buffer.from('aaaa').indexOf('a'.repeat(4), 'utf8'), 0)
t.equal(Buffer.from('aaaa').indexOf('你好', 'ucs2'), -1)
// Haystack has odd length, but the needle is UCS2.
t.equal(Buffer.from('aaaaa').indexOf('b', 'ucs2'), -1)
{
// Find substrings in Utf8.
const lengths = [1, 3, 15] // Single char, simple and complex.
const indices = [0x5, 0x60, 0x400, 0x680, 0x7ee, 0xFF02, 0x16610, 0x2f77b]
for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
for (let i = 0; i < indices.length; i++) {
const index = indices[i]
let length = lengths[lengthIndex]
if (index + length > 0x7F) {
length = 2 * length
}
if (index + length > 0x7FF) {
length = 3 * length
}
if (index + length > 0xFFFF) {
length = 4 * length
}
const patternBufferUtf8 = allCharsBufferUtf8.slice(index, index + length)
t.equal(index, allCharsBufferUtf8.indexOf(patternBufferUtf8))
const patternStringUtf8 = patternBufferUtf8.toString()
t.equal(index, allCharsBufferUtf8.indexOf(patternStringUtf8))
}
}
}
{
// Find substrings in Usc2.
const lengths = [2, 4, 16] // Single char, simple and complex.
const indices = [0x5, 0x65, 0x105, 0x205, 0x285, 0x2005, 0x2085, 0xfff0]
for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
for (let i = 0; i < indices.length; i++) {
const index = indices[i] * 2
const length = lengths[lengthIndex]
const patternBufferUcs2 =
allCharsBufferUcs2.slice(index, index + length)
t.equal(
index, allCharsBufferUcs2.indexOf(patternBufferUcs2, 0, 'ucs2'))
const patternStringUcs2 = patternBufferUcs2.toString('ucs2')
t.equal(
index, allCharsBufferUcs2.indexOf(patternStringUcs2, 0, 'ucs2'))
}
}
}
[
() => {},
{},
[]
].forEach((val) => {
t.throws(() => b.indexOf(val), TypeError, `"${JSON.stringify(val)}" should throw`)
})
// Test weird offset arguments.
// The following offsets coerce to NaN or 0, searching the whole Buffer
t.equal(b.indexOf('b', undefined), 1)
t.equal(b.indexOf('b', {}), 1)
t.equal(b.indexOf('b', 0), 1)
t.equal(b.indexOf('b', null), 1)
t.equal(b.indexOf('b', []), 1)
// The following offset coerces to 2, in other words +[2] === 2
t.equal(b.indexOf('b', [2]), -1)
// Behavior should match String.indexOf()
t.equal(
b.indexOf('b', undefined),
stringComparison.indexOf('b', undefined))
t.equal(
b.indexOf('b', {}),
stringComparison.indexOf('b', {}))
t.equal(
b.indexOf('b', 0),
stringComparison.indexOf('b', 0))
t.equal(
b.indexOf('b', null),
stringComparison.indexOf('b', null))
t.equal(
b.indexOf('b', []),
stringComparison.indexOf('b', []))
t.equal(
b.indexOf('b', [2]),
stringComparison.indexOf('b', [2]))
// test truncation of Number arguments to uint8
{
const buf = Buffer.from('this is a test')
t.equal(buf.indexOf(0x6973), 3)
t.equal(buf.indexOf(0x697320), 4)
t.equal(buf.indexOf(0x69732069), 2)
t.equal(buf.indexOf(0x697374657374), 0)
t.equal(buf.indexOf(0x69737374), 0)
t.equal(buf.indexOf(0x69737465), 11)
t.equal(buf.indexOf(0x69737465), 11)
t.equal(buf.indexOf(-140), 0)
t.equal(buf.indexOf(-152), 1)
t.equal(buf.indexOf(0xff), -1)
t.equal(buf.indexOf(0xffff), -1)
}
// Test that Uint8Array arguments are okay.
{
const needle = new Uint8Array([0x66, 0x6f, 0x6f])
const haystack = new BufferList(Buffer.from('a foo b foo'))
t.equal(haystack.indexOf(needle), 2)
}
t.end()
})
@@ -0,0 +1 @@
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["info.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH,uBAAuB;AACvB;IACE;;;;;;;OAOG;IACH,sBAPW,MAAM,aAEN,MAAM,EAQhB;IAFC,kBAA0B;IAC1B,iBAAwB;IAK5B,oBAAyB;IACzB,iBAAsB;IACtB,+BAAoC;IACpC,wBAA6B;IAC7B,iBAAsB;IACtB,yBAA8B;IAC9B,gBAAqB;IACrB,2BAAgC;IAEhC,wBAA6B;IAC7B,wDAAoB;CAbnB"}
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = toIdentifier;
var _isValidIdentifier = require("../validators/isValidIdentifier.js");
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
function toIdentifier(input) {
input = input + "";
let name = "";
for (const c of input) {
name += (0, _helperValidatorIdentifier.isIdentifierChar)(c.codePointAt(0)) ? c : "-";
}
name = name.replace(/^[-0-9]+/, "");
name = name.replace(/[-\s]+(.)?/g, function (match, c) {
return c ? c.toUpperCase() : "";
});
if (!(0, _isValidIdentifier.default)(name)) {
name = `_${name}`;
}
return name || "_";
}
//# sourceMappingURL=toIdentifier.js.map
@@ -0,0 +1,19 @@
"use strict";
var SubjectDirectoryAttributes_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SubjectDirectoryAttributes = exports.id_ce_subjectDirectoryAttributes = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const attribute_1 = require("../attribute");
const object_identifiers_1 = require("../object_identifiers");
exports.id_ce_subjectDirectoryAttributes = `${object_identifiers_1.id_ce}.9`;
let SubjectDirectoryAttributes = SubjectDirectoryAttributes_1 = class SubjectDirectoryAttributes extends asn1_schema_1.AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, SubjectDirectoryAttributes_1.prototype);
}
};
exports.SubjectDirectoryAttributes = SubjectDirectoryAttributes;
exports.SubjectDirectoryAttributes = SubjectDirectoryAttributes = SubjectDirectoryAttributes_1 = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence, itemType: attribute_1.Attribute })
], SubjectDirectoryAttributes);
@@ -0,0 +1,70 @@
"use client";
// src/table-checkbox-cell.tsx
import { forwardRef } from "@heroui/system";
import { useDOMRef, filterDOMProps } from "@heroui/react-utils";
import { clsx, dataAttr, mergeProps } from "@heroui/shared-utils";
import { useTableCell, useTableSelectionCheckbox } from "@react-aria/table";
import { useFocusRing } from "@react-aria/focus";
import { Checkbox } from "@heroui/checkbox";
import { VisuallyHidden } from "@react-aria/visually-hidden";
import { jsx } from "react/jsx-runtime";
var TableCheckboxCell = forwardRef((props, ref) => {
var _a, _b;
const {
as,
className,
node,
rowKey,
slots,
state,
color,
disableAnimation,
checkboxesProps,
selectionMode,
classNames,
...otherProps
} = props;
const Component = as || "td";
const shouldFilterDOMProps = typeof Component === "string";
const domRef = useDOMRef(ref);
const { gridCellProps } = useTableCell({ node }, state, domRef);
const { isFocusVisible, focusProps } = useFocusRing();
const { checkboxProps } = useTableSelectionCheckbox({ key: (node == null ? void 0 : node.parentKey) || node.key }, state);
const tdStyles = clsx(classNames == null ? void 0 : classNames.td, className, (_a = node.props) == null ? void 0 : _a.className);
const isSingleSelectionMode = selectionMode === "single";
const { onChange, ...otherCheckboxProps } = checkboxProps;
const isRowSelected = state.selectionManager.isSelected(rowKey);
return /* @__PURE__ */ jsx(
Component,
{
ref: domRef,
"data-focus-visible": dataAttr(isFocusVisible),
"data-selected": dataAttr(isRowSelected),
...mergeProps(
gridCellProps,
focusProps,
filterDOMProps(node.props, {
enabled: shouldFilterDOMProps
}),
otherProps
),
className: (_b = slots.td) == null ? void 0 : _b.call(slots, { class: tdStyles }),
children: isSingleSelectionMode ? /* @__PURE__ */ jsx(VisuallyHidden, { children: checkboxProps["aria-label"] }) : /* @__PURE__ */ jsx(
Checkbox,
{
color,
disableAnimation,
onValueChange: onChange,
...mergeProps(checkboxesProps, otherCheckboxProps)
}
)
}
);
});
TableCheckboxCell.displayName = "HeroUI.TableCheckboxCell";
var table_checkbox_cell_default = TableCheckboxCell;
export {
table_checkbox_cell_default
};
@@ -0,0 +1,25 @@
// src/success.tsx
import { jsx } from "react/jsx-runtime";
var SuccessIcon = (props) => {
return /* @__PURE__ */ jsx(
"svg",
{
fill: "none",
height: "24",
viewBox: "0 0 24 24",
width: "24",
xmlns: "http://www.w3.org/2000/svg",
...props,
children: /* @__PURE__ */ jsx(
"path",
{
d: "\n M12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2Z\n M16.78 9.7L11.11 15.37C10.97 15.51 10.78 15.59 10.58 15.59C10.38 15.59 10.19 15.51 10.05 15.37L7.22 12.54\n C6.93 12.25 6.93 11.77 7.22 11.48C7.51 11.19 7.99 11.19 8.28 11.48L10.58 13.78L15.72 8.64\n C16.01 8.35 16.49 8.35 16.78 8.64C17.07 8.93 17.07 9.4 16.78 9.7Z\n "
}
)
}
);
};
export {
SuccessIcon
};
@@ -0,0 +1,2 @@
// Note: types exposed from `index.d.ts`.
export {mdxjsEsmFromMarkdown, mdxjsEsmToMarkdown} from './lib/index.js'
@@ -0,0 +1,39 @@
// Italian [it]
import dayjs from '../index';
var locale = {
name: 'it',
weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'),
weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
weekStart: 1,
monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
formats: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
relativeTime: {
future: 'tra %s',
past: '%s fa',
s: 'qualche secondo',
m: 'un minuto',
mm: '%d minuti',
h: 'un\'ora',
hh: '%d ore',
d: 'un giorno',
dd: '%d giorni',
M: 'un mese',
MM: '%d mesi',
y: 'un anno',
yy: '%d anni'
},
ordinal: function ordinal(n) {
return n + "\xBA";
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,315 @@
/**
* @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
*/
/**
* @type {VisitorKeys}
*/
const KEYS = {
ArrayExpression: [
"elements"
],
ArrayPattern: [
"elements"
],
ArrowFunctionExpression: [
"params",
"body"
],
AssignmentExpression: [
"left",
"right"
],
AssignmentPattern: [
"left",
"right"
],
AwaitExpression: [
"argument"
],
BinaryExpression: [
"left",
"right"
],
BlockStatement: [
"body"
],
BreakStatement: [
"label"
],
CallExpression: [
"callee",
"arguments"
],
CatchClause: [
"param",
"body"
],
ChainExpression: [
"expression"
],
ClassBody: [
"body"
],
ClassDeclaration: [
"id",
"superClass",
"body"
],
ClassExpression: [
"id",
"superClass",
"body"
],
ConditionalExpression: [
"test",
"consequent",
"alternate"
],
ContinueStatement: [
"label"
],
DebuggerStatement: [],
DoWhileStatement: [
"body",
"test"
],
EmptyStatement: [],
ExperimentalRestProperty: [
"argument"
],
ExperimentalSpreadProperty: [
"argument"
],
ExportAllDeclaration: [
"exported",
"source"
],
ExportDefaultDeclaration: [
"declaration"
],
ExportNamedDeclaration: [
"declaration",
"specifiers",
"source"
],
ExportSpecifier: [
"exported",
"local"
],
ExpressionStatement: [
"expression"
],
ForInStatement: [
"left",
"right",
"body"
],
ForOfStatement: [
"left",
"right",
"body"
],
ForStatement: [
"init",
"test",
"update",
"body"
],
FunctionDeclaration: [
"id",
"params",
"body"
],
FunctionExpression: [
"id",
"params",
"body"
],
Identifier: [],
IfStatement: [
"test",
"consequent",
"alternate"
],
ImportDeclaration: [
"specifiers",
"source"
],
ImportDefaultSpecifier: [
"local"
],
ImportExpression: [
"source"
],
ImportNamespaceSpecifier: [
"local"
],
ImportSpecifier: [
"imported",
"local"
],
JSXAttribute: [
"name",
"value"
],
JSXClosingElement: [
"name"
],
JSXClosingFragment: [],
JSXElement: [
"openingElement",
"children",
"closingElement"
],
JSXEmptyExpression: [],
JSXExpressionContainer: [
"expression"
],
JSXFragment: [
"openingFragment",
"children",
"closingFragment"
],
JSXIdentifier: [],
JSXMemberExpression: [
"object",
"property"
],
JSXNamespacedName: [
"namespace",
"name"
],
JSXOpeningElement: [
"name",
"attributes"
],
JSXOpeningFragment: [],
JSXSpreadAttribute: [
"argument"
],
JSXSpreadChild: [
"expression"
],
JSXText: [],
LabeledStatement: [
"label",
"body"
],
Literal: [],
LogicalExpression: [
"left",
"right"
],
MemberExpression: [
"object",
"property"
],
MetaProperty: [
"meta",
"property"
],
MethodDefinition: [
"key",
"value"
],
NewExpression: [
"callee",
"arguments"
],
ObjectExpression: [
"properties"
],
ObjectPattern: [
"properties"
],
PrivateIdentifier: [],
Program: [
"body"
],
Property: [
"key",
"value"
],
PropertyDefinition: [
"key",
"value"
],
RestElement: [
"argument"
],
ReturnStatement: [
"argument"
],
SequenceExpression: [
"expressions"
],
SpreadElement: [
"argument"
],
StaticBlock: [
"body"
],
Super: [],
SwitchCase: [
"test",
"consequent"
],
SwitchStatement: [
"discriminant",
"cases"
],
TaggedTemplateExpression: [
"tag",
"quasi"
],
TemplateElement: [],
TemplateLiteral: [
"quasis",
"expressions"
],
ThisExpression: [],
ThrowStatement: [
"argument"
],
TryStatement: [
"block",
"handler",
"finalizer"
],
UnaryExpression: [
"argument"
],
UpdateExpression: [
"argument"
],
VariableDeclaration: [
"declarations"
],
VariableDeclarator: [
"id",
"init"
],
WhileStatement: [
"test",
"body"
],
WithStatement: [
"object",
"body"
],
YieldExpression: [
"argument"
]
};
// Types.
const NODE_TYPES = Object.keys(KEYS);
// Freeze the keys.
for (const type of NODE_TYPES) {
Object.freeze(KEYS[type]);
}
Object.freeze(KEYS);
export default KEYS;
@@ -0,0 +1,283 @@
/*
* 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 {CollectionBase, CollectionElement, Key, Node} from '@react-types/shared';
import {PartialNode} from './types';
import React, {ReactElement} from 'react';
interface CollectionBuilderState {
renderer?: (value: any) => ReactElement | null
}
interface CollectReactElement<T> extends ReactElement {
getCollectionNode(props: any, context: any): Generator<PartialNode<T>, void, Node<T>[]>
}
export class CollectionBuilder<T extends object> {
private context?: unknown;
private cache: WeakMap<T, Node<T>> = new WeakMap();
build(props: Partial<CollectionBase<T>>, context?: unknown) {
this.context = context;
return iterable(() => this.iterateCollection(props));
}
private *iterateCollection(props: Partial<CollectionBase<T>>): Generator<Node<T>> {
let {children, items} = props;
if (React.isValidElement<{children: CollectionElement<T>}>(children) && children.type === React.Fragment) {
yield* this.iterateCollection({
children: children.props.children,
items
});
} else if (typeof children === 'function') {
if (!items) {
throw new Error('props.children was a function but props.items is missing');
}
let index = 0;
for (let item of items) {
yield* this.getFullNode({
value: item,
index
}, {renderer: children});
index++;
}
} else {
let items: CollectionElement<T>[] = [];
React.Children.forEach(children, child => {
if (child) {
items.push(child);
}
});
let index = 0;
for (let item of items) {
let nodes = this.getFullNode({
element: item,
index: index
}, {});
for (let node of nodes) {
index++;
yield node;
}
}
}
}
private getKey(item: NonNullable<CollectionElement<T>>, partialNode: PartialNode<T>, state: CollectionBuilderState, parentKey?: Key | null): Key {
if (item.key != null) {
return item.key;
}
if (partialNode.type === 'cell' && partialNode.key != null) {
return `${parentKey}${partialNode.key}`;
}
let v = partialNode.value as any;
if (v != null) {
let key = v.key ?? v.id;
if (key == null) {
throw new Error('No key found for item');
}
return key;
}
return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
}
private getChildState(state: CollectionBuilderState, partialNode: PartialNode<T>) {
return {
renderer: partialNode.renderer || state.renderer
};
}
private *getFullNode(partialNode: PartialNode<T> & {index: number}, state: CollectionBuilderState, parentKey?: Key | null, parentNode?: Node<T>): Generator<Node<T>> {
if (React.isValidElement<{children: CollectionElement<T>}>(partialNode.element) && partialNode.element.type === React.Fragment) {
let children: CollectionElement<T>[] = [];
React.Children.forEach(partialNode.element.props.children, child => {
children.push(child);
});
let index = partialNode.index ?? 0;
for (const child of children) {
yield* this.getFullNode({
element: child,
index: index++
}, state, parentKey, parentNode);
}
return;
}
// If there's a value instead of an element on the node, and a parent renderer function is available,
// use it to render an element for the value.
let element = partialNode.element;
if (!element && partialNode.value && state && state.renderer) {
let cached = this.cache.get(partialNode.value);
if (cached && (!cached.shouldInvalidate || !cached.shouldInvalidate(this.context))) {
cached.index = partialNode.index;
cached.parentKey = parentNode ? parentNode.key : null;
yield cached;
return;
}
element = state.renderer(partialNode.value);
}
// If there's an element with a getCollectionNode function on its type, then it's a supported component.
// Call this function to get a partial node, and recursively build a full node from there.
if (React.isValidElement(element)) {
let type = element.type as unknown as CollectReactElement<T>;
if (typeof type !== 'function' && typeof type.getCollectionNode !== 'function') {
let name = element.type;
throw new Error(`Unknown element <${name}> in collection.`);
}
let childNodes = type.getCollectionNode(element.props, this.context) as Generator<PartialNode<T>, void, Node<T>[]>;
let index = partialNode.index ?? 0;
let result = childNodes.next();
while (!result.done && result.value) {
let childNode = result.value;
partialNode.index = index;
let nodeKey = childNode.key ?? null;
if (nodeKey == null) {
nodeKey = childNode.element ? null : this.getKey(element as NonNullable<CollectionElement<T>>, partialNode, state, parentKey);
}
let nodes = this.getFullNode({
...childNode,
key: nodeKey,
index,
wrapper: compose(partialNode.wrapper, childNode.wrapper)
}, this.getChildState(state, childNode), parentKey ? `${parentKey}${element.key}` : element.key, parentNode);
let children = [...nodes];
for (let node of children) {
// Cache the node based on its value
node.value = childNode.value ?? partialNode.value ?? null;
if (node.value) {
this.cache.set(node.value, node);
}
// The partial node may have specified a type for the child in order to specify a constraint.
// Verify that the full node that was built recursively matches this type.
if (partialNode.type && node.type !== partialNode.type) {
throw new Error(`Unsupported type <${capitalize(node.type)}> in <${capitalize(parentNode?.type ?? 'unknown parent type')}>. Only <${capitalize(partialNode.type)}> is supported.`);
}
index++;
yield node;
}
result = childNodes.next(children);
}
return;
}
// Ignore invalid elements
if (partialNode.key == null || partialNode.type == null) {
return;
}
// Create full node
let builder = this;
let node: Node<T> = {
type: partialNode.type,
props: partialNode.props,
key: partialNode.key,
parentKey: parentNode ? parentNode.key : null,
value: partialNode.value ?? null,
level: parentNode ? parentNode.level + 1 : 0,
index: partialNode.index,
rendered: partialNode.rendered,
textValue: partialNode.textValue ?? '',
'aria-label': partialNode['aria-label'],
wrapper: partialNode.wrapper,
shouldInvalidate: partialNode.shouldInvalidate,
hasChildNodes: partialNode.hasChildNodes || false,
childNodes: iterable(function *() {
if (!partialNode.hasChildNodes || !partialNode.childNodes) {
return;
}
let index = 0;
for (let child of partialNode.childNodes()) {
// Ensure child keys are globally unique by prepending the parent node's key
if (child.key != null) {
// TODO: Remove this line entirely and enforce that users always provide unique keys.
// Currently this line will have issues when a parent has a key `a` and a child with key `bc`
// but another parent has key `ab` and its child has a key `c`. The combined keys would result in both
// children having a key of `abc`.
child.key = `${node.key}${child.key}`;
}
let nodes = builder.getFullNode({...child, index}, builder.getChildState(state, child), node.key, node);
for (let node of nodes) {
index++;
yield node;
}
}
})
};
yield node;
}
}
// Wraps an iterator function as an iterable object, and caches the results.
function iterable<T>(iterator: () => IterableIterator<Node<T>>): Iterable<Node<T>> {
let cache: Array<Node<T>> = [];
let iterable: null | IterableIterator<Node<T>> = null;
return {
*[Symbol.iterator]() {
for (let item of cache) {
yield item;
}
if (!iterable) {
iterable = iterator();
}
for (let item of iterable) {
cache.push(item);
yield item;
}
}
};
}
type Wrapper = (element: ReactElement) => ReactElement;
function compose(outer: Wrapper | void, inner: Wrapper | void): Wrapper | undefined {
if (outer && inner) {
return (element) => outer(inner(element));
}
if (outer) {
return outer;
}
if (inner) {
return inner;
}
}
function capitalize(str: string) {
return str[0].toUpperCase() + str.slice(1);
}
@@ -0,0 +1,51 @@
"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/close.tsx
var close_exports = {};
__export(close_exports, {
CloseIcon: () => CloseIcon
});
module.exports = __toCommonJS(close_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var CloseIcon = (props) => {
const { isSelected, isIndeterminate, disableAnimation, ...otherProps } = props;
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"svg",
{
"aria-hidden": "true",
fill: "none",
focusable: "false",
height: "1em",
role: "presentation",
stroke: "currentColor",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: 2,
viewBox: "0 0 24 24",
width: "1em",
...otherProps,
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M18 6L6 18M6 6l12 12" })
}
);
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
CloseIcon
});
@@ -0,0 +1,75 @@
let p = process || {}, argv = p.argv || [], env = p.env || {}
let isColorSupported =
!(!!env.NO_COLOR || argv.includes("--no-color")) &&
(!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI)
let formatter = (open, close, replace = open) =>
input => {
let string = "" + input, index = string.indexOf(close, open.length)
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close
}
let replaceClose = (string, close, replace, index) => {
let result = "", cursor = 0
do {
result += string.substring(cursor, index) + replace
cursor = index + close.length
index = string.indexOf(close, cursor)
} while (~index)
return result + string.substring(cursor)
}
let createColors = (enabled = isColorSupported) => {
let f = enabled ? formatter : () => String
return {
isColorSupported: enabled,
reset: f("\x1b[0m", "\x1b[0m"),
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
italic: f("\x1b[3m", "\x1b[23m"),
underline: f("\x1b[4m", "\x1b[24m"),
inverse: f("\x1b[7m", "\x1b[27m"),
hidden: f("\x1b[8m", "\x1b[28m"),
strikethrough: f("\x1b[9m", "\x1b[29m"),
black: f("\x1b[30m", "\x1b[39m"),
red: f("\x1b[31m", "\x1b[39m"),
green: f("\x1b[32m", "\x1b[39m"),
yellow: f("\x1b[33m", "\x1b[39m"),
blue: f("\x1b[34m", "\x1b[39m"),
magenta: f("\x1b[35m", "\x1b[39m"),
cyan: f("\x1b[36m", "\x1b[39m"),
white: f("\x1b[37m", "\x1b[39m"),
gray: f("\x1b[90m", "\x1b[39m"),
bgBlack: f("\x1b[40m", "\x1b[49m"),
bgRed: f("\x1b[41m", "\x1b[49m"),
bgGreen: f("\x1b[42m", "\x1b[49m"),
bgYellow: f("\x1b[43m", "\x1b[49m"),
bgBlue: f("\x1b[44m", "\x1b[49m"),
bgMagenta: f("\x1b[45m", "\x1b[49m"),
bgCyan: f("\x1b[46m", "\x1b[49m"),
bgWhite: f("\x1b[47m", "\x1b[49m"),
blackBright: f("\x1b[90m", "\x1b[39m"),
redBright: f("\x1b[91m", "\x1b[39m"),
greenBright: f("\x1b[92m", "\x1b[39m"),
yellowBright: f("\x1b[93m", "\x1b[39m"),
blueBright: f("\x1b[94m", "\x1b[39m"),
magentaBright: f("\x1b[95m", "\x1b[39m"),
cyanBright: f("\x1b[96m", "\x1b[39m"),
whiteBright: f("\x1b[97m", "\x1b[39m"),
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
bgRedBright: f("\x1b[101m", "\x1b[49m"),
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
bgWhiteBright: f("\x1b[107m", "\x1b[49m"),
}
}
module.exports = createColors()
module.exports.createColors = createColors
@@ -0,0 +1,52 @@
'use strict';
var utils = require('../utils.js');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
var noFloatingDecimal = utils.createRule({
name: "no-floating-decimal",
package: "js",
meta: {
type: "layout",
docs: {
description: "Disallow leading or trailing decimal points in numeric literals"
},
schema: [],
fixable: "code",
messages: {
leading: "A leading decimal point can be confused with a dot.",
trailing: "A trailing decimal point can be confused with a dot."
}
},
create(context) {
const sourceCode = context.sourceCode;
return {
Literal(node) {
if (typeof node.value === "number") {
if (node.raw.startsWith(".")) {
context.report({
node,
messageId: "leading",
fix(fixer) {
const tokenBefore = sourceCode.getTokenBefore(node);
const needsSpaceBefore = tokenBefore && tokenBefore.range[1] === node.range[0] && !utils.canTokensBeAdjacent(tokenBefore, `0${node.raw}`);
return fixer.insertTextBefore(node, needsSpaceBefore ? " 0" : "0");
}
});
}
if (node.raw.indexOf(".") === node.raw.length - 1) {
context.report({
node,
messageId: "trailing",
fix: (fixer) => fixer.insertTextAfter(node, "0")
});
}
}
}
};
}
});
module.exports = noFloatingDecimal;
@@ -0,0 +1,27 @@
import { Feature } from '../../motion/features/Feature.mjs';
import { noop } from 'motion-utils';
import { VisualElementDragControls } from './VisualElementDragControls.mjs';
class DragGesture extends Feature {
constructor(node) {
super(node);
this.removeGroupControls = noop;
this.removeListeners = noop;
this.controls = new VisualElementDragControls(node);
}
mount() {
// If we've been provided a DragControls for manual control over the drag gesture,
// subscribe this component to it on mount.
const { dragControls } = this.node.getProps();
if (dragControls) {
this.removeGroupControls = dragControls.subscribe(this.controls);
}
this.removeListeners = this.controls.addListeners() || noop;
}
unmount() {
this.removeGroupControls();
this.removeListeners();
}
}
export { DragGesture };
@@ -0,0 +1,233 @@
'use strict';
var utils = require('../utils.js');
var astUtils = require('@typescript-eslint/utils/ast-utils');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
var _baseRule = utils.createRule({
name: "brace-style",
package: "js",
meta: {
type: "layout",
docs: {
description: "Enforce consistent brace style for blocks"
},
schema: [
{
type: "string",
enum: ["1tbs", "stroustrup", "allman"]
},
{
type: "object",
properties: {
allowSingleLine: {
type: "boolean",
default: false
}
},
additionalProperties: false
}
],
fixable: "whitespace",
messages: {
nextLineOpen: "Opening curly brace does not appear on the same line as controlling statement.",
sameLineOpen: "Opening curly brace appears on the same line as controlling statement.",
blockSameLine: "Statement inside of curly braces should be on next line.",
nextLineClose: "Closing curly brace does not appear on the same line as the subsequent block.",
singleLineClose: "Closing curly brace should be on the same line as opening curly brace or on the line after the previous block.",
sameLineClose: "Closing curly brace appears on the same line as the subsequent block."
}
},
create(context) {
const style = context.options[0] || "1tbs";
const params = context.options[1] || {};
const sourceCode = context.sourceCode;
function removeNewlineBetween(firstToken, secondToken) {
const textRange = [firstToken.range[1], secondToken.range[0]];
const textBetween = sourceCode.text.slice(textRange[0], textRange[1]);
if (textBetween.trim())
return null;
return (fixer) => fixer.replaceTextRange(textRange, " ");
}
function validateCurlyPair(openingCurly, closingCurly) {
const tokenBeforeOpeningCurly = sourceCode.getTokenBefore(openingCurly);
const tokenAfterOpeningCurly = sourceCode.getTokenAfter(openingCurly);
const tokenBeforeClosingCurly = sourceCode.getTokenBefore(closingCurly);
const singleLineException = params.allowSingleLine && utils.isTokenOnSameLine(openingCurly, closingCurly);
if (style !== "allman" && !utils.isTokenOnSameLine(tokenBeforeOpeningCurly, openingCurly)) {
context.report({
node: openingCurly,
messageId: "nextLineOpen",
fix: removeNewlineBetween(
tokenBeforeOpeningCurly,
openingCurly
)
});
}
if (style === "allman" && utils.isTokenOnSameLine(tokenBeforeOpeningCurly, openingCurly) && !singleLineException) {
context.report({
node: openingCurly,
messageId: "sameLineOpen",
fix: (fixer) => fixer.insertTextBefore(openingCurly, "\n")
});
}
if (utils.isTokenOnSameLine(openingCurly, tokenAfterOpeningCurly) && tokenAfterOpeningCurly !== closingCurly && !singleLineException) {
context.report({
node: openingCurly,
messageId: "blockSameLine",
fix: (fixer) => fixer.insertTextAfter(openingCurly, "\n")
});
}
if (tokenBeforeClosingCurly !== openingCurly && !singleLineException && utils.isTokenOnSameLine(tokenBeforeClosingCurly, closingCurly)) {
context.report({
node: closingCurly,
messageId: "singleLineClose",
fix: (fixer) => fixer.insertTextBefore(closingCurly, "\n")
});
}
}
function validateCurlyBeforeKeyword(curlyToken) {
const keywordToken = sourceCode.getTokenAfter(curlyToken);
if (style === "1tbs" && !utils.isTokenOnSameLine(curlyToken, keywordToken)) {
context.report({
node: curlyToken,
messageId: "nextLineClose",
fix: removeNewlineBetween(curlyToken, keywordToken)
});
}
if (style !== "1tbs" && utils.isTokenOnSameLine(curlyToken, keywordToken)) {
context.report({
node: curlyToken,
messageId: "sameLineClose",
fix: (fixer) => fixer.insertTextAfter(curlyToken, "\n")
});
}
}
return {
BlockStatement(node) {
if (!utils.STATEMENT_LIST_PARENTS.has(node.parent.type))
validateCurlyPair(sourceCode.getFirstToken(node), sourceCode.getLastToken(node));
},
StaticBlock(node) {
validateCurlyPair(
sourceCode.getFirstToken(node, { skip: 1 }),
// skip the `static` token
sourceCode.getLastToken(node)
);
},
ClassBody(node) {
validateCurlyPair(sourceCode.getFirstToken(node), sourceCode.getLastToken(node));
},
SwitchStatement(node) {
const closingCurly = sourceCode.getLastToken(node);
const openingCurly = sourceCode.getTokenBefore(node.cases.length ? node.cases[0] : closingCurly);
validateCurlyPair(openingCurly, closingCurly);
},
IfStatement(node) {
if (node.consequent.type === "BlockStatement" && node.alternate) {
validateCurlyBeforeKeyword(sourceCode.getLastToken(node.consequent));
}
},
TryStatement(node) {
validateCurlyBeforeKeyword(sourceCode.getLastToken(node.block));
if (node.handler && node.finalizer) {
validateCurlyBeforeKeyword(sourceCode.getLastToken(node.handler.body));
}
}
};
}
});
const baseRule = /* @__PURE__ */ utils.castRuleModule(_baseRule);
var braceStyle = utils.createRule({
name: "brace-style",
package: "ts",
meta: {
type: "layout",
docs: {
description: "Enforce consistent brace style for blocks"
},
messages: baseRule.meta.messages,
fixable: baseRule.meta.fixable,
hasSuggestions: baseRule.meta.hasSuggestions,
schema: baseRule.meta.schema
},
defaultOptions: ["1tbs"],
create(context) {
const [
style,
{ allowSingleLine } = { allowSingleLine: false }
] = context.options;
const isAllmanStyle = style === "allman";
const sourceCode = context.sourceCode;
const rules = baseRule.create(context);
function validateCurlyPair(openingCurlyToken, closingCurlyToken) {
if (allowSingleLine && astUtils.isTokenOnSameLine(openingCurlyToken, closingCurlyToken)) {
return;
}
const tokenBeforeOpeningCurly = sourceCode.getTokenBefore(openingCurlyToken);
const tokenBeforeClosingCurly = sourceCode.getTokenBefore(closingCurlyToken);
const tokenAfterOpeningCurly = sourceCode.getTokenAfter(openingCurlyToken);
if (!isAllmanStyle && !astUtils.isTokenOnSameLine(tokenBeforeOpeningCurly, openingCurlyToken)) {
context.report({
node: openingCurlyToken,
messageId: "nextLineOpen",
fix: (fixer) => {
const textRange = [
tokenBeforeOpeningCurly.range[1],
openingCurlyToken.range[0]
];
const textBetween = sourceCode.text.slice(
textRange[0],
textRange[1]
);
if (textBetween.trim())
return null;
return fixer.replaceTextRange(textRange, " ");
}
});
}
if (isAllmanStyle && astUtils.isTokenOnSameLine(tokenBeforeOpeningCurly, openingCurlyToken)) {
context.report({
node: openingCurlyToken,
messageId: "sameLineOpen",
fix: (fixer) => fixer.insertTextBefore(openingCurlyToken, "\n")
});
}
if (astUtils.isTokenOnSameLine(openingCurlyToken, tokenAfterOpeningCurly) && tokenAfterOpeningCurly !== closingCurlyToken) {
context.report({
node: openingCurlyToken,
messageId: "blockSameLine",
fix: (fixer) => fixer.insertTextAfter(openingCurlyToken, "\n")
});
}
if (astUtils.isTokenOnSameLine(tokenBeforeClosingCurly, closingCurlyToken) && tokenBeforeClosingCurly !== openingCurlyToken) {
context.report({
node: closingCurlyToken,
messageId: "singleLineClose",
fix: (fixer) => fixer.insertTextBefore(closingCurlyToken, "\n")
});
}
}
return {
...rules,
"TSInterfaceBody, TSModuleBlock": function(node) {
const openingCurly = sourceCode.getFirstToken(node);
const closingCurly = sourceCode.getLastToken(node);
validateCurlyPair(openingCurly, closingCurly);
},
TSEnumDeclaration(node) {
const closingCurly = sourceCode.getLastToken(node);
const members = node.body?.members || node.members;
const openingCurly = sourceCode.getTokenBefore(
members.length ? members[0] : closingCurly
);
validateCurlyPair(openingCurly, closingCurly);
}
};
}
});
module.exports = braceStyle;
@@ -0,0 +1,48 @@
/**
* @file 解析cff编码
* @author mengke01(kekee000@gmail.com)
*/
/**
* 解析cff encoding数据
* See Adobe TN #5176 chapter 12, "Encodings".
*
* @param {Reader} reader 读取器
* @param {number=} start 偏移
* @return {Object} 编码表
*/
export default function parseCFFEncoding(reader, start) {
if (null != start) {
reader.seek(start);
}
let i;
let code;
const encoding = {};
const format = reader.readUint8();
if (format === 0) {
const nCodes = reader.readUint8();
for (i = 0; i < nCodes; i += 1) {
code = reader.readUint8();
encoding[code] = i;
}
}
else if (format === 1) {
const nRanges = reader.readUint8();
code = 1;
for (i = 0; i < nRanges; i += 1) {
const first = reader.readUint8();
const nLeft = reader.readUint8();
for (let j = first; j <= first + nLeft; j += 1) {
encoding[j] = code;
code += 1;
}
}
}
else {
console.warn('unknown encoding format:' + format);
}
return encoding;
}
@@ -0,0 +1 @@
{"name":"@formatjs/ecma402-abstract","version":"2.3.6","requiresBuild":false,"files":{"262.js":{"checkedAt":1794532126376,"integrity":"sha512-M9tD1IZbadyahUiaad7Bf9sfKvXh/6kOzTMcAi5bszC3R3cH7o5fdq3uIykZ+HfkQ5nsiIcls4otADW/Ozi8MQ==","mode":420,"size":10899},"lib/262.js":{"checkedAt":1794532126376,"integrity":"sha512-nGbVdq865l3NJ9jZD+CxBfm3ZunNYQr+2u6uGno6AePQPteXy8qyUdgz9nYOkGNgOnMfqrjXw2GkSPTywSJ2SA==","mode":420,"size":10010},"lib/NumberFormat/ApplyUnsignedRoundingMode.js":{"checkedAt":1794532126377,"integrity":"sha512-gtjtWMHbKYVkQYcMsauSsdf9VjVdMSOHqV/Hx3rgbel89mTw1T+6e3ZrTGo4lmA/GL36APXqAEqs+w5zLQZekg==","mode":420,"size":1013},"NumberFormat/ApplyUnsignedRoundingMode.js":{"checkedAt":1794532126377,"integrity":"sha512-Pl+uvZT4i2JeLE3LZ0cmez9ZxNKfH25fjjkQlcyx8jUm9bqI2fWjgGmo16OTXpAMVkt4ZPoFS12Cpc1OMxT85g==","mode":420,"size":1182},"CanonicalizeLocaleList.js":{"checkedAt":1794532126377,"integrity":"sha512-kdNJG5Teyju77DsHGn5RlDIkdCj73YU1MQc2bb6ZxnTlus4Nmv+25cnRc8xXLHS069mdBPL4hTreaC+k+VOFaA==","mode":420,"size":347},"lib/CanonicalizeLocaleList.js":{"checkedAt":1794532126377,"integrity":"sha512-A+FTBKfLFYEbnUuRHbwbIiqJXC8TEsdOj7r3z2TPMypTZ9t6vEV5m6DnxDMM0EYxI3mgYKDV7B7dzeZVI1QaEg==","mode":420,"size":220},"CanonicalizeTimeZoneName.js":{"checkedAt":1794532126377,"integrity":"sha512-WVhxXdjPkRnFU0u1MU0yKiw0cixADLYS5xjJbqjD4dXX0C8QcBmATTkfChoLXw9KkrFup68ulXENsmu2/E4pHw==","mode":420,"size":709},"lib/CanonicalizeTimeZoneName.js":{"checkedAt":1794532126377,"integrity":"sha512-irFfCWSxFOUfPTySnoiuLRVJURwKYHlevMf0b1MX3VkzoijD4bJgRJ35CzkEi3tmXGXIWaoDoiL7T0MHLSlJ8A==","mode":420,"size":578},"CoerceOptionsToObject.js":{"checkedAt":1794532126377,"integrity":"sha512-EZF3fgkFV5WLGn9Je/lkPosQnBfXrwsxAky81Z1VqxSsdTI85HYag1qX2s2gSTDDXPC3PSjEJny8PRdaLp5e8g==","mode":420,"size":425},"lib/CoerceOptionsToObject.js":{"checkedAt":1794532126377,"integrity":"sha512-Mh+l2GmAb117pn94d7zcj/se61jkCPCjlPgAEX1GhXRLYVubgqovXKoHVZ/Aq8rk7UIufAuLGYKttywEfAMQGA==","mode":420,"size":291},"lib/NumberFormat/CollapseNumberRange.js":{"checkedAt":1794532126378,"integrity":"sha512-N0aPQMv/Q5dLYCTlRkpEws/9lpV9Yc/KknHMIrUGye9QoBa8jxUmRduo/zzI2tTWd8/URajYXF3moJuoQGl+eg==","mode":420,"size":1912},"NumberFormat/CollapseNumberRange.js":{"checkedAt":1794532126378,"integrity":"sha512-NE/m8rHPWudR1p53XnJOuaV1b8FkKYDQKyDUsbiex8ktNLUesullek1j2+JzdF09vP/xNtoT3SIdalbEIgum7g==","mode":420,"size":2033},"lib/NumberFormat/ComputeExponent.js":{"checkedAt":1794532126378,"integrity":"sha512-+68XKSh/zRvDe09eLnHUCd7WyZ5BJ3aGKqxiwxZgcDZBj/r1q3lHG7i0wW11GgKcbukJV5aWiSBY6/WpVP3iSQ==","mode":420,"size":1359},"NumberFormat/ComputeExponent.js":{"checkedAt":1794532126378,"integrity":"sha512-YH17lybBfNmIfLSN1OeVoMFsmCTPoy/M90HxI2m2dX11eS0pZwnBqtiNBaG39F1WnDLVxUoFadu529/ga7HwBw==","mode":420,"size":1651},"lib/NumberFormat/ComputeExponentForMagnitude.js":{"checkedAt":1794532126378,"integrity":"sha512-u9lfaAmxGcAAEeHER+VJCwLGQrjcI8rN0wvQZu5FUKpHR0KG9I3oY1Ae5jZ17u3J9xAO0M27/i2Hu7Xh4QOZ9w==","mode":420,"size":3106},"NumberFormat/ComputeExponentForMagnitude.js":{"checkedAt":1794532126378,"integrity":"sha512-VWh7lpgSGIrxLsNulcNzRdStXnpsxvHX4de73VwVcOm9KDJ80fRuOHPY1hM0+RgzueoMxfixHTal4rYPA3m0+w==","mode":420,"size":3344},"constants.js":{"checkedAt":1794532126378,"integrity":"sha512-EldDYfgVcuFW/9KuQmgwND181o7FsFRTuccC5WU89Lwg17pwrhfIhoChHr7QnthZVkhiUKv5SOLCr+yV2IY9Ww==","mode":420,"size":379},"lib/constants.js":{"checkedAt":1794532126378,"integrity":"sha512-7ech8RCz/V7VaxHlKgLl/JPLKss0aJVTY+0ZJGaTURv/Kd3IzEG+6rQ28ZtSdYduCD7HAwPpLt5Z2dZkLjC00A==","mode":420,"size":146},"lib/types/core.js":{"checkedAt":1794532126379,"integrity":"sha512-TuHIj4w/TkzTTLbAAzm/nW0Db/St469J6HHMiWa4THKdi3VJKsxkE8mmZKwApXlYIjrBPEIp2oxi6+alPk94Pw==","mode":420,"size":11},"types/core.js":{"checkedAt":1794532126379,"integrity":"sha512-f2XGQDoj2T+xSOglmwEtZVKrO/8Xj0p9ap2c7A9gQp/BiZ45tLyozAivx12afHv9sT/DcspjyF6yKwNV601gAA==","mode":420,"size":77},"lib/NumberFormat/CurrencyDigits.js":{"checkedAt":1794532126379,"integrity":"sha512-A3z1urGcREhw9Uh8rS2PqP8Q0lXVW79B1jReL9BqNc8onpkMqwEEcHACwYvIljp6crymLX3YDuHehaUD0KkJ/w==","mode":420,"size":284},"NumberFormat/CurrencyDigits.js":{"checkedAt":1794532126379,"integrity":"sha512-FQfTChZVL0tdBjK6BUZ7LKapgvKzjPYK3sCCxb9C+oVXoxtblEEVkNW7ZgQgwJlWU0gPd810PWNcahg9hJ9CWA==","mode":420,"size":398},"data.js":{"checkedAt":1794532126379,"integrity":"sha512-YRDuXWhTiB5Wa3dqQS96+4RouqYO/qH/nF+1Gwj/dLKz/eG2IYQ3tK9787MHwp1EOiKS6Y2xzrlqXy9AOyhLtA==","mode":420,"size":611},"lib/data.js":{"checkedAt":1794532126379,"integrity":"sha512-FhreR3SiWUEjvLWQP5SJRNYp8sALeDlTYUAOnhs8gol4xbbAHxI99UYuLrvVcbOEQsz3P1n8vBl4sFWD+Ysdiw==","mode":420,"size":475},"lib/types/date-time.js":{"checkedAt":1794532126379,"integrity":"sha512-aiDcz3QGggMh0YafXAwCUogwt/nQLusi1nBoN2pby2nrl7TVlP1sd7V3EMF94zUsDACTLFtwE0sN81lmw6S49A==","mode":420,"size":250},"types/date-time.js":{"checkedAt":1794532126379,"integrity":"sha512-S/c4KAiwKJewfrboBt7zAafvejtfPKtVLPyvcCAND89IuVlwdPuyMhVrHy0WAhGrQCGEpo5kAuE7cvxInR2Ktw==","mode":420,"Line truncated
@@ -0,0 +1 @@
{"version":3,"file":"WeakList.int.spec.d.ts","sourceRoot":"","sources":["../../../../src/common/models/WeakList.int.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,31 @@
'use strict';
var $TypeError = require('es-errors/type');
var isFinite = require('math-intrinsics/isFinite');
var isNaN = require('math-intrinsics/isNaN');
// https://262.ecma-international.org/12.0/#sec-numeric-types-number-add
module.exports = function NumberAdd(x, y) {
if (typeof x !== 'number' || typeof y !== 'number') {
throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers');
}
if (isNaN(x) || isNaN(y) || (x === Infinity && y === -Infinity) || (x === -Infinity && y === Infinity)) {
return NaN;
}
if (!isFinite(x)) {
return x;
}
if (!isFinite(y)) {
return y;
}
if (x === y && x === 0) { // both zeroes
return Infinity / x === -Infinity && Infinity / y === -Infinity ? -0 : +0;
}
// shortcut for the actual spec mechanics
return x + y;
};
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":""}
@@ -0,0 +1,65 @@
{
"name": "@heroui/checkbox",
"version": "2.3.27",
"description": "Checkboxes allow users to select multiple items from a list of individual items, or to mark one individual item as selected.",
"keywords": [
"checkbox"
],
"author": "HeroUI <support@heroui.com>",
"homepage": "https://heroui.com",
"license": "MIT",
"main": "dist/index.js",
"sideEffects": false,
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/heroui-inc/heroui.git",
"directory": "packages/components/checkbox"
},
"bugs": {
"url": "https://github.com/heroui-inc/heroui/issues"
},
"peerDependencies": {
"@heroui/system": ">=2.4.18",
"@heroui/theme": ">=2.4.17",
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0"
},
"dependencies": {
"@react-aria/checkbox": "3.16.2",
"@react-aria/focus": "3.21.2",
"@react-aria/interactions": "3.25.6",
"@react-stately/checkbox": "3.7.2",
"@react-stately/toggle": "3.9.2",
"@react-types/checkbox": "3.10.2",
"@react-types/shared": "3.32.1",
"@heroui/form": "2.1.27",
"@heroui/react-utils": "2.1.14",
"@heroui/shared-utils": "2.1.12",
"@heroui/use-callback-ref": "2.1.8",
"@heroui/use-safe-layout-effect": "2.1.8"
},
"clean-package": "../../../clean-package.config.json",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsup src --dts",
"dev": "pnpm build:fast --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"build:fast": "tsup src"
}
}
@@ -0,0 +1,594 @@
/**
* The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-v22.x/api/stream.html#readable-streams) stream
* (such as [`process.stdin`](https://nodejs.org/docs/latest-v22.x/api/process.html#processstdin)) one line at a time.
*
* To use the promise-based APIs:
*
* ```js
* import * as readline from 'node:readline/promises';
* ```
*
* To use the callback and sync APIs:
*
* ```js
* import * as readline from 'node:readline';
* ```
*
* The following simple example illustrates the basic use of the `node:readline` module.
*
* ```js
* import * as readline from 'node:readline/promises';
* import { stdin as input, stdout as output } from 'node:process';
*
* const rl = readline.createInterface({ input, output });
*
* const answer = await rl.question('What do you think of Node.js? ');
*
* console.log(`Thank you for your valuable feedback: ${answer}`);
*
* rl.close();
* ```
*
* Once this code is invoked, the Node.js application will not terminate until the `readline.Interface` is closed because the interface waits for data to be
* received on the `input` stream.
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/readline.js)
*/
declare module "readline" {
import { Abortable, EventEmitter } from "node:events";
import * as promises from "node:readline/promises";
export { promises };
export interface Key {
sequence?: string | undefined;
name?: string | undefined;
ctrl?: boolean | undefined;
meta?: boolean | undefined;
shift?: boolean | undefined;
}
/**
* Instances of the `readline.Interface` class are constructed using the `readline.createInterface()` method. Every instance is associated with a
* single `input` [Readable](https://nodejs.org/docs/latest-v22.x/api/stream.html#readable-streams) stream and a single `output` [Writable](https://nodejs.org/docs/latest-v22.x/api/stream.html#writable-streams) stream.
* The `output` stream is used to print prompts for user input that arrives on,
* and is read from, the `input` stream.
* @since v0.1.104
*/
export class Interface extends EventEmitter implements Disposable {
readonly terminal: boolean;
/**
* The current input data being processed by node.
*
* This can be used when collecting input from a TTY stream to retrieve the
* current value that has been processed thus far, prior to the `line` event
* being emitted. Once the `line` event has been emitted, this property will
* be an empty string.
*
* Be aware that modifying the value during the instance runtime may have
* unintended consequences if `rl.cursor` is not also controlled.
*
* **If not using a TTY stream for input, use the `'line'` event.**
*
* One possible use case would be as follows:
*
* ```js
* const values = ['lorem ipsum', 'dolor sit amet'];
* const rl = readline.createInterface(process.stdin);
* const showResults = debounce(() => {
* console.log(
* '\n',
* values.filter((val) => val.startsWith(rl.line)).join(' '),
* );
* }, 300);
* process.stdin.on('keypress', (c, k) => {
* showResults();
* });
* ```
* @since v0.1.98
*/
readonly line: string;
/**
* The cursor position relative to `rl.line`.
*
* This will track where the current cursor lands in the input string, when
* reading input from a TTY stream. The position of cursor determines the
* portion of the input string that will be modified as input is processed,
* as well as the column where the terminal caret will be rendered.
* @since v0.1.98
*/
readonly cursor: number;
/**
* NOTE: According to the documentation:
*
* > Instances of the `readline.Interface` class are constructed using the
* > `readline.createInterface()` method.
*
* @see https://nodejs.org/dist/latest-v22.x/docs/api/readline.html#class-interfaceconstructor
*/
protected constructor(
input: NodeJS.ReadableStream,
output?: NodeJS.WritableStream,
completer?: Completer | AsyncCompleter,
terminal?: boolean,
);
/**
* NOTE: According to the documentation:
*
* > Instances of the `readline.Interface` class are constructed using the
* > `readline.createInterface()` method.
*
* @see https://nodejs.org/dist/latest-v22.x/docs/api/readline.html#class-interfaceconstructor
*/
protected constructor(options: ReadLineOptions);
/**
* The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`.
* @since v15.3.0, v14.17.0
* @return the current prompt string
*/
getPrompt(): string;
/**
* The `rl.setPrompt()` method sets the prompt that will be written to `output` whenever `rl.prompt()` is called.
* @since v0.1.98
*/
setPrompt(prompt: string): void;
/**
* The `rl.prompt()` method writes the `Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new
* location at which to provide input.
*
* When called, `rl.prompt()` will resume the `input` stream if it has been
* paused.
*
* If the `Interface` was created with `output` set to `null` or `undefined` the prompt is not written.
* @since v0.1.98
* @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`.
*/
prompt(preserveCursor?: boolean): void;
/**
* The `rl.question()` method displays the `query` by writing it to the `output`,
* waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument.
*
* When called, `rl.question()` will resume the `input` stream if it has been
* paused.
*
* If the `Interface` was created with `output` set to `null` or `undefined` the `query` is not written.
*
* The `callback` function passed to `rl.question()` does not follow the typical
* pattern of accepting an `Error` object or `null` as the first argument.
* The `callback` is called with the provided answer as the only argument.
*
* An error will be thrown if calling `rl.question()` after `rl.close()`.
*
* Example usage:
*
* ```js
* rl.question('What is your favorite food? ', (answer) => {
* console.log(`Oh, so your favorite food is ${answer}`);
* });
* ```
*
* Using an `AbortController` to cancel a question.
*
* ```js
* const ac = new AbortController();
* const signal = ac.signal;
*
* rl.question('What is your favorite food? ', { signal }, (answer) => {
* console.log(`Oh, so your favorite food is ${answer}`);
* });
*
* signal.addEventListener('abort', () => {
* console.log('The food question timed out');
* }, { once: true });
*
* setTimeout(() => ac.abort(), 10000);
* ```
* @since v0.3.3
* @param query A statement or query to write to `output`, prepended to the prompt.
* @param callback A callback function that is invoked with the user's input in response to the `query`.
*/
question(query: string, callback: (answer: string) => void): void;
question(query: string, options: Abortable, callback: (answer: string) => void): void;
/**
* The `rl.pause()` method pauses the `input` stream, allowing it to be resumed
* later if necessary.
*
* Calling `rl.pause()` does not immediately pause other events (including `'line'`) from being emitted by the `Interface` instance.
* @since v0.3.4
*/
pause(): this;
/**
* The `rl.resume()` method resumes the `input` stream if it has been paused.
* @since v0.3.4
*/
resume(): this;
/**
* The `rl.close()` method closes the `Interface` instance and
* relinquishes control over the `input` and `output` streams. When called,
* the `'close'` event will be emitted.
*
* Calling `rl.close()` does not immediately stop other events (including `'line'`)
* from being emitted by the `Interface` instance.
* @since v0.1.98
*/
close(): void;
/**
* Alias for `rl.close()`.
* @since v22.15.0
*/
[Symbol.dispose](): void;
/**
* The `rl.write()` method will write either `data` or a key sequence identified
* by `key` to the `output`. The `key` argument is supported only if `output` is
* a `TTY` text terminal. See `TTY keybindings` for a list of key
* combinations.
*
* If `key` is specified, `data` is ignored.
*
* When called, `rl.write()` will resume the `input` stream if it has been
* paused.
*
* If the `Interface` was created with `output` set to `null` or `undefined` the `data` and `key` are not written.
*
* ```js
* rl.write('Delete this!');
* // Simulate Ctrl+U to delete the line written previously
* rl.write(null, { ctrl: true, name: 'u' });
* ```
*
* The `rl.write()` method will write the data to the `readline` `Interface`'s `input` _as if it were provided by the user_.
* @since v0.1.98
*/
write(data: string | Buffer, key?: Key): void;
write(data: undefined | null | string | Buffer, key: Key): void;
/**
* Returns the real position of the cursor in relation to the input
* prompt + string. Long input (wrapping) strings, as well as multiple
* line prompts are included in the calculations.
* @since v13.5.0, v12.16.0
*/
getCursorPos(): CursorPos;
/**
* events.EventEmitter
* 1. close
* 2. line
* 3. pause
* 4. resume
* 5. SIGCONT
* 6. SIGINT
* 7. SIGTSTP
* 8. history
*/
addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: "close", listener: () => void): this;
addListener(event: "line", listener: (input: string) => void): this;
addListener(event: "pause", listener: () => void): this;
addListener(event: "resume", listener: () => void): this;
addListener(event: "SIGCONT", listener: () => void): this;
addListener(event: "SIGINT", listener: () => void): this;
addListener(event: "SIGTSTP", listener: () => void): this;
addListener(event: "history", listener: (history: string[]) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: "close"): boolean;
emit(event: "line", input: string): boolean;
emit(event: "pause"): boolean;
emit(event: "resume"): boolean;
emit(event: "SIGCONT"): boolean;
emit(event: "SIGINT"): boolean;
emit(event: "SIGTSTP"): boolean;
emit(event: "history", history: string[]): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: "close", listener: () => void): this;
on(event: "line", listener: (input: string) => void): this;
on(event: "pause", listener: () => void): this;
on(event: "resume", listener: () => void): this;
on(event: "SIGCONT", listener: () => void): this;
on(event: "SIGINT", listener: () => void): this;
on(event: "SIGTSTP", listener: () => void): this;
on(event: "history", listener: (history: string[]) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: "close", listener: () => void): this;
once(event: "line", listener: (input: string) => void): this;
once(event: "pause", listener: () => void): this;
once(event: "resume", listener: () => void): this;
once(event: "SIGCONT", listener: () => void): this;
once(event: "SIGINT", listener: () => void): this;
once(event: "SIGTSTP", listener: () => void): this;
once(event: "history", listener: (history: string[]) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: "close", listener: () => void): this;
prependListener(event: "line", listener: (input: string) => void): this;
prependListener(event: "pause", listener: () => void): this;
prependListener(event: "resume", listener: () => void): this;
prependListener(event: "SIGCONT", listener: () => void): this;
prependListener(event: "SIGINT", listener: () => void): this;
prependListener(event: "SIGTSTP", listener: () => void): this;
prependListener(event: "history", listener: (history: string[]) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: "close", listener: () => void): this;
prependOnceListener(event: "line", listener: (input: string) => void): this;
prependOnceListener(event: "pause", listener: () => void): this;
prependOnceListener(event: "resume", listener: () => void): this;
prependOnceListener(event: "SIGCONT", listener: () => void): this;
prependOnceListener(event: "SIGINT", listener: () => void): this;
prependOnceListener(event: "SIGTSTP", listener: () => void): this;
prependOnceListener(event: "history", listener: (history: string[]) => void): this;
[Symbol.asyncIterator](): NodeJS.AsyncIterator<string>;
}
export type ReadLine = Interface; // type forwarded for backwards compatibility
export type Completer = (line: string) => CompleterResult;
export type AsyncCompleter = (
line: string,
callback: (err?: null | Error, result?: CompleterResult) => void,
) => void;
export type CompleterResult = [string[], string];
export interface ReadLineOptions {
/**
* The [`Readable`](https://nodejs.org/docs/latest-v22.x/api/stream.html#readable-streams) stream to listen to
*/
input: NodeJS.ReadableStream;
/**
* The [`Writable`](https://nodejs.org/docs/latest-v22.x/api/stream.html#writable-streams) stream to write readline data to.
*/
output?: NodeJS.WritableStream | undefined;
/**
* An optional function used for Tab autocompletion.
*/
completer?: Completer | AsyncCompleter | undefined;
/**
* `true` if the `input` and `output` streams should be treated like a TTY,
* and have ANSI/VT100 escape codes written to it.
* Default: checking `isTTY` on the `output` stream upon instantiation.
*/
terminal?: boolean | undefined;
/**
* Initial list of history lines.
* This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check,
* otherwise the history caching mechanism is not initialized at all.
* @default []
*/
history?: string[] | undefined;
/**
* Maximum number of history lines retained.
* To disable the history set this value to `0`.
* This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check,
* otherwise the history caching mechanism is not initialized at all.
* @default 30
*/
historySize?: number | undefined;
/**
* If `true`, when a new input line added to the history list duplicates an older one,
* this removes the older line from the list.
* @default false
*/
removeHistoryDuplicates?: boolean | undefined;
/**
* The prompt string to use.
* @default "> "
*/
prompt?: string | undefined;
/**
* If the delay between `\r` and `\n` exceeds `crlfDelay` milliseconds,
* both `\r` and `\n` will be treated as separate end-of-line input.
* `crlfDelay` will be coerced to a number no less than `100`.
* It can be set to `Infinity`, in which case
* `\r` followed by `\n` will always be considered a single newline
* (which may be reasonable for [reading files](https://nodejs.org/docs/latest-v22.x/api/readline.html#example-read-file-stream-line-by-line) with `\r\n` line delimiter).
* @default 100
*/
crlfDelay?: number | undefined;
/**
* The duration `readline` will wait for a character
* (when reading an ambiguous key sequence in milliseconds
* one that can both form a complete key sequence using the input read so far
* and can take additional input to complete a longer key sequence).
* @default 500
*/
escapeCodeTimeout?: number | undefined;
/**
* The number of spaces a tab is equal to (minimum 1).
* @default 8
*/
tabSize?: number | undefined;
/**
* Allows closing the interface using an AbortSignal.
* Aborting the signal will internally call `close` on the interface.
*/
signal?: AbortSignal | undefined;
}
/**
* The `readline.createInterface()` method creates a new `readline.Interface` instance.
*
* ```js
* import readline from 'node:readline';
* const rl = readline.createInterface({
* input: process.stdin,
* output: process.stdout,
* });
* ```
*
* Once the `readline.Interface` instance is created, the most common case is to
* listen for the `'line'` event:
*
* ```js
* rl.on('line', (line) => {
* console.log(`Received: ${line}`);
* });
* ```
*
* If `terminal` is `true` for this instance then the `output` stream will get
* the best compatibility if it defines an `output.columns` property and emits
* a `'resize'` event on the `output` if or when the columns ever change
* (`process.stdout` does this automatically when it is a TTY).
*
* When creating a `readline.Interface` using `stdin` as input, the program
* will not terminate until it receives an [EOF character](https://en.wikipedia.org/wiki/End-of-file#EOF_character). To exit without
* waiting for user input, call `process.stdin.unref()`.
* @since v0.1.98
*/
export function createInterface(
input: NodeJS.ReadableStream,
output?: NodeJS.WritableStream,
completer?: Completer | AsyncCompleter,
terminal?: boolean,
): Interface;
export function createInterface(options: ReadLineOptions): Interface;
/**
* The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input.
*
* Optionally, `interface` specifies a `readline.Interface` instance for which
* autocompletion is disabled when copy-pasted input is detected.
*
* If the `stream` is a `TTY`, then it must be in raw mode.
*
* This is automatically called by any readline instance on its `input` if the `input` is a terminal. Closing the `readline` instance does not stop
* the `input` from emitting `'keypress'` events.
*
* ```js
* readline.emitKeypressEvents(process.stdin);
* if (process.stdin.isTTY)
* process.stdin.setRawMode(true);
* ```
*
* ## Example: Tiny CLI
*
* The following example illustrates the use of `readline.Interface` class to
* implement a small command-line interface:
*
* ```js
* import readline from 'node:readline';
* const rl = readline.createInterface({
* input: process.stdin,
* output: process.stdout,
* prompt: 'OHAI> ',
* });
*
* rl.prompt();
*
* rl.on('line', (line) => {
* switch (line.trim()) {
* case 'hello':
* console.log('world!');
* break;
* default:
* console.log(`Say what? I might have heard '${line.trim()}'`);
* break;
* }
* rl.prompt();
* }).on('close', () => {
* console.log('Have a great day!');
* process.exit(0);
* });
* ```
*
* ## Example: Read file stream line-by-Line
*
* A common use case for `readline` is to consume an input file one line at a
* time. The easiest way to do so is leveraging the `fs.ReadStream` API as
* well as a `for await...of` loop:
*
* ```js
* import fs from 'node:fs';
* import readline from 'node:readline';
*
* async function processLineByLine() {
* const fileStream = fs.createReadStream('input.txt');
*
* const rl = readline.createInterface({
* input: fileStream,
* crlfDelay: Infinity,
* });
* // Note: we use the crlfDelay option to recognize all instances of CR LF
* // ('\r\n') in input.txt as a single line break.
*
* for await (const line of rl) {
* // Each line in input.txt will be successively available here as `line`.
* console.log(`Line from file: ${line}`);
* }
* }
*
* processLineByLine();
* ```
*
* Alternatively, one could use the `'line'` event:
*
* ```js
* import fs from 'node:fs';
* import readline from 'node:readline';
*
* const rl = readline.createInterface({
* input: fs.createReadStream('sample.txt'),
* crlfDelay: Infinity,
* });
*
* rl.on('line', (line) => {
* console.log(`Line from file: ${line}`);
* });
* ```
*
* Currently, `for await...of` loop can be a bit slower. If `async` / `await` flow and speed are both essential, a mixed approach can be applied:
*
* ```js
* import { once } from 'node:events';
* import { createReadStream } from 'node:fs';
* import { createInterface } from 'node:readline';
*
* (async function processLineByLine() {
* try {
* const rl = createInterface({
* input: createReadStream('big-file.txt'),
* crlfDelay: Infinity,
* });
*
* rl.on('line', (line) => {
* // Process the line.
* });
*
* await once(rl, 'close');
*
* console.log('File processed.');
* } catch (err) {
* console.error(err);
* }
* })();
* ```
* @since v0.7.7
*/
export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
export type Direction = -1 | 0 | 1;
export interface CursorPos {
rows: number;
cols: number;
}
/**
* The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-v22.x/api/tty.html) stream
* in a specified direction identified by `dir`.
* @since v0.7.7
* @param callback Invoked once the operation completes.
* @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
*/
export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
/**
* The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-v22.x/api/tty.html) stream from
* the current position of the cursor down.
* @since v0.7.7
* @param callback Invoked once the operation completes.
* @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
*/
export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
/**
* The `readline.cursorTo()` method moves cursor to the specified position in a
* given [TTY](https://nodejs.org/docs/latest-v22.x/api/tty.html) `stream`.
* @since v0.7.7
* @param callback Invoked once the operation completes.
* @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
*/
export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
/**
* The `readline.moveCursor()` method moves the cursor _relative_ to its current
* position in a given [TTY](https://nodejs.org/docs/latest-v22.x/api/tty.html) `stream`.
* @since v0.7.7
* @param callback Invoked once the operation completes.
* @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
*/
export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
}
declare module "node:readline" {
export * from "readline";
}
@@ -0,0 +1,144 @@
/**
* @fileoverview Disallow multiple spaces between inline JSX props
* @author Adrian Moennich
*/
'use strict';
const docsUrl = require('../util/docsUrl');
const eslintUtil = require('../util/eslint');
const report = require('../util/report');
const propsUtil = require('../util/props');
const getSourceCode = eslintUtil.getSourceCode;
const getText = eslintUtil.getText;
// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------
const messages = {
noLineGap: 'Expected no line gap between “{{prop1}}” and “{{prop2}}”',
onlyOneSpace: 'Expected only one space between “{{prop1}}” and “{{prop2}}”',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Disallow multiple spaces between inline JSX props',
category: 'Stylistic Issues',
recommended: false,
url: docsUrl('jsx-props-no-multi-spaces'),
},
fixable: 'code',
messages,
schema: [],
},
create(context) {
const sourceCode = getSourceCode(context);
function getPropName(propNode) {
switch (propNode.type) {
case 'JSXSpreadAttribute':
return getText(context, propNode.argument);
case 'JSXIdentifier':
return propNode.name;
case 'JSXMemberExpression':
return `${getPropName(propNode.object)}.${propNode.property.name}`;
default:
return propNode.name
? propNode.name.name
: `${getText(context, propNode.object)}.${propNode.property.name}`; // needed for typescript-eslint parser
}
}
// First and second must be adjacent nodes
function hasEmptyLines(first, second) {
const comments = sourceCode.getCommentsBefore ? sourceCode.getCommentsBefore(second) : [];
const nodes = [].concat(first, comments, second);
for (let i = 1; i < nodes.length; i += 1) {
const prev = nodes[i - 1];
const curr = nodes[i];
if (curr.loc.start.line - prev.loc.end.line >= 2) {
return true;
}
}
return false;
}
function checkSpacing(prev, node) {
if (hasEmptyLines(prev, node)) {
report(context, messages.noLineGap, 'noLineGap', {
node,
data: {
prop1: getPropName(prev),
prop2: getPropName(node),
},
});
}
if (prev.loc.end.line !== node.loc.end.line) {
return;
}
const between = getSourceCode(context).text.slice(prev.range[1], node.range[0]);
if (between !== ' ') {
report(context, messages.onlyOneSpace, 'onlyOneSpace', {
node,
data: {
prop1: getPropName(prev),
prop2: getPropName(node),
},
fix(fixer) {
return fixer.replaceTextRange([prev.range[1], node.range[0]], ' ');
},
});
}
}
function containsGenericType(node) {
const nodeTypeArguments = propsUtil.getTypeArguments(node);
if (typeof nodeTypeArguments === 'undefined') {
return false;
}
return nodeTypeArguments.type === 'TSTypeParameterInstantiation';
}
function getGenericNode(node) {
const name = node.name;
if (containsGenericType(node)) {
const nodeTypeArguments = propsUtil.getTypeArguments(node);
return Object.assign(
{},
node,
{
range: [
name.range[0],
nodeTypeArguments.range[1],
],
}
);
}
return name;
}
return {
JSXOpeningElement(node) {
node.attributes.reduce((prev, prop) => {
checkSpacing(prev, prop);
return prop;
}, getGenericNode(node));
},
};
},
};
@@ -0,0 +1,6 @@
import Bold from './bold.js';
declare class Italic extends Bold {
static blotName: string;
static tagName: string[];
}
export default Italic;
@@ -0,0 +1,168 @@
# micromark-util-symbol
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]
[micromark][] utility with symbols.
## Contents
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This package exposes constants used throughout the micromark ecosystem.
## When should I use this?
This package is useful when you are making your own micromark extensions.
It’s useful to reference these constants by name instead of value while
developing.
[`micromark-build`][micromark-build] compiles them away for production code.
## Install
This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:
```sh
npm install micromark-util-symbol
```
In Deno with [`esm.sh`][esmsh]:
```js
import * as symbol from 'https://esm.sh/micromark-util-symbol@1'
```
In browsers with [`esm.sh`][esmsh]:
```html
<script type="module">
import * as symbol from 'https://esm.sh/micromark-util-symbol@1?bundle'
</script>
```
## Use
```js
import {codes, constants, types, values} from 'micromark-util-symbol'
console.log(codes.atSign) // 64
console.log(constants.characterReferenceNamedSizeMax) // 31
console.log(types.definitionDestinationRaw) // 'definitionDestinationRaw'
console.log(values.atSign) // '@'
```
## API
This package exports the identifiers `codes`, `constants`, `types`, and
`values`.
There is no default export.
Each identifier is an object mapping strings to values.
See the code for the exposed data.
## Types
This package is fully typed with [TypeScript][].
It exports no additional types.
## Compatibility
Projects maintained by the unified collective are compatible with maintained
versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-util-symbol@2`, compatible with Node.js 16.
This package works with `micromark@3`.
## Security
This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.
## Contribute
See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.
This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg
[build]: https://github.com/micromark/micromark/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg
[coverage]: https://codecov.io/github/micromark/micromark
[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-symbol.svg
[downloads]: https://www.npmjs.com/package/micromark-util-symbol
[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-symbol
[bundle-size]: https://bundlejs.com/?q=micromark-util-symbol
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
[opencollective]: https://opencollective.com/unified
[npm]: https://docs.npmjs.com/cli/install
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[esmsh]: https://esm.sh
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
[chat]: https://github.com/micromark/micromark/discussions
[license]: https://github.com/micromark/micromark/blob/main/license
[author]: https://wooorm.com
[health]: https://github.com/micromark/.github
[securitymd]: https://github.com/micromark/.github/blob/main/security.md
[contributing]: https://github.com/micromark/.github/blob/main/contributing.md
[support]: https://github.com/micromark/.github/blob/main/support.md
[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
[typescript]: https://www.typescriptlang.org
[micromark]: https://github.com/micromark/micromark
[micromark-build]: https://github.com/micromark/micromark/tree/main/packages/micromark-build
@@ -0,0 +1,27 @@
var apply = require('./_apply'),
arrayMap = require('./_arrayMap'),
baseIteratee = require('./_baseIteratee'),
baseRest = require('./_baseRest'),
baseUnary = require('./_baseUnary'),
flatRest = require('./_flatRest');
/**
* Creates a function like `_.over`.
*
* @private
* @param {Function} arrayFunc The function to iterate over iteratees.
* @returns {Function} Returns the new over function.
*/
function createOver(arrayFunc) {
return flatRest(function(iteratees) {
iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
return baseRest(function(args) {
var thisArg = this;
return arrayFunc(iteratees, function(iteratee) {
return apply(iteratee, thisArg, args);
});
});
});
}
module.exports = createOver;
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more