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

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

No files matched your search

@@ -0,0 +1,44 @@
/**
* @fileoverview A class of identifiers generator for code path segments.
*
* Each rule uses the identifier of code path segments to store additional
* information of the code path.
*
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------
/**
* A generator for unique ids.
*/
class IdGenerator {
/**
* @param {string} prefix Optional. A prefix of generated ids.
*/
constructor(prefix) {
this.prefix = String(prefix);
this.n = 0;
}
/**
* Generates id.
* @returns {string} A generated id.
*/
next() {
this.n = (1 + this.n) | 0;
/* c8 ignore start */
if (this.n < 0) {
this.n = 1;
} /* c8 ignore stop */
return this.prefix + this.n;
}
}
module.exports = IdGenerator;
@@ -0,0 +1,7 @@
"use client";
import {
useAvatarGroup
} from "./chunk-QH65JCLF.mjs";
export {
useAvatarGroup
};
@@ -0,0 +1,180 @@
"use client";
// src/use-checkbox-group.ts
import { useProviderContext } from "@heroui/system";
import { useCallback, useMemo } from "react";
import { chain, mergeProps } from "@react-aria/utils";
import { checkboxGroup } from "@heroui/theme";
import { useCheckboxGroup as useReactAriaCheckboxGroup } from "@react-aria/checkbox";
import { useCheckboxGroupState } from "@react-stately/checkbox";
import { filterDOMProps, useDOMRef } from "@heroui/react-utils";
import { clsx, safeAriaLabel } from "@heroui/shared-utils";
import { FormContext, useSlottedContext } from "@heroui/form";
function useCheckboxGroup(props) {
var _a, _b;
const globalContext = useProviderContext();
const { validationBehavior: formValidationBehavior } = useSlottedContext(FormContext) || {};
const {
as,
ref,
classNames,
children,
label,
radius,
value,
name,
defaultValue,
isInvalid: isInvalidProp,
validationState,
size = "md",
color = "primary",
orientation = "vertical",
lineThrough = false,
isDisabled = false,
validationBehavior = (_a = formValidationBehavior != null ? formValidationBehavior : globalContext == null ? void 0 : globalContext.validationBehavior) != null ? _a : "native",
disableAnimation = (_b = globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false,
isReadOnly,
isRequired,
onValueChange,
description,
errorMessage,
className,
...otherProps
} = props;
const Component = as || "div";
const shouldFilterDOMProps = typeof Component === "string";
const domRef = useDOMRef(ref);
const checkboxGroupProps = useMemo(() => {
return {
...otherProps,
value,
name,
"aria-label": safeAriaLabel(otherProps["aria-label"], label),
defaultValue,
isRequired,
isReadOnly,
orientation,
validationBehavior,
isInvalid: validationState === "invalid" || isInvalidProp,
onChange: chain(props.onChange, onValueChange)
};
}, [
value,
name,
label,
defaultValue,
isRequired,
isReadOnly,
orientation,
onValueChange,
isInvalidProp,
validationState,
validationBehavior,
otherProps["aria-label"],
otherProps
]);
const groupState = useCheckboxGroupState(checkboxGroupProps);
const {
labelProps,
groupProps,
descriptionProps,
errorMessageProps,
validationErrors,
validationDetails
} = useReactAriaCheckboxGroup(checkboxGroupProps, groupState);
const context = useMemo(
() => ({
size,
color,
radius,
lineThrough,
isInvalid: groupState.isInvalid,
isDisabled,
disableAnimation,
validationBehavior,
groupState
}),
[
size,
color,
radius,
lineThrough,
isDisabled,
disableAnimation,
validationBehavior,
groupState.value,
groupState.isDisabled,
groupState.isReadOnly,
groupState.isInvalid,
groupState.isSelected
]
);
const slots = useMemo(
() => checkboxGroup({ isRequired, isInvalid: groupState.isInvalid, disableAnimation }),
[isRequired, groupState.isInvalid, , disableAnimation]
);
const baseStyles = clsx(classNames == null ? void 0 : classNames.base, className);
const getGroupProps = useCallback(() => {
return {
ref: domRef,
className: slots.base({ class: baseStyles }),
...mergeProps(
groupProps,
filterDOMProps(otherProps, {
enabled: shouldFilterDOMProps
})
)
};
}, [slots, domRef, baseStyles, groupProps, otherProps]);
const getLabelProps = useCallback(() => {
return {
className: slots.label({ class: classNames == null ? void 0 : classNames.label }),
...labelProps
};
}, [slots, labelProps, classNames == null ? void 0 : classNames.label]);
const getWrapperProps = useCallback(() => {
return {
className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }),
role: "presentation",
"data-orientation": orientation
};
}, [slots, orientation, classNames == null ? void 0 : classNames.wrapper]);
const getDescriptionProps = useCallback(
(props2 = {}) => {
return {
...props2,
...descriptionProps,
className: slots.description({ class: clsx(classNames == null ? void 0 : classNames.description, props2 == null ? void 0 : props2.className) })
};
},
[slots, descriptionProps, classNames == null ? void 0 : classNames.description]
);
const getErrorMessageProps = useCallback(
(props2 = {}) => {
return {
...props2,
...errorMessageProps,
className: slots.errorMessage({ class: clsx(classNames == null ? void 0 : classNames.errorMessage, props2 == null ? void 0 : props2.className) })
};
},
[slots, errorMessageProps, classNames == null ? void 0 : classNames.errorMessage]
);
return {
Component,
children,
label,
context,
description,
isInvalid: groupState.isInvalid,
errorMessage: typeof errorMessage === "function" ? errorMessage({ isInvalid: groupState.isInvalid, validationErrors, validationDetails }) : errorMessage || (validationErrors == null ? void 0 : validationErrors.join(" ")),
getGroupProps,
getLabelProps,
getWrapperProps,
getDescriptionProps,
getErrorMessageProps
};
}
export {
useCheckboxGroup
};
@@ -0,0 +1,101 @@
import type {
DynamicMiddlewareInstance,
GetDispatch,
GetState,
MiddlewareApiConfig,
TSHelpersExtractDispatchExtensions,
} from '@reduxjs/toolkit'
import { createDynamicMiddleware as cDM } from '@reduxjs/toolkit'
import type { Context } from 'react'
import type { ReactReduxContextValue } from 'react-redux'
import {
createDispatchHook,
ReactReduxContext,
useDispatch as useDefaultDispatch,
} from 'react-redux'
import type { Action, Dispatch, Middleware, UnknownAction } from 'redux'
export type UseDispatchWithMiddlewareHook<
Middlewares extends Middleware<any, State, DispatchType>[] = [],
State = any,
DispatchType extends Dispatch<UnknownAction> = Dispatch<UnknownAction>,
> = () => TSHelpersExtractDispatchExtensions<Middlewares> & DispatchType
export type CreateDispatchWithMiddlewareHook<
State = any,
DispatchType extends Dispatch<UnknownAction> = Dispatch<UnknownAction>,
> = {
<
Middlewares extends [
Middleware<any, State, DispatchType>,
...Middleware<any, State, DispatchType>[],
],
>(
...middlewares: Middlewares
): UseDispatchWithMiddlewareHook<Middlewares, State, DispatchType>
withTypes<
MiddlewareConfig extends MiddlewareApiConfig,
>(): CreateDispatchWithMiddlewareHook<
GetState<MiddlewareConfig>,
GetDispatch<MiddlewareConfig>
>
}
type ActionFromDispatch<DispatchType extends Dispatch<Action>> =
DispatchType extends Dispatch<infer Action> ? Action : never
type ReactDynamicMiddlewareInstance<
State = any,
DispatchType extends Dispatch<UnknownAction> = Dispatch<UnknownAction>,
> = DynamicMiddlewareInstance<State, DispatchType> & {
createDispatchWithMiddlewareHookFactory: (
context?: Context<ReactReduxContextValue<
State,
ActionFromDispatch<DispatchType>
> | null>,
) => CreateDispatchWithMiddlewareHook<State, DispatchType>
createDispatchWithMiddlewareHook: CreateDispatchWithMiddlewareHook<
State,
DispatchType
>
}
export const createDynamicMiddleware = <
State = any,
DispatchType extends Dispatch<UnknownAction> = Dispatch<UnknownAction>,
>(): ReactDynamicMiddlewareInstance<State, DispatchType> => {
const instance = cDM<State, DispatchType>()
const createDispatchWithMiddlewareHookFactory = (
// @ts-ignore
context: Context<ReactReduxContextValue<
State,
ActionFromDispatch<DispatchType>
> | null> = ReactReduxContext,
) => {
const useDispatch =
context === ReactReduxContext
? useDefaultDispatch
: createDispatchHook(context)
function createDispatchWithMiddlewareHook<
Middlewares extends Middleware<any, State, DispatchType>[],
>(...middlewares: Middlewares) {
instance.addMiddleware(...middlewares)
return useDispatch
}
createDispatchWithMiddlewareHook.withTypes = () =>
createDispatchWithMiddlewareHook
return createDispatchWithMiddlewareHook as CreateDispatchWithMiddlewareHook<
State,
DispatchType
>
}
const createDispatchWithMiddlewareHook =
createDispatchWithMiddlewareHookFactory()
return {
...instance,
createDispatchWithMiddlewareHookFactory,
createDispatchWithMiddlewareHook,
}
}
@@ -0,0 +1,60 @@
/**
* @import {Encoding, Value} from 'micromark-util-types'
*/
/**
* @typedef {import('micromark-util-types').Options} Options
*/
import { compile } from './lib/compile.js';
import { parse } from './lib/parse.js';
import { postprocess } from './lib/postprocess.js';
import { preprocess } from './lib/preprocess.js';
export { compile } from './lib/compile.js';
export { parse } from './lib/parse.js';
export { postprocess } from './lib/postprocess.js';
export { preprocess } from './lib/preprocess.js';
/**
* Compile markdown to HTML.
*
* > Note: which encodings are supported depends on the engine.
* > For info on Node.js, see:
* > <https://nodejs.org/api/util.html#whatwg-supported-encodings>.
*
* @overload
* @param {Value} value
* Markdown to parse (`string` or `Uint8Array`).
* @param {Encoding | null | undefined} encoding
* Character encoding to understand `value` as when it’s a `Uint8Array`
* (`string`, default: `'utf8'`).
* @param {Options | null | undefined} [options]
* Configuration.
* @returns {string}
* Compiled HTML.
*
* @overload
* @param {Value} value
* Markdown to parse (`string` or `Uint8Array`).
* @param {Options | null | undefined} [options]
* Configuration.
* @returns {string}
* Compiled HTML.
*
* @param {Value} value
* Markdown to parse (`string` or `Uint8Array`).
* @param {Encoding | Options | null | undefined} [encoding]
* Character encoding to understand `value` as when it’s a `Uint8Array`
* (`string`, default: `'utf8'`).
* @param {Options | null | undefined} [options]
* Configuration.
* @returns {string}
* Compiled HTML.
*/
export function micromark(value, encoding, options) {
if (typeof encoding !== 'string') {
options = encoding;
encoding = undefined;
}
return compile(options)(postprocess(parse(options).document().write(preprocess()(value, encoding, true))));
}
@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertCertBufferToPEM = convertCertBufferToPEM;
const index_js_1 = require("./iso/index.js");
/**
* Convert buffer to an OpenSSL-compatible PEM text format.
*/
function convertCertBufferToPEM(certBuffer) {
let b64cert;
/**
* Get certBuffer to a base64 representation
*/
if (typeof certBuffer === 'string') {
if (index_js_1.isoBase64URL.isBase64URL(certBuffer)) {
b64cert = index_js_1.isoBase64URL.toBase64(certBuffer);
}
else if (index_js_1.isoBase64URL.isBase64(certBuffer)) {
b64cert = certBuffer;
}
else {
throw new Error('Certificate is not a valid base64 or base64url string');
}
}
else {
b64cert = index_js_1.isoBase64URL.fromBuffer(certBuffer, 'base64');
}
let PEMKey = '';
for (let i = 0; i < Math.ceil(b64cert.length / 64); i += 1) {
const start = 64 * i;
PEMKey += `${b64cert.substr(start, 64)}\n`;
}
PEMKey = `-----BEGIN CERTIFICATE-----\n${PEMKey}-----END CERTIFICATE-----\n`;
return PEMKey;
}
@@ -0,0 +1,286 @@
'use strict';
//parse Empty Node as self closing node
const buildFromOrderedJs = require('./orderedJs2Xml');
const getIgnoreAttributesFn = require('../ignoreAttributes')
const defaultOptions = {
attributeNamePrefix: '@_',
attributesGroupName: false,
textNodeName: '#text',
ignoreAttributes: true,
cdataPropName: false,
format: false,
indentBy: ' ',
suppressEmptyNode: false,
suppressUnpairedNode: true,
suppressBooleanAttributes: true,
tagValueProcessor: function(key, a) {
return a;
},
attributeValueProcessor: function(attrName, a) {
return a;
},
preserveOrder: false,
commentPropName: false,
unpairedTags: [],
entities: [
{ regex: new RegExp("&", "g"), val: "&amp;" },//it must be on top
{ regex: new RegExp(">", "g"), val: "&gt;" },
{ regex: new RegExp("<", "g"), val: "&lt;" },
{ regex: new RegExp("\'", "g"), val: "&apos;" },
{ regex: new RegExp("\"", "g"), val: "&quot;" }
],
processEntities: true,
stopNodes: [],
// transformTagName: false,
// transformAttributeName: false,
oneListGroup: false
};
function Builder(options) {
this.options = Object.assign({}, defaultOptions, options);
if (this.options.ignoreAttributes === true || this.options.attributesGroupName) {
this.isAttribute = function(/*a*/) {
return false;
};
} else {
this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes)
this.attrPrefixLen = this.options.attributeNamePrefix.length;
this.isAttribute = isAttribute;
}
this.processTextOrObjNode = processTextOrObjNode
if (this.options.format) {
this.indentate = indentate;
this.tagEndChar = '>\n';
this.newLine = '\n';
} else {
this.indentate = function() {
return '';
};
this.tagEndChar = '>';
this.newLine = '';
}
}
Builder.prototype.build = function(jObj) {
if(this.options.preserveOrder){
return buildFromOrderedJs(jObj, this.options);
}else {
if(Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1){
jObj = {
[this.options.arrayNodeName] : jObj
}
}
return this.j2x(jObj, 0, []).val;
}
};
Builder.prototype.j2x = function(jObj, level, ajPath) {
let attrStr = '';
let val = '';
const jPath = ajPath.join('.')
for (let key in jObj) {
if(!Object.prototype.hasOwnProperty.call(jObj, key)) continue;
if (typeof jObj[key] === 'undefined') {
// supress undefined node only if it is not an attribute
if (this.isAttribute(key)) {
val += '';
}
} else if (jObj[key] === null) {
// null attribute should be ignored by the attribute list, but should not cause the tag closing
if (this.isAttribute(key)) {
val += '';
} else if (key === this.options.cdataPropName) {
val += '';
} else if (key[0] === '?') {
val += this.indentate(level) + '<' + key + '?' + this.tagEndChar;
} else {
val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
}
// val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
} else if (jObj[key] instanceof Date) {
val += this.buildTextValNode(jObj[key], key, '', level);
} else if (typeof jObj[key] !== 'object') {
//premitive type
const attr = this.isAttribute(key);
if (attr && !this.ignoreAttributesFn(attr, jPath)) {
attrStr += this.buildAttrPairStr(attr, '' + jObj[key]);
} else if (!attr) {
//tag value
if (key === this.options.textNodeName) {
let newval = this.options.tagValueProcessor(key, '' + jObj[key]);
val += this.replaceEntitiesValue(newval);
} else {
val += this.buildTextValNode(jObj[key], key, '', level);
}
}
} else if (Array.isArray(jObj[key])) {
//repeated nodes
const arrLen = jObj[key].length;
let listTagVal = "";
let listTagAttr = "";
for (let j = 0; j < arrLen; j++) {
const item = jObj[key][j];
if (typeof item === 'undefined') {
// supress undefined node
} else if (item === null) {
if(key[0] === "?") val += this.indentate(level) + '<' + key + '?' + this.tagEndChar;
else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
// val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
} else if (typeof item === 'object') {
if(this.options.oneListGroup){
const result = this.j2x(item, level + 1, ajPath.concat(key));
listTagVal += result.val;
if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) {
listTagAttr += result.attrStr
}
}else{
listTagVal += this.processTextOrObjNode(item, key, level, ajPath)
}
} else {
if (this.options.oneListGroup) {
let textValue = this.options.tagValueProcessor(key, item);
textValue = this.replaceEntitiesValue(textValue);
listTagVal += textValue;
} else {
listTagVal += this.buildTextValNode(item, key, '', level);
}
}
}
if(this.options.oneListGroup){
listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level);
}
val += listTagVal;
} else {
//nested node
if (this.options.attributesGroupName && key === this.options.attributesGroupName) {
const Ks = Object.keys(jObj[key]);
const L = Ks.length;
for (let j = 0; j < L; j++) {
attrStr += this.buildAttrPairStr(Ks[j], '' + jObj[key][Ks[j]]);
}
} else {
val += this.processTextOrObjNode(jObj[key], key, level, ajPath)
}
}
}
return {attrStr: attrStr, val: val};
};
Builder.prototype.buildAttrPairStr = function(attrName, val){
val = this.options.attributeValueProcessor(attrName, '' + val);
val = this.replaceEntitiesValue(val);
if (this.options.suppressBooleanAttributes && val === "true") {
return ' ' + attrName;
} else return ' ' + attrName + '="' + val + '"';
}
function processTextOrObjNode (object, key, level, ajPath) {
const result = this.j2x(object, level + 1, ajPath.concat(key));
if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) {
return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level);
} else {
return this.buildObjectNode(result.val, key, result.attrStr, level);
}
}
Builder.prototype.buildObjectNode = function(val, key, attrStr, level) {
if(val === ""){
if(key[0] === "?") return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar;
else {
return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar;
}
}else{
let tagEndExp = '</' + key + this.tagEndChar;
let piClosingChar = "";
if(key[0] === "?") {
piClosingChar = "?";
tagEndExp = "";
}
// attrStr is an empty string in case the attribute came as undefined or null
if ((attrStr || attrStr === '') && val.indexOf('<') === -1) {
return ( this.indentate(level) + '<' + key + attrStr + piClosingChar + '>' + val + tagEndExp );
} else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) {
return this.indentate(level) + `<!--${val}-->` + this.newLine;
}else {
return (
this.indentate(level) + '<' + key + attrStr + piClosingChar + this.tagEndChar +
val +
this.indentate(level) + tagEndExp );
}
}
}
Builder.prototype.closeTag = function(key){
let closeTag = "";
if(this.options.unpairedTags.indexOf(key) !== -1){ //unpaired
if(!this.options.suppressUnpairedNode) closeTag = "/"
}else if(this.options.suppressEmptyNode){ //empty
closeTag = "/";
}else{
closeTag = `></${key}`
}
return closeTag;
}
function buildEmptyObjNode(val, key, attrStr, level) {
if (val !== '') {
return this.buildObjectNode(val, key, attrStr, level);
} else {
if(key[0] === "?") return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar;
else {
return this.indentate(level) + '<' + key + attrStr + '/' + this.tagEndChar;
// return this.buildTagStr(level,key, attrStr);
}
}
}
Builder.prototype.buildTextValNode = function(val, key, attrStr, level) {
if (this.options.cdataPropName !== false && key === this.options.cdataPropName) {
return this.indentate(level) + `<![CDATA[${val}]]>` + this.newLine;
}else if (this.options.commentPropName !== false && key === this.options.commentPropName) {
return this.indentate(level) + `<!--${val}-->` + this.newLine;
}else if(key[0] === "?") {//PI tag
return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar;
}else{
let textValue = this.options.tagValueProcessor(key, val);
textValue = this.replaceEntitiesValue(textValue);
if( textValue === ''){
return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar;
}else{
return this.indentate(level) + '<' + key + attrStr + '>' +
textValue +
'</' + key + this.tagEndChar;
}
}
}
Builder.prototype.replaceEntitiesValue = function(textValue){
if(textValue && textValue.length > 0 && this.options.processEntities){
for (let i=0; i<this.options.entities.length; i++) {
const entity = this.options.entities[i];
textValue = textValue.replace(entity.regex, entity.val);
}
}
return textValue;
}
function indentate(level) {
return this.options.indentBy.repeat(level);
}
function isAttribute(name /*, options*/) {
if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) {
return name.substr(this.attrPrefixLen);
} else {
return false;
}
}
module.exports = Builder;
@@ -0,0 +1,233 @@
'use strict';
var utils = require('../utils.js');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
const DEFAULTS = {
declaration: "parens",
assignment: "parens",
return: "parens",
arrow: "parens",
condition: "ignore",
logical: "ignore",
prop: "ignore",
propertyValue: "ignore"
};
const messages = {
missingParens: "Missing parentheses around multilines JSX",
parensOnNewLines: "Parentheses around JSX should be on separate lines"
};
var jsxWrapMultilines = utils.createRule({
name: "jsx-wrap-multilines",
package: "jsx",
meta: {
type: "layout",
docs: {
description: "Disallow missing parentheses around multiline JSX"
},
fixable: "code",
messages,
schema: [{
type: "object",
// true/false are for backwards compatibility
properties: {
declaration: {
type: ["string", "boolean"],
enum: [true, false, "ignore", "parens", "parens-new-line"]
},
assignment: {
type: ["string", "boolean"],
enum: [true, false, "ignore", "parens", "parens-new-line"]
},
return: {
type: ["string", "boolean"],
enum: [true, false, "ignore", "parens", "parens-new-line"]
},
arrow: {
type: ["string", "boolean"],
enum: [true, false, "ignore", "parens", "parens-new-line"]
},
condition: {
type: ["string", "boolean"],
enum: [true, false, "ignore", "parens", "parens-new-line"]
},
logical: {
type: ["string", "boolean"],
enum: [true, false, "ignore", "parens", "parens-new-line"]
},
prop: {
type: ["string", "boolean"],
enum: [true, false, "ignore", "parens", "parens-new-line"]
},
propertyValue: {
type: ["string", "boolean"],
enum: [true, false, "ignore", "parens", "parens-new-line"]
}
},
additionalProperties: false
}]
},
create(context) {
function getOption(type) {
const userOptions = context.options[0] || {};
if (type in userOptions)
return userOptions[type];
return DEFAULTS[type];
}
function isEnabled(type) {
const option = getOption(type);
return option && option !== "ignore";
}
function needsOpeningNewLine(node) {
const previousToken = context.sourceCode.getTokenBefore(node);
if (!utils.isParenthesized(node, context.sourceCode))
return false;
if (previousToken.loc.end.line === node.loc.start.line)
return true;
return false;
}
function needsClosingNewLine(node) {
const nextToken = context.sourceCode.getTokenAfter(node);
if (!utils.isParenthesized(node, context.sourceCode))
return false;
if (node.loc.end.line === nextToken.loc.end.line)
return true;
return false;
}
function isMultilines(node) {
return node.loc.start.line !== node.loc.end.line;
}
function trimTokenBeforeNewline(node, tokenBefore) {
const isBracket = tokenBefore.value === "{" || tokenBefore.value === "[";
return `${tokenBefore.value.trim()}${isBracket ? "" : " "}`;
}
function check(node, type) {
if (!node || !utils.isJSX(node))
return;
const sourceCode = context.sourceCode;
const option = getOption(type);
if ((option === true || option === "parens") && !utils.isParenthesized(node, context.sourceCode) && isMultilines(node)) {
context.report({
node,
messageId: "missingParens",
fix: (fixer) => fixer.replaceText(node, `(${sourceCode.getText(node)})`)
});
}
if (option === "parens-new-line" && isMultilines(node)) {
if (!utils.isParenthesized(node, context.sourceCode)) {
const tokenBefore = sourceCode.getTokenBefore(node, { includeComments: true });
const tokenAfter = sourceCode.getTokenAfter(node, { includeComments: true });
const start = node.loc.start;
if (tokenBefore.loc.end.line < start.line) {
context.report({
node,
messageId: "missingParens",
fix: (fixer) => fixer.replaceTextRange(
[
tokenBefore.range[0],
tokenAfter && (tokenAfter.value === ";" || tokenAfter.value === "}") ? tokenAfter.range[0] : node.range[1]
],
`${trimTokenBeforeNewline(node, tokenBefore)}(
${start.column > 0 ? " ".repeat(start.column) : ""}${sourceCode.getText(node)}
${start.column > 0 ? " ".repeat(start.column - 2) : ""})`
)
});
} else {
context.report({
node,
messageId: "missingParens",
fix: (fixer) => fixer.replaceText(node, `(
${sourceCode.getText(node)}
)`)
});
}
} else {
const needsOpening = needsOpeningNewLine(node);
const needsClosing = needsClosingNewLine(node);
if (needsOpening || needsClosing) {
context.report({
node,
messageId: "parensOnNewLines",
fix: (fixer) => {
const text = sourceCode.getText(node);
let fixed = text;
if (needsOpening)
fixed = `
${fixed}`;
if (needsClosing)
fixed = `${fixed}
`;
return fixer.replaceText(node, fixed);
}
});
}
}
}
}
return {
VariableDeclarator(node) {
const type = "declaration";
if (!isEnabled(type))
return;
if (!isEnabled("condition") && node.init && node.init.type === "ConditionalExpression") {
check(node.init.consequent, type);
check(node.init.alternate, type);
return;
}
check(node.init, type);
},
AssignmentExpression(node) {
const type = "assignment";
if (!isEnabled(type))
return;
if (!isEnabled("condition") && node.right.type === "ConditionalExpression") {
check(node.right.consequent, type);
check(node.right.alternate, type);
return;
}
check(node.right, type);
},
ReturnStatement(node) {
const type = "return";
if (isEnabled(type))
check(node.argument, type);
},
"ArrowFunctionExpression:exit": (node) => {
const arrowBody = node.body;
const type = "arrow";
if (isEnabled(type) && arrowBody.type !== "BlockStatement")
check(arrowBody, type);
},
ConditionalExpression(node) {
const type = "condition";
if (isEnabled(type)) {
check(node.consequent, type);
check(node.alternate, type);
}
},
LogicalExpression(node) {
const type = "logical";
if (isEnabled(type))
check(node.right, type);
},
JSXAttribute(node) {
const type = "prop";
if (isEnabled(type) && node.value && node.value.type === "JSXExpressionContainer")
check(node.value.expression, type);
},
ObjectExpression(node) {
const type = "propertyValue";
if (isEnabled(type)) {
node.properties.forEach((property) => {
if (property.type === "Property" && property.value.type === "JSXElement")
check(property.value, type);
});
}
}
};
}
});
module.exports = jsxWrapMultilines;
@@ -0,0 +1,225 @@
var $5935ba4d7da2c103$exports = require("./calculatePosition.main.js");
var $9a8aa1b0b336ea3a$exports = require("./useCloseOnScroll.main.js");
var $6TXnl$react = require("react");
var $6TXnl$reactariautils = require("@react-aria/utils");
var $6TXnl$reactariai18n = require("@react-aria/i18n");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useOverlayPosition", () => $cd94b4896dd97759$export$d39e1813b3bdd0e1);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
let $cd94b4896dd97759$var$visualViewport = typeof document !== 'undefined' ? window.visualViewport : null;
function $cd94b4896dd97759$export$d39e1813b3bdd0e1(props) {
let { direction: direction } = (0, $6TXnl$reactariai18n.useLocale)();
let { arrowSize: arrowSize, targetRef: targetRef, overlayRef: overlayRef, arrowRef: arrowRef, scrollRef: scrollRef = overlayRef, placement: placement = 'bottom', containerPadding: containerPadding = 12, shouldFlip: shouldFlip = true, boundaryElement: boundaryElement = typeof document !== 'undefined' ? document.body : null, offset: offset = 0, crossOffset: crossOffset = 0, shouldUpdatePosition: shouldUpdatePosition = true, isOpen: isOpen = true, onClose: onClose, maxHeight: maxHeight, arrowBoundaryOffset: arrowBoundaryOffset = 0 } = props;
let [position, setPosition] = (0, $6TXnl$react.useState)(null);
let deps = [
shouldUpdatePosition,
placement,
overlayRef.current,
targetRef.current,
arrowRef === null || arrowRef === void 0 ? void 0 : arrowRef.current,
scrollRef.current,
containerPadding,
shouldFlip,
boundaryElement,
offset,
crossOffset,
isOpen,
direction,
maxHeight,
arrowBoundaryOffset,
arrowSize
];
// Note, the position freezing breaks if body sizes itself dynamicly with the visual viewport but that might
// just be a non-realistic use case
// Upon opening a overlay, record the current visual viewport scale so we can freeze the overlay styles
let lastScale = (0, $6TXnl$react.useRef)($cd94b4896dd97759$var$visualViewport === null || $cd94b4896dd97759$var$visualViewport === void 0 ? void 0 : $cd94b4896dd97759$var$visualViewport.scale);
(0, $6TXnl$react.useEffect)(()=>{
if (isOpen) lastScale.current = $cd94b4896dd97759$var$visualViewport === null || $cd94b4896dd97759$var$visualViewport === void 0 ? void 0 : $cd94b4896dd97759$var$visualViewport.scale;
}, [
isOpen
]);
let updatePosition = (0, $6TXnl$react.useCallback)(()=>{
if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !boundaryElement) return;
if (($cd94b4896dd97759$var$visualViewport === null || $cd94b4896dd97759$var$visualViewport === void 0 ? void 0 : $cd94b4896dd97759$var$visualViewport.scale) !== lastScale.current) return;
// Determine a scroll anchor based on the focused element.
// This stores the offset of the anchor element from the scroll container
// so it can be restored after repositioning. This way if the overlay height
// changes, the focused element appears to stay in the same position.
let anchor = null;
if (scrollRef.current && scrollRef.current.contains(document.activeElement)) {
var _document_activeElement;
let anchorRect = (_document_activeElement = document.activeElement) === null || _document_activeElement === void 0 ? void 0 : _document_activeElement.getBoundingClientRect();
let scrollRect = scrollRef.current.getBoundingClientRect();
var _anchorRect_top;
// Anchor from the top if the offset is in the top half of the scrollable element,
// otherwise anchor from the bottom.
anchor = {
type: 'top',
offset: ((_anchorRect_top = anchorRect === null || anchorRect === void 0 ? void 0 : anchorRect.top) !== null && _anchorRect_top !== void 0 ? _anchorRect_top : 0) - scrollRect.top
};
if (anchor.offset > scrollRect.height / 2) {
anchor.type = 'bottom';
var _anchorRect_bottom;
anchor.offset = ((_anchorRect_bottom = anchorRect === null || anchorRect === void 0 ? void 0 : anchorRect.bottom) !== null && _anchorRect_bottom !== void 0 ? _anchorRect_bottom : 0) - scrollRect.bottom;
}
}
// Always reset the overlay's previous max height if not defined by the user so that we can compensate for
// RAC collections populating after a second render and properly set a correct max height + positioning when it populates.
let overlay = overlayRef.current;
if (!maxHeight && overlayRef.current) {
var _window_visualViewport;
overlay.style.top = '0px';
overlay.style.bottom = '';
var _window_visualViewport_height;
overlay.style.maxHeight = ((_window_visualViewport_height = (_window_visualViewport = window.visualViewport) === null || _window_visualViewport === void 0 ? void 0 : _window_visualViewport.height) !== null && _window_visualViewport_height !== void 0 ? _window_visualViewport_height : window.innerHeight) + 'px';
}
let position = (0, $5935ba4d7da2c103$exports.calculatePosition)({
placement: $cd94b4896dd97759$var$translateRTL(placement, direction),
overlayNode: overlayRef.current,
targetNode: targetRef.current,
scrollNode: scrollRef.current || overlayRef.current,
padding: containerPadding,
shouldFlip: shouldFlip,
boundaryElement: boundaryElement,
offset: offset,
crossOffset: crossOffset,
maxHeight: maxHeight,
arrowSize: arrowSize !== null && arrowSize !== void 0 ? arrowSize : (arrowRef === null || arrowRef === void 0 ? void 0 : arrowRef.current) ? (0, $5935ba4d7da2c103$exports.getRect)(arrowRef.current, true).width : 0,
arrowBoundaryOffset: arrowBoundaryOffset
});
if (!position.position) return;
// Modify overlay styles directly so positioning happens immediately without the need of a second render
// This is so we don't have to delay autoFocus scrolling or delay applying preventScroll for popovers
overlay.style.top = '';
overlay.style.bottom = '';
overlay.style.left = '';
overlay.style.right = '';
Object.keys(position.position).forEach((key)=>overlay.style[key] = position.position[key] + 'px');
overlay.style.maxHeight = position.maxHeight != null ? position.maxHeight + 'px' : '';
// Restore scroll position relative to anchor element.
if (anchor && document.activeElement && scrollRef.current) {
let anchorRect = document.activeElement.getBoundingClientRect();
let scrollRect = scrollRef.current.getBoundingClientRect();
let newOffset = anchorRect[anchor.type] - scrollRect[anchor.type];
scrollRef.current.scrollTop += newOffset - anchor.offset;
}
// Trigger a set state for a second render anyway for arrow positioning
setPosition(position);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, deps);
// Update position when anything changes
// eslint-disable-next-line react-hooks/exhaustive-deps
(0, $6TXnl$reactariautils.useLayoutEffect)(updatePosition, deps);
// Update position on window resize
$cd94b4896dd97759$var$useResize(updatePosition);
// Update position when the overlay changes size (might need to flip).
(0, $6TXnl$reactariautils.useResizeObserver)({
ref: overlayRef,
onResize: updatePosition
});
// Update position when the target changes size (might need to flip).
(0, $6TXnl$reactariautils.useResizeObserver)({
ref: targetRef,
onResize: updatePosition
});
// Reposition the overlay and do not close on scroll while the visual viewport is resizing.
// This will ensure that overlays adjust their positioning when the iOS virtual keyboard appears.
let isResizing = (0, $6TXnl$react.useRef)(false);
(0, $6TXnl$reactariautils.useLayoutEffect)(()=>{
let timeout;
let onResize = ()=>{
isResizing.current = true;
clearTimeout(timeout);
timeout = setTimeout(()=>{
isResizing.current = false;
}, 500);
updatePosition();
};
// Only reposition the overlay if a scroll event happens immediately as a result of resize (aka the virtual keyboard has appears)
// We don't want to reposition the overlay if the user has pinch zoomed in and is scrolling the viewport around.
let onScroll = ()=>{
if (isResizing.current) onResize();
};
$cd94b4896dd97759$var$visualViewport === null || $cd94b4896dd97759$var$visualViewport === void 0 ? void 0 : $cd94b4896dd97759$var$visualViewport.addEventListener('resize', onResize);
$cd94b4896dd97759$var$visualViewport === null || $cd94b4896dd97759$var$visualViewport === void 0 ? void 0 : $cd94b4896dd97759$var$visualViewport.addEventListener('scroll', onScroll);
return ()=>{
$cd94b4896dd97759$var$visualViewport === null || $cd94b4896dd97759$var$visualViewport === void 0 ? void 0 : $cd94b4896dd97759$var$visualViewport.removeEventListener('resize', onResize);
$cd94b4896dd97759$var$visualViewport === null || $cd94b4896dd97759$var$visualViewport === void 0 ? void 0 : $cd94b4896dd97759$var$visualViewport.removeEventListener('scroll', onScroll);
};
}, [
updatePosition
]);
let close = (0, $6TXnl$react.useCallback)(()=>{
if (!isResizing.current) onClose === null || onClose === void 0 ? void 0 : onClose();
}, [
onClose,
isResizing
]);
// When scrolling a parent scrollable region of the trigger (other than the body),
// we hide the popover. Otherwise, its position would be incorrect.
(0, $9a8aa1b0b336ea3a$exports.useCloseOnScroll)({
triggerRef: targetRef,
isOpen: isOpen,
onClose: onClose && close
});
var _position_maxHeight, _position_placement, _position_triggerAnchorPoint;
return {
overlayProps: {
style: {
position: position ? 'absolute' : 'fixed',
top: !position ? 0 : undefined,
left: !position ? 0 : undefined,
zIndex: 100000,
...position === null || position === void 0 ? void 0 : position.position,
maxHeight: (_position_maxHeight = position === null || position === void 0 ? void 0 : position.maxHeight) !== null && _position_maxHeight !== void 0 ? _position_maxHeight : '100vh'
}
},
placement: (_position_placement = position === null || position === void 0 ? void 0 : position.placement) !== null && _position_placement !== void 0 ? _position_placement : null,
triggerAnchorPoint: (_position_triggerAnchorPoint = position === null || position === void 0 ? void 0 : position.triggerAnchorPoint) !== null && _position_triggerAnchorPoint !== void 0 ? _position_triggerAnchorPoint : null,
arrowProps: {
'aria-hidden': 'true',
role: 'presentation',
style: {
left: position === null || position === void 0 ? void 0 : position.arrowOffsetLeft,
top: position === null || position === void 0 ? void 0 : position.arrowOffsetTop
}
},
updatePosition: updatePosition
};
}
function $cd94b4896dd97759$var$useResize(onResize) {
(0, $6TXnl$reactariautils.useLayoutEffect)(()=>{
window.addEventListener('resize', onResize, false);
return ()=>{
window.removeEventListener('resize', onResize, false);
};
}, [
onResize
]);
}
function $cd94b4896dd97759$var$translateRTL(position, direction) {
if (direction === 'rtl') return position.replace('start', 'right').replace('end', 'left');
return position.replace('start', 'left').replace('end', 'right');
}
//# sourceMappingURL=useOverlayPosition.main.js.map
@@ -0,0 +1,29 @@
import _extends from '@babel/runtime/helpers/esm/extends';
import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';
import * as React from 'react';
import useComposedRef from 'use-composed-ref';
var noop = function noop() {};
var _excluded = ["cacheMeasurements", "maxRows", "minRows", "onChange", "onHeightChange"];
var TextareaAutosize = function TextareaAutosize(_ref, userRef) {
_ref.cacheMeasurements;
_ref.maxRows;
_ref.minRows;
var _ref$onChange = _ref.onChange,
onChange = _ref$onChange === void 0 ? noop : _ref$onChange;
_ref.onHeightChange;
var props = _objectWithoutPropertiesLoose(_ref, _excluded);
props.value !== undefined;
var libRef = React.useRef(null);
var ref = useComposedRef(libRef, userRef);
React.useRef(0);
React.useRef();
return /*#__PURE__*/React.createElement("textarea", _extends({}, props, {
onChange: onChange,
ref: ref
}));
};
var index = /* #__PURE__ */React.forwardRef(TextareaAutosize);
export { index as default };
@@ -0,0 +1,19 @@
Copyright (C) 2012-2014 by various contributors (see AUTHORS)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,5 @@
[
"esnext.promise.all-settled",
"esnext.string.match-all",
"esnext.global-this"
]
@@ -0,0 +1,38 @@
export {}; // Make this a module
declare global {
namespace NodeJS {
type TypedArray<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> =
| Uint8Array<TArrayBuffer>
| Uint8ClampedArray<TArrayBuffer>
| Uint16Array<TArrayBuffer>
| Uint32Array<TArrayBuffer>
| Int8Array<TArrayBuffer>
| Int16Array<TArrayBuffer>
| Int32Array<TArrayBuffer>
| BigUint64Array<TArrayBuffer>
| BigInt64Array<TArrayBuffer>
| Float32Array<TArrayBuffer>
| Float64Array<TArrayBuffer>;
type ArrayBufferView<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> =
| TypedArray<TArrayBuffer>
| DataView<TArrayBuffer>;
// The following aliases are required to allow use of non-shared ArrayBufferViews in @types/node
// while maintaining compatibility with TS <=5.6.
type NonSharedUint8Array = Uint8Array<ArrayBuffer>;
type NonSharedUint8ClampedArray = Uint8ClampedArray<ArrayBuffer>;
type NonSharedUint16Array = Uint16Array<ArrayBuffer>;
type NonSharedUint32Array = Uint32Array<ArrayBuffer>;
type NonSharedInt8Array = Int8Array<ArrayBuffer>;
type NonSharedInt16Array = Int16Array<ArrayBuffer>;
type NonSharedInt32Array = Int32Array<ArrayBuffer>;
type NonSharedBigUint64Array = BigUint64Array<ArrayBuffer>;
type NonSharedBigInt64Array = BigInt64Array<ArrayBuffer>;
type NonSharedFloat32Array = Float32Array<ArrayBuffer>;
type NonSharedFloat64Array = Float64Array<ArrayBuffer>;
type NonSharedDataView = DataView<ArrayBuffer>;
type NonSharedTypedArray = TypedArray<ArrayBuffer>;
type NonSharedArrayBufferView = ArrayBufferView<ArrayBuffer>;
}
}
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016 Jordan Harband
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,335 @@
'use strict';
module.exports = function generate_properties(it, $keyword, $ruleType) {
var out = ' ';
var $lvl = it.level;
var $dataLvl = it.dataLevel;
var $schema = it.schema[$keyword];
var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $data = 'data' + ($dataLvl || '');
var $errs = 'errs__' + $lvl;
var $it = it.util.copy(it);
var $closingBraces = '';
$it.level++;
var $nextValid = 'valid' + $it.level;
var $key = 'key' + $lvl,
$idx = 'idx' + $lvl,
$dataNxt = $it.dataLevel = it.dataLevel + 1,
$nextData = 'data' + $dataNxt,
$dataProperties = 'dataProperties' + $lvl;
var $schemaKeys = Object.keys($schema || {}).filter(notProto),
$pProperties = it.schema.patternProperties || {},
$pPropertyKeys = Object.keys($pProperties).filter(notProto),
$aProperties = it.schema.additionalProperties,
$someProperties = $schemaKeys.length || $pPropertyKeys.length,
$noAdditional = $aProperties === false,
$additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length,
$removeAdditional = it.opts.removeAdditional,
$checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional,
$ownProperties = it.opts.ownProperties,
$currentBaseId = it.baseId;
var $required = it.schema.required;
if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) {
var $requiredHash = it.util.toHash($required);
}
function notProto(p) {
return p !== '__proto__';
}
out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;';
if ($ownProperties) {
out += ' var ' + ($dataProperties) + ' = undefined;';
}
if ($checkAdditional) {
if ($ownProperties) {
out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
} else {
out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
}
if ($someProperties) {
out += ' var isAdditional' + ($lvl) + ' = !(false ';
if ($schemaKeys.length) {
if ($schemaKeys.length > 8) {
out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') ';
} else {
var arr1 = $schemaKeys;
if (arr1) {
var $propertyKey, i1 = -1,
l1 = arr1.length - 1;
while (i1 < l1) {
$propertyKey = arr1[i1 += 1];
out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' ';
}
}
}
}
if ($pPropertyKeys.length) {
var arr2 = $pPropertyKeys;
if (arr2) {
var $pProperty, $i = -1,
l2 = arr2.length - 1;
while ($i < l2) {
$pProperty = arr2[$i += 1];
out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') ';
}
}
}
out += ' ); if (isAdditional' + ($lvl) + ') { ';
}
if ($removeAdditional == 'all') {
out += ' delete ' + ($data) + '[' + ($key) + ']; ';
} else {
var $currentErrorPath = it.errorPath;
var $additionalProperty = '\' + ' + $key + ' + \'';
if (it.opts._errorDataPathProperty) {
it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
}
if ($noAdditional) {
if ($removeAdditional) {
out += ' delete ' + ($data) + '[' + ($key) + ']; ';
} else {
out += ' ' + ($nextValid) + ' = false; ';
var $currErrSchemaPath = $errSchemaPath;
$errSchemaPath = it.errSchemaPath + '/additionalProperties';
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = ''; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } ';
if (it.opts.messages !== false) {
out += ' , message: \'';
if (it.opts._errorDataPathProperty) {
out += 'is an invalid additional property';
} else {
out += 'should NOT have additional properties';
}
out += '\' ';
}
if (it.opts.verbose) {
out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
var __err = out;
out = $$outStack.pop();
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError([' + (__err) + ']); ';
} else {
out += ' validate.errors = [' + (__err) + ']; return false; ';
}
} else {
out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
}
$errSchemaPath = $currErrSchemaPath;
if ($breakOnError) {
out += ' break; ';
}
}
} else if ($additionalIsSchema) {
if ($removeAdditional == 'failing') {
out += ' var ' + ($errs) + ' = errors; ';
var $wasComposite = it.compositeRule;
it.compositeRule = $it.compositeRule = true;
$it.schema = $aProperties;
$it.schemaPath = it.schemaPath + '.additionalProperties';
$it.errSchemaPath = it.errSchemaPath + '/additionalProperties';
$it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
var $passData = $data + '[' + $key + ']';
$it.dataPathArr[$dataNxt] = $key;
var $code = it.validate($it);
$it.baseId = $currentBaseId;
if (it.util.varOccurences($code, $nextData) < 2) {
out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
} else {
out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
}
out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } ';
it.compositeRule = $it.compositeRule = $wasComposite;
} else {
$it.schema = $aProperties;
$it.schemaPath = it.schemaPath + '.additionalProperties';
$it.errSchemaPath = it.errSchemaPath + '/additionalProperties';
$it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
var $passData = $data + '[' + $key + ']';
$it.dataPathArr[$dataNxt] = $key;
var $code = it.validate($it);
$it.baseId = $currentBaseId;
if (it.util.varOccurences($code, $nextData) < 2) {
out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
} else {
out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
}
if ($breakOnError) {
out += ' if (!' + ($nextValid) + ') break; ';
}
}
}
it.errorPath = $currentErrorPath;
}
if ($someProperties) {
out += ' } ';
}
out += ' } ';
if ($breakOnError) {
out += ' if (' + ($nextValid) + ') { ';
$closingBraces += '}';
}
}
var $useDefaults = it.opts.useDefaults && !it.compositeRule;
if ($schemaKeys.length) {
var arr3 = $schemaKeys;
if (arr3) {
var $propertyKey, i3 = -1,
l3 = arr3.length - 1;
while (i3 < l3) {
$propertyKey = arr3[i3 += 1];
var $sch = $schema[$propertyKey];
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
var $prop = it.util.getProperty($propertyKey),
$passData = $data + $prop,
$hasDefault = $useDefaults && $sch.default !== undefined;
$it.schema = $sch;
$it.schemaPath = $schemaPath + $prop;
$it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey);
$it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers);
$it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey);
var $code = it.validate($it);
$it.baseId = $currentBaseId;
if (it.util.varOccurences($code, $nextData) < 2) {
$code = it.util.varReplace($code, $nextData, $passData);
var $useData = $passData;
} else {
var $useData = $nextData;
out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ';
}
if ($hasDefault) {
out += ' ' + ($code) + ' ';
} else {
if ($requiredHash && $requiredHash[$propertyKey]) {
out += ' if ( ' + ($useData) + ' === undefined ';
if ($ownProperties) {
out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
}
out += ') { ' + ($nextValid) + ' = false; ';
var $currentErrorPath = it.errorPath,
$currErrSchemaPath = $errSchemaPath,
$missingProperty = it.util.escapeQuotes($propertyKey);
if (it.opts._errorDataPathProperty) {
it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
}
$errSchemaPath = it.errSchemaPath + '/required';
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = ''; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
if (it.opts.messages !== false) {
out += ' , message: \'';
if (it.opts._errorDataPathProperty) {
out += 'is a required property';
} else {
out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
}
out += '\' ';
}
if (it.opts.verbose) {
out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
var __err = out;
out = $$outStack.pop();
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError([' + (__err) + ']); ';
} else {
out += ' validate.errors = [' + (__err) + ']; return false; ';
}
} else {
out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
}
$errSchemaPath = $currErrSchemaPath;
it.errorPath = $currentErrorPath;
out += ' } else { ';
} else {
if ($breakOnError) {
out += ' if ( ' + ($useData) + ' === undefined ';
if ($ownProperties) {
out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
}
out += ') { ' + ($nextValid) + ' = true; } else { ';
} else {
out += ' if (' + ($useData) + ' !== undefined ';
if ($ownProperties) {
out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
}
out += ' ) { ';
}
}
out += ' ' + ($code) + ' } ';
}
}
if ($breakOnError) {
out += ' if (' + ($nextValid) + ') { ';
$closingBraces += '}';
}
}
}
}
if ($pPropertyKeys.length) {
var arr4 = $pPropertyKeys;
if (arr4) {
var $pProperty, i4 = -1,
l4 = arr4.length - 1;
while (i4 < l4) {
$pProperty = arr4[i4 += 1];
var $sch = $pProperties[$pProperty];
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
$it.schema = $sch;
$it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty);
$it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty);
if ($ownProperties) {
out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
} else {
out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
}
out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { ';
$it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
var $passData = $data + '[' + $key + ']';
$it.dataPathArr[$dataNxt] = $key;
var $code = it.validate($it);
$it.baseId = $currentBaseId;
if (it.util.varOccurences($code, $nextData) < 2) {
out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
} else {
out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
}
if ($breakOnError) {
out += ' if (!' + ($nextValid) + ') break; ';
}
out += ' } ';
if ($breakOnError) {
out += ' else ' + ($nextValid) + ' = true; ';
}
out += ' } ';
if ($breakOnError) {
out += ' if (' + ($nextValid) + ') { ';
$closingBraces += '}';
}
}
}
}
}
if ($breakOnError) {
out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
}
return out;
}
@@ -0,0 +1,81 @@
/**
* @fileoverview Prevent multiple component definition per file
* @author Yannick Croissant
*/
'use strict';
const values = require('object.values');
const Components = require('../util/Components');
const docsUrl = require('../util/docsUrl');
const report = require('../util/report');
// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------
const messages = {
onlyOneComponent: 'Declare only one React component per file',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Disallow multiple component definition per file',
category: 'Stylistic Issues',
recommended: false,
url: docsUrl('no-multi-comp'),
},
messages,
schema: [{
type: 'object',
properties: {
ignoreStateless: {
default: false,
type: 'boolean',
},
},
additionalProperties: false,
}],
},
create: Components.detect((context, components, utils) => {
const configuration = context.options[0] || {};
const ignoreStateless = configuration.ignoreStateless || false;
/**
* Checks if the component is ignored
* @param {Object} component The component being checked.
* @returns {boolean} True if the component is ignored, false if not.
*/
function isIgnored(component) {
return (
ignoreStateless && (
/Function/.test(component.node.type)
|| utils.isPragmaComponentWrapper(component.node)
)
);
}
return {
'Program:exit'() {
if (components.length() <= 1) {
return;
}
values(components.list())
.filter((component) => !isIgnored(component))
.slice(1)
.forEach((component) => {
report(context, messages.onlyOneComponent, 'onlyOneComponent', {
node: component.node,
});
});
},
};
}),
};
@@ -0,0 +1,44 @@
/**
* @template {unknown[]|(readonly unknown[])} T
* @param {T} input
* @returns {Exclude<T[number], undefined>[]}
*/
export function filter (input) {
/** @type {Exclude<T[number], undefined>[]} */
const result = [];
for (const item of input) {
if (item !== undefined) {
result.push(/** @type {Exclude<T[number], undefined>} */ (item));
}
}
return result;
}
// TODO [engine:node@>=21.0.0]: You can use the built in Object.groupBy() instead
/**
* Ponyfill for Object.groupBy
*
* @template T
* @template {string | number | symbol} K
* @param {Iterable<T>} iterable
* @param {function(T, number): K} callback
* @returns {Partial<Record<K, T[]>>}
*/
export function groupBy (iterable, callback) {
/** @type {Partial<Record<K, T[]>>} */
const obj = {};
let i = 0;
for (const value of iterable) {
const key = callback(value, i++);
const existingGroup = obj[key];
if (existingGroup) {
existingGroup.push(value);
} else {
obj[key] = [value];
}
}
return obj;
}
@@ -0,0 +1,54 @@
# dunder-proto <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
If available, the `Object.prototype.__proto__` accessor and mutator, call-bound.
## Getting started
```sh
npm install --save dunder-proto
```
## Usage/Examples
```js
const assert = require('assert');
const getDunder = require('dunder-proto/get');
const setDunder = require('dunder-proto/set');
const obj = {};
assert.equal('toString' in obj, true);
assert.equal(getDunder(obj), Object.prototype);
setDunder(obj, null);
assert.equal('toString' in obj, false);
assert.equal(getDunder(obj), null);
```
## Tests
Clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/dunder-proto
[npm-version-svg]: https://versionbadg.es/es-shims/dunder-proto.svg
[deps-svg]: https://david-dm.org/es-shims/dunder-proto.svg
[deps-url]: https://david-dm.org/es-shims/dunder-proto
[dev-deps-svg]: https://david-dm.org/es-shims/dunder-proto/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/dunder-proto#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/dunder-proto.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/dunder-proto.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/dunder-proto.svg
[downloads-url]: https://npm-stat.com/charts.html?package=dunder-proto
[codecov-image]: https://codecov.io/gh/es-shims/dunder-proto/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/es-shims/dunder-proto/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/dunder-proto
[actions-url]: https://github.com/es-shims/dunder-proto/actions
@@ -0,0 +1,30 @@
/*
* 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.
*/
/** Returns whether two sets are equal. */
export function isSetEqual<T>(a: Set<T>, b: Set<T>): boolean {
if (a === b) {
return true;
}
if (a.size !== b.size) {
return false;
}
for (let key of a) {
if (!b.has(key)) {
return false;
}
}
return true;
}
@@ -0,0 +1,8 @@
// src/dimensions.ts
var getMargin = (num) => {
return `calc(${num * 15.25}pt + 1px * ${num - 1})`;
};
export {
getMargin
};
@@ -0,0 +1,36 @@
import type { SchemaOptions, TSchema } from '../schema/index';
import type { TupleToUnion, Evaluate, Ensure } from '../helpers/index';
import { type TRecursive } from '../recursive/index';
import type { TMappedKey, TMappedResult } from '../mapped/index';
import { TComputed } from '../computed/index';
import { TLiteral, TLiteralValue } from '../literal/index';
import { type TIndexPropertyKeys } from '../indexed/index';
import { type TIntersect } from '../intersect/index';
import { type TUnion } from '../union/index';
import { type TObject, type TProperties } from '../object/index';
import { type TRef } from '../ref/index';
import { type TOmitFromMappedKey } from './omit-from-mapped-key';
import { type TOmitFromMappedResult } from './omit-from-mapped-result';
type TFromIntersect<Types extends TSchema[], PropertyKeys extends PropertyKey[], Result extends TSchema[] = []> = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromIntersect<R, PropertyKeys, [...Result, TOmit<L, PropertyKeys>]> : Result);
type TFromUnion<T extends TSchema[], K extends PropertyKey[], Result extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromUnion<R, K, [...Result, TOmit<L, K>]> : Result);
type TFromProperties<Properties extends TProperties, PropertyKeys extends PropertyKey[], UnionKey extends PropertyKey = TupleToUnion<PropertyKeys>> = (Evaluate<Omit<Properties, UnionKey>>);
type TFromObject<Type extends TObject, PropertyKeys extends PropertyKey[], Properties extends TProperties = Type['properties']> = Ensure<TObject<(TFromProperties<Properties, PropertyKeys>)>>;
type TUnionFromPropertyKeys<PropertyKeys extends PropertyKey[], Result extends TLiteral[] = []> = (PropertyKeys extends [infer Key extends PropertyKey, ...infer Rest extends PropertyKey[]] ? Key extends TLiteralValue ? TUnionFromPropertyKeys<Rest, [...Result, TLiteral<Key>]> : TUnionFromPropertyKeys<Rest, [...Result]> : TUnion<Result>);
export type TOmitResolve<Properties extends TProperties, PropertyKeys extends PropertyKey[]> = (Properties extends TRecursive<infer Types extends TSchema> ? TRecursive<TOmitResolve<Types, PropertyKeys>> : Properties extends TIntersect<infer Types extends TSchema[]> ? TIntersect<TFromIntersect<Types, PropertyKeys>> : Properties extends TUnion<infer Types extends TSchema[]> ? TUnion<TFromUnion<Types, PropertyKeys>> : Properties extends TObject<infer Types extends TProperties> ? TFromObject<TObject<Types>, PropertyKeys> : TObject<{}>);
type TResolvePropertyKeys<Key extends TSchema | PropertyKey[]> = Key extends TSchema ? TIndexPropertyKeys<Key> : Key;
type TResolveTypeKey<Key extends TSchema | PropertyKey[]> = Key extends PropertyKey[] ? TUnionFromPropertyKeys<Key> : Key;
export type TOmit<Type extends TSchema, Key extends TSchema | PropertyKey[], IsTypeRef extends boolean = Type extends TRef ? true : false, IsKeyRef extends boolean = Key extends TRef ? true : false> = (Type extends TMappedResult ? TOmitFromMappedResult<Type, TResolvePropertyKeys<Key>> : Key extends TMappedKey ? TOmitFromMappedKey<Type, Key> : [
IsTypeRef,
IsKeyRef
] extends [true, true] ? TComputed<'Omit', [Type, TResolveTypeKey<Key>]> : [
IsTypeRef,
IsKeyRef
] extends [false, true] ? TComputed<'Omit', [Type, TResolveTypeKey<Key>]> : [
IsTypeRef,
IsKeyRef
] extends [true, false] ? TComputed<'Omit', [Type, TResolveTypeKey<Key>]> : TOmitResolve<Type, TResolvePropertyKeys<Key>>);
/** `[Json]` Constructs a type whose keys are picked from the given type */
export declare function Omit<Type extends TSchema, Key extends PropertyKey[]>(type: Type, key: readonly [...Key], options?: SchemaOptions): TOmit<Type, Key>;
/** `[Json]` Constructs a type whose keys are picked from the given type */
export declare function Omit<Type extends TSchema, Key extends TSchema>(type: Type, key: Key, options?: SchemaOptions): TOmit<Type, Key>;
export {};
@@ -0,0 +1,97 @@
/*
* 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 {Collection, CollectionStateBase, DisabledBehavior, Expandable, Key, MultipleSelection, Node} from '@react-types/shared';
import {SelectionManager, useMultipleSelectionState} from '@react-stately/selection';
import {TreeCollection} from './TreeCollection';
import {useCallback, useEffect, useMemo} from 'react';
import {useCollection} from '@react-stately/collections';
import {useControlledState} from '@react-stately/utils';
export interface TreeProps<T> extends CollectionStateBase<T>, Expandable, MultipleSelection {
/** Whether `disabledKeys` applies to all interactions, or only selection. */
disabledBehavior?: DisabledBehavior
}
export interface TreeState<T> {
/** A collection of items in the tree. */
readonly collection: Collection<Node<T>>,
/** A set of keys for items that are disabled. */
readonly disabledKeys: Set<Key>,
/** A set of keys for items that are expanded. */
readonly expandedKeys: Set<Key>,
/** Toggles the expanded state for an item by its key. */
toggleKey(key: Key): void,
/** Replaces the set of expanded keys. */
setExpandedKeys(keys: Set<Key>): void,
/** A selection manager to read and update multiple selection state. */
readonly selectionManager: SelectionManager
}
/**
* Provides state management for tree-like components. Handles building a collection
* of items from props, item expanded state, and manages multiple selection state.
*/
export function useTreeState<T extends object>(props: TreeProps<T>): TreeState<T> {
let {
onExpandedChange
} = props;
let [expandedKeys, setExpandedKeys] = useControlledState(
props.expandedKeys ? new Set(props.expandedKeys) : undefined,
props.defaultExpandedKeys ? new Set(props.defaultExpandedKeys) : new Set(),
onExpandedChange
);
let selectionState = useMultipleSelectionState(props);
let disabledKeys = useMemo(() =>
props.disabledKeys ? new Set(props.disabledKeys) : new Set<Key>()
, [props.disabledKeys]);
let tree = useCollection(props, useCallback(nodes => new TreeCollection(nodes, {expandedKeys}), [expandedKeys]), null);
// Reset focused key if that item is deleted from the collection.
useEffect(() => {
if (selectionState.focusedKey != null && !tree.getItem(selectionState.focusedKey)) {
selectionState.setFocusedKey(null);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [tree, selectionState.focusedKey]);
let onToggle = (key: Key) => {
setExpandedKeys(toggleKey(expandedKeys, key));
};
return {
collection: tree,
expandedKeys,
disabledKeys,
toggleKey: onToggle,
setExpandedKeys,
selectionManager: new SelectionManager(tree, selectionState)
};
}
function toggleKey(set: Set<Key>, key: Key): Set<Key> {
let res = new Set(set);
if (res.has(key)) {
res.delete(key);
} else {
res.add(key);
}
return res;
}
@@ -0,0 +1,137 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $SyntaxError = require('es-errors/syntax');
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var $Promise = GetIntrinsic('%Promise%', true);
var AsyncFromSyncIteratorContinuation = require('./AsyncFromSyncIteratorContinuation');
var Call = require('./Call');
var CreateIterResultObject = require('./CreateIterResultObject');
var Get = require('./Get');
var GetMethod = require('./GetMethod');
var IteratorNext = require('./IteratorNext');
var OrdinaryObjectCreate = require('./OrdinaryObjectCreate');
var isIteratorRecord = require('../helpers/records/iterator-record-2023');
var SLOT = require('internal-slot');
var $AsyncFromSyncIteratorPrototype = GetIntrinsic('%AsyncFromSyncIteratorPrototype%', true) || {
next: function next(value) {
if (!$Promise) {
throw new $SyntaxError('This environment does not support Promises.');
}
var O = this; // step 1
SLOT.assert(O, '[[SyncIteratorRecord]]'); // step 2
var argsLength = arguments.length;
return new $Promise(function (resolve) { // step 3
var syncIteratorRecord = SLOT.get(O, '[[SyncIteratorRecord]]'); // step 4
var result;
if (argsLength > 0) {
result = IteratorNext(syncIteratorRecord['[[Iterator]]'], value); // step 5.a
} else { // step 6
result = IteratorNext(syncIteratorRecord['[[Iterator]]']);// step 6.a
}
resolve(AsyncFromSyncIteratorContinuation(result)); // step 8
});
},
'return': function () {
if (!$Promise) {
throw new $SyntaxError('This environment does not support Promises.');
}
var O = this; // step 1
SLOT.assert(O, '[[SyncIteratorRecord]]'); // step 2
var valueIsPresent = arguments.length > 0;
var value = valueIsPresent ? arguments[0] : void undefined;
return new $Promise(function (resolve, reject) { // step 3
var syncIterator = SLOT.get(O, '[[SyncIteratorRecord]]')['[[Iterator]]']; // step 4
var iteratorReturn = GetMethod(syncIterator, 'return'); // step 5
if (typeof iteratorReturn === 'undefined') { // step 7
var iterResult = CreateIterResultObject(value, true); // step 7.a
Call(resolve, undefined, [iterResult]); // step 7.b
return;
}
var result;
if (valueIsPresent) { // step 8
result = Call(iteratorReturn, syncIterator, [value]); // step 8.a
} else { // step 9
result = Call(iteratorReturn, syncIterator); // step 9.a
}
if (!isObject(result)) { // step 11
Call(reject, undefined, [new $TypeError('Iterator `return` method returned a non-object value.')]); // step 11.a
return;
}
resolve(AsyncFromSyncIteratorContinuation(result)); // step 12
});
},
'throw': function () {
if (!$Promise) {
throw new $SyntaxError('This environment does not support Promises.');
}
var O = this; // step 1
SLOT.assert(O, '[[SyncIteratorRecord]]'); // step 2
var valueIsPresent = arguments.length > 0;
var value = valueIsPresent ? arguments[0] : void undefined;
return new $Promise(function (resolve, reject) { // step 3
var syncIterator = SLOT.get(O, '[[SyncIteratorRecord]]')['[[Iterator]]']; // step 4
var throwMethod = GetMethod(syncIterator, 'throw'); // step 5
if (typeof throwMethod === 'undefined') { // step 7
Call(reject, undefined, [value]); // step 7.a
return;
}
var result;
if (valueIsPresent) { // step 8
result = Call(throwMethod, syncIterator, [value]); // step 8.a
} else { // step 9
result = Call(throwMethod, syncIterator); // step 9.a
}
if (!isObject(result)) { // step 11
Call(reject, undefined, [new $TypeError('Iterator `throw` method returned a non-object value.')]); // step 11.a
return;
}
resolve(AsyncFromSyncIteratorContinuation(result/* , promiseCapability */)); // step 12
});
}
};
// https://262.ecma-international.org/11.0/#sec-createasyncfromsynciterator
module.exports = function CreateAsyncFromSyncIterator(syncIteratorRecord) {
if (!isIteratorRecord(syncIteratorRecord)) {
throw new $TypeError('Assertion failed: `syncIteratorRecord` must be an Iterator Record');
}
// var asyncIterator = OrdinaryObjectCreate(%AsyncFromSyncIteratorPrototype%, « [[SyncIteratorRecord]] »); // step 1
var asyncIterator = OrdinaryObjectCreate($AsyncFromSyncIteratorPrototype);
SLOT.set(asyncIterator, '[[SyncIteratorRecord]]', syncIteratorRecord); // step 2
var nextMethod = Get(asyncIterator, 'next'); // step 3
return { // steps 3-4
'[[Iterator]]': asyncIterator,
'[[NextMethod]]': nextMethod,
'[[Done]]': false
};
};
@@ -0,0 +1,33 @@
var path = require('path');
var test = require('tape');
var resolve = require('../');
test('filter', function (t) {
var dir = path.join(__dirname, 'resolver');
var packageFilterArgs;
var res = resolve.sync('./baz', {
basedir: dir,
packageFilter: function (pkg, pkgfile, dir) {
pkg.main = 'doom'; // eslint-disable-line no-param-reassign
packageFilterArgs = [pkg, pkgfile, dir];
return pkg;
}
});
t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works');
var packageData = packageFilterArgs[0];
t.equal(packageData.main, 'doom', 'package "main" was altered');
var packageFile = packageFilterArgs[1];
t.equal(
packageFile,
path.join(dir, 'baz/package.json'),
'second packageFilter argument is "pkgfile"'
);
var packageDir = packageFilterArgs[2];
t.equal(packageDir, path.join(dir, 'baz'), 'third packageFilter argument is "dir"');
t.end();
});
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var PopUpButtonRole = {
relatedConcepts: [],
type: 'widget'
};
var _default = PopUpButtonRole;
exports.default = _default;
@@ -0,0 +1,24 @@
import assignValue from './_assignValue.js';
import baseZipObject from './_baseZipObject.js';
/**
* This method is like `_.fromPairs` except that it accepts two arrays,
* one of property identifiers and one of corresponding values.
*
* @static
* @memberOf _
* @since 0.4.0
* @category Array
* @param {Array} [props=[]] The property identifiers.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObject(['a', 'b'], [1, 2]);
* // => { 'a': 1, 'b': 2 }
*/
function zipObject(props, values) {
return baseZipObject(props || [], values || [], assignValue);
}
export default zipObject;
@@ -0,0 +1,290 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ROOT_CONFIG_FILENAMES = void 0;
exports.findConfigUpwards = findConfigUpwards;
exports.findRelativeConfig = findRelativeConfig;
exports.findRootConfig = findRootConfig;
exports.loadConfig = loadConfig;
exports.resolveShowConfigPath = resolveShowConfigPath;
function _debug() {
const data = require("debug");
_debug = function () {
return data;
};
return data;
}
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
function _json() {
const data = require("json5");
_json = function () {
return data;
};
return data;
}
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
var _caching = require("../caching.js");
var _configApi = require("../helpers/config-api.js");
var _utils = require("./utils.js");
var _moduleTypes = require("./module-types.js");
var _patternToRegex = require("../pattern-to-regex.js");
var _configError = require("../../errors/config-error.js");
var fs = require("../../gensync-utils/fs.js");
require("module");
var _rewriteStackTrace = require("../../errors/rewrite-stack-trace.js");
var _async = require("../../gensync-utils/async.js");
const debug = _debug()("babel:config:loading:files:configuration");
const ROOT_CONFIG_FILENAMES = exports.ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json", "babel.config.cts", "babel.config.ts", "babel.config.mts"];
const RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", ".babelrc.json", ".babelrc.cts"];
const BABELIGNORE_FILENAME = ".babelignore";
const runConfig = (0, _caching.makeWeakCache)(function* runConfig(options, cache) {
yield* [];
return {
options: (0, _rewriteStackTrace.endHiddenCallStack)(options)((0, _configApi.makeConfigAPI)(cache)),
cacheNeedsConfiguration: !cache.configured()
};
});
function* readConfigCode(filepath, data) {
if (!_fs().existsSync(filepath)) return null;
let options = yield* (0, _moduleTypes.default)(filepath, (yield* (0, _async.isAsync)()) ? "auto" : "require", "You appear to be using a native ECMAScript module configuration " + "file, which is only supported when running Babel asynchronously " + "or when using the Node.js `--experimental-require-module` flag.", "You appear to be using a configuration file that contains top-level " + "await, which is only supported when running Babel asynchronously.");
let cacheNeedsConfiguration = false;
if (typeof options === "function") {
({
options,
cacheNeedsConfiguration
} = yield* runConfig(options, data));
}
if (!options || typeof options !== "object" || Array.isArray(options)) {
throw new _configError.default(`Configuration should be an exported JavaScript object.`, filepath);
}
if (typeof options.then === "function") {
options.catch == null || options.catch(() => {});
throw new _configError.default(`You appear to be using an async configuration, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously return your config.`, filepath);
}
if (cacheNeedsConfiguration) throwConfigError(filepath);
return buildConfigFileObject(options, filepath);
}
const cfboaf = new WeakMap();
function buildConfigFileObject(options, filepath) {
let configFilesByFilepath = cfboaf.get(options);
if (!configFilesByFilepath) {
cfboaf.set(options, configFilesByFilepath = new Map());
}
let configFile = configFilesByFilepath.get(filepath);
if (!configFile) {
configFile = {
filepath,
dirname: _path().dirname(filepath),
options
};
configFilesByFilepath.set(filepath, configFile);
}
return configFile;
}
const packageToBabelConfig = (0, _caching.makeWeakCacheSync)(file => {
const babel = file.options.babel;
if (babel === undefined) return null;
if (typeof babel !== "object" || Array.isArray(babel) || babel === null) {
throw new _configError.default(`.babel property must be an object`, file.filepath);
}
return {
filepath: file.filepath,
dirname: file.dirname,
options: babel
};
});
const readConfigJSON5 = (0, _utils.makeStaticFileCache)((filepath, content) => {
let options;
try {
options = _json().parse(content);
} catch (err) {
throw new _configError.default(`Error while parsing config - ${err.message}`, filepath);
}
if (!options) throw new _configError.default(`No config detected`, filepath);
if (typeof options !== "object") {
throw new _configError.default(`Config returned typeof ${typeof options}`, filepath);
}
if (Array.isArray(options)) {
throw new _configError.default(`Expected config object but found array`, filepath);
}
delete options.$schema;
return {
filepath,
dirname: _path().dirname(filepath),
options
};
});
const readIgnoreConfig = (0, _utils.makeStaticFileCache)((filepath, content) => {
const ignoreDir = _path().dirname(filepath);
const ignorePatterns = content.split("\n").map(line => line.replace(/#.*$/, "").trim()).filter(Boolean);
for (const pattern of ignorePatterns) {
if (pattern[0] === "!") {
throw new _configError.default(`Negation of file paths is not supported.`, filepath);
}
}
return {
filepath,
dirname: _path().dirname(filepath),
ignore: ignorePatterns.map(pattern => (0, _patternToRegex.default)(pattern, ignoreDir))
};
});
function findConfigUpwards(rootDir) {
let dirname = rootDir;
for (;;) {
for (const filename of ROOT_CONFIG_FILENAMES) {
if (_fs().existsSync(_path().join(dirname, filename))) {
return dirname;
}
}
const nextDir = _path().dirname(dirname);
if (dirname === nextDir) break;
dirname = nextDir;
}
return null;
}
function* findRelativeConfig(packageData, envName, caller) {
let config = null;
let ignore = null;
const dirname = _path().dirname(packageData.filepath);
for (const loc of packageData.directories) {
if (!config) {
var _packageData$pkg;
config = yield* loadOneConfig(RELATIVE_CONFIG_FILENAMES, loc, envName, caller, ((_packageData$pkg = packageData.pkg) == null ? void 0 : _packageData$pkg.dirname) === loc ? packageToBabelConfig(packageData.pkg) : null);
}
if (!ignore) {
const ignoreLoc = _path().join(loc, BABELIGNORE_FILENAME);
ignore = yield* readIgnoreConfig(ignoreLoc);
if (ignore) {
debug("Found ignore %o from %o.", ignore.filepath, dirname);
}
}
}
return {
config,
ignore
};
}
function findRootConfig(dirname, envName, caller) {
return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname, envName, caller);
}
function* loadOneConfig(names, dirname, envName, caller, previousConfig = null) {
const configs = yield* _gensync().all(names.map(filename => readConfig(_path().join(dirname, filename), envName, caller)));
const config = configs.reduce((previousConfig, config) => {
if (config && previousConfig) {
throw new _configError.default(`Multiple configuration files found. Please remove one:\n` + ` - ${_path().basename(previousConfig.filepath)}\n` + ` - ${config.filepath}\n` + `from ${dirname}`);
}
return config || previousConfig;
}, previousConfig);
if (config) {
debug("Found configuration %o from %o.", config.filepath, dirname);
}
return config;
}
function* loadConfig(name, dirname, envName, caller) {
const filepath = (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
paths: [b]
}, M = require("module")) => {
let f = M._findPath(r, M._nodeModulePaths(b).concat(b));
if (f) return f;
f = new Error(`Cannot resolve module '${r}'`);
f.code = "MODULE_NOT_FOUND";
throw f;
})(name, {
paths: [dirname]
});
const conf = yield* readConfig(filepath, envName, caller);
if (!conf) {
throw new _configError.default(`Config file contains no configuration data`, filepath);
}
debug("Loaded config %o from %o.", name, dirname);
return conf;
}
function readConfig(filepath, envName, caller) {
const ext = _path().extname(filepath);
switch (ext) {
case ".js":
case ".cjs":
case ".mjs":
case ".ts":
case ".cts":
case ".mts":
return readConfigCode(filepath, {
envName,
caller
});
default:
return readConfigJSON5(filepath);
}
}
function* resolveShowConfigPath(dirname) {
const targetPath = process.env.BABEL_SHOW_CONFIG_FOR;
if (targetPath != null) {
const absolutePath = _path().resolve(dirname, targetPath);
const stats = yield* fs.stat(absolutePath);
if (!stats.isFile()) {
throw new Error(`${absolutePath}: BABEL_SHOW_CONFIG_FOR must refer to a regular file, directories are not supported.`);
}
return absolutePath;
}
return null;
}
function throwConfigError(filepath) {
throw new _configError.default(`\
Caching was left unconfigured. Babel's plugins, presets, and .babelrc.js files can be configured
for various types of caching, using the first param of their handler functions:
module.exports = function(api) {
// The API exposes the following:
// Cache the returned value forever and don't call this function again.
api.cache(true);
// Don't cache at all. Not recommended because it will be very slow.
api.cache(false);
// Cached based on the value of some function. If this function returns a value different from
// a previously-encountered value, the plugins will re-evaluate.
var env = api.cache(() => process.env.NODE_ENV);
// If testing for a specific env, we recommend specifics to avoid instantiating a plugin for
// any possible NODE_ENV value that might come up during plugin execution.
var isProd = api.cache(() => process.env.NODE_ENV === "production");
// .cache(fn) will perform a linear search though instances to find the matching plugin based
// based on previous instantiated plugins. If you want to recreate the plugin and discard the
// previous instance whenever something changes, you may use:
var isProd = api.cache.invalidate(() => process.env.NODE_ENV === "production");
// Note, we also expose the following more-verbose versions of the above examples:
api.cache.forever(); // api.cache(true)
api.cache.never(); // api.cache(false)
api.cache.using(fn); // api.cache(fn)
// Return the value that will be cached.
return { };
};`, filepath);
}
0 && 0;
//# sourceMappingURL=configuration.js.map
@@ -0,0 +1,44 @@
// Catalan [ca]
import dayjs from '../index';
var locale = {
name: 'ca',
weekdays: 'Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte'.split('_'),
weekdaysShort: 'Dg._Dl._Dt._Dc._Dj._Dv._Ds.'.split('_'),
weekdaysMin: 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'),
months: 'Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre'.split('_'),
monthsShort: 'Gen._Febr._Març_Abr._Maig_Juny_Jul._Ag._Set._Oct._Nov._Des.'.split('_'),
weekStart: 1,
formats: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM [de] YYYY',
LLL: 'D MMMM [de] YYYY [a les] H:mm',
LLLL: 'dddd D MMMM [de] YYYY [a les] H:mm',
ll: 'D MMM YYYY',
lll: 'D MMM YYYY, H:mm',
llll: 'ddd D MMM YYYY, H:mm'
},
relativeTime: {
future: 'd\'aquí %s',
past: 'fa %s',
s: 'uns segons',
m: 'un minut',
mm: '%d minuts',
h: 'una hora',
hh: '%d hores',
d: 'un dia',
dd: '%d dies',
M: 'un mes',
MM: '%d mesos',
y: 'un any',
yy: '%d anys'
},
ordinal: function ordinal(n) {
var ord;
if (n === 1 || n === 3) ord = 'r';else if (n === 2) ord = 'n';else if (n === 4) ord = 't';else ord = 'è';
return "" + n + ord;
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,16 @@
Copyright (c) 2012-2014 Andris Reinman
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 SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,75 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/default-layout.ts
var default_layout_exports = {};
__export(default_layout_exports, {
darkLayout: () => darkLayout,
defaultLayout: () => defaultLayout,
lightLayout: () => lightLayout
});
module.exports = __toCommonJS(default_layout_exports);
var defaultLayout = {
dividerWeight: "1px",
disabledOpacity: ".5",
fontSize: {
tiny: "0.75rem",
small: "0.875rem",
medium: "1rem",
large: "1.125rem"
},
lineHeight: {
tiny: "1rem",
small: "1.25rem",
medium: "1.5rem",
large: "1.75rem"
},
radius: {
small: "8px",
medium: "12px",
large: "14px"
},
borderWidth: {
small: "1px",
medium: "2px",
large: "3px"
},
boxShadow: {
small: "0px 0px 5px 0px rgb(0 0 0 / 0.02), 0px 2px 10px 0px rgb(0 0 0 / 0.06), 0px 0px 1px 0px rgb(0 0 0 / 0.3)",
medium: "0px 0px 15px 0px rgb(0 0 0 / 0.03), 0px 2px 30px 0px rgb(0 0 0 / 0.08), 0px 0px 1px 0px rgb(0 0 0 / 0.3)",
large: "0px 0px 30px 0px rgb(0 0 0 / 0.04), 0px 30px 60px 0px rgb(0 0 0 / 0.12), 0px 0px 1px 0px rgb(0 0 0 / 0.3)"
}
};
var lightLayout = {
hoverOpacity: ".8"
};
var darkLayout = {
hoverOpacity: ".9",
boxShadow: {
small: "0px 0px 5px 0px rgb(0 0 0 / 0.05), 0px 2px 10px 0px rgb(0 0 0 / 0.2), inset 0px 0px 1px 0px rgb(255 255 255 / 0.15)",
medium: "0px 0px 15px 0px rgb(0 0 0 / 0.06), 0px 2px 30px 0px rgb(0 0 0 / 0.22), inset 0px 0px 1px 0px rgb(255 255 255 / 0.15)",
large: "0px 0px 30px 0px rgb(0 0 0 / 0.07), 0px 30px 60px 0px rgb(0 0 0 / 0.26), inset 0px 0px 1px 0px rgb(255 255 255 / 0.15)"
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
darkLayout,
defaultLayout,
lightLayout
});
@@ -0,0 +1,4 @@
/// <reference types="node" />
import type * as fs from 'fs';
export declare type Stats = fs.Stats;
export declare type ErrnoException = NodeJS.ErrnoException;
@@ -0,0 +1,62 @@
{
"name": "@heroui/snippet",
"version": "2.2.11",
"description": "Display a snippet of copyable code for the command line.",
"keywords": [
"snippet"
],
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"homepage": "https://heroui.com",
"license": "MIT",
"main": "dist/index.js",
"sideEffects": false,
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/heroui-inc/heroui.git",
"directory": "packages/components/snippet"
},
"bugs": {
"url": "https://github.com/heroui-inc/heroui/issues"
},
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"@heroui/theme": ">=2.4.0",
"@heroui/system": ">=2.4.0"
},
"dependencies": {
"@react-aria/focus": "3.19.0",
"@react-aria/utils": "3.26.0",
"@heroui/button": "2.2.10",
"@heroui/shared-utils": "2.1.3",
"@heroui/react-utils": "2.1.4",
"@heroui/shared-icons": "2.1.2",
"@heroui/use-clipboard": "2.1.3",
"@heroui/tooltip": "2.2.8"
},
"clean-package": "../../../clean-package.config.json",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsup src --dts",
"dev": "pnpm build:fast --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"build:fast": "tsup src"
}
}
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from '../types.js';
import 'react';
declare const CopyLinearIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { CopyLinearIcon };
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Robert Taussig
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,eAAe,CAAC,wHAAkB,CAAC;AACvD","sources":["packages/@react-aria/breadcrumbs/intl/uk-UA.json"],"sourcesContent":["{\n \"breadcrumbs\": \"Навігаційна стежка\"\n}\n"],"names":[],"version":3,"file":"uk-UA.main.js.map"}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ConstantValueBinding.js.map
@@ -0,0 +1 @@
export { _ as default } from "../esm/_sliced_to_array_loose.js";
@@ -0,0 +1,52 @@
'use strict';
var through = require('through2');
var readDir = require('./read-dir');
var readStream = require('./read-stream');
var readBuffer = require('./read-buffer');
var readSymbolicLink = require('./read-symbolic-link');
function readContents(optResolver) {
function readFile(file, enc, callback) {
// Skip reading contents if read option says so
var read = optResolver.resolve('read', file);
if (!read) {
return callback(null, file);
}
// Don't fail to read a directory
if (file.isDirectory()) {
return readDir(file, optResolver, onRead);
}
// Process symbolic links included with `resolveSymlinks` option
if (file.stat && file.stat.isSymbolicLink()) {
return readSymbolicLink(file, optResolver, onRead);
}
// Read and pass full contents
var buffer = optResolver.resolve('buffer', file);
if (buffer) {
return readBuffer(file, optResolver, onRead);
}
// Don't buffer anything - just pass streams
return readStream(file, optResolver, onRead);
// This is invoked by the various readXxx modules when they've finished
// reading the contents.
function onRead(readErr) {
if (readErr) {
return callback(readErr);
}
return callback(null, file);
}
}
return through.obj(readFile);
}
module.exports = readContents;
@@ -0,0 +1,246 @@
4.1.7 / 2024-12-18
==================
* [Deps] add missing `es-object-atoms` (#86)
4.1.6 / 2024-12-18
==================
* [Refactor] use `call-bound` directly; use `es-object-atoms`
* [Deps] update `call-bind`, `has-symbols`
* [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `hasown`, `mock-property`, `ses`, `tape`
* [actions] split out node 10-20, and 20+
* [actions] remove redundant finisher
* [Tests] replace `aud` with `npm audit`
4.1.5 / 2023-11-30
==================
* [meta] republish without testing HTML file (#85)
* [Deps] update `call-bind`, `define-properties`
* [Dev Deps] use `hasown` instead of `has`
* [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `aud`, `npmignore`, `mock-property`, `tape`
* [actions] update rebase action
4.1.4 / 2022-08-16
==================
* [meta] fix `npmignore` integration (#83)
4.1.3 / 2022-08-05
==================
* [Refactor] make steps closer to actual spec
* [Refactor] simplify object coercible check
* [readme] remove defunct badges, add coverage and actions badges
* [eslint] ignore coverage output
* [meta] use `npmignore` to autogenerate an npmignore file
* [meta] remove audit-level
* [Deps] update `call-bind`, `define-properties`, `has-symbols`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `aud`, `functions-have-names`, `safe-publish-latest`, `ses`, `tape`
* [actions] use `node/install` instead of `node/run`; use `codecov` action
* [actions] reuse common workflows
* [actions] update codecov uploader
* [Tests] add implementation tests
* [Tests] use `mock-property`
* [Tests] disable posttest pending `aud` handling `file:` deps
* [Tests] migrate remaining tests to Github Actions (#81)
* [Tests] gitignore coverage output
* [Tests] test node v1-v9 on Github Actions instead of travis; resume testing all minors (#80)
4.1.2 / 2020-10-30
==================
* [Refactor] use extracted `call-bind` instead of full `es-abstract`
* [Dev Deps] update `eslint`, `ses`, `browserify`
* [Tests] run tests in SES
* [Tests] ses-compat: show error stacks
4.1.1 / 2020-09-11
==================
* [Fix] avoid mutating `Object.assign` in modern engines
* [Refactor] use `callBind` from `es-abstract` instead of `function-bind`
* [Deps] update `has-symbols`, `object-keys`, `define-properties`
* [meta] add `funding` field, FUNDING.yml
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `browserify`, `covert`, `for-each`, `is`, `tape`, `functions-have-names`; add `aud`, `safe-publish-latest`; remove `jscs`
* [actions] add Require Allow Edits workflow
* [actions] add automatic rebasing / merge commit blocking
* [Tests] ses-compat - add test to ensure package initializes correctly after ses lockdown (#77)
* [Tests] Add passing test for a source of `window.location` (#68)
* [Tests] use shared travis-ci config
* [Tests] use `npx aud` instead of `npm audit` with hoops or `nsp`
* [Tests] use `functions-have-names`
4.1.0 / 2017-12-21
==================
* [New] add `auto` entry point (#52)
* [Refactor] Use `has-symbols` module
* [Deps] update `function-bind`, `object-keys`
* [Dev Deps] update `@es-shims/api`, `browserify`, `nsp`, `eslint`, `@ljharb/eslint-config`, `is`
* [Tests] up to `node` `v9.3`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTS
4.0.4 / 2016-07-04
==================
* [Fix] Cache original `getOwnPropertySymbols`, and use that when `Object.getOwnPropertySymbols` is unavailable
* [Deps] update `object-keys`
* [Dev Deps] update `eslint`, `get-own-property-symbols`, `core-js`, `jscs`, `nsp`, `browserify`, `@ljharb/eslint-config`, `tape`, `@es-shims/api`
* [Tests] up to `node` `v6.2`, `v5.10`, `v4.4`
* [Tests] run sham tests on node 0.10
* [Tests] use pretest/posttest for linting/security
4.0.3 / 2015-10-21
==================
* [Fix] Support core-js's Symbol sham (#17)
* [Fix] Ensure that properties removed or made non-enumerable during enumeration are not assigned (#16)
* [Fix] Avoid looking up keys and values more than once
* [Tests] Avoid using `reduce` so `npm run test:shams:corejs` passes in `node` `v0.8` ([core-js#122](https://github.com/zloirock/core-js/issues/122))
* [Tests] Refactor to use my conventional structure that separates shimmed, implementation, and common tests
* [Tests] Create `npm run test:shams` and better organize tests for symbol shams
* [Tests] Remove `nsp` in favor of `requiresafe`
4.0.2 / 2015-10-20
==================
* [Fix] Ensure correct property enumeration order, particularly in v8 (#15)
* [Deps] update `object-keys`, `define-properties`
* [Dev Deps] update `browserify`, `is`, `tape`, `jscs`, `eslint`, `@ljharb/eslint-config`
* [Tests] up to `io.js` `v3.3`, `node` `v4.2`
4.0.1 / 2015-08-16
==================
* [Docs] Add `Symbol` note to readme
4.0.0 / 2015-08-15
==================
* [Breaking] Implement the [es-shim API](es-shims/api).
* [Robustness] Make implementation robust against later modification of environment methods.
* [Refactor] Move implementation to `implementation.js`
* [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG
* [Deps] update `object-keys`, `define-properties`
* [Dev Deps] update `browserify`, `tape`, `eslint`, `jscs`, `browserify`
* [Tests] Add `npm run tests-only`
* [Tests] use my personal shared `eslint` config.
* [Tests] up to `io.js` `v3.0`
3.0.1 / 2015-06-28
==================
* Cache `Object` and `Array#push` to make the shim more robust.
* [Fix] Remove use of `Array#filter`, which isn't in ES3.
* [Deps] Update `object-keys`, `define-properties`
* [Dev Deps] Update `get-own-property-symbols`, `browserify`, `eslint`, `nsp`
* [Tests] Test up to `io.js` `v2.3`
* [Tests] Adding `Object.assign` tests for non-object targets, per https://github.com/paulmillr/es6-shim/issues/348
3.0.0 / 2015-05-20
==================
* Attempt to feature-detect Symbols, even if `typeof Symbol() !== 'symbol'` (#12)
* Make a separate `hasSymbols` internal module
* Update `browserify`, `eslint`
2.0.3 / 2015-06-28
==================
* Cache `Object` and `Array#push` to make the shim more robust.
* [Fix] Remove use of `Array#filter`, which isn't in ES3
* [Deps] Update `object-keys`, `define-properties`
* [Dev Deps] Update `browserify`, `nsp`, `eslint`
* [Tests] Test up to `io.js` `v2.3`
2.0.2 / 2015-05-20
==================
* Make sure `.shim` is non-enumerable.
* Refactor `.shim` implementation to use `define-properties` predicates, rather than `delete`ing the original.
* Update docs to match spec/implementation. (#11)
* Add `npm run eslint`
* Test up to `io.js` `v2.0`
* Update `jscs`, `browserify`, `covert`
2.0.1 / 2015-04-12
==================
* Make sure non-enumerable Symbols are excluded.
2.0.0 / 2015-04-12
==================
* Make sure the shim function overwrites a broken implementation with pending exceptions.
* Ensure shim is not enumerable using `define-properties`
* Ensure `Object.assign` includes symbols.
* All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`.
* Run `travis-ci` tests on `iojs` and `node` v0.12; speed up builds; allow 0.8 failures.
* Add `npm run security` via `nsp`
* Update `browserify`, `jscs`, `tape`, `object-keys`, `is`
1.1.1 / 2014-12-14
==================
* Actually include the browser build in `npm`
1.1.0 / 2014-12-14
==================
* Add `npm run build`, and build an automatic-shimming browser distribution as part of the npm publish process.
* Update `is`, `jscs`
1.0.3 / 2014-11-29
==================
* Revert "optimize --production installs"
1.0.2 / 2014-11-27
==================
* Update `jscs`, `is`, `object-keys`, `tape`
* Add badges to README
* Name URLs in README
* Lock `covert` to `v1.0.0`
* Optimize --production installs
1.0.1 / 2014-08-26
==================
* Update `is`, `covert`
1.0.0 / 2014-08-07
==================
* Update `object-keys`, `tape`
0.5.0 / 2014-07-31
==================
* Object.assign no longer throws on null or undefined sources, per https://bugs.ecmascript.org/show_bug.cgi?id=3096
0.4.3 / 2014-07-30
==================
* Don’t modify vars in the function signature, since it deoptimizes v8
0.4.2 / 2014-07-30
==================
* Fixing the version number: v0.4.2
0.4.1 / 2014-07-19
==================
* Revert "Use the native Object.keys if it’s available."
0.4.0 / 2014-07-19
==================
* Use the native Object.keys if it’s available.
* Fixes [#2](https://github.com/ljharb/object.assign/issues/2).
* Adding failing tests for [#2](https://github.com/ljharb/object.assign/issues/2).
* Fix indentation.
* Adding `npm run lint`
* Update `tape`, `covert`
* README: Use SVG badge for Travis [#1](https://github.com/ljharb/object.assign/issues/1) from mathiasbynens/patch-1
0.3.1 / 2014-04-10
==================
* Object.assign does partially modify objects if it throws, per https://twitter.com/awbjs/status/454320863093862400
0.3.0 / 2014-04-10
==================
* Update with newest ES6 behavior - Object.assign now takes a variable number of source objects.
* Update `tape`
* Make sure old and unstable nodes don’t fail Travis
0.2.1 / 2014-03-16
==================
* Let object-keys handle the fallback
* Update dependency badges
* Adding bower.json
0.2.0 / 2014-03-16
==================
* Use a for loop, because ES3 browsers don’t have "reduce"
0.1.1 / 2014-03-14
==================
* Updating readme
0.1.0 / 2014-03-14
==================
* Initial release.
@@ -0,0 +1,19 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./required-from-mapped-result"), exports);
__exportStar(require("./required"), exports);
@@ -0,0 +1,9 @@
export * from './registration/generateRegistrationOptions.js';
export * from './registration/verifyRegistrationResponse.js';
export * from './authentication/generateAuthenticationOptions.js';
export * from './authentication/verifyAuthenticationResponse.js';
export * from './services/metadataService.js';
export * from './services/settingsService.js';
export * from './metadata/mdsTypes.js';
export * from './types/index.js';
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,12 @@
import baseProperty from './_baseProperty.js';
/**
* Gets the size of an ASCII `string`.
*
* @private
* @param {string} string The string inspect.
* @returns {number} Returns the string size.
*/
var asciiSize = baseProperty('length');
export default asciiSize;
@@ -0,0 +1 @@
{"name":"@heroui/use-image","version":"2.1.3","requiresBuild":false,"files":{"dist/index.js":{"checkedAt":1794532107236,"integrity":"sha512-cDGTkYbsNcYpFDh3U+bMg4e2758QHf4jAR1GAPNdD4l7qJbbrQb4rvtlbnzHjAyBnxHm4PzLPBwlTxvSTTzrsQ==","mode":420,"size":3094},"package.json":{"checkedAt":1794532107236,"integrity":"sha512-W5oDRHXxmcMfRaVilHTZg4t6R7zSm941nIn4W0idjxS9ZMkI9XhUPlkLff5zlveReHYlLCek0hb27GhUXExMjw==","mode":420,"size":1377},"README.md":{"checkedAt":1794532107236,"integrity":"sha512-FYb6+QgaKUZgt1aO+BhXU2YWv9Mh1b1LiRC923fZa8dzkqmImbfQZHlBjXADmGoKWh2tuPrYhCDRp34sny/WHg==","mode":420,"size":482},"dist/index.mjs":{"checkedAt":1794532107236,"integrity":"sha512-yZ05MFYRt1gxhIa0YrR5ifEZaSISOvG3RQla0MmpQl42YKp6j6d60orhpzZKINX2GJ/KHgyyww/YnDEEls7aKQ==","mode":420,"size":1926},"dist/index.d.ts":{"checkedAt":1794532107236,"integrity":"sha512-dDBVKSfAxC1eOSbcYoKr5sw+3ZiXZvjKw2NlZyB+6wK3I5VoPTNeypvE339YjoSuUDcW2V9kznhalYhDGjJegA==","mode":420,"size":1912},"LICENSE":{"checkedAt":1794532107236,"integrity":"sha512-eaopHP+N4EYXlGoX9hmoxDPoVft4BqrXKmbsFTcsoBHSrJp/GWF4qVtLBzrw9h9ZrbFfPY69z+3RuDX9FdPG+Q==","mode":420,"size":1064}}}
@@ -0,0 +1,474 @@
var isValidSemver = require('semver/functions/valid')
var cleanSemver = require('semver/functions/clean')
var validateLicense = require('validate-npm-package-license')
var hostedGitInfo = require('hosted-git-info')
var isBuiltinModule = require('is-core-module')
var depTypes = ['dependencies', 'devDependencies', 'optionalDependencies']
var extractDescription = require('./extract_description')
var url = require('url')
var typos = require('./typos.json')
module.exports = {
// default warning function
warn: function () {},
fixRepositoryField: function (data) {
if (data.repositories) {
this.warn('repositories')
data.repository = data.repositories[0]
}
if (!data.repository) {
return this.warn('missingRepository')
}
if (typeof data.repository === 'string') {
data.repository = {
type: 'git',
url: data.repository,
}
}
var r = data.repository.url || ''
if (r) {
var hosted = hostedGitInfo.fromUrl(r)
if (hosted) {
r = data.repository.url
= hosted.getDefaultRepresentation() === 'shortcut' ? hosted.https() : hosted.toString()
}
}
if (r.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)) {
this.warn('brokenGitUrl', r)
}
},
fixTypos: function (data) {
Object.keys(typos.topLevel).forEach(function (d) {
if (Object.prototype.hasOwnProperty.call(data, d)) {
this.warn('typo', d, typos.topLevel[d])
}
}, this)
},
fixScriptsField: function (data) {
if (!data.scripts) {
return
}
if (typeof data.scripts !== 'object') {
this.warn('nonObjectScripts')
delete data.scripts
return
}
Object.keys(data.scripts).forEach(function (k) {
if (typeof data.scripts[k] !== 'string') {
this.warn('nonStringScript')
delete data.scripts[k]
} else if (typos.script[k] && !data.scripts[typos.script[k]]) {
this.warn('typo', k, typos.script[k], 'scripts')
}
}, this)
},
fixFilesField: function (data) {
var files = data.files
if (files && !Array.isArray(files)) {
this.warn('nonArrayFiles')
delete data.files
} else if (data.files) {
data.files = data.files.filter(function (file) {
if (!file || typeof file !== 'string') {
this.warn('invalidFilename', file)
return false
} else {
return true
}
}, this)
}
},
fixBinField: function (data) {
if (!data.bin) {
return
}
if (typeof data.bin === 'string') {
var b = {}
var match
if (match = data.name.match(/^@[^/]+[/](.*)$/)) {
b[match[1]] = data.bin
} else {
b[data.name] = data.bin
}
data.bin = b
}
},
fixManField: function (data) {
if (!data.man) {
return
}
if (typeof data.man === 'string') {
data.man = [data.man]
}
},
fixBundleDependenciesField: function (data) {
var bdd = 'bundledDependencies'
var bd = 'bundleDependencies'
if (data[bdd] && !data[bd]) {
data[bd] = data[bdd]
delete data[bdd]
}
if (data[bd] && !Array.isArray(data[bd])) {
this.warn('nonArrayBundleDependencies')
delete data[bd]
} else if (data[bd]) {
data[bd] = data[bd].filter(function (bd) {
if (!bd || typeof bd !== 'string') {
this.warn('nonStringBundleDependency', bd)
return false
} else {
if (!data.dependencies) {
data.dependencies = {}
}
if (Object.prototype.hasOwnProperty.call(data.dependencies, bd)) {
this.warn('nonDependencyBundleDependency', bd)
data.dependencies[bd] = '*'
}
return true
}
}, this)
}
},
fixDependencies: function (data, strict) {
objectifyDeps(data, this.warn)
addOptionalDepsToDeps(data, this.warn)
this.fixBundleDependenciesField(data)
;['dependencies', 'devDependencies'].forEach(function (deps) {
if (!(deps in data)) {
return
}
if (!data[deps] || typeof data[deps] !== 'object') {
this.warn('nonObjectDependencies', deps)
delete data[deps]
return
}
Object.keys(data[deps]).forEach(function (d) {
var r = data[deps][d]
if (typeof r !== 'string') {
this.warn('nonStringDependency', d, JSON.stringify(r))
delete data[deps][d]
}
var hosted = hostedGitInfo.fromUrl(data[deps][d])
if (hosted) {
data[deps][d] = hosted.toString()
}
}, this)
}, this)
},
fixModulesField: function (data) {
if (data.modules) {
this.warn('deprecatedModules')
delete data.modules
}
},
fixKeywordsField: function (data) {
if (typeof data.keywords === 'string') {
data.keywords = data.keywords.split(/,\s+/)
}
if (data.keywords && !Array.isArray(data.keywords)) {
delete data.keywords
this.warn('nonArrayKeywords')
} else if (data.keywords) {
data.keywords = data.keywords.filter(function (kw) {
if (typeof kw !== 'string' || !kw) {
this.warn('nonStringKeyword')
return false
} else {
return true
}
}, this)
}
},
fixVersionField: function (data, strict) {
// allow "loose" semver 1.0 versions in non-strict mode
// enforce strict semver 2.0 compliance in strict mode
var loose = !strict
if (!data.version) {
data.version = ''
return true
}
if (!isValidSemver(data.version, loose)) {
throw new Error('Invalid version: "' + data.version + '"')
}
data.version = cleanSemver(data.version, loose)
return true
},
fixPeople: function (data) {
modifyPeople(data, unParsePerson)
modifyPeople(data, parsePerson)
},
fixNameField: function (data, options) {
if (typeof options === 'boolean') {
options = {strict: options}
} else if (typeof options === 'undefined') {
options = {}
}
var strict = options.strict
if (!data.name && !strict) {
data.name = ''
return
}
if (typeof data.name !== 'string') {
throw new Error('name field must be a string.')
}
if (!strict) {
data.name = data.name.trim()
}
ensureValidName(data.name, strict, options.allowLegacyCase)
if (isBuiltinModule(data.name)) {
this.warn('conflictingName', data.name)
}
},
fixDescriptionField: function (data) {
if (data.description && typeof data.description !== 'string') {
this.warn('nonStringDescription')
delete data.description
}
if (data.readme && !data.description) {
data.description = extractDescription(data.readme)
}
if (data.description === undefined) {
delete data.description
}
if (!data.description) {
this.warn('missingDescription')
}
},
fixReadmeField: function (data) {
if (!data.readme) {
this.warn('missingReadme')
data.readme = 'ERROR: No README data found!'
}
},
fixBugsField: function (data) {
if (!data.bugs && data.repository && data.repository.url) {
var hosted = hostedGitInfo.fromUrl(data.repository.url)
if (hosted && hosted.bugs()) {
data.bugs = {url: hosted.bugs()}
}
} else if (data.bugs) {
var emailRe = /^.+@.*\..+$/
if (typeof data.bugs === 'string') {
if (emailRe.test(data.bugs)) {
data.bugs = {email: data.bugs}
/* eslint-disable-next-line node/no-deprecated-api */
} else if (url.parse(data.bugs).protocol) {
data.bugs = {url: data.bugs}
} else {
this.warn('nonEmailUrlBugsString')
}
} else {
bugsTypos(data.bugs, this.warn)
var oldBugs = data.bugs
data.bugs = {}
if (oldBugs.url) {
/* eslint-disable-next-line node/no-deprecated-api */
if (typeof (oldBugs.url) === 'string' && url.parse(oldBugs.url).protocol) {
data.bugs.url = oldBugs.url
} else {
this.warn('nonUrlBugsUrlField')
}
}
if (oldBugs.email) {
if (typeof (oldBugs.email) === 'string' && emailRe.test(oldBugs.email)) {
data.bugs.email = oldBugs.email
} else {
this.warn('nonEmailBugsEmailField')
}
}
}
if (!data.bugs.email && !data.bugs.url) {
delete data.bugs
this.warn('emptyNormalizedBugs')
}
}
},
fixHomepageField: function (data) {
if (!data.homepage && data.repository && data.repository.url) {
var hosted = hostedGitInfo.fromUrl(data.repository.url)
if (hosted && hosted.docs()) {
data.homepage = hosted.docs()
}
}
if (!data.homepage) {
return
}
if (typeof data.homepage !== 'string') {
this.warn('nonUrlHomepage')
return delete data.homepage
}
/* eslint-disable-next-line node/no-deprecated-api */
if (!url.parse(data.homepage).protocol) {
data.homepage = 'http://' + data.homepage
}
},
fixLicenseField: function (data) {
const license = data.license || data.licence
if (!license) {
return this.warn('missingLicense')
}
if (
typeof (license) !== 'string' ||
license.length < 1 ||
license.trim() === ''
) {
return this.warn('invalidLicense')
}
if (!validateLicense(license).validForNewPackages) {
return this.warn('invalidLicense')
}
},
}
function isValidScopedPackageName (spec) {
if (spec.charAt(0) !== '@') {
return false
}
var rest = spec.slice(1).split('/')
if (rest.length !== 2) {
return false
}
return rest[0] && rest[1] &&
rest[0] === encodeURIComponent(rest[0]) &&
rest[1] === encodeURIComponent(rest[1])
}
function isCorrectlyEncodedName (spec) {
return !spec.match(/[/@\s+%:]/) &&
spec === encodeURIComponent(spec)
}
function ensureValidName (name, strict, allowLegacyCase) {
if (name.charAt(0) === '.' ||
!(isValidScopedPackageName(name) || isCorrectlyEncodedName(name)) ||
(strict && (!allowLegacyCase) && name !== name.toLowerCase()) ||
name.toLowerCase() === 'node_modules' ||
name.toLowerCase() === 'favicon.ico') {
throw new Error('Invalid name: ' + JSON.stringify(name))
}
}
function modifyPeople (data, fn) {
if (data.author) {
data.author = fn(data.author)
}['maintainers', 'contributors'].forEach(function (set) {
if (!Array.isArray(data[set])) {
return
}
data[set] = data[set].map(fn)
})
return data
}
function unParsePerson (person) {
if (typeof person === 'string') {
return person
}
var name = person.name || ''
var u = person.url || person.web
var url = u ? (' (' + u + ')') : ''
var e = person.email || person.mail
var email = e ? (' <' + e + '>') : ''
return name + email + url
}
function parsePerson (person) {
if (typeof person !== 'string') {
return person
}
var name = person.match(/^([^(<]+)/)
var url = person.match(/\(([^)]+)\)/)
var email = person.match(/<([^>]+)>/)
var obj = {}
if (name && name[0].trim()) {
obj.name = name[0].trim()
}
if (email) {
obj.email = email[1]
}
if (url) {
obj.url = url[1]
}
return obj
}
function addOptionalDepsToDeps (data, warn) {
var o = data.optionalDependencies
if (!o) {
return
}
var d = data.dependencies || {}
Object.keys(o).forEach(function (k) {
d[k] = o[k]
})
data.dependencies = d
}
function depObjectify (deps, type, warn) {
if (!deps) {
return {}
}
if (typeof deps === 'string') {
deps = deps.trim().split(/[\n\r\s\t ,]+/)
}
if (!Array.isArray(deps)) {
return deps
}
warn('deprecatedArrayDependencies', type)
var o = {}
deps.filter(function (d) {
return typeof d === 'string'
}).forEach(function (d) {
d = d.trim().split(/(:?[@\s><=])/)
var dn = d.shift()
var dv = d.join('')
dv = dv.trim()
dv = dv.replace(/^@/, '')
o[dn] = dv
})
return o
}
function objectifyDeps (data, warn) {
depTypes.forEach(function (type) {
if (!data[type]) {
return
}
data[type] = depObjectify(data[type], type, warn)
})
}
function bugsTypos (bugs, warn) {
if (!bugs) {
return
}
Object.keys(bugs).forEach(function (k) {
if (typos.bugs[k]) {
warn('typo', k, typos.bugs[k], 'bugs')
bugs[typos.bugs[k]] = bugs[k]
delete bugs[k]
}
})
}
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO;IACpC,CAAC,CAAC,OAAO;IACT,CAAC,CAAC;QACE,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;KACb,CAAA;AACP,6CAA0C;AAC1C,8DAAgC;AAChC,6DAAmD;AASnD;;;GAGG;AACI,MAAM,QAAQ,GAAG,CACtB,CAAM,EACsC,EAAE,CAC9C,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,KAAK,QAAQ;IACrB,CAAC,CAAC,YAAY,QAAQ;QACpB,CAAC,YAAY,qBAAM;QACnB,IAAA,kBAAU,EAAC,CAAC,CAAC;QACb,IAAA,kBAAU,EAAC,CAAC,CAAC,CAAC,CAAA;AARL,QAAA,QAAQ,YAQH;AAElB;;GAEG;AACI,MAAM,UAAU,GAAG,CAAC,CAAM,EAA0B,EAAE,CAC3D,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,KAAK,QAAQ;IACrB,CAAC,YAAY,0BAAY;IACzB,OAAQ,CAAuB,CAAC,IAAI,KAAK,UAAU;IACnD,iEAAiE;IAChE,CAAuB,CAAC,IAAI,KAAK,qBAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAA;AANrD,QAAA,UAAU,cAM2C;AAElE;;GAEG;AACI,MAAM,UAAU,GAAG,CAAC,CAAM,EAA0B,EAAE,CAC3D,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,KAAK,QAAQ;IACrB,CAAC,YAAY,0BAAY;IACzB,OAAQ,CAAuB,CAAC,KAAK,KAAK,UAAU;IACpD,OAAQ,CAAuB,CAAC,GAAG,KAAK,UAAU,CAAA;AALvC,QAAA,UAAU,cAK6B;AAEpD,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;AACzB,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA;AAC7C,MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;AACxC,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;AAC1C,MAAM,aAAa,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA;AAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAC/B,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;AAC3B,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;AAC7B,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;AACvC,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;AACnC,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AACjC,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AACjC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAC/B,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAC/B,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;AAC7B,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA;AAC3C,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;AACvC,MAAM,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;AACzC,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;AACvC,0CAA0C;AAC1C,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;AACrC,0CAA0C;AAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;AAC7B,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;AACnC,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AACjC,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;AACnC,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;AAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;AAC7B,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AACjC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAC/B,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAA;AAC7C,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;AAErC,MAAM,KAAK,GAAG,CAAC,EAAwB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACtE,MAAM,OAAO,GAAG,CAAC,EAAwB,EAAE,EAAE,CAAC,EAAE,EAAE,CAAA;AAMlD,MAAM,QAAQ,GAAG,CAAC,EAAO,EAAqB,EAAE,CAC9C,EAAE,KAAK,KAAK,IAAI,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,WAAW,CAAA;AAEvD,MAAM,iBAAiB,GAAG,CAAC,CAAM,EAAwB,EAAE,CACzD,CAAC,YAAY,WAAW;IACxB,CAAC,CAAC,CAAC,CAAC;QACF,OAAO,CAAC,KAAK,QAAQ;QACrB,CAAC,CAAC,WAAW;QACb,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,aAAa;QACpC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,CAAA;AAEtB,MAAM,iBAAiB,GAAG,CAAC,CAAM,EAAwB,EAAE,CACzD,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AAgB9C;;;;GAIG;AACH,MAAM,IAAI;IACR,GAAG,CAAa;IAChB,IAAI,CAAkB;IACtB,IAAI,CAAa;IACjB,OAAO,CAAW;IAClB,YACE,GAAgB,EAChB,IAAuB,EACvB,IAAiB;QAEjB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,IAAwB,CAAA;QACpC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAA;QAClC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IACrC,CAAC;IACD,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IACjD,CAAC;IACD,8BAA8B;IAC9B,qBAAqB;IACrB,WAAW,CAAC,GAAQ,IAAG,CAAC;IACxB,oBAAoB;IACpB,GAAG;QACD,IAAI,CAAC,MAAM,EAAE,CAAA;QACb,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG;YAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAA;IACpC,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,eAAmB,SAAQ,IAAO;IACtC,MAAM;QACJ,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;QAClD,KAAK,CAAC,MAAM,EAAE,CAAA;IAChB,CAAC;IACD,YACE,GAAgB,EAChB,IAAuB,EACvB,IAAiB;QAEjB,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;QACtB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;QAC/C,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;IACnC,CAAC;CACF;AA6ID,MAAM,mBAAmB,GAAG,CAC1B,CAAyB,EACQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAA;AAEpD,MAAM,iBAAiB,GAAG,CACxB,CAAyB,EACM,EAAE,CACjC,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAA;AAE1D;;;;;;;;;;GAUG;AACH,MAAa,QAOX,SAAQ,0BAAY;IAGpB,CAAC,OAAO,CAAC,GAAY,KAAK,CAAC;IAC3B,CAAC,MAAM,CAAC,GAAY,KAAK,CAAC;IAC1B,CAAC,KAAK,CAAC,GAAkB,EAAE,CAAC;IAC5B,CAAC,MAAM,CAAC,GAAY,EAAE,CAAC;IACvB,CAAC,UAAU,CAAC,CAAU;IACtB,CAAC,QAAQ,CAAC,CAAwB;IAClC,CAAC,KAAK,CAAC,CAAU;IACjB,CAAC,OAAO,CAAC,CAAY;IACrB,CAAC,GAAG,CAAC,GAAY,KAAK,CAAC;IACvB,CAAC,WAAW,CAAC,GAAY,KAAK,CAAC;IAC/B,CAAC,YAAY,CAAC,GAAY,KAAK,CAAC;IAChC,CAAC,MAAM,CAAC,GAAY,KAAK,CAAC;IAC1B,CAAC,aAAa,CAAC,GAAY,IAAI,CAAC;IAChC,CAAC,YAAY,CAAC,GAAW,CAAC,CAAC;IAC3B,CAAC,SAAS,CAAC,GAAY,KAAK,CAAC;IAC7B,CAAC,MAAM,CAAC,CAAe;IACvB,CAAC,OAAO,CAAC,GAAY,KAALine truncated
@@ -0,0 +1,149 @@
import { IncomingHttpHeaders } from "./header";
import Client from './client'
export default Errors
declare namespace Errors {
export class UndiciError extends Error {
name: string;
code: string;
}
/** Connect timeout error. */
export class ConnectTimeoutError extends UndiciError {
name: 'ConnectTimeoutError';
code: 'UND_ERR_CONNECT_TIMEOUT';
}
/** A header exceeds the `headersTimeout` option. */
export class HeadersTimeoutError extends UndiciError {
name: 'HeadersTimeoutError';
code: 'UND_ERR_HEADERS_TIMEOUT';
}
/** Headers overflow error. */
export class HeadersOverflowError extends UndiciError {
name: 'HeadersOverflowError'
code: 'UND_ERR_HEADERS_OVERFLOW'
}
/** A body exceeds the `bodyTimeout` option. */
export class BodyTimeoutError extends UndiciError {
name: 'BodyTimeoutError';
code: 'UND_ERR_BODY_TIMEOUT';
}
export class ResponseStatusCodeError extends UndiciError {
constructor (
message?: string,
statusCode?: number,
headers?: IncomingHttpHeaders | string[] | null,
body?: null | Record<string, any> | string
);
name: 'ResponseStatusCodeError';
code: 'UND_ERR_RESPONSE_STATUS_CODE';
body: null | Record<string, any> | string
status: number
statusCode: number
headers: IncomingHttpHeaders | string[] | null;
}
/** Passed an invalid argument. */
export class InvalidArgumentError extends UndiciError {
name: 'InvalidArgumentError';
code: 'UND_ERR_INVALID_ARG';
}
/** Returned an invalid value. */
export class InvalidReturnValueError extends UndiciError {
name: 'InvalidReturnValueError';
code: 'UND_ERR_INVALID_RETURN_VALUE';
}
/** The request has been aborted by the user. */
export class RequestAbortedError extends UndiciError {
name: 'AbortError';
code: 'UND_ERR_ABORTED';
}
/** Expected error with reason. */
export class InformationalError extends UndiciError {
name: 'InformationalError';
code: 'UND_ERR_INFO';
}
/** Request body length does not match content-length header. */
export class RequestContentLengthMismatchError extends UndiciError {
name: 'RequestContentLengthMismatchError';
code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH';
}
/** Response body length does not match content-length header. */
export class ResponseContentLengthMismatchError extends UndiciError {
name: 'ResponseContentLengthMismatchError';
code: 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH';
}
/** Trying to use a destroyed client. */
export class ClientDestroyedError extends UndiciError {
name: 'ClientDestroyedError';
code: 'UND_ERR_DESTROYED';
}
/** Trying to use a closed client. */
export class ClientClosedError extends UndiciError {
name: 'ClientClosedError';
code: 'UND_ERR_CLOSED';
}
/** There is an error with the socket. */
export class SocketError extends UndiciError {
name: 'SocketError';
code: 'UND_ERR_SOCKET';
socket: Client.SocketInfo | null
}
/** Encountered unsupported functionality. */
export class NotSupportedError extends UndiciError {
name: 'NotSupportedError';
code: 'UND_ERR_NOT_SUPPORTED';
}
/** No upstream has been added to the BalancedPool. */
export class BalancedPoolMissingUpstreamError extends UndiciError {
name: 'MissingUpstreamError';
code: 'UND_ERR_BPL_MISSING_UPSTREAM';
}
export class HTTPParserError extends UndiciError {
name: 'HTTPParserError';
code: string;
}
/** The response exceed the length allowed. */
export class ResponseExceededMaxSizeError extends UndiciError {
name: 'ResponseExceededMaxSizeError';
code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE';
}
export class RequestRetryError extends UndiciError {
constructor (
message: string,
statusCode: number,
headers?: IncomingHttpHeaders | string[] | null,
body?: null | Record<string, any> | string
);
name: 'RequestRetryError';
code: 'UND_ERR_REQ_RETRY';
statusCode: number;
data: {
count: number;
};
headers: Record<string, string | string[]>;
}
export class SecureProxyConnectionError extends UndiciError {
name: 'SecureProxyConnectionError';
code: 'UND_ERR_PRX_TLS';
}
}
@@ -0,0 +1,4 @@
function _tdzError(e) {
throw new ReferenceError(e + " is not defined - temporal dead zone");
}
export { _tdzError as default };
@@ -0,0 +1,39 @@
{
"name": "@react-aria/visually-hidden",
"version": "3.8.18",
"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": [
"*.css"
],
"repository": {
"type": "git",
"url": "https://github.com/adobe/react-spectrum"
},
"dependencies": {
"@react-aria/interactions": "^3.22.5",
"@react-aria/utils": "^3.26.0",
"@react-types/shared": "^3.26.0",
"@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 @@
{"mappings":";;;;;;;;;AAIA,SAAS;IACP,OAAO,OAAO,OAAO,cAAc,KAAK;AAC1C;AAQO,SAAS,0CAAqC,OAAwC;IAC3F,MAAM,OAAC,GAAG,OAAE,GAAG,YAAE,QAAQ,EAAC,GAAG;IAE7B,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,UAAU,gBAAA,0BAAA,IAAK,OAAO;QAC1B,IAAI,CAAC,SACH;QAGF,IAAI,CAAC,2CAAqB;YACxB,OAAO,gBAAgB,CAAC,UAAU,UAAU;YAC5C,OAAO;gBACL,OAAO,mBAAmB,CAAC,UAAU,UAAU;YACjD;QACF,OAAO;YAEL,MAAM,yBAAyB,IAAI,OAAO,cAAc,CAAC,CAAC;gBACxD,IAAI,CAAC,QAAQ,MAAM,EACjB;gBAGF;YACF;YACA,uBAAuB,OAAO,CAAC,SAAS;qBAAC;YAAG;YAE5C,OAAO;gBACL,IAAI,SACF,uBAAuB,SAAS,CAAC;YAErC;QACF;IAEF,GAAG;QAAC;QAAU;QAAK;KAAI;AACzB","sources":["packages/@react-aria/utils/src/useResizeObserver.ts"],"sourcesContent":["\nimport {RefObject} from '@react-types/shared';\nimport {useEffect} from 'react';\n\nfunction hasResizeObserver() {\n return typeof window.ResizeObserver !== 'undefined';\n}\n\ntype useResizeObserverOptionsType<T> = {\n ref: RefObject<T | undefined | null> | undefined,\n box?: ResizeObserverBoxOptions,\n onResize: () => void\n}\n\nexport function useResizeObserver<T extends Element>(options: useResizeObserverOptionsType<T>) {\n const {ref, box, onResize} = options;\n\n useEffect(() => {\n let element = ref?.current;\n if (!element) {\n return;\n }\n\n if (!hasResizeObserver()) {\n window.addEventListener('resize', onResize, false);\n return () => {\n window.removeEventListener('resize', onResize, false);\n };\n } else {\n\n const resizeObserverInstance = new window.ResizeObserver((entries) => {\n if (!entries.length) {\n return;\n }\n\n onResize();\n });\n resizeObserverInstance.observe(element, {box});\n\n return () => {\n if (element) {\n resizeObserverInstance.unobserve(element);\n }\n };\n }\n\n }, [onResize, ref, box]);\n}\n"],"names":[],"version":3,"file":"useResizeObserver.main.js.map"}
@@ -0,0 +1,10 @@
export type MessageIds = 'rejectAnError';
export type Options = [
{
allowEmptyReject?: boolean;
allowThrowingAny?: boolean;
allowThrowingUnknown?: boolean;
}
];
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"rejectAnError", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
export default _default;
@@ -0,0 +1,60 @@
var $98hxh$react = require("react");
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "Section", () => $350f13aa4d8b327c$export$6e2c8f0811a474ce);
/*
* 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 $350f13aa4d8b327c$var$Section(props) {
return null;
}
$350f13aa4d8b327c$var$Section.getCollectionNode = function* getCollectionNode(props) {
let { children: children, title: title, items: items } = props;
yield {
type: 'section',
props: props,
hasChildNodes: true,
rendered: title,
'aria-label': props['aria-label'],
*childNodes () {
if (typeof children === 'function') {
if (!items) throw new Error('props.children was a function but props.items is missing');
for (let item of items)yield {
type: 'item',
value: item,
renderer: children
};
} else {
let items = [];
(0, ($parcel$interopDefault($98hxh$react))).Children.forEach(children, (child)=>{
items.push({
type: 'item',
element: child
});
});
yield* items;
}
}
};
};
// We don't want getCollectionNode to show up in the type definition
let $350f13aa4d8b327c$export$6e2c8f0811a474ce = $350f13aa4d8b327c$var$Section;
//# sourceMappingURL=Section.main.js.map
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,gEAAgE;AAChE,gGAAgG;;;AAMhG,MAAM,8BAAQ,SAAS,wBAAwB;AACxC,SAAS,0CAAqB,GAAW,EAAE,IAAY,EAAE,KAAa,EAAE,GAAW;IACxF,OAAO,0CAAgB,KAAK;IAE5B,IAAI,KAAK,OAAO;IAChB,IAAI,cAAc;IAClB,IAAI,SAAS,GACX,cAAc;SACT,IAAI,0CAAW,OACpB,cAAc;IAGhB,OACE,8BACA,IACA,MAAM,KACN,KAAK,KAAK,CAAC,KAAK,KAChB,KAAK,KAAK,CAAC,KAAK,OAChB,KAAK,KAAK,CAAC,KAAK,OAChB,KAAK,KAAK,CAAC,AAAC,CAAA,MAAM,QAAQ,GAAE,IAAK,KAAK,cAAc;AAExD;AAEO,SAAS,0CAAW,IAAY;IACrC,OAAO,OAAO,MAAM,KAAM,CAAA,OAAO,QAAQ,KAAK,OAAO,QAAQ,CAAA;AAC/D;AAEO,SAAS,0CAAgB,GAAW,EAAE,IAAY;IACvD,OAAO,QAAQ,OAAO,IAAI,OAAO;AACnC;AAEO,SAAS,0CAAiB,IAAY;IAC3C,IAAI,MAAM;IACV,IAAI,QAAQ,GAAG;QACb,MAAM;QACN,OAAO,IAAI;IACb;IAEA,OAAO;QAAC;QAAK;KAAK;AACpB;AAEA,MAAM,oCAAc;IAClB,UAAU;QAAC;QAAI;QAAI;QAAI;QAAI;QAAI;QAAI;QAAI;QAAI;QAAI;QAAI;QAAI;KAAG;IAC1D,UAAU;QAAC;QAAI;QAAI;QAAI;QAAI;QAAI;QAAI;QAAI;QAAI;QAAI;QAAI;QAAI;KAAG;AAC5D;AAMO,MAAM;IAGX,cAAc,EAAU,EAAgB;QACtC,IAAI,MAAM;QACV,IAAI,SAAS,MAAM;QACnB,IAAI,aAAa,KAAK,KAAK,CAAC,SAAS;QACrC,IAAI,MAAM,CAAA,GAAA,6BAAE,EAAE,QAAQ;QACtB,IAAI,OAAO,KAAK,KAAK,CAAC,MAAM;QAC5B,IAAI,QAAQ,CAAA,GAAA,6BAAE,EAAE,KAAK;QACrB,IAAI,OAAO,KAAK,KAAK,CAAC,QAAQ;QAC9B,IAAI,QAAQ,CAAA,GAAA,6BAAE,EAAE,OAAO;QACvB,IAAI,SAAS,KAAK,KAAK,CAAC,QAAQ;QAEhC,IAAI,eAAe,aAAa,MAAM,OAAO,MAAM,OAAO,IAAI,SAAU,CAAA,SAAS,KAAK,WAAW,IAAI,IAAI,CAAA;QACzG,IAAI,CAAC,KAAK,KAAK,GAAG,0CAAiB;QACnC,IAAI,UAAU,MAAM,0CAAqB,KAAK,MAAM,GAAG;QACvD,IAAI,UAAU;QACd,IAAI,MAAM,0CAAqB,KAAK,MAAM,GAAG,IAC3C,UAAU;aACL,IAAI,0CAAW,OACpB,UAAU;QAEZ,IAAI,QAAQ,KAAK,KAAK,CAAC,AAAC,CAAA,AAAC,CAAA,UAAU,OAAM,IAAK,KAAK,GAAE,IAAK;QAC1D,IAAI,MAAM,MAAM,0CAAqB,KAAK,MAAM,OAAO,KAAK;QAE5D,OAAO,IAAI,CAAA,GAAA,sCAAW,EAAE,KAAK,MAAM,OAAO;IAC5C;IAEA,YAAY,IAAqB,EAAU;QACzC,OAAO,0CAAqB,KAAK,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK,GAAG;IACvE;IAEA,eAAe,IAAqB,EAAU;QAC5C,OAAO,iCAAW,CAAC,0CAAW,KAAK,IAAI,IAAI,aAAa,WAAW,CAAC,KAAK,KAAK,GAAG,EAAE;IACrF;IAEA,6DAA6D;IAC7D,gBAAgB,IAAqB,EAAU;QAC7C,OAAO;IACT;IAEA,cAAc,IAAqB,EAAU;QAC3C,OAAO,0CAAW,KAAK,IAAI,IAAI,MAAM;IACvC;IAEA,6DAA6D;IAC7D,cAAc,IAAqB,EAAU;QAC3C,OAAO;IACT;IAEA,UAAoB;QAClB,OAAO;YAAC;YAAM;SAAK;IACrB;IAEA,aAAa,IAAqB,EAAW;QAC3C,OAAO,KAAK,GAAG,KAAK;IACtB;IAEA,YAAY,IAA8B,EAAQ;QAChD,IAAI,KAAK,IAAI,IAAI,GAAG;YAClB,KAAK,GAAG,GAAG,KAAK,GAAG,KAAK,OAAO,OAAO;YACtC,KAAK,IAAI,GAAG,IAAI,KAAK,IAAI;QAC3B;IACF;;aA/DA,aAAiC;;AAgEnC","sources":["packages/@internationalized/date/src/calendars/GregorianCalendar.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// Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\nimport {AnyCalendarDate, Calendar, CalendarIdentifier} from '../types';\nimport {CalendarDate} from '../CalendarDate';\nimport {mod, Mutable} from '../utils';\n\nconst EPOCH = 1721426; // 001/01/03 Julian C.E.\nexport function gregorianToJulianDay(era: string, year: number, month: number, day: number): number {\n year = getExtendedYear(era, year);\n\n let y1 = year - 1;\n let monthOffset = -2;\n if (month <= 2) {\n monthOffset = 0;\n } else if (isLeapYear(year)) {\n monthOffset = -1;\n }\n\n return (\n EPOCH -\n 1 +\n 365 * y1 +\n Math.floor(y1 / 4) -\n Math.floor(y1 / 100) +\n Math.floor(y1 / 400) +\n Math.floor((367 * month - 362) / 12 + monthOffset + day)\n );\n}\n\nexport function isLeapYear(year: number): boolean {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function getExtendedYear(era: string, year: number): number {\n return era === 'BC' ? 1 - year : year;\n}\n\nexport function fromExtendedYear(year: number): [string, number] {\n let era = 'AD';\n if (year <= 0) {\n era = 'BC';\n year = 1 - year;\n }\n\n return [era, year];\n}\n\nconst daysInMonth = {\n standard: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],\n leapyear: [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n};\n\n/**\n * The Gregorian calendar is the most commonly used calendar system in the world. It supports two eras: BC, and AD.\n * Years always contain 12 months, and 365 or 366 days depending on whether it is a leap year.\n */\nexport class GregorianCalendar implements Calendar {\n identifier: CalendarIdentifier = 'gregory';\n\n fromJulianDay(jd: number): CalendarDate {\n let jd0 = jd;\n let depoch = jd0 - EPOCH;\n let quadricent = Math.floor(depoch / 146097);\n let dqc = mod(depoch, 146Line truncated
@@ -0,0 +1 @@
{"version":3,"file":"urn.js","sourceRoot":"","sources":["../../../src/schemes/urn.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,OAAO,EAAE,MAAM,QAAQ,CAAC;AAW7C,MAAM,IAAI,GAAG,qCAAqC,CAAC;AACnD,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAC7C,MAAM,OAAO,GAAG,mEAAmE,CAAC;AACpF,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,GAAG,GAAG,GAAG,OAAO,GAAG,KAAK,CAAC;AAC7D,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACxD,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACjE,MAAM,SAAS,GAAG,iBAAiB,CAAC;AACpC,MAAM,YAAY,GAAG,iDAAiD,CAAC;AAEvE,UAAU;AACV,MAAM,OAAO,GAA8C;IAC1D,MAAM,EAAG,KAAK;IAEd,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACpE,IAAI,aAAa,GAAG,UAA2B,CAAC;QAEhD,IAAI,OAAO,EAAE;YACZ,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,IAAI,KAAK,CAAC;YAC/D,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;YACrC,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM,SAAS,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;YACpD,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;YAEzC,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;YACxB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;YACxB,aAAa,CAAC,IAAI,GAAG,SAAS,CAAC;YAE/B,IAAI,aAAa,EAAE;gBAClB,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC,aAAa,EAAE,OAAO,CAAkB,CAAC;aAC7E;SACD;aAAM;YACN,aAAa,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,IAAI,wBAAwB,CAAC;SACtE;QAED,OAAO,aAAa,CAAC;IACtB,CAAC;IAED,SAAS,EAAG,UAAU,aAA2B,EAAE,OAAkB;QACpE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,IAAI,KAAK,CAAC;QAC/D,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC;QAC9B,MAAM,SAAS,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;QACpD,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QAEzC,IAAI,aAAa,EAAE;YAClB,aAAa,GAAG,aAAa,CAAC,SAAS,CAAC,aAAa,EAAE,OAAO,CAAkB,CAAC;SACjF;QAED,MAAM,aAAa,GAAG,aAA8B,CAAC;QACrD,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC;QAC9B,aAAa,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;QAEpD,OAAO,aAAa,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,57 @@
{
"name": "@heroui/spinner",
"version": "2.2.7",
"description": "Loaders express an unspecified wait time or display the length of a process.",
"keywords": [
"loading",
"spinner",
"progress"
],
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"homepage": "https://heroui.com",
"license": "MIT",
"main": "dist/index.js",
"sideEffects": false,
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/heroui-inc/heroui.git",
"directory": "packages/components/loading"
},
"bugs": {
"url": "https://github.com/heroui-inc/heroui/issues"
},
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"@heroui/theme": ">=2.4.0"
},
"dependencies": {
"@heroui/system-rsc": "2.3.6",
"@heroui/shared-utils": "2.1.3",
"@heroui/react-utils": "2.1.4"
},
"clean-package": "../../../clean-package.config.json",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsup src --dts",
"dev": "pnpm build:fast --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"build:fast": "tsup src"
}
}
@@ -0,0 +1,482 @@
'use strict';
var node_crypto = require('node:crypto');
var fs = require('node:fs');
var module$1 = require('node:module');
var path = require('node:path');
var node_url = require('node:url');
var node_worker_threads = require('node:worker_threads');
var core = require('@pkgr/core');
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
const import_meta = {};
const INT32_BYTES = 4;
const TsRunner = {
// https://github.com/TypeStrong/ts-node
TsNode: "ts-node",
// https://github.com/egoist/esbuild-register
EsbuildRegister: "esbuild-register",
// https://github.com/folke/esbuild-runner
EsbuildRunner: "esbuild-runner",
// https://github.com/swc-project/swc-node/tree/master/packages/register
SWC: "swc",
// https://github.com/esbuild-kit/tsx
TSX: "tsx"
};
const {
NODE_OPTIONS,
SYNCKIT_EXEC_ARGV,
SYNCKIT_GLOBAL_SHIMS,
SYNCKIT_TIMEOUT,
SYNCKIT_TS_RUNNER
} = process.env;
const IS_NODE_20 = Number(process.versions.node.split(".")[0]) >= 20;
const DEFAULT_TIMEOUT = SYNCKIT_TIMEOUT ? +SYNCKIT_TIMEOUT : void 0;
const DEFAULT_EXEC_ARGV = (SYNCKIT_EXEC_ARGV == null ? void 0 : SYNCKIT_EXEC_ARGV.split(",")) || [];
const DEFAULT_TS_RUNNER = SYNCKIT_TS_RUNNER;
const DEFAULT_GLOBAL_SHIMS = ["1", "true"].includes(
SYNCKIT_GLOBAL_SHIMS
);
const DEFAULT_GLOBAL_SHIMS_PRESET = [
{
moduleName: "node-fetch",
globalName: "fetch"
},
{
moduleName: "node:perf_hooks",
globalName: "performance",
named: "performance"
}
];
const MTS_SUPPORTED_NODE_VERSION = 16;
let syncFnCache;
function extractProperties(object) {
if (object && typeof object === "object") {
const properties = {};
for (const key in object) {
properties[key] = object[key];
}
return properties;
}
}
function createSyncFn(workerPath, timeoutOrOptions) {
syncFnCache != null ? syncFnCache : syncFnCache = /* @__PURE__ */ new Map();
const cachedSyncFn = syncFnCache.get(workerPath);
if (cachedSyncFn) {
return cachedSyncFn;
}
if (!path.isAbsolute(workerPath)) {
throw new Error("`workerPath` must be absolute");
}
const syncFn = startWorkerThread(
workerPath,
/* istanbul ignore next */
typeof timeoutOrOptions === "number" ? { timeout: timeoutOrOptions } : timeoutOrOptions
);
syncFnCache.set(workerPath, syncFn);
return syncFn;
}
const cjsRequire = typeof require === "undefined" ? module$1.createRequire(import_meta.url) : (
/* istanbul ignore next */
require
);
const dataUrl = (code) => new URL(`data:text/javascript,${encodeURIComponent(code)}`);
const isFile = (path2) => {
var _a;
try {
return !!((_a = fs.statSync(path2, { throwIfNoEntry: false })) == null ? void 0 : _a.isFile());
} catch (e) {
return false;
}
};
const setupTsRunner = (workerPath, { execArgv, tsRunner }) => {
let ext = path.extname(workerPath);
if (!/[/\\]node_modules[/\\]/.test(workerPath) && (!ext || /^\.[cm]?js$/.test(ext))) {
const workPathWithoutExt = ext ? workerPath.slice(0, -ext.length) : workerPath;
let extensions;
switch (ext) {
case ".cjs": {
extensions = [".cts", ".cjs"];
break;
}
case ".mjs": {
extensions = [".mts", ".mjs"];
break;
}
default: {
extensions = [".ts", ".js"];
break;
}
}
const found = core.tryExtensions(workPathWithoutExt, extensions);
let differentExt;
if (found && (!ext || (differentExt = found !== workPathWithoutExt))) {
workerPath = found;
if (differentExt) {
ext = path.extname(workerPath);
}
}
}
const isTs = /\.[cm]?ts$/.test(workerPath);
let jsUseEsm = workerPath.endsWith(".mjs");
let tsUseEsm = workerPath.endsWith(".mts");
if (isTs) {
if (!tsUseEsm) {
const pkg = core.findUp(workerPath);
if (pkg) {
tsUseEsm = cjsRequire(pkg).type === "module";
}
}
if (tsRunner == null && core.isPkgAvailable(TsRunner.TsNode)) {
tsRunner = TsRunner.TsNode;
}
switch (tsRunner) {
case TsRunner.TsNode: {
if (tsUseEsm) {
if (!execArgv.includes("--loader")) {
execArgv = ["--loader", `${TsRunner.TsNode}/esm`, ...execArgv];
}
} else if (!execArgv.includes("-r")) {
execArgv = ["-r", `${TsRunner.TsNode}/register`, ...execArgv];
}
break;
}
case TsRunner.EsbuildRegister: {
if (!execArgv.includes("-r")) {
execArgv = ["-r", TsRunner.EsbuildRegister, ...execArgv];
}
break;
}
case TsRunner.EsbuildRunner: {
if (!execArgv.includes("-r")) {
execArgv = ["-r", `${TsRunner.EsbuildRunner}/register`, ...execArgv];
}
break;
}
case TsRunner.SWC: {
if (!execArgv.includes("-r")) {
execArgv = ["-r", `@${TsRunner.SWC}-node/register`, ...execArgv];
}
break;
}
case TsRunner.TSX: {
if (!execArgv.includes("--loader")) {
execArgv = ["--loader", TsRunner.TSX, ...execArgv];
}
break;
}
default: {
throw new Error(`Unknown ts runner: ${String(tsRunner)}`);
}
}
} else if (!jsUseEsm) {
const pkg = core.findUp(workerPath);
if (pkg) {
jsUseEsm = cjsRequire(pkg).type === "module";
}
}
let resolvedPnpLoaderPath;
if (process.versions.pnp) {
const nodeOptions = NODE_OPTIONS == null ? void 0 : NODE_OPTIONS.split(/\s+/);
let pnpApiPath;
try {
pnpApiPath = cjsRequire.resolve("pnpapi");
} catch (e) {
}
if (pnpApiPath && !(nodeOptions == null ? void 0 : nodeOptions.some(
(option, index) => ["-r", "--require"].includes(option) && pnpApiPath === cjsRequire.resolve(nodeOptions[index + 1])
)) && !execArgv.includes(pnpApiPath)) {
execArgv = ["-r", pnpApiPath, ...execArgv];
const pnpLoaderPath = path.resolve(pnpApiPath, "../.pnp.loader.mjs");
if (isFile(pnpLoaderPath)) {
resolvedPnpLoaderPath = node_url.pathToFileURL(pnpLoaderPath).toString();
if (!IS_NODE_20) {
execArgv = [
"--experimental-loader",
resolvedPnpLoaderPath,
...execArgv
];
}
}
}
}
return {
ext,
isTs,
jsUseEsm,
tsRunner,
tsUseEsm,
workerPath,
pnpLoaderPath: resolvedPnpLoaderPath,
execArgv
};
};
const md5Hash = (text) => node_crypto.createHash("md5").update(text).digest("hex");
const encodeImportModule = (moduleNameOrGlobalShim, type = "import") => {
const { moduleName, globalName, named, conditional } = typeof moduleNameOrGlobalShim === "string" ? { moduleName: moduleNameOrGlobalShim } : moduleNameOrGlobalShim;
const importStatement = type === "import" ? `import${globalName ? " " + (named === null ? "* as " + globalName : (named == null ? void 0 : named.trim()) ? `{${named}}` : globalName) + " from" : ""} '${path.isAbsolute(moduleName) ? String(node_url.pathToFileURL(moduleName)) : moduleName}'` : `${globalName ? "const " + ((named == null ? void 0 : named.trim()) ? `{${named}}` : globalName) + "=" : ""}require('${moduleName.replace(/\\/g, "\\\\")}')`;
if (!globalName) {
return importStatement;
}
const overrideStatement = `globalThis.${globalName}=${(named == null ? void 0 : named.trim()) ? named : globalName}`;
return importStatement + (conditional === false ? `;${overrideStatement}` : `;if(!globalThis.${globalName})${overrideStatement}`);
};
const _generateGlobals = (globalShims, type) => globalShims.reduce(
(acc, shim) => `${acc}${acc ? ";" : ""}${encodeImportModule(shim, type)}`,
""
);
let globalsCache;
let tmpdir;
const _dirname = typeof __dirname === "undefined" ? path.dirname(node_url.fileURLToPath(import_meta.url)) : (
/* istanbul ignore next */
__dirname
);
let sharedBuffer;
let sharedBufferView;
const generateGlobals = (workerPath, globalShims, type = "import") => {
globalsCache != null ? globalsCache : globalsCache = /* @__PURE__ */ new Map();
const cached = globalsCache.get(workerPath);
if (cached) {
const [content2, filepath2] = cached;
if (type === "require" && !filepath2 || type === "import" && filepath2 && isFile(filepath2)) {
return content2;
}
}
const globals = _generateGlobals(globalShims, type);
let content = globals;
let filepath;
if (type === "import") {
if (!tmpdir) {
tmpdir = path.resolve(core.findUp(_dirname), "../node_modules/.synckit");
}
fs.mkdirSync(tmpdir, { recursive: true });
filepath = path.resolve(tmpdir, md5Hash(workerPath) + ".mjs");
content = encodeImportModule(filepath);
fs.writeFileSync(filepath, globals);
}
globalsCache.set(workerPath, [content, filepath]);
return content;
};
function startWorkerThread(workerPath, {
timeout = DEFAULT_TIMEOUT,
execArgv = DEFAULT_EXEC_ARGV,
tsRunner = DEFAULT_TS_RUNNER,
transferList = [],
globalShims = DEFAULT_GLOBAL_SHIMS
} = {}) {
const { port1: mainPort, port2: workerPort } = new node_worker_threads.MessageChannel();
const {
isTs,
ext,
jsUseEsm,
tsUseEsm,
tsRunner: finalTsRunner,
workerPath: finalWorkerPath,
pnpLoaderPath,
execArgv: finalExecArgv
} = setupTsRunner(workerPath, { execArgv, tsRunner });
const workerPathUrl = node_url.pathToFileURL(finalWorkerPath);
if (/\.[cm]ts$/.test(finalWorkerPath)) {
const isTsxSupported = !tsUseEsm || Number.parseFloat(process.versions.node) >= MTS_SUPPORTED_NODE_VERSION;
if (!finalTsRunner) {
throw new Error("No ts runner specified, ts worker path is not supported");
} else if ([
// https://github.com/egoist/esbuild-register/issues/79
TsRunner.EsbuildRegister,
// https://github.com/folke/esbuild-runner/issues/67
TsRunner.EsbuildRunner,
// https://github.com/swc-project/swc-node/issues/667
TsRunner.SWC,
.../* istanbul ignore next */
isTsxSupported ? [] : [TsRunner.TSX]
].includes(finalTsRunner)) {
throw new Error(
`${finalTsRunner} is not supported for ${ext} files yet` + /* istanbul ignore next */
(isTsxSupported ? ", you can try [tsx](https://github.com/esbuild-kit/tsx) instead" : "")
);
}
}
const finalGlobalShims = (globalShims === true ? DEFAULT_GLOBAL_SHIMS_PRESET : Array.isArray(globalShims) ? globalShims : []).filter(({ moduleName }) => core.isPkgAvailable(moduleName));
sharedBufferView != null ? sharedBufferView : sharedBufferView = new Int32Array(
/* istanbul ignore next */
sharedBuffer != null ? sharedBuffer : sharedBuffer = new SharedArrayBuffer(
INT32_BYTES
),
0,
1
);
const useGlobals = finalGlobalShims.length > 0;
const useEval = isTs ? !tsUseEsm : !jsUseEsm && useGlobals;
const worker = new node_worker_threads.Worker(
jsUseEsm && useGlobals || tsUseEsm && finalTsRunner === TsRunner.TsNode ? dataUrl(
`${generateGlobals(
finalWorkerPath,
finalGlobalShims
)};import '${String(workerPathUrl)}'`
) : useEval ? `${generateGlobals(
finalWorkerPath,
finalGlobalShims,
"require"
)};${encodeImportModule(finalWorkerPath, "require")}` : workerPathUrl,
{
eval: useEval,
workerData: { sharedBuffer, workerPort, pnpLoaderPath },
transferList: [workerPort, ...transferList],
execArgv: finalExecArgv
}
);
let nextID = 0;
const receiveMessageWithId = (port, expectedId, waitingTimeout) => {
const start = Date.now();
const status = Atomics.wait(sharedBufferView, 0, 0, waitingTimeout);
Atomics.store(sharedBufferView, 0, 0);
if (!["ok", "not-equal"].includes(status)) {
const abortMsg = {
id: expectedId,
cmd: "abort"
};
port.postMessage(abortMsg);
throw new Error("Internal error: Atomics.wait() failed: " + status);
}
const result = node_worker_threads.receiveMessageOnPort(mainPort);
const msg = result == null ? void 0 : result.message;
if ((msg == null ? void 0 : msg.id) == null || msg.id < expectedId) {
const waitingTime = Date.now() - start;
return receiveMessageWithId(
port,
expectedId,
waitingTimeout ? waitingTimeout - waitingTime : void 0
);
}
const _a = msg, { id } = _a, message = __objRest(_a, ["id"]);
if (id < expectedId) {
const waitingTime = Date.now() - start;
return receiveMessageWithId(
port,
expectedId,
waitingTimeout ? waitingTimeout - waitingTime : void 0
);
}
if (expectedId !== id) {
throw new Error(
`Internal error: Expected id ${expectedId} but got id ${id}`
);
}
return __spreadValues({ id }, message);
};
const syncFn = (...args) => {
const id = nextID++;
const msg = { id, args };
worker.postMessage(msg);
const { result, error, properties } = receiveMessageWithId(
mainPort,
id,
timeout
);
if (error) {
throw Object.assign(error, properties);
}
return result;
};
worker.unref();
return syncFn;
}
function runAsWorker(fn) {
if (!node_worker_threads.workerData) {
return;
}
const { workerPort, sharedBuffer: sharedBuffer2, pnpLoaderPath } = node_worker_threads.workerData;
if (pnpLoaderPath && IS_NODE_20) {
module$1.register(pnpLoaderPath);
}
const sharedBufferView2 = new Int32Array(sharedBuffer2, 0, 1);
node_worker_threads.parentPort.on(
"message",
({ id, args }) => {
(() => __async(this, null, function* () {
let isAborted = false;
const handleAbortMessage = (msg2) => {
if (msg2.id === id && msg2.cmd === "abort") {
isAborted = true;
}
};
workerPort.on("message", handleAbortMessage);
let msg;
try {
msg = { id, result: yield fn(...args) };
} catch (error) {
msg = { id, error, properties: extractProperties(error) };
}
workerPort.off("message", handleAbortMessage);
if (isAborted) {
return;
}
workerPort.postMessage(msg);
Atomics.add(sharedBufferView2, 0, 1);
Atomics.notify(sharedBufferView2, 0);
}))();
}
);
}
exports.DEFAULT_EXEC_ARGV = DEFAULT_EXEC_ARGV;
exports.DEFAULT_GLOBAL_SHIMS = DEFAULT_GLOBAL_SHIMS;
exports.DEFAULT_GLOBAL_SHIMS_PRESET = DEFAULT_GLOBAL_SHIMS_PRESET;
exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT;
exports.DEFAULT_TS_RUNNER = DEFAULT_TS_RUNNER;
exports.MTS_SUPPORTED_NODE_VERSION = MTS_SUPPORTED_NODE_VERSION;
exports.TsRunner = TsRunner;
exports._generateGlobals = _generateGlobals;
exports.createSyncFn = createSyncFn;
exports.encodeImportModule = encodeImportModule;
exports.extractProperties = extractProperties;
exports.generateGlobals = generateGlobals;
exports.isFile = isFile;
exports.runAsWorker = runAsWorker;
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Jordan Harband
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,127 @@
/**
* @fileoverview A rule to warn against using arrow functions when they could be
* confused with comparisons
* @author Jxck <https://github.com/Jxck>
* @deprecated in ESLint v8.53.0
*/
"use strict";
const astUtils = require("./utils/ast-utils.js");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Checks whether or not a node is a conditional expression.
* @param {ASTNode} node node to test
* @returns {boolean} `true` if the node is a conditional expression.
*/
function isConditional(node) {
return node && node.type === "ConditionalExpression";
}
//------------------------------------------------------------------------------
// 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-confusing-arrow",
url: "https://eslint.style/rules/no-confusing-arrow",
},
},
],
},
type: "suggestion",
docs: {
description:
"Disallow arrow functions where they could be confused with comparisons",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-confusing-arrow",
},
fixable: "code",
schema: [
{
type: "object",
properties: {
allowParens: { type: "boolean", default: true },
onlyOneSimpleParam: { type: "boolean", default: false },
},
additionalProperties: false,
},
],
messages: {
confusing:
"Arrow function used ambiguously with a conditional expression.",
},
},
create(context) {
const config = context.options[0] || {};
const allowParens = config.allowParens || config.allowParens === void 0;
const onlyOneSimpleParam = config.onlyOneSimpleParam;
const sourceCode = context.sourceCode;
/**
* Reports if an arrow function contains an ambiguous conditional.
* @param {ASTNode} node A node to check and report.
* @returns {void}
*/
function checkArrowFunc(node) {
const body = node.body;
if (
isConditional(body) &&
!(allowParens && astUtils.isParenthesised(sourceCode, body)) &&
!(
onlyOneSimpleParam &&
!(
node.params.length === 1 &&
node.params[0].type === "Identifier"
)
)
) {
context.report({
node,
messageId: "confusing",
fix(fixer) {
// if `allowParens` is not set to true don't bother wrapping in parens
return (
allowParens &&
fixer.replaceText(
node.body,
`(${sourceCode.getText(node.body)})`,
)
);
},
});
}
}
return {
ArrowFunctionExpression: checkArrowFunc,
};
},
};
@@ -0,0 +1,229 @@
'use strict';
const fs = require('fs');
const path = require('path');
const mkdirp = require('mkdirp');
const pump = require('pump');
// file/fileBuffer/stream
exports.sourceType = source => {
if (!source) return undefined;
if (source instanceof Buffer) return 'buffer';
if (typeof source._read === 'function' || typeof source._transform === 'function') return 'stream';
if (typeof source !== 'string') {
const err = new Error('Type is not supported, must be a file path, file buffer, or a readable stream');
err.name = 'IlligalSourceError';
throw err;
}
return 'file';
};
function destType(dest) {
if (typeof dest._write === 'function' || typeof dest._transform === 'function') return 'stream';
if (typeof dest !== 'string') {
const err = new Error('Type is not supported, must be a file path, or a writable stream');
err.name = 'IlligalDestinationError';
throw err;
}
return 'path';
}
exports.destType = destType;
const illigalEntryError = new Error('Type is not supported, must be a file path, directory path, file buffer, or a readable stream');
illigalEntryError.name = 'IlligalEntryError';
// fileOrDir/fileBuffer/stream
exports.entryType = entry => {
if (!entry) return;
if (entry instanceof Buffer) return 'buffer';
if (typeof entry._read === 'function' || typeof entry._transform === 'function') return 'stream';
if (typeof entry !== 'string') throw illigalEntryError;
return 'fileOrDir';
};
exports.clone = obj => {
const newObj = {};
for (const i in obj) {
newObj[i] = obj[i];
}
return newObj;
};
exports.makeFileProcessFn = StreamClass => {
return (source, dest, opts) => {
opts = opts || {};
opts.source = source;
const destStream = destType(dest) === 'path' ? fs.createWriteStream(dest) : dest;
const compressStream = new StreamClass(opts);
return safePipe([ compressStream, destStream ]);
};
};
exports.makeCompressDirFn = StreamClass => {
return (dir, dest, opts) => {
const destStream = destType(dest) === 'path' ? fs.createWriteStream(dest) : dest;
const compressStream = new StreamClass();
compressStream.addEntry(dir, opts);
return safePipe([ compressStream, destStream ]);
};
};
exports.makeUncompressFn = StreamClass => {
return (source, destDir, opts) => {
opts = opts || {};
opts.source = source;
if (!source) { // !source 和 sourceType中返回undeined对应
const error = new Error('Type is not supported, must be a file path, file buffer, or a readable stream');
error.name = 'IlligalSourceError';
throw error;
}
if (destType(destDir) !== 'path') {
const error = new Error('uncompress destination must be a directory');
error.name = 'IlligalDestError';
throw error;
}
return new Promise((resolve, reject) => {
mkdirp(destDir, err => {
if (err) return reject(err);
let entryCount = 0;
let successCount = 0;
let isFinish = false;
function done() {
// resolve when both stream finish and file write finish
if (isFinish && entryCount === successCount) resolve();
}
new StreamClass(opts)
.on('finish', () => {
isFinish = true;
done();
})
.on('error', reject)
.on('entry', (header, stream, next) => {
stream.on('end', next);
const destFilePath = path.join(destDir, header.name);
if (header.type === 'file') {
const dir = path.dirname(destFilePath);
mkdirp(dir, err => {
if (err) return reject(err);
entryCount++;
pump(stream, fs.createWriteStream(destFilePath, { mode: opts.mode || header.mode }), err => {
if (err) return reject(err);
successCount++;
done();
});
});
} else if (header.type === 'symlink') {
const dir = path.dirname(destFilePath);
const target = path.resolve(dir, header.linkname);
entryCount++;
mkdirp(dir, err => {
if (err) return reject(err);
const relativeTarget = path.relative(dir, target);
fs.symlink(relativeTarget, destFilePath, err => {
if (err) return reject(err);
successCount++;
stream.resume();
});
});
} else { // directory
mkdirp(destFilePath, err => {
if (err) return reject(err);
stream.resume();
});
}
});
});
});
};
};
exports.streamToBuffer = stream => {
return new Promise((resolve, reject) => {
const chunks = [];
stream
.on('readable', () => {
let chunk;
while ((chunk = stream.read())) chunks.push(chunk);
})
.on('end', () => resolve(Buffer.concat(chunks)))
.on('error', err => reject(err));
});
};
function safePipe(streams) {
return new Promise((resolve, reject) => {
pump(streams[0], streams[1], err => {
if (err) return reject(err);
resolve();
});
});
}
exports.safePipe = safePipe;
function normalizePath(fileName) {
fileName = path.normalize(fileName);
// https://nodejs.org/api/path.html#path_path_normalize_path
if (process.platform === 'win32') fileName = fileName.replace(/\\+/g, '/');
return fileName;
}
function stripFileName(strip, fileName, type) {
// before
// node/package.json
// node/lib/index.js
//
// when strip 1
// package.json
// lib/index.js
//
// when strip 2
// package.json
// index.js
if (Buffer.isBuffer(fileName)) fileName = fileName.toString();
// use / instead of \\
if (fileName.indexOf('\\') !== -1) fileName = fileName.replace(/\\+/g, '/');
// fix absolute path
// /foo => foo
if (fileName[0] === '/') fileName = fileName.replace(/^\/+/, '');
// fix case
// ./foo/bar => foo/bar
if (fileName) {
fileName = normalizePath(fileName);
}
let s = fileName.split('/');
// fix relative path
// foo/../bar/../../asdf/
// => asdf/
if (s.indexOf('..') !== -1) {
// replace '../' on ../../foo/bar
fileName = fileName.replace(/(\.\.\/)+/, '');
if (type === 'directory' && fileName && fileName[fileName.length - 1] !== '/') {
fileName += '/';
}
s = fileName.split('/');
}
strip = Math.min(strip, s.length - 1);
return s.slice(strip).join('/') || '/';
}
exports.stripFileName = stripFileName;
@@ -0,0 +1,69 @@
import OverloadYield from "./OverloadYield.js";
function _wrapAsyncGenerator(e) {
return function () {
return new AsyncGenerator(e.apply(this, arguments));
};
}
function AsyncGenerator(e) {
var r, t;
function resume(r, t) {
try {
var n = e[r](t),
o = n.value,
u = o instanceof OverloadYield;
Promise.resolve(u ? o.v : o).then(function (t) {
if (u) {
var i = "return" === r ? "return" : "next";
if (!o.k || t.done) return resume(i, t);
t = e[i](t).value;
}
settle(n.done ? "return" : "normal", t);
}, function (e) {
resume("throw", e);
});
} catch (e) {
settle("throw", e);
}
}
function settle(e, n) {
switch (e) {
case "return":
r.resolve({
value: n,
done: !0
});
break;
case "throw":
r.reject(n);
break;
default:
r.resolve({
value: n,
done: !1
});
}
(r = r.next) ? resume(r.key, r.arg) : t = null;
}
this._invoke = function (e, n) {
return new Promise(function (o, u) {
var i = {
key: e,
arg: n,
resolve: o,
reject: u,
next: null
};
t ? t = t.next = i : (r = t = i, resume(e, n));
});
}, "function" != typeof e["return"] && (this["return"] = void 0);
}
AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () {
return this;
}, AsyncGenerator.prototype.next = function (e) {
return this._invoke("next", e);
}, AsyncGenerator.prototype["throw"] = function (e) {
return this._invoke("throw", e);
}, AsyncGenerator.prototype["return"] = function (e) {
return this._invoke("return", e);
};
export { _wrapAsyncGenerator as default };
@@ -0,0 +1,56 @@
import arrayEvery from './_arrayEvery.js';
import baseEvery from './_baseEvery.js';
import baseIteratee from './_baseIteratee.js';
import isArray from './isArray.js';
import isIterateeCall from './_isIterateeCall.js';
/**
* Checks if `predicate` returns truthy for **all** elements of `collection`.
* Iteration is stopped once `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* **Note:** This method returns `true` for
* [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
* [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
* elements of empty collections.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
* @example
*
* _.every([true, 1, null, 'yes'], Boolean);
* // => false
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.every(users, { 'user': 'barney', 'active': false });
* // => false
*
* // The `_.matchesProperty` iteratee shorthand.
* _.every(users, ['active', false]);
* // => true
*
* // The `_.property` iteratee shorthand.
* _.every(users, 'active');
* // => false
*/
function every(collection, predicate, guard) {
var func = isArray(collection) ? arrayEvery : baseEvery;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, baseIteratee(predicate, 3));
}
export default every;
@@ -0,0 +1,139 @@
'use strict'
const { describe, it, after } = require('mocha')
const assert = require('assert')
const path = require('path')
const os = require('os')
const util = require('util')
const { test: { download, install } } = require('../lib/install')
const rimraf = require('rimraf')
const gyp = require('../lib/node-gyp')
const log = require('npmlog')
const semver = require('semver')
const stream = require('stream')
const streamPipeline = util.promisify(stream.pipeline)
log.level = 'error' // we expect a warning
const TIMEOUT = 20 * 60 * 1000
describe('install', function () {
it('EACCES retry once', async () => {
const fs = {
promises: {
stat (_) {
const err = new Error()
err.code = 'EACCES'
assert.ok(true)
throw err
}
}
}
const Gyp = {
devDir: __dirname,
opts: {
ensure: true
},
commands: {
install (argv, cb) {
install(fs, Gyp, argv).then(cb, cb)
},
remove (_, cb) {
cb()
}
}
}
try {
await install(fs, Gyp, [])
} catch (err) {
assert.ok(true)
if (/"pre" versions of node cannot be installed/.test(err.message)) {
assert.ok(true)
}
}
})
// only run these tests if we are running a version of Node with predictable version path behavior
const skipParallelInstallTests = process.env.FAST_TEST ||
process.release.name !== 'node' ||
semver.prerelease(process.version) !== null ||
semver.satisfies(process.version, '<10')
async function parallelInstallsTest (test, fs, devDir, prog) {
if (skipParallelInstallTests) {
return test.skip('Skipping parallel installs test due to test environment configuration')
}
after(async () => {
await util.promisify(rimraf)(devDir)
})
const expectedDir = path.join(devDir, process.version.replace(/^v/, ''))
await util.promisify(rimraf)(expectedDir)
await Promise.all([
install(fs, prog, []),
install(fs, prog, []),
install(fs, prog, []),
install(fs, prog, []),
install(fs, prog, []),
install(fs, prog, []),
install(fs, prog, []),
install(fs, prog, []),
install(fs, prog, []),
install(fs, prog, [])
])
}
it('parallel installs (ensure=true)', async function () {
this.timeout(TIMEOUT)
const fs = require('graceful-fs')
const devDir = await util.promisify(fs.mkdtemp)(path.join(os.tmpdir(), 'node-gyp-test-'))
const prog = gyp()
prog.parseArgv([])
prog.devDir = devDir
prog.opts.ensure = true
log.level = 'warn'
await parallelInstallsTest(this, fs, devDir, prog)
})
it('parallel installs (ensure=false)', async function () {
this.timeout(TIMEOUT)
const fs = require('graceful-fs')
const devDir = await util.promisify(fs.mkdtemp)(path.join(os.tmpdir(), 'node-gyp-test-'))
const prog = gyp()
prog.parseArgv([])
prog.devDir = devDir
prog.opts.ensure = false
log.level = 'warn'
await parallelInstallsTest(this, fs, devDir, prog)
})
it('parallel installs (tarball)', async function () {
this.timeout(TIMEOUT)
const fs = require('graceful-fs')
const devDir = await util.promisify(fs.mkdtemp)(path.join(os.tmpdir(), 'node-gyp-test-'))
const prog = gyp()
prog.parseArgv([])
prog.devDir = devDir
prog.opts.tarball = path.join(devDir, 'node-headers.tar.gz')
log.level = 'warn'
await streamPipeline(
(await download(prog, `https://nodejs.org/dist/${process.version}/node-${process.version}.tar.gz`)).body,
fs.createWriteStream(prog.opts.tarball)
)
await parallelInstallsTest(this, fs, devDir, prog)
})
})
@@ -0,0 +1,9 @@
{
"extends": "@ljharb/tsconfig",
"compilerOptions": {
"target": "ESNext",
},
"exclude": [
"coverage",
],
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"2":"C L M G N O P","33":"0 1 2 3 4 5 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"2":"0 1 2 3 4 5 6 7 8 9 xC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC 0C 1C"},D:{"33":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC"},E:{"2":"2C ZC","33":"J ZB K D E F A B C L M G 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED"},F:{"2":"F B C FD GD HD ID NC uC JD OC","33":"0 1 2 3 4 5 6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{"33":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"2":"hD"},I:{"33":"TC J I iD jD kD lD vC mD nD"},J:{"33":"D A"},K:{"2":"A B C NC uC OC","33":"H"},L:{"33":"I"},M:{"2":"MC"},N:{"2":"A B"},O:{"33":"PC"},P:{"33":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"33":"zD"},R:{"33":"0D"},S:{"2":"1D 2D"}},B:7,C:"CSS Reflections",D:true};
@@ -0,0 +1,69 @@
'use strict';
var isCallable = require('is-callable');
var toStr = Object.prototype.toString;
var hasOwnProperty = Object.prototype.hasOwnProperty;
/** @type {<This, A extends readonly unknown[]>(arr: A, iterator: (this: This | void, value: A[number], index: number, arr: A) => void, receiver: This | undefined) => void} */
var forEachArray = function forEachArray(array, iterator, receiver) {
for (var i = 0, len = array.length; i < len; i++) {
if (hasOwnProperty.call(array, i)) {
if (receiver == null) {
iterator(array[i], i, array);
} else {
iterator.call(receiver, array[i], i, array);
}
}
}
};
/** @type {<This, S extends string>(string: S, iterator: (this: This | void, value: S[number], index: number, string: S) => void, receiver: This | undefined) => void} */
var forEachString = function forEachString(string, iterator, receiver) {
for (var i = 0, len = string.length; i < len; i++) {
// no such thing as a sparse string.
if (receiver == null) {
iterator(string.charAt(i), i, string);
} else {
iterator.call(receiver, string.charAt(i), i, string);
}
}
};
/** @type {<This, O>(obj: O, iterator: (this: This | void, value: O[keyof O], index: keyof O, obj: O) => void, receiver: This | undefined) => void} */
var forEachObject = function forEachObject(object, iterator, receiver) {
for (var k in object) {
if (hasOwnProperty.call(object, k)) {
if (receiver == null) {
iterator(object[k], k, object);
} else {
iterator.call(receiver, object[k], k, object);
}
}
}
};
/** @type {(x: unknown) => x is readonly unknown[]} */
function isArray(x) {
return toStr.call(x) === '[object Array]';
}
/** @type {import('.')._internal} */
module.exports = function forEach(list, iterator, thisArg) {
if (!isCallable(iterator)) {
throw new TypeError('iterator must be a function');
}
var receiver;
if (arguments.length >= 3) {
receiver = thisArg;
}
if (isArray(list)) {
forEachArray(list, iterator, receiver);
} else if (typeof list === 'string') {
forEachString(list, iterator, receiver);
} else {
forEachObject(list, iterator, receiver);
}
};
@@ -0,0 +1,10 @@
/**
* HTML URL properties.
*
* Each key is a property name and each value is a list of tag names it applies
* to or `null` if it applies to all elements.
*
* @type {Record<string, Array<string> | null>}
*/
export const urlAttributes: Record<string, Array<string> | null>;
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,21 @@
'use strict';
var $TypeError = require('es-errors/type');
var ToInt32 = require('../ToInt32');
var ToUint32 = require('../ToUint32');
// https://262.ecma-international.org/11.0/#sec-numeric-types-number-signedRightShift
module.exports = function NumberSignedRightShift(x, y) {
if (typeof x !== 'number' || typeof y !== 'number') {
throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers');
}
var lnum = ToInt32(x);
var rnum = ToUint32(y);
var shiftCount = rnum & 0x1F;
return lnum >> shiftCount;
};
@@ -0,0 +1,74 @@
import { ConfigExtension, GenericConfig } from './types'
/**
* @param baseConfig Config where other config will be merged into. This object will be mutated.
* @param configExtension Partial config to merge into the `baseConfig`.
*/
export const mergeConfigs = <ClassGroupIds extends string, ThemeGroupIds extends string = never>(
baseConfig: GenericConfig,
{
cacheSize,
prefix,
separator,
experimentalParseClassName,
extend = {},
override = {},
}: ConfigExtension<ClassGroupIds, ThemeGroupIds>,
) => {
overrideProperty(baseConfig, 'cacheSize', cacheSize)
overrideProperty(baseConfig, 'prefix', prefix)
overrideProperty(baseConfig, 'separator', separator)
overrideProperty(baseConfig, 'experimentalParseClassName', experimentalParseClassName)
for (const configKey in override) {
overrideConfigProperties(
baseConfig[configKey as keyof typeof override],
override[configKey as keyof typeof override],
)
}
for (const key in extend) {
mergeConfigProperties(
baseConfig[key as keyof typeof extend],
extend[key as keyof typeof extend],
)
}
return baseConfig
}
const overrideProperty = <T extends object, K extends keyof T>(
baseObject: T,
overrideKey: K,
overrideValue: T[K] | undefined,
) => {
if (overrideValue !== undefined) {
baseObject[overrideKey] = overrideValue
}
}
const overrideConfigProperties = (
baseObject: Partial<Record<string, readonly unknown[]>>,
overrideObject: Partial<Record<string, readonly unknown[]>> | undefined,
) => {
if (overrideObject) {
for (const key in overrideObject) {
overrideProperty(baseObject, key, overrideObject[key])
}
}
}
const mergeConfigProperties = (
baseObject: Partial<Record<string, readonly unknown[]>>,
mergeObject: Partial<Record<string, readonly unknown[]>> | undefined,
) => {
if (mergeObject) {
for (const key in mergeObject) {
const mergeValue = mergeObject[key]
if (mergeValue !== undefined) {
baseObject[key] = (baseObject[key] || []).concat(mergeValue)
}
}
}
}
@@ -0,0 +1,21 @@
import type { TSchema } from '../schema/index';
import type { Assert, Ensure } from '../helpers/index';
import type { TMappedResult } from '../mapped/index';
import type { SchemaOptions } from '../schema/index';
import { type TLiteral, type TLiteralValue } from '../literal/index';
import { type TNumber } from '../number/index';
import { TComputed } from '../computed/index';
import { type TRef } from '../ref/index';
import { type TKeyOfPropertyKeys } from './keyof-property-keys';
import { type TUnionEvaluated } from '../union/index';
import { type TKeyOfFromMappedResult } from './keyof-from-mapped-result';
type TFromComputed<Target extends string, Parameters extends TSchema[]> = Ensure<TComputed<'KeyOf', [TComputed<Target, Parameters>]>>;
type TFromRef<Ref extends string> = Ensure<TComputed<'KeyOf', [TRef<Ref>]>>;
/** `[Internal]` Used by KeyOfFromMappedResult */
export type TKeyOfFromType<Type extends TSchema, PropertyKeys extends PropertyKey[] = TKeyOfPropertyKeys<Type>, PropertyKeyTypes extends TSchema[] = TKeyOfPropertyKeysToRest<PropertyKeys>, Result = TUnionEvaluated<PropertyKeyTypes>> = Ensure<Result>;
export type TKeyOfPropertyKeysToRest<PropertyKeys extends PropertyKey[], Result extends TSchema[] = []> = (PropertyKeys extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? L extends '[number]' ? TKeyOfPropertyKeysToRest<R, [...Result, TNumber]> : TKeyOfPropertyKeysToRest<R, [...Result, TLiteral<Assert<L, TLiteralValue>>]> : Result);
export declare function KeyOfPropertyKeysToRest<PropertyKeys extends PropertyKey[]>(propertyKeys: [...PropertyKeys]): TKeyOfPropertyKeysToRest<PropertyKeys>;
export type TKeyOf<Type extends TSchema> = (Type extends TComputed<infer Target extends string, infer Parameters extends TSchema[]> ? TFromComputed<Target, Parameters> : Type extends TRef<infer Ref extends string> ? TFromRef<Ref> : Type extends TMappedResult ? TKeyOfFromMappedResult<Type> : TKeyOfFromType<Type>);
/** `[Json]` Creates a KeyOf type */
export declare function KeyOf<Type extends TSchema>(type: Type, options?: SchemaOptions): TKeyOf<Type>;
export {};
@@ -0,0 +1,44 @@
import baseFindKey from './_baseFindKey.js';
import baseForOwn from './_baseForOwn.js';
import baseIteratee from './_baseIteratee.js';
/**
* This method is like `_.find` except that it returns the key of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Object
* @param {Object} object The object to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {string|undefined} Returns the key of the matched element,
* else `undefined`.
* @example
*
* var users = {
* 'barney': { 'age': 36, 'active': true },
* 'fred': { 'age': 40, 'active': false },
* 'pebbles': { 'age': 1, 'active': true }
* };
*
* _.findKey(users, function(o) { return o.age < 40; });
* // => 'barney' (iteration order is not guaranteed)
*
* // The `_.matches` iteratee shorthand.
* _.findKey(users, { 'age': 1, 'active': true });
* // => 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findKey(users, ['active', false]);
* // => 'fred'
*
* // The `_.property` iteratee shorthand.
* _.findKey(users, 'active');
* // => 'barney'
*/
function findKey(object, predicate) {
return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn);
}
export default findKey;
@@ -0,0 +1 @@
{"name":"enhanced-resolve","version":"5.18.3","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532098344,"integrity":"sha512-4rrVLk4kSgb1C9ZPzvp8lC/r+sWoFMcQlRBv075kY0uDgYldTM6IT747LCAEPOIQ5jIrE1sbn7KWW9Suele6jA==","mode":420,"size":1071},"lib/AliasFieldPlugin.js":{"checkedAt":1794532098344,"integrity":"sha512-5az6Yo39Ar4cjPdxTbLWbXMJdb+D7uhdEVz3/O7B0H3vcqF6FP3wSnU/6rziWQt0wou0O+ivD7EhW6f2McU6Tw==","mode":420,"size":3044},"lib/AliasPlugin.js":{"checkedAt":1794532098344,"integrity":"sha512-p4p4a9B7XtCzJBNNf9Zw5tsx/lkphqkon35zVMsjNSbSVnaW10DksoFs92xyfmzIiZaFEetBZNV8EtwEXAiNxQ==","mode":420,"size":5172},"lib/AppendPlugin.js":{"checkedAt":1794532098345,"integrity":"sha512-fMcCFwCE28lrnM5KTbDxNvXts9gyWKXXHyJQHWmy/7A90yyMPbFdVZRPCmNN/w2HxZfVGgm8Q6E4KfJJqynWxg==","mode":420,"size":1201},"lib/CachedInputFileSystem.js":{"checkedAt":1794532098345,"integrity":"sha512-s5fXac7S3VzQygkP6QONOUOnIZeJNhsaXOJLK5NLaF+xAnpTI4jJ4siw0DvRgaDnTwHG9GF+nwJHSSWwoK9Pgw==","mode":420,"size":18709},"lib/CloneBasenamePlugin.js":{"checkedAt":1794532098345,"integrity":"sha512-DNmqlnZlfOyT8r/xgdcOZxijUJipKe7zHhz6W12OK3+lnyez676ukK7Gvi+GPZZnxO+u5vJglK7tNXyrUfJ9Dw==","mode":420,"size":1372},"lib/ConditionalPlugin.js":{"checkedAt":1794532098345,"integrity":"sha512-WNXPWD4nD3VNYXJ6qc4uU1sd90fo/d8WupfF0VGADcSMyrKl5ipM5QHiptTkqCMyShinskSGSqsTZZPO9QbjZg==","mode":420,"size":1723},"lib/createInnerContext.js":{"checkedAt":1794532098345,"integrity":"sha512-OqgRH4VzUWdYEzuUKoQzQjhp6ks/WiNCtN+KbJUePSFNfv0onCblAWixQ6chQB5dcMEInDa5ir+fQ7rqA9bRIQ==","mode":420,"size":1060},"lib/DescriptionFilePlugin.js":{"checkedAt":1794532098345,"integrity":"sha512-OSbZtlF+qUN9tYU8hbvhqVB8tMknQYXSTNdTh2WEliTlVlN9AcTmklR+Va7ar6BcewTjE4pGAkId5TzCVWyqng==","mode":420,"size":2683},"lib/DescriptionFileUtils.js":{"checkedAt":1794532098345,"integrity":"sha512-BV2kKNUlGMnx1px3CaB6iqt5ZY/qzJfIo0YOu20CCb6qWVUKBbqrP9CphZSZP0x9yUbO+clNyu9ZDm82+SYUOw==","mode":420,"size":5380},"lib/DirectoryExistsPlugin.js":{"checkedAt":1794532098346,"integrity":"sha512-Rgz1p4cjgN10ptAHGDVaINYYZkJZKE92Hf11Q6bgsNugFTfmU3GJqScGrXPY/kfAEp9ar/jWb6GsiTtq32kFKQ==","mode":420,"size":1753},"lib/util/entrypoints.js":{"checkedAt":1794532098346,"integrity":"sha512-A1KePniqYYOGaFW4GaRO9xdmkRlze68Pp4krZUwmiPF3r1lHRv1kZm59LkhxErDh+5XdScRAWITKRI6r/PixNw==","mode":420,"size":14430},"lib/ExportsFieldPlugin.js":{"checkedAt":1794532098346,"integrity":"sha512-g/n+hRpnqKZxJK3/aaKg7iCfuO8E+uyF6Phf/uaGhj74Z3Wi8yj8uSUNu4iKb3p3vyrN+88hmIAQ3EQtHdej5A==","mode":420,"size":6154},"lib/ExtensionAliasPlugin.js":{"checkedAt":1794532098346,"integrity":"sha512-iI2rukKxrRtTETDwiEWPyU24EHMuarjc/zRvQMHIlEwHcro7v1sW26zmvI2Hry3GDhF2Ywr8xxxldfX0AjV+Xg==","mode":420,"size":3053},"lib/FileExistsPlugin.js":{"checkedAt":1794532098346,"integrity":"sha512-XeC4HU+KI5sVcZ+3OW5Be6Oxa5c6CSRccAAWC1YeAJNFzMjAkyCzns4JftBgpLioClcKLExK+wdu6oHOr7W9/g==","mode":420,"size":1600},"lib/forEachBail.js":{"checkedAt":1794532098346,"integrity":"sha512-cygNdzeHUILt/SeAIundQeGHUPKjtJYFHMSnxDnxtLtp5kRCArnLcnF441C3wkzxMG66uLR+CwkFjW9pAgq/gQ==","mode":420,"size":1122},"lib/getInnerRequest.js":{"checkedAt":1794532098347,"integrity":"sha512-adzrxxvSLO/Mnci5SRknWKmd7v3BLyYzclWMaPRV0TyzB+LfrchVgUeMZ/g73MXPGrVxIipqoChFzwuXQgcdwA==","mode":420,"size":1205},"lib/getPaths.js":{"checkedAt":1794532098347,"integrity":"sha512-p7x816b3bC59bq3rAa9Avub4ppvAlEijc2iQra40mjZDXIkn2K9AA+Y7pkZeUpbVauH5QrRCNc0r/itMbuosJQ==","mode":420,"size":1206},"lib/util/identifier.js":{"checkedAt":1794532098347,"integrity":"sha512-BeTQ58v0MCWihH+G0Irm0fY5r7xDYwfvModZzyd6dcmvF3uzCt/IR/zPeLx4m76N33km9ppQk6NNIMw/DZVSPA==","mode":420,"size":1590},"lib/ImportsFieldPlugin.js":{"checkedAt":1794532098347,"integrity":"sha512-gnpajkj+QDBlHrcAIGf33kY5NF4JuoELnQDO1BPplZmpBzU273PkKNTn3oTVGdEsccTQ7xMUqdX8wos8Lx3fww==","mode":420,"size":6589},"lib/index.js":{"checkedAt":1794532098347,"integrity":"sha512-MxNyGFWJcYOPAW2gW3NJJjl6enRO8JRTsA+3oYl9swo6UDOPGXPv4QN0zwkTloeDG1cT8QgShUQH5xVNdo0i2A==","mode":420,"size":6466},"lib/JoinRequestPartPlugin.js":{"checkedAt":1794532098347,"integrity":"sha512-ce/nYjmPOKULIXVKRxXbZbjwHcH/EgJtorLBX3b9QVXiqa+K9gRYVb0SJZiQK5BJjnU5CvU6rZ1PspSKCDZbLg==","mode":420,"size":1922},"lib/JoinRequestPlugin.js":{"checkedAt":1794532098348,"integrity":"sha512-9LJpcjCGhJWYUlyKVD0FYYSeNV8LxNpaYO41l32HeSfUPXAAujU4Wc9PVCZswgM1HJjGMvEQrGyThojFFDvJmw==","mode":420,"size":1276},"lib/LogInfoPlugin.js":{"checkedAt":1794532098348,"integrity":"sha512-t6kJ9G2XfXGlrG5wMCdmcVTN1gyqDHBnow8L+Tj53anmsH/sjnprNNxZNkGHC7LnZVjxVZQ0H7VKEp/HJHLUGw==","mode":420,"size":1570},"lib/MainFieldPlugin.js":{"checkedAt":1794532098348,"integrity":"sha512-KW4kT6PFYkfFb5MciXzwnNI4mAI4JreQgWqlwSIqb1LIKjW1slW5TJ76+iOY2ABONCxqjCOa6ibx5z6M/N+Wow==","mode":420,"size":2456},"lib/util/memoize.js":{"checkedAt":1794532098348,"integrity":"sha512-UIUH5XzlmVfxP5MLxXJ4VHA12CGVs3eOa1NMLn0IGaYzdiUR59MeBk75auUWbQu5NW4gvJ8yVgtmVAzFwYYELA==","mode":420,"size":711},"lib/util/module-browser.js":{"checkedAt":1794532098348,"integrity":"sha512-NEPLine truncated
@@ -0,0 +1,13 @@
import type { TSchema, SchemaOptions } from '../schema/index';
import type { Ensure, Evaluate } from '../helpers/index';
import type { TProperties } from '../object/index';
import { type TIndex } from './indexed';
import { type TMappedResult, type TMappedKey } from '../mapped/index';
type TMappedIndexPropertyKey<Type extends TSchema, Key extends PropertyKey> = {
[_ in Key]: TIndex<Type, [Key]>;
};
type TMappedIndexPropertyKeys<Type extends TSchema, PropertyKeys extends PropertyKey[], Result extends TProperties = {}> = (PropertyKeys extends [infer Left extends PropertyKey, ...infer Right extends PropertyKey[]] ? TMappedIndexPropertyKeys<Type, Right, Result & TMappedIndexPropertyKey<Type, Left>> : Result);
type TMappedIndexProperties<Type extends TSchema, MappedKey extends TMappedKey> = Evaluate<TMappedIndexPropertyKeys<Type, MappedKey['keys']>>;
export type TIndexFromMappedKey<Type extends TSchema, MappedKey extends TMappedKey, Properties extends TProperties = TMappedIndexProperties<Type, MappedKey>> = (Ensure<TMappedResult<Properties>>);
export declare function IndexFromMappedKey<Type extends TSchema, MappedKey extends TMappedKey, Properties extends TProperties = TMappedIndexProperties<Type, MappedKey>>(type: Type, mappedKey: MappedKey, options?: SchemaOptions): TMappedResult<Properties>;
export {};
@@ -0,0 +1,38 @@
'use strict';
function checkDCE() {
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
) {
return;
}
if (process.env.NODE_ENV !== 'production') {
// This branch is unreachable because this function is only called
// in production, but the condition is true only in development.
// Therefore if the branch is still here, dead code elimination wasn't
// properly applied.
// Don't change the message. React DevTools relies on it. Also make sure
// this message doesn't occur elsewhere in this function, or it will cause
// a false positive.
throw new Error('^_^');
}
try {
// Verify that the code above has been dead code eliminated (DCE'd).
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
} catch (err) {
// DevTools shouldn't crash React, no matter what.
// We should still report in case we break this code.
console.error(err);
}
}
if (process.env.NODE_ENV === 'production') {
// DCE check should happen before ReactDOM bundle executes so that
// DevTools can report bad minification during injection.
checkDCE();
module.exports = require('./cjs/react-dom-client.production.js');
} else {
module.exports = require('./cjs/react-dom-client.development.js');
}
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,oBAAoB,CAAC,wZAAwE,CAAC;AAClH","sources":["packages/@react-aria/menu/intl/ru-RU.json"],"sourcesContent":["{\n \"longPressMessage\": \"Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню\"\n}\n"],"names":[],"version":3,"file":"ru-RU.module.js.map"}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('capitalize', require('../capitalize'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,496 @@
'use strict';
var util = require('util');
var fs = require('graceful-fs');
var assign = require('object.assign');
var date = require('value-or-function').date;
var Writable = require('readable-stream').Writable;
var constants = require('./constants');
var APPEND_MODE_REGEXP = /a/;
function closeFd(propagatedErr, fd, callback) {
if (typeof fd !== 'number') {
return callback(propagatedErr);
}
fs.close(fd, onClosed);
function onClosed(closeErr) {
if (propagatedErr || closeErr) {
return callback(propagatedErr || closeErr);
}
callback();
}
}
function isValidUnixId(id) {
if (typeof id !== 'number') {
return false;
}
if (id < 0) {
return false;
}
return true;
}
function getFlags(options) {
var flags = !options.append ? 'w' : 'a';
if (!options.overwrite) {
flags += 'x';
}
return flags;
}
function isFatalOverwriteError(err, flags) {
if (!err) {
return false;
}
if (err.code === 'EEXIST' && flags[1] === 'x') {
// Handle scenario for file overwrite failures.
return false;
}
// Otherwise, this is a fatal error
return true;
}
function isFatalUnlinkError(err) {
if (!err || err.code === 'ENOENT') {
return false;
}
return true;
}
function getModeDiff(fsMode, vinylMode) {
var modeDiff = 0;
if (typeof vinylMode === 'number') {
modeDiff = (vinylMode ^ fsMode) & constants.MASK_MODE;
}
return modeDiff;
}
function getTimesDiff(fsStat, vinylStat) {
var mtime = date(vinylStat.mtime) || 0;
if (!mtime) {
return;
}
var atime = date(vinylStat.atime) || 0;
if (+mtime === +fsStat.mtime &&
+atime === +fsStat.atime) {
return;
}
if (!atime) {
atime = date(fsStat.atime) || undefined;
}
var timesDiff = {
mtime: vinylStat.mtime,
atime: atime,
};
return timesDiff;
}
function getOwnerDiff(fsStat, vinylStat) {
if (!isValidUnixId(vinylStat.uid) &&
!isValidUnixId(vinylStat.gid)) {
return;
}
if ((!isValidUnixId(fsStat.uid) && !isValidUnixId(vinylStat.uid)) ||
(!isValidUnixId(fsStat.gid) && !isValidUnixId(vinylStat.gid))) {
return;
}
var uid = fsStat.uid; // Default to current uid.
if (isValidUnixId(vinylStat.uid)) {
uid = vinylStat.uid;
}
var gid = fsStat.gid; // Default to current gid.
if (isValidUnixId(vinylStat.gid)) {
gid = vinylStat.gid;
}
if (uid === fsStat.uid &&
gid === fsStat.gid) {
return;
}
var ownerDiff = {
uid: uid,
gid: gid,
};
return ownerDiff;
}
function isOwner(fsStat) {
var hasGetuid = (typeof process.getuid === 'function');
var hasGeteuid = (typeof process.geteuid === 'function');
// If we don't have either, assume we don't have permissions.
// This should only happen on Windows.
// Windows basically noops fchmod and errors on futimes called on directories.
if (!hasGeteuid && !hasGetuid) {
return false;
}
var uid;
if (hasGeteuid) {
uid = process.geteuid();
} else {
uid = process.getuid();
}
if (fsStat.uid !== uid && uid !== 0) {
return false;
}
return true;
}
function reflectStat(path, file, callback) {
// Set file.stat to the reflect current state on disk
fs.stat(path, onStat);
function onStat(statErr, stat) {
if (statErr) {
return callback(statErr);
}
file.stat = stat;
callback();
}
}
function reflectLinkStat(path, file, callback) {
// Set file.stat to the reflect current state on disk
fs.lstat(path, onLstat);
function onLstat(lstatErr, stat) {
if (lstatErr) {
return callback(lstatErr);
}
file.stat = stat;
callback();
}
}
function updateMetadata(fd, file, callback) {
fs.fstat(fd, onStat);
function onStat(statErr, stat) {
if (statErr) {
return callback(statErr);
}
// Check if mode needs to be updated
var modeDiff = getModeDiff(stat.mode, file.stat.mode);
// Check if atime/mtime need to be updated
var timesDiff = getTimesDiff(stat, file.stat);
// Check if uid/gid need to be updated
var ownerDiff = getOwnerDiff(stat, file.stat);
// Set file.stat to the reflect current state on disk
assign(file.stat, stat);
// Nothing to do
if (!modeDiff && !timesDiff && !ownerDiff) {
return callback();
}
// Check access, `futimes`, `fchmod` & `fchown` only work if we own
// the file, or if we are effectively root (`fchown` only when root).
if (!isOwner(stat)) {
return callback();
}
if (modeDiff) {
return mode();
}
if (timesDiff) {
return times();
}
owner();
function mode() {
var mode = stat.mode ^ modeDiff;
fs.fchmod(fd, mode, onFchmod);
function onFchmod(fchmodErr) {
if (!fchmodErr) {
file.stat.mode = mode;
}
if (timesDiff) {
return times(fchmodErr);
}
if (ownerDiff) {
return owner(fchmodErr);
}
callback(fchmodErr);
}
}
function times(propagatedErr) {
fs.futimes(fd, timesDiff.atime, timesDiff.mtime, onFutimes);
function onFutimes(futimesErr) {
if (!futimesErr) {
file.stat.atime = timesDiff.atime;
file.stat.mtime = timesDiff.mtime;
}
if (ownerDiff) {
return owner(propagatedErr || futimesErr);
}
callback(propagatedErr || futimesErr);
}
}
function owner(propagatedErr) {
fs.fchown(fd, ownerDiff.uid, ownerDiff.gid, onFchown);
function onFchown(fchownErr) {
if (!fchownErr) {
file.stat.uid = ownerDiff.uid;
file.stat.gid = ownerDiff.gid;
}
callback(propagatedErr || fchownErr);
}
}
}
}
function symlink(srcPath, destPath, opts, callback) {
// Because fs.symlink does not allow atomic overwrite option with flags, we
// delete and recreate if the link already exists and overwrite is true.
if (opts.flags === 'w') {
// TODO What happens when we call unlink with windows junctions?
fs.unlink(destPath, onUnlink);
} else {
fs.symlink(srcPath, destPath, opts.type, onSymlink);
}
function onUnlink(unlinkErr) {
if (isFatalUnlinkError(unlinkErr)) {
return callback(unlinkErr);
}
fs.symlink(srcPath, destPath, opts.type, onSymlink);
}
function onSymlink(symlinkErr) {
if (isFatalOverwriteError(symlinkErr, opts.flags)) {
return callback(symlinkErr);
}
callback();
}
}
/*
Custom writeFile implementation because we need access to the
file descriptor after the write is complete.
Most of the implementation taken from node core.
*/
function writeFile(filepath, data, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (!Buffer.isBuffer(data)) {
return callback(new TypeError('Data must be a Buffer'));
}
if (!options) {
options = {};
}
// Default the same as node
var mode = options.mode || constants.DEFAULT_FILE_MODE;
var flags = options.flags || 'w';
var position = APPEND_MODE_REGEXP.test(flags) ? null : 0;
fs.open(filepath, flags, mode, onOpen);
function onOpen(openErr, fd) {
if (openErr) {
return onComplete(openErr);
}
fs.write(fd, data, 0, data.length, position, onComplete);
function onComplete(writeErr) {
callback(writeErr, fd);
}
}
}
function createWriteStream(path, options, flush) {
return new WriteStream(path, options, flush);
}
// Taken from node core and altered to receive a flush function and simplified
// To be used for cleanup (like updating times/mode/etc)
function WriteStream(path, options, flush) {
// Not exposed so we can avoid the case where someone doesn't use `new`
if (typeof options === 'function') {
flush = options;
options = null;
}
options = options || {};
Writable.call(this, options);
this.flush = flush;
this.path = path;
this.mode = options.mode || constants.DEFAULT_FILE_MODE;
this.flags = options.flags || 'w';
// Used by node's `fs.WriteStream`
this.fd = null;
this.start = null;
this.open();
// Dispose on finish.
this.once('finish', this.close);
}
util.inherits(WriteStream, Writable);
WriteStream.prototype.open = function() {
var self = this;
fs.open(this.path, this.flags, this.mode, onOpen);
function onOpen(openErr, fd) {
if (openErr) {
self.destroy();
self.emit('error', openErr);
return;
}
self.fd = fd;
self.emit('open', fd);
}
};
// Use our `end` method since it is patched for flush
WriteStream.prototype.destroySoon = WriteStream.prototype.end;
WriteStream.prototype._destroy = function(err, cb) {
this.close(function(err2) {
cb(err || err2);
});
};
WriteStream.prototype.close = function(cb) {
var that = this;
if (cb) {
this.once('close', cb);
}
if (this.closed || typeof this.fd !== 'number') {
if (typeof this.fd !== 'number') {
this.once('open', closeOnOpen);
return;
}
return process.nextTick(function() {
that.emit('close');
});
}
this.closed = true;
fs.close(this.fd, function(er) {
if (er) {
that.emit('error', er);
} else {
that.emit('close');
}
});
this.fd = null;
};
WriteStream.prototype._final = function(callback) {
if (typeof this.flush !== 'function') {
return callback();
}
this.flush(this.fd, callback);
};
function closeOnOpen() {
this.close();
}
WriteStream.prototype._write = function(data, encoding, callback) {
var self = this;
// This is from node core but I have no idea how to get code coverage on it
if (!Buffer.isBuffer(data)) {
return this.emit('error', new Error('Invalid data'));
}
if (typeof this.fd !== 'number') {
return this.once('open', onOpen);
}
fs.write(this.fd, data, 0, data.length, null, onWrite);
function onOpen() {
self._write(data, encoding, callback);
}
function onWrite(writeErr) {
if (writeErr) {
self.destroy();
callback(writeErr);
return;
}
callback();
}
};
module.exports = {
closeFd: closeFd,
isValidUnixId: isValidUnixId,
getFlags: getFlags,
isFatalOverwriteError: isFatalOverwriteError,
isFatalUnlinkError: isFatalUnlinkError,
getModeDiff: getModeDiff,
getTimesDiff: getTimesDiff,
getOwnerDiff: getOwnerDiff,
isOwner: isOwner,
reflectStat: reflectStat,
reflectLinkStat: reflectLinkStat,
updateMetadata: updateMetadata,
symlink: symlink,
writeFile: writeFile,
createWriteStream: createWriteStream,
};
@@ -0,0 +1,177 @@
# Retry utility
by [Nicholas C. Zakas](https://humanwhocodes.com)
If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star.
## Description
A utility for retrying failed async JavaScript calls based on the error returned.
## Usage
### Node.js
Install using [npm][npm] or [yarn][yarn]:
```
npm install @humanwhocodes/retry
# or
yarn add @humanwhocodes/retry
```
Import into your Node.js project:
```js
// CommonJS
const { Retrier } = require("@humanwhocodes/retry");
// ESM
import { Retrier } from "@humanwhocodes/retry";
```
### Deno
Install using [JSR](https://jsr.io):
```shell
deno add @humanwhocodes/retry
#or
jsr add @humanwhocodes/retry
```
Then import into your Deno project:
```js
import { Retrier } from "@humanwhocodes/retry";
```
### Bun
Install using this command:
```
bun add @humanwhocodes/retry
```
Import into your Bun project:
```js
import { Retrier } from "@humanwhocodes/retry";
```
### Browser
It's recommended to import the minified version to save bandwidth:
```js
import { Retrier } from "https://cdn.skypack.dev/@humanwhocodes/retry?min";
```
However, you can also import the unminified version for debugging purposes:
```js
import { Retrier } from "https://cdn.skypack.dev/@humanwhocodes/retry";
```
## API
After importing, create a new instance of `Retrier` and specify the function to run on the error. This function should return `true` if you want the call retried and `false` if not.
```js
// this instance will retry if the specific error code is found
const retrier = new Retrier(error => {
return error.code === "ENFILE" || error.code === "EMFILE";
});
```
Then, call the `retry()` method around the function you'd like to retry, such as:
```js
import fs from "fs/promises";
const retrier = new Retrier(error => {
return error.code === "ENFILE" || error.code === "EMFILE";
});
const text = await retrier.retry(() => fs.readFile("README.md", "utf8"));
```
The `retry()` method will either pass through the result on success or wait and retry on failure. Any error that isn't caught by the retrier is automatically rejected so the end result is a transparent passing through of both success and failure.
### Setting a Timeout
You can control how long a task will attempt to retry before giving up by passing the `timeout` option to the `Retrier` constructor. By default, the timeout is one minute.
```js
import fs from "fs/promises";
const retrier = new Retrier(error => {
return error.code === "ENFILE" || error.code === "EMFILE";
}, { timeout: 100_000 });
const text = await retrier.retry(() => fs.readFile("README.md", "utf8"));
```
When a call times out, it rejects the first error that was received from calling the function.
### Setting a Concurrency Limit
When processing a large number of function calls, you can limit the number of concurrent function calls by passing the `concurrency` option to the `Retrier` constructor. By default, `concurrency` is 1000.
```js
import fs from "fs/promises";
const retrier = new Retrier(error => {
return error.code === "ENFILE" || error.code === "EMFILE";
}, { concurrency: 100 });
const filenames = getFilenames();
const contents = await Promise.all(
filenames.map(filename => retrier.retry(() => fs.readFile(filename, "utf8"))
);
```
### Aborting with `AbortSignal`
You can also pass an `AbortSignal` to cancel a retry:
```js
import fs from "fs/promises";
const controller = new AbortController();
const retrier = new Retrier(error => {
return error.code === "ENFILE" || error.code === "EMFILE";
});
const text = await retrier.retry(
() => fs.readFile("README.md", "utf8"),
{ signal: controller.signal }
);
```
## Developer Setup
1. Fork the repository
2. Clone your fork
3. Run `npm install` to setup dependencies
4. Run `npm test` to run tests
### Debug Output
Enable debugging output by setting the `DEBUG` environment variable to `"@hwc/retry"` before running.
## License
Apache 2.0
## Prior Art
This utility is inspired by, and contains code from [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).
[npm]: https://npmjs.com/
[yarn]: https://yarnpkg.com/
@@ -0,0 +1,34 @@
import type {
ZodArray,
ZodNullable,
ZodObject,
ZodOptional,
ZodRawShape,
ZodTuple,
ZodTupleItems,
ZodTypeAny,
} from "../types.js";
export namespace partialUtil {
export type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<ZodRawShape>
? ZodObject<
{ [k in keyof T["shape"]]: ZodOptional<DeepPartial<T["shape"][k]>> },
T["_def"]["unknownKeys"],
T["_def"]["catchall"]
>
: T extends ZodArray<infer Type, infer Card>
? ZodArray<DeepPartial<Type>, Card>
: T extends ZodOptional<infer Type>
? ZodOptional<DeepPartial<Type>>
: T extends ZodNullable<infer Type>
? ZodNullable<DeepPartial<Type>>
: T extends ZodTuple<infer Items>
? {
[k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never;
} extends infer PI
? PI extends ZodTupleItems
? ZodTuple<PI>
: never
: never
: T;
}
@@ -0,0 +1,6 @@
"use client";
import { createContext } from 'react';
const LazyContext = createContext({ strict: false });
export { LazyContext };
@@ -0,0 +1,41 @@
// Arabic (Algeria) [ar-dz]
import dayjs from '../index';
var locale = {
name: 'ar-dz',
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdaysMin: 'أح_إث_ثلا_أر_خم_جم_سب'.split('_'),
ordinal: function ordinal(n) {
return n;
},
formats: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
meridiem: function meridiem(hour) {
return hour > 12 ? 'م' : 'ص';
},
relativeTime: {
future: 'في %s',
past: 'منذ %s',
s: 'ثوان',
m: 'دقيقة',
mm: '%d دقائق',
h: 'ساعة',
hh: '%d ساعات',
d: 'يوم',
dd: '%d أيام',
M: 'شهر',
MM: '%d أشهر',
y: 'سنة',
yy: '%d سنوات'
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var lifecycle_1 = require("./lifecycle");
Object.defineProperty(exports, "Lifecycle", { enumerable: true, get: function () { return lifecycle_1.default; } });
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,oBAAoB,CAAC,uEAAuE,CAAC;AACjH","sources":["packages/@react-aria/menu/intl/pt-BR.json"],"sourcesContent":["{\n \"longPressMessage\": \"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu\"\n}\n"],"names":[],"version":3,"file":"pt-BR.main.js.map"}
@@ -0,0 +1,27 @@
/**
* Copyright (c) 2021 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { ICoreTerminal } from 'common/Types';
import { IUnicodeHandling, IUnicodeVersionProvider } from '@xterm/xterm';
export class UnicodeApi implements IUnicodeHandling {
constructor(private _core: ICoreTerminal) { }
public register(provider: IUnicodeVersionProvider): void {
this._core.unicodeService.register(provider);
}
public get versions(): string[] {
return this._core.unicodeService.versions;
}
public get activeVersion(): string {
return this._core.unicodeService.activeVersion;
}
public set activeVersion(version: string) {
this._core.unicodeService.activeVersion = version;
}
}
@@ -0,0 +1,18 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./string"), exports);
@@ -0,0 +1,125 @@
/**
* @typedef {import('hast').Element} Element
* @typedef {import('hast').ElementContent} ElementContent
* @typedef {import('hast').Properties} Properties
* @typedef {import('mdast').ListItem} ListItem
* @typedef {import('mdast').Parents} Parents
* @typedef {import('../state.js').State} State
*/
// Make VS Code show references to the above types.
''
/**
* Turn an mdast `listItem` node into hast.
*
* @param {State} state
* Info passed around.
* @param {ListItem} node
* mdast node.
* @param {Parents | undefined} parent
* Parent of `node`.
* @returns {Element}
* hast node.
*/
export function listItem(state, node, parent) {
const results = state.all(node)
const loose = parent ? listLoose(parent) : listItemLoose(node)
/** @type {Properties} */
const properties = {}
/** @type {Array<ElementContent>} */
const children = []
if (typeof node.checked === 'boolean') {
const head = results[0]
/** @type {Element} */
let paragraph
if (head && head.type === 'element' && head.tagName === 'p') {
paragraph = head
} else {
paragraph = {type: 'element', tagName: 'p', properties: {}, children: []}
results.unshift(paragraph)
}
if (paragraph.children.length > 0) {
paragraph.children.unshift({type: 'text', value: ' '})
}
paragraph.children.unshift({
type: 'element',
tagName: 'input',
properties: {type: 'checkbox', checked: node.checked, disabled: true},
children: []
})
// According to github-markdown-css, this class hides bullet.
// See: <https://github.com/sindresorhus/github-markdown-css>.
properties.className = ['task-list-item']
}
let index = -1
while (++index < results.length) {
const child = results[index]
// Add eols before nodes, except if this is a loose, first paragraph.
if (
loose ||
index !== 0 ||
child.type !== 'element' ||
child.tagName !== 'p'
) {
children.push({type: 'text', value: '\n'})
}
if (child.type === 'element' && child.tagName === 'p' && !loose) {
children.push(...child.children)
} else {
children.push(child)
}
}
const tail = results[results.length - 1]
// Add a final eol.
if (tail && (loose || tail.type !== 'element' || tail.tagName !== 'p')) {
children.push({type: 'text', value: '\n'})
}
/** @type {Element} */
const result = {type: 'element', tagName: 'li', properties, children}
state.patch(node, result)
return state.applyData(node, result)
}
/**
* @param {Parents} node
* @return {Boolean}
*/
function listLoose(node) {
let loose = false
if (node.type === 'list') {
loose = node.spread || false
const children = node.children
let index = -1
while (!loose && ++index < children.length) {
loose = listItemLoose(children[index])
}
}
return loose
}
/**
* @param {ListItem} node
* @return {Boolean}
*/
function listItemLoose(node) {
const spread = node.spread
return spread === null || spread === undefined
? node.children.length > 1
: spread
}
@@ -0,0 +1,142 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "karakter", verb: "memiliki" },
file: { unit: "byte", verb: "memiliki" },
array: { unit: "item", verb: "memiliki" },
set: { unit: "item", verb: "memiliki" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "number";
}
case "object": {
if (Array.isArray(data)) {
return "array";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "input",
email: "alamat email",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "tanggal dan waktu format ISO",
date: "tanggal format ISO",
time: "jam format ISO",
duration: "durasi format ISO",
ipv4: "alamat IPv4",
ipv6: "alamat IPv6",
cidrv4: "rentang alamat IPv4",
cidrv6: "rentang alamat IPv6",
base64: "string dengan enkode base64",
base64url: "string dengan enkode base64url",
json_string: "string JSON",
e164: "angka E.164",
jwt: "JWT",
template_literal: "input",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Input tidak valid: diharapkan ${issue.expected}, diterima ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Input tidak valid: diharapkan ${util.stringifyPrimitive(issue.values[0])}`;
return `Pilihan tidak valid: diharapkan salah satu dari ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Terlalu besar: diharapkan ${issue.origin ?? "value"} memiliki ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemen"}`;
return `Terlalu besar: diharapkan ${issue.origin ?? "value"} menjadi ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Terlalu kecil: diharapkan ${issue.origin} memiliki ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Terlalu kecil: diharapkan ${issue.origin} menjadi ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `String tidak valid: harus dimulai dengan "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `String tidak valid: harus berakhir dengan "${_issue.suffix}"`;
if (_issue.format === "includes")
return `String tidak valid: harus menyertakan "${_issue.includes}"`;
if (_issue.format === "regex")
return `String tidak valid: harus sesuai pola ${_issue.pattern}`;
return `${Nouns[_issue.format] ?? issue.format} tidak valid`;
}
case "not_multiple_of":
return `Angka tidak valid: harus kelipatan dari ${issue.divisor}`;
case "unrecognized_keys":
return `Kunci tidak dikenali ${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Kunci tidak valid di ${issue.origin}`;
case "invalid_union":
return "Input tidak valid";
case "invalid_element":
return `Nilai tidak valid di ${issue.origin}`;
default:
return `Input tidak valid`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../util");
const getESLintCoreRule_1 = require("../util/getESLintCoreRule");
const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-loss-of-precision');
exports.default = (0, util_1.createRule)({
name: 'no-loss-of-precision',
meta: {
type: 'problem',
// defaultOptions, -- base rule does not use defaultOptions
deprecated: {
deprecatedSince: '8.0.0',
replacedBy: [
{
rule: {
name: 'no-loss-of-precision',
url: 'https://eslint.org/docs/latest/rules/no-loss-of-precision',
},
},
],
url: 'https://github.com/typescript-eslint/typescript-eslint/pull/8832',
},
docs: {
description: 'Disallow literal numbers that lose precision',
extendsBaseRule: true,
},
hasSuggestions: baseRule.meta.hasSuggestions,
messages: baseRule.meta.messages,
schema: [],
},
defaultOptions: [],
create(context) {
return baseRule.create(context);
},
});
@@ -0,0 +1,8 @@
import type { TSESTree } from '@typescript-eslint/types';
import { DefinitionBase } from './DefinitionBase';
import { DefinitionType } from './DefinitionType';
export declare class TSEnumNameDefinition extends DefinitionBase<DefinitionType.TSEnumName, TSESTree.TSEnumDeclaration, null, TSESTree.Identifier> {
readonly isTypeDefinition = true;
readonly isVariableDefinition = true;
constructor(name: TSESTree.Identifier, node: TSEnumNameDefinition['node']);
}
@@ -0,0 +1 @@
{"version":3,"names":["_t","require","STATEMENT_OR_BLOCK_KEYS","VISITOR_KEYS","isBlockStatement","isExpression","isIdentifier","isLiteral","isStringLiteral","isType","matchesPattern","_matchesPattern","pattern","allowPartial","node","exports","has","key","_this$node","val","Array","isArray","length","isStatic","scope","is","isnt","equals","value","isNodeType","type","canHaveVariableDeclarationOrExpression","parentPath","isFor","canSwapBetweenExpressionAndStatement","replacement","isArrowFunctionExpression","isCompletionRecord","allowInsideFunction","path","first","container","isFunction","isProgram","isDoExpression","isStatementOrBlock","isLabeledStatement","includes","referencesImport","moduleSource","importName","isReferencedIdentifier","isJSXMemberExpression","property","name","isMemberExpression","isOptionalMemberExpression","computed","object","get","binding","getBinding","kind","parent","isImportDeclaration","source","isImportDefaultSpecifier","isImportNamespaceSpecifier","isImportSpecifier","imported","getSource","end","code","hub","getCode","slice","start","willIMaybeExecuteBefore","target","_guessExecutionStatusRelativeTo","getOuterFunction","getFunctionParent","getProgramParent","isExecutionUncertain","isExecutionUncertainInList","paths","maxIndex","i","parentKey","SYMBOL_CHECKING","Symbol","_guessExecutionStatusRelativeToCached","Map","base","cache","funcParent","this","_guessExecutionStatusRelativeToDifferentFunctionsCached","getAncestry","commonPath","commonIndex","indexOf","Error","divergence","listKey","keys","keyPosition","_guessExecutionStatusRelativeToDifferentFunctionsInternal","isFunctionDeclaration","isExportDeclaration","id","references","referencePaths","allStatus","childOfFunction","find","isCallExpression","status","nodeMap","cached","set","result","resolve","dangerous","resolved","_resolve","call","_resolved","push","isVariableDeclarator","constant","ret","isTypeCastExpression","targetKey","toComputedKey","targetName","isObjectExpression","props","prop","isProperty","match","isArrayExpression","isNaN","elems","elem","isConstantExpression","isRegExpLiteral","isTemplateLiteral","every","expression","isUnaryExpression","operator","isBinaryExpression","hasBinding","noGlobals","arguments","isInStrictMode","strictParent","sourceType","isClass","body","directive","directives"],"sources":["../../src/path/introspection.ts"],"sourcesContent":["// This file contains methods responsible for introspecting the current path for certain values.\n\nimport type NodePath from \"./index.ts\";\nimport {\n STATEMENT_OR_BLOCK_KEYS,\n VISITOR_KEYS,\n isBlockStatement,\n isExpression,\n isIdentifier,\n isLiteral,\n isStringLiteral,\n isType,\n matchesPattern as _matchesPattern,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\n/**\n * Match the current node if it matches the provided `pattern`.\n *\n * For example, given the match `React.createClass` it would match the\n * parsed nodes of `React.createClass` and `React[\"createClass\"]`.\n */\n\nexport function matchesPattern(\n this: NodePath,\n pattern: string,\n allowPartial?: boolean,\n): boolean {\n return _matchesPattern(this.node, pattern, allowPartial);\n}\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM) {\n /**\n * Check whether we have the input `key`. If the `key` references an array then we check\n * if the array has any items, otherwise we just check if it's falsy.\n */\n // eslint-disable-next-line no-restricted-globals\n exports.has = function has<N extends t.Node>(\n this: NodePath<N>,\n key: keyof N,\n ): boolean {\n const val = (this.node as N)?.[key];\n if (val && Array.isArray(val)) {\n return !!val.length;\n } else {\n return !!val;\n }\n };\n}\n\nexport function isStatic(this: NodePath): boolean {\n return this.scope.isStatic(this.node);\n}\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM) {\n /**\n * Alias of `has`.\n */\n // eslint-disable-next-line no-restricted-globals\n exports.is = exports.has;\n\n /**\n * Opposite of `has`.\n */\n // eslint-disable-next-line no-restricted-globals\n exports.isnt = function isnt<N extends t.Node>(\n this: NodePath<N>,\n key: keyof N,\n ): boolean {\n // @ts-expect-error Babel 7\n return !this.has(key);\n };\n\n /**\n * Check whether the path node `key` strict equals `value`.\n */\n // eslint-disable-next-line no-restricted-globals\n exports.equals = function equals<N extends t.Node>(\n this: NodePath<N>,\n key: keyof N,\n value: any,\n ): boolean {\n return (this.node as N)[key] === value;\n };\n}\n\n/**\n * Check the type against our stored internal type of the node. This is handy when a node has\n * been removed yet we still internally know the type and need it to calculate node replacement.\n */\n\nexport function isNodeType(this: NodePath, type: string): boolean {\n return isType(this.type, type);\n}\n\n/**\n * This checks whether or not we're in one of the following Line truncated
@@ -0,0 +1,18 @@
import { As, RightJoinProps, PropsOf, InternalForwardRefRenderFunction } from './types.js';
import * as React from 'react';
import '@react-types/shared';
declare function forwardRef<Component extends As, Props extends object, OmitKeys extends keyof any = never>(component: React.ForwardRefRenderFunction<any, RightJoinProps<PropsOf<Component>, Props> & {
as?: As;
}>): InternalForwardRefRenderFunction<Component, Props, OmitKeys>;
declare const toIterator: (obj: any) => any;
declare const mapPropsVariants: <T extends Record<string, any>, K extends keyof T>(props: T, variantKeys?: K[] | undefined, removeVariantProps?: boolean) => readonly [T | Omit<T, K>, {} | Pick<T, K>];
declare const mapPropsVariantsWithCommon: <P extends Record<any, any>, VK extends keyof P, CK extends keyof P = never>(originalProps: P, variantKeys: VK[], commonKeys?: CK[] | undefined) => readonly [Omit<P, Exclude<VK, CK>>, Pick<P, VK>];
/**
* Checks if a component is a HeroUI component.
* @param component - The component to check.
* @returns `true` if the component is a HeroUI component, `false` otherwise.
*/
declare const isHeroUIEl: (component: React.ReactComponentElement<any>) => boolean;
export { forwardRef, isHeroUIEl, mapPropsVariants, mapPropsVariantsWithCommon, toIterator };
@@ -0,0 +1 @@
{"version":3,"names":["_fs","data","require","_gensync","readFile","exports","gensync","sync","fs","readFileSync","errback","stat","statSync"],"sources":["../../src/gensync-utils/fs.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport gensync from \"gensync\";\n\nexport const readFile = gensync<[filepath: string, encoding: \"utf8\"], string>({\n sync: fs.readFileSync,\n errback: fs.readFile,\n});\n\nexport const stat = gensync({\n sync: fs.statSync,\n errback: fs.stat,\n});\n"],"mappings":";;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMG,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAGE,SAAMA,CAAC,CAA+C;EAC5EC,IAAI,EAAEC,IAACA,CAAC,CAACC,YAAY;EACrBC,OAAO,EAAEF,IAACA,CAAC,CAACJ;AACd,CAAC,CAAC;AAEK,MAAMO,IAAI,GAAAN,OAAA,CAAAM,IAAA,GAAGL,SAAMA,CAAC,CAAC;EAC1BC,IAAI,EAAEC,IAACA,CAAC,CAACI,QAAQ;EACjBF,OAAO,EAAEF,IAACA,CAAC,CAACG;AACd,CAAC,CAAC;AAAC","ignoreList":[]}
@@ -0,0 +1,429 @@
flf2a$ 4 4 48 0 20 0 0
DANC4 by Richard Sabey <cryptic_fan@hotmail.com> 9.2003
This font is based on the "dancing men" cipher used in Sir Arthur Conan
Doyle's Sherlock Holmes story "The Adventure of the Dancing Men" (DANC),
which was later published in the collection "The Return of Sherlock Holmes".
The cipher ignores punctuation, and marks a space by a flag held by the
dancing man for the last letter before the space. The last figure of
an entire message carries no flag, as there is no need for one. In this
implementation of the cipher, figures with no flags represent lowercase
letters; those with flags, uppercase letters. Thus, when FIGletising, you
should type only the letters, and uppercase the *last* letter of every word
except the last. For example "Come, Elsie!" becomes comEelsie.
The messages in dancing-men cipher in DANC didn't use the letters
FJKQUWXZ. What's more, editions of DANC vary in what mistakes they make in
the cipher, though they are consistent in using the same figure for P & V.
To resolve this problem and supply the missing figures, I follow the TrueType
font designed in 1994 by Martin Bergman of Sweden.
The positions of the flags have been altered to keep this a 4-line FIGfont.
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
\O \O/ \O/ \O \O/ O/ '\ /`@
.___| Y Y___, | Y <| \ / @
| / \ | / \ / \ / \ X @
|_ ./ \, _| _\ /_ ./ \, _| |_ /O\# @@
\O/ O/ '\ /`@
Y_ <| \ / @
/ | / \ Y @
./ |_ _| |_ O\# @@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
\O |_O \O |_O_|#@
.___| _|> |_ _| @
| _| \ / | _| \ @
|_ |_ ./ |_ |_ @@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
\O @
|\ @
/ \ @
_\ /_@@
O/ @
/| @
/ \ @
./ \,@@
O @
/| @
/ \ @
_\ /_@@
O @
/|\ @
/ \ @
./ \,@@
O @
|\ @
/ \ @
_\ /_@@
\O @
|\ @
/ \ @
./ \,@@
O/ @
/| @
/ \ @
_\ /_@@
O @
/| @
/ \ @
./ \,@@
O @
/|\ @
/ \ @
_\ /_@@
O @
|\ @
/ \ @
./ \,@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
\O/ '\ /`@
Y_ \ / @
/ | X @
./ |_ /O\# @@
\O/# @
Y_ @
/ | @
./ |_@@
O @
|# @
/ \ @
_\ /_@@
\O @
|# @
/ \ @
_\ /_@@
'\ /`@
\ / @
Y @
O\# @@
\O/# @
Y @
/ \ @
./ \,@@
O/# @
|_ @
/ | @
./ |_@@
'\ /`@
\ / @
Y @
/O# @@
\O/#@
Y @
| @
_|_ @@
\O/#@
.___Y @
| @
|_ @@
\O @
_|#@
_| | @
|_@@
O/# @
| @
/ \ @
./ \,@@
|_O @
_#> @
_| \ @
|_@@
\O/#@
Y @
/ \ @
_| |_@@
O/#@
<| @
/ \ @
_| |_@@
\O/#@
_Y @
_| | @
|_ @@
\O @
.___|#@
| @
|_@@
\O @
|#__,@
| @
_| @@
\O/# @
Y___,@
| @
_| @@
|_O_|#@
_| @
_| \ @
|_ @@
'\ /`@
\ / @
X @
/O\# @@
\O# @
|_ @
/ | @
./ |_@@
O/#@
.___| @
| @
|_ @@
O/#@
_| @
_| | @
|_ @@
\O @
|# @
/ \ @
./ \,@@
O/# @
_| @
_| \ @
\,@@
O/# @
|___,@
| @
_| @@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
\O/ @
Y_ @
/ | @
./ |_@@
O @
| @
/ \ @
_\ /_@@
\O @
| @
/ \ @
_\ /_@@
'\ /`@
\ / @
Y @
O\ @@
\O/ @
Y @
/ \ @
./ \,@@
O/ @
|_ @
/ | @
./ |_@@
'\ /`@
\ / @
Y @
/O @@
\O/@
Y @
| @
_|_@@
\O/@
.___Y @
| @
|_@@
\O @
_| @
_| | @
|_@@
O/ @
| @
/ \ @
./ \,@@
|_O @
_|> @
_| \ @
|_@@
\O/ @
Y @
/ \ @
_| |_@@
O/ @
<| @
/ \ @
_| |_@@
\O/@
_Y @
_| | @
|_@@
\O @
.___| @
| @
|_@@
\O @
|___,@
| @
_| @@
\O/ @
Y___,@
| @
_| @@
|_O_|@
_| @
_| \ @
|_@@
'\ /`@
\ / @
X @
/O\ @@
\O @
|_ @
/ | @
./ |_@@
O/@
.___| @
| @
|_@@
O/@
_| @
_| | @
|_@@
\O @
| @
/ \ @
./ \,@@
O/ @
_| @
_| \ @
\,@@
O/ @
|___,@
| @
_| @@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
\O/ \O/# @
Y_ Y @
/ | / \ @
./ |_ ./ \,@@
\O/ \O/# @
_Y Y @
_| | / \ @
|_ ./ \,@@
\O \O/# @
|_ Y @
/ | / \ @
./ |_ ./ \,@@
\O/ \O/ @
Y_ Y @
/ | / \ @
./ |_ ./ \,@@
\O/ \O/ @
_Y Y @
_| | / \ @
|_ ./ \,@@
\O \O/ @
|_ Y @
/ | / \ @
./ |_ ./ \,@@
|_O_| |_O_|@
_| _| @
_| \ _| \ @
|_ |_@@
@@ -0,0 +1,2 @@
import type { Coordinates } from '../../types';
export declare const defaultCoordinates: Coordinates;
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=named_default.int.spec.d.ts.map
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/query/core/apiState.ts","../../src/query/core/rtkImports.ts","../../src/query/utils/copyWithStructuralSharing.ts","../../src/query/utils/filterMap.ts","../../src/query/utils/isAbsoluteUrl.ts","../../src/query/utils/isDocumentVisible.ts","../../src/query/utils/isNotNullish.ts","../../src/query/utils/isOnline.ts","../../src/query/utils/joinUrls.ts","../../src/query/utils/getOrInsert.ts","../../src/query/fetchBaseQuery.ts","../../src/query/HandledError.ts","../../src/query/retry.ts","../../src/query/core/setupListeners.ts","../../src/query/endpointDefinitions.ts","../../src/query/utils/immerImports.ts","../../src/query/core/buildInitiate.ts","../../src/tsHelpers.ts","../../src/query/apiTypes.ts","../../src/query/standardSchema.ts","../../src/query/core/buildThunks.ts","../../src/query/utils/getCurrent.ts","../../src/query/core/buildSlice.ts","../../src/query/core/buildSelectors.ts","../../src/query/createApi.ts","../../src/query/defaultSerializeQueryArgs.ts","../../src/query/fakeBaseQuery.ts","../../src/query/tsHelpers.ts","../../src/query/core/buildMiddleware/batchActions.ts","../../src/query/core/buildMiddleware/cacheCollection.ts","../../src/query/core/buildMiddleware/cacheLifecycle.ts","../../src/query/core/buildMiddleware/devMiddleware.ts","../../src/query/core/buildMiddleware/invalidationByTags.ts","../../src/query/core/buildMiddleware/polling.ts","../../src/query/core/buildMiddleware/queryLifecycle.ts","../../src/query/core/buildMiddleware/windowEventHandling.ts","../../src/query/core/buildMiddleware/index.ts","../../src/query/core/module.ts","../../src/query/core/index.ts"],"sourcesContent":["import type { SerializedError } from '@reduxjs/toolkit';\nimport type { BaseQueryError } from '../baseQueryTypes';\nimport type { BaseEndpointDefinition, EndpointDefinitions, FullTagDescription, InfiniteQueryDefinition, MutationDefinition, PageParamFrom, QueryArgFromAnyQuery, QueryDefinition, ResultTypeFrom } from '../endpointDefinitions';\nimport type { Id, WithRequiredProp } from '../tsHelpers';\nexport type QueryCacheKey = string & {\n _type: 'queryCacheKey';\n};\nexport type QuerySubstateIdentifier = {\n queryCacheKey: QueryCacheKey;\n};\nexport type MutationSubstateIdentifier = {\n requestId: string;\n fixedCacheKey?: string;\n} | {\n requestId?: string;\n fixedCacheKey: string;\n};\nexport type RefetchConfigOptions = {\n refetchOnMountOrArgChange: boolean | number;\n refetchOnReconnect: boolean;\n refetchOnFocus: boolean;\n};\nexport type InfiniteQueryConfigOptions<DataType, PageParam, QueryArg> = {\n /**\n * The initial page parameter to use for the first page fetch.\n */\n initialPageParam: PageParam;\n /**\n * This function is required to automatically get the next cursor for infinite queries.\n * The result will also be used to determine the value of `hasNextPage`.\n */\n getNextPageParam: (lastPage: DataType, allPages: Array<DataType>, lastPageParam: PageParam, allPageParams: Array<PageParam>, queryArg: QueryArg) => PageParam | undefined | null;\n /**\n * This function can be set to automatically get the previous cursor for infinite queries.\n * The result will also be used to determine the value of `hasPreviousPage`.\n */\n getPreviousPageParam?: (firstPage: DataType, allPages: Array<DataType>, firstPageParam: PageParam, allPageParams: Array<PageParam>, queryArg: QueryArg) => PageParam | undefined | null;\n /**\n * If specified, only keep this many pages in cache at once.\n * If additional pages are fetched, older pages in the other\n * direction will be dropped from the cache.\n */\n maxPages?: number;\n};\nexport type InfiniteData<DataType, PageParam> = {\n pages: Array<DataType>;\n pageParams: Array<PageParam>;\n};\n\n// NOTE: DO NOT import and use this for runtime comparisons internally,\n// except in the RTKQ React package. Use the string versions just below this.\n// ESBuild auto-inlines TS enums, which bloats our bundle with many repeated\n// constants like \"initialized\":\n// https://github.com/evanw/esbuild/releases/tag/v0.14.7\n// We still have to use this in the React package since we don't publicly export\n// the string constants below.\n/**\n * Strings describing the query state at any given time.\n */\nexport enum QueryStatus {\n uninitialized = 'uninitialized',\n pending = 'pending',\n fulfilled = 'fulfilled',\n rejected = 'rejected',\n}\n\n// Use these string constants for runtime comparisons internally\nexport const STATUS_UNINITIALIZED = QueryStatus.uninitialized;\nexport const STATUS_PENDING = QueryStatus.pending;\nexport const STATUS_FULFILLED = QueryStatus.fulfilled;\nexport const STATUS_REJECTED = QueryStatus.rejected;\nexport type RequestStatusFlags = {\n status: QueryStatus.uninitialized;\n isUninitialized: true;\n isLoading: false;\n isSuccess: false;\n isError: false;\n} | {\n status: QueryStatus.pending;\n isUninitialized: false;\n isLoading: true;\n isSuccess: false;\n isError: falsLine truncated
@@ -0,0 +1,42 @@
'use strict';
var isGlob = require('is-glob');
var pathPosixDirname = require('path').posix.dirname;
var isWin32 = require('os').platform() === 'win32';
var slash = '/';
var backslash = /\\/g;
var enclosure = /[\{\[].*[\}\]]$/;
var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
/**
* @param {string} str
* @param {Object} opts
* @param {boolean} [opts.flipBackslashes=true]
* @returns {string}
*/
module.exports = function globParent(str, opts) {
var options = Object.assign({ flipBackslashes: true }, opts);
// flip windows path separators
if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
str = str.replace(backslash, slash);
}
// special case for strings ending in enclosure containing path separator
if (enclosure.test(str)) {
str += slash;
}
// preserves full path in case of trailing path separator
str += 'a';
// remove path parts that are globby
do {
str = pathPosixDirname(str);
} while (isGlob(str) || globby.test(str));
// remove escape chars and return result
return str.replace(escaped, '$1');
};
@@ -0,0 +1 @@
{"version":3,"file":"resolveScopedResolvedValueBindingNode.js","sourceRoot":"","sources":["../../../../src/resolution/actions/resolveScopedResolvedValueBindingNode.ts"],"names":[],"mappings":";;;AAEA,6FAA0F;AAG1F,mDAAgD;AAEzC,MAAM,qCAAqC,GAQtB,CAC1B,OAGyB,EACzB,EAAE,CAAC,IAAA,6BAAa,EAAC,yDAA2B,EAAE,OAAO,CAAC,CAAC;AAb5C,QAAA,qCAAqC,yCAaO"}
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more