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,48 @@
/**
* @returns {String} the string with all zeroes contained in a <span>
*/
export function spanAllZeroes(s: string): string {
return s.replace(/(0+)/g, '<span class="zero">$1</span>');
}
/**
* @returns {String} the string with each character contained in a <span>
*/
export function spanAll(s: string, offset: number = 0): string {
const letters = s.split('');
return letters
.map(
(n, i) => `<span class="digit value-${n} position-${i + offset}">${spanAllZeroes(n)}</span>`,
)
.join('');
}
function spanLeadingZeroesSimple(group: string): string {
return group.replace(/^(0+)/, '<span class="zero">$1</span>');
}
/**
* @returns {String} the string with leading zeroes contained in a <span>
*/
export function spanLeadingZeroes(address: string): string {
const groups = address.split(':');
return groups.map((g) => spanLeadingZeroesSimple(g)).join(':');
}
/**
* Groups an address
* @returns {String} a grouped address
*/
export function simpleGroup(addressString: string, offset: number = 0): string[] {
const groups = addressString.split(':');
return groups.map((g, i) => {
if (/group-v4/.test(g)) {
return g;
}
return `<span class="hover-group group-${i + offset}">${spanLeadingZeroesSimple(g)}</span>`;
});
}
@@ -0,0 +1,101 @@
import { AnyConfig } from './types'
export const IMPORTANT_MODIFIER = '!'
export const createParseClassName = (config: AnyConfig) => {
const { separator, experimentalParseClassName } = config
const isSeparatorSingleCharacter = separator.length === 1
const firstSeparatorCharacter = separator[0]
const separatorLength = separator.length
// parseClassName inspired by https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js
const parseClassName = (className: string) => {
const modifiers = []
let bracketDepth = 0
let modifierStart = 0
let postfixModifierPosition: number | undefined
for (let index = 0; index < className.length; index++) {
let currentCharacter = className[index]
if (bracketDepth === 0) {
if (
currentCharacter === firstSeparatorCharacter &&
(isSeparatorSingleCharacter ||
className.slice(index, index + separatorLength) === separator)
) {
modifiers.push(className.slice(modifierStart, index))
modifierStart = index + separatorLength
continue
}
if (currentCharacter === '/') {
postfixModifierPosition = index
continue
}
}
if (currentCharacter === '[') {
bracketDepth++
} else if (currentCharacter === ']') {
bracketDepth--
}
}
const baseClassNameWithImportantModifier =
modifiers.length === 0 ? className : className.substring(modifierStart)
const hasImportantModifier =
baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)
const baseClassName = hasImportantModifier
? baseClassNameWithImportantModifier.substring(1)
: baseClassNameWithImportantModifier
const maybePostfixModifierPosition =
postfixModifierPosition && postfixModifierPosition > modifierStart
? postfixModifierPosition - modifierStart
: undefined
return {
modifiers,
hasImportantModifier,
baseClassName,
maybePostfixModifierPosition,
}
}
if (experimentalParseClassName) {
return (className: string) => experimentalParseClassName({ className, parseClassName })
}
return parseClassName
}
/**
* Sorts modifiers according to following schema:
* - Predefined modifiers are sorted alphabetically
* - When an arbitrary variant appears, it must be preserved which modifiers are before and after it
*/
export const sortModifiers = (modifiers: string[]) => {
if (modifiers.length <= 1) {
return modifiers
}
const sortedModifiers: string[] = []
let unsortedModifiers: string[] = []
modifiers.forEach((modifier) => {
const isArbitraryVariant = modifier[0] === '['
if (isArbitraryVariant) {
sortedModifiers.push(...unsortedModifiers.sort(), modifier)
unsortedModifiers = []
} else {
unsortedModifiers.push(modifier)
}
})
sortedModifiers.push(...unsortedModifiers.sort())
return sortedModifiers
}
@@ -0,0 +1,53 @@
import * as ts from 'typescript';
/**
* @example
* ```ts
* class DerivedClass extends Promise<number> {}
* DerivedClass.reject
* // ^ PromiseLike
* ```
*/
export declare function isPromiseLike(program: ts.Program, type: ts.Type): boolean;
/**
* @example
* ```ts
* const value = Promise
* value.reject
* // ^ PromiseConstructorLike
* ```
*/
export declare function isPromiseConstructorLike(program: ts.Program, type: ts.Type): boolean;
/**
* @example
* ```ts
* class Foo extends Error {}
* new Foo()
* // ^ ErrorLike
* ```
*/
export declare function isErrorLike(program: ts.Program, type: ts.Type): boolean;
/**
* @example
* ```ts
* type T = Readonly<Error>
* // ^ ReadonlyErrorLike
* ```
*/
export declare function isReadonlyErrorLike(program: ts.Program, type: ts.Type): boolean;
/**
* @example
* ```ts
* type T = Readonly<{ foo: 'bar' }>
* // ^ ReadonlyTypeLike
* ```
*/
export declare function isReadonlyTypeLike(program: ts.Program, type: ts.Type, predicate?: (subType: {
aliasSymbol: ts.Symbol;
aliasTypeArguments: readonly ts.Type[];
} & ts.Type) => boolean): boolean;
export declare function isBuiltinTypeAliasLike(program: ts.Program, type: ts.Type, predicate: (subType: {
aliasSymbol: ts.Symbol;
aliasTypeArguments: readonly ts.Type[];
} & ts.Type) => boolean): boolean;
export declare function isBuiltinSymbolLike(program: ts.Program, type: ts.Type, symbolName: string | string[]): boolean;
export declare function isBuiltinSymbolLikeRecurser(program: ts.Program, type: ts.Type, predicate: (subType: ts.Type) => boolean | null): boolean;
@@ -0,0 +1,30 @@
import * as _heroui_system from '@heroui/system';
import { HTMLHeroUIProps } from '@heroui/system';
import { GridNode } from '@react-types/grid';
import { ValuesType } from './use-table.mjs';
import '@react-types/table';
import 'react';
import '@heroui/theme';
import '@react-stately/virtualizer';
import '@react-types/shared';
import '@react-stately/table';
import '@react-aria/table';
import '@heroui/react-utils';
import '@heroui/checkbox';
interface TableSelectAllCheckboxProps<T = object> extends HTMLHeroUIProps<"th"> {
/**
* The table column.
*/
node: GridNode<T>;
slots: ValuesType["slots"];
state: ValuesType["state"];
color: ValuesType["color"];
disableAnimation: ValuesType["disableAnimation"];
checkboxesProps: ValuesType["checkboxesProps"];
selectionMode: ValuesType["selectionMode"];
classNames?: ValuesType["classNames"];
}
declare const TableSelectAllCheckbox: _heroui_system.InternalForwardRefRenderFunction<"th", TableSelectAllCheckboxProps<object>, never>;
export { type TableSelectAllCheckboxProps, TableSelectAllCheckbox as default };
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A wC","132":"B"},B:{"1":"0 1 2 3 4 5 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","132":"C L M G N O P","513":"Q H R S T"},C:{"1":"W X Y Z a","2":"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 0C 1C","513":"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","2049":"0 1 2 3 4 5 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"},D:{"1":"0 1 2 3 4 5 U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 J ZB K D E F A B C L M G N O P aB","260":"7 8 9 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","513":"VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T"},E:{"2":"J ZB K D 2C ZC 3C 4C","132":"E F A B 5C 6C aC","513":"C NC OC","1025":"G 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","1537":"L M 7C 8C"},F:{"1":"0 1 2 3 4 5 GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C FD GD HD ID NC uC JD OC","513":"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"},G:{"2":"ZC KD vC LD MD ND","132":"E OD PD QD RD SD TD UD","513":"VD WD XD YD","1025":"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","1537":"ZD aD bD cD"},H:{"2":"hD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"2049":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB wD xD QC RC SC yD","2":"J","513":"oD pD qD rD sD aC tD uD vD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"513":"1D 2D"}},B:4,C:"Referrer Policy",D:true};
@@ -0,0 +1,58 @@
{
"name": "micromark-factory-title",
"version": "2.0.1",
"description": "micromark factory to parse markdown titles (found in resources, definitions)",
"license": "MIT",
"keywords": [
"micromark",
"factory",
"title"
],
"repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-factory-title",
"bugs": "https://github.com/micromark/micromark/issues",
"funding": [
{
"type": "GitHub Sponsors",
"url": "https://github.com/sponsors/unifiedjs"
},
{
"type": "OpenCollective",
"url": "https://opencollective.com/unified"
}
],
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"sideEffects": false,
"type": "module",
"files": [
"dev/",
"index.d.ts.map",
"index.d.ts",
"index.js"
],
"exports": {
"development": "./dev/index.js",
"default": "./index.js"
},
"dependencies": {
"micromark-factory-space": "^2.0.0",
"micromark-util-character": "^2.0.0",
"micromark-util-symbol": "^2.0.0",
"micromark-util-types": "^2.0.0"
},
"scripts": {
"build": "micromark-build"
},
"xo": {
"envs": [
"shared-node-browser"
],
"prettier": true,
"rules": {
"max-params": "off",
"unicorn/prefer-code-point": "off"
}
}
}
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.S_UNICODE_REGEX = void 0;
// @generated from regex-gen.ts
exports.S_UNICODE_REGEX = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEE0-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF73\uDF80-\uDFD8\uDFE0-\uDFEB]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDD78\uDD7A-\uDDCB\uDDCD-\uDE53\uDE60-\uDE6D\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6\uDF00-\uDF92\uDF94-\uDFCA]/;
@@ -0,0 +1,104 @@
var $d1742ec2644a0949$exports = require("./intlStrings.main.js");
var $jo7gW$reactariautils = require("@react-aria/utils");
var $jo7gW$reactariai18n = require("@react-aria/i18n");
var $jo7gW$reactariainteractions = require("@react-aria/interactions");
var $jo7gW$reactariaoverlays = require("@react-aria/overlays");
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, "useMenuTrigger", () => $7211ab9328763fb9$export$dc9c12ed27dd1b49);
/*
* 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 $7211ab9328763fb9$export$dc9c12ed27dd1b49(props, state, ref) {
let { type: type = 'menu', isDisabled: isDisabled, trigger: trigger = 'press' } = props;
let menuTriggerId = (0, $jo7gW$reactariautils.useId)();
let { triggerProps: triggerProps, overlayProps: overlayProps } = (0, $jo7gW$reactariaoverlays.useOverlayTrigger)({
type: type
}, state, ref);
let onKeyDown = (e)=>{
if (isDisabled) return;
if (trigger === 'longPress' && !e.altKey) return;
if (ref && ref.current) switch(e.key){
case 'Enter':
case ' ':
if (trigger === 'longPress') return;
// fallthrough
case 'ArrowDown':
// Stop propagation, unless it would already be handled by useKeyboard.
if (!('continuePropagation' in e)) e.stopPropagation();
e.preventDefault();
state.toggle('first');
break;
case 'ArrowUp':
if (!('continuePropagation' in e)) e.stopPropagation();
e.preventDefault();
state.toggle('last');
break;
default:
// Allow other keys.
if ('continuePropagation' in e) e.continuePropagation();
}
};
let stringFormatter = (0, $jo7gW$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($d1742ec2644a0949$exports))), '@react-aria/menu');
let { longPressProps: longPressProps } = (0, $jo7gW$reactariainteractions.useLongPress)({
isDisabled: isDisabled || trigger !== 'longPress',
accessibilityDescription: stringFormatter.format('longPressMessage'),
onLongPressStart () {
state.close();
},
onLongPress () {
state.open('first');
}
});
let pressProps = {
onPressStart (e) {
// For consistency with native, open the menu on mouse/key down, but touch up.
if (e.pointerType !== 'touch' && e.pointerType !== 'keyboard' && !isDisabled) // If opened with a screen reader, auto focus the first item.
// Otherwise, the menu itself will be focused.
state.open(e.pointerType === 'virtual' ? 'first' : null);
},
onPress (e) {
if (e.pointerType === 'touch' && !isDisabled) state.toggle();
}
};
// omit onPress from triggerProps since we override it above.
delete triggerProps.onPress;
return {
// @ts-ignore - TODO we pass out both DOMAttributes AND AriaButtonProps, but useButton will discard the longPress event handlers, it's only through PressResponder magic that this works for RSP and RAC. it does not work in aria examples
menuTriggerProps: {
...triggerProps,
...trigger === 'press' ? pressProps : longPressProps,
id: menuTriggerId,
onKeyDown: onKeyDown
},
menuProps: {
...overlayProps,
'aria-labelledby': menuTriggerId,
autoFocus: state.focusStrategy || true,
onClose: state.close
}
};
}
//# sourceMappingURL=useMenuTrigger.main.js.map
@@ -0,0 +1,275 @@
"use strict";
const compile = require("./compile.js");
const normalizeUnit = require("./normalizeUnit-Cn0hUyBC.js");
const units = require("./units.js");
const BASIC_ISO_REGEX = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
const EXTENDED_ISO_REGEX = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
const ISO_TIMES_REGEX = [
/(\d\d):(\d\d):(\d\d)\.(\d+)/,
// 'HH:mm:ss.SSSS'
/(\d\d):(\d\d):(\d\d),(\d+)/,
// 'HH:mm:ss,SSSS'
/(\d\d):(\d\d):(\d\d)/,
// 'HH:mm:ss'
/(\d\d):(\d\d)/,
// 'HH:mm'
/(\d\d)(\d\d)(\d\d)\.(\d+)/,
// 'HHmmss.SSSS'
/(\d\d)(\d\d)(\d\d),(\d+)/,
// 'HHmmss,SSSS'
/(\d\d)(\d\d)(\d\d)/,
// 'HHmmss'
/(\d\d)(\d\d)/,
// 'HHmm'
/(\d\d)/
// 'HH'
];
const TZ_REGEX = /(Z)|([+-]\d\d)(?::?(\d\d))?/;
const ISO_DATES_REGEX = [
/(\d{4})-(\d\d)-(\d\d)/,
// 'YYYY-MM-DD'
/(\d{4})-(\d\d)/,
// 'YYYY-MM'
/(\d{4})(\d\d)(\d\d)/,
// 'YYYYMMDD'
/(\d{4})(\d\d)/,
// 'YYYYMM'
/(\d{4})/
// 'YYYY'
];
function autoExtract(input) {
const dateRet = new Array(8);
let matches;
const match = EXTENDED_ISO_REGEX.exec(input) || BASIC_ISO_REGEX.exec(input);
if (match) {
const datesLen = ISO_DATES_REGEX.length;
for (let i = 0; i < datesLen; i++) {
if (matches = ISO_DATES_REGEX[i].exec(match[1])) {
for (let j = 0; j < 3; j++) {
const matched = matches[j + 1];
dateRet[j] = matched ? +matched : 1;
}
if (dateRet[1]) {
dateRet[1] -= 1;
}
break;
}
}
matches = null;
if (match[3]) {
for (let i = 0, timesLen = ISO_TIMES_REGEX.length; i < timesLen; i++) {
if (matches = ISO_TIMES_REGEX[i].exec(match[3])) {
if (matches[4]) {
matches[4] = matches[4].padEnd(3, "00");
}
for (let j = 1, len = matches.length; j < len; j++) {
dateRet[j + 2] = +matches[j];
}
break;
}
}
}
matches = null;
if (match[4]) {
matches = TZ_REGEX.exec(match[4]);
if (matches) {
dateRet[7] = matches[1] ? NaN : +matches[2] * 60 + (matches[3] ? +matches[3] : 0);
}
}
return dateRet;
}
return input;
}
function createDate(y, m, d, h, minute, s, ms) {
let date;
if (y < 100 && y >= 0) {
date = new Date(y + 400, m, d, h, minute, s, ms);
if (isFinite(date.getFullYear())) {
date.setFullYear(y);
}
} else {
date = new Date(y, m, d, h, minute, s, ms);
}
return date;
}
function createUTCDate(y, m, d, h, minute, s, ms) {
let date;
if (y < 100 && y >= 0) {
y += 400;
date = new Date(Date.UTC(y, m, d, h, minute, s, ms));
if (isFinite(date.getUTCFullYear())) {
date.setUTCFullYear(y);
}
} else {
date = new Date(Date.UTC(y, m, d, h, minute, s, ms));
}
return date;
}
function createFromArray(input) {
const utcOffset = input[7];
const currentDate = /* @__PURE__ */ new Date();
const isUTC = Number.isNaN(utcOffset);
const flag = isUTC ? "UTC" : "";
const currentStuffing = [
currentDate[`get${flag}FullYear`](),
currentDate[`get${flag}Month`](),
currentDate[`get${flag}Date`]()
];
let i = 0;
const array = new Array(7);
for (; i < 3 && input[i] == null; ++i) {
array[i] = currentStuffing[i];
}
for (; i < 7; i++) {
array[i] = input[i] == null ? 0 : input[i];
}
let day = array[2];
if (day === 0) {
day = 1;
}
let minute = array[4];
if (!isUTC && typeof utcOffset === "number") {
minute -= utcOffset + currentDate.getTimezoneOffset();
}
return (isUTC ? createUTCDate : createDate)(
array[0],
array[1],
day,
array[3],
minute,
array[5],
array[6]
);
}
function toInteger(val) {
return parseInt(val, 10);
}
function toMonth(val) {
return parseInt(val, 10) - 1;
}
function toMilliseconds(val) {
return parseInt(val.padEnd(3, "0"), 10);
}
function parseTimezone(val) {
if (val === "Z") {
return NaN;
}
const matches = TZ_REGEX.exec(val);
return +matches[2] * 60 + (matches[3] ? +matches[3] : 0);
}
function extractWithFormat(input, format) {
const { pattern, tokens } = compile(format);
const match = new RegExp(pattern).exec(input);
if (!match) {
return "";
}
const parts = [];
tokens.forEach((token, i) => {
const value = match[i + 1];
switch (token) {
case "YYYY":
parts[0] = toInteger(value);
break;
// case 'YY':
// parts[0] = toInteger(value);
// break;
case "MM":
parts[1] = toMonth(value);
break;
case "DD":
parts[2] = toInteger(value);
break;
case "HH":
parts[3] = toInteger(value);
break;
case "mm":
parts[4] = toInteger(value);
break;
case "ss":
parts[5] = toInteger(value);
break;
case "SSS":
parts[6] = toMilliseconds(value);
break;
case "Z":
parts[7] = parseTimezone(value);
break;
}
});
return parts;
}
const { DATE, DAY, HOUR, MILLISECOND, MINUTE, MONTH, SECOND, YEAR, UTC_OFFSET } = units;
const ASP_NET_JSON_REGEX = /^\/?Date\((-?\d+)/i;
function ensureType(value, checked) {
return checked;
}
function parseObject(obj) {
const array = [];
Object.entries(obj).forEach(([unit, value]) => {
unit = normalizeUnit.normalizeUnit(unit);
switch (unit) {
case YEAR:
array[0] = value;
break;
case MONTH:
array[1] = value;
break;
case DATE:
case DAY:
array[2] = value;
break;
case HOUR:
array[3] = value;
break;
case MINUTE:
array[4] = value;
break;
case SECOND:
array[5] = value;
break;
case MILLISECOND:
array[6] = value;
break;
case UTC_OFFSET:
array[7] = value;
break;
}
});
if (array.length === 0) {
return /* @__PURE__ */ new Date();
}
return createFromArray(array);
}
function parseString(input, format) {
const extracted = typeof format === "string" && format ? extractWithFormat(input, format) : autoExtract(input);
if (Array.isArray(extracted)) {
return createFromArray(extracted);
}
const matched = ASP_NET_JSON_REGEX.exec(input);
return new Date(matched !== null ? +matched[1] : Date.parse(extracted));
}
function parse(input, format) {
let ret;
const whatType = typeof input;
if (ensureType(input, whatType === "string")) {
ret = parseString(input, format);
} else if (Array.isArray(input)) {
ret = createFromArray(input);
} else if (input instanceof Date) {
ret = new Date(input);
} else if (ensureType(input, whatType === "object" && input !== null)) {
if (input.isValid && input.isValid()) {
ret = /* @__PURE__ */ new Date(+input);
} else {
ret = parseObject(input);
}
} else if (ensureType(input, whatType === "number")) {
ret = new Date(input);
} else if (ensureType(input, whatType === "undefined")) {
ret = format ? /* @__PURE__ */ new Date(NaN) : /* @__PURE__ */ new Date();
} else {
ret = new Date(Date.parse(input));
}
return ret;
}
module.exports = parse;
@@ -0,0 +1,45 @@
var duplexer = require('duplexer')
var through = require('through')
module.exports = function () {
var streams
if(arguments.length == 1 && Array.isArray(arguments[0])) {
streams = arguments[0]
} else {
streams = [].slice.call(arguments)
}
if(streams.length == 0)
return through()
else if(streams.length == 1)
return streams[0]
var first = streams[0]
, last = streams[streams.length - 1]
, thepipe = duplexer(first, last)
//pipe all the streams together
function recurse (streams) {
if(streams.length < 2)
return
streams[0].pipe(streams[1])
recurse(streams.slice(1))
}
recurse(streams)
function onerror () {
var args = [].slice.call(arguments)
args.unshift('error')
thepipe.emit.apply(thepipe, args)
}
//es.duplex already reemits the error from the first and last stream.
//add a listener for the inner streams in the pipeline.
for(var i = 1; i < streams.length - 1; i ++)
streams[i].on('error', onerror)
return thepipe
}
@@ -0,0 +1,8 @@
var $7c28f5687f0779a9$exports = {};
$7c28f5687f0779a9$exports = {
"dismiss": `Hylk\xe4\xe4`
};
export {$7c28f5687f0779a9$exports as default};
//# sourceMappingURL=fi-FI.module.js.map
@@ -0,0 +1,135 @@
/**
* @fileoverview Rule to enforce a single linebreak style.
* @author Erik Mueller
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------
/**
* @import { SourceRange } from "@eslint/core";
*/
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "linebreak-style",
url: "https://eslint.style/rules/linebreak-style",
},
},
],
},
type: "layout",
docs: {
description: "Enforce consistent linebreak style",
recommended: false,
url: "https://eslint.org/docs/latest/rules/linebreak-style",
},
fixable: "whitespace",
schema: [
{
enum: ["unix", "windows"],
},
],
messages: {
expectedLF: "Expected linebreaks to be 'LF' but found 'CRLF'.",
expectedCRLF: "Expected linebreaks to be 'CRLF' but found 'LF'.",
},
},
create(context) {
const sourceCode = context.sourceCode;
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Builds a fix function that replaces text at the specified range in the source text.
* @param {SourceRange} range The range to replace
* @param {string} text The text to insert.
* @returns {Function} Fixer function
* @private
*/
function createFix(range, text) {
return function (fixer) {
return fixer.replaceTextRange(range, text);
};
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
Program: function checkForLinebreakStyle(node) {
const linebreakStyle = context.options[0] || "unix",
expectedLF = linebreakStyle === "unix",
expectedLFChars = expectedLF ? "\n" : "\r\n",
source = sourceCode.getText(),
pattern = astUtils.createGlobalLinebreakMatcher();
let match;
let i = 0;
while ((match = pattern.exec(source)) !== null) {
i++;
if (match[0] === expectedLFChars) {
continue;
}
const index = match.index;
const range = [index, index + match[0].length];
context.report({
node,
loc: {
start: {
line: i,
column: sourceCode.lines[i - 1].length,
},
end: {
line: i + 1,
column: 0,
},
},
messageId: expectedLF ? "expectedLF" : "expectedCRLF",
fix: createFix(range, expectedLFChars),
});
}
},
};
},
};
@@ -0,0 +1,7 @@
export default function dlv(obj, key, def, p, undef) {
key = key.split ? key.split('.') : key;
for (p = 0; p < key.length; p++) {
obj = obj ? obj[key[p]] : undef;
}
return obj === undef ? def : obj;
}
@@ -0,0 +1,16 @@
var baseForRight = require('./_baseForRight'),
keys = require('./keys');
/**
* The base implementation of `_.forOwnRight` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwnRight(object, iteratee) {
return object && baseForRight(object, iteratee, keys);
}
module.exports = baseForOwnRight;
@@ -0,0 +1,3 @@
export default function escapeCommas(className) {
return className.replace(/\\,/g, '\\2c ')
}
@@ -0,0 +1,181 @@
# micromark-util-subtokenize
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]
[micromark][] utility to tokenize subtokens.
## Contents
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`subtokenize(events)`](#subtokenizeevents)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This package exposes a micromark internal that you probably don’t need.
## When should I use this?
This package might be useful when you are making your own micromark extensions.
## Install
This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:
```sh
npm install micromark-util-subtokenize
```
In Deno with [`esm.sh`][esmsh]:
```js
import {subtokenize} from 'https://esm.sh/micromark-util-subtokenize@1'
```
In browsers with [`esm.sh`][esmsh]:
```html
<script type="module">
import {subtokenize} from 'https://esm.sh/micromark-util-subtokenize@1?bundle'
</script>
```
## Use
```js
import {subtokenize} from 'micromark-util-subtokenize'
/**
* Content is transparent: it’s parsed right now. That way, definitions are also
* parsed right now: before text in paragraphs (specifically, media) are parsed.
*
* @type {Resolver}
*/
function resolveContent(events) {
subtokenize(events)
return events
}
```
## API
This module exports the identifiers [`subtokenize`][api-subtokenize].
There is no default export.
### `subtokenize(events)`
Tokenize subcontent.
###### Parameters
* `events` (`Array<Event>`)
— list of events
###### Returns
Whether subtokens were found (`boolean`).
## Types
This package is fully typed with [TypeScript][].
It exports no additional types.
## Compatibility
Projects maintained by the unified collective are compatible with maintained
versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-util-subtokenize@2`, compatible with Node.js 16.
This package works with `micromark@3`.
## Security
This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.
## Contribute
See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.
This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[api-subtokenize]: #subtokenizeevents
[author]: https://wooorm.com
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
[build]: https://github.com/micromark/micromark/actions
[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg
[bundle-size]: https://bundlejs.com/?q=micromark-util-subtokenize
[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-subtokenize
[chat]: https://github.com/micromark/micromark/discussions
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
[contributing]: https://github.com/micromark/.github/blob/main/contributing.md
[coverage]: https://codecov.io/github/micromark/micromark
[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg
[downloads]: https://www.npmjs.com/package/micromark-util-subtokenize
[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-subtokenize.svg
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[esmsh]: https://esm.sh
[health]: https://github.com/micromark/.github
[license]: https://github.com/micromark/micromark/blob/main/license
[micromark]: https://github.com/micromark/micromark
[npm]: https://docs.npmjs.com/cli/install
[opencollective]: https://opencollective.com/unified
[securitymd]: https://github.com/micromark/.github/blob/main/security.md
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
[support]: https://github.com/micromark/.github/blob/main/support.md
[typescript]: https://www.typescriptlang.org
@@ -0,0 +1,14 @@
declare const blue: {
50: string;
100: string;
200: string;
300: string;
400: string;
500: string;
600: string;
700: string;
800: string;
900: string;
};
export { blue };
@@ -0,0 +1,447 @@
/**
* @fileoverview Source code for spaced-comments rule
* @author Gyandeep Singh
* @deprecated in ESLint v8.53.0
*/
"use strict";
const escapeRegExp = require("escape-string-regexp");
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Escapes the control characters of a given string.
* @param {string} s A string to escape.
* @returns {string} An escaped string.
*/
function escape(s) {
return `(?:${escapeRegExp(s)})`;
}
/**
* Escapes the control characters of a given string.
* And adds a repeat flag.
* @param {string} s A string to escape.
* @returns {string} An escaped string.
*/
function escapeAndRepeat(s) {
return `${escape(s)}+`;
}
/**
* Parses `markers` option.
* If markers don't include `"*"`, this adds `"*"` to allow JSDoc comments.
* @param {string[]} [markers] A marker list.
* @returns {string[]} A marker list.
*/
function parseMarkersOption(markers) {
// `*` is a marker for JSDoc comments.
if (!markers.includes("*")) {
return markers.concat("*");
}
return markers;
}
/**
* Creates string pattern for exceptions.
* Generated pattern:
*
* 1. A space or an exception pattern sequence.
* @param {string[]} exceptions An exception pattern list.
* @returns {string} A regular expression string for exceptions.
*/
function createExceptionsPattern(exceptions) {
let pattern = "";
/*
* A space or an exception pattern sequence.
* [] ==> "\s"
* ["-"] ==> "(?:\s|\-+$)"
* ["-", "="] ==> "(?:\s|(?:\-+|=+)$)"
* ["-", "=", "--=="] ==> "(?:\s|(?:\-+|=+|(?:\-\-==)+)$)" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5Cs%7C(%3F%3A%5C-%2B%7C%3D%2B%7C(%3F%3A%5C-%5C-%3D%3D)%2B)%24)
*/
if (exceptions.length === 0) {
// a space.
pattern += "\\s";
} else {
// a space or...
pattern += "(?:\\s|";
if (exceptions.length === 1) {
// a sequence of the exception pattern.
pattern += escapeAndRepeat(exceptions[0]);
} else {
// a sequence of one of the exception patterns.
pattern += "(?:";
pattern += exceptions.map(escapeAndRepeat).join("|");
pattern += ")";
}
pattern += `(?:$|[${Array.from(astUtils.LINEBREAKS).join("")}]))`;
}
return pattern;
}
/**
* Creates RegExp object for `always` mode.
* Generated pattern for beginning of comment:
*
* 1. First, a marker or nothing.
* 2. Next, a space or an exception pattern sequence.
* @param {string[]} markers A marker list.
* @param {string[]} exceptions An exception pattern list.
* @returns {RegExp} A RegExp object for the beginning of a comment in `always` mode.
*/
function createAlwaysStylePattern(markers, exceptions) {
let pattern = "^";
/*
* A marker or nothing.
* ["*"] ==> "\*?"
* ["*", "!"] ==> "(?:\*|!)?"
* ["*", "/", "!<"] ==> "(?:\*|\/|(?:!<))?" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5C*%7C%5C%2F%7C(%3F%3A!%3C))%3F
*/
if (markers.length === 1) {
// the marker.
pattern += escape(markers[0]);
} else {
// one of markers.
pattern += "(?:";
pattern += markers.map(escape).join("|");
pattern += ")";
}
pattern += "?"; // or nothing.
pattern += createExceptionsPattern(exceptions);
return new RegExp(pattern, "u");
}
/**
* Creates RegExp object for `never` mode.
* Generated pattern for beginning of comment:
*
* 1. First, a marker or nothing (captured).
* 2. Next, a space or a tab.
* @param {string[]} markers A marker list.
* @returns {RegExp} A RegExp object for `never` mode.
*/
function createNeverStylePattern(markers) {
const pattern = `^(${markers.map(escape).join("|")})?[ \t]+`;
return new RegExp(pattern, "u");
}
//------------------------------------------------------------------------------
// 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: "spaced-comment",
url: "https://eslint.style/rules/spaced-comment",
},
},
],
},
type: "suggestion",
docs: {
description:
"Enforce consistent spacing after the `//` or `/*` in a comment",
recommended: false,
url: "https://eslint.org/docs/latest/rules/spaced-comment",
},
fixable: "whitespace",
schema: [
{
enum: ["always", "never"],
},
{
type: "object",
properties: {
exceptions: {
type: "array",
items: {
type: "string",
},
},
markers: {
type: "array",
items: {
type: "string",
},
},
line: {
type: "object",
properties: {
exceptions: {
type: "array",
items: {
type: "string",
},
},
markers: {
type: "array",
items: {
type: "string",
},
},
},
additionalProperties: false,
},
block: {
type: "object",
properties: {
exceptions: {
type: "array",
items: {
type: "string",
},
},
markers: {
type: "array",
items: {
type: "string",
},
},
balanced: {
type: "boolean",
default: false,
},
},
additionalProperties: false,
},
},
additionalProperties: false,
},
],
messages: {
unexpectedSpaceAfterMarker:
"Unexpected space or tab after marker ({{refChar}}) in comment.",
expectedExceptionAfter:
"Expected exception block, space or tab after '{{refChar}}' in comment.",
unexpectedSpaceBefore:
"Unexpected space or tab before '*/' in comment.",
unexpectedSpaceAfter:
"Unexpected space or tab after '{{refChar}}' in comment.",
expectedSpaceBefore:
"Expected space or tab before '*/' in comment.",
expectedSpaceAfter:
"Expected space or tab after '{{refChar}}' in comment.",
},
},
create(context) {
const sourceCode = context.sourceCode;
// Unless the first option is never, require a space
const requireSpace = context.options[0] !== "never";
/*
* Parse the second options.
* If markers don't include `"*"`, it's added automatically for JSDoc
* comments.
*/
const config = context.options[1] || {};
const balanced = config.block && config.block.balanced;
const styleRules = ["block", "line"].reduce((rule, type) => {
const markers = parseMarkersOption(
(config[type] && config[type].markers) || config.markers || [],
);
const exceptions =
(config[type] && config[type].exceptions) ||
config.exceptions ||
[];
const endNeverPattern = "[ \t]+$";
// Create RegExp object for valid patterns.
rule[type] = {
beginRegex: requireSpace
? createAlwaysStylePattern(markers, exceptions)
: createNeverStylePattern(markers),
endRegex:
balanced && requireSpace
? new RegExp(
`${createExceptionsPattern(exceptions)}$`,
"u",
)
: new RegExp(endNeverPattern, "u"),
hasExceptions: exceptions.length > 0,
captureMarker: new RegExp(
`^(${markers.map(escape).join("|")})`,
"u",
),
markers: new Set(markers),
};
return rule;
}, {});
/**
* Reports a beginning spacing error with an appropriate message.
* @param {ASTNode} node A comment node to check.
* @param {string} messageId An error message to report.
* @param {Array} match An array of match results for markers.
* @param {string} refChar Character used for reference in the error message.
* @returns {void}
*/
function reportBegin(node, messageId, match, refChar) {
const type = node.type.toLowerCase(),
commentIdentifier = type === "block" ? "/*" : "//";
context.report({
node,
fix(fixer) {
const start = node.range[0];
let end = start + 2;
if (requireSpace) {
if (match) {
end += match[0].length;
}
return fixer.insertTextAfterRange([start, end], " ");
}
end += match[0].length;
return fixer.replaceTextRange(
[start, end],
commentIdentifier + (match[1] ? match[1] : ""),
);
},
messageId,
data: { refChar },
});
}
/**
* Reports an ending spacing error with an appropriate message.
* @param {ASTNode} node A comment node to check.
* @param {string} messageId An error message to report.
* @param {string} match An array of the matched whitespace characters.
* @returns {void}
*/
function reportEnd(node, messageId, match) {
context.report({
node,
fix(fixer) {
if (requireSpace) {
return fixer.insertTextAfterRange(
[node.range[0], node.range[1] - 2],
" ",
);
}
const end = node.range[1] - 2,
start = end - match[0].length;
return fixer.replaceTextRange([start, end], "");
},
messageId,
});
}
/**
* Reports a given comment if it's invalid.
* @param {ASTNode} node a comment node to check.
* @returns {void}
*/
function checkCommentForSpace(node) {
const type = node.type.toLowerCase(),
rule = styleRules[type],
commentIdentifier = type === "block" ? "/*" : "//";
// Ignores empty comments and comments that consist only of a marker.
if (node.value.length === 0 || rule.markers.has(node.value)) {
return;
}
const beginMatch = rule.beginRegex.exec(node.value);
const endMatch = rule.endRegex.exec(node.value);
// Checks.
if (requireSpace) {
if (!beginMatch) {
const hasMarker = rule.captureMarker.exec(node.value);
const marker = hasMarker
? commentIdentifier + hasMarker[0]
: commentIdentifier;
if (rule.hasExceptions) {
reportBegin(
node,
"expectedExceptionAfter",
hasMarker,
marker,
);
} else {
reportBegin(
node,
"expectedSpaceAfter",
hasMarker,
marker,
);
}
}
if (balanced && type === "block" && !endMatch) {
reportEnd(node, "expectedSpaceBefore");
}
} else {
if (beginMatch) {
if (!beginMatch[1]) {
reportBegin(
node,
"unexpectedSpaceAfter",
beginMatch,
commentIdentifier,
);
} else {
reportBegin(
node,
"unexpectedSpaceAfterMarker",
beginMatch,
beginMatch[1],
);
}
}
if (balanced && type === "block" && endMatch) {
reportEnd(node, "unexpectedSpaceBefore", endMatch);
}
}
}
return {
Program() {
const comments = sourceCode.getAllComments();
comments
.filter(token => token.type !== "Shebang")
.forEach(checkCommentForSpace);
},
};
},
};
@@ -0,0 +1,315 @@
/**
* @fileoverview Operator linebreak - enforces operator linebreak style of two types: after and before
* @author Benoît Zugmeyer
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "operator-linebreak",
url: "https://eslint.style/rules/operator-linebreak",
},
},
],
},
type: "layout",
docs: {
description: "Enforce consistent linebreak style for operators",
recommended: false,
url: "https://eslint.org/docs/latest/rules/operator-linebreak",
},
schema: [
{
enum: ["after", "before", "none", null],
},
{
type: "object",
properties: {
overrides: {
type: "object",
additionalProperties: {
enum: ["after", "before", "none", "ignore"],
},
},
},
additionalProperties: false,
},
],
fixable: "code",
messages: {
operatorAtBeginning:
"'{{operator}}' should be placed at the beginning of the line.",
operatorAtEnd:
"'{{operator}}' should be placed at the end of the line.",
badLinebreak: "Bad line breaking before and after '{{operator}}'.",
noLinebreak:
"There should be no line break before or after '{{operator}}'.",
},
},
create(context) {
const usedDefaultGlobal = !context.options[0];
const globalStyle = context.options[0] || "after";
const options = context.options[1] || {};
const styleOverrides = options.overrides
? Object.assign({}, options.overrides)
: {};
if (usedDefaultGlobal && !styleOverrides["?"]) {
styleOverrides["?"] = "before";
}
if (usedDefaultGlobal && !styleOverrides[":"]) {
styleOverrides[":"] = "before";
}
const sourceCode = context.sourceCode;
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Gets a fixer function to fix rule issues
* @param {Token} operatorToken The operator token of an expression
* @param {string} desiredStyle The style for the rule. One of 'before', 'after', 'none'
* @returns {Function} A fixer function
*/
function getFixer(operatorToken, desiredStyle) {
return fixer => {
const tokenBefore = sourceCode.getTokenBefore(operatorToken);
const tokenAfter = sourceCode.getTokenAfter(operatorToken);
const textBefore = sourceCode.text.slice(
tokenBefore.range[1],
operatorToken.range[0],
);
const textAfter = sourceCode.text.slice(
operatorToken.range[1],
tokenAfter.range[0],
);
const hasLinebreakBefore = !astUtils.isTokenOnSameLine(
tokenBefore,
operatorToken,
);
const hasLinebreakAfter = !astUtils.isTokenOnSameLine(
operatorToken,
tokenAfter,
);
let newTextBefore, newTextAfter;
if (
hasLinebreakBefore !== hasLinebreakAfter &&
desiredStyle !== "none"
) {
// If there is a comment before and after the operator, don't do a fix.
if (
sourceCode.getTokenBefore(operatorToken, {
includeComments: true,
}) !== tokenBefore &&
sourceCode.getTokenAfter(operatorToken, {
includeComments: true,
}) !== tokenAfter
) {
return null;
}
/*
* If there is only one linebreak and it's on the wrong side of the operator, swap the text before and after the operator.
* foo &&
* bar
* would get fixed to
* foo
* && bar
*/
newTextBefore = textAfter;
newTextAfter = textBefore;
} else {
const LINEBREAK_REGEX =
astUtils.createGlobalLinebreakMatcher();
// Otherwise, if no linebreak is desired and no comments interfere, replace the linebreaks with empty strings.
newTextBefore =
desiredStyle === "before" || textBefore.trim()
? textBefore
: textBefore.replace(LINEBREAK_REGEX, "");
newTextAfter =
desiredStyle === "after" || textAfter.trim()
? textAfter
: textAfter.replace(LINEBREAK_REGEX, "");
// If there was no change (due to interfering comments), don't output a fix.
if (
newTextBefore === textBefore &&
newTextAfter === textAfter
) {
return null;
}
}
if (
newTextAfter === "" &&
tokenAfter.type === "Punctuator" &&
"+-".includes(operatorToken.value) &&
tokenAfter.value === operatorToken.value
) {
// To avoid accidentally creating a ++ or -- operator, insert a space if the operator is a +/- and the following token is a unary +/-.
newTextAfter += " ";
}
return fixer.replaceTextRange(
[tokenBefore.range[1], tokenAfter.range[0]],
newTextBefore + operatorToken.value + newTextAfter,
);
};
}
/**
* Checks the operator placement
* @param {ASTNode} node The node to check
* @param {ASTNode} rightSide The node that comes after the operator in `node`
* @param {string} operator The operator
* @private
* @returns {void}
*/
function validateNode(node, rightSide, operator) {
/*
* Find the operator token by searching from the right side, because between the left side and the operator
* there could be additional tokens from type annotations. Search specifically for the token which
* value equals the operator, in order to skip possible opening parentheses before the right side node.
*/
const operatorToken = sourceCode.getTokenBefore(
rightSide,
token => token.value === operator,
);
const leftToken = sourceCode.getTokenBefore(operatorToken);
const rightToken = sourceCode.getTokenAfter(operatorToken);
const operatorStyleOverride = styleOverrides[operator];
const style = operatorStyleOverride || globalStyle;
const fix = getFixer(operatorToken, style);
// if single line
if (
astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
astUtils.isTokenOnSameLine(operatorToken, rightToken)
) {
// do nothing.
} else if (
operatorStyleOverride !== "ignore" &&
!astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
!astUtils.isTokenOnSameLine(operatorToken, rightToken)
) {
// lone operator
context.report({
node,
loc: operatorToken.loc,
messageId: "badLinebreak",
data: {
operator,
},
fix,
});
} else if (
style === "before" &&
astUtils.isTokenOnSameLine(leftToken, operatorToken)
) {
context.report({
node,
loc: operatorToken.loc,
messageId: "operatorAtBeginning",
data: {
operator,
},
fix,
});
} else if (
style === "after" &&
astUtils.isTokenOnSameLine(operatorToken, rightToken)
) {
context.report({
node,
loc: operatorToken.loc,
messageId: "operatorAtEnd",
data: {
operator,
},
fix,
});
} else if (style === "none") {
context.report({
node,
loc: operatorToken.loc,
messageId: "noLinebreak",
data: {
operator,
},
fix,
});
}
}
/**
* Validates a binary expression using `validateNode`
* @param {BinaryExpression|LogicalExpression|AssignmentExpression} node node to be validated
* @returns {void}
*/
function validateBinaryExpression(node) {
validateNode(node, node.right, node.operator);
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
BinaryExpression: validateBinaryExpression,
LogicalExpression: validateBinaryExpression,
AssignmentExpression: validateBinaryExpression,
VariableDeclarator(node) {
if (node.init) {
validateNode(node, node.init, "=");
}
},
PropertyDefinition(node) {
if (node.value) {
validateNode(node, node.value, "=");
}
},
ConditionalExpression(node) {
validateNode(node, node.consequent, "?");
validateNode(node, node.alternate, ":");
},
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"validateConstructorMetadataArray.js","sourceRoot":"","sources":["../../../../src/metadata/calculations/validateConstructorMetadataArray.ts"],"names":[],"mappings":";;AAMA,4EAmCC;AAvCD,8EAA2E;AAC3E,sFAAmF;AAGnF,SAAgB,gCAAgC,CAC9C,IAAa,EACb,KAA2C;IAE3C,MAAM,gBAAgB,GAAa,EAAE,CAAC;IAEtC,IAAI,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC/B,MAAM,IAAI,uCAAkB,CAC1B,+CAAsB,CAAC,yBAAyB,EAChD,8CAA8C,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,IAAI,mCAAmC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,qBAAqB,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE;;;mHAG/D,CAC9G,CAAC;IACJ,CAAC;IAED,gEAAgE;IAChE,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;QAC9C,MAAM,OAAO,GAAqC,KAAK,CAAC,CAAC,CAAC,CAAC;QAE3D,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IAED,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,uCAAkB,CAC1B,+CAAsB,CAAC,yBAAyB,EAChD,8CAA8C,IAAI,CAAC,IAAI,6BAA6B,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC;;;;mHAIJ,CAC9G,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,iBAAW,CAAC;IAC5C,iBAAiB,CAAC,OAAS,CAAC,2BAAqB,EAAE,KAAK,UAAU,CAAC,+BAAsB,CAAC;IAC1F,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,OAAO,CAAC;IAC9C,cAAc,CAAC,oBAAc,CAAC;IAC9B,kBAAkB,CAAC,OAAS,CAAC,2BAAqB,EAAE,KAAK,UAAU,CAAC,kCAAyB,CAAC;IAC9F,sBAAsB,CAAC,+DAAgD,CAAC;IACxE,UAAU,CAAC,SAAS,CAAC;IACrB,aAAa,CAAC,sBAAgB,CAAC;IAC/B,YAAY,CAAC,6BAAiB,CAAC;AACjC","sources":["packages/@react-aria/table/intl/ro-RO.json"],"sourcesContent":["{\n \"ascending\": \"crescătoare\",\n \"ascendingSort\": \"sortate după coloana {columnName} în ordine crescătoare\",\n \"columnSize\": \"{value} pixeli\",\n \"descending\": \"descrescătoare\",\n \"descendingSort\": \"sortate după coloana {columnName} în ordine descrescătoare\",\n \"resizerDescription\": \"Apăsați pe Enter pentru a începe redimensionarea\",\n \"select\": \"Selectare\",\n \"selectAll\": \"Selectare totală\",\n \"sortable\": \"coloană sortabilă\"\n}\n"],"names":[],"version":3,"file":"ro-RO.main.js.map"}
@@ -0,0 +1 @@
{"version":3,"file":"stringifyBinding.d.ts","sourceRoot":"","sources":["../../../../src/binding/calculations/stringifyBinding.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CASzD"}
@@ -0,0 +1,16 @@
export { createTailwindMerge } from './lib/create-tailwind-merge'
export { getDefaultConfig } from './lib/default-config'
export { extendTailwindMerge } from './lib/extend-tailwind-merge'
export { fromTheme } from './lib/from-theme'
export { mergeConfigs } from './lib/merge-configs'
export { twJoin, type ClassNameValue } from './lib/tw-join'
export { twMerge } from './lib/tw-merge'
export {
type ClassValidator,
type Config,
type DefaultClassGroupIds,
type DefaultThemeGroupIds,
type ExperimentalParseClassNameParam,
type ExperimentalParsedClassName,
} from './lib/types'
export * as validators from './lib/validators'
@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var switchRole = {
abstract: false,
accessibleNameRequired: true,
baseConcepts: [],
childrenPresentational: true,
nameFrom: ['author', 'contents'],
prohibitedProps: [],
props: {},
relatedConcepts: [{
concept: {
name: 'button'
},
module: 'ARIA'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {
'aria-checked': null
},
superClass: [['roletype', 'widget', 'input', 'checkbox']]
};
var _default = exports.default = switchRole;
@@ -0,0 +1 @@
{"version":3,"file":"parse-args.d.ts","sourceRoot":"","sources":["../../src/parse-args.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAoC5B,eAAO,MAAM,SAAS,uBAA6C,CAAA"}
@@ -0,0 +1,3 @@
declare const _exports: import('eslint').Rule.RuleModule;
export = _exports;
//# sourceMappingURL=no-unescaped-entities.d.ts.map
@@ -0,0 +1 @@
export { _ as default } from "../esm/_class_private_method_init.js";
@@ -0,0 +1,48 @@
{
"name": "color-convert",
"description": "Plain color conversion functions",
"version": "2.0.1",
"author": "Heather Arthur <fayearthur@gmail.com>",
"license": "MIT",
"repository": "Qix-/color-convert",
"scripts": {
"pretest": "xo",
"test": "node test/basic.js"
},
"engines": {
"node": ">=7.0.0"
},
"keywords": [
"color",
"colour",
"convert",
"converter",
"conversion",
"rgb",
"hsl",
"hsv",
"hwb",
"cmyk",
"ansi",
"ansi16"
],
"files": [
"index.js",
"conversions.js",
"route.js"
],
"xo": {
"rules": {
"default-case": 0,
"no-inline-comments": 0,
"operator-linebreak": 0
}
},
"devDependencies": {
"chalk": "^2.4.2",
"xo": "^0.24.0"
},
"dependencies": {
"color-name": "~1.1.4"
}
}
@@ -0,0 +1,20 @@
"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("./eslint-utils"), exports);
__exportStar(require("./helpers"), exports);
__exportStar(require("./misc"), exports);
__exportStar(require("./predicates"), exports);
@@ -0,0 +1 @@
{"version":3,"file":"updateMaybeClassMetadataPreDestroy.d.ts","sourceRoot":"","sources":["../../../../src/metadata/actions/updateMaybeClassMetadataPreDestroy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,wBAAgB,kCAAkC,CAChD,UAAU,EAAE,MAAM,GAAG,MAAM,GAC1B,CAAC,QAAQ,EAAE,kBAAkB,KAAK,kBAAkB,CAatD"}
@@ -0,0 +1,162 @@
export declare const OidbSvcTrpcTcp0x6D6: {
file: import("napcat-protobuf").MessageProtoFieldType<() => {
groupUin: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
appId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
busId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
entrance: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
targetDirectory: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
fileName: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
localDirectory: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
fileSize: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT64, false, false>;
fileSha1: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
fileSha3: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
fileMd5: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
field15: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BOOL, false, false>;
}, true, false>;
download: import("napcat-protobuf").MessageProtoFieldType<() => {
groupUin: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
appId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
busId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
fileId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
}, true, false>;
delete: import("napcat-protobuf").MessageProtoFieldType<() => {
groupUin: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
busId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
fileId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
}, true, false>;
rename: import("napcat-protobuf").MessageProtoFieldType<() => {
groupUin: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
busId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
fileId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
parentFolder: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
newFileName: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
}, true, false>;
move: import("napcat-protobuf").MessageProtoFieldType<() => {
groupUin: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
appId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
busId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
fileId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
parentDirectory: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
targetDirectory: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
}, true, false>;
};
export declare const OidbSvcTrpcTcp0x6D6Upload: {
groupUin: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
appId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
busId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
entrance: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
targetDirectory: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
fileName: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
localDirectory: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
fileSize: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT64, false, false>;
fileSha1: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
fileSha3: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
fileMd5: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
field15: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BOOL, false, false>;
};
export declare const OidbSvcTrpcTcp0x6D6Download: {
groupUin: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
appId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
busId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
fileId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
};
export declare const OidbSvcTrpcTcp0x6D6Delete: {
groupUin: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
busId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
fileId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
};
export declare const OidbSvcTrpcTcp0x6D6Rename: {
groupUin: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
busId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
fileId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
parentFolder: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
newFileName: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
};
export declare const OidbSvcTrpcTcp0x6D6Move: {
groupUin: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
appId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
busId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
fileId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
parentDirectory: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
targetDirectory: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
};
export declare const OidbSvcTrpcTcp0x6D6Response: {
upload: import("napcat-protobuf").MessageProtoFieldType<() => {
retCode: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
retMsg: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
clientWording: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
uploadIp: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
serverDns: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
busId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
fileId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
checkKey: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
fileKey: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
boolFileExist: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BOOL, false, false>;
uploadIpLanV4: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, true>;
uploadIpLanV6: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, true>;
uploadPort: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
}, false, false>;
download: import("napcat-protobuf").MessageProtoFieldType<() => {
retCode: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
retMsg: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
clientWording: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
downloadIp: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
downloadDns: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
downloadUrl: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
fileSha1: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
fileSha3: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
fileMd5: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
cookieVal: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
saveFileName: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
previewPort: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
}, false, false>;
delete: import("napcat-protobuf").MessageProtoFieldType<() => {
retCode: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
retMsg: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
clientWording: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
}, false, false>;
rename: import("napcat-protobuf").MessageProtoFieldType<() => {
retCode: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
retMsg: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
clientWording: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
}, false, false>;
move: import("napcat-protobuf").MessageProtoFieldType<() => {
retCode: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
retMsg: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
clientWording: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
}, false, false>;
};
export declare const OidbSvcTrpcTcp0x6D6_0Response: {
retCode: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
retMsg: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
clientWording: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
uploadIp: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
serverDns: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
busId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
fileId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
checkKey: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
fileKey: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
boolFileExist: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BOOL, false, false>;
uploadIpLanV4: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, true>;
uploadIpLanV6: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, true>;
uploadPort: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
};
export declare const OidbSvcTrpcTcp0x6D6_2Response: {
retCode: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
retMsg: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
clientWording: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
downloadIp: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
downloadDns: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
downloadUrl: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
fileSha1: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
fileSha3: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
fileMd5: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
cookieVal: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BYTES, false, false>;
saveFileName: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
previewPort: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
};
export declare const OidbSvcTrpcTcp0x6D6_3_4_5Response: {
retCode: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
retMsg: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
clientWording: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
};
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_class_private_field_loose_base.cjs",
"module": "../../esm/_class_private_field_loose_base.js"
}
@@ -0,0 +1 @@
{"version":3,"file":"DecoratorInfo.d.ts","sourceRoot":"","sources":["../../../../src/decorator/models/DecoratorInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,MAAM,aAAa,GACrB,mBAAmB,GACnB,sBAAsB,GACtB,qBAAqB,CAAC"}
@@ -0,0 +1,246 @@
![decimal.js](https://raw.githubusercontent.com/MikeMcl/decimal.js/gh-pages/decimaljs.png)
An arbitrary-precision Decimal type for JavaScript.
[![npm version](https://img.shields.io/npm/v/decimal.js.svg)](https://www.npmjs.com/package/decimal.js)
[![npm downloads](https://img.shields.io/npm/dw/decimal.js)](https://www.npmjs.com/package/decimal.js)
[![CDNJS](https://img.shields.io/cdnjs/v/decimal.js.svg)](https://cdnjs.com/libraries/decimal.js)
[![](https://data.jsdelivr.com/v1/package/npm/decimal.js/badge)](https://www.jsdelivr.com/package/npm/decimal.js)
<br>
## Features
- Integers and floats
- Simple but full-featured API
- Replicates many of the methods of JavaScript's `Number.prototype` and `Math` objects
- Also handles hexadecimal, binary and octal values
- Faster, smaller, and perhaps easier to use than JavaScript versions of Java's BigDecimal
- No dependencies
- Wide platform compatibility: uses JavaScript 1.5 (ECMAScript 3) features only
- Comprehensive [documentation](https://mikemcl.github.io/decimal.js/) and test set
- Used under the hood by [math.js](https://github.com/josdejong/mathjs)
- Includes a TypeScript declaration file: *decimal.d.ts*
![API](https://raw.githubusercontent.com/MikeMcl/decimal.js/gh-pages/API.png)
The library is similar to [bignumber.js](https://github.com/MikeMcl/bignumber.js/), but here
precision is specified in terms of significant digits rather than decimal places, and all
calculations are rounded to the precision (similar to Python's decimal module) rather than just
those involving division.
This library also adds the trigonometric functions, among others, and supports non-integer powers,
which makes it a significantly larger library than *bignumber.js* and the even smaller
[big.js](https://github.com/MikeMcl/big.js/).
For a lighter version of this library without the trigonometric functions see
[decimal.js-light](https://github.com/MikeMcl/decimal.js-light/).
## Load
The library is the single JavaScript file *decimal.js* or ES module *decimal.mjs*.
Browser:
```html
<script src='path/to/decimal.js'></script>
<script type="module">
import Decimal from './path/to/decimal.mjs';
...
</script>
```
[Node.js](https://nodejs.org):
```bash
npm install decimal.js
```
```js
const Decimal = require('decimal.js');
import Decimal from 'decimal.js';
import {Decimal} from 'decimal.js';
```
## Use
*In all examples below, semicolons and `toString` calls are not shown.
If a commented-out value is in quotes it means `toString` has been called on the preceding expression.*
The library exports a single constructor function, `Decimal`, which expects a single argument that is a number, string or Decimal instance.
```js
x = new Decimal(123.4567)
y = new Decimal('123456.7e-3')
z = new Decimal(x)
x.equals(y) && y.equals(z) && x.equals(z) // true
```
If using values with more than a few digits, it is recommended to pass strings rather than numbers to avoid a potential loss of precision.
```js
// Precision loss from using numeric literals with more than 15 significant digits.
new Decimal(1.0000000000000001) // '1'
new Decimal(88259496234518.57) // '88259496234518.56'
new Decimal(99999999999999999999) // '100000000000000000000'
// Precision loss from using numeric literals outside the range of Number values.
new Decimal(2e+308) // 'Infinity'
new Decimal(1e-324) // '0'
// Precision loss from the unexpected result of arithmetic with Number values.
new Decimal(0.7 + 0.1) // '0.7999999999999999'
```
As with JavaScript numbers, strings can contain underscores as separators to improve readability.
```js
x = new Decimal('2_147_483_647')
```
String values in binary, hexadecimal or octal notation are also accepted if the appropriate prefix is included.
```js
x = new Decimal('0xff.f') // '255.9375'
y = new Decimal('0b10101100') // '172'
z = x.plus(y) // '427.9375'
z.toBinary() // '0b110101011.1111'
z.toBinary(13) // '0b1.101010111111p+8'
// Using binary exponential notation to create a Decimal with the value of `Number.MAX_VALUE`.
x = new Decimal('0b1.1111111111111111111111111111111111111111111111111111p+1023')
// '1.7976931348623157081e+308'
```
Decimal instances are immutable in the sense that they are not changed by their methods.
```js
0.3 - 0.1 // 0.19999999999999998
x = new Decimal(0.3)
x.minus(0.1) // '0.2'
x // '0.3'
```
The methods that return a Decimal can be chained.
```js
x.dividedBy(y).plus(z).times(9).floor()
x.times('1.23456780123456789e+9').plus(9876.5432321).dividedBy('4444562598.111772').ceil()
```
Many method names have a shorter alias.
```js
x.squareRoot().dividedBy(y).toPower(3).equals(x.sqrt().div(y).pow(3)) // true
x.comparedTo(y.modulo(z).negated() === x.cmp(y.mod(z).neg()) // true
```
Most of the methods of JavaScript's `Number.prototype` and `Math` objects are replicated.
```js
x = new Decimal(255.5)
x.toExponential(5) // '2.55500e+2'
x.toFixed(5) // '255.50000'
x.toPrecision(5) // '255.50'
Decimal.sqrt('6.98372465832e+9823') // '8.3568682281821340204e+4911'
Decimal.pow(2, 0.0979843) // '1.0702770511687781839'
// Using `toFixed()` to avoid exponential notation:
x = new Decimal('0.0000001')
x.toString() // '1e-7'
x.toFixed() // '0.0000001'
```
And there are `isNaN` and `isFinite` methods, as `NaN` and `Infinity` are valid `Decimal` values.
```js
x = new Decimal(NaN) // 'NaN'
y = new Decimal(Infinity) // 'Infinity'
x.isNaN() && !y.isNaN() && !x.isFinite() && !y.isFinite() // true
```
There is also a `toFraction` method with an optional *maximum denominator* argument.
```js
z = new Decimal(355)
pi = z.dividedBy(113) // '3.1415929204'
pi.toFraction() // [ '7853982301', '2500000000' ]
pi.toFraction(1000) // [ '355', '113' ]
```
All calculations are rounded according to the number of significant digits and rounding mode specified
by the `precision` and `rounding` properties of the Decimal constructor.
For advanced usage, multiple Decimal constructors can be created, each with their own independent
configuration which applies to all Decimal numbers created from it.
```js
// Set the precision and rounding of the default Decimal constructor
Decimal.set({ precision: 5, rounding: 4 })
// Create another Decimal constructor, optionally passing in a configuration object
Dec = Decimal.clone({ precision: 9, rounding: 1 })
x = new Decimal(5)
y = new Dec(5)
x.div(3) // '1.6667'
y.div(3) // '1.66666666'
```
The value of a Decimal is stored in a floating point format in terms of its digits, exponent and sign, but these properties should be considered read-only.
```js
x = new Decimal(-12345.67);
x.d // [ 12345, 6700000 ] digits (base 10000000)
x.e // 4 exponent (base 10)
x.s // -1 sign
```
For further information see the [API](http://mikemcl.github.io/decimal.js/) reference in the *doc* directory.
## Test
To run the tests using Node.js from the root directory:
```bash
npm test
```
Each separate test module can also be executed individually, for example:
```bash
node test/modules/toFraction
```
To run the tests in a browser, open *test/test.html*.
## Minify
Two minification examples:
Using [uglify-js](https://github.com/mishoo/UglifyJS) to minify the *decimal.js* file:
```bash
npm install uglify-js -g
uglifyjs decimal.js --source-map url=decimal.min.js.map -c -m -o decimal.min.js
```
Using [terser](https://github.com/terser/terser) to minify the ES module version, *decimal.mjs*:
```bash
npm install terser -g
terser decimal.mjs --source-map url=decimal.min.mjs.map -c -m --toplevel -o decimal.min.mjs
```
```js
import Decimal from './decimal.min.mjs';
```
## Licence
[The MIT Licence](LICENCE.md)
@@ -0,0 +1,203 @@
import { ClassGroup, ClassGroupId, ClassValidator, Config, ThemeGetter, ThemeObject } from './types'
export interface ClassPartObject {
nextPart: Map<string, ClassPartObject>
validators: ClassValidatorObject[]
classGroupId?: ClassGroupId
}
interface ClassValidatorObject {
classGroupId: ClassGroupId
validator: ClassValidator
}
const CLASS_PART_SEPARATOR = '-'
export function createClassUtils(config: Config) {
const classMap = createClassMap(config)
const { conflictingClassGroups, conflictingClassGroupModifiers = {} } = config
function getClassGroupId(className: string) {
const classParts = className.split(CLASS_PART_SEPARATOR)
// Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and remove it from classParts.
if (classParts[0] === '' && classParts.length !== 1) {
classParts.shift()
}
return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className)
}
function getConflictingClassGroupIds(classGroupId: ClassGroupId, hasPostfixModifier: boolean) {
const conflicts = conflictingClassGroups[classGroupId] || []
if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]!]
}
return conflicts
}
return {
getClassGroupId,
getConflictingClassGroupIds,
}
}
function getGroupRecursive(
classParts: string[],
classPartObject: ClassPartObject,
): ClassGroupId | undefined {
if (classParts.length === 0) {
return classPartObject.classGroupId
}
const currentClassPart = classParts[0]!
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart)
const classGroupFromNextClassPart = nextClassPartObject
? getGroupRecursive(classParts.slice(1), nextClassPartObject)
: undefined
if (classGroupFromNextClassPart) {
return classGroupFromNextClassPart
}
if (classPartObject.validators.length === 0) {
return undefined
}
const classRest = classParts.join(CLASS_PART_SEPARATOR)
return classPartObject.validators.find(({ validator }) => validator(classRest))?.classGroupId
}
const arbitraryPropertyRegex = /^\[(.+)\]$/
function getGroupIdForArbitraryProperty(className: string) {
if (arbitraryPropertyRegex.test(className)) {
const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)![1]
const property = arbitraryPropertyClassName?.substring(
0,
arbitraryPropertyClassName.indexOf(':'),
)
if (property) {
// I use two dots here because one dot is used as prefix for class groups in plugins
return 'arbitrary..' + property
}
}
}
/**
* Exported for testing only
*/
export function createClassMap(config: Config) {
const { theme, prefix } = config
const classMap: ClassPartObject = {
nextPart: new Map<string, ClassPartObject>(),
validators: [],
}
const prefixedClassGroupEntries = getPrefixedClassGroupEntries(
Object.entries(config.classGroups),
prefix,
)
prefixedClassGroupEntries.forEach(([classGroupId, classGroup]) => {
processClassesRecursively(classGroup, classMap, classGroupId, theme)
})
return classMap
}
function processClassesRecursively(
classGroup: ClassGroup,
classPartObject: ClassPartObject,
classGroupId: ClassGroupId,
theme: ThemeObject,
) {
classGroup.forEach((classDefinition) => {
if (typeof classDefinition === 'string') {
const classPartObjectToEdit =
classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition)
classPartObjectToEdit.classGroupId = classGroupId
return
}
if (typeof classDefinition === 'function') {
if (isThemeGetter(classDefinition)) {
processClassesRecursively(
classDefinition(theme),
classPartObject,
classGroupId,
theme,
)
return
}
classPartObject.validators.push({
validator: classDefinition,
classGroupId,
})
return
}
Object.entries(classDefinition).forEach(([key, classGroup]) => {
processClassesRecursively(
classGroup,
getPart(classPartObject, key),
classGroupId,
theme,
)
})
})
}
function getPart(classPartObject: ClassPartObject, path: string) {
let currentClassPartObject = classPartObject
path.split(CLASS_PART_SEPARATOR).forEach((pathPart) => {
if (!currentClassPartObject.nextPart.has(pathPart)) {
currentClassPartObject.nextPart.set(pathPart, {
nextPart: new Map(),
validators: [],
})
}
currentClassPartObject = currentClassPartObject.nextPart.get(pathPart)!
})
return currentClassPartObject
}
function isThemeGetter(func: ClassValidator | ThemeGetter): func is ThemeGetter {
return (func as ThemeGetter).isThemeGetter
}
function getPrefixedClassGroupEntries(
classGroupEntries: Array<[classGroupId: string, classGroup: ClassGroup]>,
prefix: string | undefined,
): Array<[classGroupId: string, classGroup: ClassGroup]> {
if (!prefix) {
return classGroupEntries
}
return classGroupEntries.map(([classGroupId, classGroup]) => {
const prefixedClassGroup = classGroup.map((classDefinition) => {
if (typeof classDefinition === 'string') {
return prefix + classDefinition
}
if (typeof classDefinition === 'object') {
return Object.fromEntries(
Object.entries(classDefinition).map(([key, value]) => [prefix + key, value]),
)
}
return classDefinition
})
return [classGroupId, prefixedClassGroup]
})
}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=optional.int.spec.d.ts.map
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var FormRole = {
relatedConcepts: [{
module: 'ARIA',
concept: {
name: 'form'
}
}, {
module: 'HTML',
concept: {
name: 'form'
}
}],
type: 'structure'
};
var _default = FormRole;
exports.default = _default;
@@ -0,0 +1,27 @@
{
"name": "console-control-strings",
"version": "1.1.0",
"description": "A library of cross-platform tested terminal/console command strings for doing things like color and cursor positioning. This is a subset of both ansi and vt100. All control codes included work on both Windows & Unix-like OSes, except where noted.",
"main": "index.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "standard && tap test/*.js"
},
"repository": {
"type": "git",
"url": "https://github.com/iarna/console-control-strings"
},
"keywords": [],
"author": "Rebecca Turner <me@re-becca.org> (http://re-becca.org/)",
"license": "ISC",
"files": [
"LICENSE",
"index.js"
],
"devDependencies": {
"standard": "^7.1.2",
"tap": "^5.7.2"
}
}
@@ -0,0 +1,13 @@
'use strict'
let Node = require('./node')
class Comment extends Node {
constructor(defaults) {
super(defaults)
this.type = 'comment'
}
}
module.exports = Comment
Comment.default = Comment
@@ -0,0 +1,101 @@
/**
* A value which is wrapped with a CBOR Tag.
* Several tags are registered with defined meanings like 0 for a date string.
* These meanings are **not interpreted** when decoded or encoded.
*
* This class is an immutable record.
* If the tag number or value needs to change, then construct a new tag
*/
export declare class CBORTag {
private tagId;
private tagValue;
/**
* Wrap a value with a tag number.
* When encoded, this tag will be attached to the value.
*
* @param tag Tag number
* @param value Wrapped value
*/
constructor(tag: number, value: CBORType);
/**
* Read the tag number
*/
get tag(): number;
/**
* Read the value
*/
get value(): CBORType;
}
/**
* Supported types which are encodable and decodable with tiny CBOR.
* Note that plain javascript objects are omitted.
*/
export type CBORType = number | bigint | string | Uint8Array | boolean | null | undefined | CBORType[] | CBORTag | Map<string | number, CBORType>;
/**
* Like {decodeCBOR}, but the length of the data is unknown and there is likely
* more -- possibly unrelated non-CBOR -- data afterwards.
*
* Examples:
*
* ```ts
* import {decodePartialCBOR} from './cbor.ts'
* decodePartialCBOR(new Uint8Array([1, 2, 245, 3, 4]), 2)
* // returns [true, 1]
* // It did not decode the leading [1, 2] or trailing [3, 4]
* ```
*
* @param data a data stream to read data from
* @param index where to start reading in the data stream
* @returns a tuple of the value followed by bytes read.
* @throws {Error}
* When the data stream ends early or the CBOR data is not well formed
*/
export declare function decodePartialCBOR(data: DataView | Uint8Array | ArrayBuffer, index: number): [CBORType, number];
/**
* Decode CBOR data from a binary stream
*
* The entire data stream from [0, length) will be consumed.
* If you require a partial decoding, see {decodePartialCBOR}.
*
* Examples:
*
* ```ts
* import {decodeCBOR, CBORTag, CBORType} from './cbor.ts'
* decodeCBOR(new Uint8Array([162, 99, 107, 101, 121, 101, 118, 97, 108, 117, 101, 1, 109, 97, 110, 111, 116, 104, 101, 114, 32, 118, 97, 108, 117, 101]));
* // returns new Map<string | number, CBORType>([
* // ["key", "value"],
* // [1, "another value"]
* // ]);
*
* const taggedItem = new Uint8Array([217, 4, 210, 101, 104, 101, 108, 108, 111]);
* decodeCBOR(new DataView(taggedItem.buffer))
* // returns new CBORTag(1234, "hello")
* ```
*
* @param data a data stream, multiple types are supported
* @returns
*/
export declare function decodeCBOR(data: DataView | Uint8Array | ArrayBuffer): CBORType;
/**
* Encode a supported structure to a CBOR byte string.
*
* Example:
*
* ```ts
* import {encodeCBOR, CBORType, CBORTag} from './cbor.ts'
* encodeCBOR(new Map<string | number, CBORType>([
* ["key", "value"],
* [1, "another value"]
* ]));
* // returns new Uint8Array([162, 99, 107, 101, 121, 101, 118, 97, 108, 117, 101, 1, 109, 97, 110, 111, 116, 104, 101, 114, 32 118, 97, 108, 117, 101])
*
* encodeCBOR(new CBORTag(1234, "hello"))
* // returns new UInt8Array([217, 4, 210, 101, 104, 101, 108, 108, 111])
* ```
*
* @param data Data to encode
* @returns A byte string as a Uint8Array
* @throws Error
* if unsupported data is found during encoding
*/
export declare function encodeCBOR(data: CBORType): Uint8Array;
@@ -0,0 +1,19 @@
module.exports = {
// These settings are duplicated in .editorconfig:
tabWidth: 2, // indent_size = 2
useTabs: false, // indent_style = space
endOfLine: 'lf', // end_of_line = lf
semi: false, // default: true
singleQuote: true, // default: false
printWidth: 100, // default: 80
trailingComma: 'es5',
bracketSpacing: true,
overrides: [
{
files: '*.js',
options: {
parser: 'flow',
},
},
],
}
@@ -0,0 +1,16 @@
import { IBackOffOptions } from "../options";
import { fullJitter } from "./full/full.jitter";
import { noJitter } from "./no/no.jitter";
export type Jitter = (delay: number) => number;
export function JitterFactory(options: IBackOffOptions): Jitter {
switch (options.jitter) {
case "full":
return fullJitter;
case "none":
default:
return noJitter;
}
}
@@ -0,0 +1,9 @@
import type { AsyncFunction } from 'async-function';
declare namespace isAsyncFunction {
export type { AsyncFunction };
}
declare function isAsyncFunction(fn: unknown): fn is AsyncFunction;
export = isAsyncFunction;
@@ -0,0 +1 @@
{"name":"@jridgewell/gen-mapping","version":"0.3.13","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532105194,"integrity":"sha512-saakd7FVlV7sB0lJxPAaywkJ8R69jC/1QO2e2TcVLl8ZDaccoi9woo8schL6tVJhKyT8pyy4mSRgiae248P97g==","mode":420,"size":1080},"types/gen-mapping.d.cts":{"checkedAt":1794532105194,"integrity":"sha512-j/VPNzCQQ61S1VsLHWHQgeQFTB0OjRhlgrDS3wGu0/tkz0gfhieB1p5iQngTGXygh7unS1nU9EOsOcVMyQwtxA==","mode":420,"size":3871},"types/set-array.d.cts":{"checkedAt":1794532105194,"integrity":"sha512-AVx8BsMcVWgC2tvw4KTGGb/t882VX93hYSdC9tHBElUeEcJaScQMnxx8E7Eft3UsRR1fUj4By6PuVWoE1HCCkw==","mode":420,"size":1256},"types/sourcemap-segment.d.cts":{"checkedAt":1794532105194,"integrity":"sha512-cS+Fl6F6FyCTG5kc7IHMmBbL5TWb2i6d1jc0fVcKjSyhkrx+67Aem4R0HUqqL35Fur0wAn1NccKQXVRih/nw/Q==","mode":420,"size":568},"types/types.d.cts":{"checkedAt":1794532105194,"integrity":"sha512-+hjcaFSqUFW5ND5cX9yO3U6IgHtbayKqialmrNkyay6eF7yZJL8JEXwpSz8BO+hB9rVCUaNRDOqD2lS3BALYzw==","mode":420,"size":1036},"dist/gen-mapping.umd.js":{"checkedAt":1794532105195,"integrity":"sha512-tdLo99Lc3TvizqY2JFY+lQZYdIR+jC9mGacszqVS21Zs3zyfOUOcm225OXv5F77YlqFGmk42jUYDDMjAu3INnQ==","mode":420,"size":11170},"package.json":{"checkedAt":1794532105195,"integrity":"sha512-yU58IvuS7Vi7NvWLEs3MvNzfcmXMl9cG+3NqKitNP7WEjZht1+P0yHjxesN9fRuyU2bU8TwutT8G2EkB6sirDA==","mode":420,"size":2201},"types/gen-mapping.d.cts.map":{"checkedAt":1794532105195,"integrity":"sha512-7KXXyxvOLqfdOpzjReDrPcs9n5ZvqJ3eX+Yv1QySfcZDa+3DX+6CrhIn2jMlHHBewmEMYcYoZxhTvXEyFwD7Dw==","mode":420,"size":2603},"types/gen-mapping.d.mts.map":{"checkedAt":1794532105195,"integrity":"sha512-7KXXyxvOLqfdOpzjReDrPcs9n5ZvqJ3eX+Yv1QySfcZDa+3DX+6CrhIn2jMlHHBewmEMYcYoZxhTvXEyFwD7Dw==","mode":420,"size":2603},"dist/gen-mapping.mjs.map":{"checkedAt":1794532105195,"integrity":"sha512-R3H6JKojOnASKza2SseJo/E8aLfSQMIQDzfN+KB+luUy7QYky0NYJL/zT23Iiv8KQKIHHLgo6oO1ZwWZxXwj6w==","mode":420,"size":5917},"dist/gen-mapping.umd.js.map":{"checkedAt":1794532105195,"integrity":"sha512-S9qpBiBp9kRm5M4uLufNyZjnkBLZZCrh4l8lctVsRRrSxo2/4fGtxxClXshpFRbcksfvXyv2/oITonbEmzabBw==","mode":420,"size":6222},"types/set-array.d.cts.map":{"checkedAt":1794532105195,"integrity":"sha512-9p8CMVCkeOsdVyUe4KBTRoDwc1rwmUu7mlfuODP9J2/WqT1zqImqJod6xjCAedEDvjKtxsnuxWE/wE8s7Z8RIw==","mode":420,"size":757},"types/set-array.d.mts.map":{"checkedAt":1794532105195,"integrity":"sha512-9p8CMVCkeOsdVyUe4KBTRoDwc1rwmUu7mlfuODP9J2/WqT1zqImqJod6xjCAedEDvjKtxsnuxWE/wE8s7Z8RIw==","mode":420,"size":757},"types/sourcemap-segment.d.cts.map":{"checkedAt":1794532105195,"integrity":"sha512-UQEBSlFrBX2mCmEm06EcW1PBoXBr8qc9Oo2a6baHvdJ/xnhR95TpSgewJ5LeghYtPoMfXFhzpf9Gnxi0GNYX9A==","mode":420,"size":597},"types/sourcemap-segment.d.mts.map":{"checkedAt":1794532105195,"integrity":"sha512-UQEBSlFrBX2mCmEm06EcW1PBoXBr8qc9Oo2a6baHvdJ/xnhR95TpSgewJ5LeghYtPoMfXFhzpf9Gnxi0GNYX9A==","mode":420,"size":597},"types/types.d.cts.map":{"checkedAt":1794532105195,"integrity":"sha512-TFCeZxdcZ1RvdhGMYcc8GwJeGURf+Adsenx7IZMp1HuEgcQazkBMxOQrNIgB5yXpz9iu+Dfo/eQ2YBIP1QI+SA==","mode":420,"size":1192},"types/types.d.mts.map":{"checkedAt":1794532105195,"integrity":"sha512-TFCeZxdcZ1RvdhGMYcc8GwJeGURf+Adsenx7IZMp1HuEgcQazkBMxOQrNIgB5yXpz9iu+Dfo/eQ2YBIP1QI+SA==","mode":420,"size":1192},"README.md":{"checkedAt":1794532105196,"integrity":"sha512-p4xp2sQx/4LNm4rNNHPnaTB/+RqGsRFCSILPPEOrMiZ6Bdst36Zf6ROmf8aFFddUwBWTecaqNvFzddZ+G1JVSg==","mode":420,"size":7506},"dist/gen-mapping.mjs":{"checkedAt":1794532105196,"integrity":"sha512-TW6sBjTFxTc200ctcrw0OM7grBAPFUb0/HavsCss33KgjP8ugRiyHceG9gpFehbUhtZRMRseobbg5TGuIUU6kQ==","mode":420,"size":7969},"types/gen-mapping.d.mts":{"checkedAt":1794532105196,"integrity":"sha512-IOh8Ci4XeAU8bGB1bwEje3DiahwxlMSbigt9fudacZrbMX0BoSkp0V5mewC7d74FA6oAD/fXQampp262mr4sjA==","mode":420,"size":3871},"types/set-array.d.mts":{"checkedAt":1794532105194,"integrity":"sha512-AVx8BsMcVWgC2tvw4KTGGb/t882VX93hYSdC9tHBElUeEcJaScQMnxx8E7Eft3UsRR1fUj4By6PuVWoE1HCCkw==","mode":420,"size":1256},"types/sourcemap-segment.d.mts":{"checkedAt":1794532105194,"integrity":"sha512-cS+Fl6F6FyCTG5kc7IHMmBbL5TWb2i6d1jc0fVcKjSyhkrx+67Aem4R0HUqqL35Fur0wAn1NccKQXVRih/nw/Q==","mode":420,"size":568},"types/types.d.mts":{"checkedAt":1794532105196,"integrity":"sha512-GdmCm8Nk+CcAKZryMrGaBpG7AsaC3kTAWwm32xQcUmS5mMAcpeGIXDTepsQaPf/PWbV5tH3NDDuNE11p6trnsg==","mode":420,"size":1036},"dist/types/gen-mapping.d.ts":{"checkedAt":1794532105196,"integrity":"sha512-MQhsPG6migZdw9P7/SeYxs7ceCqHY/kLg0YQseWEIMju+vCHC5pgwrRRoeM+Buh1UTv2YTFwuRvLeS8fyeFA5Q==","mode":420,"size":3826},"src/gen-mapping.ts":{"checkedAt":1794532105196,"integrity":"sha512-KCzb37uqMXK4dffY7scWf5IABPmJaql4qUJDBfabFpo50kkBQShbCxyE+AEUqvhEOR23jIzjIwmASGrMRoEj1g==","mode":420,"size":17131},"dist/types/set-array.d.ts":{"checkedAt":1794532105197,"integrity":"sha512-VV1iX+FKObAo/K7Cox6pLE6UR6fsFawTNtv2ZWeVb3V0WqtdZ8s87WN+z5Ne4N0hEzry1CLGP24jgpYgoU5KzQ==","mode":420,"size":1217},"src/set-array.ts":{"checkedAt":1794532105197,"integrity":"sha512-erNwKLine truncated
@@ -0,0 +1,288 @@
// Copyright 2013 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// 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 CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Library for preprocessing fonts as part of the WOFF 2.0 conversion.
#include "./transform.h"
#include <complex> // for std::abs
#include "./buffer.h"
#include "./font.h"
#include "./glyph.h"
#include "./table_tags.h"
#include "./variable_length.h"
namespace woff2 {
namespace {
const int FLAG_ARG_1_AND_2_ARE_WORDS = 1 << 0;
const int FLAG_WE_HAVE_INSTRUCTIONS = 1 << 8;
void WriteBytes(std::vector<uint8_t>* out, const uint8_t* data, size_t len) {
if (len == 0) return;
size_t offset = out->size();
out->resize(offset + len);
memcpy(&(*out)[offset], data, len);
}
void WriteBytes(std::vector<uint8_t>* out, const std::vector<uint8_t>& in) {
for (int i = 0; i < in.size(); ++i) {
out->push_back(in[i]);
}
}
void WriteUShort(std::vector<uint8_t>* out, int value) {
out->push_back(value >> 8);
out->push_back(value & 255);
}
void WriteLong(std::vector<uint8_t>* out, int value) {
out->push_back((value >> 24) & 255);
out->push_back((value >> 16) & 255);
out->push_back((value >> 8) & 255);
out->push_back(value & 255);
}
// Glyf table preprocessing, based on
// GlyfEncoder.java
class GlyfEncoder {
public:
explicit GlyfEncoder(int num_glyphs)
: n_glyphs_(num_glyphs) {
bbox_bitmap_.resize(((num_glyphs + 31) >> 5) << 2);
}
bool Encode(int glyph_id, const Glyph& glyph) {
if (glyph.composite_data_size > 0) {
WriteCompositeGlyph(glyph_id, glyph);
} else if (glyph.contours.size() > 0) {
WriteSimpleGlyph(glyph_id, glyph);
} else {
WriteUShort(&n_contour_stream_, 0);
}
return true;
}
void GetTransformedGlyfBytes(std::vector<uint8_t>* result) {
WriteLong(result, 0); // version
WriteUShort(result, n_glyphs_);
WriteUShort(result, 0); // index_format, will be set later
WriteLong(result, n_contour_stream_.size());
WriteLong(result, n_points_stream_.size());
WriteLong(result, flag_byte_stream_.size());
WriteLong(result, glyph_stream_.size());
WriteLong(result, composite_stream_.size());
WriteLong(result, bbox_bitmap_.size() + bbox_stream_.size());
WriteLong(result, instruction_stream_.size());
WriteBytes(result, n_contour_stream_);
WriteBytes(result, n_points_stream_);
WriteBytes(result, flag_byte_stream_);
WriteBytes(result, glyph_stream_);
WriteBytes(result, composite_stream_);
WriteBytes(result, bbox_bitmap_);
WriteBytes(result, bbox_stream_);
WriteBytes(result, instruction_stream_);
}
private:
void WriteInstructions(const Glyph& glyph) {
Write255UShort(&glyph_stream_, glyph.instructions_size);
WriteBytes(&instruction_stream_,
glyph.instructions_data, glyph.instructions_size);
}
bool ShouldWriteSimpleGlyphBbox(const Glyph& glyph) {
if (glyph.contours.empty() || glyph.contours[0].empty()) {
return glyph.x_min || glyph.y_min || glyph.x_max || glyph.y_max;
}
int16_t x_min = glyph.contours[0][0].x;
int16_t y_min = glyph.contours[0][0].y;
int16_t x_max = x_min;
int16_t y_max = y_min;
for (const auto& contour : glyph.contours) {
for (const auto& point : contour) {
if (point.x < x_min) x_min = point.x;
if (point.x > x_max) x_max = point.x;
if (point.y < y_min) y_min = point.y;
if (point.y > y_max) y_max = point.y;
}
}
if (glyph.x_min != x_min)
return true;
if (glyph.y_min != y_min)
return true;
if (glyph.x_max != x_max)
return true;
if (glyph.y_max != y_max)
return true;
return false;
}
void WriteSimpleGlyph(int glyph_id, const Glyph& glyph) {
int num_contours = glyph.contours.size();
WriteUShort(&n_contour_stream_, num_contours);
if (ShouldWriteSimpleGlyphBbox(glyph)) {
WriteBbox(glyph_id, glyph);
}
for (int i = 0; i < num_contours; i++) {
Write255UShort(&n_points_stream_, glyph.contours[i].size());
}
int lastX = 0;
int lastY = 0;
for (int i = 0; i < num_contours; i++) {
int num_points = glyph.contours[i].size();
for (int j = 0; j < num_points; j++) {
int x = glyph.contours[i][j].x;
int y = glyph.contours[i][j].y;
int dx = x - lastX;
int dy = y - lastY;
WriteTriplet(glyph.contours[i][j].on_curve, dx, dy);
lastX = x;
lastY = y;
}
}
if (num_contours > 0) {
WriteInstructions(glyph);
}
}
void WriteCompositeGlyph(int glyph_id, const Glyph& glyph) {
WriteUShort(&n_contour_stream_, -1);
WriteBbox(glyph_id, glyph);
WriteBytes(&composite_stream_,
glyph.composite_data,
glyph.composite_data_size);
if (glyph.have_instructions) {
WriteInstructions(glyph);
}
}
void WriteBbox(int glyph_id, const Glyph& glyph) {
bbox_bitmap_[glyph_id >> 3] |= 0x80 >> (glyph_id & 7);
WriteUShort(&bbox_stream_, glyph.x_min);
WriteUShort(&bbox_stream_, glyph.y_min);
WriteUShort(&bbox_stream_, glyph.x_max);
WriteUShort(&bbox_stream_, glyph.y_max);
}
void WriteTriplet(bool on_curve, int x, int y) {
int abs_x = std::abs(x);
int abs_y = std::abs(y);
int on_curve_bit = on_curve ? 0 : 128;
int x_sign_bit = (x < 0) ? 0 : 1;
int y_sign_bit = (y < 0) ? 0 : 1;
int xy_sign_bits = x_sign_bit + 2 * y_sign_bit;
if (x == 0 && abs_y < 1280) {
flag_byte_stream_.push_back(on_curve_bit +
((abs_y & 0xf00) >> 7) + y_sign_bit);
glyph_stream_.push_back(abs_y & 0xff);
} else if (y == 0 && abs_x < 1280) {
flag_byte_stream_.push_back(on_curve_bit + 10 +
((abs_x & 0xf00) >> 7) + x_sign_bit);
glyph_stream_.push_back(abs_x & 0xff);
} else if (abs_x < 65 && abs_y < 65) {
flag_byte_stream_.push_back(on_curve_bit + 20 +
((abs_x - 1) & 0x30) +
(((abs_y - 1) & 0x30) >> 2) +
xy_sign_bits);
glyph_stream_.push_back((((abs_x - 1) & 0xf) << 4) | ((abs_y - 1) & 0xf));
} else if (abs_x < 769 && abs_y < 769) {
flag_byte_stream_.push_back(on_curve_bit + 84 +
12 * (((abs_x - 1) & 0x300) >> 8) +
(((abs_y - 1) & 0x300) >> 6) + xy_sign_bits);
glyph_stream_.push_back((abs_x - 1) & 0xff);
glyph_stream_.push_back((abs_y - 1) & 0xff);
} else if (abs_x < 4096 && abs_y < 4096) {
flag_byte_stream_.push_back(on_curve_bit + 120 + xy_sign_bits);
glyph_stream_.push_back(abs_x >> 4);
glyph_stream_.push_back(((abs_x & 0xf) << 4) | (abs_y >> 8));
glyph_stream_.push_back(abs_y & 0xff);
} else {
flag_byte_stream_.push_back(on_curve_bit + 124 + xy_sign_bits);
glyph_stream_.push_back(abs_x >> 8);
glyph_stream_.push_back(abs_x & 0xff);
glyph_stream_.push_back(abs_y >> 8);
glyph_stream_.push_back(abs_y & 0xff);
}
}
std::vector<uint8_t> n_contour_stream_;
std::vector<uint8_t> n_points_stream_;
std::vector<uint8_t> flag_byte_stream_;
std::vector<uint8_t> composite_stream_;
std::vector<uint8_t> bbox_bitmap_;
std::vector<uint8_t> bbox_stream_;
std::vector<uint8_t> glyph_stream_;
std::vector<uint8_t> instruction_stream_;
int n_glyphs_;
};
} // namespace
bool TransformGlyfAndLocaTables(Font* font) {
// no transform for CFF
const Font::Table* glyf_table = font->FindTable(kGlyfTableTag);
const Font::Table* loca_table = font->FindTable(kLocaTableTag);
if (font->FindTable(kCffTableTag) != NULL
&& glyf_table == NULL
&& loca_table == NULL) {
return true;
}
// Must share neither or both loca/glyf
if (glyf_table->IsReused() != loca_table->IsReused()) {
return FONT_COMPRESSION_FAILURE();
}
if (glyf_table->IsReused()) {
return true;
}
Font::Table* transformed_glyf = &font->tables[kGlyfTableTag ^ 0x80808080];
Font::Table* transformed_loca = &font->tables[kLocaTableTag ^ 0x80808080];
int num_glyphs = NumGlyphs(*font);
GlyfEncoder encoder(num_glyphs);
for (int i = 0; i < num_glyphs; ++i) {
Glyph glyph;
const uint8_t* glyph_data;
size_t glyph_size;
if (!GetGlyphData(*font, i, &glyph_data, &glyph_size) ||
(glyph_size > 0 && !ReadGlyph(glyph_data, glyph_size, &glyph))) {
return FONT_COMPRESSION_FAILURE();
}
encoder.Encode(i, glyph);
}
encoder.GetTransformedGlyfBytes(&transformed_glyf->buffer);
const Font::Table* head_table = font->FindTable(kHeadTableTag);
if (head_table == NULL || head_table->length < 52) {
return FONT_COMPRESSION_FAILURE();
}
transformed_glyf->buffer[7] = head_table->data[51]; // index_format
transformed_glyf->tag = kGlyfTableTag ^ 0x80808080;
transformed_glyf->length = transformed_glyf->buffer.size();
transformed_glyf->data = transformed_glyf->buffer.data();
transformed_loca->tag = kLocaTableTag ^ 0x80808080;
transformed_loca->length = 0;
transformed_loca->data = NULL;
return true;
}
} // namespace woff2
@@ -0,0 +1 @@
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AA0DM,SAAS,0CAAsB,QAA4B,CAAC,CAAC;IAClE,IAAI,CAAC,gBAAgB,SAAS,GAAG,CAAA,GAAA,yBAAiB,EAAE,MAAM,KAAK,EAAE,MAAM,YAAY,IAAI,EAAE,EAAE,MAAM,QAAQ;IACzG,IAAI,CAAC,cAAc,GAAG,CAAA,GAAA,eAAO,EAAE;IAC/B,IAAI,aAAa,CAAC,CAAC,MAAM,UAAU,IAAI,eAAe,MAAM,KAAK;IAEjE,IAAI,gBAAgB,CAAA,GAAA,aAAK,EAAE,IAAI;IAC/B,IAAI,aAAa,CAAA,GAAA,6BAAqB,EAAE;QACtC,GAAG,KAAK;QACR,OAAO;IACT;IAEA,IAAI,YAAY,WAAW,iBAAiB,CAAC,SAAS;QAItC,qBAmDG;IAtDnB,MAAM,QAA4B;QAChC,GAAG,UAAU;QACb,OAAO;QACP,cAAc,CAAA,sBAAA,MAAM,YAAY,cAAlB,iCAAA,sBAAsB;QACpC,UAAS,KAAK;YACZ,IAAI,MAAM,UAAU,IAAI,MAAM,UAAU,EACtC;YAGF,SAAS;QACX;QACA,YAAY,MAAM,UAAU,IAAI;QAChC,YAAY,MAAM,UAAU,IAAI;QAChC,YAAW,KAAK;YACd,OAAO,eAAe,QAAQ,CAAC;QACjC;QACA,UAAS,KAAK;YACZ,IAAI,MAAM,UAAU,IAAI,MAAM,UAAU,EACtC;YAEF,IAAI,CAAC,eAAe,QAAQ,CAAC,QAAQ;gBACnC,iBAAiB,eAAe,MAAM,CAAC;gBACvC,SAAS;YACX;QACF;QACA,aAAY,KAAK;YACf,IAAI,MAAM,UAAU,IAAI,MAAM,UAAU,EACtC;YAEF,IAAI,eAAe,QAAQ,CAAC,QAC1B,SAAS,eAAe,MAAM,CAAC,CAAA,gBAAiB,kBAAkB;QAEtE;QACA,aAAY,KAAK;YACf,IAAI,MAAM,UAAU,IAAI,MAAM,UAAU,EACtC;YAEF,IAAI,eAAe,QAAQ,CAAC,QAC1B,SAAS,eAAe,MAAM,CAAC,CAAA,gBAAiB,kBAAkB;iBAElE,SAAS,eAAe,MAAM,CAAC;QAEnC;QACA,YAAW,KAAK,EAAE,CAAC;YACjB,IAAI,IAAI,IAAI,IAAI,cAAc,OAAO;YACrC,IAAI,EAAE,SAAS,EACb,EAAE,GAAG,CAAC,OAAO;iBAEb,EAAE,MAAM,CAAC;YAGX,cAAc,OAAO,GAAG;YACxB,WAAW,gBAAgB,CAAC,CAAA,GAAA,sBAAc,KAAK,EAAE,MAAM;QACzD;QACA,iBAAiB,CAAA,yBAAA,MAAM,eAAe,cAArB,oCAAA,yBAA0B,YAAY,YAAY;mBACnE;oBACA;IACF;IAEA,OAAO;AACT","sources":["packages/@react-stately/checkbox/src/useCheckboxGroupState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CheckboxGroupProps} from '@react-types/checkbox';\nimport {FormValidationState, mergeValidation, useFormValidationState} from '@react-stately/form';\nimport {useControlledState} from '@react-stately/utils';\nimport {useRef, useState} from 'react';\nimport {ValidationResult, ValidationState} from '@react-types/shared';\n\nexport interface CheckboxGroupState extends FormValidationState {\n /** Current selected values. */\n readonly value: readonly string[],\n /** Default selected values. */\n readonly defaultValue: readonly string[],\n\n /** Whether the checkbox group is disabled. */\n readonly isDisabled: boolean,\n\n /** Whether the checkbox group is read only. */\n readonly isReadOnly: boolean,\n\n /**\n * The current validation state of the checkbox group.\n * @deprecated Use `isInvalid` instead.\n */\n readonly validationState: ValidationState | null,\n\n /** Whether the checkbox group is invalid. */\n readonly isInvalid: boolean,\n\n /**\n * Whether the checkboxes in the group are required.\n * This changes to false once at least one item is selected.\n */\n readonly isRequired: boolean,\n\n /** Returns whether the given value is selected. */\n isSelected(value: string): boolean,\n\n /** Sets the selected values. */\n setValue(value: string[]): void,\n\n /** Adds a value to the set of selected values. */\n addValue(value: string): void,\n\n /** Removes a value from the set of selected values. */\n removeValue(value: string): void,\n\n /** Toggles a value in the set of selected values. */\n toggleValue(value: string): void,\n\n /** Sets whether one of the checkboxes is invalid. */\n setInvalid(value: string, validation: ValidationResult): void\n}\n\n/**\n * Provides state management for a checkbox group component. Provides a name for the group,\n * and manages selection and focus state.\n */\nexport function useCheckboxGroupState(props: CheckboxGroupProps = {}): CheckboxGroupState {\n let [selectedValues, setValue] = useControlledState(props.value, props.defaultValue || [], props.onChange);\n let [initialValues] = useState(selectedValues);\n let isRequired = !!props.isRequired && selectedValues.length === 0;\n\n let invalidValues = useRef(new Map<string, ValidationResult>());\n let validation = useFormValidationState({\n ...props,\n value: selectedValues\n });\n\n let isInvalid = validation.displayValidation.isInvalid;\n const state: CheckboxGroupState = {\n ...validation,\n value: selectedValues,\n defaultValue: props.defaultValue ?? initialValues,\n setValue(value) {\n if (props.isReadOnly || props.isDisabled) {\n return;\n }\n\n setValue(value);\n },\n isDisabled: props.isDisabled || false,\n isReadOnly: props.isReadOnly || false,\n isSelected(value) {\n returLine truncated
@@ -0,0 +1 @@
{"mappings":";;;;ACsBA;IACE,mCAAmC;IACnC,UAAU,EAAE,oBAAoB,gBAAgB,CAAC,CAAC;IAElD,gFAAgF;IAChF,UAAU,EAAE,aAAa,CAAC;IAE1B,mCAAmC;IACnC,UAAU,EAAE,aAAa,CAAC;IAE1B,+EAA+E;IAC/E,WAAW,EAAE,qBAAqB,iBAAiB,CAAC,CAAA;CACrD;AAED;;;;;;;;;GASG;AACH,0BAA0B,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EACnD,KAAK,EAAE,gBAAgB,CAAC,CAAC,EACzB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,UAAU,OAAO,GAAG,IAAI,CAAC,GAClC,UAAU,CA+KZ;ACtND;IACE,qEAAqE;IACrE,UAAU,EAAE,aAAa,CAAC;IAE1B,yDAAyD;IACzD,UAAU,EAAE,oBAAoB,gBAAgB,CAAC,CAAC;IAElD,6DAA6D;IAC7D,UAAU,EAAE,oBAAoB,gBAAgB,CAAC,CAAC;IAElD,qDAAqD;IACrD,UAAU,EAAE,OAAO,CAAC;IACpB,8CAA8C;IAC9C,SAAS,EAAE,OAAO,CAAC;IACnB,qCAAqC;IACrC,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,uCAAwC,SAAQ,oBAAoB;IAClE,kCAAkC;IAClC,QAAQ,EAAE,UAAU,OAAO,GAAG,IAAI,CAAC,CAAC;IACpC,wCAAwC;IACxC,QAAQ,EAAE,UAAU,gBAAgB,GAAG,IAAI,CAAC,CAAA;CAC7C;AAED;;;;;GAKG;AACH,+BACE,IAAI,EAAE,sBAAsB,EAC5B,KAAK,EAAE,WAAW,GACjB,eAAe,CAoOjB;ACpQD,YAAY,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAGzD,YAAY,EAAC,oBAAoB,EAAC,MAAM,qBAAqB,CAAC;AAC9D,YAAY,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC","sources":["packages/@react-aria/slider/src/packages/@react-aria/slider/src/utils.ts","packages/@react-aria/slider/src/packages/@react-aria/slider/src/useSlider.ts","packages/@react-aria/slider/src/packages/@react-aria/slider/src/useSliderThumb.ts","packages/@react-aria/slider/src/packages/@react-aria/slider/src/index.ts","packages/@react-aria/slider/src/index.ts"],"sourcesContent":[null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useSlider} from './useSlider';\nexport {useSliderThumb} from './useSliderThumb';\nexport type {AriaSliderProps} from '@react-types/slider';\nexport type {SliderAria} from './useSlider';\nexport type {AriaSliderThumbOptions, SliderThumbAria} from './useSliderThumb';\nexport type {AriaSliderThumbProps} from '@react-types/slider';\nexport type {Orientation} from '@react-types/shared';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -0,0 +1,66 @@
'use strict';
var File = require('vinyl');
var helpers = require('./lib/helpers');
var PLUGIN_NAME = 'vinyl-sourcemap';
function add(file, callback) {
// Bail early an error if the file argument is not a Vinyl file
if (!File.isVinyl(file)) {
return callback(new Error(PLUGIN_NAME + '-add: Not a vinyl file'));
}
// Bail early with an error if file has streaming contents
if (file.isStream()) {
return callback(new Error(PLUGIN_NAME + '-add: Streaming not supported'));
}
// Bail early successfully if file is null or already has a sourcemap
if (file.isNull() || file.sourceMap) {
return callback(null, file);
}
var state = {
path: '', // Root path for the sources in the map
map: null,
content: file.contents.toString(),
// TODO: handle this?
preExistingComment: null,
};
helpers.addSourceMaps(file, state, callback);
}
function write(file, destPath, callback) {
// Check if options or a callback are passed as second argument
if (typeof destPath === 'function') {
callback = destPath;
destPath = undefined;
}
// Bail early with an error if the file argument is not a Vinyl file
if (!File.isVinyl(file)) {
return callback(new Error(PLUGIN_NAME + '-write: Not a vinyl file'));
}
// Bail early with an error if file has streaming contents
if (file.isStream()) {
return callback(new Error(PLUGIN_NAME + '-write: Streaming not supported'));
}
// Bail early successfully if file is null or doesn't have sourcemap
if (file.isNull() || !file.sourceMap) {
return callback(null, file);
}
helpers.writeSourceMaps(file, destPath, callback);
}
module.exports = {
add: add,
write: write,
};
@@ -0,0 +1,144 @@
/*
Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
(function () {
'use strict';
function isExpression(node) {
if (node == null) { return false; }
switch (node.type) {
case 'ArrayExpression':
case 'AssignmentExpression':
case 'BinaryExpression':
case 'CallExpression':
case 'ConditionalExpression':
case 'FunctionExpression':
case 'Identifier':
case 'Literal':
case 'LogicalExpression':
case 'MemberExpression':
case 'NewExpression':
case 'ObjectExpression':
case 'SequenceExpression':
case 'ThisExpression':
case 'UnaryExpression':
case 'UpdateExpression':
return true;
}
return false;
}
function isIterationStatement(node) {
if (node == null) { return false; }
switch (node.type) {
case 'DoWhileStatement':
case 'ForInStatement':
case 'ForStatement':
case 'WhileStatement':
return true;
}
return false;
}
function isStatement(node) {
if (node == null) { return false; }
switch (node.type) {
case 'BlockStatement':
case 'BreakStatement':
case 'ContinueStatement':
case 'DebuggerStatement':
case 'DoWhileStatement':
case 'EmptyStatement':
case 'ExpressionStatement':
case 'ForInStatement':
case 'ForStatement':
case 'IfStatement':
case 'LabeledStatement':
case 'ReturnStatement':
case 'SwitchStatement':
case 'ThrowStatement':
case 'TryStatement':
case 'VariableDeclaration':
case 'WhileStatement':
case 'WithStatement':
return true;
}
return false;
}
function isSourceElement(node) {
return isStatement(node) || node != null && node.type === 'FunctionDeclaration';
}
function trailingStatement(node) {
switch (node.type) {
case 'IfStatement':
if (node.alternate != null) {
return node.alternate;
}
return node.consequent;
case 'LabeledStatement':
case 'ForStatement':
case 'ForInStatement':
case 'WhileStatement':
case 'WithStatement':
return node.body;
}
return null;
}
function isProblematicIfStatement(node) {
var current;
if (node.type !== 'IfStatement') {
return false;
}
if (node.alternate == null) {
return false;
}
current = node.consequent;
do {
if (current.type === 'IfStatement') {
if (current.alternate == null) {
return true;
}
}
current = trailingStatement(current);
} while (current);
return false;
}
module.exports = {
isExpression: isExpression,
isStatement: isStatement,
isIterationStatement: isIterationStatement,
isSourceElement: isSourceElement,
isProblematicIfStatement: isProblematicIfStatement,
trailingStatement: trailingStatement
};
}());
/* vim: set sw=4 ts=4 et tw=80 : */
@@ -0,0 +1,25 @@
import { createTailwindMerge } from './create-tailwind-merge'
import { getDefaultConfig } from './default-config'
import { mergeConfigs } from './merge-configs'
import { AnyConfig, ConfigExtension, DefaultClassGroupIds, DefaultThemeGroupIds } from './types'
type CreateConfigSubsequent = (config: AnyConfig) => AnyConfig
export const extendTailwindMerge = <
AdditionalClassGroupIds extends string = never,
AdditionalThemeGroupIds extends string = never,
>(
configExtension:
| ConfigExtension<
DefaultClassGroupIds | AdditionalClassGroupIds,
DefaultThemeGroupIds | AdditionalThemeGroupIds
>
| CreateConfigSubsequent,
...createConfig: CreateConfigSubsequent[]
) =>
typeof configExtension === 'function'
? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig)
: createTailwindMerge(
() => mergeConfigs(getDefaultConfig(), configExtension),
...createConfig,
)
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"B","2":"K D E F A wC"},B:{"1":"0 1 2 3 4 5 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"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 0C 1C"},D:{"1":"0 1 2 3 4 5 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","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB"},E:{"1":"A B C L M G aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","2":"J ZB K D E F 2C ZC 3C 4C 5C 6C"},F:{"1":"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","2":"F B C FD GD HD ID NC uC JD OC"},G:{"1":"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","2":"E ZC KD vC LD MD ND OD PD QD"},H:{"2":"hD"},I:{"1":"I mD nD","2":"TC J iD jD kD lD vC"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"B","2":"A"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"2D","2":"1D"}},B:6,C:"Internationalization API",D:true};
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_initializer_define_property.cjs",
"module": "../../esm/_initializer_define_property.js"
}
@@ -0,0 +1,32 @@
var rng;
var crypto = global.crypto || global.msCrypto; // for IE 11
if (crypto && crypto.getRandomValues) {
// WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto
// Moderately fast, high quality
var _rnds8 = new Uint8Array(16);
rng = function whatwgRNG() {
crypto.getRandomValues(_rnds8);
return _rnds8;
};
}
if (!rng) {
// Math.random()-based (RNG)
//
// If all else fails, use Math.random(). It's fast, but is of unspecified
// quality.
var _rnds = new Array(16);
rng = function() {
for (var i = 0, r; i < 16; i++) {
if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
_rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
}
return _rnds;
};
}
module.exports = rng;
@@ -0,0 +1,53 @@
{
"name": "queue-lit",
"description": "queue-lit is a tiny queue data structure in case you `Array#push()` or `Array#shift()` on large arrays very often",
"version": "1.5.2",
"author": "Joel Voß <mail@joelvoss.com>",
"license": "MIT",
"homepage": "https://github.com/joelvoss/queue-lit",
"bugs": {
"url": "https://github.com/joelvoss/queue-lit/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/joelvoss/queue-lit.git"
},
"engines": {
"node": ">=12"
},
"type": "module",
"source": "src/index.js",
"main": "dist/queue-lit.cjs",
"module": "dist/queue-lit.module.js",
"exports": {
"types": "./dist/index.d.ts",
"require": "./dist/queue-lit.cjs",
"import": "./dist/queue-lit.modern.js"
},
"types": "dist/index.d.ts",
"files": [
"dist",
"LICENSE"
],
"scripts": {
"start": "./Taskfile.sh",
"test": "./Taskfile.sh test",
"prepublishOnly": "./Taskfile.sh build"
},
"dependencies": {},
"devDependencies": {
"@jvdx/core": "^3.6.0"
},
"prettier": "@jvdx/prettier-config",
"prettierIgnore": [
"tests/",
"dist/"
],
"eslintConfig": {
"extends": "@jvdx/eslint-config"
},
"eslintIgnore": [
"tests/",
"dist/"
]
}
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_unsupported_iterable_to_array.cjs",
"module": "../../esm/_unsupported_iterable_to_array.js"
}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ParameterDecoratorInfo.js.map
@@ -0,0 +1,72 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
const getESLintCoreRule_1 = require("../util/getESLintCoreRule");
const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('max-params');
exports.default = (0, util_1.createRule)({
name: 'max-params',
meta: {
type: 'suggestion',
// defaultOptions, -- base rule does not use defaultOptions
docs: {
description: 'Enforce a maximum number of parameters in function definitions',
extendsBaseRule: true,
},
messages: baseRule.meta.messages,
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
countVoidThis: {
type: 'boolean',
description: 'Whether to count a `this` declaration when the type is `void`.',
},
max: {
type: 'integer',
description: 'A maximum number of parameters in function definitions.',
minimum: 0,
},
maximum: {
type: 'integer',
description: '(deprecated) A maximum number of parameters in function definitions.',
minimum: 0,
},
},
},
],
},
defaultOptions: [{ countVoidThis: false, max: 3 }],
create(context, [{ countVoidThis }]) {
const baseRules = baseRule.create(context);
if (countVoidThis === true) {
return baseRules;
}
const removeVoidThisParam = (node) => {
if (node.params.length === 0 ||
node.params[0].type !== utils_1.AST_NODE_TYPES.Identifier ||
node.params[0].name !== 'this' ||
node.params[0].typeAnnotation?.typeAnnotation.type !==
utils_1.AST_NODE_TYPES.TSVoidKeyword) {
return node;
}
return {
...node,
params: node.params.slice(1),
};
};
const wrapListener = (listener) => {
return (node) => {
listener(removeVoidThisParam(node));
};
};
return {
ArrowFunctionExpression: wrapListener(baseRules.ArrowFunctionExpression),
FunctionDeclaration: wrapListener(baseRules.FunctionDeclaration),
FunctionExpression: wrapListener(baseRules.FunctionExpression),
TSDeclareFunction: wrapListener(baseRules.FunctionDeclaration),
TSFunctionType: wrapListener(baseRules.FunctionDeclaration),
};
},
});
@@ -0,0 +1,5 @@
declare const lineSplitRE: RegExp;
declare function positionToOffset(source: string, lineNumber: number, columnNumber: number): number;
declare function offsetToLineNumber(source: string, offset: number): number;
export { lineSplitRE, offsetToLineNumber, positionToOffset };
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=MultiInjectOptions.js.map
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,SAAS,CAAC;AAC1C","sources":["packages/@react-aria/overlays/intl/pt-PT.json"],"sourcesContent":["{\n \"dismiss\": \"Dispensar\"\n}\n"],"names":[],"version":3,"file":"pt-PT.main.js.map"}
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;AAEO,SAAS,0CAAW,KAAe;IACxC,MAAM,SAAS,CAAA,GAAA,oBAAM,EAAE,KAAK,CAAC;IAC7B,MAAM,QAAQ,SAAS,MAAM,CAAC,EAAE,EAAE;IAClC,IAAI,SAAS,IACX,OAAO;IAET,gCAAgC;IAChC,OAAO,QAAQ,SAAS;AAC1B","sources":["packages/@react-aria/utils/src/inertValue.ts"],"sourcesContent":["import {version} from 'react';\n\nexport function inertValue(value?: boolean): string | boolean | undefined {\n const pieces = version.split('.');\n const major = parseInt(pieces[0], 10);\n if (major >= 19) {\n return value;\n }\n // compatibility with React < 19\n return value ? 'true' : undefined;\n}\n"],"names":[],"version":3,"file":"inertValue.main.js.map"}
@@ -0,0 +1,7 @@
import type { ITokenizer } from 'strtok3';
export declare class GzipHandler {
private tokenizer;
private gunzip;
constructor(tokenizer: ITokenizer);
inflate(): ReadableStream<Uint8Array>;
}
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveDynamicValueBindingCallback = resolveDynamicValueBindingCallback;
function resolveDynamicValueBindingCallback(params, binding) {
return binding.value(params.context);
}
//# sourceMappingURL=resolveDynamicValueBindingCallback.js.map
@@ -0,0 +1,30 @@
"use strict";
var PKCS12AttrSet_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PKCS12AttrSet = exports.PKCS12Attribute = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
class PKCS12Attribute {
constructor(params = {}) {
this.attrId = "";
this.attrValues = [];
Object.assign(params);
}
}
exports.PKCS12Attribute = PKCS12Attribute;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })
], PKCS12Attribute.prototype, "attrId", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any, repeated: "set" })
], PKCS12Attribute.prototype, "attrValues", void 0);
let PKCS12AttrSet = PKCS12AttrSet_1 = class PKCS12AttrSet extends asn1_schema_1.AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, PKCS12AttrSet_1.prototype);
}
};
exports.PKCS12AttrSet = PKCS12AttrSet;
exports.PKCS12AttrSet = PKCS12AttrSet = PKCS12AttrSet_1 = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence, itemType: PKCS12Attribute })
], PKCS12AttrSet);
@@ -0,0 +1,31 @@
import baseFlatten from './_baseFlatten.js';
import map from './map.js';
import toInteger from './toInteger.js';
/**
* This method is like `_.flatMap` except that it recursively flattens the
* mapped results up to `depth` times.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {number} [depth=1] The maximum recursion depth.
* @returns {Array} Returns the new flattened array.
* @example
*
* function duplicate(n) {
* return [[[n, n]]];
* }
*
* _.flatMapDepth([1, 2], duplicate, 2);
* // => [[1, 1], [2, 2]]
*/
function flatMapDepth(collection, iteratee, depth) {
depth = depth === undefined ? 1 : toInteger(depth);
return baseFlatten(map(collection, iteratee), depth);
}
export default flatMapDepth;
@@ -0,0 +1 @@
{"version":3,"file":"updateMetadataName.d.ts","sourceRoot":"","sources":["../../../../src/metadata/actions/updateMetadataName.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,YAAY,GACjB,CACD,QAAQ,EAAE,2BAA2B,GAAG,gCAAgC,KACrE,2BAA2B,GAAG,gCAAgC,CAelE"}
@@ -0,0 +1,3 @@
import * as ts from 'typescript';
export declare function isSourceFile(code: unknown): code is ts.SourceFile;
export declare function getCodeText(code: string | ts.SourceFile): string;
@@ -0,0 +1,2 @@
function t(t){const o=Object.getPrototypeOf(t.prototype),r=o?.constructor;return r}function o(o,r){for(let n=o;void 0!==n;n=t(n)){const t=r(n);if(void 0!==t)return t}}export{o as findInPrototypeChain,t as getBaseType};
//# sourceMappingURL=index.js.map
@@ -0,0 +1,99 @@
'use strict';
var map = require('./common/map.js');
var _null = require('./common/null.js');
var seq = require('./common/seq.js');
var string = require('./common/string.js');
var bool = require('./core/bool.js');
var float = require('./core/float.js');
var int = require('./core/int.js');
var schema = require('./core/schema.js');
var schema$1 = require('./json/schema.js');
var binary = require('./yaml-1.1/binary.js');
var merge = require('./yaml-1.1/merge.js');
var omap = require('./yaml-1.1/omap.js');
var pairs = require('./yaml-1.1/pairs.js');
var schema$2 = require('./yaml-1.1/schema.js');
var set = require('./yaml-1.1/set.js');
var timestamp = require('./yaml-1.1/timestamp.js');
const schemas = new Map([
['core', schema.schema],
['failsafe', [map.map, seq.seq, string.string]],
['json', schema$1.schema],
['yaml11', schema$2.schema],
['yaml-1.1', schema$2.schema]
]);
const tagsByName = {
binary: binary.binary,
bool: bool.boolTag,
float: float.float,
floatExp: float.floatExp,
floatNaN: float.floatNaN,
floatTime: timestamp.floatTime,
int: int.int,
intHex: int.intHex,
intOct: int.intOct,
intTime: timestamp.intTime,
map: map.map,
merge: merge.merge,
null: _null.nullTag,
omap: omap.omap,
pairs: pairs.pairs,
seq: seq.seq,
set: set.set,
timestamp: timestamp.timestamp
};
const coreKnownTags = {
'tag:yaml.org,2002:binary': binary.binary,
'tag:yaml.org,2002:merge': merge.merge,
'tag:yaml.org,2002:omap': omap.omap,
'tag:yaml.org,2002:pairs': pairs.pairs,
'tag:yaml.org,2002:set': set.set,
'tag:yaml.org,2002:timestamp': timestamp.timestamp
};
function getTags(customTags, schemaName, addMergeTag) {
const schemaTags = schemas.get(schemaName);
if (schemaTags && !customTags) {
return addMergeTag && !schemaTags.includes(merge.merge)
? schemaTags.concat(merge.merge)
: schemaTags.slice();
}
let tags = schemaTags;
if (!tags) {
if (Array.isArray(customTags))
tags = [];
else {
const keys = Array.from(schemas.keys())
.filter(key => key !== 'yaml11')
.map(key => JSON.stringify(key))
.join(', ');
throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
}
}
if (Array.isArray(customTags)) {
for (const tag of customTags)
tags = tags.concat(tag);
}
else if (typeof customTags === 'function') {
tags = customTags(tags.slice());
}
if (addMergeTag)
tags = tags.concat(merge.merge);
return tags.reduce((tags, tag) => {
const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
if (!tagObj) {
const tagName = JSON.stringify(tag);
const keys = Object.keys(tagsByName)
.map(key => JSON.stringify(key))
.join(', ');
throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
}
if (!tags.includes(tagObj))
tags.push(tagObj);
return tags;
}, []);
}
exports.coreKnownTags = coreKnownTags;
exports.getTags = getTags;
@@ -0,0 +1,74 @@
import { CreateType } from '../create/type.mjs';
import { Computed } from '../computed/index.mjs';
import { Optional } from '../optional/index.mjs';
import { Object } from '../object/index.mjs';
import { Intersect } from '../intersect/index.mjs';
import { Union } from '../union/index.mjs';
import { Ref } from '../ref/index.mjs';
import { Discard } from '../discard/index.mjs';
import { TransformKind } from '../symbols/index.mjs';
import { PartialFromMappedResult } from './partial-from-mapped-result.mjs';
// ------------------------------------------------------------------
// KindGuard
// ------------------------------------------------------------------
import * as KindGuard from '../guard/kind.mjs';
// prettier-ignore
function FromComputed(target, parameters) {
return Computed('Partial', [Computed(target, parameters)]);
}
// prettier-ignore
function FromRef($ref) {
return Computed('Partial', [Ref($ref)]);
}
// prettier-ignore
function FromProperties(properties) {
const partialProperties = {};
for (const K of globalThis.Object.getOwnPropertyNames(properties))
partialProperties[K] = Optional(properties[K]);
return partialProperties;
}
// prettier-ignore
function FromObject(type) {
const options = Discard(type, [TransformKind, '$id', 'required', 'properties']);
const properties = FromProperties(type['properties']);
return Object(properties, options);
}
// prettier-ignore
function FromRest(types) {
return types.map(type => PartialResolve(type));
}
// ------------------------------------------------------------------
// PartialResolve
// ------------------------------------------------------------------
// prettier-ignore
function PartialResolve(type) {
return (
// Mappable
KindGuard.IsComputed(type) ? FromComputed(type.target, type.parameters) :
KindGuard.IsRef(type) ? FromRef(type.$ref) :
KindGuard.IsIntersect(type) ? Intersect(FromRest(type.allOf)) :
KindGuard.IsUnion(type) ? Union(FromRest(type.anyOf)) :
KindGuard.IsObject(type) ? FromObject(type) :
// Intrinsic
KindGuard.IsBigInt(type) ? type :
KindGuard.IsBoolean(type) ? type :
KindGuard.IsInteger(type) ? type :
KindGuard.IsLiteral(type) ? type :
KindGuard.IsNull(type) ? type :
KindGuard.IsNumber(type) ? type :
KindGuard.IsString(type) ? type :
KindGuard.IsSymbol(type) ? type :
KindGuard.IsUndefined(type) ? type :
// Passthrough
Object({}));
}
/** `[Json]` Constructs a type where all properties are optional */
export function Partial(type, options) {
if (KindGuard.IsMappedResult(type)) {
return PartialFromMappedResult(type, options);
}
else {
// special: mapping types require overridable options
return CreateType({ ...PartialResolve(type), ...options });
}
}
@@ -0,0 +1,6 @@
// src/utils/theme.ts
var isBaseTheme = (theme) => theme === "light" || theme === "dark";
export {
isBaseTheme
};
@@ -0,0 +1,57 @@
'use strict'
const recommendedRules = {
'promise/always-return': 'error',
'promise/no-return-wrap': 'error',
'promise/param-names': 'error',
'promise/catch-or-return': 'error',
'promise/no-native': 'off',
'promise/no-nesting': 'warn',
'promise/no-promise-in-callback': 'warn',
'promise/no-callback-in-promise': 'warn',
'promise/avoid-new': 'off',
'promise/no-new-statics': 'error',
'promise/no-return-in-finally': 'warn',
'promise/valid-params': 'warn',
}
const pluginPromise = {
rules: {
'param-names': require('./rules/param-names'),
'no-return-wrap': require('./rules/no-return-wrap'),
'always-return': require('./rules/always-return'),
'catch-or-return': require('./rules/catch-or-return'),
'prefer-await-to-callbacks': require('./rules/prefer-await-to-callbacks'),
'prefer-await-to-then': require('./rules/prefer-await-to-then'),
'prefer-catch': require('./rules/prefer-catch'),
'no-native': require('./rules/no-native'),
'no-callback-in-promise': require('./rules/no-callback-in-promise'),
'no-promise-in-callback': require('./rules/no-promise-in-callback'),
'no-nesting': require('./rules/no-nesting'),
'avoid-new': require('./rules/avoid-new'),
'no-new-statics': require('./rules/no-new-statics'),
'no-return-in-finally': require('./rules/no-return-in-finally'),
'valid-params': require('./rules/valid-params'),
'no-multiple-resolved': require('./rules/no-multiple-resolved'),
'spec-only': require('./rules/spec-only'),
},
rulesConfig: {
'param-names': 1,
'always-return': 1,
'no-return-wrap': 1,
'no-native': 0,
'catch-or-return': 1,
},
}
pluginPromise.configs = {
recommended: {
plugins: ['promise'],
rules: recommendedRules,
},
'flat/recommended': {
name: 'promise/flat/recommended',
plugins: { promise: pluginPromise },
rules: recommendedRules,
},
}
module.exports = pluginPromise
@@ -0,0 +1 @@
{"mappings":"AAAA;;;;;;;;;;CAUC,GAMD,IAAI,4BAAM;AAMH,MAAM;IA6BX;;GAEC,GACD,kBAAwB;QACtB,IAAI,CAAC,OAAO,GAAG;QACf,IAAI,CAAC,QAAQ,GAAG;QAChB,IAAI,CAAC,UAAU,GAAG;IACpB;IAEA,gBAAgB,SAAiB,EAAmB;QAClD,4FAA4F;QAC5F,oGAAoG;QACpG,iGAAiG;QACjG,sEAAsE;QACtE,IAAI,WAAW,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;QACtC,IAAI,OAAO,YAAY,SAAS,MAAM,GAAG,IACrC,SAAS,KAAK,KACd,IAAI,0CAAgB,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE;QAEhD,OAAO;IACT;IAEA,WAAW,KAAsB,EAAQ;QACvC,MAAM,eAAe;QACrB,IAAI,WAAW,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,QAAQ;QACpD,IAAI,CAAC,UAAU;YACb,WAAW,EAAE;YACb,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,QAAQ,EAAE;QACzC;QACA,SAAS,IAAI,CAAC;IAChB;IAzCA,YAAY,WAA8B,EAAE,QAAgB,CAAE;QAC5D,IAAI,CAAC,WAAW,GAAG;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE;QACb,IAAI,CAAC,QAAQ,GAAG;QAChB,IAAI,CAAC,QAAQ,GAAG,IAAI;QACpB,IAAI,CAAC,aAAa,GAAG,IAAI;QACzB,IAAI,CAAC,UAAU,GAAG;QAClB,IAAI,CAAC,OAAO,GAAG;QACf,IAAI,CAAC,QAAQ,GAAG;IAClB;AAiCF;AAEO,MAAM,kDAAsC;IACjD,YAAY,WAA8B,CAAE;QAC1C,KAAK,CAAC,aAAa;IACrB;AACF;AAEO,MAAM,kDAAuC;IAGlD,YAAY,WAA8B,EAAE,MAA0B,EAAE,QAAgB,CAAE;QACxF,KAAK,CAAC,aAAa;QACnB,IAAI,CAAC,MAAM,GAAG;IAChB;AACF","sources":["packages/@react-stately/virtualizer/src/ReusableView.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Key} from '@react-types/shared';\nimport {LayoutInfo} from './LayoutInfo';\nimport {Virtualizer} from './Virtualizer';\n\nlet KEY = 0;\n\n/**\n * `Virtualizer` creates instances of the `ReusableView` class to\n * represent views currently being displayed.\n */\nexport class ReusableView<T extends object, V> {\n /** The Virtualizer this view is a part of. */\n virtualizer: Virtualizer<T, V>;\n\n /** The LayoutInfo this view is currently representing. */\n layoutInfo: LayoutInfo | null;\n\n /** The content currently being displayed by this view, set by the virtualizer. */\n content: T | null;\n\n rendered: V | null;\n\n viewType: string;\n key: Key;\n\n children: Set<ChildView<T, V>>;\n reusableViews: Map<string, ChildView<T, V>[]>;\n\n constructor(virtualizer: Virtualizer<T, V>, viewType: string) {\n this.virtualizer = virtualizer;\n this.key = ++KEY;\n this.viewType = viewType;\n this.children = new Set();\n this.reusableViews = new Map();\n this.layoutInfo = null;\n this.content = null;\n this.rendered = null;\n }\n\n /**\n * Prepares the view for reuse. Called just before the view is removed from the DOM.\n */\n prepareForReuse(): void {\n this.content = null;\n this.rendered = null;\n this.layoutInfo = null;\n }\n\n getReusableView(reuseType: string): ChildView<T, V> {\n // Reusable view queue should be FIFO so that DOM order remains consistent during scrolling.\n // For example, cells within a row should remain in the same order even if the row changes contents.\n // The cells within a row are removed from their parent in order. If the row is reused, the cells\n // should be reused in the new row in the same order they were before.\n let reusable = this.reusableViews.get(reuseType);\n let view = reusable && reusable.length > 0\n ? reusable.shift()!\n : new ChildView<T, V>(this.virtualizer, this, reuseType);\n\n return view;\n }\n\n reuseChild(child: ChildView<T, V>): void {\n child.prepareForReuse();\n let reusable = this.reusableViews.get(child.viewType);\n if (!reusable) {\n reusable = [];\n this.reusableViews.set(child.viewType, reusable);\n }\n reusable.push(child);\n }\n}\n\nexport class RootView<T extends object, V> extends ReusableView<T, V> {\n constructor(virtualizer: Virtualizer<T, V>) {\n super(virtualizer, 'root');\n }\n}\n\nexport class ChildView<T extends object, V> extends ReusableView<T, V> {\n parent: ReusableView<T, V>;\n\n constructor(virtualizer: Virtualizer<T, V>, parent: ReusableView<T, V>, viewType: string) {\n super(virtualizer, viewType);\n this.parent = parent;\n }\n}\n"],"names":[],"version":3,"file":"ReusableView.module.js.map"}
@@ -0,0 +1 @@
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAUM,SAAS,0CAAiB,CAAQ;IACvC,IAAI,CAAA,GAAA,yCAAI,KACN,OAAO,EAAE,OAAO;IAGlB,OAAO,EAAE,OAAO;AAClB;AAEA,sEAAsE;AACtE,MAAM,0CAAoB,IAAI,IAAI;IAChC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAEM,SAAS,0CAAiB,MAAe;IAC9C,OACE,AAAC,kBAAkB,oBAAoB,CAAC,wCAAkB,GAAG,CAAC,OAAO,IAAI,KACzE,kBAAkB,uBACjB,kBAAkB,eAAe,OAAO,iBAAiB;AAE9D","sources":["packages/@react-aria/utils/src/keyboard.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isMac} from './platform';\n\ninterface Event {\n altKey: boolean,\n ctrlKey: boolean,\n metaKey: boolean\n}\n\nexport function isCtrlKeyPressed(e: Event): boolean {\n if (isMac()) {\n return e.metaKey;\n }\n\n return e.ctrlKey;\n}\n\n// HTML input types that do not cause the software keyboard to appear.\nconst nonTextInputTypes = new Set([\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset'\n]);\n\nexport function willOpenKeyboard(target: Element) {\n return (\n (target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type)) ||\n target instanceof HTMLTextAreaElement ||\n (target instanceof HTMLElement && target.isContentEditable)\n );\n}\n"],"names":[],"version":3,"file":"keyboard.module.js.map"}
@@ -0,0 +1,35 @@
var asciiWords = require('./_asciiWords'),
hasUnicodeWord = require('./_hasUnicodeWord'),
toString = require('./toString'),
unicodeWords = require('./_unicodeWords');
/**
* Splits `string` into an array of its words.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {RegExp|string} [pattern] The pattern to match words.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the words of `string`.
* @example
*
* _.words('fred, barney, & pebbles');
* // => ['fred', 'barney', 'pebbles']
*
* _.words('fred, barney, & pebbles', /[^, ]+/g);
* // => ['fred', 'barney', '&', 'pebbles']
*/
function words(string, pattern, guard) {
string = toString(string);
pattern = guard ? undefined : pattern;
if (pattern === undefined) {
return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
}
return string.match(pattern) || [];
}
module.exports = words;
@@ -0,0 +1,38 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $Object = require('es-object-atoms');
var $StringPrototype = GetIntrinsic('%String.prototype%');
var $SyntaxError = require('es-errors/syntax');
var $TypeError = require('es-errors/type');
var setProto = require('set-proto');
var DefinePropertyOrThrow = require('./DefinePropertyOrThrow');
// https://262.ecma-international.org/6.0/#sec-stringcreate
module.exports = function StringCreate(value, prototype) {
if (typeof value !== 'string') {
throw new $TypeError('Assertion failed: `S` must be a String');
}
var S = $Object(value);
if (prototype !== $StringPrototype) {
if (setProto) {
setProto(S, prototype);
} else {
throw new $SyntaxError('StringCreate: a `proto` argument that is not `String.prototype` is not supported in an environment that does not support setting the [[Prototype]]');
}
}
var length = value.length;
DefinePropertyOrThrow(S, 'length', {
'[[Configurable]]': false,
'[[Enumerable]]': false,
'[[Value]]': length,
'[[Writable]]': false
});
return S;
};
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from './types.mjs';
import 'react';
declare const CloseFilledIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { CloseFilledIcon };
@@ -0,0 +1,172 @@
const C = "\u037c"
const COUNT = typeof Symbol == "undefined" ? "__" + C : Symbol.for(C)
const SET = typeof Symbol == "undefined" ? "__styleSet" + Math.floor(Math.random() * 1e8) : Symbol("styleSet")
const top = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : {}
// :: - Style modules encapsulate a set of CSS rules defined from
// JavaScript. Their definitions are only available in a given DOM
// root after it has been _mounted_ there with `StyleModule.mount`.
//
// Style modules should be created once and stored somewhere, as
// opposed to re-creating them every time you need them. The amount of
// CSS rules generated for a given DOM root is bounded by the amount
// of style modules that were used. So to avoid leaking rules, don't
// create these dynamically, but treat them as one-time allocations.
export class StyleModule {
// :: (Object<Style>, ?{finish: ?(string) → string})
// Create a style module from the given spec.
//
// When `finish` is given, it is called on regular (non-`@`)
// selectors (after `&` expansion) to compute the final selector.
constructor(spec, options) {
this.rules = []
let {finish} = options || {}
function splitSelector(selector) {
return /^@/.test(selector) ? [selector] : selector.split(/,\s*/)
}
function render(selectors, spec, target, isKeyframes) {
let local = [], isAt = /^@(\w+)\b/.exec(selectors[0]), keyframes = isAt && isAt[1] == "keyframes"
if (isAt && spec == null) return target.push(selectors[0] + ";")
for (let prop in spec) {
let value = spec[prop]
if (/&/.test(prop)) {
render(prop.split(/,\s*/).map(part => selectors.map(sel => part.replace(/&/, sel))).reduce((a, b) => a.concat(b)),
value, target)
} else if (value && typeof value == "object") {
if (!isAt) throw new RangeError("The value of a property (" + prop + ") should be a primitive value.")
render(splitSelector(prop), value, local, keyframes)
} else if (value != null) {
local.push(prop.replace(/_.*/, "").replace(/[A-Z]/g, l => "-" + l.toLowerCase()) + ": " + value + ";")
}
}
if (local.length || keyframes) {
target.push((finish && !isAt && !isKeyframes ? selectors.map(finish) : selectors).join(", ") +
" {" + local.join(" ") + "}")
}
}
for (let prop in spec) render(splitSelector(prop), spec[prop], this.rules)
}
// :: () → string
// Returns a string containing the module's CSS rules.
getRules() { return this.rules.join("\n") }
// :: () → string
// Generate a new unique CSS class name.
static newName() {
let id = top[COUNT] || 1
top[COUNT] = id + 1
return C + id.toString(36)
}
// :: (union<Document, ShadowRoot>, union<[StyleModule], StyleModule>, ?{nonce: ?string})
//
// Mount the given set of modules in the given DOM root, which ensures
// that the CSS rules defined by the module are available in that
// context.
//
// Rules are only added to the document once per root.
//
// Rule order will follow the order of the modules, so that rules from
// modules later in the array take precedence of those from earlier
// modules. If you call this function multiple times for the same root
// in a way that changes the order of already mounted modules, the old
// order will be changed.
//
// If a Content Security Policy nonce is provided, it is added to
// the `<style>` tag generated by the library.
static mount(root, modules, options) {
let set = root[SET], nonce = options && options.nonce
if (!set) set = new StyleSet(root, nonce)
else if (nonce) set.setNonce(nonce)
set.mount(Array.isArray(modules) ? modules : [modules], root)
}
}
let adoptedSet = new Map //<Document, StyleSet>
class StyleSet {
constructor(root, nonce) {
let doc = root.ownerDocument || root, win = doc.defaultView
if (!root.head && root.adoptedStyleSheets && win.CSSStyleSheet) {
let adopted = adoptedSet.get(doc)
if (adopted) return root[SET] = adopted
this.sheet = new win.CSSStyleSheet
adoptedSet.set(doc, this)
} else {
this.styleTag = doc.createElement("style")
if (nonce) this.styleTag.setAttribute("nonce", nonce)
}
this.modules = []
root[SET] = this
}
mount(modules, root) {
let sheet = this.sheet
let pos = 0 /* Current rule offset */, j = 0 /* Index into this.modules */
for (let i = 0; i < modules.length; i++) {
let mod = modules[i], index = this.modules.indexOf(mod)
if (index < j && index > -1) { // Ordering conflict
this.modules.splice(index, 1)
j--
index = -1
}
if (index == -1) {
this.modules.splice(j++, 0, mod)
if (sheet) for (let k = 0; k < mod.rules.length; k++)
sheet.insertRule(mod.rules[k], pos++)
} else {
while (j < index) pos += this.modules[j++].rules.length
pos += mod.rules.length
j++
}
}
if (sheet) {
if (root.adoptedStyleSheets.indexOf(this.sheet) < 0)
root.adoptedStyleSheets = [this.sheet, ...root.adoptedStyleSheets]
} else {
let text = ""
for (let i = 0; i < this.modules.length; i++)
text += this.modules[i].getRules() + "\n"
this.styleTag.textContent = text
let target = root.head || root
if (this.styleTag.parentNode != target)
target.insertBefore(this.styleTag, target.firstChild)
}
}
setNonce(nonce) {
if (this.styleTag && this.styleTag.getAttribute("nonce") != nonce)
this.styleTag.setAttribute("nonce", nonce)
}
}
// Style::Object<union<Style,string>>
//
// A style is an object that, in the simple case, maps CSS property
// names to strings holding their values, as in `{color: "red",
// fontWeight: "bold"}`. The property names can be given in
// camel-case—the library will insert a dash before capital letters
// when converting them to CSS.
//
// If you include an underscore in a property name, it and everything
// after it will be removed from the output, which can be useful when
// providing a property multiple times, for browser compatibility
// reasons.
//
// A property in a style object can also be a sub-selector, which
// extends the current context to add a pseudo-selector or a child
// selector. Such a property should contain a `&` character, which
// will be replaced by the current selector. For example `{"&:before":
// {content: '"hi"'}}`. Sub-selectors and regular properties can
// freely be mixed in a given object. Any property containing a `&` is
// assumed to be a sub-selector.
//
// Finally, a property can specify an @-block to be wrapped around the
// styles defined inside the object that's the property's value. For
// example to create a media query you can do `{"@media screen and
// (min-width: 400px)": {...}}`.
@@ -0,0 +1,548 @@
/* @minVersion 7.20.0 */
/**
Enums are used in this file, but not assigned to vars to avoid non-hoistable values
CONSTRUCTOR = 0;
PUBLIC = 1;
PRIVATE = 2;
FIELD = 0;
ACCESSOR = 1;
METHOD = 2;
GETTER = 3;
SETTER = 4;
STATIC = 5;
CLASS = 10; // only used in assertValidReturnValue
*/
function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
return function addInitializer(initializer) {
assertNotFinished(decoratorFinishedRef, "addInitializer");
assertCallable(initializer, "An initializer");
initializers.push(initializer);
};
}
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
var kindStr;
switch (kind) {
case 1 /* ACCESSOR */:
kindStr = "accessor";
break;
case 2 /* METHOD */:
kindStr = "method";
break;
case 3 /* GETTER */:
kindStr = "getter";
break;
case 4 /* SETTER */:
kindStr = "setter";
break;
default:
kindStr = "field";
}
var ctx = { kind: kindStr, name: isPrivate ? "#" + name : name, static: isStatic, private: isPrivate, metadata: metadata };
var decoratorFinishedRef = { v: false };
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
var get, set;
if (kind === 0 /* FIELD */) {
if (isPrivate) {
get = desc.get;
set = desc.set;
} else {
get = function() {
return this[name];
};
set = function(v) {
this[name] = v;
};
}
} else if (kind === 2 /* METHOD */) {
get = function() {
return desc.value;
};
} else {
// replace with values that will go through the final getter and setter
if (kind === 1 /* ACCESSOR */ || kind === 3 /* GETTER */) {
get = function() {
return desc.get.call(this);
};
}
if (kind === 1 /* ACCESSOR */ || kind === 4 /* SETTER */) {
set = function(v) {
desc.set.call(this, v);
};
}
}
ctx.access = get && set ? { get: get, set: set } : get ? { get: get } : { set: set };
try {
return dec(value, ctx);
} finally {
decoratorFinishedRef.v = true;
}
}
function assertNotFinished(decoratorFinishedRef, fnName) {
if (decoratorFinishedRef.v) {
throw new Error("attempted to call " + fnName + " after decoration was finished");
}
}
function assertCallable(fn, hint) {
if (typeof fn !== "function") {
throw new TypeError(hint + " must be a function");
}
}
function assertValidReturnValue(kind, value) {
var type = typeof value;
if (kind === 1 /* ACCESSOR */) {
if (type !== "object" || value === null) {
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
}
if (value.get !== undefined) {
assertCallable(value.get, "accessor.get");
}
if (value.set !== undefined) {
assertCallable(value.set, "accessor.set");
}
if (value.init !== undefined) {
assertCallable(value.init, "accessor.init");
}
} else if (type !== "function") {
var hint;
if (kind === 0 /* FIELD */) {
hint = "field";
} else if (kind === 10 /* CLASS */) {
hint = "class";
} else {
hint = "method";
}
throw new TypeError(hint + " decorators must return a function or void 0");
}
}
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
var decs = decInfo[0];
var desc, init, value;
if (isPrivate) {
if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {
desc = { get: decInfo[3], set: decInfo[4] };
} else if (kind === 3 /* GETTER */) {
desc = { get: decInfo[3] };
} else if (kind === 4 /* SETTER */) {
desc = { set: decInfo[3] };
} else {
desc = { value: decInfo[3] };
}
} else if (kind !== 0 /* FIELD */) {
desc = Object.getOwnPropertyDescriptor(base, name);
}
if (kind === 1 /* ACCESSOR */) {
value = { get: desc.get, set: desc.set };
} else if (kind === 2 /* METHOD */) {
value = desc.value;
} else if (kind === 3 /* GETTER */) {
value = desc.get;
} else if (kind === 4 /* SETTER */) {
value = desc.set;
}
var newValue, get, set;
if (typeof decs === "function") {
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
if (newValue !== void 0) {
assertValidReturnValue(kind, newValue);
if (kind === 0 /* FIELD */) {
init = newValue;
} else if (kind === 1 /* ACCESSOR */) {
init = newValue.init;
get = newValue.get || value.get;
set = newValue.set || value.set;
value = { get: get, set: set };
} else {
value = newValue;
}
}
} else {
for (var i = decs.length - 1; i >= 0; i--) {
var dec = decs[i];
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
if (newValue !== void 0) {
assertValidReturnValue(kind, newValue);
var newInit;
if (kind === 0 /* FIELD */) {
newInit = newValue;
} else if (kind === 1 /* ACCESSOR */) {
newInit = newValue.init;
get = newValue.get || value.get;
set = newValue.set || value.set;
value = { get: get, set: set };
} else {
value = newValue;
}
if (newInit !== void 0) {
if (init === void 0) {
init = newInit;
} else if (typeof init === "function") {
init = [init, newInit];
} else {
init.push(newInit);
}
}
}
}
}
if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {
if (init === void 0) {
// If the initializer was void 0, sub in a dummy initializer
init = function(instance, init) {
return init;
};
} else if (typeof init !== "function") {
var ownInitializers = init;
init = function(instance, init) {
var value = init;
for (var i = 0; i < ownInitializers.length; i++) value = ownInitializers[i].call(instance, value);
return value;
};
} else {
var originalInitializer = init;
init = function(instance, init) {
return originalInitializer.call(instance, init);
};
}
ret.push(init);
}
if (kind !== 0 /* FIELD */) {
if (kind === 1 /* ACCESSOR */) {
desc.get = value.get;
desc.set = value.set;
} else if (kind === 2 /* METHOD */) {
desc.value = value;
} else if (kind === 3 /* GETTER */) {
desc.get = value;
} else if (kind === 4 /* SETTER */) {
desc.set = value;
}
if (isPrivate) {
if (kind === 1 /* ACCESSOR */) {
ret.push(function(instance, args) {
return value.get.call(instance, args);
});
ret.push(function(instance, args) {
return value.set.call(instance, args);
});
} else if (kind === 2 /* METHOD */) {
ret.push(value);
} else {
ret.push(function(instance, args) {
return value.call(instance, args);
});
}
} else {
Object.defineProperty(base, name, desc);
}
}
}
function applyMemberDecs(Class, decInfos, metadata) {
var ret = [];
var protoInitializers;
var staticInitializers;
var existingProtoNonFields = new Map();
var existingStaticNonFields = new Map();
for (var i = 0; i < decInfos.length; i++) {
var decInfo = decInfos[i];
// skip computed property names
if (!Array.isArray(decInfo)) continue;
var kind = decInfo[1];
var name = decInfo[2];
var isPrivate = decInfo.length > 3;
var isStatic = kind >= 5; /* STATIC */
var base;
var initializers;
if (isStatic) {
base = Class;
kind = kind - 5 /* STATIC */;
// initialize staticInitializers when we see a non-field static member
staticInitializers = staticInitializers || [];
initializers = staticInitializers;
} else {
base = Class.prototype;
// initialize protoInitializers when we see a non-field member
protoInitializers = protoInitializers || [];
initializers = protoInitializers;
}
if (kind !== 0 /* FIELD */ && !isPrivate) {
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
var existingKind = existingNonFields.get(name) || 0;
if (existingKind === true || (existingKind === 3 /* GETTER */ && kind !== 4) /* SETTER */ || (existingKind === 4 /* SETTER */ && kind !== 3) /* GETTER */) {
throw new Error(
"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "
+ name
);
} else if (!existingKind && kind > 2 /* METHOD */) {
existingNonFields.set(name, kind);
} else {
existingNonFields.set(name, true);
}
}
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
}
pushInitializers(ret, protoInitializers);
pushInitializers(ret, staticInitializers);
return ret;
}
function pushInitializers(ret, initializers) {
if (initializers) {
ret.push(function(instance) {
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
return instance;
});
}
}
function applyClassDecs(targetClass, classDecs, metadata) {
if (classDecs.length > 0) {
var initializers = [];
var newClass = targetClass;
var name = targetClass.name;
for (var i = classDecs.length - 1; i >= 0; i--) {
var decoratorFinishedRef = { v: false };
try {
var nextNewClass = classDecs[i](newClass, { kind: "class", name: name, addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef), metadata });
} finally {
decoratorFinishedRef.v = true;
}
if (nextNewClass !== undefined) {
assertValidReturnValue(10, /* CLASS */ nextNewClass);
newClass = nextNewClass;
}
}
return [defineMetadata(newClass, metadata), function() {
for (var i = 0; i < initializers.length; i++) initializers[i].call(newClass);
}];
}
// The transformer will not emit assignment when there are no class decorators,
// so we don't have to return an empty array here.
}
function defineMetadata(Class, metadata) {
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: true, enumerable: true, value: metadata });
}
/**
Basic usage:
applyDecs(
Class,
[
// member decorators
[
dec, // dec or array of decs
0, // kind of value being decorated
'prop', // name of public prop on class containing the value being decorated,
'#p', // the name of the private property (if is private, void 0 otherwise),
]
],
[
// class decorators
dec1, dec2
]
)
```
Fully transpiled example:
```js
@dec
class Class {
@dec
a = 123;
@dec
#a = 123;
@dec
@dec2
accessor b = 123;
@dec
accessor #b = 123;
@dec
c() { console.log('c'); }
@dec
#c() { console.log('privC'); }
@dec
get d() { console.log('d'); }
@dec
get #d() { console.log('privD'); }
@dec
set e(v) { console.log('e'); }
@dec
set #e(v) { console.log('privE'); }
}
// becomes
let initializeInstance;
let initializeClass;
let initA;
let initPrivA;
let initB;
let initPrivB, getPrivB, setPrivB;
let privC;
let privD;
let privE;
let Class;
class _Class {
static {
let ret = applyDecs(
this,
[
[dec, 0, 'a'],
[dec, 0, 'a', (i) => i.#a, (i, v) => i.#a = v],
[[dec, dec2], 1, 'b'],
[dec, 1, 'b', (i) => i.#privBData, (i, v) => i.#privBData = v],
[dec, 2, 'c'],
[dec, 2, 'c', () => console.log('privC')],
[dec, 3, 'd'],
[dec, 3, 'd', () => console.log('privD')],
[dec, 4, 'e'],
[dec, 4, 'e', () => console.log('privE')],
],
[
dec
]
)
initA = ret[0];
initPrivA = ret[1];
initB = ret[2];
initPrivB = ret[3];
getPrivB = ret[4];
setPrivB = ret[5];
privC = ret[6];
privD = ret[7];
privE = ret[8];
initializeInstance = ret[9];
Class = ret[10]
initializeClass = ret[11];
}
a = (initializeInstance(this), initA(this, 123));
#a = initPrivA(this, 123);
#bData = initB(this, 123);
get b() { return this.#bData }
set b(v) { this.#bData = v }
#privBData = initPrivB(this, 123);
get #b() { return getPrivB(this); }
set #b(v) { setPrivB(this, v); }
c() { console.log('c'); }
#c(...args) { return privC(this, ...args) }
get d() { console.log('d'); }
get #d() { return privD(this); }
set e(v) { console.log('e'); }
set #e(v) { privE(this, v); }
}
initializeClass(Class);
*/
_apply_decs_2203_r = function(targetClass, memberDecs, classDecs, parentClass) {
if (parentClass !== void 0) {
var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
}
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
var e = applyMemberDecs(targetClass, memberDecs, metadata);
if (!classDecs.length) defineMetadata(targetClass, metadata);
return {
e: e,
// Lazily apply class decorations so that member init locals can be properly bound.
get c() {
return applyClassDecs(targetClass, classDecs, metadata);
}
};
};
return _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass);
}
export { _apply_decs_2203_r as _ };
@@ -0,0 +1,27 @@
'use strict';
var $TypeError = require('es-errors/type');
var IteratorStep = require('./IteratorStep');
var IteratorValue = require('./IteratorValue');
var isIteratorRecord = require('../helpers/records/iterator-record');
// https://262.ecma-international.org/15.0/#sec-iteratortolist
module.exports = function IteratorToList(iteratorRecord) {
if (!isIteratorRecord(iteratorRecord)) {
throw new $TypeError('Assertion failed: `iteratorRecord` must be an Iterator Record'); // step 1
}
var values = []; // step 1
var next = true; // step 2
while (next) { // step 3
next = IteratorStep(iteratorRecord); // step 3.a
if (next) {
var nextValue = IteratorValue(next); // step 3.b.i
values[values.length] = nextValue; // step 3.b.ii
}
}
return values; // step 4
};
@@ -0,0 +1,17 @@
/**
* DON'T EDIT THIS FILE.
* This file was generated by "scripts/update-lib-flat-configs.js" script.
*/
"use strict"
module.exports = {
plugins: {
get "es-x"() {
return require("../../index.js")
},
},
rules: {
"es-x/no-intl-locale": "error",
"es-x/no-intl-relativetimeformat": "error",
},
}
@@ -0,0 +1,12 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}
{{# def.numberKeyword }}
{{ var $op = $keyword == 'maxItems' ? '>' : '<'; }}
if ({{# def.$dataNotType:'number' }} {{=$data}}.length {{=$op}} {{=$schemaValue}}) {
{{ var $errorKeyword = $keyword; }}
{{# def.error:'_limitItems' }}
} {{? $breakOnError }} else { {{?}}
@@ -0,0 +1,514 @@
flf2a$ 5 5 14 1 3 0 129 0
BABYFACE Leet by cat, v0.8 2019
gopher:╱╱baud.baby
$$@
$$@
$$@
$$@
$$@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
_______ @
╱ ╲╲@
╱ ╱╱@
╱ ╱ @
╲___╱____╱ @@
_______@
╱╱ ╱@
╱╱ ╲@
╱ ╱@
╲________╱ @@
_______ @
╱╱ ╲@
╱╱ ╱@
╱ --╱ @
╲________╱ @@
______ @
_╱ ╲╲@
╱ ╱╱@
╱ ╱ @
╲________╱ @@
_______ @
╱╱ ╲@
╱╱ ╱@
╱ _╱ @
╲________╱ @@
_______ @
╱╱ ╲@
╱╱ __╱@
╱ _╱ @
╲_______╱ @@
_______ @
╱╱ ╲@
╱╱ __╱@
╱ ╱ ╱ @
╲________╱ @@
_______ @
╱ ╱ ╲╲@
╱ ╱╱@
╱ ╱ @
╲___╱____╱ @@
________ @
╱ ╲@
_╱ ╱ @
╱ ╱ @
╲╲_______╱ @@
______ @
╱ ╲@
╱ ╱@
_╱ ╱╱ @
╲______╱╱ @@
____ ___ @
╱ ╱ ╲@
╱ ╱@
╱╱ _╱ @
╲╲___╱___╱ @@
______ @
╱╱ ╲@
╱╱ ╱@
╱ ╱ @
╲________╱ @@
_______ @
╱ ╲╲@
╱ ╱╱@
╱ ╱ @
╲__╱__╱__╱ @@
_______ @
╱╱ ╱ ╲@
╱╱ ╱@
╱ ╱ @
╲__╱_____╱ @@
_______ @
╱ ╲╲@
╱ ╱╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╲@
╱ ╱@
╱╱ __╱ @
╲╲_____╱ @@
_______ @
╱ ╲╲@
╱ ╱╱@
╲__ ╱ @
╲_____╱ @@
_______ @
╱╱ ╲@
╱╱ ╱@
╱ _╱ @
╲____╱___╱ @@
________ @
╱ ╲@
╱ _╱@
╱- ╱ @
╲_______╱╱ @@
________ @
╱ ╲@
╱ _╱@
╱ ╱ @
╲_____╱╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╱ ╱╱ @
╲_______╱╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╲ ╱ @
╲╲_____╱ @@
________ @
╱ ╱ ╱ ╲@
╱ ╱@
╱╱ ╱ @
╲╲_______╱ @@
________ @
╱ ╱ ╲@
╱_ _╱@
╱ ╱ @
╲___╱___╱╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╲__ ╱╱ @
╲____╱╱ @@
_______ @
╱ ╲╲@
╱- ╱@
╱ _╱ @
╲________╱ @@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
________ @
╱ ╲@
╱ ╱@
╱ ╱ @
╲___╱____╱ @@
________@
╱ ╱@
╱ ╲@
╱ ╱@
╲________╱ @@
________ @
╱ ╲@
╱ ╱@
╱ --╱ @
╲________╱ @@
_______ @
_╱ ╲@
╱ ╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╲@
╱ ╱@
╱ _╱ @
╲________╱ @@
________ @
╱ ╲@
╱ __╱@
╱ _╱ @
╲_______╱ @@
________ @
╱ ╲@
╱ __╱@
╱ ╱ ╱ @
╲________╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╱ ╱ @
╲___╱____╱ @@
________ @
╱ ╲@
_╱ ╱ @
╱ ╱ @
╲________╱ @@
______ @
╱ ╲@
╱ ╱@
_╱ ╱ @
╲_______╱ @@
____ ___ @
╱ ╱ ╲@
╱ ╱@
╱ _╱ @
╲____╱___╱ @@
_______ @
╱ ╲@
╱ ╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╲@
╱ ╱@
╱ ╱ @
╲__╱__╱__╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╱ ╱ @
╲__╱_____╱ @@
________ @
╱ ╲@
╱ ╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╲@
╱ ╱@
╱ __╱ @
╲______╱ @@
________ @
╱ ╲@
╱ ╱@
╲__ ╱ @
╲_____╱ @@
________ @
╱ ╲@
╱ ╱@
╱ _╱ @
╲____╱___╱ @@
________ @
╱ ╲@
╱ _╱@
╱- ╱ @
╲________╱ @@
________ @
╱ ╲@
╱ _╱@
╱ ╱ @
╲______╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╲ ╱ @
╲______╱ @@
________ @
╱ ╱ ╱ ╲@
╱ ╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╱ ╲@
╱_ _╱@
╱ ╱ @
╲___╱____╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╲__ ╱ @
╲_____╱ @@
________ @
╱ ╲@
╱- ╱@
╱ _╱ @
╲________╱ @@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@@ -0,0 +1,33 @@
import * as core from "../core/index.js";
import { type ZodError, ZodRealError } from "./errors.js";
export type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
export type ZodSafeParseSuccess<T> = { success: true; data: T; error?: never };
export type ZodSafeParseError<T> = { success: false; data?: never; error: ZodError<T> };
export const parse: <T extends core.$ZodType>(
schema: T,
value: unknown,
_ctx?: core.ParseContext<core.$ZodIssue>,
_params?: { callee?: core.util.AnyFunc; Err?: core.$ZodErrorClass }
) => core.output<T> = /* @__PURE__ */ core._parse(ZodRealError) as any;
export const parseAsync: <T extends core.$ZodType>(
schema: T,
value: unknown,
_ctx?: core.ParseContext<core.$ZodIssue>,
_params?: { callee?: core.util.AnyFunc; Err?: core.$ZodErrorClass }
) => Promise<core.output<T>> = /* @__PURE__ */ core._parseAsync(ZodRealError) as any;
export const safeParse: <T extends core.$ZodType>(
schema: T,
value: unknown,
_ctx?: core.ParseContext<core.$ZodIssue>
// _params?: { callee?: core.util.AnyFunc; Err?: core.$ZodErrorClass }
) => ZodSafeParseResult<core.output<T>> = /* @__PURE__ */ core._safeParse(ZodRealError) as any;
export const safeParseAsync: <T extends core.$ZodType>(
schema: T,
value: unknown,
_ctx?: core.ParseContext<core.$ZodIssue>
) => Promise<ZodSafeParseResult<core.output<T>>> = /* @__PURE__ */ core._safeParseAsync(ZodRealError) as any;
@@ -0,0 +1,4 @@
import type { Control, FieldValues, FormState, ReadFormState } from '../types';
declare const _default: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(formState: FormState<TFieldValues>, control: Control<TFieldValues, TContext, TTransformedValues>, localProxyFormState?: ReadFormState, isRoot?: boolean) => FormState<TFieldValues>;
export default _default;
//# sourceMappingURL=getProxyFormState.d.ts.map
@@ -0,0 +1 @@
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC,GAED,uFAAuF;AACvF,gGAAgG;;;;;AASzF,SAAS,yCAAc,IAAiB;IAC7C,OAAO,0CAAW,MAAM,IAAI,CAAA,GAAA,yCAAgB;IAC5C,IAAI,OAAO,CAAA,GAAA,yCAAc,EAAE,KAAK,GAAG,EAAE,KAAK,IAAI;IAC9C,OAAO,qCAAe,MAAM,KAAK,KAAK,EAAE,KAAK,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW;AACzG;AAEA,SAAS,qCAAe,IAAY,EAAE,KAAa,EAAE,GAAW,EAAE,IAAY,EAAE,MAAc,EAAE,MAAc,EAAE,WAAmB;IACjI,sEAAsE;IACtE,gCAAgC;IAChC,IAAI,OAAO,IAAI;IACf,KAAK,WAAW,CAAC,MAAM,QAAQ,QAAQ;IACvC,KAAK,cAAc,CAAC,MAAM,QAAQ,GAAG;IACrC,OAAO,KAAK,OAAO;AACrB;AAEO,SAAS,0CAAkB,EAAU,EAAE,QAAgB;IAC5D,qBAAqB;IACrB,IAAI,aAAa,OACf,OAAO;IAGT,6DAA6D;IAC7D,IAAI,KAAK,KAAK,aAAa,CAAA,GAAA,yCAAe,KACxC,OAAO,IAAI,KAAK,IAAI,iBAAiB,KAA9B;IAGT,IAAI,QAAC,IAAI,SAAE,KAAK,OAAE,GAAG,QAAE,IAAI,UAAE,MAAM,UAAE,MAAM,EAAC,GAAG,uCAAiB,IAAI;IACpE,IAAI,MAAM,qCAAe,MAAM,OAAO,KAAK,MAAM,QAAQ,QAAQ;IACjE,OAAO,MAAM,KAAK,KAAK,CAAC,KAAK,QAAQ;AACvC;AAEA,MAAM,6CAAuB,IAAI;AAEjC,SAAS,uCAAiB,EAAU,EAAE,QAAgB;IACpD,IAAI,YAAY,2CAAqB,GAAG,CAAC;IACzC,IAAI,CAAC,WAAW;QACd,YAAY,IAAI,KAAK,cAAc,CAAC,SAAS;sBAC3C;YACA,QAAQ;YACR,KAAK;YACL,MAAM;YACN,OAAO;YACP,KAAK;YACL,MAAM;YACN,QAAQ;YACR,QAAQ;QACV;QAEA,2CAAqB,GAAG,CAAC,UAAU;IACrC;IAEA,IAAI,QAAQ,UAAU,aAAa,CAAC,IAAI,KAAK;IAC7C,IAAI,aAAuC,CAAC;IAC5C,KAAK,IAAI,QAAQ,MACf,IAAI,KAAK,IAAI,KAAK,WAChB,UAAU,CAAC,KAAK,IAAI,CAAC,GAAG,KAAK,KAAK;IAKtC,OAAO;QACL,0FAA0F;QAC1F,MAAM,WAAW,GAAG,KAAK,QAAQ,WAAW,GAAG,KAAK,MAAM,CAAC,WAAW,IAAI,GAAG,IAAI,CAAC,WAAW,IAAI;QACjG,OAAO,CAAC,WAAW,KAAK;QACxB,KAAK,CAAC,WAAW,GAAG;QACpB,MAAM,WAAW,IAAI,KAAK,OAAO,IAAI,CAAC,WAAW,IAAI;QACrD,QAAQ,CAAC,WAAW,MAAM;QAC1B,QAAQ,CAAC,WAAW,MAAM;IAC5B;AACF;AAEA,MAAM,kCAAY;AAEX,SAAS,0CAAkB,IAAsB,EAAE,QAAgB;IACxE,IAAI,KAAK,yCAAc;IACvB,IAAI,UAAU,KAAK,0CAAkB,KAAK,iCAAW;IACrD,IAAI,QAAQ,KAAK,0CAAkB,KAAK,iCAAW;IACnD,OAAO,wCAAkB,MAAM,UAAU,SAAS;AACpD;AAEA,SAAS,wCAAkB,IAAsB,EAAE,QAAgB,EAAE,OAAe,EAAE,KAAa;IACjG,IAAI,QAAQ,YAAY,QAAQ;QAAC;KAAQ,GAAG;QAAC;QAAS;KAAM;IAC5D,OAAO,MAAM,MAAM,CAAC,CAAA,WAAY,sCAAgB,MAAM,UAAU;AAClE;AAEA,SAAS,sCAAgB,IAAsB,EAAE,QAAgB,EAAE,QAAgB;IACjF,IAAI,QAAQ,uCAAiB,UAAU;IACvC,OAAO,KAAK,IAAI,KAAK,MAAM,IAAI,IAC1B,KAAK,KAAK,KAAK,MAAM,KAAK,IAC1B,KAAK,GAAG,KAAK,MAAM,GAAG,IACtB,KAAK,IAAI,KAAK,MAAM,IAAI,IACxB,KAAK,MAAM,KAAK,MAAM,MAAM,IAC5B,KAAK,MAAM,KAAK,MAAM,MAAM;AACnC;AAEO,SAAS,0CAAW,IAAqC,EAAE,QAAgB,EAAE,iBAAiC,YAAY;IAC/H,IAAI,WAAW,0CAAmB;IAElC,uDAAuD;IACvD,IAAI,aAAa,OACf,OAAO,yCAAc;IAGvB,uGAAuG;IACvG,IAAI,aAAa,CAAA,GAAA,yCAAe,OAAO,mBAAmB,cAAc;QACtE,WAAW,0CAAW,UAAU,IAAI,CAAA,GAAA,yCAAgB;QAEpD,+FAA+F;QAC/F,IAAI,OAAO,IAAI;QACf,IAAI,OAAO,CAAA,GAAA,yCAAc,EAAE,SAAS,GAAG,EAAE,SAAS,IAAI;QACtD,KAAK,WAAW,CAAC,MAAM,SAAS,KAAK,GAAG,GAAG,SAAS,GAAG;QACvD,KAAK,QAAQ,CAAC,SAAS,IAAI,EAAE,SAAS,MAAM,EAAE,SAAS,MAAM,EAAE,SAAS,WAAW;QACnF,OAAO,KAAK,OAAO;IACrB;IAEA,IAAI,KAAK,yCAAc;IACvB,IAAI,eAAe,0CAAkB,KAAK,iCAAW;IACrD,IAAI,cAAc,0CAAkB,KAAK,iCAAW;IACpD,IAAI,QAAQ,wCAAkB,UAAU,UAAU,KAAK,cAAc,KAAK;IAE1E,IAAI,MAAM,MAAM,KAAK,GACnB,OAAO,KAAK,CAAC,EAAE;IAGjB,IAAI,MAAM,MAAM,GAAG,GACjB,OAAQ;QACN,2DAA2D;QAC3D,KAAK;QACL,KAAK;YACH,OAAO,KAAK,CAAC,EAAE;QACjB,KAAK;YACH,OAAO,KAAK,CAAC,MAAM,MAAM,GAAG,EAAE;QAChC,KAAK;YACH,MAAM,IAAI,WAAW;IACzB;IAGF,OAAQ;QACN,KAAK;YACH,OAAO,KAAK,GAAG,CAAC,KAAK,cAAc,KAAK;QAC1C,8DAA8D;QAC9D,KAAK;QACL,KAAK;YACH,OAAO,KAAK,GAAG,CAAC,KAAK,cAAc,KAAK;QAC1C,KAAK;YACH,MAAM,IAAI,WAAW;IACzB;AACF;AAEO,SAAS,0CAAO,QAAyC,EAAE,QAAgB,EAAE,iBAAiC,YAAY;IAC/H,OAAO,IAAI,KAAK,0CAAW,UAAU,UAAU;AACjD;AAKO,SAAS,0CAAa,EAAU,EAAE,QAAgB;IACvD,IAAI,SAAS,0CAAkB,IAAI;IACnC,IAAI,OAAO,IAAI,KAAK,KAAK;IACzB,IAAI,OAAO,KAAK,cAAc;IAC9B,IAAI,QAAQ,KAAK,WAAW,KAAK;IACjC,IAAI,MAAM,KAAK,UAAU;IACzB,IAAI,OAAO,KAAK,WAAW;IAC3B,IAAI,SAAS,KAAK,aAAa;IAC/B,IAAI,SAAS,KAAK,aAAa;IAC/B,IAAI,cAAc,KAAK,kBAAkB;IAEzC,OAAO,IAAI,CAAA,GAAA,yCAAY,EAAE,OAAO,IAAI,OAAO,MAAM,OAAO,IAAI,CAAC,OAAO,IAAI,MAAM,OAAO,KAAK,UAAU,QAAQ,MAAM,QAAQ,QAAQ;AACpI;AAKO,SAAS,0CAAS,IAAU,EAAE,QAAgB;IACnD,OAAO,0CAAa,KAAK,OAAO,IAAI;AACtC;AAEO,SAAS,0CAAgB,IAAU;IACxC,OAAO,0CAAS,MAAM,CAAA,GAAA,yCAAe;AACvC;AAGO,SAAS,0CAAe,QAAyB;IACtD,OAAO,IAAI,CAAA,GAAA,yCAAW,EAAE,SAAS,QAAQ,EAAE,SAAS,GAAG,EAAE,SAAS,IAAI,EAAE,SAAS,KAAK,EAAE,SAAS,GAAG;AACtG;AAEO,SAAS,0CAAa,IAAqB;IAChD,OAAO;QACL,KAAK,KAAK,GAAG;QACb,MAAM,KAAK,IAAI;QACf,OAAO,KAAK,KAAK;QACjB,KAAK,KAAK,GAAG;IACf;AACF;AAEO,SAAS,0CAAa,IAAa;IACxC,OAAO;QACL,MAAM,KAAK,IAAI;QACf,QAAQ,KAAK,MAAM;QACnB,QAAQ,KAAK,MAAM;QACnB,aAAa,KAAK,WAAW;IAC/B;AACF;AAMO,SAAS,0CAAmB,IAAqD,EAAE,IAAc;IACtG,IAAI,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,cAAc;IACpD,IAAI,cAAc,MACf,CAAA,QAAC,IAAI,UAAE,MAAM,UAAE,MAAM,eAAE,WAAW,EAAC,GAAG,IAAG;SACrC,IAAI,UAAU,QAAQ,CAAC,MAC5B,OAAO;IAGT,IAAI,MACD,CAAA,QAAC,IAAI,UAAE,MAAM,UAAE,MAAM,eAAE,WAAW,EAAC,GAAG,IAAG;IAG5C,OAAO,IAAI,CAAA,GAAA,yCAAe,EACxB,KAAK,QAAQ,EACb,KAAK,GAAG,EACR,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,GAAG,EACR,MACA,QACA,QACA;AAEJ;AAGO,SAAS,0CAAO,QAA0C;IAC/D,OAAO,IAAI,CAAA,GAAA,wCAAG,EAAE,SAAS,IAAI,EAAE,SAAS,MAAM,EAAE,SAAS,MAAM,EAAE,SAAS,WAAW;AACvF;AAGO,SAAS,0CAAsC,IAAO,EAAE,QAAkB;IAC/E,IAAI,KAAK,QAAQ,CAAC,UAAU,KAAK,SAAS,UAAU,EAClD,OAAO;IAGT,IAAI,eAAe,SAAS,aAAa,CAAC,KAAK,QAAQ,CAAC,WAAW,CAAC;IACpE,IAAI,OAAmB,KAAK,IAAI;IAChC,KAAK,QAAQ,GAAG;IAChB,KAAK,Line truncated
@@ -0,0 +1,36 @@
"use client";
import {
CheckboxIcon
} from "./chunk-FFVF7OUL.mjs";
import {
useCheckbox
} from "./chunk-VBM6YDUQ.mjs";
// src/checkbox.tsx
import { forwardRef } from "@heroui/system";
import { cloneElement } from "react";
import { jsx, jsxs } from "react/jsx-runtime";
var Checkbox = forwardRef((props, ref) => {
const {
Component,
children,
icon = /* @__PURE__ */ jsx(CheckboxIcon, {}),
getBaseProps,
getWrapperProps,
getInputProps,
getIconProps,
getLabelProps
} = useCheckbox({ ...props, ref });
const clonedIcon = typeof icon === "function" ? icon(getIconProps()) : cloneElement(icon, getIconProps());
return /* @__PURE__ */ jsxs(Component, { ...getBaseProps(), children: [
/* @__PURE__ */ jsx("input", { ...getInputProps() }),
/* @__PURE__ */ jsx("span", { ...getWrapperProps(), children: clonedIcon }),
children && /* @__PURE__ */ jsx("span", { ...getLabelProps(), children })
] });
});
Checkbox.displayName = "HeroUI.Checkbox";
var checkbox_default = Checkbox;
export {
checkbox_default
};
@@ -0,0 +1 @@
module.exports={A:{A:{"132":"K D E F A B wC"},B:{"132":"C L M G N O P","388":"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:{"1":"4 5 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","132":"0 1 2 3 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 0C 1C"},D:{"132":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB","388":"0 1 2 3 4 5 jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC"},E:{"1":"QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","132":"J ZB K D E F A B C L M G 2C ZC 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD"},F:{"132":"6 7 8 9 F B C G N O P aB AB FD GD HD ID NC uC JD OC","388":"0 1 2 3 4 5 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:{"1":"QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","132":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD"},H:{"132":"hD"},I:{"132":"TC J iD jD kD lD vC mD nD","388":"I"},J:{"132":"D A"},K:{"132":"A B C NC uC OC","388":"H"},L:{"388":"I"},M:{"1":"MC"},N:{"132":"A B"},O:{"388":"PC"},P:{"132":"J","388":"6 7 8 9 AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"388":"zD"},R:{"388":"0D"},S:{"132":"1D 2D"}},B:4,C:"CSS text-indent",D:true};
@@ -0,0 +1,80 @@
'use strict';
module.exports = function generate_multipleOf(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 $isData = it.opts.$data && $schema && $schema.$data,
$schemaValue;
if ($isData) {
out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
$schemaValue = 'schema' + $lvl;
} else {
$schemaValue = $schema;
}
if (!($isData || typeof $schema == 'number')) {
throw new Error($keyword + ' must be number');
}
out += 'var division' + ($lvl) + ';if (';
if ($isData) {
out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || ';
}
out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', ';
if (it.opts.multipleOfPrecision) {
out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' ';
} else {
out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') ';
}
out += ' ) ';
if ($isData) {
out += ' ) ';
}
out += ' ) { ';
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = ''; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } ';
if (it.opts.messages !== false) {
out += ' , message: \'should be multiple of ';
if ($isData) {
out += '\' + ' + ($schemaValue);
} else {
out += '' + ($schemaValue) + '\'';
}
}
if (it.opts.verbose) {
out += ' , schema: ';
if ($isData) {
out += 'validate.schema' + ($schemaPath);
} else {
out += '' + ($schema);
}
out += ' , 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++; ';
}
out += '} ';
if ($breakOnError) {
out += ' else { ';
}
return out;
}
@@ -0,0 +1,99 @@
import { JsonTypeBuilder } from './json.mjs';
import { Argument } from '../argument/index.mjs';
import { AsyncIterator } from '../async-iterator/index.mjs';
import { Awaited } from '../awaited/index.mjs';
import { BigInt } from '../bigint/index.mjs';
import { Constructor } from '../constructor/index.mjs';
import { ConstructorParameters } from '../constructor-parameters/index.mjs';
import { Date } from '../date/index.mjs';
import { Function as FunctionType } from '../function/index.mjs';
import { InstanceType } from '../instance-type/index.mjs';
import { Instantiate } from '../instantiate/index.mjs';
import { Iterator } from '../iterator/index.mjs';
import { Parameters } from '../parameters/index.mjs';
import { Promise } from '../promise/index.mjs';
import { RegExp } from '../regexp/index.mjs';
import { ReturnType } from '../return-type/index.mjs';
import { Symbol } from '../symbol/index.mjs';
import { Uint8Array } from '../uint8array/index.mjs';
import { Undefined } from '../undefined/index.mjs';
import { Void } from '../void/index.mjs';
/** JavaScript Type Builder with Static Resolution for TypeScript */
export class JavaScriptTypeBuilder extends JsonTypeBuilder {
/** `[JavaScript]` Creates a Generic Argument Type */
Argument(index) {
return Argument(index);
}
/** `[JavaScript]` Creates a AsyncIterator type */
AsyncIterator(items, options) {
return AsyncIterator(items, options);
}
/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */
Awaited(schema, options) {
return Awaited(schema, options);
}
/** `[JavaScript]` Creates a BigInt type */
BigInt(options) {
return BigInt(options);
}
/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */
ConstructorParameters(schema, options) {
return ConstructorParameters(schema, options);
}
/** `[JavaScript]` Creates a Constructor type */
Constructor(parameters, instanceType, options) {
return Constructor(parameters, instanceType, options);
}
/** `[JavaScript]` Creates a Date type */
Date(options = {}) {
return Date(options);
}
/** `[JavaScript]` Creates a Function type */
Function(parameters, returnType, options) {
return FunctionType(parameters, returnType, options);
}
/** `[JavaScript]` Extracts the InstanceType from the given Constructor type */
InstanceType(schema, options) {
return InstanceType(schema, options);
}
/** `[JavaScript]` Instantiates a type with the given parameters */
Instantiate(schema, parameters) {
return Instantiate(schema, parameters);
}
/** `[JavaScript]` Creates an Iterator type */
Iterator(items, options) {
return Iterator(items, options);
}
/** `[JavaScript]` Extracts the Parameters from the given Function type */
Parameters(schema, options) {
return Parameters(schema, options);
}
/** `[JavaScript]` Creates a Promise type */
Promise(item, options) {
return Promise(item, options);
}
/** `[JavaScript]` Creates a RegExp type */
RegExp(unresolved, options) {
return RegExp(unresolved, options);
}
/** `[JavaScript]` Extracts the ReturnType from the given Function type */
ReturnType(type, options) {
return ReturnType(type, options);
}
/** `[JavaScript]` Creates a Symbol type */
Symbol(options) {
return Symbol(options);
}
/** `[JavaScript]` Creates a Undefined type */
Undefined(options) {
return Undefined(options);
}
/** `[JavaScript]` Creates a Uint8Array type */
Uint8Array(options) {
return Uint8Array(options);
}
/** `[JavaScript]` Creates a Void type */
Void(options) {
return Void(options);
}
}
@@ -0,0 +1,8 @@
{
"branch": "pull/18344",
"buildNumber": "106499",
"checksum": "7fe5a2e",
"commit": "da834083c",
"environment": "ci",
"reactVersion": "16.12.0-da834083c"
}
@@ -0,0 +1,754 @@
import path from 'node:path';
import { TSESTree } from '@typescript-eslint/types';
import eslintUnsupportedApi from 'eslint/use-at-your-own-risk';
import { ExportMap, recursivePatternCapture, createRule, resolve, getFileExtensions, readPkgUp, visit, getValue, } from '../utils/index.js';
const { FileEnumerator, shouldUseFlatConfig } = eslintUnsupportedApi;
function listFilesUsingFileEnumerator(src, extensions) {
const { ESLINT_USE_FLAT_CONFIG } = process.env;
let isUsingFlatConfig;
try {
isUsingFlatConfig =
shouldUseFlatConfig && ESLINT_USE_FLAT_CONFIG !== 'false';
}
catch {
isUsingFlatConfig =
!!ESLINT_USE_FLAT_CONFIG && ESLINT_USE_FLAT_CONFIG !== 'false';
}
const enumerator = new FileEnumerator({ extensions });
try {
return Array.from(enumerator.iterateFiles(src), ({ filePath, ignored }) => ({ filename: filePath, ignored }));
}
catch (error) {
if (isUsingFlatConfig &&
error.message.includes('No ESLint configuration found')) {
throw new Error(`
Due to the exclusion of certain internal ESLint APIs when using flat config,
the import-x/no-unused-modules rule requires an .eslintrc file (even empty) to know which
files to ignore (even when using flat config).
The .eslintrc file only needs to contain "ignorePatterns", or can be empty if
you do not want to ignore any files.
See https://github.com/import-js/eslint-plugin-import/issues/3079
for additional context.
`);
}
throw error;
}
}
const DEFAULT = 'default';
const { AST_NODE_TYPES } = TSESTree;
function forEachDeclarationIdentifier(declaration, cb) {
if (declaration) {
const isTypeDeclaration = declaration.type === AST_NODE_TYPES.TSInterfaceDeclaration ||
declaration.type === AST_NODE_TYPES.TSTypeAliasDeclaration ||
declaration.type === AST_NODE_TYPES.TSEnumDeclaration;
if (declaration.type === AST_NODE_TYPES.FunctionDeclaration ||
declaration.type === AST_NODE_TYPES.ClassDeclaration ||
isTypeDeclaration) {
cb(declaration.id.name, isTypeDeclaration);
}
else if (declaration.type === AST_NODE_TYPES.VariableDeclaration) {
for (const { id } of declaration.declarations) {
if (id.type === AST_NODE_TYPES.ObjectPattern) {
recursivePatternCapture(id, pattern => {
if (pattern.type === AST_NODE_TYPES.Identifier) {
cb(pattern.name, false);
}
});
}
else if (id.type === AST_NODE_TYPES.ArrayPattern) {
for (const el of id.elements) {
if (el?.type === AST_NODE_TYPES.Identifier) {
cb(el.name, false);
}
}
}
else {
cb(id.name, false);
}
}
}
}
}
const importList = new Map();
const exportList = new Map();
const visitorKeyMap = new Map();
const ignoredFiles = new Set();
const filesOutsideSrc = new Set();
const isNodeModule = (path) => /([/\\])(node_modules)\1/.test(path);
const resolveFiles = (src, ignoreExports, context) => {
const extensions = [...getFileExtensions(context.settings)];
const srcFileList = listFilesUsingFileEnumerator(src, extensions);
const ignoredFilesList = listFilesUsingFileEnumerator(ignoreExports, extensions);
for (const { filename } of ignoredFilesList)
ignoredFiles.add(filename);
return new Set(srcFileList.flatMap(({ filename }) => isNodeModule(filename) ? [] : filename));
};
const prepareImportsAndExports = (srcFiles, context) => {
const exportAll = new Map();
for (const file of srcFiles) {
const exports = new Map();
const imports = new Map();
const currentExports = ExportMap.get(file, context);
if (currentExports) {
const { dependencies, reexports, imports: localImportList, namespace, visitorKeys, } = currentExports;
visitorKeyMap.set(file, visitorKeys);
const currentExportAll = new Set();
for (const getDependency of dependencies) {
const dependency = getDependency();
if (dependency === null) {
continue;
}
currentExportAll.add(dependency.path);
}
exportAll.set(file, currentExportAll);
for (const [key, value] of reexports.entries()) {
if (key === DEFAULT) {
exports.set(AST_NODE_TYPES.ImportDefaultSpecifier, {
whereUsed: new Set(),
});
}
else {
exports.set(key, { whereUsed: new Set() });
}
const reexport = value.getImport();
if (!reexport) {
continue;
}
let localImport = imports.get(reexport.path);
const currentValue = value.local === DEFAULT
? AST_NODE_TYPES.ImportDefaultSpecifier
: value.local;
localImport =
localImport === undefined
? new Set([currentValue])
: new Set([...localImport, currentValue]);
imports.set(reexport.path, localImport);
}
for (const [key, value] of localImportList.entries()) {
if (isNodeModule(key)) {
continue;
}
const localImport = imports.get(key) || new Set();
for (const { importedSpecifiers } of value.declarations) {
for (const specifier of importedSpecifiers) {
localImport.add(specifier);
}
}
imports.set(key, localImport);
}
importList.set(file, imports);
if (ignoredFiles.has(file)) {
continue;
}
for (const [key, _value] of namespace.entries()) {
if (key === DEFAULT) {
exports.set(AST_NODE_TYPES.ImportDefaultSpecifier, {
whereUsed: new Set(),
});
}
else {
exports.set(key, { whereUsed: new Set() });
}
}
}
exports.set(AST_NODE_TYPES.ExportAllDeclaration, {
whereUsed: new Set(),
});
exports.set(AST_NODE_TYPES.ImportNamespaceSpecifier, {
whereUsed: new Set(),
});
exportList.set(file, exports);
}
for (const [key, value] of exportAll.entries()) {
for (const val of value) {
const currentExports = exportList.get(val);
if (currentExports) {
const currentExport = currentExports.get(AST_NODE_TYPES.ExportAllDeclaration);
currentExport.whereUsed.add(key);
}
}
}
};
const determineUsage = () => {
for (const [listKey, listValue] of importList.entries()) {
for (const [key, value] of listValue.entries()) {
const exports = exportList.get(key);
if (exports !== undefined) {
for (const currentImport of value) {
let specifier;
if (currentImport === AST_NODE_TYPES.ImportNamespaceSpecifier) {
specifier = AST_NODE_TYPES.ImportNamespaceSpecifier;
}
else if (currentImport === AST_NODE_TYPES.ImportDefaultSpecifier) {
specifier = AST_NODE_TYPES.ImportDefaultSpecifier;
}
else {
specifier = currentImport;
}
if (specifier !== undefined) {
const exportStatement = exports.get(specifier);
if (exportStatement !== undefined) {
const { whereUsed } = exportStatement;
whereUsed.add(listKey);
exports.set(specifier, { whereUsed });
}
}
}
}
}
}
};
let srcFiles;
let lastPrepareKey;
const doPreparation = (src, ignoreExports, context) => {
const prepareKey = JSON.stringify({
src: src.sort(),
ignoreExports: (ignoreExports || []).sort(),
extensions: [...getFileExtensions(context.settings)].sort(),
});
if (prepareKey === lastPrepareKey) {
return;
}
importList.clear();
exportList.clear();
ignoredFiles.clear();
filesOutsideSrc.clear();
srcFiles = resolveFiles(src, ignoreExports, context);
prepareImportsAndExports(srcFiles, context);
determineUsage();
lastPrepareKey = prepareKey;
};
const newNamespaceImportExists = (specifiers) => specifiers.some(({ type }) => type === AST_NODE_TYPES.ImportNamespaceSpecifier);
const newDefaultImportExists = (specifiers) => specifiers.some(({ type }) => type === AST_NODE_TYPES.ImportDefaultSpecifier);
const fileIsInPkg = (file) => {
const { pkg, path: pkgPath } = readPkgUp({ cwd: file });
const basePath = path.dirname(pkgPath);
const checkPkgFieldString = (pkgField) => {
if (path.join(basePath, pkgField) === file) {
return true;
}
};
const checkPkgFieldObject = (pkgField) => {
const pkgFieldFiles = Object.values(pkgField).flatMap(value => typeof value === 'boolean' ? [] : path.join(basePath, value));
if (pkgFieldFiles.includes(file)) {
return true;
}
};
const checkPkgField = (pkgField) => {
if (typeof pkgField === 'string') {
return checkPkgFieldString(pkgField);
}
if (typeof pkgField === 'object') {
return checkPkgFieldObject(pkgField);
}
};
if (!pkg) {
return false;
}
if (pkg.private === true) {
return false;
}
if (pkg.bin && checkPkgField(pkg.bin)) {
return true;
}
if (pkg.browser && checkPkgField(pkg.browser)) {
return true;
}
if (pkg.main && checkPkgFieldString(pkg.main)) {
return true;
}
return false;
};
export default createRule({
name: 'no-unused-modules',
meta: {
type: 'suggestion',
docs: {
category: 'Helpful warnings',
description: 'Forbid modules without exports, or exports without matching import in another module.',
},
schema: [
{
type: 'object',
properties: {
src: {
description: 'files/paths to be analyzed (only for unused exports)',
type: 'array',
uniqueItems: true,
items: {
type: 'string',
minLength: 1,
},
},
ignoreExports: {
description: 'files/paths for which unused exports will not be reported (e.g module entry points)',
type: 'array',
uniqueItems: true,
items: {
type: 'string',
minLength: 1,
},
},
missingExports: {
description: 'report modules without any exports',
type: 'boolean',
},
unusedExports: {
description: 'report exports without any usage',
type: 'boolean',
},
ignoreUnusedTypeExports: {
description: 'ignore type exports without any usage',
type: 'boolean',
},
},
anyOf: [
{
type: 'object',
properties: {
unusedExports: {
type: 'boolean',
enum: [true],
},
src: {
type: 'array',
minItems: 1,
},
},
required: ['unusedExports'],
},
{
type: 'object',
properties: {
missingExports: {
type: 'boolean',
enum: [true],
},
},
required: ['missingExports'],
},
],
},
],
messages: {
notFound: 'No exports found',
unused: "exported declaration '{{value}}' not used within other modules",
},
},
defaultOptions: [],
create(context) {
const { src = [process.cwd()], ignoreExports = [], missingExports, unusedExports, ignoreUnusedTypeExports, } = context.options[0] || {};
if (unusedExports) {
doPreparation(src, ignoreExports, context);
}
const filename = context.physicalFilename;
const checkExportPresence = (node) => {
if (!missingExports) {
return;
}
if (ignoreUnusedTypeExports) {
return;
}
if (ignoredFiles.has(filename)) {
return;
}
const exportCount = exportList.get(filename);
const exportAll = exportCount.get(AST_NODE_TYPES.ExportAllDeclaration);
const namespaceImports = exportCount.get(AST_NODE_TYPES.ImportNamespaceSpecifier);
exportCount.delete(AST_NODE_TYPES.ExportAllDeclaration);
exportCount.delete(AST_NODE_TYPES.ImportNamespaceSpecifier);
if (exportCount.size === 0) {
context.report({
node: node.body[0] ?? node,
messageId: 'notFound',
});
}
exportCount.set(AST_NODE_TYPES.ExportAllDeclaration, exportAll);
exportCount.set(AST_NODE_TYPES.ImportNamespaceSpecifier, namespaceImports);
};
const checkUsage = (node, exportedValue, isTypeExport) => {
if (!unusedExports) {
return;
}
if (isTypeExport && ignoreUnusedTypeExports) {
return;
}
if (ignoredFiles.has(filename)) {
return;
}
if (fileIsInPkg(filename)) {
return;
}
if (filesOutsideSrc.has(filename)) {
return;
}
if (!srcFiles.has(filename)) {
srcFiles = resolveFiles(src, ignoreExports, context);
if (!srcFiles.has(filename)) {
filesOutsideSrc.add(filename);
return;
}
}
const exports = exportList.get(filename);
if (!exports) {
console.error(`file \`${filename}\` has no exports. Please update to the latest, and if it still happens, report this on https://github.com/import-js/eslint-plugin-import/issues/2866!`);
return;
}
const exportAll = exports.get(AST_NODE_TYPES.ExportAllDeclaration);
if (exportAll !== undefined &&
exportedValue !== AST_NODE_TYPES.ImportDefaultSpecifier &&
exportAll.whereUsed.size > 0) {
return;
}
const namespaceImports = exports.get(AST_NODE_TYPES.ImportNamespaceSpecifier);
if (namespaceImports !== undefined &&
namespaceImports.whereUsed.size > 0) {
return;
}
const exportsKey = exportedValue === DEFAULT
? AST_NODE_TYPES.ImportDefaultSpecifier
: exportedValue;
const exportStatement = exports.get(exportsKey);
const value = exportsKey === AST_NODE_TYPES.ImportDefaultSpecifier
? DEFAULT
: exportsKey;
if (exportStatement === undefined) {
context.report({
node,
messageId: 'unused',
data: {
value,
},
});
}
else {
if (exportStatement.whereUsed.size === 0) {
context.report({
node,
messageId: 'unused',
data: {
value,
},
});
}
}
};
const updateExportUsage = (node) => {
if (ignoredFiles.has(filename)) {
return;
}
const exports = exportList.get(filename) ??
new Map();
const newExports = new Map();
const newExportIdentifiers = new Set();
for (const s of node.body) {
if (s.type === AST_NODE_TYPES.ExportDefaultDeclaration) {
newExportIdentifiers.add(AST_NODE_TYPES.ImportDefaultSpecifier);
}
if (s.type === AST_NODE_TYPES.ExportNamedDeclaration) {
if (s.specifiers.length > 0) {
for (const specifier of s.specifiers) {
if (specifier.exported) {
newExportIdentifiers.add(getValue(specifier.exported));
}
}
}
forEachDeclarationIdentifier(s.declaration, name => {
newExportIdentifiers.add(name);
});
}
}
for (const [key, value] of exports.entries()) {
if (newExportIdentifiers.has(key)) {
newExports.set(key, value);
}
}
for (const key of newExportIdentifiers) {
if (!exports.has(key)) {
newExports.set(key, { whereUsed: new Set() });
}
}
const exportAll = exports.get(AST_NODE_TYPES.ExportAllDeclaration);
const namespaceImports = exports.get(AST_NODE_TYPES.ImportNamespaceSpecifier) ?? { whereUsed: new Set() };
newExports.set(AST_NODE_TYPES.ExportAllDeclaration, exportAll);
newExports.set(AST_NODE_TYPES.ImportNamespaceSpecifier, namespaceImports);
exportList.set(filename, newExports);
};
const updateImportUsage = (node) => {
if (!unusedExports) {
return;
}
const oldImportPaths = importList.get(filename) ?? new Map();
const oldNamespaceImports = new Set();
const newNamespaceImports = new Set();
const oldExportAll = new Set();
const newExportAll = new Set();
const oldDefaultImports = new Set();
const newDefaultImports = new Set();
const oldImports = new Map();
const newImports = new Map();
for (const [key, value] of oldImportPaths.entries()) {
if (value.has(AST_NODE_TYPES.ExportAllDeclaration)) {
oldExportAll.add(key);
}
if (value.has(AST_NODE_TYPES.ImportNamespaceSpecifier)) {
oldNamespaceImports.add(key);
}
if (value.has(AST_NODE_TYPES.ImportDefaultSpecifier)) {
oldDefaultImports.add(key);
}
for (const val of value) {
if (val !== AST_NODE_TYPES.ImportNamespaceSpecifier &&
val !== AST_NODE_TYPES.ImportDefaultSpecifier) {
oldImports.set(val, key);
}
}
}
function processDynamicImport(source) {
if (source.type !== 'Literal' || typeof source.value !== 'string') {
return null;
}
const p = resolve(source.value, context);
if (p == null) {
return null;
}
newNamespaceImports.add(p);
}
visit(node, visitorKeyMap.get(filename), {
ImportExpression(child) {
processDynamicImport(child.source);
},
CallExpression(child_) {
const child = child_;
if (child.callee.type === 'Import') {
processDynamicImport(child.arguments[0]);
}
},
});
for (const astNode of node.body) {
let resolvedPath;
if (astNode.type === AST_NODE_TYPES.ExportNamedDeclaration &&
astNode.source) {
resolvedPath = resolve(astNode.source.raw.replaceAll(/('|")/g, ''), context);
for (const specifier of astNode.specifiers) {
const name = getValue(specifier.local);
if (name === DEFAULT) {
newDefaultImports.add(resolvedPath);
}
else {
newImports.set(name, resolvedPath);
}
}
}
if (astNode.type === AST_NODE_TYPES.ExportAllDeclaration) {
resolvedPath = resolve(astNode.source.raw.replaceAll(/('|")/g, ''), context);
newExportAll.add(resolvedPath);
}
if (astNode.type === AST_NODE_TYPES.ImportDeclaration) {
resolvedPath = resolve(astNode.source.raw.replaceAll(/('|")/g, ''), context);
if (!resolvedPath) {
continue;
}
if (isNodeModule(resolvedPath)) {
continue;
}
if (newNamespaceImportExists(astNode.specifiers)) {
newNamespaceImports.add(resolvedPath);
}
if (newDefaultImportExists(astNode.specifiers)) {
newDefaultImports.add(resolvedPath);
}
for (const specifier of astNode.specifiers.filter(specifier => specifier.type !== AST_NODE_TYPES.ImportDefaultSpecifier &&
specifier.type !== AST_NODE_TYPES.ImportNamespaceSpecifier)) {
if ('imported' in specifier) {
newImports.set(getValue(specifier.imported), resolvedPath);
}
}
}
}
for (const value of newExportAll) {
if (!oldExportAll.has(value)) {
const imports = oldImportPaths.get(value) ?? new Set();
imports.add(AST_NODE_TYPES.ExportAllDeclaration);
oldImportPaths.set(value, imports);
let exports = exportList.get(value);
let currentExport;
if (exports === undefined) {
exports = new Map();
exportList.set(value, exports);
}
else {
currentExport = exports.get(AST_NODE_TYPES.ExportAllDeclaration);
}
if (currentExport === undefined) {
const whereUsed = new Set();
whereUsed.add(filename);
exports.set(AST_NODE_TYPES.ExportAllDeclaration, {
whereUsed,
});
}
else {
currentExport.whereUsed.add(filename);
}
}
}
for (const value of oldExportAll) {
if (!newExportAll.has(value)) {
const imports = oldImportPaths.get(value);
imports.delete(AST_NODE_TYPES.ExportAllDeclaration);
const exports = exportList.get(value);
if (exports !== undefined) {
const currentExport = exports.get(AST_NODE_TYPES.ExportAllDeclaration);
if (currentExport !== undefined) {
currentExport.whereUsed.delete(filename);
}
}
}
}
for (const value of newDefaultImports) {
if (!oldDefaultImports.has(value)) {
let imports = oldImportPaths.get(value);
if (imports === undefined) {
imports = new Set();
}
imports.add(AST_NODE_TYPES.ImportDefaultSpecifier);
oldImportPaths.set(value, imports);
let exports = exportList.get(value);
let currentExport;
if (exports === undefined) {
exports = new Map();
exportList.set(value, exports);
}
else {
currentExport = exports.get(AST_NODE_TYPES.ImportDefaultSpecifier);
}
if (currentExport === undefined) {
const whereUsed = new Set();
whereUsed.add(filename);
exports.set(AST_NODE_TYPES.ImportDefaultSpecifier, {
whereUsed,
});
}
else {
currentExport.whereUsed.add(filename);
}
}
}
for (const value of oldDefaultImports) {
if (!newDefaultImports.has(value)) {
const imports = oldImportPaths.get(value);
imports.delete(AST_NODE_TYPES.ImportDefaultSpecifier);
const exports = exportList.get(value);
if (exports !== undefined) {
const currentExport = exports.get(AST_NODE_TYPES.ImportDefaultSpecifier);
if (currentExport !== undefined) {
currentExport.whereUsed.delete(filename);
}
}
}
}
for (const value of newNamespaceImports) {
if (!oldNamespaceImports.has(value)) {
let imports = oldImportPaths.get(value);
if (imports === undefined) {
imports = new Set();
}
imports.add(AST_NODE_TYPES.ImportNamespaceSpecifier);
oldImportPaths.set(value, imports);
let exports = exportList.get(value);
let currentExport;
if (exports === undefined) {
exports = new Map();
exportList.set(value, exports);
}
else {
currentExport = exports.get(AST_NODE_TYPES.ImportNamespaceSpecifier);
}
if (currentExport === undefined) {
const whereUsed = new Set();
whereUsed.add(filename);
exports.set(AST_NODE_TYPES.ImportNamespaceSpecifier, {
whereUsed,
});
}
else {
currentExport.whereUsed.add(filename);
}
}
}
for (const value of oldNamespaceImports) {
if (!newNamespaceImports.has(value)) {
const imports = oldImportPaths.get(value);
imports.delete(AST_NODE_TYPES.ImportNamespaceSpecifier);
const exports = exportList.get(value);
if (exports !== undefined) {
const currentExport = exports.get(AST_NODE_TYPES.ImportNamespaceSpecifier);
if (currentExport !== undefined) {
currentExport.whereUsed.delete(filename);
}
}
}
}
for (const [key, value] of newImports.entries()) {
if (!oldImports.has(key)) {
let imports = oldImportPaths.get(value);
if (imports === undefined) {
imports = new Set();
}
imports.add(key);
oldImportPaths.set(value, imports);
let exports = exportList.get(value);
let currentExport;
if (exports === undefined) {
exports = new Map();
exportList.set(value, exports);
}
else {
currentExport = exports.get(key);
}
if (currentExport === undefined) {
const whereUsed = new Set();
whereUsed.add(filename);
exports.set(key, { whereUsed });
}
else {
currentExport.whereUsed.add(filename);
}
}
}
for (const [key, value] of oldImports.entries()) {
if (!newImports.has(key)) {
const imports = oldImportPaths.get(value);
imports.delete(key);
const exports = exportList.get(value);
if (exports !== undefined) {
const currentExport = exports.get(key);
if (currentExport !== undefined) {
currentExport.whereUsed.delete(filename);
}
}
}
}
};
return {
'Program:exit'(node) {
updateExportUsage(node);
updateImportUsage(node);
checkExportPresence(node);
},
ExportDefaultDeclaration(node) {
checkUsage(node, AST_NODE_TYPES.ImportDefaultSpecifier, false);
},
ExportNamedDeclaration(node) {
for (const specifier of node.specifiers) {
checkUsage(specifier, getValue(specifier.exported), false);
}
forEachDeclarationIdentifier(node.declaration, (name, isTypeExport) => {
checkUsage(node, name, isTypeExport);
});
},
};
},
});
//# sourceMappingURL=no-unused-modules.js.map
@@ -0,0 +1,32 @@
import basePullAll from './_basePullAll.js';
/**
* This method is like `_.pullAll` except that it accepts `comparator` which
* is invoked to compare elements of `array` to `values`. The comparator is
* invoked with two arguments: (arrVal, othVal).
*
* **Note:** Unlike `_.differenceWith`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.6.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns `array`.
* @example
*
* var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
*
* _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
* console.log(array);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
*/
function pullAllWith(array, values, comparator) {
return (array && array.length && values && values.length)
? basePullAll(array, values, undefined, comparator)
: array;
}
export default pullAllWith;
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more