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

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

No files matched your search

@@ -0,0 +1,11 @@
import { Binding } from '../../binding/models/Binding';
import { InternalBindingConstraints } from '../../binding/models/BindingConstraintsImplementation';
import { SingleImmutableLinkedList } from '../../common/models/SingleImmutableLinkedList';
import { ResolvedValueElementMetadata } from '../../metadata/models/ResolvedValueElementMetadata';
import { BasePlanParams } from '../models/BasePlanParams';
import { BindingNodeParent } from '../models/BindingNodeParent';
import { PlanBindingNode } from '../models/PlanBindingNode';
import { PlanServiceNode } from '../models/PlanServiceNode';
import { SubplanParams } from '../models/SubplanParams';
export declare function curryLazyBuildPlanServiceNodeFromResolvedValueElementMetadata(buildServiceNodeBindings: (params: BasePlanParams, bindingConstraintsList: SingleImmutableLinkedList<InternalBindingConstraints>, serviceBindings: Binding<unknown>[], parentNode: BindingNodeParent, chainedBindings: boolean) => PlanBindingNode[]): (params: SubplanParams, bindingConstraintsList: SingleImmutableLinkedList<InternalBindingConstraints>, elementMetadata: ResolvedValueElementMetadata) => PlanServiceNode | undefined;
//# sourceMappingURL=curryLazyBuildPlanServiceNodeFromResolvedValueElementMetadata.d.ts.map
@@ -0,0 +1,41 @@
'use strict';
var $TypeError = require('es-errors/type');
// https://262.ecma-international.org/15.0/#sec-arraybufferbytelength
var IsDetachedBuffer = require('./IsDetachedBuffer');
var isArrayBuffer = require('is-array-buffer');
var isSharedArrayBuffer = require('is-shared-array-buffer');
var arrayBufferByteLength = require('array-buffer-byte-length');
var callBound = require('call-bound');
var $sabByteLength = callBound('SharedArrayBuffer.prototype.byteLength', true);
var isGrowable = false; // TODO: support this
module.exports = function ArrayBufferByteLength(arrayBuffer, order) {
var isSAB = isSharedArrayBuffer(arrayBuffer);
if (!isArrayBuffer(arrayBuffer) && !isSAB) {
throw new $TypeError('Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer');
}
if (order !== 'SEQ-CST' && order !== 'UNORDERED') {
throw new $TypeError('Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~');
}
// 1. If IsSharedArrayBuffer(arrayBuffer) is true and arrayBuffer has an [[ArrayBufferByteLengthData]] internal slot, then
// TODO: see if IsFixedLengthArrayBuffer can be used here in the spec instead
if (isSAB && isGrowable) { // step 1
// a. Let bufferByteLengthBlock be arrayBuffer.[[ArrayBufferByteLengthData]].
// b. Let rawLength be GetRawBytesFromSharedBlock(bufferByteLengthBlock, 0, BIGUINT64, true, order).
// c. Let isLittleEndian be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record.
// d. Return ℝ(RawBytesToNumeric(BIGUINT64, rawLength, isLittleEndian)).
}
if (IsDetachedBuffer(arrayBuffer)) {
throw new $TypeError('Assertion failed: `arrayBuffer` must not be detached'); // step 2
}
return isSAB ? $sabByteLength(arrayBuffer) : arrayBufferByteLength(arrayBuffer);
};
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cloneServiceRedirectionBinding = cloneServiceRedirectionBinding;
/**
* Clones a ServiceRedirectionBinding
*/
function cloneServiceRedirectionBinding(binding) {
return {
id: binding.id,
isSatisfiedBy: binding.isSatisfiedBy,
moduleId: binding.moduleId,
serviceIdentifier: binding.serviceIdentifier,
targetServiceIdentifier: binding.targetServiceIdentifier,
type: binding.type,
};
}
//# sourceMappingURL=cloneServiceRedirectionBinding.js.map
@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = pathSkewX;
var _computeBoundingBox = require("./computeBoundingBox");
/**
* @file 按X轴平移变换, 变换中心为图像中心点
* @author mengke01(kekee000@gmail.com)
*/
/**
* path倾斜变换
*
* @param {Object} contour 坐标点
* @param {number} angle 角度
*
* @return {Object} contour 坐标点
*/
function pathSkewX(contour, angle) {
angle = angle === undefined ? 0 : angle;
var y = (0, _computeBoundingBox.computePath)(contour).y;
var tan = Math.tan(angle);
var p;
// x 平移
for (var i = 0, l = contour.length; i < l; i++) {
p = contour[i];
p.x += tan * (p.y - y);
}
return contour;
}
@@ -0,0 +1,88 @@
import {useCheckbox as $406796ff087fe49b$export$e375f10ce42261c5} from "./useCheckbox.mjs";
import {checkboxGroupData as $1ae600c947479353$export$ec98120685d4f57d} from "./utils.mjs";
import {useFormValidationState as $6clEo$useFormValidationState, DEFAULT_VALIDATION_RESULT as $6clEo$DEFAULT_VALIDATION_RESULT, privateValidationStateProp as $6clEo$privateValidationStateProp} from "@react-stately/form";
import {useRef as $6clEo$useRef, useEffect as $6clEo$useEffect} from "react";
import {useToggleState as $6clEo$useToggleState} from "@react-stately/toggle";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $fba3e38d5ca8983f$export$353b32fc6898d37d(props, state, inputRef) {
const toggleState = (0, $6clEo$useToggleState)({
isReadOnly: props.isReadOnly || state.isReadOnly,
isSelected: state.isSelected(props.value),
defaultSelected: state.defaultValue.includes(props.value),
onChange (isSelected) {
if (isSelected) state.addValue(props.value);
else state.removeValue(props.value);
if (props.onChange) props.onChange(isSelected);
}
});
let { name: name, form: form, descriptionId: descriptionId, errorMessageId: errorMessageId, validationBehavior: validationBehavior } = (0, $1ae600c947479353$export$ec98120685d4f57d).get(state);
var _props_validationBehavior;
validationBehavior = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : validationBehavior;
// Local validation for this checkbox.
let { realtimeValidation: realtimeValidation } = (0, $6clEo$useFormValidationState)({
...props,
value: toggleState.isSelected,
// Server validation is handled at the group level.
name: undefined,
validationBehavior: 'aria'
});
// Update the checkbox group state when realtime validation changes.
let nativeValidation = (0, $6clEo$useRef)((0, $6clEo$DEFAULT_VALIDATION_RESULT));
let updateValidation = ()=>{
state.setInvalid(props.value, realtimeValidation.isInvalid ? realtimeValidation : nativeValidation.current);
};
(0, $6clEo$useEffect)(updateValidation);
// Combine group and checkbox level validation.
let combinedRealtimeValidation = state.realtimeValidation.isInvalid ? state.realtimeValidation : realtimeValidation;
let displayValidation = validationBehavior === 'native' ? state.displayValidation : combinedRealtimeValidation;
var _props_isRequired;
let res = (0, $406796ff087fe49b$export$e375f10ce42261c5)({
...props,
isReadOnly: props.isReadOnly || state.isReadOnly,
isDisabled: props.isDisabled || state.isDisabled,
name: props.name || name,
form: props.form || form,
isRequired: (_props_isRequired = props.isRequired) !== null && _props_isRequired !== void 0 ? _props_isRequired : state.isRequired,
validationBehavior: validationBehavior,
[(0, $6clEo$privateValidationStateProp)]: {
realtimeValidation: combinedRealtimeValidation,
displayValidation: displayValidation,
resetValidation: state.resetValidation,
commitValidation: state.commitValidation,
updateValidation (v) {
nativeValidation.current = v;
updateValidation();
}
}
}, toggleState, inputRef);
return {
...res,
inputProps: {
...res.inputProps,
'aria-describedby': [
props['aria-describedby'],
state.isInvalid ? errorMessageId : null,
descriptionId
].filter(Boolean).join(' ') || undefined
}
};
}
export {$fba3e38d5ca8983f$export$353b32fc6898d37d as useCheckboxGroupItem};
//# sourceMappingURL=useCheckboxGroupItem.module.js.map
@@ -0,0 +1,227 @@
/**
* @fileoverview Disallow trailing spaces at the end of lines.
* @author Nodeca Team <https://github.com/nodeca>
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------
/**
* @import { SourceLocation, SourceRange } from "@eslint/core";
*/
//------------------------------------------------------------------------------
// 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: "no-trailing-spaces",
url: "https://eslint.style/rules/no-trailing-spaces",
},
},
],
},
type: "layout",
docs: {
description: "Disallow trailing whitespace at the end of lines",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-trailing-spaces",
},
fixable: "whitespace",
schema: [
{
type: "object",
properties: {
skipBlankLines: {
type: "boolean",
default: false,
},
ignoreComments: {
type: "boolean",
default: false,
},
},
additionalProperties: false,
},
],
messages: {
trailingSpace: "Trailing spaces not allowed.",
},
},
create(context) {
const sourceCode = context.sourceCode;
const BLANK_CLASS =
"[ \t\u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u3000]",
SKIP_BLANK = `^${BLANK_CLASS}*$`,
NONBLANK = `${BLANK_CLASS}+$`;
const options = context.options[0] || {},
skipBlankLines = options.skipBlankLines || false,
ignoreComments = options.ignoreComments || false;
/**
* Report the error message
* @param {ASTNode} node node to report
* @param {SourceLocation} location range information
* @param {SourceRange} fixRange Range based on the whole program
* @returns {void}
*/
function report(node, location, fixRange) {
/*
* Passing node is a bit dirty, because message data will contain big
* text in `source`. But... who cares :) ?
* One more kludge will not make worse the bloody wizardry of this
* plugin.
*/
context.report({
node,
loc: location,
messageId: "trailingSpace",
fix(fixer) {
return fixer.removeRange(fixRange);
},
});
}
/**
* Given a list of comment nodes, return the line numbers for those comments.
* @param {Array} comments An array of comment nodes.
* @returns {number[]} An array of line numbers containing comments.
*/
function getCommentLineNumbers(comments) {
const lines = new Set();
comments.forEach(comment => {
const endLine =
comment.type === "Block"
? comment.loc.end.line - 1
: comment.loc.end.line;
for (let i = comment.loc.start.line; i <= endLine; i++) {
lines.add(i);
}
});
return lines;
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
Program: function checkTrailingSpaces(node) {
/*
* Let's hack. Since Espree does not return whitespace nodes,
* fetch the source code and do matching via regexps.
*/
const re = new RegExp(NONBLANK, "u"),
skipMatch = new RegExp(SKIP_BLANK, "u"),
lines = sourceCode.lines,
linebreaks = sourceCode
.getText()
.match(astUtils.createGlobalLinebreakMatcher()),
comments = sourceCode.getAllComments(),
commentLineNumbers = getCommentLineNumbers(comments);
let totalLength = 0;
for (let i = 0, ii = lines.length; i < ii; i++) {
const lineNumber = i + 1;
/*
* Always add linebreak length to line length to accommodate for line break (\n or \r\n)
* Because during the fix time they also reserve one spot in the array.
* Usually linebreak length is 2 for \r\n (CRLF) and 1 for \n (LF)
*/
const linebreakLength =
linebreaks && linebreaks[i] ? linebreaks[i].length : 1;
const lineLength = lines[i].length + linebreakLength;
const matches = re.exec(lines[i]);
if (matches) {
const location = {
start: {
line: lineNumber,
column: matches.index,
},
end: {
line: lineNumber,
column: lineLength - linebreakLength,
},
};
const rangeStart = totalLength + location.start.column;
const rangeEnd = totalLength + location.end.column;
const containingNode =
sourceCode.getNodeByRangeIndex(rangeStart);
if (
containingNode &&
containingNode.type === "TemplateElement" &&
rangeStart > containingNode.parent.range[0] &&
rangeEnd < containingNode.parent.range[1]
) {
totalLength += lineLength;
continue;
}
/*
* If the line has only whitespace, and skipBlankLines
* is true, don't report it
*/
if (skipBlankLines && skipMatch.test(lines[i])) {
totalLength += lineLength;
continue;
}
const fixRange = [rangeStart, rangeEnd];
if (
!ignoreComments ||
!commentLineNumbers.has(lineNumber)
) {
report(node, location, fixRange);
}
}
totalLength += lineLength;
}
},
};
},
};
@@ -0,0 +1,13 @@
/**
* @param {Root} node
* @param {Parents | undefined} _
* @param {State} state
* @param {Info} info
* @returns {string}
*/
export function root(node: Root, _: Parents | undefined, state: State, info: Info): string;
import type { Root } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
//# sourceMappingURL=root.d.ts.map
@@ -0,0 +1 @@
{"name":"@internationalized/date","version":"3.10.0","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532106008,"integrity":"sha512-cil7stSp3ik41Hdv2Dj+GMcbvUfs1q+MZ2Yte0804py9i6oJJN/diCiIr/brcQOZ5ZqwAI6dgaHA7l8FZheQBw==","mode":420,"size":11335},"dist/BuddhistCalendar.main.js":{"checkedAt":1794532106008,"integrity":"sha512-Rgii/mXSB0Wdsk0ONfrcBn4GySF4H6nKjOIlqseGTvQf3lybOPNlaLFTfNhICmcq637rCtBtV0PzJOR/bKizoA==","mode":420,"size":2379},"dist/BuddhistCalendar.module.js":{"checkedAt":1794532106009,"integrity":"sha512-ys/0d3989oFm7UFEEXYmHeXLQ8GW9dVdqPAAR7dvFJJPZC2J6IDbafZIStpiQPDdWfJT1qdQjdvK4nUsFEicmQ==","mode":420,"size":2422},"dist/CalendarDate.main.js":{"checkedAt":1794532106009,"integrity":"sha512-K3yVJs2tfEHy6PpHWdkQFhCrtWT9+SBSQrF+WgbS0YbhfqH12ZJESEekfMnutPYWrsTeAHO+sd1vplFE/Fjojg==","mode":420,"size":13317},"dist/CalendarDate.module.js":{"checkedAt":1794532106009,"integrity":"sha512-+jHKYr0UmnYLNQ1bePL9AIOlZjTOHBOtNKx5If0OC0vQhg6Gcjg1ZBAv8jSFki/1fk3zn30kkGWc4d0Ty420EQ==","mode":420,"size":14335},"dist/conversion.main.js":{"checkedAt":1794532106009,"integrity":"sha512-4K3KVmaXM5OPw4d0c0chDwxZTsQrBY0lVJXDl7IM3TOw7Ft73QcyljkaxoD7yCoTE1LYuwvXC+QYMYM4c7pqiQ==","mode":420,"size":12683},"dist/conversion.module.js":{"checkedAt":1794532106009,"integrity":"sha512-PYuUaCvqOdONOOKIgzza9x/0B3dTISW8W+BM36AtRJ1CRcM8lAGpY2t5tIDb13KN10yBLSSu1RMFlx7HsBbTlw==","mode":420,"size":12724},"dist/createCalendar.main.js":{"checkedAt":1794532106009,"integrity":"sha512-FF2n6GdfQ3WZtJBIs4OwRYbzIjAfkdmJi2GuuHsTCWp6p4EwzJ03gmxkizlBz7Ep0f9ABuntB0KSuck+mSfgeQ==","mode":420,"size":2950},"dist/createCalendar.module.js":{"checkedAt":1794532106010,"integrity":"sha512-kbvJhVbc6TTrbucI6OCJi+DsTOUFD5XjUrsqA89IHdpSH7WoyzI2gKmByx4ophSHa/4oaXNIbSMEVqUZc8doYA==","mode":420,"size":3364},"dist/DateFormatter.main.js":{"checkedAt":1794532106010,"integrity":"sha512-6T6WCfnwGeQaOmLlKxii+apCbuPkPccVMo/CURDEgHUj2MCJzdE5RKZ4cFwEbrIOTxbaWSiBh4ykR305kNj8bg==","mode":420,"size":7864},"dist/DateFormatter.module.js":{"checkedAt":1794532106010,"integrity":"sha512-P5ejErldsosCwmcbhgEiJGPaV5NbQ6t1dytaggOwlmhTM26iSlTVgbiE2t9f0VwJfsEhVVptYD3sHN0H/VBzVA==","mode":420,"size":7708},"dist/EthiopicCalendar.main.js":{"checkedAt":1794532106010,"integrity":"sha512-mBiwTLvnorhIdY9mUuQMPglHemf7mRA1J6+cnj3XncDlDtmsSSyB25Pghe65OTZanxAcfNLSEN77+Mx9Ho1XVw==","mode":420,"size":6587},"dist/EthiopicCalendar.module.js":{"checkedAt":1794532106010,"integrity":"sha512-g+XKnhI6B0+8nLUMdziiSbaQZ3PihYRgqlWSWfwuCdqiqb1cx9B/U8rOIdPaBa0HKXMIQwBgtdDhhu1PNyQ13w==","mode":420,"size":6397},"dist/GregorianCalendar.main.js":{"checkedAt":1794532106010,"integrity":"sha512-9mVmvtgXf/O053COMoOH0z5bHB631pbDFuC4uG44VN+dncwkxBUxz9+bdrbjzJdhGgO/ASH1HMXIBTGKrE0Tfw==","mode":420,"size":5301},"dist/GregorianCalendar.module.js":{"checkedAt":1794532106010,"integrity":"sha512-LOvDxlnqb/kwpL+cPXBpnjLBYUFiWNAXHyZk+y77HB75ViTbZib3VWaTajWnkWTSbvaCt2l051ZegfIjqZEr9w==","mode":420,"size":5089},"dist/HebrewCalendar.main.js":{"checkedAt":1794532106010,"integrity":"sha512-Y4YpVuzgdWd0Q3WVXGD0xd87iA5N4ZjFLSdosEiH8GXx6Pm4ciHi7qZrmCGoRIpTWlBE+kPIcQlL3MK0d5VpYw==","mode":420,"size":6802},"dist/HebrewCalendar.module.js":{"checkedAt":1794532106011,"integrity":"sha512-ey6d7MrTPC88lQkQ74EgW2ISamPQjsf08aNfqOXkZeXKlUWxFfsw7HS7MKwGpnlbnFhCioj0/OipN4FQsmDxyg==","mode":420,"size":6730},"dist/IndianCalendar.main.js":{"checkedAt":1794532106011,"integrity":"sha512-kvr9Lnbttx+fWxE72DgOCxaxvgVErLz3VJQgSoPrO6AIVM5teJAUXXM+2DQkHAXv6m2M0ppEC/XB0OpiCCz96g==","mode":420,"size":4450},"dist/IndianCalendar.module.js":{"checkedAt":1794532106011,"integrity":"sha512-DpBcNQy4P0olDj26IoPvBQP6MS5feGRbdZAG8VO0dCflPlUJnCVJ41K9cD0c7k4aIcoVtL+iWYBLYJ/ObFCHjQ==","mode":420,"size":4557},"dist/IslamicCalendar.main.js":{"checkedAt":1794532106011,"integrity":"sha512-ejkl9BQn8nbMNPEoSq6qze379obkHA1y235jGZNdHxEK5jCj7aA8i1gbKl62AVpL70SnQLojSkFT/FR2LWHOig==","mode":420,"size":9131},"dist/IslamicCalendar.module.js":{"checkedAt":1794532106011,"integrity":"sha512-Dr5dNwF2Lf7rfnaa0pEU/z/3e65RRfvyir5pQgwBwV36ckbwZnuprDEnGx8vh0WSX2WweE0sJs0uiFZGGe4sTg==","mode":420,"size":8938},"dist/JapaneseCalendar.main.js":{"checkedAt":1794532106011,"integrity":"sha512-+HRX9fpKu4SmK6tYFomSt1c8ni1I+hDQlcAGMMvXZ4ETmyzV21TB3uaqIA1tAeG5p4gV6IwtXXlvCX1ykTR4eA==","mode":420,"size":6245},"dist/JapaneseCalendar.module.js":{"checkedAt":1794532106011,"integrity":"sha512-1+q3pFqfH5IdjT1Mqw8Fd0fYkvd0GMNxkietpzrD6m5LjcEYeQD73o1tPZGuXWUq1/D7FtS2QwbPWLZIDQbkiw==","mode":420,"size":6164},"dist/main.js":{"checkedAt":1794532106012,"integrity":"sha512-KsftKikwmvg77cYG2LbWFX5GZyGOMz21ljpZcJl6ntfMdhQ77fEeNPr/aI+clb+tfGIXHtldQI+700l4+EookA==","mode":420,"size":7856},"dist/manipulation.main.js":{"checkedAt":1794532106012,"integrity":"sha512-LU/m02it1jrOcuV+4LS6+rMeZSfisHK85+Fw2A9gR/z+UF5jZPzwUEkvCUnXeezNN1siXRecznbKjBSRW6msVw==","mode":420,"size":21060},"dist/manipulation.module.js":{"checkedAt":1794532106012,"integrity":"sha512-iEPdDsbCM21J3EWBUYmTMKKN/7CFIrww1/GO9X1muzcKrv5BtGEnI3RHWKX+yzubbwLine truncated
@@ -0,0 +1,144 @@
# node-error-ex [![Travis-CI.org Build Status](https://img.shields.io/travis/Qix-/node-error-ex.svg?style=flat-square)](https://travis-ci.org/Qix-/node-error-ex) [![Coveralls.io Coverage Rating](https://img.shields.io/coveralls/Qix-/node-error-ex.svg?style=flat-square)](https://coveralls.io/r/Qix-/node-error-ex)
> Easily subclass and customize new Error types
## Examples
To include in your project:
```javascript
var errorEx = require('error-ex');
```
To create an error message type with a specific name (note, that `ErrorFn.name`
will not reflect this):
```javascript
var JSONError = errorEx('JSONError');
var err = new JSONError('error');
err.name; //-> JSONError
throw err; //-> JSONError: error
```
To add a stack line:
```javascript
var JSONError = errorEx('JSONError', {fileName: errorEx.line('in %s')});
var err = new JSONError('error')
err.fileName = '/a/b/c/foo.json';
throw err; //-> (line 2)-> in /a/b/c/foo.json
```
To append to the error message:
```javascript
var JSONError = errorEx('JSONError', {fileName: errorEx.append('in %s')});
var err = new JSONError('error');
err.fileName = '/a/b/c/foo.json';
throw err; //-> JSONError: error in /a/b/c/foo.json
```
## API
#### `errorEx([name], [properties])`
Creates a new ErrorEx error type
- `name`: the name of the new type (appears in the error message upon throw;
defaults to `Error.name`)
- `properties`: if supplied, used as a key/value dictionary of properties to
use when building up the stack message. Keys are property names that are
looked up on the error message, and then passed to function values.
- `line`: if specified and is a function, return value is added as a stack
entry (error-ex will indent for you). Passed the property value given
the key.
- `stack`: if specified and is a function, passed the value of the property
using the key, and the raw stack lines as a second argument. Takes no
return value (but the stack can be modified directly).
- `message`: if specified and is a function, return value is used as new
`.message` value upon get. Passed the property value of the property named
by key, and the existing message is passed as the second argument as an
array of lines (suitable for multi-line messages).
Returns a constructor (Function) that can be used just like the regular Error
constructor.
```javascript
var errorEx = require('error-ex');
var BasicError = errorEx();
var NamedError = errorEx('NamedError');
// --
var AdvancedError = errorEx('AdvancedError', {
foo: {
line: function (value, stack) {
if (value) {
return 'bar ' + value;
}
return null;
}
}
})
var err = new AdvancedError('hello, world');
err.foo = 'baz';
throw err;
/*
AdvancedError: hello, world
bar baz
at tryReadme() (readme.js:20:1)
*/
```
#### `errorEx.line(str)`
Creates a stack line using a delimiter
> This is a helper function. It is to be used in lieu of writing a value object
> for `properties` values.
- `str`: The string to create
- Use the delimiter `%s` to specify where in the string the value should go
```javascript
var errorEx = require('error-ex');
var FileError = errorEx('FileError', {fileName: errorEx.line('in %s')});
var err = new FileError('problem reading file');
err.fileName = '/a/b/c/d/foo.js';
throw err;
/*
FileError: problem reading file
in /a/b/c/d/foo.js
at tryReadme() (readme.js:7:1)
*/
```
#### `errorEx.append(str)`
Appends to the `error.message` string
> This is a helper function. It is to be used in lieu of writing a value object
> for `properties` values.
- `str`: The string to append
- Use the delimiter `%s` to specify where in the string the value should go
```javascript
var errorEx = require('error-ex');
var SyntaxError = errorEx('SyntaxError', {fileName: errorEx.append('in %s')});
var err = new SyntaxError('improper indentation');
err.fileName = '/a/b/c/d/foo.js';
throw err;
/*
SyntaxError: improper indentation in /a/b/c/d/foo.js
at tryReadme() (readme.js:7:1)
*/
```
## License
Licensed under the [MIT License](http://opensource.org/licenses/MIT).
You can find a copy of it in [LICENSE](LICENSE).
@@ -0,0 +1 @@
{"name":"keyv","version":"4.5.4","requiresBuild":false,"files":{"README.md":{"checkedAt":1794532094377,"integrity":"sha512-jNxLTMM65O+5xHz004/wpKBNoECI0KFXfk6rId6HYIbFf+/n7BCzduICFG6Uic6cKo+3Cbt9h3XPOevLDLOxaw==","mode":420,"size":15631},"package.json":{"checkedAt":1794532094377,"integrity":"sha512-fwZdcrG4RRURmccY2k4o0fb/6zQ5OIFrrJ3hcRY0Hk0R8TVUvH/gs8C2iHRRQFBpcJDOM3z4LENjeWgr6c0Zsg==","mode":420,"size":1297},"src/index.d.ts":{"checkedAt":1794532094377,"integrity":"sha512-FXsJqBpz/oxiA2t7+PoivQCgpOmdupJxFPJohkkL7zufIwQN4v/MzT1wpYL7XQZKHcaRivDcOc0YRRMe0uYPYg==","mode":420,"size":4220},"src/index.js":{"checkedAt":1794532094377,"integrity":"sha512-KjpXDY0JGl3VKIMAugVQb/WcwYW/js/5n8TkSG34Wk3csesgQLFh0y8webrYDauUBGikZ0/NO8qL7lj/4AlnYA==","mode":420,"size":6603}}}
@@ -0,0 +1,165 @@
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import re
import os
import locale
from functools import reduce
def XmlToString(content, encoding="utf-8", pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
Visual Studio files have a lot of pre-defined structures. This function makes
it easy to represent these structures as Python data structures, instead of
having to create a lot of function calls.
Each XML element of the content is represented as a list composed of:
1. The name of the element, a string,
2. The attributes of the element, a dictionary (optional), and
3+. The content of the element, if any. Strings are simple text nodes and
lists are child elements.
Example 1:
<test/>
becomes
['test']
Example 2:
<myelement a='value1' b='value2'>
<childtype>This is</childtype>
<childtype>it!</childtype>
</myelement>
becomes
['myelement', {'a':'value1', 'b':'value2'},
['childtype', 'This is'],
['childtype', 'it!'],
]
Args:
content: The structured content to be converted.
encoding: The encoding to report on the first XML line.
pretty: True if we want pretty printing with indents and new lines.
Returns:
The XML content as a string.
"""
# We create a huge list of all the elements of the file.
xml_parts = ['<?xml version="1.0" encoding="%s"?>' % encoding]
if pretty:
xml_parts.append("\n")
_ConstructContentList(xml_parts, content, pretty)
# Convert it to a string
return "".join(xml_parts)
def _ConstructContentList(xml_parts, specification, pretty, level=0):
""" Appends the XML parts corresponding to the specification.
Args:
xml_parts: A list of XML parts to be appended to.
specification: The specification of the element. See EasyXml docs.
pretty: True if we want pretty printing with indents and new lines.
level: Indentation level.
"""
# The first item in a specification is the name of the element.
if pretty:
indentation = " " * level
new_line = "\n"
else:
indentation = ""
new_line = ""
name = specification[0]
if not isinstance(name, str):
raise Exception(
"The first item of an EasyXml specification should be "
"a string. Specification was " + str(specification)
)
xml_parts.append(indentation + "<" + name)
# Optionally in second position is a dictionary of the attributes.
rest = specification[1:]
if rest and isinstance(rest[0], dict):
for at, val in sorted(rest[0].items()):
xml_parts.append(f' {at}="{_XmlEscape(val, attr=True)}"')
rest = rest[1:]
if rest:
xml_parts.append(">")
all_strings = reduce(lambda x, y: x and isinstance(y, str), rest, True)
multi_line = not all_strings
if multi_line and new_line:
xml_parts.append(new_line)
for child_spec in rest:
# If it's a string, append a text node.
# Otherwise recurse over that child definition
if isinstance(child_spec, str):
xml_parts.append(_XmlEscape(child_spec))
else:
_ConstructContentList(xml_parts, child_spec, pretty, level + 1)
if multi_line and indentation:
xml_parts.append(indentation)
xml_parts.append(f"</{name}>{new_line}")
else:
xml_parts.append("/>%s" % new_line)
def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False,
win32=(sys.platform == "win32")):
""" Writes the XML content to disk, touching the file only if it has changed.
Args:
content: The structured content to be written.
path: Location of the file.
encoding: The encoding to report on the first line of the XML file.
pretty: True if we want pretty printing with indents and new lines.
"""
xml_string = XmlToString(content, encoding, pretty)
if win32 and os.linesep != "\r\n":
xml_string = xml_string.replace("\n", "\r\n")
default_encoding = locale.getdefaultlocale()[1]
if default_encoding and default_encoding.upper() != encoding.upper():
xml_string = xml_string.encode(encoding)
# Get the old content
try:
with open(path) as file:
existing = file.read()
except OSError:
existing = None
# It has changed, write it
if existing != xml_string:
with open(path, "wb") as file:
file.write(xml_string)
_xml_escape_map = {
'"': "&quot;",
"'": "&apos;",
"<": "&lt;",
">": "&gt;",
"&": "&amp;",
"\n": "&#xA;",
"\r": "&#xD;",
}
_xml_escape_re = re.compile("(%s)" % "|".join(map(re.escape, _xml_escape_map.keys())))
def _XmlEscape(value, attr=False):
""" Escape a string for inclusion in XML."""
def replace(match):
m = match.string[match.start() : match.end()]
# don't replace single quotes in attrs
if attr and m == "'":
return m
return _xml_escape_map[m]
return _xml_escape_re.sub(replace, value)
@@ -0,0 +1,959 @@
/**
* @fileoverview Utility class and functions for React components detection
* @author Yannick Croissant
*/
'use strict';
const arrayIncludes = require('array-includes');
const fromEntries = require('object.fromentries');
const values = require('object.values');
const iterFrom = require('es-iterator-helpers/Iterator.from');
const map = require('es-iterator-helpers/Iterator.prototype.map');
const variableUtil = require('./variable');
const pragmaUtil = require('./pragma');
const astUtil = require('./ast');
const componentUtil = require('./componentUtil');
const propTypesUtil = require('./propTypes');
const jsxUtil = require('./jsx');
const usedPropTypesUtil = require('./usedPropTypes');
const defaultPropsUtil = require('./defaultProps');
const isFirstLetterCapitalized = require('./isFirstLetterCapitalized');
const isDestructuredFromPragmaImport = require('./isDestructuredFromPragmaImport');
const eslintUtil = require('./eslint');
const getScope = eslintUtil.getScope;
const getText = eslintUtil.getText;
function getId(node) {
return node ? `${node.range[0]}:${node.range[1]}` : '';
}
function usedPropTypesAreEquivalent(propA, propB) {
if (propA.name === propB.name) {
if (!propA.allNames && !propB.allNames) {
return true;
}
if (Array.isArray(propA.allNames) && Array.isArray(propB.allNames) && propA.allNames.join('') === propB.allNames.join('')) {
return true;
}
return false;
}
return false;
}
function mergeUsedPropTypes(propsList, newPropsList) {
const propsToAdd = newPropsList.filter((newProp) => {
const newPropIsAlreadyInTheList = propsList.some((prop) => usedPropTypesAreEquivalent(prop, newProp));
return !newPropIsAlreadyInTheList;
});
return propsList.concat(propsToAdd);
}
const USE_HOOK_PREFIX_REGEX = /^use[A-Z]/;
const Lists = new WeakMap();
const ReactImports = new WeakMap();
/**
* Components
*/
class Components {
constructor() {
Lists.set(this, {});
ReactImports.set(this, {});
}
/**
* Add a node to the components list, or update it if it's already in the list
*
* @param {ASTNode} node The AST node being added.
* @param {number} confidence Confidence in the component detection (0=banned, 1=maybe, 2=yes)
* @returns {Object} Added component object
*/
add(node, confidence) {
const id = getId(node);
const list = Lists.get(this);
if (list[id]) {
if (confidence === 0 || list[id].confidence === 0) {
list[id].confidence = 0;
} else {
list[id].confidence = Math.max(list[id].confidence, confidence);
}
return list[id];
}
list[id] = {
node,
confidence,
};
return list[id];
}
/**
* Find a component in the list using its node
*
* @param {ASTNode} node The AST node being searched.
* @returns {Object} Component object, undefined if the component is not found or has confidence value of 0.
*/
get(node) {
const id = getId(node);
const item = Lists.get(this)[id];
if (item && item.confidence >= 1) {
return item;
}
return null;
}
/**
* Update a component in the list
*
* @param {ASTNode} node The AST node being updated.
* @param {Object} props Additional properties to add to the component.
*/
set(node, props) {
const list = Lists.get(this);
let component = list[getId(node)];
while (!component || component.confidence < 1) {
node = node.parent;
if (!node) {
return;
}
component = list[getId(node)];
}
Object.assign(
component,
props,
{
usedPropTypes: mergeUsedPropTypes(
component.usedPropTypes || [],
props.usedPropTypes || []
),
}
);
}
/**
* Return the components list
* Components for which we are not confident are not returned
*
* @returns {Object} Components list
*/
list() {
const thisList = Lists.get(this);
const list = {};
const usedPropTypes = {};
// Find props used in components for which we are not confident
Object.keys(thisList).filter((i) => thisList[i].confidence < 2).forEach((i) => {
let component = null;
let node = null;
node = thisList[i].node;
while (!component && node.parent) {
node = node.parent;
// Stop moving up if we reach a decorator
if (node.type === 'Decorator') {
break;
}
component = this.get(node);
}
if (component) {
const newUsedProps = (thisList[i].usedPropTypes || []).filter((propType) => !propType.node || propType.node.kind !== 'init');
const componentId = getId(component.node);
usedPropTypes[componentId] = mergeUsedPropTypes(usedPropTypes[componentId] || [], newUsedProps);
}
});
// Assign used props in not confident components to the parent component
Object.keys(thisList).filter((j) => thisList[j].confidence >= 2).forEach((j) => {
const id = getId(thisList[j].node);
list[j] = thisList[j];
if (usedPropTypes[id]) {
list[j].usedPropTypes = mergeUsedPropTypes(list[j].usedPropTypes || [], usedPropTypes[id]);
}
});
return list;
}
/**
* Return the length of the components list
* Components for which we are not confident are not counted
*
* @returns {number} Components list length
*/
length() {
const list = Lists.get(this);
return values(list).filter((component) => component.confidence >= 2).length;
}
/**
* Return the node naming the default React import
* It can be used to determine the local name of import, even if it's imported
* with an unusual name.
*
* @returns {ASTNode} React default import node
*/
getDefaultReactImports() {
return ReactImports.get(this).defaultReactImports;
}
/**
* Return the nodes of all React named imports
*
* @returns {Object} The list of React named imports
*/
getNamedReactImports() {
return ReactImports.get(this).namedReactImports;
}
/**
* Add the default React import specifier to the scope
*
* @param {ASTNode} specifier The AST Node of the default React import
* @returns {void}
*/
addDefaultReactImport(specifier) {
const info = ReactImports.get(this);
ReactImports.set(this, Object.assign({}, info, {
defaultReactImports: (info.defaultReactImports || []).concat(specifier),
}));
}
/**
* Add a named React import specifier to the scope
*
* @param {ASTNode} specifier The AST Node of a named React import
* @returns {void}
*/
addNamedReactImport(specifier) {
const info = ReactImports.get(this);
ReactImports.set(this, Object.assign({}, info, {
namedReactImports: (info.namedReactImports || []).concat(specifier),
}));
}
}
function getWrapperFunctions(context, pragma) {
const componentWrapperFunctions = context.settings.componentWrapperFunctions || [];
// eslint-disable-next-line arrow-body-style
return componentWrapperFunctions.map((wrapperFunction) => {
return typeof wrapperFunction === 'string'
? { property: wrapperFunction }
: Object.assign({}, wrapperFunction, {
object: wrapperFunction.object === '<pragma>' ? pragma : wrapperFunction.object,
});
}).concat([
{ property: 'forwardRef', object: pragma },
{ property: 'memo', object: pragma },
]);
}
// eslint-disable-next-line valid-jsdoc
/**
* Merge many eslint rules into one
* @param {{[_: string]: Function}[]} rules the returned values for eslint rule.create(context)
* @returns {{[_: string]: Function}} merged rule
*/
function mergeRules(rules) {
/** @type {Map<string, Function[]>} */
const handlersByKey = new Map();
rules.forEach((rule) => {
Object.keys(rule).forEach((key) => {
const fns = handlersByKey.get(key);
if (!fns) {
handlersByKey.set(key, [rule[key]]);
} else {
fns.push(rule[key]);
}
});
});
/** @type {{ [key: string]: Function }} */
return fromEntries(map(iterFrom(handlersByKey), (entry) => [
entry[0],
function mergedHandler(node) {
entry[1].forEach((fn) => {
fn(node);
});
},
]));
}
function componentRule(rule, context) {
const pragma = pragmaUtil.getFromContext(context);
const components = new Components();
const wrapperFunctions = getWrapperFunctions(context, pragma);
// Utilities for component detection
const utils = {
/**
* Check if variable is destructured from pragma import
*
* @param {ASTNode} node The AST node to check
* @param {string} variable The variable name to check
* @returns {boolean} True if createElement is destructured from the pragma
*/
isDestructuredFromPragmaImport(node, variable) {
return isDestructuredFromPragmaImport(context, node, variable);
},
/**
* @param {ASTNode} node
* @param {boolean=} strict
* @returns {boolean}
*/
isReturningJSX(node, strict) {
return jsxUtil.isReturningJSX(context, node, strict, true);
},
isReturningJSXOrNull(node, strict) {
return jsxUtil.isReturningJSX(context, node, strict);
},
isReturningOnlyNull(node) {
return jsxUtil.isReturningOnlyNull(node, context);
},
getPragmaComponentWrapper(node) {
let isPragmaComponentWrapper;
let currentNode = node;
let prevNode;
do {
currentNode = currentNode.parent;
isPragmaComponentWrapper = this.isPragmaComponentWrapper(currentNode);
if (isPragmaComponentWrapper) {
prevNode = currentNode;
}
} while (isPragmaComponentWrapper);
return prevNode;
},
getComponentNameFromJSXElement(node) {
if (node.type !== 'JSXElement') {
return null;
}
if (node.openingElement && node.openingElement.name && node.openingElement.name.name) {
return node.openingElement.name.name;
}
return null;
},
/**
* Getting the first JSX element's name.
* @param {object} node
* @returns {string | null}
*/
getNameOfWrappedComponent(node) {
if (node.length < 1) {
return null;
}
const body = node[0].body;
if (!body) {
return null;
}
if (body.type === 'JSXElement') {
return this.getComponentNameFromJSXElement(body);
}
if (body.type === 'BlockStatement') {
const jsxElement = body.body.find((item) => item.type === 'ReturnStatement');
return jsxElement
&& jsxElement.argument
&& this.getComponentNameFromJSXElement(jsxElement.argument);
}
return null;
},
/**
* Get the list of names of components created till now
* @returns {string | boolean}
*/
getDetectedComponents() {
const list = components.list();
return values(list).filter((val) => {
if (val.node.type === 'ClassDeclaration') {
return true;
}
if (
val.node.type === 'ArrowFunctionExpression'
&& val.node.parent
&& val.node.parent.type === 'VariableDeclarator'
&& val.node.parent.id
) {
return true;
}
return false;
}).map((val) => {
if (val.node.type === 'ArrowFunctionExpression') return val.node.parent.id.name;
return val.node.id && val.node.id.name;
});
},
/**
* It will check whether memo/forwardRef is wrapping existing component or
* creating a new one.
* @param {object} node
* @returns {boolean}
*/
nodeWrapsComponent(node) {
const childComponent = this.getNameOfWrappedComponent(node.arguments);
const componentList = this.getDetectedComponents();
return !!childComponent && arrayIncludes(componentList, childComponent);
},
isPragmaComponentWrapper(node) {
if (!astUtil.isCallExpression(node)) {
return false;
}
return wrapperFunctions.some((wrapperFunction) => {
if (node.callee.type === 'MemberExpression') {
return wrapperFunction.object
&& wrapperFunction.object === node.callee.object.name
&& wrapperFunction.property === node.callee.property.name
&& !this.nodeWrapsComponent(node);
}
return wrapperFunction.property === node.callee.name
&& (!wrapperFunction.object
// Functions coming from the current pragma need special handling
|| (wrapperFunction.object === pragma && this.isDestructuredFromPragmaImport(node, node.callee.name))
);
});
},
/**
* Find a return statement in the current node
*
* @param {ASTNode} node The AST node being checked
*/
findReturnStatement: astUtil.findReturnStatement,
/**
* Get the parent component node from the current scope
* @param {ASTNode} node
*
* @returns {ASTNode} component node, null if we are not in a component
*/
getParentComponent(node) {
return (
componentUtil.getParentES6Component(context, node)
|| componentUtil.getParentES5Component(context, node)
|| utils.getParentStatelessComponent(node)
);
},
/**
* @param {ASTNode} node
* @returns {boolean}
*/
isInAllowedPositionForComponent(node) {
switch (node.parent.type) {
case 'VariableDeclarator':
case 'AssignmentExpression':
case 'Property':
case 'ReturnStatement':
case 'ExportDefaultDeclaration':
case 'ArrowFunctionExpression': {
return true;
}
case 'SequenceExpression': {
return utils.isInAllowedPositionForComponent(node.parent)
&& node === node.parent.expressions[node.parent.expressions.length - 1];
}
default:
return false;
}
},
/**
* Get node if node is a stateless component, or node.parent in cases like
* `React.memo` or `React.forwardRef`. Otherwise returns `undefined`.
* @param {ASTNode} node
* @returns {ASTNode | undefined}
*/
getStatelessComponent(node) {
const parent = node.parent;
if (
node.type === 'FunctionDeclaration'
&& (!node.id || isFirstLetterCapitalized(node.id.name))
&& utils.isReturningJSXOrNull(node)
) {
return node;
}
if (node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression') {
const isPropertyAssignment = parent.type === 'AssignmentExpression'
&& parent.left.type === 'MemberExpression';
const isModuleExportsAssignment = isPropertyAssignment
&& parent.left.object.name === 'module'
&& parent.left.property.name === 'exports';
if (node.parent.type === 'ExportDefaultDeclaration') {
if (utils.isReturningJSX(node)) {
return node;
}
return undefined;
}
if (node.parent.type === 'VariableDeclarator' && utils.isReturningJSXOrNull(node)) {
if (isFirstLetterCapitalized(node.parent.id.name)) {
return node;
}
return undefined;
}
// case: const any = () => { return (props) => null }
// case: const any = () => (props) => null
if (
(node.parent.type === 'ReturnStatement' || (node.parent.type === 'ArrowFunctionExpression' && node.parent.expression))
&& !utils.isReturningJSX(node)
) {
return undefined;
}
// case: any = () => { return => null }
// case: any = () => null
if (node.parent.type === 'AssignmentExpression' && !isPropertyAssignment && utils.isReturningJSXOrNull(node)) {
if (isFirstLetterCapitalized(node.parent.left.name)) {
return node;
}
return undefined;
}
// case: any = () => () => null
if (node.parent.type === 'ArrowFunctionExpression' && node.parent.parent.type === 'AssignmentExpression' && !isPropertyAssignment && utils.isReturningJSXOrNull(node)) {
if (isFirstLetterCapitalized(node.parent.parent.left.name)) {
return node;
}
return undefined;
}
// case: { any: () => () => null }
if (node.parent.type === 'ArrowFunctionExpression' && node.parent.parent.type === 'Property' && !isPropertyAssignment && utils.isReturningJSXOrNull(node)) {
if (isFirstLetterCapitalized(node.parent.parent.key.name)) {
return node;
}
return undefined;
}
// case: any = function() {return function() {return null;};}
if (node.parent.type === 'ReturnStatement') {
if (isFirstLetterCapitalized(node.id && node.id.name)) {
return node;
}
const functionExpr = node.parent.parent.parent;
if (functionExpr.parent.type === 'AssignmentExpression' && !isPropertyAssignment && utils.isReturningJSXOrNull(node)) {
if (isFirstLetterCapitalized(functionExpr.parent.left.name)) {
return node;
}
return undefined;
}
}
// case: { any: function() {return function() {return null;};} }
if (node.parent.type === 'ReturnStatement') {
const functionExpr = node.parent.parent.parent;
if (functionExpr.parent.type === 'Property' && !isPropertyAssignment && utils.isReturningJSXOrNull(node)) {
if (isFirstLetterCapitalized(functionExpr.parent.key.name)) {
return node;
}
return undefined;
}
}
// for case abc = { [someobject.somekey]: props => { ... return not-jsx } }
if (
node.parent
&& node.parent.key
&& node.parent.key.type === 'MemberExpression'
&& !utils.isReturningJSX(node)
&& !utils.isReturningOnlyNull(node)
) {
return undefined;
}
if (
node.parent.type === 'Property' && (
(node.parent.method && !node.parent.computed) // case: { f() { return ... } }
|| (!node.id && !node.parent.computed) // case: { f: () => ... }
)
) {
if (
isFirstLetterCapitalized(node.parent.key.name)
&& utils.isReturningJSX(node)
) {
return node;
}
return undefined;
}
// Case like `React.memo(() => <></>)` or `React.forwardRef(...)`
const pragmaComponentWrapper = utils.getPragmaComponentWrapper(node);
if (pragmaComponentWrapper && utils.isReturningJSXOrNull(node)) {
return pragmaComponentWrapper;
}
if (!(utils.isInAllowedPositionForComponent(node) && utils.isReturningJSXOrNull(node))) {
return undefined;
}
if (utils.isParentComponentNotStatelessComponent(node)) {
return undefined;
}
if (node.id) {
return isFirstLetterCapitalized(node.id.name) ? node : undefined;
}
if (
isPropertyAssignment
&& !isModuleExportsAssignment
&& !isFirstLetterCapitalized(parent.left.property.name)
) {
return undefined;
}
if (parent.type === 'Property' && utils.isReturningOnlyNull(node)) {
return undefined;
}
return node;
}
return undefined;
},
/**
* Get the parent stateless component node from the current scope
*
* @param {ASTNode} node The AST node being checked
* @returns {ASTNode} component node, null if we are not in a component
*/
getParentStatelessComponent(node) {
let scope = getScope(context, node);
while (scope) {
const statelessComponent = utils.getStatelessComponent(scope.block);
if (statelessComponent) {
return statelessComponent;
}
scope = scope.upper;
}
return null;
},
/**
* Get the related component from a node
*
* @param {ASTNode} node The AST node being checked (must be a MemberExpression).
* @returns {ASTNode | null} component node, null if we cannot find the component
*/
getRelatedComponent(node) {
let i;
let j;
let k;
let l;
let componentNode;
// Get the component path
const componentPath = [];
let nodeTemp = node;
while (nodeTemp) {
if (nodeTemp.property && nodeTemp.property.type === 'Identifier') {
componentPath.push(nodeTemp.property.name);
}
if (nodeTemp.object && nodeTemp.object.type === 'Identifier') {
componentPath.push(nodeTemp.object.name);
}
nodeTemp = nodeTemp.object;
}
componentPath.reverse();
const componentName = componentPath.slice(0, componentPath.length - 1).join('.');
// Find the variable in the current scope
const variableName = componentPath.shift();
if (!variableName) {
return null;
}
const variableInScope = variableUtil.getVariableFromContext(context, node, variableName);
if (!variableInScope) {
return null;
}
// Try to find the component using variable references
variableInScope.references.some((ref) => {
let refId = ref.identifier;
if (refId.parent && refId.parent.type === 'MemberExpression') {
refId = refId.parent;
}
if (getText(context, refId) !== componentName) {
return false;
}
if (refId.type === 'MemberExpression') {
componentNode = refId.parent.right;
} else if (
refId.parent
&& refId.parent.type === 'VariableDeclarator'
&& refId.parent.init
&& refId.parent.init.type !== 'Identifier'
) {
componentNode = refId.parent.init;
}
return true;
});
if (componentNode) {
// Return the component
return components.add(componentNode, 1);
}
// Try to find the component using variable declarations
const defs = variableInScope.defs;
const defInScope = defs.find((def) => (
def.type === 'ClassName'
|| def.type === 'FunctionName'
|| def.type === 'Variable'
));
if (!defInScope || !defInScope.node) {
return null;
}
componentNode = defInScope.node.init || defInScope.node;
// Traverse the node properties to the component declaration
for (i = 0, j = componentPath.length; i < j; i++) {
if (!componentNode.properties) {
continue; // eslint-disable-line no-continue
}
for (k = 0, l = componentNode.properties.length; k < l; k++) {
if (componentNode.properties[k].key && componentNode.properties[k].key.name === componentPath[i]) {
componentNode = componentNode.properties[k];
break;
}
}
if (!componentNode || !componentNode.value) {
return null;
}
componentNode = componentNode.value;
}
// Return the component
return components.add(componentNode, 1);
},
isParentComponentNotStatelessComponent(node) {
return !!(
node.parent
&& node.parent.key
&& node.parent.key.type === 'Identifier'
// custom component functions must start with a capital letter (returns false otherwise)
&& node.parent.key.name.charAt(0) === node.parent.key.name.charAt(0).toLowerCase()
// react render function cannot have params
&& !!(node.params || []).length
);
},
/**
* Identify whether a node (CallExpression) is a call to a React hook
*
* @param {ASTNode} node The AST node being searched. (expects CallExpression)
* @param {('useCallback'|'useContext'|'useDebugValue'|'useEffect'|'useImperativeHandle'|'useLayoutEffect'|'useMemo'|'useReducer'|'useRef'|'useState')[]} [expectedHookNames] React hook names to which search is limited.
* @returns {boolean} True if the node is a call to a React hook
*/
isReactHookCall(node, expectedHookNames) {
if (!astUtil.isCallExpression(node)) {
return false;
}
const defaultReactImports = components.getDefaultReactImports();
const namedReactImports = components.getNamedReactImports();
const defaultReactImportName = defaultReactImports
&& defaultReactImports[0]
&& defaultReactImports[0].local.name;
const reactHookImportSpecifiers = namedReactImports
&& namedReactImports.filter((specifier) => USE_HOOK_PREFIX_REGEX.test(specifier.imported.name));
const reactHookImportNames = reactHookImportSpecifiers
&& fromEntries(reactHookImportSpecifiers.map((specifier) => [specifier.local.name, specifier.imported.name]));
const isPotentialReactHookCall = defaultReactImportName
&& node.callee.type === 'MemberExpression'
&& node.callee.object.type === 'Identifier'
&& node.callee.object.name === defaultReactImportName
&& node.callee.property.type === 'Identifier'
&& node.callee.property.name.match(USE_HOOK_PREFIX_REGEX);
const isPotentialHookCall = reactHookImportNames
&& node.callee.type === 'Identifier'
&& node.callee.name.match(USE_HOOK_PREFIX_REGEX);
const scope = (isPotentialReactHookCall || isPotentialHookCall) && getScope(context, node);
const reactResolvedDefs = isPotentialReactHookCall
&& scope.references
&& scope.references.find(
(reference) => reference.identifier.name === defaultReactImportName
).resolved.defs;
const isReactShadowed = isPotentialReactHookCall && reactResolvedDefs
&& reactResolvedDefs.some((reactDef) => reactDef.type !== 'ImportBinding');
const potentialHookReference = isPotentialHookCall
&& scope.references
&& scope.references.find(
(reference) => reactHookImportNames[reference.identifier.name]
);
const hookResolvedDefs = potentialHookReference && potentialHookReference.resolved.defs;
const localHookName = (
isPotentialReactHookCall
&& node.callee.property.name
) || (
isPotentialHookCall
&& potentialHookReference
&& node.callee.name
);
const isHookShadowed = isPotentialHookCall
&& hookResolvedDefs
&& hookResolvedDefs.some(
(hookDef) => hookDef.name.name === localHookName
&& hookDef.type !== 'ImportBinding'
);
const isHookCall = (isPotentialReactHookCall && !isReactShadowed)
|| (isPotentialHookCall && localHookName && !isHookShadowed);
if (!isHookCall) {
return false;
}
if (!expectedHookNames) {
return true;
}
return arrayIncludes(
expectedHookNames,
(reactHookImportNames && reactHookImportNames[localHookName]) || localHookName
);
},
};
// Component detection instructions
const detectionInstructions = {
CallExpression(node) {
if (!utils.isPragmaComponentWrapper(node)) {
return;
}
if (node.arguments.length > 0 && astUtil.isFunctionLikeExpression(node.arguments[0])) {
components.add(node, 2);
}
},
ClassExpression(node) {
if (!componentUtil.isES6Component(node, context)) {
return;
}
components.add(node, 2);
},
ClassDeclaration(node) {
if (!componentUtil.isES6Component(node, context)) {
return;
}
components.add(node, 2);
},
ObjectExpression(node) {
if (!componentUtil.isES5Component(node, context)) {
return;
}
components.add(node, 2);
},
FunctionExpression(node) {
if (node.async && node.generator) {
components.add(node, 0);
return;
}
const component = utils.getStatelessComponent(node);
if (!component) {
return;
}
components.add(component, 2);
},
FunctionDeclaration(node) {
if (node.async && node.generator) {
components.add(node, 0);
return;
}
const cNode = utils.getStatelessComponent(node);
if (!cNode) {
return;
}
components.add(cNode, 2);
},
ArrowFunctionExpression(node) {
const component = utils.getStatelessComponent(node);
if (!component) {
return;
}
components.add(component, 2);
},
ThisExpression(node) {
const component = utils.getParentStatelessComponent(node);
if (!component || !/Function/.test(component.type) || !node.parent.property) {
return;
}
// Ban functions accessing a property on a ThisExpression
components.add(node, 0);
},
};
// Detect React import specifiers
const reactImportInstructions = {
ImportDeclaration(node) {
const isReactImported = node.source.type === 'Literal' && node.source.value === 'react';
if (!isReactImported) {
return;
}
node.specifiers.forEach((specifier) => {
if (specifier.type === 'ImportDefaultSpecifier') {
components.addDefaultReactImport(specifier);
}
if (specifier.type === 'ImportSpecifier') {
components.addNamedReactImport(specifier);
}
});
},
};
const ruleInstructions = rule(context, components, utils);
const propTypesInstructions = propTypesUtil(context, components, utils);
const usedPropTypesInstructions = usedPropTypesUtil(context, components, utils);
const defaultPropsInstructions = defaultPropsUtil(context, components, utils);
const mergedRule = mergeRules([
detectionInstructions,
propTypesInstructions,
usedPropTypesInstructions,
defaultPropsInstructions,
reactImportInstructions,
ruleInstructions,
]);
return mergedRule;
}
module.exports = Object.assign(Components, {
detect(rule) {
return componentRule.bind(this, rule);
},
});
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from './types.js';
import 'react';
declare const EyeSlashFilledIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { EyeSlashFilledIcon };
@@ -0,0 +1,9 @@
import defaultErrorMap from "./locales/en.js";
let overrideErrorMap = defaultErrorMap;
export { defaultErrorMap };
export function setErrorMap(map) {
overrideErrorMap = map;
}
export function getErrorMap() {
return overrideErrorMap;
}
@@ -0,0 +1,6 @@
import regenerator from "./regenerator.js";
import regeneratorAsyncIterator from "./regeneratorAsyncIterator.js";
function _regeneratorAsyncGen(r, e, t, o, n) {
return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
}
export { _regeneratorAsyncGen as default };
@@ -0,0 +1 @@
{"name":"@react-stately/tabs","version":"3.7.0","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532127963,"integrity":"sha512-cil7stSp3ik41Hdv2Dj+GMcbvUfs1q+MZ2Yte0804py9i6oJJN/diCiIr/brcQOZ5ZqwAI6dgaHA7l8FZheQBw==","mode":420,"size":11335},"dist/main.js":{"checkedAt":1794532127963,"integrity":"sha512-nLwNCI1P9BZgMoKV7JFvhI6ZjNdqGpknoZde3YJ+sNmaS9GdjdHfWNoqcq2W/Y/ZC0etUjEJaycAftTMfdSQkg==","mode":420,"size":956},"dist/module.js":{"checkedAt":1794532127963,"integrity":"sha512-Y6TUWTa6m7vtDWE6ujwDUZ0KUCcBE0SqAVXjfzysJ5zDk67k6vIjaCu7/rjEPDDQIg8kqmsk9zFwPQOdaT1Klg==","mode":420,"size":832},"dist/useTabListState.main.js":{"checkedAt":1794532127963,"integrity":"sha512-4fTuLSVB/3gQCZyLIpygx6LaBwnaK5RTTJ6VtHSkC3azlUclmIxAflzAdeTzcnUazCKt8ltuzGnxIoeSjB3TlQ==","mode":420,"size":4288},"dist/useTabListState.module.js":{"checkedAt":1794532127963,"integrity":"sha512-+7oMqpIQ0OvmYfRpB6A50GLyreWCmtNesa8DWAL+/dWCY6n/XYJ0CFD7Pr+xl542aP3AVuUujsdnOMzdiO6byg==","mode":420,"size":4179},"package.json":{"checkedAt":1794532127963,"integrity":"sha512-HDLD7X1jxj12K0zUNaVTMnSKgfBGJsdg13dFrqyR/ipvp0QuRo5/lvNIrJxGYs6/HK1c46Ed7HeCD5WMiJtugQ==","mode":420,"size":898},"dist/main.js.map":{"checkedAt":1794532127964,"integrity":"sha512-FUZK7jH9zV6joEt0IzVbLtQ0UIInwuFBYG7isT6Tj10iggg59SVYnb0laSJp9ERcNVEKGcVkK/m5nwepvpBiGw==","mode":420,"size":983},"dist/module.js.map":{"checkedAt":1794532127964,"integrity":"sha512-vc3yOYABtThpkVAxczlvAO09E5CAsBM++wclPceC/0/UU7qcE+qGxHJI9Ah1Puy+2fM8oZG3dr6LNsMhUDaMBA==","mode":420,"size":979},"dist/types.d.ts.map":{"checkedAt":1794532127964,"integrity":"sha512-4uGIVmP0phqU9kDXRS9VeKjGTXJ+e6144KwNcqaaZeiRYTl99Qtlm9BDPU71zjrKjZLzp/rrKChkM0AWdTuBEg==","mode":420,"size":1462},"dist/useTabListState.main.js.map":{"checkedAt":1794532127964,"integrity":"sha512-Mb1NNg+P6bQMWBbGmGn6CjqKzjyQCtcHnwCQnHlCS2pC04j/ORy8EVTVhEcxMsPSO/K69MsJqIKokKLfREEmAw==","mode":420,"size":5334},"dist/useTabListState.module.js.map":{"checkedAt":1794532127964,"integrity":"sha512-YhUp+wkfCxB8j2fXm60HuKGUqiFq/9yt2OBsIRHNE15jjapjCz+5QHQa3fT0tNLH9REvyz2Zt/ftkZdv7ttRhg==","mode":420,"size":5329},"README.md":{"checkedAt":1794532127964,"integrity":"sha512-VkQWTJfKXhTE8hC4DZBeTngRi9cIuBqKEGPxBciNIQDLY5Lx0iZtcqRYQDkZzjl8OWsYAeBxWjn6MLe1dICLZg==","mode":420,"size":137},"dist/import.mjs":{"checkedAt":1794532127964,"integrity":"sha512-Gb1YfIfRdPbt4YyQCshi/JOJ+2BVGabTKEfmehsQKA/THXgKuxMxQqn4Q6pg75A3d88lh6yJ1CjTBeZiKiNQcQ==","mode":420,"size":826},"dist/useTabListState.mjs":{"checkedAt":1794532127963,"integrity":"sha512-+7oMqpIQ0OvmYfRpB6A50GLyreWCmtNesa8DWAL+/dWCY6n/XYJ0CFD7Pr+xl542aP3AVuUujsdnOMzdiO6byg==","mode":420,"size":4179},"src/index.ts":{"checkedAt":1794532127965,"integrity":"sha512-ObhOTqZ9cg3H+pkVHK9Q8rBY794zIThnJ93xD/15ZCKc9jEZ4Td2h0p6D2jDWImj/C/TaBvZqmlLTUDBpG3suA==","mode":420,"size":800},"dist/types.d.ts":{"checkedAt":1794532127965,"integrity":"sha512-BFC2lQDF5za5HDEx9WeBvXLnfz9tdrFaKvVog4S4y2yqw2rkFtt1bcm87uYRTgp/4LnT+5kzB1F7C4/zONFEOg==","mode":420,"size":806},"src/useTabListState.ts":{"checkedAt":1794532127965,"integrity":"sha512-LEILlQnXnIwCURgvMulY4zdSGYbe2Jx+f+eP8G5W0warMAmquEeW43KiIsKh3REMTgrv5CfczeTYRbZGmLAz/Q==","mode":420,"size":3761}}}
@@ -0,0 +1,48 @@
'use strict';
var $TypeError = require('es-errors/type');
var IsDetachedBuffer = require('./IsDetachedBuffer');
var IsFixedLengthArrayBuffer = require('./IsFixedLengthArrayBuffer');
var isDataViewWithBufferWitnessRecord = require('../helpers/records/data-view-with-buffer-witness-record');
var dataViewBuffer = require('data-view-buffer');
var dataViewByteLength = require('data-view-byte-length');
var dataViewByteOffset = require('data-view-byte-offset');
// https://262.ecma-international.org/15.0/#sec-isviewoutofbounds
module.exports = function IsViewOutOfBounds(viewRecord) {
if (!isDataViewWithBufferWitnessRecord(viewRecord)) {
throw new $TypeError('Assertion failed: `viewRecord` must be a DataView With Buffer Witness Record');
}
var view = viewRecord['[[Object]]']; // step 1
var bufferByteLength = viewRecord['[[CachedBufferByteLength]]']; // step 2
if (IsDetachedBuffer(dataViewBuffer(view)) !== (bufferByteLength === 'DETACHED')) {
// step 3
throw new $TypeError('Assertion failed: `IsDetachedBuffer(dataViewBuffer(view))` must be true if and only if `bufferByteLength === ~DETACHED~');
}
if (bufferByteLength === 'DETACHED') {
return true; // step 4
}
var byteOffsetStart = dataViewByteOffset(view); // step 5
var isFixed = IsFixedLengthArrayBuffer(dataViewBuffer(view));
var viewByteLength = isFixed ? dataViewByteLength(view) : 'AUTO'; // view.[[ByteLength]]
var byteOffsetEnd = viewByteLength === 'AUTO' ? bufferByteLength : byteOffsetStart + viewByteLength; // steps 6 - 7
if (byteOffsetStart > bufferByteLength || byteOffsetEnd > bufferByteLength) {
return true; // step 8
}
// 9. NOTE: 0-length DataViews are not considered out-of-bounds.
return false; // step 10
};
@@ -0,0 +1,9 @@
declare function _exports(messageId: any, message: any): {
messageId: any;
message?: undefined;
} | {
message: any;
messageId?: undefined;
};
export = _exports;
//# sourceMappingURL=message.d.ts.map
@@ -0,0 +1,14 @@
module.exports = {
"ascending": `crescente`,
"ascendingSort": (args)=>`classificado pela coluna ${args.columnName} em ordem crescente`,
"columnSize": (args)=>`${args.value} pixels`,
"descending": `decrescente`,
"descendingSort": (args)=>`classificado pela coluna ${args.columnName} em ordem decrescente`,
"resizerDescription": `Pressione Enter para come\xe7ar a redimensionar`,
"select": `Selecionar`,
"selectAll": `Selecionar tudo`,
"sortable": `coluna classific\xe1vel`
};
//# sourceMappingURL=pt-BR.main.js.map
@@ -0,0 +1,44 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils")
const { getSourceCode } = require("eslint-compat-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `SharedArrayBuffer` class.",
category: "ES2017",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-shared-array-buffer.html",
},
fixable: null,
messages: {
forbidden: "ES2017 '{{name}}' class is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"(program) {
const sourceCode = getSourceCode(context)
const tracker = new ReferenceTracker(
sourceCode.getScope(program),
)
for (const { node, path } of tracker.iterateGlobalReferences({
SharedArrayBuffer: { [READ]: true },
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1,114 @@
// Copyright (c) 2011-2015 Ryan Prichard
//
// 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.
#include "InputHandler.h"
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <sys/select.h>
#include <unistd.h>
#include <algorithm>
#include <vector>
#include "../shared/DebugClient.h"
#include "Util.h"
#include "WakeupFd.h"
InputHandler::InputHandler(
HANDLE conin, int inputfd, WakeupFd &completionWakeup) :
m_conin(conin),
m_inputfd(inputfd),
m_completionWakeup(completionWakeup),
m_threadHasBeenJoined(false),
m_shouldShutdown(0),
m_threadCompleted(0)
{
pthread_create(&m_thread, NULL, InputHandler::threadProcS, this);
}
void InputHandler::shutdown() {
startShutdown();
if (!m_threadHasBeenJoined) {
int ret = pthread_join(m_thread, NULL);
assert(ret == 0 && "pthread_join failed");
m_threadHasBeenJoined = true;
}
}
void InputHandler::threadProc() {
std::vector<char> buffer(4096);
fd_set readfds;
FD_ZERO(&readfds);
while (true) {
// Handle shutdown.
m_wakeup.reset();
if (m_shouldShutdown) {
trace("InputHandler: shutting down");
break;
}
// Block until data arrives.
{
const int max_fd = std::max(m_inputfd, m_wakeup.fd());
FD_SET(m_inputfd, &readfds);
FD_SET(m_wakeup.fd(), &readfds);
selectWrapper("InputHandler", max_fd + 1, &readfds);
if (!FD_ISSET(m_inputfd, &readfds)) {
continue;
}
}
const int numRead = read(m_inputfd, &buffer[0], buffer.size());
if (numRead == -1 && errno == EINTR) {
// Apparently, this read is interrupted on Cygwin 1.7 by a SIGWINCH
// signal even though I set the SA_RESTART flag on the handler.
continue;
}
// tty is closed, or the read failed for some unexpected reason.
if (numRead <= 0) {
trace("InputHandler: tty read failed: numRead=%d", numRead);
break;
}
DWORD written = 0;
BOOL ret = WriteFile(m_conin,
&buffer[0], numRead,
&written, NULL);
if (!ret || written != static_cast<DWORD>(numRead)) {
if (!ret && GetLastError() == ERROR_BROKEN_PIPE) {
trace("InputHandler: pipe closed: written=%u",
static_cast<unsigned int>(written));
} else {
trace("InputHandler: write failed: "
"ret=%d lastError=0x%x numRead=%d written=%u",
ret,
static_cast<unsigned int>(GetLastError()),
numRead,
static_cast<unsigned int>(written));
}
break;
}
}
m_threadCompleted = 1;
m_completionWakeup.set();
}
@@ -0,0 +1,24 @@
export {gfmAutolinkLiteral} from './lib/syntax.js'
export {gfmAutolinkLiteralHtml} from './lib/html.js'
/**
* Augment types.
*/
declare module 'micromark-util-types' {
/**
* Augment token with a field to improve performance.
*/
interface Token {
_gfmAutolinkLiteralWalkedInto?: boolean
}
/**
* Token types.
*/
interface TokenTypeMap {
literalAutolink: 'literalAutolink'
literalAutolinkEmail: 'literalAutolinkEmail'
literalAutolinkHttp: 'literalAutolinkHttp'
literalAutolinkWww: 'literalAutolinkWww'
}
}
@@ -0,0 +1,65 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
interface ArrayBuffer {
/**
* If this ArrayBuffer is resizable, returns the maximum byte length given during construction; returns the byte length if not.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/maxByteLength)
*/
get maxByteLength(): number;
/**
* Returns true if this ArrayBuffer can be resized.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/resizable)
*/
get resizable(): boolean;
/**
* Resizes the ArrayBuffer to the specified size (in bytes).
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/resize)
*/
resize(newByteLength?: number): void;
/**
* Returns a boolean indicating whether or not this buffer has been detached (transferred).
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/detached)
*/
get detached(): boolean;
/**
* Creates a new ArrayBuffer with the same byte content as this buffer, then detaches this buffer.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/transfer)
*/
transfer(newByteLength?: number): ArrayBuffer;
/**
* Creates a new non-resizable ArrayBuffer with the same byte content as this buffer, then detaches this buffer.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/transferToFixedLength)
*/
transferToFixedLength(newByteLength?: number): ArrayBuffer;
}
interface ArrayBufferConstructor {
new (byteLength: number, options?: { maxByteLength?: number; }): ArrayBuffer;
}
@@ -0,0 +1,6 @@
"use strict";
function _class_private_method_set() {
throw new TypeError("attempted to reassign private method");
}
exports._ = _class_private_method_set;
@@ -0,0 +1,6 @@
function _type_of(obj) {
"@swc/helpers - typeof";
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
}
export { _type_of as _ };
@@ -0,0 +1,480 @@
{
"bugs": {
"url": "https://github.com/nodejs/node-addon-api/issues"
},
"contributors": [
{
"name": "Abhishek Kumar Singh",
"url": "https://github.com/abhi11210646"
},
{
"name": "Alba Mendez",
"url": "https://github.com/jmendeth"
},
{
"name": "Alexander Floh",
"url": "https://github.com/alexanderfloh"
},
{
"name": "Ammar Faizi",
"url": "https://github.com/ammarfaizi2"
},
{
"name": "András Timár, Dr",
"url": "https://github.com/timarandras"
},
{
"name": "Andrew Petersen",
"url": "https://github.com/kirbysayshi"
},
{
"name": "Anisha Rohra",
"url": "https://github.com/anisha-rohra"
},
{
"name": "Anna Henningsen",
"url": "https://github.com/addaleax"
},
{
"name": "Arnaud Botella",
"url": "https://github.com/BotellaA"
},
{
"name": "Arunesh Chandra",
"url": "https://github.com/aruneshchandra"
},
{
"name": "Azlan Mukhtar",
"url": "https://github.com/azlan"
},
{
"name": "Ben Berman",
"url": "https://github.com/rivertam"
},
{
"name": "Benjamin Byholm",
"url": "https://github.com/kkoopa"
},
{
"name": "Bill Gallafent",
"url": "https://github.com/gallafent"
},
{
"name": "blagoev",
"url": "https://github.com/blagoev"
},
{
"name": "Bruce A. MacNaughton",
"url": "https://github.com/bmacnaughton"
},
{
"name": "Cory Mickelson",
"url": "https://github.com/corymickelson"
},
{
"name": "Daniel Bevenius",
"url": "https://github.com/danbev"
},
{
"name": "Dante Calderón",
"url": "https://github.com/dantehemerson"
},
{
"name": "Darshan Sen",
"url": "https://github.com/RaisinTen"
},
{
"name": "David Halls",
"url": "https://github.com/davedoesdev"
},
{
"name": "Deepak Rajamohan",
"url": "https://github.com/deepakrkris"
},
{
"name": "Dmitry Ashkadov",
"url": "https://github.com/dmitryash"
},
{
"name": "Dongjin Na",
"url": "https://github.com/nadongguri"
},
{
"name": "Doni Rubiagatra",
"url": "https://github.com/rubiagatra"
},
{
"name": "Eric Bickle",
"url": "https://github.com/ebickle"
},
{
"name": "extremeheat",
"url": "https://github.com/extremeheat"
},
{
"name": "Feng Yu",
"url": "https://github.com/F3n67u"
},
{
"name": "Ferdinand Holzer",
"url": "https://github.com/fholzer"
},
{
"name": "Gabriel Schulhof",
"url": "https://github.com/gabrielschulhof"
},
{
"name": "Guenter Sandner",
"url": "https://github.com/gms1"
},
{
"name": "Gus Caplan",
"url": "https://github.com/devsnek"
},
{
"name": "Helio Frota",
"url": "https://github.com/helio-frota"
},
{
"name": "Hitesh Kanwathirtha",
"url": "https://github.com/digitalinfinity"
},
{
"name": "ikokostya",
"url": "https://github.com/ikokostya"
},
{
"name": "Jack Xia",
"url": "https://github.com/JckXia"
},
{
"name": "Jake Barnes",
"url": "https://github.com/DuBistKomisch"
},
{
"name": "Jake Yoon",
"url": "https://github.com/yjaeseok"
},
{
"name": "Jason Ginchereau",
"url": "https://github.com/jasongin"
},
{
"name": "Jenny",
"url": "https://github.com/egg-bread"
},
{
"name": "Jeroen Janssen",
"url": "https://github.com/japj"
},
{
"name": "Jim Schlight",
"url": "https://github.com/jschlight"
},
{
"name": "Jinho Bang",
"url": "https://github.com/romandev"
},
{
"name": "José Expósito",
"url": "https://github.com/JoseExposito"
},
{
"name": "joshgarde",
"url": "https://github.com/joshgarde"
},
{
"name": "Julian Mesa",
"url": "https://github.com/julianmesa-gitkraken"
},
{
"name": "Kasumi Hanazuki",
"url": "https://github.com/hanazuki"
},
{
"name": "Kelvin",
"url": "https://github.com/kelvinhammond"
},
{
"name": "Kevin Eady",
"url": "https://github.com/KevinEady"
},
{
"name": "Kévin VOYER",
"url": "https://github.com/kecsou"
},
{
"name": "kidneysolo",
"url": "https://github.com/kidneysolo"
},
{
"name": "Koki Nishihara",
"url": "https://github.com/Nishikoh"
},
{
"name": "Konstantin Tarkus",
"url": "https://github.com/koistya"
},
{
"name": "Kyle Farnung",
"url": "https://github.com/kfarnung"
},
{
"name": "Kyle Kovacs",
"url": "https://github.com/nullromo"
},
{
"name": "legendecas",
"url": "https://github.com/legendecas"
},
{
"name": "LongYinan",
"url": "https://github.com/Brooooooklyn"
},
{
"name": "Lovell Fuller",
"url": "https://github.com/lovell"
},
{
"name": "Luciano Martorella",
"url": "https://github.com/lmartorella"
},
{
"name": "mastergberry",
"url": "https://github.com/mastergberry"
},
{
"name": "Mathias Küsel",
"url": "https://github.com/mathiask88"
},
{
"name": "Mathias Stearn",
"url": "https://github.com/RedBeard0531"
},
{
"name": "Matteo Collina",
"url": "https://github.com/mcollina"
},
{
"name": "Michael Dawson",
"url": "https://github.com/mhdawson"
},
{
"name": "Michael Price",
"url": "https://github.com/mikepricedev"
},
{
"name": "Michele Campus",
"url": "https://github.com/kYroL01"
},
{
"name": "Mikhail Cheshkov",
"url": "https://github.com/mcheshkov"
},
{
"name": "nempoBu4",
"url": "https://github.com/nempoBu4"
},
{
"name": "Nicola Del Gobbo",
"url": "https://github.com/NickNaso"
},
{
"name": "Nick Soggin",
"url": "https://github.com/iSkore"
},
{
"name": "Nikolai Vavilov",
"url": "https://github.com/seishun"
},
{
"name": "Nurbol Alpysbayev",
"url": "https://github.com/anurbol"
},
{
"name": "pacop",
"url": "https://github.com/pacop"
},
{
"name": "Peter Šándor",
"url": "https://github.com/petersandor"
},
{
"name": "Philipp Renoth",
"url": "https://github.com/DaAitch"
},
{
"name": "rgerd",
"url": "https://github.com/rgerd"
},
{
"name": "Richard Lau",
"url": "https://github.com/richardlau"
},
{
"name": "Rolf Timmermans",
"url": "https://github.com/rolftimmermans"
},
{
"name": "Ross Weir",
"url": "https://github.com/ross-weir"
},
{
"name": "Ryuichi Okumura",
"url": "https://github.com/okuryu"
},
{
"name": "Saint Gabriel",
"url": "https://github.com/chineduG"
},
{
"name": "Sampson Gao",
"url": "https://github.com/sampsongao"
},
{
"name": "Sam Roberts",
"url": "https://github.com/sam-github"
},
{
"name": "strager",
"url": "https://github.com/strager"
},
{
"name": "Taylor Woll",
"url": "https://github.com/boingoing"
},
{
"name": "Thomas Gentilhomme",
"url": "https://github.com/fraxken"
},
{
"name": "Tim Rach",
"url": "https://github.com/timrach"
},
{
"name": "Tobias Nießen",
"url": "https://github.com/tniessen"
},
{
"name": "todoroff",
"url": "https://github.com/todoroff"
},
{
"name": "Toyo Li",
"url": "https://github.com/toyobayashi"
},
{
"name": "Tux3",
"url": "https://github.com/tux3"
},
{
"name": "Vlad Velmisov",
"url": "https://github.com/Velmisov"
},
{
"name": "Vladimir Morozov",
"url": "https://github.com/vmoroz"
},
{
"name": "WenheLI",
"url": "https://github.com/WenheLI"
},
{
"name": "Xuguang Mei",
"url": "https://github.com/meixg"
},
{
"name": "Yohei Kishimoto",
"url": "https://github.com/morokosi"
},
{
"name": "Yulong Wang",
"url": "https://github.com/fs-eire"
},
{
"name": "Ziqiu Zhao",
"url": "https://github.com/ZzqiZQute"
},
{
"name": "Feng Yu",
"url": "https://github.com/F3n67u"
},
{
"name": "wanlu wang",
"url": "https://github.com/wanlu"
},
{
"name": "Caleb Hearon",
"url": "https://github.com/chearon"
},
{
"name": "Marx",
"url": "https://github.com/MarxJiao"
},
{
"name": "Ömer AKGÜL",
"url": "https://github.com/tuhalf"
}
],
"description": "Node.js API (Node-API)",
"devDependencies": {
"benchmark": "^2.1.4",
"bindings": "^1.5.0",
"clang-format": "^1.4.0",
"eslint": "^7.32.0",
"eslint-config-semistandard": "^16.0.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"fs-extra": "^11.1.1",
"path": "^0.12.7",
"pre-commit": "^1.2.2",
"safe-buffer": "^5.1.1"
},
"directories": {},
"gypfile": false,
"homepage": "https://github.com/nodejs/node-addon-api",
"keywords": [
"n-api",
"napi",
"addon",
"native",
"bindings",
"c",
"c++",
"nan",
"node-addon-api"
],
"license": "MIT",
"main": "index.js",
"name": "node-addon-api",
"readme": "README.md",
"repository": {
"type": "git",
"url": "git://github.com/nodejs/node-addon-api.git"
},
"files": [
"*.{c,h,gyp,gypi}",
"package-support.json",
"tools/"
],
"scripts": {
"prebenchmark": "node-gyp rebuild -C benchmark",
"benchmark": "node benchmark",
"pretest": "node-gyp rebuild -C test",
"test": "node test",
"test:debug": "node-gyp rebuild -C test --debug && NODE_API_BUILD_CONFIG=Debug node ./test/index.js",
"predev": "node-gyp rebuild -C test --debug",
"dev": "node test",
"predev:incremental": "node-gyp configure build -C test --debug",
"dev:incremental": "node test",
"doc": "doxygen doc/Doxyfile",
"lint": "node tools/eslint-format && node tools/clang-format",
"lint:fix": "node tools/clang-format --fix && node tools/eslint-format --fix"
},
"pre-commit": "lint",
"version": "7.1.1",
"support": true
}
@@ -0,0 +1,29 @@
{
"name": "@pkgr/core",
"version": "0.1.2",
"type": "module",
"description": "Shared core module for `@pkgr` packages or any package else",
"repository": "https://github.com/un-ts/pkgr.git",
"homepage": "https://github.com/un-ts/pkgr/blob/master/packages/core",
"author": "JounQin <admin@1stg.me> (https://www.1stG.me)",
"funding": "https://opencollective.com/unts",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.18.0 || >=16.0.0"
},
"main": "./lib/index.cjs",
"module": "./lib/index.js",
"exports": {
"types": "./lib/index.d.ts",
"import": "./lib/index.js",
"require": "./lib/index.cjs"
},
"types": "./lib/index.d.ts",
"files": [
"lib"
],
"publishConfig": {
"access": "public"
},
"sideEffects": false
}
@@ -0,0 +1,240 @@
import * as vite from 'vite';
import { InlineConfig, UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1, LogLevel, LoggerOptions, Logger as Logger$1 } from 'vite';
export { vite as Vite };
export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
import { IncomingMessage } from 'node:http';
import { h as ResolvedConfig, f as UserConfig, i as VitestRunMode, j as VitestOptions, V as Vitest, A as ApiConfig, k as TestSpecification, T as TestProject, P as PoolWorker, l as PoolOptions, m as WorkerRequest, n as TestSequencer, L as Logger } from './chunks/reporters.d.BQ0wpUaj.js';
export { at as BaseCoverageOptions, Y as BenchmarkUserOptions, Z as BrowserBuiltinProvider, $ as BrowserCommand, a0 as BrowserCommandContext, a1 as BrowserConfigOptions, a2 as BrowserInstanceOption, a3 as BrowserModuleMocker, a4 as BrowserOrchestrator, a5 as BrowserProvider, a6 as BrowserProviderOption, a7 as BrowserScript, a8 as BrowserServerFactory, a9 as BrowserServerOptions, aa as BrowserServerState, ab as BrowserServerStateSession, ai as BuiltinEnvironment, ac as CDPSession, aj as CSSModuleScopeStrategy, au as CoverageIstanbulOptions, av as CoverageOptions, aw as CoverageProvider, ax as CoverageProviderModule, ay as CoverageReporter, c as CoverageV8Options, az as CustomProviderOptions, ak as DepsOptimizationOptions, al as EnvironmentOptions, H as HTMLOptions, I as InlineConfig, t as JUnitOptions, J as JsonOptions, M as ModuleDiagnostic, O as OnServerRestartHandler, o as OnTestsRerunHandler, ad as ParentProjectBrowser, am as Pool, q as PoolRunnerInitializer, r as PoolTask, ae as ProjectBrowser, an as ProjectConfig, b as ReportContext, aB as ReportedHookContext, aC as Reporter, ap as ResolveSnapshotPathHandler, aq as ResolveSnapshotPathHandlerContext, af as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ao as ResolvedProjectConfig, S as SerializedTestProject, u as TaskOptions, v as TestCase, w as TestCollection, x as TestDiagnostic, y as TestModule, z as TestModuleState, B as TestResult, D as TestResultFailed, E as TestResultPassed, F as TestResultSkipped, aD as TestRunEndReason, aA as TestRunResult, X as TestSequencerConstructor, G as TestState, K as TestSuite, N as TestSuiteState, ag as ToMatchScreenshotComparators, ah as ToMatchScreenshotOptions, ar as TypecheckConfig, U as UserWorkspaceConfig, as as VitestEnvironment, p as VitestPackageInstaller, W as WatcherTriggerPattern, s as WorkerResponse, _ as _BrowserNames, Q as experimental_getRunnerTask } from './chunks/reporters.d.BQ0wpUaj.js';
import { Awaitable } from '@vitest/utils';
export { SerializedError } from '@vitest/utils';
import { R as RuntimeRPC, C as ContextRPC } from './chunks/worker.d.ZGohxCEd.js';
export { T as TestExecutionType } from './chunks/worker.d.ZGohxCEd.js';
import { Writable } from 'node:stream';
export { V as VitestPluginContext } from './chunks/plugin.d.DevON6kQ.js';
import { Debugger } from 'debug';
import './chunks/global.d.BQDgW9Pr.js';
export { Task as RunnerTask, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
export { b as RuntimeConfig } from './chunks/config.d.BTfZNUu9.js';
export { generateFileHash } from '@vitest/runner/utils';
import '@vitest/mocker';
import '@vitest/utils/source-map';
import 'vitest/browser';
import './chunks/browser.d.DnU_kh8a.js';
import '@vitest/pretty-format';
import '@vitest/snapshot';
import '@vitest/utils/diff';
import '@vitest/expect';
import 'vitest/optional-types.js';
import './chunks/benchmark.d.DAaHLpsq.js';
import 'tinybench';
import './chunks/coverage.d.BZtK59WP.js';
import '@vitest/snapshot/manager';
import 'node:fs';
import 'node:console';
import 'vite/module-runner';
import './chunks/environment.d.CrsxCzP1.js';
type RawErrsMap = Map<string, TscErrorInfo[]>;
interface TscErrorInfo {
filePath: string;
errCode: number;
errMsg: string;
line: number;
column: number;
}
interface CollectLineNumbers {
target: number;
next: number;
prev?: number;
}
type CollectLines = { [key in keyof CollectLineNumbers] : string };
interface RootAndTarget {
root: string;
targetAbsPath: string;
}
type Context = RootAndTarget & {
rawErrsMap: RawErrsMap;
openedDirs: Set<string>;
lastActivePath?: string;
};
declare function isValidApiRequest(config: ResolvedConfig, req: IncomingMessage): boolean;
declare function escapeTestName(label: string, dynamic: boolean): string;
interface CliOptions extends UserConfig {
/**
* Override the watch mode
*/
run?: boolean;
/**
* Removes colors from the console output
*/
color?: boolean;
/**
* Output collected tests as JSON or to a file
*/
json?: string | boolean;
/**
* Output collected test files only
*/
filesOnly?: boolean;
/**
* Override vite config's configLoader from cli.
* Use `bundle` to bundle the config with esbuild or `runner` (experimental) to process it on the fly (default: `bundle`).
* This is only available with **vite version 6.1.0** and above.
* @experimental
*/
configLoader?: InlineConfig extends {
configLoader?: infer T;
} ? T : never;
}
/**
* Start Vitest programmatically
*
* Returns a Vitest instance if initialized successfully.
*/
declare function startVitest(mode: VitestRunMode, cliFilters?: string[], options?: CliOptions, viteOverrides?: UserConfig$1, vitestOptions?: VitestOptions): Promise<Vitest>;
interface CliParseOptions {
allowUnknownOptions?: boolean;
}
declare function parseCLI(argv: string | string[], config?: CliParseOptions): {
filter: string[];
options: CliOptions;
};
declare function resolveApiServerConfig<Options extends ApiConfig & Omit<UserConfig, "expect">>(options: Options, defaultPort: number): ApiConfig | undefined;
declare function createVitest(mode: VitestRunMode, options: CliOptions, viteOverrides?: UserConfig$1, vitestOptions?: VitestOptions): Promise<Vitest>;
declare class FilesNotFoundError extends Error {
code: string;
constructor(mode: "test" | "benchmark");
}
declare class GitNotFoundError extends Error {
code: string;
constructor();
}
declare function VitestPlugin(options?: UserConfig, vitest?: Vitest): Promise<Plugin[]>;
declare function resolveConfig(options?: UserConfig, viteOverrides?: UserConfig$1): Promise<{
vitestConfig: ResolvedConfig;
viteConfig: ResolvedConfig$1;
}>;
declare function resolveFsAllow(projectRoot: string, rootConfigFile: string | false | undefined): string[];
type RunWithFiles = (files: TestSpecification[], invalidates?: string[]) => Promise<void>;
interface ProcessPool {
name: string;
runTests: RunWithFiles;
collectTests: RunWithFiles;
close?: () => Awaitable<void>;
}
declare function getFilePoolName(project: TestProject): ResolvedConfig["pool"];
interface MethodsOptions {
cacheFs?: boolean;
collect?: boolean;
}
declare function createMethodsRPC(project: TestProject, options?: MethodsOptions): RuntimeRPC;
/** @experimental */
declare class ForksPoolWorker implements PoolWorker {
readonly name: string;
readonly cacheFs: boolean;
protected readonly entrypoint: string;
protected execArgv: string[];
protected env: Partial<NodeJS.ProcessEnv>;
private _fork?;
private stdout;
private stderr;
constructor(options: PoolOptions);
on(event: string, callback: (arg: any) => void): void;
off(event: string, callback: (arg: any) => void): void;
send(message: WorkerRequest): void;
start(): Promise<void>;
stop(): Promise<void>;
deserialize(data: unknown): unknown;
private get fork();
}
/** @experimental */
declare class ThreadsPoolWorker implements PoolWorker {
readonly name: string;
protected readonly entrypoint: string;
protected execArgv: string[];
protected env: Partial<NodeJS.ProcessEnv>;
private _thread?;
private stdout;
private stderr;
constructor(options: PoolOptions);
on(event: string, callback: (arg: any) => void): void;
off(event: string, callback: (arg: any) => void): void;
send(message: WorkerRequest): void;
start(): Promise<void>;
stop(): Promise<void>;
deserialize(data: unknown): unknown;
private get thread();
}
/** @experimental */
declare class TypecheckPoolWorker implements PoolWorker {
readonly name: string;
private readonly project;
private _eventEmitter;
constructor(options: PoolOptions);
start(): Promise<void>;
stop(): Promise<void>;
canReuse(): boolean;
send(message: WorkerRequest): void;
on(event: string, callback: (arg: any) => any): void;
off(event: string, callback: (arg: any) => any): void;
deserialize(data: unknown): unknown;
}
/** @experimental */
declare class VmForksPoolWorker extends ForksPoolWorker {
readonly name = "vmForks";
readonly reportMemory: true;
protected readonly entrypoint: string;
constructor(options: PoolOptions);
}
/** @experimental */
declare class VmThreadsPoolWorker extends ThreadsPoolWorker {
readonly name = "vmThreads";
readonly reportMemory: true;
protected readonly entrypoint: string;
constructor(options: PoolOptions);
}
declare class BaseSequencer implements TestSequencer {
protected ctx: Vitest;
constructor(ctx: Vitest);
shard(files: TestSpecification[]): Promise<TestSpecification[]>;
sort(files: TestSpecification[]): Promise<TestSpecification[]>;
private calculateShardRange;
}
declare function registerConsoleShortcuts(ctx: Vitest, stdin: NodeJS.ReadStream | undefined, stdout: NodeJS.WriteStream | Writable): () => void;
interface WorkerContext extends ContextRPC {}
declare function createViteLogger(console: Logger, level?: LogLevel, options?: LoggerOptions): Logger$1;
declare const rootDir: string;
declare const distDir: string;
declare function createDebugger(namespace: `vitest:${string}`): Debugger | undefined;
declare const version: string;
declare const createViteServer: typeof vite.createServer;
declare const rolldownVersion: string | undefined;
export { ApiConfig, BaseSequencer, ForksPoolWorker, GitNotFoundError, PoolOptions, PoolWorker, ResolvedConfig, TestProject, TestSequencer, TestSpecification, UserConfig as TestUserConfig, FilesNotFoundError as TestsNotFoundError, ThreadsPoolWorker, TypecheckPoolWorker, Vitest, VitestOptions, VitestPlugin, VitestRunMode, VmForksPoolWorker, VmThreadsPoolWorker, WorkerRequest, createDebugger, createMethodsRPC, createViteLogger, createViteServer, createVitest, distDir, escapeTestName, getFilePoolName, isValidApiRequest, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rolldownVersion, rootDir, startVitest, version };
export type { CliOptions, CliParseOptions, ProcessPool, CollectLineNumbers as TypeCheckCollectLineNumbers, CollectLines as TypeCheckCollectLines, Context as TypeCheckContext, TscErrorInfo as TypeCheckErrorInfo, RawErrsMap as TypeCheckRawErrorsMap, RootAndTarget as TypeCheckRootAndTarget, WorkerContext };
@@ -0,0 +1,2 @@
import { TSESTree } from '@typescript-eslint/types';
export declare const getValue: (node: TSESTree.Identifier | TSESTree.StringLiteral) => string;
@@ -0,0 +1,16 @@
import type { ParserServicesWithTypeInformation, TSESTree } from '@typescript-eslint/utils';
import * as ts from 'typescript';
/**
* Inspect a call expression to see if it's a call to an assertion function.
* If it is, return the node of the argument that is asserted.
*/
export declare function findTruthinessAssertedArgument(services: ParserServicesWithTypeInformation, node: TSESTree.CallExpression): TSESTree.Expression | undefined;
/**
* Inspect a call expression to see if it's a call to an assertion function.
* If it is, return the node of the argument that is asserted and other useful info.
*/
export declare function findTypeGuardAssertedArgument(services: ParserServicesWithTypeInformation, node: TSESTree.CallExpression): {
argument: TSESTree.Expression;
asserts: boolean;
type: ts.Type;
} | undefined;
@@ -0,0 +1,37 @@
'use strict';
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var objectKeys = require('object-keys');
var safePushApply = require('safe-push-apply');
var callBound = require('call-bound');
var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
var forEach = require('../helpers/forEach');
// https://262.ecma-international.org/8.0/#sec-enumerableownproperties
module.exports = function EnumerableOwnPropertyNames(O, kind) {
if (!isObject(O)) {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
var keys = objectKeys(O);
if (kind === 'key') {
return keys;
}
if (kind === 'value' || kind === 'key+value') {
var results = [];
forEach(keys, function (key) {
if ($isEnumerable(O, key)) {
safePushApply(results, [
kind === 'value' ? O[key] : [key, O[key]]
]);
}
});
return results;
}
throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind);
};
@@ -0,0 +1,195 @@
import type { FieldValues } from './fields';
import type { Control } from './form';
import type { FieldArrayPath, FieldArrayPathValue } from './path';
import type { RegisterOptions, Validate } from './validator';
export type UseFieldArrayProps<TFieldValues extends FieldValues = FieldValues, TFieldArrayName extends FieldArrayPath<TFieldValues> = FieldArrayPath<TFieldValues>, TKeyName extends string = 'id', TTransformedValues = TFieldValues> = {
name: TFieldArrayName;
keyName?: TKeyName;
control?: Control<TFieldValues, any, TTransformedValues>;
rules?: {
validate?: Validate<FieldArray<TFieldValues, TFieldArrayName>[], TFieldValues> | Record<string, Validate<FieldArray<TFieldValues, TFieldArrayName>[], TFieldValues>>;
} & Pick<RegisterOptions<TFieldValues>, 'maxLength' | 'minLength' | 'required'>;
shouldUnregister?: boolean;
};
/**
* `useFieldArray` returned `fields` with unique id
*/
export type FieldArrayWithId<TFieldValues extends FieldValues = FieldValues, TFieldArrayName extends FieldArrayPath<TFieldValues> = FieldArrayPath<TFieldValues>, TKeyName extends string = 'id'> = FieldArray<TFieldValues, TFieldArrayName> & Record<TKeyName, string>;
export type FieldArray<TFieldValues extends FieldValues = FieldValues, TFieldArrayName extends FieldArrayPath<TFieldValues> = FieldArrayPath<TFieldValues>> = FieldArrayPathValue<TFieldValues, TFieldArrayName> extends ReadonlyArray<infer U> | null | undefined ? U : never;
/**
* `useFieldArray` focus option, ability to toggle focus on and off with `shouldFocus` and setting focus by either field index or name.
*/
export type FieldArrayMethodProps = {
shouldFocus?: boolean;
focusIndex?: number;
focusName?: string;
};
/**
* Swap field array by supplying from and to index
*
* @remarks
* [API](https://react-hook-form.com/docs/usefieldarray) • [Demo](https://codesandbox.io/s/calc-i231d)
*
* @param indexA - from index
* @param indexB - to index
*
* @example
* ```tsx
* <button type="button" onClick={() => swap(0, 1)}>swap</button>
* ```
*/
export type UseFieldArraySwap = (indexA: number, indexB: number) => void;
/**
* Move field array by supplying from and to index
*
* @remarks
* [API](https://react-hook-form.com/docs/usefieldarray) • [Demo](https://codesandbox.io/s/calc-i231d)
*
* @param indexA - from index
* @param indexB - to index
*
* @example
* ```tsx
* <button type="button" onClick={() => move(0, 1)}>swap</button>
* ```
*/
export type UseFieldArrayMove = (indexA: number, indexB: number) => void;
/**
* Prepend field/fields to the start of the fields and optionally focus. The input value will be registered during this action.
*
* @remarks
* [API](https://react-hook-form.com/docs/usefieldarray) • [Demo](https://codesandbox.io/s/calc-i231d)
*
* @param value - prepend items or items
* @param options - focus options
*
* @example
* ```tsx
* <button type="button" onClick={() => prepend({ name: "data" })}>Prepend</button>
* <button type="button" onClick={() => prepend({ name: "data" }, { shouldFocus: false })}>Prepend</button>
* <button
* type="button"
* onClick={() => prepend([{ name: "data" }, { name: "data" }])}
* >
* Prepend
* </button>
* ```
*/
export type UseFieldArrayPrepend<TFieldValues extends FieldValues, TFieldArrayName extends FieldArrayPath<TFieldValues> = FieldArrayPath<TFieldValues>> = (value: FieldArray<TFieldValues, TFieldArrayName> | FieldArray<TFieldValues, TFieldArrayName>[], options?: FieldArrayMethodProps) => void;
/**
* Append field/fields to the end of your fields and focus. The input value will be registered during this action.
*
* @remarks
* [API](https://react-hook-form.com/docs/usefieldarray) • [Demo](https://codesandbox.io/s/calc-i231d)
*
* @param value - append items or items.
* @param options - focus options
*
* @example
* ```tsx
* <button type="button" onClick={() => append({ name: "data" })}>Append</button>
* <button type="button" onClick={() => append({ name: "data" }, { shouldFocus: false })}>Append</button>
* <button
* type="button"
* onClick={() => append([{ name: "data" }, { name: "data" }])}
* >
* Append
* </button>
* ```
*/
export type UseFieldArrayAppend<TFieldValues extends FieldValues, TFieldArrayName extends FieldArrayPath<TFieldValues> = FieldArrayPath<TFieldValues>> = (value: FieldArray<TFieldValues, TFieldArrayName> | FieldArray<TFieldValues, TFieldArrayName>[], options?: FieldArrayMethodProps) => void;
/**
* Remove field/fields at particular position.
*
* @remarks
* [API](https://react-hook-form.com/docs/usefieldarray) • [Demo](https://codesandbox.io/s/calc-i231d)
*
* @param index - index to remove at, or remove all when no index provided.
*
* @example
* ```tsx
* <button type="button" onClick={() => remove(0)}>Remove</button>
* <button
* type="button"
* onClick={() => remove()}
* >
* Remove all
* </button>
* ```
*/
export type UseFieldArrayRemove = (index?: number | number[]) => void;
/**
* Insert field/fields at particular position and focus.
*
* @remarks
* [API](https://react-hook-form.com/docs/usefieldarray) • [Demo](https://codesandbox.io/s/calc-i231d)
*
* @param index - insert position
* @param value - insert field or fields
* @param options - focus options
*
* @example
* ```tsx
* <button type="button" onClick={() => insert(1, { name: "data" })}>Insert</button>
* <button type="button" onClick={() => insert(1, { name: "data" }, { shouldFocus: false })}>Insert</button>
* <button
* type="button"
* onClick={() => insert(1, [{ name: "data" }, { name: "data" }])}
* >
* Insert
* </button>
* ```
*/
export type UseFieldArrayInsert<TFieldValues extends FieldValues, TFieldArrayName extends FieldArrayPath<TFieldValues> = FieldArrayPath<TFieldValues>> = (index: number, value: FieldArray<TFieldValues, TFieldArrayName> | FieldArray<TFieldValues, TFieldArrayName>[], options?: FieldArrayMethodProps) => void;
/**
* Update field/fields at particular position.
*
* @remarks
* [API](https://react-hook-form.com/docs/usefieldarray) • [Demo](https://codesandbox.io/s/calc-i231d)
*
* @param index - insert position
* @param value - insert field or fields
*
* @example
* ```tsx
* <button type="button" onClick={() => update(1, { name: "data" })}>Update</button>
* <button
* type="button"
* onClick={() => update(1, [{ name: "data" }, { name: "data" }])}
* >
* Update
* </button>
* ```
*/
export type UseFieldArrayUpdate<TFieldValues extends FieldValues, TFieldArrayName extends FieldArrayPath<TFieldValues> = FieldArrayPath<TFieldValues>> = (index: number, value: FieldArray<TFieldValues, TFieldArrayName>) => void;
/**
* Replace the entire field array values.
*
* @remarks
* [API](https://react-hook-form.com/docs/usefieldarray) • [Demo](https://codesandbox.io/s/calc-i231d)
*
* @param value - the entire field values.
*
* @example
* ```tsx
* <button
* type="button"
* onClick={() => replace([{ name: "data" }, { name: "data" }])}
* >
* Replace
* </button>
* ```
*/
export type UseFieldArrayReplace<TFieldValues extends FieldValues, TFieldArrayName extends FieldArrayPath<TFieldValues> = FieldArrayPath<TFieldValues>> = (value: FieldArray<TFieldValues, TFieldArrayName> | FieldArray<TFieldValues, TFieldArrayName>[]) => void;
export type UseFieldArrayReturn<TFieldValues extends FieldValues = FieldValues, TFieldArrayName extends FieldArrayPath<TFieldValues> = FieldArrayPath<TFieldValues>, TKeyName extends string = 'id'> = {
swap: UseFieldArraySwap;
move: UseFieldArrayMove;
prepend: UseFieldArrayPrepend<TFieldValues, TFieldArrayName>;
append: UseFieldArrayAppend<TFieldValues, TFieldArrayName>;
remove: UseFieldArrayRemove;
insert: UseFieldArrayInsert<TFieldValues, TFieldArrayName>;
update: UseFieldArrayUpdate<TFieldValues, TFieldArrayName>;
replace: UseFieldArrayReplace<TFieldValues, TFieldArrayName>;
fields: FieldArrayWithId<TFieldValues, TFieldArrayName, TKeyName>[];
};
//# sourceMappingURL=fieldArray.d.ts.map
@@ -0,0 +1,8 @@
"use client";
import {
navbar_item_default
} from "./chunk-5LMKFFWA.mjs";
import "./chunk-IGERPFKH.mjs";
export {
navbar_item_default as default
};
@@ -0,0 +1,21 @@
import './base/accordion-item-base.mjs';
import * as _heroui_system from '@heroui/system';
import { UseAccordionProps } from './use-accordion.mjs';
import './use-accordion-item.mjs';
import '@heroui/theme';
import '@heroui/aria-utils';
import '@react-types/shared';
import 'react';
import 'framer-motion';
import '@react-types/accordion';
import '@heroui/react-utils';
import '@react-stately/tree';
import '@heroui/divider';
import './accordion-item.mjs';
import 'tailwind-variants';
interface AccordionProps extends UseAccordionProps {
}
declare const AccordionGroup: _heroui_system.InternalForwardRefRenderFunction<"div", AccordionProps, never>;
export { type AccordionProps, AccordionGroup as default };
@@ -0,0 +1,38 @@
{
"name": "@react-aria/switch",
"version": "3.6.10",
"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/toggle": "^3.10.10",
"@react-stately/toggle": "^3.8.0",
"@react-types/shared": "^3.26.0",
"@react-types/switch": "^3.5.7",
"@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,34 @@
var baseForOwnRight = require('./_baseForOwnRight'),
castFunction = require('./_castFunction');
/**
* This method is like `_.forOwn` except that it iterates over properties of
* `object` in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forOwn
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forOwnRight(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
*/
function forOwnRight(object, iteratee) {
return object && baseForOwnRight(object, castFunction(iteratee));
}
module.exports = forOwnRight;
@@ -0,0 +1,6 @@
import type { ActiveAnimationType } from '../types';
/**
* 动画关闭处理真实关闭状态
* 通过 onAnimationEnd 回调实现 leaveCallback
*/
export default function useAnimationVisible(visible: boolean | undefined, afterClose?: () => void): [realVisible: boolean | undefined, activeAnimation: ActiveAnimationType, onAnimationEnd: () => void];
@@ -0,0 +1,17 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $String = GetIntrinsic('%String%');
var $TypeError = require('es-errors/type');
// https://262.ecma-international.org/9.0/#sec-tostring-applied-to-the-number-type
module.exports = function NumberToString(m) {
if (typeof m !== 'number') {
throw new $TypeError('Assertion failed: "m" must be a String');
}
return $String(m);
};
@@ -0,0 +1 @@
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["content.js"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,sBAFU,SAAS,CAEwD;+BAbjE,sBAAsB"}
@@ -0,0 +1,232 @@
/**
* @fileoverview A rule to ensure whitespace before blocks.
* @author Mathias Schreck <https://github.com/lo1tuma>
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Checks whether the given node represents the body of a function.
* @param {ASTNode} node the node to check.
* @returns {boolean} `true` if the node is function body.
*/
function isFunctionBody(node) {
const parent = node.parent;
return (
node.type === "BlockStatement" &&
astUtils.isFunction(parent) &&
parent.body === node
);
}
//------------------------------------------------------------------------------
// 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: "space-before-blocks",
url: "https://eslint.style/rules/space-before-blocks",
},
},
],
},
type: "layout",
docs: {
description: "Enforce consistent spacing before blocks",
recommended: false,
url: "https://eslint.org/docs/latest/rules/space-before-blocks",
},
fixable: "whitespace",
schema: [
{
oneOf: [
{
enum: ["always", "never"],
},
{
type: "object",
properties: {
keywords: {
enum: ["always", "never", "off"],
},
functions: {
enum: ["always", "never", "off"],
},
classes: {
enum: ["always", "never", "off"],
},
},
additionalProperties: false,
},
],
},
],
messages: {
unexpectedSpace: "Unexpected space before opening brace.",
missingSpace: "Missing space before opening brace.",
},
},
create(context) {
const config = context.options[0],
sourceCode = context.sourceCode;
let alwaysFunctions = true,
alwaysKeywords = true,
alwaysClasses = true,
neverFunctions = false,
neverKeywords = false,
neverClasses = false;
if (typeof config === "object") {
alwaysFunctions = config.functions === "always";
alwaysKeywords = config.keywords === "always";
alwaysClasses = config.classes === "always";
neverFunctions = config.functions === "never";
neverKeywords = config.keywords === "never";
neverClasses = config.classes === "never";
} else if (config === "never") {
alwaysFunctions = false;
alwaysKeywords = false;
alwaysClasses = false;
neverFunctions = true;
neverKeywords = true;
neverClasses = true;
}
/**
* Checks whether the spacing before the given block is already controlled by another rule:
* - `arrow-spacing` checks spaces after `=>`.
* - `keyword-spacing` checks spaces after keywords in certain contexts.
* - `switch-colon-spacing` checks spaces after `:` of switch cases.
* @param {Token} precedingToken first token before the block.
* @param {ASTNode|Token} node `BlockStatement` node or `{` token of a `SwitchStatement` node.
* @returns {boolean} `true` if requiring or disallowing spaces before the given block could produce conflicts with other rules.
*/
function isConflicted(precedingToken, node) {
return (
astUtils.isArrowToken(precedingToken) ||
(astUtils.isKeywordToken(precedingToken) &&
!isFunctionBody(node)) ||
(astUtils.isColonToken(precedingToken) &&
node.parent &&
node.parent.type === "SwitchCase" &&
precedingToken ===
astUtils.getSwitchCaseColonToken(
node.parent,
sourceCode,
))
);
}
/**
* Checks the given BlockStatement node has a preceding space if it doesn’t start on a new line.
* @param {ASTNode|Token} node The AST node of a BlockStatement.
* @returns {void} undefined.
*/
function checkPrecedingSpace(node) {
const precedingToken = sourceCode.getTokenBefore(node);
if (
precedingToken &&
!isConflicted(precedingToken, node) &&
astUtils.isTokenOnSameLine(precedingToken, node)
) {
const hasSpace = sourceCode.isSpaceBetweenTokens(
precedingToken,
node,
);
let requireSpace;
let requireNoSpace;
if (isFunctionBody(node)) {
requireSpace = alwaysFunctions;
requireNoSpace = neverFunctions;
} else if (node.type === "ClassBody") {
requireSpace = alwaysClasses;
requireNoSpace = neverClasses;
} else {
requireSpace = alwaysKeywords;
requireNoSpace = neverKeywords;
}
if (requireSpace && !hasSpace) {
context.report({
node,
messageId: "missingSpace",
fix(fixer) {
return fixer.insertTextBefore(node, " ");
},
});
} else if (requireNoSpace && hasSpace) {
context.report({
node,
messageId: "unexpectedSpace",
fix(fixer) {
return fixer.removeRange([
precedingToken.range[1],
node.range[0],
]);
},
});
}
}
}
/**
* Checks if the CaseBlock of an given SwitchStatement node has a preceding space.
* @param {ASTNode} node The node of a SwitchStatement.
* @returns {void} undefined.
*/
function checkSpaceBeforeCaseBlock(node) {
const cases = node.cases;
let openingBrace;
if (cases.length > 0) {
openingBrace = sourceCode.getTokenBefore(cases[0]);
} else {
openingBrace = sourceCode.getLastToken(node, 1);
}
checkPrecedingSpace(openingBrace);
}
return {
BlockStatement: checkPrecedingSpace,
ClassBody: checkPrecedingSpace,
SwitchStatement: checkSpaceBeforeCaseBlock,
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/rules/export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAGzD,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,UAAU,EACV,QAAQ,GACT,MAAM,mBAAmB,CAAA;AAqB1B,MAAM,WAAW,GAAG,MAAM,CAAA;AAC1B,MAAM,YAAY,GAAG,OAAO,CAAA;AAa5B,SAAS,iCAAiC,CAAC,KAAyB;IAClE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,QAAQ,GACZ,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,wBAAwB;YACnD,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI;YACvB,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAA;QACvB,IAAI,QAAQ,KAAK,cAAc,CAAC,iBAAiB,EAAE,CAAC;YAClD,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QACpB,CAAC;IACH,CAAC;AACH,CAAC;AAUD,SAAS,4BAA4B,CAAC,KAAyB;IAC7D,MAAM,KAAK,GAAG,IAAI,GAAG,CACnB,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAO,CAAC,IAAI,EAAW,CAAC,CAC3D,CAAA;IACD,MAAM,gBAAgB,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,CACxC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAO,CAAC,IAAI,KAAK,qBAAqB,CACpD,CAAA;IAED,OAAO,CACL,KAAK,CAAC,GAAG,CAAC,qBAAqB,CAAC;QAChC,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;YAEf,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;gBACf,CAAC,KAAK,CAAC,GAAG,CAAC,qBAAqB,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC;YACvE,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;gBACf,KAAK,CAAC,GAAG,CAAC,qBAAqB,CAAC;gBAChC,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;YAEjC,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;gBACf,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;gBACjE,gBAAgB,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CACpC,CAAA;AACH,CAAC;AAWD,SAAS,6BAA6B,CACpC,IAAmB,EACnB,KAAyB;IAEzB,MAAM,KAAK,GAAG,IAAI,GAAG,CACnB,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAO,CAAC,IAAI,EAAW,CAAC,CAC3D,CAAA;IAED,OAAO,CACL,CAAC,4BAA4B,CAAC,KAAK,CAAC;QACpC,IAAI,CAAC,MAAO,CAAC,IAAI,KAAK,qBAAqB;QAC3C,CAAC,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC;YAC7B,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC;YAC7B,KAAK,CAAC,GAAG,CAAC,qBAAqB,CAAC;YAChC,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAClC,CAAA;AACH,CAAC;AAID,eAAe,UAAU,CAAgB;IACvC,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EACT,8DAA8D;SACjE;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,gDAAgD;YACzD,YAAY,EAAE,2BAA2B;YACzC,UAAU,EAAE,sCAAsC;SACnD;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,SAAS,GAAG,IAAI,GAAG,CAGvB,CAAC,CAAC,WAAW,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;QAE7B,SAAS,QAAQ,CACf,IAAY,EACZ,IAAmB,EACnB,MAA6C,EAC7C,MAAgB;YAEhB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC3B,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC,CAAA;YAClC,CAAC;YAED,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM,CAAE,CAAA;YAEpC,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;YAEpD,IAAI,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YAE1B,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;gBAClB,KAAK,GAAG,IAAI,GAAG,EAAE,CAAA;gBACjB,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;YACvB,CAAC;YAED,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACjB,CAAC;QAED,SAAS,SAAS,CAAC,IAAmB;YACpC,IAAI,IAAI,CAAC,MAAM,EAAE,IAAI,KAAK,eAAe,EAAE,CAAC;gBAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,MAAsC,CAAA;YAC3D,CAAC;YAID,OAAO,WAAW,CAAA;QACpB,CAAC;QAED,OAAO;YACL,wBAAwB,CAAC,IAAI;gBAC3B,QAAQ,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;YAC5C,CAAC;YAED,eAAe,CAAC,IAAI;gBAClB,QAAQ,CACN,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EACvB,IAAI,CAAC,QAAQ,EACb,SAAS,CAAC,IAAI,CAAC,MAAO,CAAC,CACxB,CAAA;YACH,CAAC;YAED,sBAAsB,CAAC,IAAI;gBACzB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC;oBAC7B,OAAM;gBACR,CAAC;gBAED,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;gBAE9B,MAAM,kBAAkB,GACtB,MAAM,IAAI,IAAI,CAAC,WAAW;oBAE1B,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,MAAM,CAAA;gBAElC,IAAI,IAAI,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC;oBAC5D,MAAM,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,EAAyB,CAAA;oBACrD,QAAQ,CACN,EAAE,CAAC,IAAI,EACP,EAAE,EACF,MAAM,EACN,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,QAAQ,CAC3D,IAAI,CAAC,WAAW,CAAC,IAAI,CACtB,IAAI,kBAAkB,CACxB,CAAA;gBACH,CAAC;gBAED,IACE,cAAc,IAAI,IAAI,CAAC,WAAW;oBAClC,IAAI,CAAC,WAAW,CAAC,YAAY,IAAI,IAAI,EACrC,CAAC;oBACD,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;wBACxD,uBAAuB,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE;4BAC1C,QAAQ,CACL,CAAyB,CAAC,IAAI,EAC/B,CAAC,EACD,MAAM,EACN,kBAAkB,CACnB,CAAA;wBACH,CAAC,CAAC,CAAA;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;YAED,oBAAoB,CAAC,IAAI;gBACvB,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;oBACxB,OAAM;gBACR,CAAC;gBAGD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;oBACxC,OAAM;gBACR,CAAC;gBAED,MAAM,aAAa,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;gBAC/D,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;oBAC1B,OAAM;gBACR,CAAC;gBAED,IAAI,aAAa,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACpC,aAAa,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;oBACzC,OAAM;gBACR,CAAC;gBAED,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;gBAE9B,IAAI,GAAG,GAAG,KAAK,CAAA;gBAEf,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE;oBACjC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;wBACvB,GAAG,GAAG,IAAI,CAAA;wBACV,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;oBAC9B,CAAC;gBACH,CAAC,CAAC,CAAA;gBAEF,IAAI,CAAC,GAAG,EAAE,CAAC;oBACT,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAE,IAAI,CAAC,MAAM;wBACjB,SAAS,EAAE,SAAS;wBACpBLine truncated
@@ -0,0 +1,263 @@
[
"3dm",
"3ds",
"3g2",
"3gp",
"7z",
"a",
"aac",
"adp",
"afdesign",
"afphoto",
"afpub",
"ai",
"aif",
"aiff",
"alz",
"ape",
"apk",
"appimage",
"ar",
"arj",
"asf",
"au",
"avi",
"bak",
"baml",
"bh",
"bin",
"bk",
"bmp",
"btif",
"bz2",
"bzip2",
"cab",
"caf",
"cgm",
"class",
"cmx",
"cpio",
"cr2",
"cur",
"dat",
"dcm",
"deb",
"dex",
"djvu",
"dll",
"dmg",
"dng",
"doc",
"docm",
"docx",
"dot",
"dotm",
"dra",
"DS_Store",
"dsk",
"dts",
"dtshd",
"dvb",
"dwg",
"dxf",
"ecelp4800",
"ecelp7470",
"ecelp9600",
"egg",
"eol",
"eot",
"epub",
"exe",
"f4v",
"fbs",
"fh",
"fla",
"flac",
"flatpak",
"fli",
"flv",
"fpx",
"fst",
"fvt",
"g3",
"gh",
"gif",
"graffle",
"gz",
"gzip",
"h261",
"h263",
"h264",
"icns",
"ico",
"ief",
"img",
"ipa",
"iso",
"jar",
"jpeg",
"jpg",
"jpgv",
"jpm",
"jxr",
"key",
"ktx",
"lha",
"lib",
"lvp",
"lz",
"lzh",
"lzma",
"lzo",
"m3u",
"m4a",
"m4v",
"mar",
"mdi",
"mht",
"mid",
"midi",
"mj2",
"mka",
"mkv",
"mmr",
"mng",
"mobi",
"mov",
"movie",
"mp3",
"mp4",
"mp4a",
"mpeg",
"mpg",
"mpga",
"mxu",
"nef",
"npx",
"numbers",
"nupkg",
"o",
"odp",
"ods",
"odt",
"oga",
"ogg",
"ogv",
"otf",
"ott",
"pages",
"pbm",
"pcx",
"pdb",
"pdf",
"pea",
"pgm",
"pic",
"png",
"pnm",
"pot",
"potm",
"potx",
"ppa",
"ppam",
"ppm",
"pps",
"ppsm",
"ppsx",
"ppt",
"pptm",
"pptx",
"psd",
"pya",
"pyc",
"pyo",
"pyv",
"qt",
"rar",
"ras",
"raw",
"resources",
"rgb",
"rip",
"rlc",
"rmf",
"rmvb",
"rpm",
"rtf",
"rz",
"s3m",
"s7z",
"scpt",
"sgi",
"shar",
"snap",
"sil",
"sketch",
"slk",
"smv",
"snk",
"so",
"stl",
"suo",
"sub",
"swf",
"tar",
"tbz",
"tbz2",
"tga",
"tgz",
"thmx",
"tif",
"tiff",
"tlz",
"ttc",
"ttf",
"txz",
"udf",
"uvh",
"uvi",
"uvm",
"uvp",
"uvs",
"uvu",
"viv",
"vob",
"war",
"wav",
"wax",
"wbmp",
"wdp",
"weba",
"webm",
"webp",
"whl",
"wim",
"wm",
"wma",
"wmv",
"wmx",
"woff",
"woff2",
"wrm",
"wvx",
"xbm",
"xif",
"xla",
"xlam",
"xls",
"xlsb",
"xlsm",
"xlsx",
"xlt",
"xltm",
"xltx",
"xm",
"xmind",
"xpi",
"xpm",
"xwd",
"xz",
"z",
"zip",
"zipx"
]
@@ -0,0 +1,109 @@
'use strict';
const assert = require('assert');
const { inspect } = require('util');
const mustCallChecks = [];
function noop() {}
function runCallChecks(exitCode) {
if (exitCode !== 0) return;
const failed = mustCallChecks.filter((context) => {
if ('minimum' in context) {
context.messageSegment = `at least ${context.minimum}`;
return context.actual < context.minimum;
}
context.messageSegment = `exactly ${context.exact}`;
return context.actual !== context.exact;
});
failed.forEach((context) => {
console.error('Mismatched %s function calls. Expected %s, actual %d.',
context.name,
context.messageSegment,
context.actual);
console.error(context.stack.split('\n').slice(2).join('\n'));
});
if (failed.length)
process.exit(1);
}
function mustCall(fn, exact) {
return _mustCallInner(fn, exact, 'exact');
}
function mustCallAtLeast(fn, minimum) {
return _mustCallInner(fn, minimum, 'minimum');
}
function _mustCallInner(fn, criteria = 1, field) {
if (process._exiting)
throw new Error('Cannot use common.mustCall*() in process exit handler');
if (typeof fn === 'number') {
criteria = fn;
fn = noop;
} else if (fn === undefined) {
fn = noop;
}
if (typeof criteria !== 'number')
throw new TypeError(`Invalid ${field} value: ${criteria}`);
const context = {
[field]: criteria,
actual: 0,
stack: inspect(new Error()),
name: fn.name || '<anonymous>'
};
// Add the exit listener only once to avoid listener leak warnings
if (mustCallChecks.length === 0)
process.on('exit', runCallChecks);
mustCallChecks.push(context);
function wrapped(...args) {
++context.actual;
return fn.call(this, ...args);
}
// TODO: remove origFn?
wrapped.origFn = fn;
return wrapped;
}
function getCallSite(top) {
const originalStackFormatter = Error.prepareStackTrace;
Error.prepareStackTrace = (err, stack) =>
`${stack[0].getFileName()}:${stack[0].getLineNumber()}`;
const err = new Error();
Error.captureStackTrace(err, top);
// With the V8 Error API, the stack is not formatted until it is accessed
// eslint-disable-next-line no-unused-expressions
err.stack;
Error.prepareStackTrace = originalStackFormatter;
return err.stack;
}
function mustNotCall(msg) {
const callSite = getCallSite(mustNotCall);
return function mustNotCall(...args) {
args = args.map(inspect).join(', ');
const argsInfo = (args.length > 0
? `\ncalled with arguments: ${args}`
: '');
assert.fail(
`${msg || 'function should not have been called'} at ${callSite}`
+ argsInfo);
};
}
module.exports = {
mustCall,
mustCallAtLeast,
mustNotCall,
};
@@ -0,0 +1,7 @@
import {
extendVariants
} from "./chunk-7J5ZEWJW.mjs";
import "./chunk-YFAKJTDR.mjs";
export {
extendVariants
};
@@ -0,0 +1,37 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
interface String {
/** Removes the trailing white space and line terminator characters from a string. */
trimEnd(): string;
/** Removes the leading white space and line terminator characters from a string. */
trimStart(): string;
/**
* Removes the leading white space and line terminator characters from a string.
* @deprecated A legacy feature for browser compatibility. Use `trimStart` instead
*/
trimLeft(): string;
/**
* Removes the trailing white space and line terminator characters from a string.
* @deprecated A legacy feature for browser compatibility. Use `trimEnd` instead
*/
trimRight(): string;
}
@@ -0,0 +1 @@
{"mappings":";;AAiBA,oCAAqC,SAAQ,aAAa;IACxD,oCAAoC;IACpC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,sBAAsB,GAAG,CAAC,CAAC;IAElD,kFAAkF;IAClF,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAeD;IACE,mBAAmB,EAAE,aAAa,CAAA;CACnC;AAED;;;GAGG;AACH,kCAAkC,KAAK,GAAE,mBAAwB,GAAG,kBAAkB,CA8BrF;AAED;;;GAGG;AACH,+BAA+B,KAAK,EAAE,mBAAmB,GAAG,IAAI,OAAO,CAUtE","sources":["packages/@react-aria/visually-hidden/src/packages/@react-aria/visually-hidden/src/VisuallyHidden.tsx","packages/@react-aria/visually-hidden/src/packages/@react-aria/visually-hidden/src/index.ts","packages/@react-aria/visually-hidden/src/index.ts"],"sourcesContent":[null,null,"/*\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 */\nexport {useVisuallyHidden, VisuallyHidden} from './VisuallyHidden';\nexport type {VisuallyHiddenAria, VisuallyHiddenProps} from './VisuallyHidden';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -0,0 +1,97 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolve = resolve;
const common_1 = require("@inversifyjs/common");
const BindingType_1 = require("../../binding/models/BindingType");
const InversifyCoreError_1 = require("../../error/models/InversifyCoreError");
const InversifyCoreErrorKind_1 = require("../../error/models/InversifyCoreErrorKind");
const handleResolveError_1 = require("../../planning/calculations/handleResolveError");
const isPlanServiceRedirectionBindingNode_1 = require("../../planning/calculations/isPlanServiceRedirectionBindingNode");
const resolveConstantValueBinding_1 = require("./resolveConstantValueBinding");
const resolveDynamicValueBinding_1 = require("./resolveDynamicValueBinding");
const resolveFactoryBinding_1 = require("./resolveFactoryBinding");
const resolveInstanceBindingConstructorParams_1 = require("./resolveInstanceBindingConstructorParams");
const resolveInstanceBindingNode_1 = require("./resolveInstanceBindingNode");
const resolveInstanceBindingNodeAsyncFromConstructorParams_1 = require("./resolveInstanceBindingNodeAsyncFromConstructorParams");
const resolveInstanceBindingNodeFromConstructorParams_1 = require("./resolveInstanceBindingNodeFromConstructorParams");
const resolveProviderBinding_1 = require("./resolveProviderBinding");
const resolveResolvedValueBindingNode_1 = require("./resolveResolvedValueBindingNode");
const resolveResolvedValueBindingParams_1 = require("./resolveResolvedValueBindingParams");
const resolveScopedInstanceBindingNode_1 = require("./resolveScopedInstanceBindingNode");
const resolveScopedResolvedValueBindingNode_1 = require("./resolveScopedResolvedValueBindingNode");
const resolveServiceRedirectionBindingNode_1 = require("./resolveServiceRedirectionBindingNode");
const setInstanceProperties_1 = require("./setInstanceProperties");
const setInstanceProperties = (0, setInstanceProperties_1.setInstanceProperties)(resolveServiceNode);
const resolveServiceRedirectionBindingNode = (0, resolveServiceRedirectionBindingNode_1.resolveServiceRedirectionBindingNode)(resolveBindingNode);
const resolveInstanceBindingNode = (0, resolveInstanceBindingNode_1.resolveInstanceBindingNode)(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(0, resolveInstanceBindingConstructorParams_1.resolveInstanceBindingConstructorParams)(resolveServiceNode), (0, resolveInstanceBindingNodeAsyncFromConstructorParams_1.resolveInstanceBindingNodeAsyncFromConstructorParams)((0, resolveInstanceBindingNodeFromConstructorParams_1.resolveInstanceBindingNodeFromConstructorParams)(setInstanceProperties)), (0, resolveInstanceBindingNodeFromConstructorParams_1.resolveInstanceBindingNodeFromConstructorParams)(setInstanceProperties));
const resolveResolvedValueBindingNode = (0, resolveResolvedValueBindingNode_1.resolveResolvedValueBindingNode)(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(0, resolveResolvedValueBindingParams_1.resolveResolvedValueBindingParams)(resolveServiceNode));
const resolveScopedInstanceBindingNode = (0, resolveScopedInstanceBindingNode_1.resolveScopedInstanceBindingNode)(resolveInstanceBindingNode);
const resolveScopedResolvedValueBindingNode = (0, resolveScopedResolvedValueBindingNode_1.resolveScopedResolvedValueBindingNode)(resolveResolvedValueBindingNode);
function resolve(params) {
try {
const serviceNode = params.planResult.tree.root;
return resolveServiceNode(params, serviceNode);
}
catch (error) {
(0, handleResolveError_1.handleResolveError)(params, error);
}
}
function resolveBindingNode(params, planBindingNode) {
switch (planBindingNode.binding.type) {
case BindingType_1.bindingTypeValues.ConstantValue:
return (0, resolveConstantValueBinding_1.resolveConstantValueBinding)(params, planBindingNode.binding);
case BindingType_1.bindingTypeValues.DynamicValue:
return (0, resolveDynamicValueBinding_1.resolveDynamicValueBinding)(params, planBindingNode.binding);
case BindingType_1.bindingTypeValues.Factory:
return (0, resolveFactoryBinding_1.resolveFactoryBinding)(params, planBindingNode.binding);
case BindingType_1.bindingTypeValues.Instance:
return resolveScopedInstanceBindingNode(params, planBindingNode);
case BindingType_1.bindingTypeValues.Provider:
return (0, resolveProviderBinding_1.resolveProviderBinding)(params, planBindingNode.binding);
case BindingType_1.bindingTypeValues.ResolvedValue:
return resolveScopedResolvedValueBindingNode(params, planBindingNode);
}
}
function resolveServiceNode(params, serviceNode) {
if (serviceNode.bindings === undefined) {
return undefined;
}
if (Array.isArray(serviceNode.bindings)) {
return resolveMultipleBindingServiceNode(params, serviceNode.bindings);
}
return resolveSingleBindingServiceNode(params, serviceNode.bindings);
}
function resolveMultipleBindingServiceNode(params, bindings) {
const resolvedValues = [];
for (const binding of bindings) {
if ((0, isPlanServiceRedirectionBindingNode_1.isPlanServiceRedirectionBindingNode)(binding)) {
resolvedValues.push(...resolveServiceRedirectionBindingNode(params, binding));
}
else {
resolvedValues.push(resolveBindingNode(params, binding));
}
}
if (resolvedValues.some(common_1.isPromise)) {
return Promise.all(resolvedValues);
}
return resolvedValues;
}
function resolveSingleBindingServiceNode(params, binding) {
if ((0, isPlanServiceRedirectionBindingNode_1.isPlanServiceRedirectionBindingNode)(binding)) {
const resolvedValues = resolveServiceRedirectionBindingNode(params, binding);
if (resolvedValues.length === 1) {
return resolvedValues[0];
}
else {
throw new InversifyCoreError_1.InversifyCoreError(InversifyCoreErrorKind_1.InversifyCoreErrorKind.resolution, 'Unexpected multiple resolved values on single injection');
}
}
else {
return resolveBindingNode(params, binding);
}
}
//# sourceMappingURL=resolve.js.map
@@ -0,0 +1,3 @@
#!/usr/bin/env node
require("../dist/cli").default();
@@ -0,0 +1 @@
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAKD,MAAM,8BAAQ,IAAI;AAEX,SAAS,0CAAgB,UAA+B;IAC7D,IAAI,QAAQ,4BAAM,GAAG,CAAC;IACtB,IAAI,SAAS,MACX,OAAO;IAGT,uFAAuF;IACvF,IAAI,UAAU;IACd,IAAI,aAAa,CAAC;QAChB,KAAK,IAAI,QAAQ,MAAO;YACtB,IAAI,KAAK,IAAI,KAAK,WAChB,WAAW,CAAA,GAAA,yCAAY,EAAE,MAAM;iBAC1B,IAAI,KAAK,IAAI,KAAK,QACvB;QAEJ;IACF;IAEA,WAAW;IACX,4BAAM,GAAG,CAAC,YAAY;IACtB,OAAO;AACT","sources":["packages/@react-stately/collections/src/getItemCount.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 {Collection, Node} from '@react-types/shared';\nimport {getChildNodes} from './getChildNodes';\n\nconst cache = new WeakMap<Iterable<unknown>, number>();\n\nexport function getItemCount<T>(collection: Collection<Node<T>>): number {\n let count = cache.get(collection);\n if (count != null) {\n return count;\n }\n\n // TS isn't smart enough to know we've ensured count is a number, so use a new variable\n let counter = 0;\n let countItems = (items: Iterable<Node<T>>) => {\n for (let item of items) {\n if (item.type === 'section') {\n countItems(getChildNodes(item, collection));\n } else if (item.type === 'item') {\n counter++;\n }\n }\n };\n\n countItems(collection);\n cache.set(collection, counter);\n return counter;\n}\n"],"names":[],"version":3,"file":"getItemCount.module.js.map"}
@@ -0,0 +1,11 @@
"use strict";
module.exports = function (it) {
const { path, message } = it;
return `
Failed to read JSON file at ${path}:
${message}
`.trimStart();
};
@@ -0,0 +1,52 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.0.4](https://github.com/es-shims/ArrayBuffer.prototype.slice/compare/v1.0.3...v1.0.4) - 2024-12-15
### Commits
- [actions] split out node 10-20, and 20+ [`5e59635`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/5e59635c948994b613c544b4e94fe93536d6b213)
- [Deps] update `call-bind`, `es-abstract`, `get-intrinsic` [`0afbb59`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/0afbb5942574055a8a3afdf0f69f60313e3f1af2)
- [Dev Deps] update `@es-shims/api`, `auto-changelog`, `es-value-fixtures`, `object-inspect`, `tape` [`d76caf4`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/d76caf4880ef358cf5384a6eb29d0f2f67e4d3a8)
- [Deps] update `call-bind`, `es-abstract`, `es-errors`, `get-intrinsic` [`2b374a2`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/2b374a2d4078d9122ac30bdecd8a8fae740aa74c)
- [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `object-inspect`, `tape` [`a24fd39`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/a24fd39370d891ea3439f9d7a1c42183c0aa1bf7)
- [Tests] replace `aud` with `npm audit` [`c704fb0`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/c704fb0b1651ceb56b609a5b4646a993fc868219)
- [Deps] remove unused dependency [`0274b32`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/0274b32ab1d345fbf70745a79dd7a44f844179bb)
- [Dev Deps] add missing peer dep [`673f754`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/673f754797dd0c40801cca2f32ff08b372448c6b)
## [v1.0.3](https://github.com/es-shims/ArrayBuffer.prototype.slice/compare/v1.0.2...v1.0.3) - 2024-02-04
### Commits
- [Deps] update `array-buffer-byte-length`, `call-bind`, `define-properties`, `es-abstract`, `get-intrinsic`, `is-array-buffer` [`d9b6859`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/d9b68591ff509613d0dfc4036539ba4e0dc34931)
- [Dev Deps] update `aud`, `npmignore`, `object-inspect`, `tape` [`38cb58d`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/38cb58dfa3f3c8b11bfb2144f8e7cc74dd461f5e)
- [Refactor] use `es-errors` where possible, so things that only need those do not need `get-intrinsic` [`5c07bef`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/5c07befd134cae93ad5f9ab307ff67691ff5155b)
## [v1.0.2](https://github.com/es-shims/ArrayBuffer.prototype.slice/compare/v1.0.1...v1.0.2) - 2023-09-05
### Commits
- [Deps] update `es-abstract` [`a9ab0d2`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/a9ab0d2551bb301b740e333ea3795fad23fcbe40)
- [Dev Deps] update `tape` [`6b24af5`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/6b24af585dc9176c8ac3fd482cb1d5257e550a09)
- [Fix] move `es-abstract` to runtime deps [`63a8397`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/63a8397623d7749856f6392ae93bf87152c3916c)
## [v1.0.1](https://github.com/es-shims/ArrayBuffer.prototype.slice/compare/v1.0.0...v1.0.1) - 2023-07-11
### Commits
- [Fix] node &lt; 0.11 has an own nonconfigurable `slice` property; use it [`554823c`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/554823c92ce16d6b7184a7d0ccfe315b663584d7)
- [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `aud`, `es-abstract`, `tape` [`53b0421`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/53b04217048c645306597e2cfc55adb69c384146)
- [Deps] update `define-properties`, `get-intrinsic` [`4966b02`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/4966b02bc25ac006709b29ca370b9f6e159f723a)
## v1.0.0 - 2023-07-09
### Commits
- Initial implementation, tests, readme [`36b4b5e`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/36b4b5eedfa225c3086e9453b9db0088c299640a)
- Initial commit [`51499df`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/51499dfac7d8c67c2928cb47363a4de7ff17904a)
- npm init [`8ec604e`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/8ec604e7d3ef8d4c27376b09645f779c2244b08f)
- Only apps should have lockfiles [`ac54435`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/ac54435161d4415e2122e3a682499f3a6df2f6de)
@@ -0,0 +1 @@
{"version":3,"names":["_index","require","_index2","_default","exports","default","toStatement","node","ignore","isStatement","mustHaveId","newType","isClass","isFunction","isAssignmentExpression","expressionStatement","id","Error","type"],"sources":["../../src/converters/toStatement.ts"],"sourcesContent":["import {\n isStatement,\n isFunction,\n isClass,\n isAssignmentExpression,\n} from \"../validators/generated/index.ts\";\nimport { expressionStatement } from \"../builders/generated/index.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default toStatement as {\n (node: t.AssignmentExpression, ignore?: boolean): t.ExpressionStatement;\n\n <T extends t.Statement>(node: T, ignore: false): T;\n <T extends t.Statement>(node: T, ignore?: boolean): T | false;\n\n (node: t.Class, ignore: false): t.ClassDeclaration;\n (node: t.Class, ignore?: boolean): t.ClassDeclaration | false;\n\n (node: t.Function, ignore: false): t.FunctionDeclaration;\n (node: t.Function, ignore?: boolean): t.FunctionDeclaration | false;\n\n (node: t.Node, ignore: false): t.Statement;\n (node: t.Node, ignore?: boolean): t.Statement | false;\n};\n\nfunction toStatement(node: t.Node, ignore?: boolean): t.Statement | false {\n if (isStatement(node)) {\n return node;\n }\n\n let mustHaveId = false;\n let newType;\n\n if (isClass(node)) {\n mustHaveId = true;\n newType = \"ClassDeclaration\" as const;\n } else if (isFunction(node)) {\n mustHaveId = true;\n newType = \"FunctionDeclaration\" as const;\n } else if (isAssignmentExpression(node)) {\n return expressionStatement(node);\n }\n\n // @ts-expect-error todo(flow->ts): node.id might be missing\n if (mustHaveId && !node.id) {\n newType = false;\n }\n\n if (!newType) {\n if (ignore) {\n return false;\n } else {\n throw new Error(`cannot turn ${node.type} to a statement`);\n }\n }\n\n // @ts-expect-error manipulating node.type\n node.type = newType;\n\n // @ts-expect-error todo(flow->ts) refactor to avoid type unsafe mutations like reassigning node type above\n return node;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,OAAA,GAAAD,OAAA;AAAqE,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGtDC,WAAW;AAgB1B,SAASA,WAAWA,CAACC,IAAY,EAAEC,MAAgB,EAAuB;EACxE,IAAI,IAAAC,kBAAW,EAACF,IAAI,CAAC,EAAE;IACrB,OAAOA,IAAI;EACb;EAEA,IAAIG,UAAU,GAAG,KAAK;EACtB,IAAIC,OAAO;EAEX,IAAI,IAAAC,cAAO,EAACL,IAAI,CAAC,EAAE;IACjBG,UAAU,GAAG,IAAI;IACjBC,OAAO,GAAG,kBAA2B;EACvC,CAAC,MAAM,IAAI,IAAAE,iBAAU,EAACN,IAAI,CAAC,EAAE;IAC3BG,UAAU,GAAG,IAAI;IACjBC,OAAO,GAAG,qBAA8B;EAC1C,CAAC,MAAM,IAAI,IAAAG,6BAAsB,EAACP,IAAI,CAAC,EAAE;IACvC,OAAO,IAAAQ,2BAAmB,EAACR,IAAI,CAAC;EAClC;EAGA,IAAIG,UAAU,IAAI,CAACH,IAAI,CAACS,EAAE,EAAE;IAC1BL,OAAO,GAAG,KAAK;EACjB;EAEA,IAAI,CAACA,OAAO,EAAE;IACZ,IAAIH,MAAM,EAAE;MACV,OAAO,KAAK;IACd,CAAC,MAAM;MACL,MAAM,IAAIS,KAAK,CAAC,eAAeV,IAAI,CAACW,IAAI,iBAAiB,CAAC;IAC5D;EACF;EAGAX,IAAI,CAACW,IAAI,GAAGP,OAAO;EAGnB,OAAOJ,IAAI;AACb","ignoreList":[]}
@@ -0,0 +1,98 @@
# Lilconfig ⚙️
[![npm version](https://badge.fury.io/js/lilconfig.svg)](https://badge.fury.io/js/lilconfig)
[![install size](https://packagephobia.now.sh/badge?p=lilconfig)](https://packagephobia.now.sh/result?p=lilconfig)
[![Coverage Status](https://coveralls.io/repos/github/antonk52/lilconfig/badge.svg)](https://coveralls.io/github/antonk52/lilconfig)
A zero-dependency alternative to [cosmiconfig](https://www.npmjs.com/package/cosmiconfig) with the same API.
## Installation
```sh
npm install lilconfig
```
## Usage
```js
import {lilconfig, lilconfigSync} from 'lilconfig';
// all keys are optional
const options = {
stopDir: '/Users/you/some/dir',
searchPlaces: ['package.json', 'myapp.conf.js'],
ignoreEmptySearchPlaces: false
}
lilconfig(
'myapp',
options // optional
).search() // Promise<LilconfigResult>
lilconfigSync(
'myapp',
options // optional
).load(pathToConfig) // LilconfigResult
/**
* LilconfigResult
* {
* config: any; // your config
* filepath: string;
* }
*/
```
## ESM
ESM configs can be loaded with **async API only**. Specifically `js` files in projects with `"type": "module"` in `package.json` or `mjs` files.
## Difference to `cosmiconfig`
Lilconfig does not intend to be 100% compatible with `cosmiconfig` but tries to mimic it where possible. The key difference is **no** support for yaml files out of the box(`lilconfig` attempts to parse files with no extension as JSON instead of YAML). You can still add the support for YAML files by providing a loader, see an [example](#yaml-loader) below.
### Options difference between the two.
|cosmiconfig option | lilconfig |
|------------------------|-----------|
|cache | ✅ |
|loaders | ✅ |
|ignoreEmptySearchPlaces | ✅ |
|packageProp | ✅ |
|searchPlaces | ✅ |
|stopDir | ✅ |
|transform | ✅ |
## Loaders examples
### Yaml loader
If you need the YAML support you can provide your own loader
```js
import {lilconfig} from 'lilconfig';
import yaml from 'yaml';
function loadYaml(filepath, content) {
return yaml.parse(content);
}
const options = {
loaders: {
'.yaml': loadYaml,
'.yml': loadYaml,
// loader for files with no extension
noExt: loadYaml
}
};
lilconfig('myapp', options)
.search()
.then(result => {
result // {config, filepath}
});
```
## Version correlation
- lilconig v1 → cosmiconfig v6
- lilconig v2 → cosmiconfig v7
- lilconig v3 → cosmiconfig v8
@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.newLineNode = exports.TYPES_SPECIAL_WORD = exports.THIRD_PARTY_TYPES_SPECIAL_WORD = exports.THIRD_PARTY_MODULES_SPECIAL_WORD = exports.chunkSideOtherNode = exports.chunkSideEffectNode = exports.sortImportsIgnoredComment = exports.newLineCharacters = exports.jsx = exports.typescript = exports.flow = void 0;
var types_1 = require("@babel/types");
exports.flow = 'flow';
exports.typescript = 'typescript';
exports.jsx = 'jsx';
exports.newLineCharacters = '\n\n';
exports.sortImportsIgnoredComment = 'sort-imports-ignore';
exports.chunkSideEffectNode = 'side-effect-node';
exports.chunkSideOtherNode = 'other-node';
/*
* Used to mark the position between RegExps,
* where the not matched imports should be placed
*/
exports.THIRD_PARTY_MODULES_SPECIAL_WORD = '<THIRD_PARTY_MODULES>';
exports.THIRD_PARTY_TYPES_SPECIAL_WORD = '<THIRD_PARTY_TS_TYPES>';
exports.TYPES_SPECIAL_WORD = '<TS_TYPES>';
var PRETTIER_PLUGIN_SORT_IMPORTS_NEW_LINE = 'PRETTIER_PLUGIN_SORT_IMPORTS_NEW_LINE';
exports.newLineNode = (0, types_1.expressionStatement)((0, types_1.stringLiteral)(PRETTIER_PLUGIN_SORT_IMPORTS_NEW_LINE));
@@ -0,0 +1 @@
{"version":3,"file":"InversifyCoreError.d.ts","sourceRoot":"","sources":["../../../../src/error/models/InversifyCoreError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,QAAA,MAAM,gBAAgB,EAAE,OAAO,MAE9B,CAAC;AAEF,qBAAa,kBAAmB,SAAQ,KAAK;IACpC,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC;IAEzB,IAAI,EAAE,sBAAsB,CAAC;gBAGlC,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,YAAY;WAQV,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB;WAQ/C,aAAa,CACzB,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,sBAAsB,GAC3B,KAAK,IAAI,kBAAkB;CAG/B"}
@@ -0,0 +1,368 @@
import fs from 'node:fs';
import module from 'node:module';
import path from 'node:path';
import isNodeCoreModule from '@nolyfill/is-core-module';
import debug from 'debug';
import { createPathsMatcher, getTsconfig } from 'get-tsconfig';
import { isBunModule } from 'is-bun-module';
import { stableHash } from 'stable-hash';
import { globSync, isDynamicPattern } from 'tinyglobby';
import { ResolverFactory } from 'unrs-resolver';
const IMPORTER_NAME = 'eslint-import-resolver-typescript';
const log = debug(IMPORTER_NAME);
export const defaultConditionNames = [
'types',
'import',
'esm2020',
'es2020',
'es2015',
'require',
'node',
'node-addons',
'browser',
'default',
];
export const defaultExtensions = [
'.ts',
'.tsx',
'.d.ts',
'.js',
'.jsx',
'.json',
'.node',
];
export const defaultExtensionAlias = {
'.js': [
'.ts',
'.tsx',
'.d.ts',
'.js',
],
'.jsx': ['.tsx', '.d.ts', '.jsx'],
'.cjs': ['.cts', '.d.cts', '.cjs'],
'.mjs': ['.mts', '.d.mts', '.mjs'],
};
export const defaultMainFields = [
'types',
'typings',
'fesm2020',
'fesm2015',
'esm2020',
'es2020',
'module',
'jsnext:main',
'main',
];
export const interfaceVersion = 2;
const JS_EXT_PATTERN = /\.(?:[cm]js|jsx?)$/;
const RELATIVE_PATH_PATTERN = /^\.{1,2}(?:\/.*)?$/;
let previousOptionsHash;
let optionsHash;
let cachedOptions;
let cachedCwd;
let mappersCachedOptions;
let mappers = [];
let resolverCachedOptions;
let cachedResolver;
export function resolve(source, file, options, resolver) {
if (!cachedOptions ||
previousOptionsHash !== (optionsHash = stableHash(options))) {
previousOptionsHash = optionsHash;
cachedOptions = {
...options,
conditionNames: options?.conditionNames ?? defaultConditionNames,
extensions: options?.extensions ?? defaultExtensions,
extensionAlias: options?.extensionAlias ?? defaultExtensionAlias,
mainFields: options?.mainFields ?? defaultMainFields,
};
}
if (!resolver) {
if (!cachedResolver || resolverCachedOptions !== cachedOptions) {
cachedResolver = new ResolverFactory(cachedOptions);
resolverCachedOptions = cachedOptions;
}
resolver = cachedResolver;
}
log('looking for', source, 'in', file);
source = removeQuerystring(source);
if (isNodeCoreModule(source) || isBunModule(source)) {
log('matched core:', source);
return {
found: true,
path: null,
};
}
if (process.versions.pnp && source === 'pnpapi') {
return {
found: true,
path: module.findPnpApi(file).resolveToUnqualified(source, file, {
considerBuiltins: false,
}),
};
}
initMappers(cachedOptions);
let mappedPaths = getMappedPaths(source, file, cachedOptions.extensions, true);
if (mappedPaths.length > 0) {
log('matched ts path:', ...mappedPaths);
}
else {
mappedPaths = [source];
}
let foundNodePath;
for (const mappedPath of mappedPaths) {
try {
const resolved = resolver.sync(path.dirname(path.resolve(file)), mappedPath);
if (resolved.path) {
foundNodePath = resolved.path;
break;
}
}
catch {
log('failed to resolve with', mappedPath);
}
}
if ((JS_EXT_PATTERN.test(foundNodePath) ||
(cachedOptions.alwaysTryTypes && !foundNodePath)) &&
!/^@types[/\\]/.test(source) &&
!path.isAbsolute(source) &&
!source.startsWith('.')) {
const definitelyTyped = resolve('@types' + path.sep + mangleScopedPackage(source), file, options);
if (definitelyTyped.found) {
return definitelyTyped;
}
}
if (foundNodePath) {
log('matched node path:', foundNodePath);
return {
found: true,
path: foundNodePath,
};
}
log("didn't find ", source);
return {
found: false,
};
}
export function createTypeScriptImportResolver(options) {
const resolver = new ResolverFactory({
...options,
conditionNames: options?.conditionNames ?? defaultConditionNames,
extensions: options?.extensions ?? defaultExtensions,
extensionAlias: options?.extensionAlias ?? defaultExtensionAlias,
mainFields: options?.mainFields ?? defaultMainFields,
});
return {
interfaceVersion: 3,
name: IMPORTER_NAME,
resolve(source, file) {
return resolve(source, file, options, resolver);
},
};
}
function removeQuerystring(id) {
const querystringIndex = id.lastIndexOf('?');
if (querystringIndex !== -1) {
return id.slice(0, querystringIndex);
}
return id;
}
const isFile = (path) => {
try {
return !!(path && fs.statSync(path, { throwIfNoEntry: false })?.isFile());
}
catch {
return false;
}
};
const isModule = (modulePath) => !!modulePath && isFile(path.resolve(modulePath, 'package.json'));
function getMappedPaths(source, file, extensions = defaultExtensions, retry) {
const originalExtensions = extensions;
extensions = ['', ...extensions];
let paths = [];
if (RELATIVE_PATH_PATTERN.test(source)) {
const resolved = path.resolve(path.dirname(file), source);
if (isFile(resolved)) {
paths = [resolved];
}
}
else {
let mapperFns = mappers
.filter(({ files }) => files.has(file))
.map(({ mapperFn }) => mapperFn);
if (mapperFns.length === 0) {
mapperFns = mappers
.map(mapper => ({
mapperFn: mapper.mapperFn,
counter: equalChars(path.dirname(file), path.dirname(mapper.path)),
}))
.sort((a, b) => b.counter - a.counter)
.map(({ mapperFn }) => mapperFn);
}
paths = mapperFns
.map(mapperFn => mapperFn(source).map(item => [
...extensions.map(ext => `${item}${ext}`),
...originalExtensions.map(ext => `${item}/index${ext}`),
]))
.flat(2)
.map(toNativePathSeparator)
.filter(mappedPath => {
try {
const stat = fs.statSync(mappedPath, { throwIfNoEntry: false });
if (stat === undefined) {
return false;
}
if (stat.isFile()) {
return true;
}
if (stat.isDirectory()) {
return isModule(mappedPath);
}
}
catch {
return false;
}
return false;
});
}
if (retry && paths.length === 0) {
const isJs = JS_EXT_PATTERN.test(source);
if (isJs) {
const jsExt = path.extname(source);
const tsExt = jsExt.replace('js', 'ts');
const basename = source.replace(JS_EXT_PATTERN, '');
let resolved = getMappedPaths(basename + tsExt, file);
if (resolved.length === 0 && jsExt === '.js') {
const tsxExt = jsExt.replace('js', 'tsx');
resolved = getMappedPaths(basename + tsxExt, file);
}
if (resolved.length === 0) {
resolved = getMappedPaths(basename + '.d' + (tsExt === '.tsx' ? '.ts' : tsExt), file);
}
if (resolved.length > 0) {
return resolved;
}
}
for (const ext of extensions) {
const mappedPaths = isJs ? [] : getMappedPaths(source + ext, file);
const resolved = mappedPaths.length > 0
? mappedPaths
: getMappedPaths(source + `/index${ext}`, file);
if (resolved.length > 0) {
return resolved;
}
}
}
return paths;
}
function initMappers(options) {
if (mappers.length > 0 &&
mappersCachedOptions === options &&
cachedCwd === process.cwd()) {
return;
}
cachedCwd = process.cwd();
const configPaths = (typeof options.project === 'string'
? [options.project]
:
Array.isArray(options.project)
? options.project
: [cachedCwd])
.map(config => replacePathSeparator(config, path.sep, path.posix.sep));
const defaultInclude = ['**/*'];
const defaultIgnore = ['**/node_modules/**'];
const projectPaths = [
...new Set([
...configPaths
.filter(p => !isDynamicPattern(p))
.map(p => path.resolve(process.cwd(), p)),
...globSync(configPaths.filter(path => isDynamicPattern(path)), {
absolute: true,
dot: true,
expandDirectories: false,
ignore: defaultIgnore,
}),
]),
];
mappers = projectPaths
.map(projectPath => {
let tsconfigResult;
if (isFile(projectPath)) {
const { dir, base } = path.parse(projectPath);
tsconfigResult = getTsconfig(dir, base);
}
else {
tsconfigResult = getTsconfig(projectPath);
}
if (!tsconfigResult) {
return;
}
const mapperFn = createPathsMatcher(tsconfigResult);
if (!mapperFn) {
return;
}
const files = tsconfigResult.config.files == null &&
tsconfigResult.config.include == null
?
globSync(defaultInclude, {
absolute: true,
cwd: path.dirname(tsconfigResult.path),
dot: true,
ignore: [
...(tsconfigResult.config.exclude ?? []),
...defaultIgnore,
],
})
: [
...(tsconfigResult.config.files != null &&
tsconfigResult.config.files.length > 0
? tsconfigResult.config.files.map(file => path.normalize(path.resolve(path.dirname(tsconfigResult.path), file)))
: []),
...(tsconfigResult.config.include != null &&
tsconfigResult.config.include.length > 0
? globSync(tsconfigResult.config.include, {
absolute: true,
cwd: path.dirname(tsconfigResult.path),
dot: true,
ignore: [
...(tsconfigResult.config.exclude ?? []),
...defaultIgnore,
],
})
: []),
];
return {
path: toNativePathSeparator(tsconfigResult.path),
files: new Set(files.map(toNativePathSeparator)),
mapperFn,
};
})
.filter(Boolean);
mappersCachedOptions = options;
}
function mangleScopedPackage(moduleName) {
if (moduleName.startsWith('@')) {
const replaceSlash = moduleName.replace(path.sep, '__');
if (replaceSlash !== moduleName) {
return replaceSlash.slice(1);
}
}
return moduleName;
}
function replacePathSeparator(p, from, to) {
return from === to ? p : p.replaceAll(from, to);
}
function toNativePathSeparator(p) {
return replacePathSeparator(p, path[process.platform === 'win32' ? 'posix' : 'win32'].sep, path[process.platform === 'win32' ? 'win32' : 'posix'].sep);
}
function equalChars(a, b) {
if (a.length === 0 || b.length === 0) {
return 0;
}
let i = 0;
const length = Math.min(a.length, b.length);
while (i < length && a.charAt(i) === b.charAt(i)) {
i += 1;
}
return i;
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isIterableIterator = isIterableIterator;
exports.mergeOptions = mergeOptions;
function mergeOptions(target, source) {
for (const k of Object.keys(source)) {
if ((k === "parserOpts" || k === "generatorOpts" || k === "assumptions") && source[k]) {
const parserOpts = source[k];
const targetObj = target[k] || (target[k] = {});
mergeDefaultFields(targetObj, parserOpts);
} else {
const val = source[k];
if (val !== undefined) target[k] = val;
}
}
}
function mergeDefaultFields(target, source) {
for (const k of Object.keys(source)) {
const val = source[k];
if (val !== undefined) target[k] = val;
}
}
function isIterableIterator(value) {
return !!value && typeof value.next === "function" && typeof value[Symbol.iterator] === "function";
}
0 && 0;
//# sourceMappingURL=util.js.map
@@ -0,0 +1,36 @@
// src/bulk/edit-document.tsx
import { jsx, jsxs } from "react/jsx-runtime";
var EditDocumentBulkIcon = (props) => /* @__PURE__ */ jsxs(
"svg",
{
"aria-hidden": "true",
fill: "none",
focusable: "false",
height: "1em",
role: "presentation",
viewBox: "0 0 24 24",
width: "1em",
...props,
children: [
/* @__PURE__ */ jsx(
"path",
{
d: "M15.48 3H7.52C4.07 3 2 5.06 2 8.52v7.95C2 19.94 4.07 22 7.52 22h7.95c3.46 0 5.52-2.06 5.52-5.52V8.52C21 5.06 18.93 3 15.48 3Z",
fill: "currentColor",
opacity: 0.4
}
),
/* @__PURE__ */ jsx(
"path",
{
d: "M21.02 2.98c-1.79-1.8-3.54-1.84-5.38 0L14.51 4.1c-.1.1-.13.24-.09.37.7 2.45 2.66 4.41 5.11 5.11.03.01.08.01.11.01.1 0 .2-.04.27-.11l1.11-1.12c.91-.91 1.36-1.78 1.36-2.67 0-.9-.45-1.79-1.36-2.71ZM17.86 10.42c-.27-.13-.53-.26-.77-.41-.2-.12-.4-.25-.59-.39-.16-.1-.34-.25-.52-.4-.02-.01-.08-.06-.16-.14-.31-.25-.64-.59-.95-.96-.02-.02-.08-.08-.13-.17-.1-.11-.25-.3-.38-.51-.11-.14-.24-.34-.36-.55-.15-.25-.28-.5-.4-.76-.13-.28-.23-.54-.32-.79L7.9 10.72c-.35.35-.69 1.01-.76 1.5l-.43 2.98c-.09.63.08 1.22.47 1.61.33.33.78.5 1.28.5.11 0 .22-.01.33-.02l2.97-.42c.49-.07 1.15-.4 1.5-.76l5.38-5.38c-.25-.08-.5-.19-.78-.31Z",
fill: "currentColor"
}
)
]
}
);
export {
EditDocumentBulkIcon
};
@@ -0,0 +1 @@
{"name":"stable-hash-x","version":"0.2.0","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532098246,"integrity":"sha512-e87Wdp2OGLvQuGX7ZGzHSH2B+u2PQqCbuN1w5Cq74jZY4gdVgp3LMybAhRjaFzEzdB1Cno2xu8ySAdWEvun1ag==","mode":420,"size":1069},"lib/index.cjs":{"checkedAt":1794532098246,"integrity":"sha512-zjBGyJByVo1O87dR9YjLcXdXUU2kQvldhDTn/kfSTJ8669IK7sdoPGJfltl1w4j99FOox8XtjSp8VMAaE669MQ==","mode":420,"size":1703},"lib/index.d.cts":{"checkedAt":1794532098246,"integrity":"sha512-5JGofT7kYPBiShrY3F+vFau7J3H1Kc6pA7clYUU0azDnJE96sRS7wpQOXpFRH9Iss7gQ+k7qManj7fp9/XYy3w==","mode":420,"size":153},"lib/index.js":{"checkedAt":1794532098246,"integrity":"sha512-kNWWiZk+MvMAt/mHfkHuGB1/WvKlpR7bBPHYkTXmOq1PmFyL6krYDqJyAFSgR0W3lRrQO6qLclcExgQzBLFsOA==","mode":420,"size":1685},"package.json":{"checkedAt":1794532098246,"integrity":"sha512-BEQ/rYOVpQJcszOOARpgcvgkPHSA+bD4vONjq18jiuXIxKeLzksnJHF7SRJoz7sprAmIMhG/Vn/o6Z9RDy7zDg==","mode":420,"size":795},"README.md":{"checkedAt":1794532098246,"integrity":"sha512-C70Tky8KGnrdwvaqLkqphjynVqz+FpjHhv6FtyqHkvLJY2Jfn0Pv8g8BLTZEee8mLavytXk0ZHq4R+0PHBjV8w==","mode":420,"size":11357},"lib/index.d.ts":{"checkedAt":1794532098246,"integrity":"sha512-5JGofT7kYPBiShrY3F+vFau7J3H1Kc6pA7clYUU0azDnJE96sRS7wpQOXpFRH9Iss7gQ+k7qManj7fp9/XYy3w==","mode":420,"size":153}}}
@@ -0,0 +1,37 @@
# import/no-amd
<!-- end auto-generated rule header -->
Reports `require([array], ...)` and `define([array], ...)` function calls at the
module scope. Will not report if !=2 arguments, or first argument is not a literal array.
Intended for temporary use when migrating to pure ES6 modules.
## Rule Details
This will be reported:
```js
define(["a", "b"], function (a, b) { /* ... */ })
require(["b", "c"], function (b, c) { /* ... */ })
```
CommonJS `require` is still valid.
## When Not To Use It
If you don't mind mixing module systems (sometimes this is useful), you probably
don't want this rule.
It is also fairly noisy if you have a larger codebase that is being transitioned
from AMD to ES6 modules.
## Contributors
Special thanks to @xjamundx for donating his no-define rule as a start to this.
## Further Reading
- [`no-commonjs`](./no-commonjs.md): report CommonJS `require` and `exports`
- Source: <https://github.com/xjamundx/eslint-plugin-modules>
@@ -0,0 +1,2 @@
import type { SensorDescriptor, SensorOptions } from './types';
export declare function useSensors(...sensors: (SensorDescriptor<any> | undefined | null)[]): SensorDescriptor<SensorOptions>[];
@@ -0,0 +1,107 @@
{
"name": "tailwind-variants",
"version": "0.3.1",
"description": "🦄 Tailwindcss first-class variant API",
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/heroui-inc/tailwind-variants"
},
"bugs": {
"url": "https://github.com/heroui-inc/tailwind-variants/issues"
},
"type": "module",
"main": "dist/index.cjs",
"types": "dist/index.d.ts",
"sideEffects": false,
"files": [
"dist",
"transformer.js",
"transformer.d.ts",
"README.md",
"LICENSE"
],
"scripts": {
"build": "tsup && node copy-types.cjs",
"typecheck": "tsc --noEmit",
"prepack": "clean-package",
"benchmark": "node benchmark.js",
"postpack": "clean-package restore",
"lint": "eslint . src/**/*.{js,ts}",
"lint:fix": "eslint --fix . src/**/*.{js,ts}",
"test": "jest --verbose",
"test:watch": "jest --watch --no-verbose"
},
"dependencies": {
"tailwind-merge": "2.5.4"
},
"devDependencies": {
"@commitlint/cli": "19.5.0",
"@commitlint/config-conventional": "19.5.0",
"@jest/globals": "29.7.0",
"@swc-node/jest": "1.8.12",
"@swc/cli": "0.5.0",
"@swc/core": "1.9.2",
"@swc/helpers": "0.5.15",
"@swc/jest": "0.2.37",
"@types/jest": "29.5.14",
"@types/node": "22.9.0",
"@typescript-eslint/eslint-plugin": "8.14.0",
"@typescript-eslint/parser": "8.14.0",
"benchmark": "2.1.4",
"class-variance-authority": "0.7.0",
"clean-package": "2.2.0",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-config-ts-lambdas": "1.2.3",
"eslint-import-resolver-typescript": "3.6.3",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-jest": "28.9.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-prettier": "5.2.1",
"eslint-plugin-promise": "7.1.0",
"expect": "29.7.0",
"jest": "29.7.0",
"prettier": "3.3.3",
"prettier-eslint": "16.3.0",
"prettier-eslint-cli": "8.0.1",
"tailwindcss": "3.4.14",
"ts-node": "10.9.2",
"tsup": "8.3.5",
"typescript": "5.6.3"
},
"peerDependencies": {
"tailwindcss": "*"
},
"keywords": [
"tailwindcss",
"classes",
"responsive",
"variants",
"styled",
"styles"
],
"engines": {
"node": ">=16.x",
"pnpm": ">=7.x"
},
"module": "dist/index.js",
"exports": {
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./dist/*": "./dist/*",
"./transformer": {
"require": "./dist/transformer.cjs",
"types": "./dist/transformer.d.ts",
"default": "./dist/transformer.js"
},
"./package.json": "./package.json"
}
}
@@ -0,0 +1,110 @@
import path from 'node:path';
import debug from 'debug';
import { moduleRequire } from './module-require.js';
function withoutProjectParserOptions(opts) {
const { EXPERIMENTAL_useProjectService, project, projectService, ...rest } = opts;
return rest;
}
const log = debug('eslint-plugin-import-x:parse');
function keysFromParser(_parserPath, parserInstance, parsedResult) {
if (parsedResult && parsedResult.visitorKeys) {
return parsedResult.visitorKeys;
}
if (parserInstance &&
'VisitorKeys' in parserInstance &&
parserInstance.VisitorKeys) {
return parserInstance.VisitorKeys;
}
return null;
}
function makeParseReturn(ast, visitorKeys) {
return {
ast,
visitorKeys,
};
}
function stripUnicodeBOM(text) {
return text.codePointAt(0) === 0xfe_ff ? text.slice(1) : text;
}
function transformHashbang(text) {
return text.replace(/^#!([^\r\n]+)/u, (_, captured) => `//${captured}`);
}
export function parse(path, content, context) {
if (context == null) {
throw new Error('need context to parse properly');
}
let parserOptions = context.languageOptions?.parserOptions || context.parserOptions;
const parserOrPath = getParser(path, context);
if (!parserOrPath) {
throw new Error('parserPath or languageOptions.parser is required!');
}
parserOptions = { ...parserOptions };
parserOptions.ecmaFeatures = { ...parserOptions.ecmaFeatures };
parserOptions.comment = true;
parserOptions.attachComment = true;
parserOptions.tokens = true;
parserOptions.loc = true;
parserOptions.range = true;
parserOptions.filePath = path;
parserOptions = withoutProjectParserOptions(parserOptions);
parserOptions.ecmaVersion ??= context.languageOptions?.ecmaVersion;
parserOptions.sourceType ??= context.languageOptions?.sourceType;
const parser = typeof parserOrPath === 'string'
? moduleRequire(parserOrPath, context.physicalFilename)
: parserOrPath;
content = transformHashbang(stripUnicodeBOM(String(content)));
if ('parseForESLint' in parser &&
typeof parser.parseForESLint === 'function') {
let ast;
try {
const parserRaw = parser.parseForESLint(content, parserOptions);
ast = parserRaw.ast;
return makeParseReturn(ast, keysFromParser(parserOrPath, parser, parserRaw));
}
catch (error_) {
const error = error_;
console.warn(`Error while parsing ${parserOptions.filePath}`);
console.warn(`Line ${error.lineNumber}, column ${error.column}: ${error.message}`);
}
if (!ast || typeof ast !== 'object') {
console.warn(`\`parseForESLint\` from parser \`${typeof parserOrPath === 'string' ? parserOrPath : 'context.languageOptions.parser'}\` is invalid and will just be ignored`, { content, parserMeta: parser.meta });
}
else {
return makeParseReturn(ast, keysFromParser(parserOrPath, parser));
}
}
if ('parse' in parser) {
const ast = parser.parse(content, parserOptions);
return makeParseReturn(ast, keysFromParser(parserOrPath, parser));
}
throw new Error('Parser must expose a `parse` or `parseForESLint` method');
}
function getParser(path, context) {
const parserPath = getParserPath(path, context);
if (parserPath) {
return parserPath;
}
const parser = 'languageOptions' in context && context.languageOptions?.parser;
if (parser &&
typeof parser !== 'string' &&
(('parse' in parser && typeof parse === 'function') ||
('parseForESLint' in parser &&
typeof parser.parseForESLint === 'function'))) {
return parser;
}
return null;
}
function getParserPath(filepath, context) {
const parsers = context.settings['import-x/parsers'];
if (parsers != null) {
const extension = path.extname(filepath);
for (const parserPath in parsers) {
if (parsers[parserPath].includes(extension)) {
log('using alt parser:', parserPath);
return parserPath;
}
}
}
return context.parserPath;
}
//# sourceMappingURL=parse.js.map
@@ -0,0 +1,46 @@
"use strict";
function _async_iterator(iterable) {
var method, async, sync, retry = 2;
for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) {
if (async && null != (method = iterable[async])) return method.call(iterable);
if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable));
async = "@@asyncIterator", sync = "@@iterator";
}
throw new TypeError("Object is not async iterable");
}
function AsyncFromSyncIterator(s) {
function AsyncFromSyncIteratorContinuation(r) {
if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object."));
var done = r.done;
return Promise.resolve(r.value).then(function(value) {
return { value: value, done: done };
});
}
return AsyncFromSyncIterator = function(s) {
this.s = s, this.n = s.next;
},
AsyncFromSyncIterator.prototype = {
s: null,
n: null,
next: function() {
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
},
return: function(value) {
var ret = this.s.return;
return void 0 === ret ? Promise.resolve({ value: value, done: !0 }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments));
},
throw: function(value) {
var thr = this.s.return;
return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));
}
},
new AsyncFromSyncIterator(s);
}
exports._ = _async_iterator;
@@ -0,0 +1,5 @@
{
"name": "beep-boop",
"version": "1.2.3",
"repository" : "git@github.com:substack/beep-boop.git"
}
@@ -0,0 +1,80 @@
/*
* 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 {ItemElement, ItemProps} from '@react-types/shared';
import {PartialNode} from './types';
import React, {JSX, ReactElement} from 'react';
function Item<T>(props: ItemProps<T>): ReactElement | null { // eslint-disable-line @typescript-eslint/no-unused-vars
return null;
}
Item.getCollectionNode = function* getCollectionNode<T>(props: ItemProps<T>, context: any): Generator<PartialNode<T>> {
let {childItems, title, children} = props;
let rendered = props.title || props.children;
let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || '';
// suppressTextValueWarning is used in components like Tabs, which don't have type to select support.
if (!textValue && !context?.suppressTextValueWarning) {
console.warn('<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.');
}
yield {
type: 'item',
props: props,
rendered,
textValue,
'aria-label': props['aria-label'],
hasChildNodes: hasChildItems(props),
*childNodes() {
if (childItems) {
for (let child of childItems) {
yield {
type: 'item',
value: child
};
}
} else if (title) {
let items: PartialNode<T>[] = [];
React.Children.forEach(children, child => {
items.push({
type: 'item',
element: child as ItemElement<T>
});
});
yield* items;
}
}
};
};
function hasChildItems<T>(props: ItemProps<T>) {
if (props.hasChildItems != null) {
return props.hasChildItems;
}
if (props.childItems) {
return true;
}
if (props.title && React.Children.count(props.children) > 0) {
return true;
}
return false;
}
// We don't want getCollectionNode to show up in the type definition
let _Item = Item as <T>(props: ItemProps<T>) => JSX.Element;
export {_Item as Item};
@@ -0,0 +1,98 @@
var path = require('path');
var fs = require('fs');
var _0777 = parseInt('0777', 8);
module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
function mkdirP (p, opts, f, made) {
if (typeof opts === 'function') {
f = opts;
opts = {};
}
else if (!opts || typeof opts !== 'object') {
opts = { mode: opts };
}
var mode = opts.mode;
var xfs = opts.fs || fs;
if (mode === undefined) {
mode = _0777 & (~process.umask());
}
if (!made) made = null;
var cb = f || function () {};
p = path.resolve(p);
xfs.mkdir(p, mode, function (er) {
if (!er) {
made = made || p;
return cb(null, made);
}
switch (er.code) {
case 'ENOENT':
mkdirP(path.dirname(p), opts, function (er, made) {
if (er) cb(er, made);
else mkdirP(p, opts, cb, made);
});
break;
// In the case of any other error, just see if there's a dir
// there already. If so, then hooray! If not, then something
// is borked.
default:
xfs.stat(p, function (er2, stat) {
// if the stat fails, then that's super weird.
// let the original error be the failure reason.
if (er2 || !stat.isDirectory()) cb(er, made)
else cb(null, made);
});
break;
}
});
}
mkdirP.sync = function sync (p, opts, made) {
if (!opts || typeof opts !== 'object') {
opts = { mode: opts };
}
var mode = opts.mode;
var xfs = opts.fs || fs;
if (mode === undefined) {
mode = _0777 & (~process.umask());
}
if (!made) made = null;
p = path.resolve(p);
try {
xfs.mkdirSync(p, mode);
made = made || p;
}
catch (err0) {
switch (err0.code) {
case 'ENOENT' :
made = sync(path.dirname(p), opts, made);
sync(p, opts, made);
break;
// In the case of any other error, just see if there's a dir
// there already. If so, then hooray! If not, then something
// is borked.
default:
var stat;
try {
stat = xfs.statSync(p);
}
catch (err1) {
throw err0;
}
if (!stat.isDirectory()) throw err0;
break;
}
}
return made;
};
@@ -0,0 +1 @@
{"mappings":"AAAA;;;;;;;;;;CAUC,GAED,uEAAuE;AACvE,6EAA6E;AAC7E,iFAAiF;AACjF,mFAAmF;AACnF,mFAAmF;AACnF,wCAAwC;AACxC,IAAI,6CAAuB,IAAI;AAE/B,wEAAwE;AACxE,IAAI,4CAAsB,IAAI;AAE9B,SAAS;IACP,IAAI,OAAO,WAAW,aACpB;IAGF,SAAS,kBAAkB,KAAY;QACrC,OAAO,kBAAkB;IAC3B;IAEA,IAAI,oBAAoB,CAAC;QACvB,IAAI,CAAC,kBAAkB,MAAM,CAAC,EAAE,MAAM,EACpC;QAEF,+DAA+D;QAC/D,IAAI,cAAc,2CAAqB,GAAG,CAAC,EAAE,MAAM;QACnD,IAAI,CAAC,aAAa;YAChB,cAAc,IAAI;YAClB,2CAAqB,GAAG,CAAC,EAAE,MAAM,EAAE;YAEnC,+FAA+F;YAC/F,yGAAyG;YACzG,mGAAmG;YACnG,EAAE,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,iBAAiB;gBAC7D,MAAM;YACR;QACF;QAEA,YAAY,GAAG,CAAC,EAAE,YAAY;IAChC;IAEA,IAAI,kBAAkB,CAAC;QACrB,IAAI,CAAC,kBAAkB,MAAM,CAAC,EAAE,MAAM,EACpC;QAEF,yDAAyD;QACzD,IAAI,aAAa,2CAAqB,GAAG,CAAC,EAAE,MAAM;QAClD,IAAI,CAAC,YACH;QAGF,WAAW,MAAM,CAAC,EAAE,YAAY;QAEhC,2GAA2G;QAC3G,IAAI,WAAW,IAAI,KAAK,GAAG;YACzB,EAAE,MAAM,CAAC,mBAAmB,CAAC,oBAAoB;YACjD,2CAAqB,MAAM,CAAC,EAAE,MAAM;QACtC;QAEA,kEAAkE;QAClE,IAAI,2CAAqB,IAAI,KAAK,GAAG;YACnC,KAAK,IAAI,MAAM,0CACb;YAGF,0CAAoB,KAAK;QAC3B;IACF;IAEA,SAAS,IAAI,CAAC,gBAAgB,CAAC,iBAAiB;IAChD,SAAS,IAAI,CAAC,gBAAgB,CAAC,iBAAiB;AAClD;AAEA,IAAI,OAAO,aAAa;IACtB,IAAI,SAAS,UAAU,KAAK,WAC1B;SAEA,SAAS,gBAAgB,CAAC,oBAAoB;;AAI3C,SAAS,0CAAmB,EAAc;IAC/C,4EAA4E;IAC5E,sBAAsB;QACpB,gEAAgE;QAChE,+EAA+E;QAC/E,IAAI,2CAAqB,IAAI,KAAK,GAChC;aAEA,0CAAoB,GAAG,CAAC;IAE5B;AACF","sources":["packages/@react-aria/utils/src/runAfterTransition.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\n// We store a global list of elements that are currently transitioning,\n// mapped to a set of CSS properties that are transitioning for that element.\n// This is necessary rather than a simple count of transitions because of browser\n// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather\n// than one or the other. So we need to track what's actually transitioning so that\n// we can ignore these duplicate events.\nlet transitionsByElement = new Map<EventTarget, Set<string>>();\n\n// A list of callbacks to call once there are no transitioning elements.\nlet transitionCallbacks = new Set<() => void>();\n\nfunction setupGlobalEvents() {\n if (typeof window === 'undefined') {\n return;\n }\n\n function isTransitionEvent(event: Event): event is TransitionEvent {\n return 'propertyName' in event;\n }\n\n let onTransitionStart = (e: Event) => {\n if (!isTransitionEvent(e) || !e.target) {\n return;\n }\n // Add the transitioning property to the list for this element.\n let transitions = transitionsByElement.get(e.target);\n if (!transitions) {\n transitions = new Set();\n transitionsByElement.set(e.target, transitions);\n\n // The transitioncancel event must be registered on the element itself, rather than as a global\n // event. This enables us to handle when the node is deleted from the document while it is transitioning.\n // In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.\n e.target.addEventListener('transitioncancel', onTransitionEnd, {\n once: true\n });\n }\n\n transitions.add(e.propertyName);\n };\n\n let onTransitionEnd = (e: Event) => {\n if (!isTransitionEvent(e) || !e.target) {\n return;\n }\n // Remove property from list of transitioning properties.\n let properties = transitionsByElement.get(e.target);\n if (!properties) {\n return;\n }\n\n properties.delete(e.propertyName);\n\n // If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.\n if (properties.size === 0) {\n e.target.removeEventListener('transitioncancel', onTransitionEnd);\n transitionsByElement.delete(e.target);\n }\n\n // If no transitioning elements, call all of the queued callbacks.\n if (transitionsByElement.size === 0) {\n for (let cb of transitionCallbacks) {\n cb();\n }\n\n transitionCallbacks.clear();\n }\n };\n\n document.body.addEventListener('transitionrun', onTransitionStart);\n document.body.addEventListener('transitionend', onTransitionEnd);\n}\n\nif (typeof document !== 'undefined') {\n if (document.readyState !== 'loading') {\n setupGlobalEvents();\n } else {\n document.addEventListener('DOMContentLoaded', setupGlobalEvents);\n }\n}\n\nexport function runAfterTransition(fn: () => void) {\n // Wait one frame to see if an animation startsLine truncated
@@ -0,0 +1,27 @@
import type { Activators, SensorInstance, SensorProps, SensorOptions } from '../types';
import { KeyboardCoordinateGetter, KeyboardCodes } from './types';
export interface KeyboardSensorOptions extends SensorOptions {
keyboardCodes?: KeyboardCodes;
coordinateGetter?: KeyboardCoordinateGetter;
scrollBehavior?: ScrollBehavior;
onActivation?({ event }: {
event: KeyboardEvent;
}): void;
}
export declare type KeyboardSensorProps = SensorProps<KeyboardSensorOptions>;
export declare class KeyboardSensor implements SensorInstance {
private props;
autoScrollEnabled: boolean;
private referenceCoordinates;
private listeners;
private windowListeners;
constructor(props: KeyboardSensorProps);
private attach;
private handleStart;
private handleKeyDown;
private handleMove;
private handleEnd;
private handleCancel;
private detach;
static activators: Activators<KeyboardSensorOptions>;
}
@@ -0,0 +1,523 @@
export default `flf2a$ 5 5 12 0 11 0 0 0
Author : myflix and Mikechat
Date : 2006/4/9 14:37:04
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
_ #
_( )__ #
_| _|#
(_ _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ ! _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ " _ (_ #
|_( )__|##
##
#
#
#
##
$#
#
#
#
##
%#
#
#
#
##
&#
#
#
#
##
'#
#
#
#
##
(#
#
#
#
##
)#
#
#
#
##
*#
#
#
#
##
_ #
_( )__ #
_| _|#
(_ + _ (_ #
|_( )__|##
,#
#
#
#
##
_ #
_( )__ #
_| _|#
(_ - _ (_ #
|_( )__|##
.#
#
#
#
##
/#
#
#
#
##
_ #
_( )__ #
_| _|#
(_ 0 _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ 1 _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ 2 _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ 3 _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ 4 _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ 5 _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ 6 _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ 7 _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ 8 _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ 9 _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ : _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ ; _ (_ #
|_( )__|##
<#
#
#
#
##
_ #
_( )__ #
_| _|#
(_ = _ (_ #
|_( )__|##
>#
#
#
#
##
_ #
_( )__ #
_| _|#
(_ ? _ (_ #
|_( )__|##
@#
#
#
#
##
_ #
_( )__ #
_| _|#
(_ 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 _ (_ #
|_( )__|##
[#
#
#
#
##
\\#
#
#
#
##
]#
#
#
#
##
_ #
_( )__ #
_| _|#
(_ ^ _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ _ _ (_ #
|_( )__|##
\`#
#
#
#
##
_ #
_( )__ #
_| _|#
(_ 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 _ (_ #
|_( )__|##
{#
#
#
#
##
|#
#
#
#
##
}#
#
#
#
##
~#
#
#
#
##
_ #
_( )__ #
_| _|#
(_ A _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ O _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ U _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ A _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ O _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ U _ (_ #
|_( )__|##
_ #
_( )__ #
_| _|#
(_ _ (_ #
|_( )__|##
`
@@ -0,0 +1,49 @@
/**
* @fileoverview Utility functions for propWrapperFunctions setting
*/
'use strict';
const iterFrom = require('es-iterator-helpers/Iterator.from');
const map = require('es-iterator-helpers/Iterator.prototype.map');
/** TODO: type {(string | { name: string, linkAttribute: string })[]} */
/** @type {any} */
const DEFAULT_LINK_COMPONENTS = ['a'];
const DEFAULT_LINK_ATTRIBUTE = 'href';
/** TODO: type {(string | { name: string, formAttribute: string })[]} */
/** @type {any} */
const DEFAULT_FORM_COMPONENTS = ['form'];
const DEFAULT_FORM_ATTRIBUTE = 'action';
function getFormComponents(context) {
const settings = context.settings || {};
const formComponents = /** @type {typeof DEFAULT_FORM_COMPONENTS} */ (
DEFAULT_FORM_COMPONENTS.concat(settings.formComponents || [])
);
return new Map(map(iterFrom(formComponents), (value) => {
if (typeof value === 'string') {
return [value, [DEFAULT_FORM_ATTRIBUTE]];
}
return [value.name, [].concat(value.formAttribute)];
}));
}
function getLinkComponents(context) {
const settings = context.settings || {};
const linkComponents = /** @type {typeof DEFAULT_LINK_COMPONENTS} */ (
DEFAULT_LINK_COMPONENTS.concat(settings.linkComponents || [])
);
return new Map(map(iterFrom(linkComponents), (value) => {
if (typeof value === 'string') {
return [value, [DEFAULT_LINK_ATTRIBUTE]];
}
return [value.name, [].concat(value.linkAttribute)];
}));
}
module.exports = {
getFormComponents,
getLinkComponents,
};
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>
@@ -0,0 +1,63 @@
import type { DevModeChecks } from '../types'
/**
* Global configuration for development mode checks. This specifies the default
* frequency at which each development mode check should be performed.
*
* @since 5.0.0
* @internal
*/
export const globalDevModeChecks: DevModeChecks = {
inputStabilityCheck: 'once',
identityFunctionCheck: 'once'
}
/**
* Overrides the development mode checks settings for all selectors.
*
* Reselect performs additional checks in development mode to help identify and
* warn about potential issues in selector behavior. This function allows you to
* customize the behavior of these checks across all selectors in your application.
*
* **Note**: This setting can still be overridden per selector inside `createSelector`'s `options` object.
* See {@link https://github.com/reduxjs/reselect#2-per-selector-by-passing-an-identityfunctioncheck-option-directly-to-createselector per-selector-configuration}
* and {@linkcode CreateSelectorOptions.identityFunctionCheck identityFunctionCheck} for more details.
*
* _The development mode checks do not run in production builds._
*
* @param devModeChecks - An object specifying the desired settings for development mode checks. You can provide partial overrides. Unspecified settings will retain their current values.
*
* @example
* ```ts
* import { setGlobalDevModeChecks } from 'reselect'
* import { DevModeChecks } from '../types'
*
* // Run only the first time the selector is called. (default)
* setGlobalDevModeChecks({ inputStabilityCheck: 'once' })
*
* // Run every time the selector is called.
* setGlobalDevModeChecks({ inputStabilityCheck: 'always' })
*
* // Never run the input stability check.
* setGlobalDevModeChecks({ inputStabilityCheck: 'never' })
*
* // Run only the first time the selector is called. (default)
* setGlobalDevModeChecks({ identityFunctionCheck: 'once' })
*
* // Run every time the selector is called.
* setGlobalDevModeChecks({ identityFunctionCheck: 'always' })
*
* // Never run the identity function check.
* setGlobalDevModeChecks({ identityFunctionCheck: 'never' })
* ```
* @see {@link https://reselect.js.org/api/development-only-stability-checks Development-Only Stability Checks}
* @see {@link https://reselect.js.org/api/development-only-stability-checks#1-globally-through-setglobaldevmodechecks global-configuration}
*
* @since 5.0.0
* @public
*/
export const setGlobalDevModeChecks = (
devModeChecks: Partial<DevModeChecks>
) => {
Object.assign(globalDevModeChecks, devModeChecks)
}
@@ -0,0 +1,177 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IpConverter = void 0;
const pvtsutils_1 = require("pvtsutils");
class IpConverter {
static isIPv4(ip) {
return /^(\d{1,3}\.){3}\d{1,3}$/.test(ip);
}
static parseIPv4(ip) {
const parts = ip.split(".");
if (parts.length !== 4) {
throw new Error("Invalid IPv4 address");
}
return parts.map((part) => {
const num = parseInt(part, 10);
if (isNaN(num) || num < 0 || num > 255) {
throw new Error("Invalid IPv4 address part");
}
return num;
});
}
static parseIPv6(ip) {
const expandedIP = this.expandIPv6(ip);
const parts = expandedIP.split(":");
if (parts.length !== 8) {
throw new Error("Invalid IPv6 address");
}
return parts.reduce((bytes, part) => {
const num = parseInt(part, 16);
if (isNaN(num) || num < 0 || num > 0xffff) {
throw new Error("Invalid IPv6 address part");
}
bytes.push((num >> 8) & 0xff);
bytes.push(num & 0xff);
return bytes;
}, []);
}
static expandIPv6(ip) {
if (!ip.includes("::")) {
return ip;
}
const parts = ip.split("::");
if (parts.length > 2) {
throw new Error("Invalid IPv6 address");
}
const left = parts[0] ? parts[0].split(":") : [];
const right = parts[1] ? parts[1].split(":") : [];
const missing = 8 - (left.length + right.length);
if (missing < 0) {
throw new Error("Invalid IPv6 address");
}
return [...left, ...Array(missing).fill("0"), ...right].join(":");
}
static formatIPv6(bytes) {
const parts = [];
for (let i = 0; i < 16; i += 2) {
parts.push(((bytes[i] << 8) | bytes[i + 1]).toString(16));
}
return this.compressIPv6(parts.join(":"));
}
static compressIPv6(ip) {
const parts = ip.split(":");
let longestZeroStart = -1;
let longestZeroLength = 0;
let currentZeroStart = -1;
let currentZeroLength = 0;
for (let i = 0; i < parts.length; i++) {
if (parts[i] === "0") {
if (currentZeroStart === -1) {
currentZeroStart = i;
}
currentZeroLength++;
}
else {
if (currentZeroLength > longestZeroLength) {
longestZeroStart = currentZeroStart;
longestZeroLength = currentZeroLength;
}
currentZeroStart = -1;
currentZeroLength = 0;
}
}
if (currentZeroLength > longestZeroLength) {
longestZeroStart = currentZeroStart;
longestZeroLength = currentZeroLength;
}
if (longestZeroLength > 1) {
const before = parts.slice(0, longestZeroStart).join(":");
const after = parts.slice(longestZeroStart + longestZeroLength).join(":");
return `${before}::${after}`;
}
return ip;
}
static parseCIDR(text) {
const [addr, prefixStr] = text.split("/");
const prefix = parseInt(prefixStr, 10);
if (this.isIPv4(addr)) {
if (prefix < 0 || prefix > 32) {
throw new Error("Invalid IPv4 prefix length");
}
return [this.parseIPv4(addr), prefix];
}
else {
if (prefix < 0 || prefix > 128) {
throw new Error("Invalid IPv6 prefix length");
}
return [this.parseIPv6(addr), prefix];
}
}
static decodeIP(value) {
if (value.length === 64 && parseInt(value, 16) === 0) {
return "::/0";
}
if (value.length !== 16) {
return value;
}
const mask = parseInt(value.slice(8), 16)
.toString(2)
.split("")
.reduce((a, k) => a + +k, 0);
let ip = value.slice(0, 8).replace(/(.{2})/g, (match) => `${parseInt(match, 16)}.`);
ip = ip.slice(0, -1);
return `${ip}/${mask}`;
}
static toString(buf) {
const uint8 = new Uint8Array(buf);
if (uint8.length === 4) {
return Array.from(uint8).join(".");
}
if (uint8.length === 16) {
return this.formatIPv6(uint8);
}
if (uint8.length === 8 || uint8.length === 32) {
const half = uint8.length / 2;
const addrBytes = uint8.slice(0, half);
const maskBytes = uint8.slice(half);
const isAllZeros = uint8.every((byte) => byte === 0);
if (isAllZeros) {
return uint8.length === 8 ? "0.0.0.0/0" : "::/0";
}
const prefixLen = maskBytes.reduce((a, b) => a + (b.toString(2).match(/1/g) || []).length, 0);
if (uint8.length === 8) {
const addrStr = Array.from(addrBytes).join(".");
return `${addrStr}/${prefixLen}`;
}
else {
const addrStr = this.formatIPv6(addrBytes);
return `${addrStr}/${prefixLen}`;
}
}
return this.decodeIP(pvtsutils_1.Convert.ToHex(buf));
}
static fromString(text) {
if (text.includes("/")) {
const [addr, prefix] = this.parseCIDR(text);
const maskBytes = new Uint8Array(addr.length);
let bitsLeft = prefix;
for (let i = 0; i < maskBytes.length; i++) {
if (bitsLeft >= 8) {
maskBytes[i] = 0xff;
bitsLeft -= 8;
}
else if (bitsLeft > 0) {
maskBytes[i] = 0xff << (8 - bitsLeft);
bitsLeft = 0;
}
}
const out = new Uint8Array(addr.length * 2);
out.set(addr, 0);
out.set(maskBytes, addr.length);
return out.buffer;
}
const bytes = this.isIPv4(text) ? this.parseIPv4(text) : this.parseIPv6(text);
return new Uint8Array(bytes).buffer;
}
}
exports.IpConverter = IpConverter;
@@ -0,0 +1 @@
{"version":3,"file":"react-error-boundary.cjs.d.mts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
@@ -0,0 +1,59 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
/* Language and Environment */
"target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
"useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */
"module": "commonjs", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
"typeRoots": ["types"], /* Specify multiple folders that act like './node_modules/@types'. */
"resolveJsonModule": true, /* Enable importing .json files. */
/* JavaScript Support */
"allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
"checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
"maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
"declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
"noEmit": true, /* Disable emitting files from a compilation. */
/* Interop Constraints */
"allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
/* Type Checking */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
"noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
"useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
"noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
"noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
"noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
"noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
"noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
"noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
/* Completeness */
// "skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"exclude": [
"coverage"
]
}
@@ -0,0 +1 @@
{"name":"toidentifier","version":"1.0.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532088825,"integrity":"sha512-rJL8AjV2XpWlXxQVsEvTqFaGesNx8QDMBrV52ydh8G8i/m8VoVJwW+hR2T81VqcjOTGiPv1qSOG4LBfP+7XfLg==","mode":420,"size":1108},"index.js":{"checkedAt":1794532088825,"integrity":"sha512-lhY2eIJ/Yzy+pgivgx8BjbhXfuIlQ9bf1lUKF2/oS0t4VQ37Xsv+YPEJZDizzkhfvOhiiOvc6LbZBITXzaB5zg==","mode":420,"size":504},"package.json":{"checkedAt":1794532088825,"integrity":"sha512-wI2nt4Usmyl6Kfb7Xc9RpntRPK7BdHSs7LzzJMVhVgH+mXRL1J6Q8KIdilcQq9WOeLSonZyg5LCx8pWEulS1fg==","mode":420,"size":1142},"HISTORY.md":{"checkedAt":1794532088825,"integrity":"sha512-zEzgwnta1B1jdgc4AuQXpaOEgoZ5Gsw7Nlpy2aqSykBOsw1NX5KWRkOm4rC1j8bcX3r1bOTnkH8x+Bi8KkalEw==","mode":420,"size":128},"README.md":{"checkedAt":1794532088826,"integrity":"sha512-aRPaylbJiPAML1pDa98UpA2eOz2U2Cc1OYxkbuqttW5SUJHro1h0UhW6p16Jkg2I0J+m0tcBhFL2/MMQ2UneKQ==","mode":420,"size":1803}}}
@@ -0,0 +1,15 @@
type Promisable<T> = T | Promise<T>;
declare namespace escalade {
export type Callback = (
directory: string,
files: string[],
) => Promisable<string | false | void>;
}
declare function escalade(
directory: string,
callback: escalade.Callback,
): Promise<string | void>;
export = escalade;
@@ -0,0 +1,52 @@
/*
* 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 {AriaLabelingProps, DOMProps} from '@react-types/shared';
// @ts-ignore
import intlMessages from '../intl/*.json';
import React from 'react';
import {useLabels} from '@react-aria/utils';
import {useLocalizedStringFormatter} from '@react-aria/i18n';
import {VisuallyHidden} from '@react-aria/visually-hidden';
export interface DismissButtonProps extends AriaLabelingProps, DOMProps {
/** Called when the dismiss button is activated. */
onDismiss?: () => void
}
/**
* A visually hidden button that can be used to allow screen reader
* users to dismiss a modal or popup when there is no visual
* affordance to do so.
*/
export function DismissButton(props: DismissButtonProps) {
let {onDismiss, ...otherProps} = props;
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/overlays');
let labels = useLabels(otherProps, stringFormatter.format('dismiss'));
let onClick = () => {
if (onDismiss) {
onDismiss();
}
};
return (
<VisuallyHidden>
<button
{...labels}
tabIndex={-1}
onClick={onClick}
style={{width: 1, height: 1}} />
</VisuallyHidden>
);
}
@@ -0,0 +1,447 @@
import { createApi, setupListeners } from '@reduxjs/toolkit/query/react'
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'
import { delay } from 'msw'
import { setupApiStore } from '../../tests/utils/helpers'
// Just setup a temporary in-memory counter for tests that `getIncrementedAmount`.
// This can be used to test how many renders happen due to data changes or
// the refetching behavior of components.
let amount = 0
const defaultApi = createApi({
baseQuery: async (arg: any) => {
await delay(150)
if ('amount' in arg?.body) {
amount += 1
}
return {
data: arg?.body
? { ...arg.body, ...(amount ? { amount } : {}) }
: undefined,
}
},
endpoints: (build) => ({
getIncrementedAmount: build.query<any, void>({
query: () => ({
url: '',
body: {
amount,
},
}),
}),
}),
refetchOnFocus: true,
refetchOnReconnect: true,
})
const storeRef = setupApiStore(defaultApi)
const getIncrementedAmountState = () =>
storeRef.store.getState().api.queries['getIncrementedAmount(undefined)']
afterEach(() => {
amount = 0
})
describe('refetchOnFocus tests', () => {
test('useQuery hook respects refetchOnFocus: true when set in createApi options', async () => {
let data, isLoading, isFetching
function User() {
;({ data, isFetching, isLoading } =
defaultApi.endpoints.getIncrementedAmount.useQuery())
return (
<div>
<div data-testid="isLoading">{String(isLoading)}</div>
<div data-testid="isFetching">{String(isFetching)}</div>
<div data-testid="amount">{String(data?.amount)}</div>
</div>
)
}
render(<User />, { wrapper: storeRef.wrapper })
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('true'),
)
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('false'),
)
await waitFor(() =>
expect(screen.getByTestId('amount').textContent).toBe('1'),
)
fireEvent.focus(window)
await waitFor(() =>
expect(screen.getByTestId('amount').textContent).toBe('2'),
)
})
test('useQuery hook respects refetchOnFocus: false from a hook and overrides createApi defaults', async () => {
let data, isLoading, isFetching
function User() {
;({ data, isFetching, isLoading } =
defaultApi.endpoints.getIncrementedAmount.useQuery(undefined, {
refetchOnFocus: false,
}))
return (
<div>
<div data-testid="isLoading">{String(isLoading)}</div>
<div data-testid="isFetching">{String(isFetching)}</div>
<div data-testid="amount">{String(data?.amount)}</div>
</div>
)
}
render(<User />, { wrapper: storeRef.wrapper })
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('true'),
)
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('false'),
)
await waitFor(() =>
expect(screen.getByTestId('amount').textContent).toBe('1'),
)
fireEvent.focus(window)
await waitFor(() =>
expect(screen.getByTestId('amount').textContent).toBe('1'),
)
})
test('useQuery hook prefers refetchOnFocus: true when multiple components have different configurations', async () => {
let data, isLoading, isFetching
function User() {
;({ data, isFetching, isLoading } =
defaultApi.endpoints.getIncrementedAmount.useQuery(undefined, {
refetchOnFocus: false,
}))
return (
<div>
<div data-testid="isLoading">{String(isLoading)}</div>
<div data-testid="isFetching">{String(isFetching)}</div>
<div data-testid="amount">{String(data?.amount)}</div>
</div>
)
}
function UserWithRefetchTrue() {
;({ data, isFetching, isLoading } =
defaultApi.endpoints.getIncrementedAmount.useQuery(undefined, {
refetchOnFocus: true,
}))
return <div />
}
render(
<div>
<User />
<UserWithRefetchTrue />
</div>,
{ wrapper: storeRef.wrapper },
)
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('true'),
)
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('false'),
)
await waitFor(() =>
expect(screen.getByTestId('amount').textContent).toBe('1'),
)
fireEvent.focus(window)
expect(screen.getByTestId('isLoading').textContent).toBe('false')
await waitFor(() =>
expect(screen.getByTestId('isFetching').textContent).toBe('true'),
)
await waitFor(() =>
expect(screen.getByTestId('isFetching').textContent).toBe('false'),
)
await waitFor(() =>
expect(screen.getByTestId('amount').textContent).toBe('2'),
)
})
test('useQuery hook cleans data if refetch without active subscribers', async () => {
let data, isLoading, isFetching
function User() {
;({ data, isFetching, isLoading } =
defaultApi.endpoints.getIncrementedAmount.useQuery(undefined, {
refetchOnFocus: true,
}))
return (
<div>
<div data-testid="isLoading">{String(isLoading)}</div>
<div data-testid="isFetching">{String(isFetching)}</div>
<div data-testid="amount">{String(data?.amount)}</div>
</div>
)
}
const { unmount } = render(<User />, { wrapper: storeRef.wrapper })
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('true'),
)
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('false'),
)
await waitFor(() =>
expect(screen.getByTestId('amount').textContent).toBe('1'),
)
unmount()
expect(getIncrementedAmountState()).not.toBeUndefined()
fireEvent.focus(window)
await delay(1)
expect(getIncrementedAmountState()).toBeUndefined()
})
})
describe('refetchOnReconnect tests', () => {
test('useQuery hook respects refetchOnReconnect: true when set in createApi options', async () => {
let data, isLoading, isFetching
function User() {
;({ data, isFetching, isLoading } =
defaultApi.endpoints.getIncrementedAmount.useQuery())
return (
<div>
<div data-testid="isLoading">{String(isLoading)}</div>
<div data-testid="isFetching">{String(isFetching)}</div>
<div data-testid="amount">{String(data?.amount)}</div>
</div>
)
}
render(<User />, { wrapper: storeRef.wrapper })
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('true'),
)
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('false'),
)
await waitFor(() =>
expect(screen.getByTestId('amount').textContent).toBe('1'),
)
act(() => {
window.dispatchEvent(new Event('offline'))
window.dispatchEvent(new Event('online'))
})
await waitFor(() =>
expect(screen.getByTestId('isFetching').textContent).toBe('true'),
)
await waitFor(() =>
expect(screen.getByTestId('isFetching').textContent).toBe('false'),
)
await waitFor(() =>
expect(screen.getByTestId('amount').textContent).toBe('2'),
)
})
test('useQuery hook should not refetch when refetchOnReconnect: false from a hook and overrides createApi defaults', async () => {
let data, isLoading, isFetching
function User() {
;({ data, isFetching, isLoading } =
defaultApi.endpoints.getIncrementedAmount.useQuery(undefined, {
refetchOnReconnect: false,
}))
return (
<div>
<div data-testid="isLoading">{String(isLoading)}</div>
<div data-testid="isFetching">{String(isFetching)}</div>
<div data-testid="amount">{String(data?.amount)}</div>
</div>
)
}
render(<User />, { wrapper: storeRef.wrapper })
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('true'),
)
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('false'),
)
await waitFor(() =>
expect(screen.getByTestId('amount').textContent).toBe('1'),
)
act(() => {
window.dispatchEvent(new Event('offline'))
window.dispatchEvent(new Event('online'))
})
expect(screen.getByTestId('isFetching').textContent).toBe('false')
await waitFor(() =>
expect(screen.getByTestId('amount').textContent).toBe('1'),
)
})
test('useQuery hook prefers refetchOnReconnect: true when multiple components have different configurations', async () => {
let data, isLoading, isFetching
function User() {
;({ data, isFetching, isLoading } =
defaultApi.endpoints.getIncrementedAmount.useQuery(undefined, {
refetchOnReconnect: false,
}))
return (
<div>
<div data-testid="isLoading">{String(isLoading)}</div>
<div data-testid="isFetching">{String(isFetching)}</div>
<div data-testid="amount">{String(data?.amount)}</div>
</div>
)
}
function UserWithRefetchTrue() {
;({ data, isFetching, isLoading } =
defaultApi.endpoints.getIncrementedAmount.useQuery(undefined, {
refetchOnReconnect: true,
}))
return <div />
}
render(
<div>
<User />
<UserWithRefetchTrue />
</div>,
{ wrapper: storeRef.wrapper },
)
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('true'),
)
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('false'),
)
await waitFor(() =>
expect(screen.getByTestId('amount').textContent).toBe('1'),
)
act(() => {
window.dispatchEvent(new Event('offline'))
window.dispatchEvent(new Event('online'))
})
await waitFor(() =>
expect(screen.getByTestId('isFetching').textContent).toBe('true'),
)
await waitFor(() =>
expect(screen.getByTestId('isFetching').textContent).toBe('false'),
)
await waitFor(() =>
expect(screen.getByTestId('amount').textContent).toBe('2'),
)
})
})
describe('customListenersHandler', () => {
const storeRef = setupApiStore(defaultApi, undefined, {
withoutListeners: true,
})
test('setupListeners accepts a custom callback and executes it', async () => {
const consoleSpy = vi.spyOn(console, 'log')
consoleSpy.mockImplementation((...args: any[]) => {
// console.info(...args)
})
const dispatchSpy = vi.spyOn(storeRef.store, 'dispatch')
let unsubscribe = () => {}
unsubscribe = setupListeners(
storeRef.store.dispatch,
(dispatch, actions) => {
const handleOnline = () =>
dispatch(defaultApi.internalActions.onOnline())
window.addEventListener('online', handleOnline, false)
console.log('setup!')
return () => {
window.removeEventListener('online', handleOnline)
console.log('cleanup!')
}
},
)
await delay(150)
let data, isLoading, isFetching
function User() {
;({ data, isFetching, isLoading } =
defaultApi.endpoints.getIncrementedAmount.useQuery(undefined, {
refetchOnReconnect: true,
}))
return (
<div>
<div data-testid="isLoading">{String(isLoading)}</div>
<div data-testid="isFetching">{String(isFetching)}</div>
<div data-testid="amount">{String(data?.amount)}</div>
</div>
)
}
render(<User />, { wrapper: storeRef.wrapper })
expect(consoleSpy).toHaveBeenCalledWith('setup!')
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('true'),
)
await waitFor(() =>
expect(screen.getByTestId('isLoading').textContent).toBe('false'),
)
await waitFor(() =>
expect(screen.getByTestId('amount').textContent).toBe('1'),
)
act(() => {
window.dispatchEvent(new Event('offline'))
window.dispatchEvent(new Event('online'))
})
expect(dispatchSpy).toHaveBeenCalled()
// Ignore RTKQ middleware internal data calls
const mockCallsWithoutInternals = dispatchSpy.mock.calls.filter((call) => {
const type = (call[0] as any)?.type ?? ''
const reIsInternal = /internal/i
return !reIsInternal.test(type)
})
expect(
defaultApi.internalActions.onOnline.match(
mockCallsWithoutInternals[1][0] as any,
),
).toBe(true)
await waitFor(() =>
expect(screen.getByTestId('isFetching').textContent).toBe('true'),
)
await waitFor(() =>
expect(screen.getByTestId('isFetching').textContent).toBe('false'),
)
await waitFor(() =>
expect(screen.getByTestId('amount').textContent).toBe('2'),
)
unsubscribe()
expect(consoleSpy).toHaveBeenCalledWith('cleanup!')
})
})
@@ -0,0 +1 @@
{"name":"ssri","version":"9.0.1","requiresBuild":false,"files":{"lib/index.js":{"checkedAt":1794532121574,"integrity":"sha512-Muwv7HM3umNp1Xa49474lCBLCXa4HXfAhX4bw5YHmM1drvkgLgQojU5Tg9KWBo4Lk43vwBBmGaCpjuLp7MKBzg==","mode":420,"size":14830},"package.json":{"checkedAt":1794532121574,"integrity":"sha512-G554Qp7zgnvfMIdmgqFhLhp88Ldf3WOkIDLPfVITeqwCfR0Wme6TQiA5xzaNfflagD9Y5gWY2g8xzn66EYzL3w==","mode":420,"size":1516},"LICENSE.md":{"checkedAt":1794532121574,"integrity":"sha512-Y2lXWNVQRXwHJ8PUXdWpdA31Z+tbOM/3YVwkyBM0OCh/ztaDFld3B+arI9557Jkfp8RZkLiOXtmz0No231IRDw==","mode":420,"size":760},"README.md":{"checkedAt":1794532121574,"integrity":"sha512-+kxZCgJeOCKM2u9rXCbC9y+CiALiFYCK9G3fj42LAA8LaXQLEty6cC0AloA0Z5HKFzPkU194u4sYsOBv6zDs4w==","mode":420,"size":20405}}}
@@ -0,0 +1,54 @@
var stream = require('readable-stream')
var inherits = require('inherits')
var SIGNAL_FLUSH =(Buffer.from && Buffer.from !== Uint8Array.from)
? Buffer.from([0])
: new Buffer([0])
module.exports = WriteStream
function WriteStream (opts, write, flush) {
if (!(this instanceof WriteStream)) return new WriteStream(opts, write, flush)
if (typeof opts === 'function') {
flush = write
write = opts
opts = {}
}
stream.Writable.call(this, opts)
this.destroyed = false
this._worker = write || null
this._flush = flush || null
}
inherits(WriteStream, stream.Writable)
WriteStream.obj = function (opts, worker, flush) {
if (typeof opts === 'function') return WriteStream.obj(null, opts, worker)
if (!opts) opts = {}
opts.objectMode = true
return new WriteStream(opts, worker, flush)
}
WriteStream.prototype._write = function (data, enc, cb) {
if (SIGNAL_FLUSH === data) this._flush(cb)
else this._worker(data, enc, cb)
}
WriteStream.prototype.end = function (data, enc, cb) {
if (!this._flush) return stream.Writable.prototype.end.apply(this, arguments)
if (typeof data === 'function') return this.end(null, null, data)
if (typeof enc === 'function') return this.end(data, null, enc)
if (data) this.write(data)
if (!this._writableState.ending) this.write(SIGNAL_FLUSH)
return stream.Writable.prototype.end.call(this, cb)
}
WriteStream.prototype.destroy = function (err) {
if (this.destroyed) return
this.destroyed = true
if (err) this.emit('error', err)
this.emit('close')
}
@@ -0,0 +1,9 @@
# Localizations
We welcome any localization for axe-core. For details on how to contribute, see the [Contributing section](../README.md#contributing) of the main README. For details on the message syntax, see [Check Message Template](../doc/check-message-template.md).
To create a new translation for axe, start by running `grunt translate --lang=<langcode>`. This will create a JSON file with the default English text in it for you to translate. Alternatively, you could copy `_template.json`.
To update an existing translation file, re-run `grunt translate --lang=<langcode>`. This will add new messages used in English and remove messages that are no longer used in English.
`_template.json` is a generated file which is created every time axe is built. It's compiled using each rule's `description` and `help` properties, as well as each check's `metadata.messages` property. To update the `_template.json` file you'll need to update the corresponding [rule](../lib/rules) or [check](../lib/checks) metadata file and rebuild.
@@ -0,0 +1,194 @@
import {nodeContains as $d4ee10de306f2510$export$4282f70798064fe0} from "./DOMFunctions.mjs";
import {shadowDOM as $bJKXg$shadowDOM} from "@react-stately/flags";
// https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/ShadowTreeWalker.ts
class $dfc540311bf7f109$export$63eb3ababa9c55c4 {
get currentNode() {
return this._currentNode;
}
set currentNode(node) {
if (!(0, $d4ee10de306f2510$export$4282f70798064fe0)(this.root, node)) throw new Error('Cannot set currentNode to a node that is not contained by the root node.');
const walkers = [];
let curNode = node;
let currentWalkerCurrentNode = node;
this._currentNode = node;
while(curNode && curNode !== this.root)if (curNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
const shadowRoot = curNode;
const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {
acceptNode: this._acceptNode
});
walkers.push(walker);
walker.currentNode = currentWalkerCurrentNode;
this._currentSetFor.add(walker);
curNode = currentWalkerCurrentNode = shadowRoot.host;
} else curNode = curNode.parentNode;
const walker = this._doc.createTreeWalker(this.root, this.whatToShow, {
acceptNode: this._acceptNode
});
walkers.push(walker);
walker.currentNode = currentWalkerCurrentNode;
this._currentSetFor.add(walker);
this._walkerStack = walkers;
}
get doc() {
return this._doc;
}
firstChild() {
let currentNode = this.currentNode;
let newNode = this.nextNode();
if (!(0, $d4ee10de306f2510$export$4282f70798064fe0)(currentNode, newNode)) {
this.currentNode = currentNode;
return null;
}
if (newNode) this.currentNode = newNode;
return newNode;
}
lastChild() {
let walker = this._walkerStack[0];
let newNode = walker.lastChild();
if (newNode) this.currentNode = newNode;
return newNode;
}
nextNode() {
const nextNode = this._walkerStack[0].nextNode();
if (nextNode) {
const shadowRoot = nextNode.shadowRoot;
if (shadowRoot) {
var _this_filter;
let nodeResult;
if (typeof this.filter === 'function') nodeResult = this.filter(nextNode);
else if ((_this_filter = this.filter) === null || _this_filter === void 0 ? void 0 : _this_filter.acceptNode) nodeResult = this.filter.acceptNode(nextNode);
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
this.currentNode = nextNode;
return nextNode;
}
// _acceptNode should have added new walker for this shadow,
// go in recursively.
let newNode = this.nextNode();
if (newNode) this.currentNode = newNode;
return newNode;
}
if (nextNode) this.currentNode = nextNode;
return nextNode;
} else {
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.nextNode();
if (newNode) this.currentNode = newNode;
return newNode;
} else return null;
}
}
previousNode() {
const currentWalker = this._walkerStack[0];
if (currentWalker.currentNode === currentWalker.root) {
if (this._currentSetFor.has(currentWalker)) {
this._currentSetFor.delete(currentWalker);
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.previousNode();
if (newNode) this.currentNode = newNode;
return newNode;
} else return null;
}
return null;
}
const previousNode = currentWalker.previousNode();
if (previousNode) {
const shadowRoot = previousNode.shadowRoot;
if (shadowRoot) {
var _this_filter;
let nodeResult;
if (typeof this.filter === 'function') nodeResult = this.filter(previousNode);
else if ((_this_filter = this.filter) === null || _this_filter === void 0 ? void 0 : _this_filter.acceptNode) nodeResult = this.filter.acceptNode(previousNode);
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
if (previousNode) this.currentNode = previousNode;
return previousNode;
}
// _acceptNode should have added new walker for this shadow,
// go in recursively.
let newNode = this.lastChild();
if (newNode) this.currentNode = newNode;
return newNode;
}
if (previousNode) this.currentNode = previousNode;
return previousNode;
} else {
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.previousNode();
if (newNode) this.currentNode = newNode;
return newNode;
} else return null;
}
}
/**
* @deprecated
*/ nextSibling() {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
/**
* @deprecated
*/ previousSibling() {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
/**
* @deprecated
*/ parentNode() {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
constructor(doc, root, whatToShow, filter){
this._walkerStack = [];
this._currentSetFor = new Set();
this._acceptNode = (node)=>{
if (node.nodeType === Node.ELEMENT_NODE) {
const shadowRoot = node.shadowRoot;
if (shadowRoot) {
const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {
acceptNode: this._acceptNode
});
this._walkerStack.unshift(walker);
return NodeFilter.FILTER_ACCEPT;
} else {
var _this_filter;
if (typeof this.filter === 'function') return this.filter(node);
else if ((_this_filter = this.filter) === null || _this_filter === void 0 ? void 0 : _this_filter.acceptNode) return this.filter.acceptNode(node);
else if (this.filter === null) return NodeFilter.FILTER_ACCEPT;
}
}
return NodeFilter.FILTER_SKIP;
};
this._doc = doc;
this.root = root;
this.filter = filter !== null && filter !== void 0 ? filter : null;
this.whatToShow = whatToShow !== null && whatToShow !== void 0 ? whatToShow : NodeFilter.SHOW_ALL;
this._currentNode = root;
this._walkerStack.unshift(doc.createTreeWalker(root, whatToShow, this._acceptNode));
const shadowRoot = root.shadowRoot;
if (shadowRoot) {
const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {
acceptNode: this._acceptNode
});
this._walkerStack.unshift(walker);
}
}
}
function $dfc540311bf7f109$export$4d0f8be8b12a7ef6(doc, root, whatToShow, filter) {
if ((0, $bJKXg$shadowDOM)()) return new $dfc540311bf7f109$export$63eb3ababa9c55c4(doc, root, whatToShow, filter);
return doc.createTreeWalker(root, whatToShow, filter);
}
export {$dfc540311bf7f109$export$63eb3ababa9c55c4 as ShadowTreeWalker, $dfc540311bf7f109$export$4d0f8be8b12a7ef6 as createShadowTreeWalker};
//# sourceMappingURL=ShadowTreeWalker.module.js.map
@@ -0,0 +1,141 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.1.8](https://github.com/es-shims/Function.prototype.name/compare/v1.1.7...v1.1.8) - 2024-12-19
### Commits
- [actions] split out node 10-20, and 20+ [`b5ea555`](https://github.com/es-shims/Function.prototype.name/commit/b5ea555b2a4db8eb531bccb4d6b2c916de9b8089)
- [Refactor] use `call-bound` directly [`f6a6c64`](https://github.com/es-shims/Function.prototype.name/commit/f6a6c640f7f209c3fc1ea65c0eb31e622e2c9399)
## [v1.1.7](https://github.com/es-shims/Function.prototype.name/compare/v1.1.6...v1.1.7) - 2024-12-15
### Commits
- [actions] split out node 10-20, and 20+ [`47155b0`](https://github.com/es-shims/Function.prototype.name/commit/47155b0bef19c37e5cf9dfff393bc14c6079959a)
- [Refactor] use `hasown` and `is-callable` directly, instead of `es-abstract` [`d5118d6`](https://github.com/es-shims/Function.prototype.name/commit/d5118d65f89f8af4d1109943955ba65f88f4aa6b)
- [Deps] update `call-bind`, `define-properties`, `es-abstract` [`cfa8b2e`](https://github.com/es-shims/Function.prototype.name/commit/cfa8b2e4fcfa437dde6436c2c34e3eb4bb646907)
- [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `auto-changelog`, `npmignore`, `tape` [`2077d9a`](https://github.com/es-shims/Function.prototype.name/commit/2077d9a9039c7cbf78816188bf486560366437bc)
- [Tests] replace `aud` with `npm audit` [`219e0a4`](https://github.com/es-shims/Function.prototype.name/commit/219e0a43a3de2d96e78ec61a43ccb61be40d8da8)
- [Dev Deps] add missing peer dep [`0b16b2b`](https://github.com/es-shims/Function.prototype.name/commit/0b16b2b1013b3c92793bcf87c573eab356e00388)
## [v1.1.6](https://github.com/es-shims/Function.prototype.name/compare/v1.1.5...v1.1.6) - 2023-08-28
### Commits
- [actions] reuse common workflows [`5f6bfba`](https://github.com/es-shims/Function.prototype.name/commit/5f6bfba9d2c42fbac8f4812396bc71f79464846c)
- [meta] use `npmignore` to autogenerate an npmignore file [`28ea2f9`](https://github.com/es-shims/Function.prototype.name/commit/28ea2f9a9dd48623cba04e94c491033f1c9d1e90)
- [Fix] properly recognize `document.all` in IE 6-8 [`316d676`](https://github.com/es-shims/Function.prototype.name/commit/316d67641d54bf221ed5edfdb9e04af3b98caad8)
- [Fix] only return an own `name` [`d647609`](https://github.com/es-shims/Function.prototype.name/commit/d6476090e110733b52a922f4d0dbfdbc9478c653)
- [Tests] add browserstack browser tests [`67ae402`](https://github.com/es-shims/Function.prototype.name/commit/67ae402aabcad83df2f7d7e356d059a84fe71f44)
- [meta] better `eccheck` command [`728df4c`](https://github.com/es-shims/Function.prototype.name/commit/728df4cc81a51a131a36c0768c4adb7668ad7569)
- [meta] add `auto-changelog` [`dbb700b`](https://github.com/es-shims/Function.prototype.name/commit/dbb700b38ef4c18e0ce0670a2ffface9ffd251a0)
- [readme] fix eclint [`c98fdf1`](https://github.com/es-shims/Function.prototype.name/commit/c98fdf1bc5451de667945c41187a67022f750001)
- [readme] add tested browsers [`d41325c`](https://github.com/es-shims/Function.prototype.name/commit/d41325ceec61627f63281d0649e4e0004f3e0609)
- [actions] update rebase action to use reusable workflow [`085f340`](https://github.com/es-shims/Function.prototype.name/commit/085f3400785cd4f3fb762b73b095f5dfb795a0b3)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `safe-publish-latest`, `tape` [`3f071ce`](https://github.com/es-shims/Function.prototype.name/commit/3f071cef2e1feebfd7d0daea7d6392c2feada091)
- [actions] update codecov uploader [`a187b4f`](https://github.com/es-shims/Function.prototype.name/commit/a187b4fd07dbbeee12e8dc60651f122ab3f41f8d)
- [Deps] update `define-properties`, `es-abstract` [`3ca42ef`](https://github.com/es-shims/Function.prototype.name/commit/3ca42ef76d5d4016d1ea87d806dc7e4a09d9b4f8)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`8de25d2`](https://github.com/es-shims/Function.prototype.name/commit/8de25d2b9b523bd385b0bf3bb9213c11ecf8f1ba)
- [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `aud`, `tape` [`8b04da7`](https://github.com/es-shims/Function.prototype.name/commit/8b04da71695a1b9cf285ee926ffeec55b543595b)
- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`39d8538`](https://github.com/es-shims/Function.prototype.name/commit/39d853854136a749c94e10f9fb06ba73903671a6)
- [meta] reorder scripts [`054f96b`](https://github.com/es-shims/Function.prototype.name/commit/054f96b5e88e08e65c4e27bcb799c7cea2bc3462)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`bebee89`](https://github.com/es-shims/Function.prototype.name/commit/bebee894a7989aef6e9db0dc8b16cbd9134b629c)
- [Dev Deps] update `aud`, `tape` [`8e68159`](https://github.com/es-shims/Function.prototype.name/commit/8e681599b4fbf26e921f61fd603da0524369b72c)
- [Tests] handle Function.prototype in Opera 12.1 [`f3b8f9a`](https://github.com/es-shims/Function.prototype.name/commit/f3b8f9a40b88f6da5ad41b874c3f2acf6fb30378)
- [Deps] update `es-abstract`, `functions-have-names` [`6a59889`](https://github.com/es-shims/Function.prototype.name/commit/6a598893f013182070479a8cc52afd44e556561f)
- [Deps] update `define-properties`, `es-abstract` [`cd1c5e7`](https://github.com/es-shims/Function.prototype.name/commit/cd1c5e773c3740ec563a26e657d764aba7c35a8c)
- [Deps] update `es-abstract` [`3584585`](https://github.com/es-shims/Function.prototype.name/commit/35845851109f767e3bc84ebef989ca93e5851276)
- [Deps] update `es-abstract` [`0e2f6d9`](https://github.com/es-shims/Function.prototype.name/commit/0e2f6d99d554a8b6b7c835702c8408832f9a2684)
- [Deps] update `es-abstract` [`b11748e`](https://github.com/es-shims/Function.prototype.name/commit/b11748ebbda2d840ac625ae6627cfdb090b94434)
- [Dev Deps] update `tape` [`d787a81`](https://github.com/es-shims/Function.prototype.name/commit/d787a81a1e1ce6d00dda6272e93a43bb193b1286)
- [Deps] update `es-abstract` [`4692639`](https://github.com/es-shims/Function.prototype.name/commit/469263915b07db8342f0aad29ad7eba083bea277)
- [Dev Deps] add `in-publish` [`568e263`](https://github.com/es-shims/Function.prototype.name/commit/568e2635099de326768f40d9e0eacbd024861676)
<!-- auto-changelog-above -->
1.1.5 / 2021-10-01
=================
* [Deps] update `es-abstract`
* [meta] use `prepublishOnly` script for npm 7+
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `aud`, `tape`
* [actions] update workflows
* [actions] use `node/install` instead of `node/run`; use `codecov` action
1.1.4 / 2021-02-22
=================
* [readme] remove travis badge
* [meta] remove audit-level
* [meta] gitignore coverage output
* [meta] do not publish github action workflow files
* [Deps] update `call-bind`, `es-abstract`, `functions-have-names`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-strict-mode`, `tape`
* [Tests] increase coverage
* [actions] update workflows
1.1.3 / 2020-11-27
=================
* [Deps] update `es-abstract`, `functions-have-names`; use `call-bind` where applicable
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `make-arrow-function`, `make-generator-function`; add `aud`, `make-async-function`
* [actions] add "Allow Edits" workflow
* [actions] switch Automatic Rebase workflow to `pull_request_target` event
* [Tests] migrate tests to Github Actions
* [Tests] run `nyc` on all tests
* [Tests] add `implementation` test; run `es-shim-api` in postlint; use `tape` runner
* [Tests] only audit prod deps
1.1.2 / 2019-12-14
=================
* [Refactor] use `es-abstract`
* [Deps] update `functions-have-names`
* [meta] add `funding` field
* [meta] fix repo capitalization
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`
* [Tests] use shared travis-ci configs
* [actions] add automatic rebasing / merge commit blocking
1.1.1 / 2019-07-24
=================
* [Refactor] use `functions-have-names`
* [meta] clean up package.json scripts
* [meta] update links
* [meta] create FUNDING.yml
* [Deps] update `is-callable`, `define-properties`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `covert`
* [Tests] use `eccheck` over `editorconfig-tools`
* [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops
* [Tests] up to `node` `v11.7`, `v10.15`, `v9.11`, `v8.15`, `v6.16`, `v4.9`
* [Test] remove `jscs`
1.1.0 / 2017-12-31
=================
* [New] add `auto` entry point
* [Deps] update `function-bind`
* [Dev Deps] update `uglify-register`, `tape`, `nsp`, `eslint`, `@ljharb/eslint-config`, `@es-shims/api`
* [Tests] up to `node` `v9.3`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTS
1.0.3 / 2017-07-21
=================
* [Fix] be robust against function name mangling
* [Refactor] move function name detection to separate file
1.0.2 / 2017-07-14
=================
* [Refactor] shim: Remove unnecessary `!functionsHaveNames` check
1.0.1 / 2017-07-11
=================
* [Fix] in IE 9-11, we must rely on `.call` being available (#13)
* [Fix] ensure that `Function.prototype.name` does not erase the getter
* [Deps] update `is-callable`
* [Dev Deps] add `safe-publish-latest`
* [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `@es-shims/api`
* [Tests] up to `node` `v8.1`; `v7.10`, `v6.11`, `v4.8`; improve matrix; newer npm fails on older nodes
* [Tests] use `Object` to avoid function name inference in node 7
1.0.0 / 2016-02-27
=================
* Initial release.
@@ -0,0 +1,26 @@
import { _ as _construct } from "./_construct.js";
import { _ as _get_prototype_of } from "./_get_prototype_of.js";
import { _ as _is_native_function } from "./_is_native_function.js";
import { _ as _set_prototype_of } from "./_set_prototype_of.js";
function _wrap_native_super(Class) {
var _cache = typeof Map === "function" ? new Map() : undefined;
_wrap_native_super = function(Class) {
if (Class === null || !_is_native_function(Class)) return Class;
if (typeof Class !== "function") throw new TypeError("Super expression must either be null or a function");
if (typeof _cache !== "undefined") {
if (_cache.has(Class)) return _cache.get(Class);
_cache.set(Class, Wrapper);
}
function Wrapper() {
return _construct(Class, arguments, _get_prototype_of(this).constructor);
}
Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } });
return _set_prototype_of(Wrapper, Class);
};
return _wrap_native_super(Class);
}
export { _wrap_native_super as _ };
@@ -0,0 +1,16 @@
import { useEffect } from 'react';
import useLatest from '../useLatest';
import { isFunction } from '../utils';
import isDev from '../utils/isDev';
var useUnmount = function (fn) {
if (isDev) {
if (!isFunction(fn)) {
console.error("useUnmount expected parameter is a function, got ".concat(typeof fn));
}
}
var fnRef = useLatest(fn);
useEffect(function () { return function () {
fnRef.current();
}; }, []);
};
export default useUnmount;
@@ -0,0 +1,37 @@
"use client";
import {
useCheckboxGroup
} from "./chunk-LLMGIUXO.mjs";
import {
CheckboxGroupProvider
} from "./chunk-LK575OWX.mjs";
// src/checkbox-group.tsx
import { forwardRef } from "@heroui/system";
import { jsx, jsxs } from "react/jsx-runtime";
var CheckboxGroup = forwardRef((props, ref) => {
const {
children,
context,
label,
description,
isInvalid,
errorMessage,
getGroupProps,
getLabelProps,
getWrapperProps,
getDescriptionProps,
getErrorMessageProps
} = useCheckboxGroup({ ...props, ref });
return /* @__PURE__ */ jsxs("div", { ...getGroupProps(), children: [
label && /* @__PURE__ */ jsx("span", { ...getLabelProps(), children: label }),
/* @__PURE__ */ jsx("div", { ...getWrapperProps(), children: /* @__PURE__ */ jsx(CheckboxGroupProvider, { value: context, children }) }),
isInvalid && errorMessage ? /* @__PURE__ */ jsx("div", { ...getErrorMessageProps(), children: errorMessage }) : description ? /* @__PURE__ */ jsx("div", { ...getDescriptionProps(), children: description }) : null
] });
});
CheckboxGroup.displayName = "HeroUI.CheckboxGroup";
var checkbox_group_default = CheckboxGroup;
export {
checkbox_group_default
};
@@ -0,0 +1,208 @@
/**
* The `node:tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes. In most cases, it will not be necessary or possible to use this module
* directly. However, it can be accessed using:
*
* ```js
* import tty from 'node:tty';
* ```
*
* When Node.js detects that it is being run with a text terminal ("TTY")
* attached, `process.stdin` will, by default, be initialized as an instance of `tty.ReadStream` and both `process.stdout` and `process.stderr` will, by
* default, be instances of `tty.WriteStream`. The preferred method of determining
* whether Node.js is being run within a TTY context is to check that the value of
* the `process.stdout.isTTY` property is `true`:
*
* ```console
* $ node -p -e "Boolean(process.stdout.isTTY)"
* true
* $ node -p -e "Boolean(process.stdout.isTTY)" | cat
* false
* ```
*
* In most cases, there should be little to no reason for an application to
* manually create instances of the `tty.ReadStream` and `tty.WriteStream` classes.
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/tty.js)
*/
declare module "tty" {
import * as net from "node:net";
/**
* The `tty.isatty()` method returns `true` if the given `fd` is associated with
* a TTY and `false` if it is not, including whenever `fd` is not a non-negative
* integer.
* @since v0.5.8
* @param fd A numeric file descriptor
*/
function isatty(fd: number): boolean;
/**
* Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js
* process and there should be no reason to create additional instances.
* @since v0.5.8
*/
class ReadStream extends net.Socket {
constructor(fd: number, options?: net.SocketConstructorOpts);
/**
* A `boolean` that is `true` if the TTY is currently configured to operate as a
* raw device.
*
* This flag is always `false` when a process starts, even if the terminal is
* operating in raw mode. Its value will change with subsequent calls to `setRawMode`.
* @since v0.7.7
*/
isRaw: boolean;
/**
* Allows configuration of `tty.ReadStream` so that it operates as a raw device.
*
* When in raw mode, input is always available character-by-character, not
* including modifiers. Additionally, all special processing of characters by the
* terminal is disabled, including echoing input
* characters. Ctrl+C will no longer cause a `SIGINT` when
* in this mode.
* @since v0.7.7
* @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw`
* property will be set to the resulting mode.
* @return The read stream instance.
*/
setRawMode(mode: boolean): this;
/**
* A `boolean` that is always `true` for `tty.ReadStream` instances.
* @since v0.5.8
*/
isTTY: boolean;
}
/**
* -1 - to the left from cursor
* 0 - the entire line
* 1 - to the right from cursor
*/
type Direction = -1 | 0 | 1;
/**
* Represents the writable side of a TTY. In normal circumstances, `process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there
* should be no reason to create additional instances.
* @since v0.5.8
*/
class WriteStream extends net.Socket {
constructor(fd: number);
addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: "resize", listener: () => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: "resize"): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: "resize", listener: () => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: "resize", listener: () => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: "resize", listener: () => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: "resize", listener: () => void): this;
/**
* `writeStream.clearLine()` clears the current line of this `WriteStream` in a
* direction identified by `dir`.
* @since v0.7.7
* @param callback Invoked once the operation completes.
* @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
*/
clearLine(dir: Direction, callback?: () => void): boolean;
/**
* `writeStream.clearScreenDown()` clears this `WriteStream` from the current
* cursor down.
* @since v0.7.7
* @param callback Invoked once the operation completes.
* @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
*/
clearScreenDown(callback?: () => void): boolean;
/**
* `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified
* position.
* @since v0.7.7
* @param callback Invoked once the operation completes.
* @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
*/
cursorTo(x: number, y?: number, callback?: () => void): boolean;
cursorTo(x: number, callback: () => void): boolean;
/**
* `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its
* current position.
* @since v0.7.7
* @param callback Invoked once the operation completes.
* @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
*/
moveCursor(dx: number, dy: number, callback?: () => void): boolean;
/**
* Returns:
*
* * `1` for 2,
* * `4` for 16,
* * `8` for 256,
* * `24` for 16,777,216 colors supported.
*
* Use this to determine what colors the terminal supports. Due to the nature of
* colors in terminals it is possible to either have false positives or false
* negatives. It depends on process information and the environment variables that
* may lie about what terminal is used.
* It is possible to pass in an `env` object to simulate the usage of a specific
* terminal. This can be useful to check how specific environment settings behave.
*
* To enforce a specific color support, use one of the below environment settings.
*
* * 2 colors: `FORCE_COLOR = 0` (Disables colors)
* * 16 colors: `FORCE_COLOR = 1`
* * 256 colors: `FORCE_COLOR = 2`
* * 16,777,216 colors: `FORCE_COLOR = 3`
*
* Disabling color support is also possible by using the `NO_COLOR` and `NODE_DISABLE_COLORS` environment variables.
* @since v9.9.0
* @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
*/
getColorDepth(env?: object): number;
/**
* Returns `true` if the `writeStream` supports at least as many colors as provided
* in `count`. Minimum support is 2 (black and white).
*
* This has the same false positives and negatives as described in `writeStream.getColorDepth()`.
*
* ```js
* process.stdout.hasColors();
* // Returns true or false depending on if `stdout` supports at least 16 colors.
* process.stdout.hasColors(256);
* // Returns true or false depending on if `stdout` supports at least 256 colors.
* process.stdout.hasColors({ TMUX: '1' });
* // Returns true.
* process.stdout.hasColors(2 ** 24, { TMUX: '1' });
* // Returns false (the environment setting pretends to support 2 ** 8 colors).
* ```
* @since v11.13.0, v10.16.0
* @param [count=16] The number of colors that are requested (minimum 2).
* @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
*/
hasColors(count?: number): boolean;
hasColors(env?: object): boolean;
hasColors(count: number, env?: object): boolean;
/**
* `writeStream.getWindowSize()` returns the size of the TTY
* corresponding to this `WriteStream`. The array is of the type `[numColumns, numRows]` where `numColumns` and `numRows` represent the number
* of columns and rows in the corresponding TTY.
* @since v0.7.7
*/
getWindowSize(): [number, number];
/**
* A `number` specifying the number of columns the TTY currently has. This property
* is updated whenever the `'resize'` event is emitted.
* @since v0.7.7
*/
columns: number;
/**
* A `number` specifying the number of rows the TTY currently has. This property
* is updated whenever the `'resize'` event is emitted.
* @since v0.7.7
*/
rows: number;
/**
* A `boolean` that is always `true`.
* @since v0.5.8
*/
isTTY: boolean;
}
}
declare module "node:tty" {
export * from "tty";
}
@@ -0,0 +1 @@
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):(global="undefined"!=typeof globalThis?globalThis:global||self).state=factory()}(this,(function(){"use strict";function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach((function(key){_defineProperty(target,key,source[key])})):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach((function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}))}return target}function compose(){for(var _len=arguments.length,fns=new Array(_len),_key=0;_key<_len;_key++)fns[_key]=arguments[_key];return function(x){return fns.reduceRight((function(y,f){return f(y)}),x)}}function curry(fn){return function curried(){for(var _this=this,_len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++)args[_key2]=arguments[_key2];return args.length>=fn.length?fn.apply(this,args):function(){for(var _len3=arguments.length,nextArgs=new Array(_len3),_key3=0;_key3<_len3;_key3++)nextArgs[_key3]=arguments[_key3];return curried.apply(_this,[].concat(args,nextArgs))}}}function isObject(value){return{}.toString.call(value).includes("Object")}function isFunction(value){return"function"==typeof value}var errorHandler=curry((function(errorMessages,type){throw new Error(errorMessages[type]||errorMessages.default)}))({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),validators={changes:function(initial,changes){return isObject(changes)||errorHandler("changeType"),Object.keys(changes).some((function(field){return object=initial,property=field,!Object.prototype.hasOwnProperty.call(object,property);var object,property}))&&errorHandler("changeField"),changes},selector:function(selector){isFunction(selector)||errorHandler("selectorType")},handler:function(handler){isFunction(handler)||isObject(handler)||errorHandler("handlerType"),isObject(handler)&&Object.values(handler).some((function(_handler){return!isFunction(_handler)}))&&errorHandler("handlersType")},initial:function(initial){var obj;initial||errorHandler("initialIsRequired"),isObject(initial)||errorHandler("initialType"),obj=initial,Object.keys(obj).length||errorHandler("initialContent")}};function extractChanges(state,causedChanges){return isFunction(causedChanges)?causedChanges(state.current):causedChanges}function updateState(state,changes){return state.current=_objectSpread2(_objectSpread2({},state.current),changes),changes}function didStateUpdate(state,handler,changes){return isFunction(handler)?handler(state.current):Object.keys(changes).forEach((function(field){var _handler$field;return null===(_handler$field=handler[field])||void 0===_handler$field?void 0:_handler$field.call(handler,state.current[field])})),changes}return{create:function(initial){var handler=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};validators.initial(initial),validators.handler(handler);var state={current:initial},didUpdate=curry(didStateUpdate)(state,handler),update=curry(updateState)(state),validate=curry(validators.changes)(initial),getChanges=curry(extractChanges)(state);function getState(){var selector=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(state){return state};return validators.selector(selector),selector(state.current)}function setState(causedChanges){compose(didUpdate,update,validate,getChanges)(causedChanges)}return[getState,setState]}}}));
@@ -0,0 +1,21 @@
import { TSchema } from '../type/schema/index.mjs';
import { ValueErrorIterator, ValueErrorType } from './errors.mjs';
/** Creates an error message using en-US as the default locale */
export declare function DefaultErrorFunction(error: ErrorFunctionParameter): string;
export type ErrorFunctionParameter = {
/** The type of validation error */
errorType: ValueErrorType;
/** The path of the error */
path: string;
/** The schema associated with the error */
schema: TSchema;
/** The value associated with the error */
value: unknown;
/** Interior errors for this error */
errors: ValueErrorIterator[];
};
export type ErrorFunction = (parameter: ErrorFunctionParameter) => string;
/** Sets the error function used to generate error messages. */
export declare function SetErrorFunction(callback: ErrorFunction): void;
/** Gets the error function used to generate error messages */
export declare function GetErrorFunction(): ErrorFunction;
@@ -0,0 +1,18 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2020_symbol_wellknown = void 0;
const base_config_1 = require("./base-config");
const es2015_iterable_1 = require("./es2015.iterable");
const es2015_symbol_1 = require("./es2015.symbol");
exports.es2020_symbol_wellknown = {
libs: [es2015_iterable_1.es2015_iterable, es2015_symbol_1.es2015_symbol],
variables: [
['SymbolConstructor', base_config_1.TYPE],
['RegExpStringIterator', base_config_1.TYPE],
['RegExp', base_config_1.TYPE],
],
};
@@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.camelCase = void 0;
var CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9_-]+$/;
var HYPHEN_REGEX = /-([a-z])/g;
var NO_HYPHEN_REGEX = /^[^-]+$/;
var VENDOR_PREFIX_REGEX = /^-(webkit|moz|ms|o|khtml)-/;
var MS_VENDOR_PREFIX_REGEX = /^-(ms)-/;
/**
* Checks whether to skip camelCase.
*/
var skipCamelCase = function (property) {
return !property ||
NO_HYPHEN_REGEX.test(property) ||
CUSTOM_PROPERTY_REGEX.test(property);
};
/**
* Replacer that capitalizes first character.
*/
var capitalize = function (match, character) {
return character.toUpperCase();
};
/**
* Replacer that removes beginning hyphen of vendor prefix property.
*/
var trimHyphen = function (match, prefix) { return "".concat(prefix, "-"); };
/**
* CamelCases a CSS property.
*/
var camelCase = function (property, options) {
if (options === void 0) { options = {}; }
if (skipCamelCase(property)) {
return property;
}
property = property.toLowerCase();
if (options.reactCompat) {
// `-ms` vendor prefix should not be capitalized
property = property.replace(MS_VENDOR_PREFIX_REGEX, trimHyphen);
}
else {
// for non-React, remove first hyphen so vendor prefix is not capitalized
property = property.replace(VENDOR_PREFIX_REGEX, trimHyphen);
}
return property.replace(HYPHEN_REGEX, capitalize);
};
exports.camelCase = camelCase;
//# sourceMappingURL=utilities.js.map
@@ -0,0 +1,7 @@
import {
useDivider
} from "./chunk-TS7K35D7.mjs";
import "./chunk-D2EG5U3Q.mjs";
export {
useDivider
};
@@ -0,0 +1,33 @@
'use strict';
var path = require('path');
function replaceExt(npath, ext) {
if (typeof npath !== 'string') {
return npath;
}
if (npath.length === 0) {
return npath;
}
var nFileName = path.basename(npath, path.extname(npath)) + ext;
var nFilepath = path.join(path.dirname(npath), nFileName);
// Because `path.join` removes the head './' from the given path.
// This removal can cause a problem when passing the result to `require` or
// `import`.
if (startsWithSingleDot(npath)) {
return '.' + path.sep + nFilepath;
}
return nFilepath;
}
function startsWithSingleDot(fpath) {
var first2chars = fpath.slice(0, 2);
return (first2chars === '.' + path.sep) ||
(first2chars === './');
}
module.exports = replaceExt;
@@ -0,0 +1,38 @@
import { BitString } from "@peculiar/asn1-schema";
/**
* ```asn1
* id-ce-keyUsage OBJECT IDENTIFIER ::= { id-ce 15 }
* ```
*/
export declare const id_ce_keyUsage = "2.5.29.15";
export type KeyUsageType = "digitalSignature" | "nonRepudiation" | "keyEncipherment" | "dataEncipherment" | "keyAgreement" | "keyCertSign" | "crlSign" | "encipherOnly" | "decipherOnly";
export declare enum KeyUsageFlags {
digitalSignature = 1,
nonRepudiation = 2,
keyEncipherment = 4,
dataEncipherment = 8,
keyAgreement = 16,
keyCertSign = 32,
cRLSign = 64,
encipherOnly = 128,
decipherOnly = 256
}
/**
* ```asn1
* KeyUsage ::= BIT STRING {
* digitalSignature (0),
* nonRepudiation (1), -- recent editions of X.509 have
* -- renamed this bit to contentCommitment
* keyEncipherment (2),
* dataEncipherment (3),
* keyAgreement (4),
* keyCertSign (5),
* cRLSign (6),
* encipherOnly (7),
* decipherOnly (8) }
* ```
*/
export declare class KeyUsage extends BitString {
toJSON(): KeyUsageType[];
toString(): string;
}
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more