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

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

No files matched your search

@@ -0,0 +1 @@
{"version":3,"file":"resolveDynamicValueBindingCallback.js","sourceRoot":"","sources":["../../../../src/resolution/calculations/resolveDynamicValueBindingCallback.ts"],"names":[],"mappings":";;AAIA,gFAKC;AALD,SAAgB,kCAAkC,CAChD,MAAwB,EACxB,OAAwC;IAExC,OAAO,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC"}
@@ -0,0 +1,97 @@
"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 });
// ------------------------------------------------------------------
// Infrastructure
// ------------------------------------------------------------------
__exportStar(require("./type/clone/index"), exports);
__exportStar(require("./type/create/index"), exports);
__exportStar(require("./type/error/index"), exports);
__exportStar(require("./type/guard/index"), exports);
__exportStar(require("./type/helpers/index"), exports);
__exportStar(require("./type/patterns/index"), exports);
__exportStar(require("./type/registry/index"), exports);
__exportStar(require("./type/sets/index"), exports);
__exportStar(require("./type/symbols/index"), exports);
// ------------------------------------------------------------------
// Types
// ------------------------------------------------------------------
__exportStar(require("./type/any/index"), exports);
__exportStar(require("./type/array/index"), exports);
__exportStar(require("./type/argument/index"), exports);
__exportStar(require("./type/async-iterator/index"), exports);
__exportStar(require("./type/awaited/index"), exports);
__exportStar(require("./type/bigint/index"), exports);
__exportStar(require("./type/boolean/index"), exports);
__exportStar(require("./type/composite/index"), exports);
__exportStar(require("./type/const/index"), exports);
__exportStar(require("./type/constructor/index"), exports);
__exportStar(require("./type/constructor-parameters/index"), exports);
__exportStar(require("./type/date/index"), exports);
__exportStar(require("./type/enum/index"), exports);
__exportStar(require("./type/exclude/index"), exports);
__exportStar(require("./type/extends/index"), exports);
__exportStar(require("./type/extract/index"), exports);
__exportStar(require("./type/function/index"), exports);
__exportStar(require("./type/indexed/index"), exports);
__exportStar(require("./type/instance-type/index"), exports);
__exportStar(require("./type/instantiate/index"), exports);
__exportStar(require("./type/integer/index"), exports);
__exportStar(require("./type/intersect/index"), exports);
__exportStar(require("./type/iterator/index"), exports);
__exportStar(require("./type/intrinsic/index"), exports);
__exportStar(require("./type/keyof/index"), exports);
__exportStar(require("./type/literal/index"), exports);
__exportStar(require("./type/module/index"), exports);
__exportStar(require("./type/mapped/index"), exports);
__exportStar(require("./type/never/index"), exports);
__exportStar(require("./type/not/index"), exports);
__exportStar(require("./type/null/index"), exports);
__exportStar(require("./type/number/index"), exports);
__exportStar(require("./type/object/index"), exports);
__exportStar(require("./type/omit/index"), exports);
__exportStar(require("./type/optional/index"), exports);
__exportStar(require("./type/parameters/index"), exports);
__exportStar(require("./type/partial/index"), exports);
__exportStar(require("./type/pick/index"), exports);
__exportStar(require("./type/promise/index"), exports);
__exportStar(require("./type/readonly/index"), exports);
__exportStar(require("./type/readonly-optional/index"), exports);
__exportStar(require("./type/record/index"), exports);
__exportStar(require("./type/recursive/index"), exports);
__exportStar(require("./type/ref/index"), exports);
__exportStar(require("./type/regexp/index"), exports);
__exportStar(require("./type/required/index"), exports);
__exportStar(require("./type/rest/index"), exports);
__exportStar(require("./type/return-type/index"), exports);
__exportStar(require("./type/schema/index"), exports);
__exportStar(require("./type/static/index"), exports);
__exportStar(require("./type/string/index"), exports);
__exportStar(require("./type/symbol/index"), exports);
__exportStar(require("./type/template-literal/index"), exports);
__exportStar(require("./type/transform/index"), exports);
__exportStar(require("./type/tuple/index"), exports);
__exportStar(require("./type/uint8array/index"), exports);
__exportStar(require("./type/undefined/index"), exports);
__exportStar(require("./type/union/index"), exports);
__exportStar(require("./type/unknown/index"), exports);
__exportStar(require("./type/unsafe/index"), exports);
__exportStar(require("./type/void/index"), exports);
// ------------------------------------------------------------------
// Type.*
// ------------------------------------------------------------------
__exportStar(require("./type/type/index"), exports);
@@ -0,0 +1 @@
{"version":3,"names":["_remapping","data","require","mergeSourceMap","inputMap","map","sourceFileName","source","replace","found","result","remapping","rootless","s","ctx","sourceRoot","Object","assign"],"sources":["../../../src/transformation/file/merge-map.ts"],"sourcesContent":["type SourceMap = any;\nimport remapping from \"@jridgewell/remapping\";\n\nexport default function mergeSourceMap(\n inputMap: SourceMap,\n map: SourceMap,\n sourceFileName: string,\n): SourceMap {\n // On win32 machines, the sourceFileName uses backslash paths like\n // `C:\\foo\\bar.js`. But sourcemaps are always posix paths, so we need to\n // normalize to regular slashes before we can merge (else we won't find the\n // source associated with our input map).\n // This mirrors code done while generating the output map at\n // https://github.com/babel/babel/blob/5c2fcadc9ae34fd20dd72b1111d5cf50476d700d/packages/babel-generator/src/source-map.ts#L102\n const source = sourceFileName.replace(/\\\\/g, \"/\");\n\n // Prevent an infinite recursion if one of the input map's sources has the\n // same resolved path as the input map. In the case, it would keep find the\n // input map, then get it's sources which will include a path like the input\n // map, on and on.\n let found = false;\n const result = remapping(rootless(map), (s, ctx) => {\n if (s === source && !found) {\n found = true;\n // We empty the source location, which will prevent the sourcemap from\n // becoming relative to the input's location. Eg, if we're transforming a\n // file 'foo/bar.js', and it is a transformation of a `baz.js` file in the\n // same directory, the expected output is just `baz.js`. Without this step,\n // it would become `foo/baz.js`.\n ctx.source = \"\";\n\n return rootless(inputMap);\n }\n\n return null;\n });\n\n if (typeof inputMap.sourceRoot === \"string\") {\n result.sourceRoot = inputMap.sourceRoot;\n }\n\n // remapping returns a SourceMap class type, but this breaks code downstream in\n // @babel/traverse and @babel/types that relies on data being plain objects.\n // When it encounters the sourcemap type it outputs a \"don't know how to turn\n // this value into a node\" error. As a result, we are converting the merged\n // sourcemap to a plain js object.\n return { ...result };\n}\n\nfunction rootless(map: SourceMap): SourceMap {\n return {\n ...map,\n\n // This is a bit hack. Remapping will create absolute sources in our\n // sourcemap, but we want to maintain sources relative to the sourceRoot.\n // We'll re-add the sourceRoot after remapping.\n sourceRoot: null,\n };\n}\n"],"mappings":";;;;;;AACA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEe,SAASE,cAAcA,CACpCC,QAAmB,EACnBC,GAAc,EACdC,cAAsB,EACX;EAOX,MAAMC,MAAM,GAAGD,cAAc,CAACE,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;EAMjD,IAAIC,KAAK,GAAG,KAAK;EACjB,MAAMC,MAAM,GAAGC,WAAQA,CAAC,CAACC,QAAQ,CAACP,GAAG,CAAC,EAAE,CAACQ,CAAC,EAAEC,GAAG,KAAK;IAClD,IAAID,CAAC,KAAKN,MAAM,IAAI,CAACE,KAAK,EAAE;MAC1BA,KAAK,GAAG,IAAI;MAMZK,GAAG,CAACP,MAAM,GAAG,EAAE;MAEf,OAAOK,QAAQ,CAACR,QAAQ,CAAC;IAC3B;IAEA,OAAO,IAAI;EACb,CAAC,CAAC;EAEF,IAAI,OAAOA,QAAQ,CAACW,UAAU,KAAK,QAAQ,EAAE;IAC3CL,MAAM,CAACK,UAAU,GAAGX,QAAQ,CAACW,UAAU;EACzC;EAOA,OAAAC,MAAA,CAAAC,MAAA,KAAYP,MAAM;AACpB;AAEA,SAASE,QAAQA,CAACP,GAAc,EAAa;EAC3C,OAAAW,MAAA,CAAAC,MAAA,KACKZ,GAAG;IAKNU,UAAU,EAAE;EAAI;AAEpB;AAAC","ignoreList":[]}
@@ -0,0 +1,52 @@
import type * as core from "./core.js";
import * as schemas from "./schemas.js";
import { $ZodTuple } from "./schemas.js";
import type * as util from "./util.js";
export interface $ZodFunctionDef<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends $ZodFunctionOut = $ZodFunctionOut> {
type: "function";
input: In;
output: Out;
}
export type $ZodFunctionArgs = schemas.$ZodType<unknown[], unknown[]>;
export type $ZodFunctionIn = $ZodFunctionArgs;
export type $ZodFunctionOut = schemas.$ZodType;
export type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.output<Args>) => core.input<Returns>;
export type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.output<Args>) => util.MaybeAsync<core.input<Returns>>;
export type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.input<Args>) => core.output<Returns>;
export type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.input<Args>) => util.MaybeAsync<core.output<Returns>>;
export declare class $ZodFunction<Args extends $ZodFunctionIn = $ZodFunctionIn, Returns extends $ZodFunctionOut = $ZodFunctionOut> {
def: $ZodFunctionDef<Args, Returns>;
/** @deprecated */
_def: $ZodFunctionDef<Args, Returns>;
_input: $InferInnerFunctionType<Args, Returns>;
_output: $InferOuterFunctionType<Args, Returns>;
constructor(def: $ZodFunctionDef<Args, Returns>);
implement<F extends $InferInnerFunctionType<Args, Returns>>(func: F): (...args: Parameters<this["_output"]>) => ReturnType<F> extends ReturnType<this["_output"]> ? ReturnType<F> : ReturnType<this["_output"]>;
implementAsync<F extends $InferInnerFunctionTypeAsync<Args, Returns>>(func: F): F extends $InferOuterFunctionTypeAsync<Args, Returns> ? F : $InferOuterFunctionTypeAsync<Args, Returns>;
input<const Items extends util.TupleItems, const Rest extends $ZodFunctionOut = $ZodFunctionOut>(args: Items, rest?: Rest): $ZodFunction<schemas.$ZodTuple<Items, Rest>, Returns>;
input<NewArgs extends $ZodFunctionIn>(args: NewArgs): $ZodFunction<NewArgs, Returns>;
output<NewReturns extends schemas.$ZodType>(output: NewReturns): $ZodFunction<Args, NewReturns>;
}
export interface $ZodFunctionParams<I extends $ZodFunctionIn, O extends schemas.$ZodType> {
input?: I;
output?: O;
}
declare function _function(): $ZodFunction;
declare function _function<const In extends Array<schemas.$ZodType> = Array<schemas.$ZodType>>(params: {
input: In;
}): $ZodFunction<$ZodTuple<In, null>, $ZodFunctionOut>;
declare function _function<const In extends Array<schemas.$ZodType> = Array<schemas.$ZodType>, const Out extends $ZodFunctionOut = $ZodFunctionOut>(params: {
input: In;
output: Out;
}): $ZodFunction<$ZodTuple<In, null>, Out>;
declare function _function<const In extends $ZodFunctionIn = $ZodFunctionIn>(params: {
input: In;
}): $ZodFunction<In, $ZodFunctionOut>;
declare function _function<const Out extends $ZodFunctionOut = $ZodFunctionOut>(params: {
output: Out;
}): $ZodFunction<$ZodFunctionIn, Out>;
declare function _function<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends schemas.$ZodType = schemas.$ZodType>(params?: {
input: In;
output: Out;
}): $ZodFunction<In, Out>;
export { _function as function };
@@ -0,0 +1,154 @@
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {FormValidationState} from '@react-stately/form';
import {RefObject, Validation, ValidationResult} from '@react-types/shared';
import {setInteractionModality} from '@react-aria/interactions';
import {useEffect, useRef} from 'react';
import {useEffectEvent, useLayoutEffect} from '@react-aria/utils';
type ValidatableElement = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;
interface FormValidationProps<T> extends Validation<T> {
focus?: () => void
}
export function useFormValidation<T>(props: FormValidationProps<T>, state: FormValidationState, ref: RefObject<ValidatableElement | null> | undefined): void {
let {validationBehavior, focus} = props;
// This is a useLayoutEffect so that it runs before the useEffect in useFormValidationState, which commits the validation change.
useLayoutEffect(() => {
if (validationBehavior === 'native' && ref?.current && !ref.current.disabled) {
let errorMessage = state.realtimeValidation.isInvalid ? state.realtimeValidation.validationErrors.join(' ') || 'Invalid value.' : '';
ref.current.setCustomValidity(errorMessage);
// Prevent default tooltip for validation message.
// https://bugzilla.mozilla.org/show_bug.cgi?id=605277
if (!ref.current.hasAttribute('title')) {
ref.current.title = '';
}
if (!state.realtimeValidation.isInvalid) {
state.updateValidation(getNativeValidity(ref.current));
}
}
});
let isIgnoredReset = useRef(false);
let onReset = useEffectEvent(() => {
if (!isIgnoredReset.current) {
state.resetValidation();
}
});
let onInvalid = useEffectEvent((e: Event) => {
// Only commit validation if we are not already displaying one.
// This avoids clearing server errors that the user didn't actually fix.
if (!state.displayValidation.isInvalid) {
state.commitValidation();
}
// Auto focus the first invalid input in a form, unless the error already had its default prevented.
let form = ref?.current?.form;
if (!e.defaultPrevented && ref && form && getFirstInvalidInput(form) === ref.current) {
if (focus) {
focus();
} else {
ref.current?.focus();
}
// Always show focus ring.
setInteractionModality('keyboard');
}
// Prevent default browser error UI from appearing.
e.preventDefault();
});
let onChange = useEffectEvent(() => {
state.commitValidation();
});
useEffect(() => {
let input = ref?.current;
if (!input) {
return;
}
let form = input.form;
let reset = form?.reset;
if (form) {
// Try to detect React's automatic form reset behavior so we don't clear
// validation errors that are returned by server actions.
// To do this, we ignore programmatic form resets that occur outside a user event.
// This is best-effort. There may be false positives, e.g. setTimeout.
form.reset = () => {
// React uses MessageChannel for scheduling, so ignore 'message' events.
isIgnoredReset.current = !window.event || (window.event.type === 'message' && window.event.target instanceof MessagePort);
reset?.call(form);
isIgnoredReset.current = false;
};
}
input.addEventListener('invalid', onInvalid);
input.addEventListener('change', onChange);
form?.addEventListener('reset', onReset);
return () => {
input!.removeEventListener('invalid', onInvalid);
input!.removeEventListener('change', onChange);
form?.removeEventListener('reset', onReset);
if (form) {
// @ts-ignore
form.reset = reset;
}
};
}, [ref, onInvalid, onChange, onReset, validationBehavior]);
}
function getValidity(input: ValidatableElement) {
// The native ValidityState object is live, meaning each property is a getter that returns the current state.
// We need to create a snapshot of the validity state at the time this function is called to avoid unpredictable React renders.
let validity = input.validity;
return {
badInput: validity.badInput,
customError: validity.customError,
patternMismatch: validity.patternMismatch,
rangeOverflow: validity.rangeOverflow,
rangeUnderflow: validity.rangeUnderflow,
stepMismatch: validity.stepMismatch,
tooLong: validity.tooLong,
tooShort: validity.tooShort,
typeMismatch: validity.typeMismatch,
valueMissing: validity.valueMissing,
valid: validity.valid
};
}
function getNativeValidity(input: ValidatableElement): ValidationResult {
return {
isInvalid: !input.validity.valid,
validationDetails: getValidity(input),
validationErrors: input.validationMessage ? [input.validationMessage] : []
};
}
function getFirstInvalidInput(form: HTMLFormElement): ValidatableElement | null {
for (let i = 0; i < form.elements.length; i++) {
let element = form.elements[i] as ValidatableElement;
if (!element.validity.valid) {
return element;
}
}
return null;
}
@@ -0,0 +1,25 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {NumberFormatOptions, NumberFormatter} from '@internationalized/number';
import {useLocale} from './context';
import {useMemo} from 'react';
/**
* Provides localized number formatting for the current locale. Automatically updates when the locale changes,
* and handles caching of the number formatter for performance.
* @param options - Formatting options.
*/
export function useNumberFormatter(options: NumberFormatOptions = {}): Intl.NumberFormat {
let {locale} = useLocale();
return useMemo(() => new NumberFormatter(locale, options), [locale, options]);
}
@@ -0,0 +1,8 @@
import type { BasicTarget } from '../utils/domTarget';
export interface Options {
onEnter?: () => void;
onLeave?: () => void;
onChange?: (isHovering: boolean) => void;
}
declare const _default: (target: BasicTarget, options?: Options) => boolean;
export default _default;
@@ -0,0 +1,97 @@
declare namespace QuickLRU {
interface Options<KeyType, ValueType> {
/**
The maximum number of items before evicting the least recently used items.
*/
readonly maxSize: number;
/**
Called right before an item is evicted from the cache.
Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`).
*/
onEviction?: (key: KeyType, value: ValueType) => void;
}
}
declare class QuickLRU<KeyType, ValueType>
implements Iterable<[KeyType, ValueType]> {
/**
The stored item count.
*/
readonly size: number;
/**
Simple ["Least Recently Used" (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29).
The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop.
@example
```
import QuickLRU = require('quick-lru');
const lru = new QuickLRU({maxSize: 1000});
lru.set('🦄', '🌈');
lru.has('🦄');
//=> true
lru.get('🦄');
//=> '🌈'
```
*/
constructor(options: QuickLRU.Options<KeyType, ValueType>);
[Symbol.iterator](): IterableIterator<[KeyType, ValueType]>;
/**
Set an item.
@returns The list instance.
*/
set(key: KeyType, value: ValueType): this;
/**
Get an item.
@returns The stored item or `undefined`.
*/
get(key: KeyType): ValueType | undefined;
/**
Check if an item exists.
*/
has(key: KeyType): boolean;
/**
Get an item without marking it as recently used.
@returns The stored item or `undefined`.
*/
peek(key: KeyType): ValueType | undefined;
/**
Delete an item.
@returns `true` if the item is removed or `false` if the item doesn't exist.
*/
delete(key: KeyType): boolean;
/**
Delete all items.
*/
clear(): void;
/**
Iterable for all the keys.
*/
keys(): IterableIterator<KeyType>;
/**
Iterable for all the values.
*/
values(): IterableIterator<ValueType>;
}
export = QuickLRU;
@@ -0,0 +1,6 @@
"use strict";
module.exports = () => {
// https://mths.be/emoji
return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\uLine truncated
};
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Anton Kastritskiy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,62 @@
/*
* 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.
*/
/**
* Takes a value and forces it to the closest min/max if it's outside. Also forces it to the closest valid step.
*/
export function clamp(value: number, min: number = -Infinity, max: number = Infinity): number {
let newValue = Math.min(Math.max(value, min), max);
return newValue;
}
export function roundToStepPrecision(value: number, step: number) {
let roundedValue = value;
let stepString = step.toString();
let pointIndex = stepString.indexOf('.');
let precision = pointIndex >= 0 ? stepString.length - pointIndex : 0;
if (precision > 0) {
let pow = Math.pow(10, precision);
roundedValue = Math.round(roundedValue * pow) / pow;
}
return roundedValue;
}
export function snapValueToStep(value: number, min: number | undefined, max: number | undefined, step: number): number {
min = Number(min);
max = Number(max);
let remainder = ((value - (isNaN(min) ? 0 : min)) % step);
let snappedValue = roundToStepPrecision(Math.abs(remainder) * 2 >= step
? value + Math.sign(remainder) * (step - Math.abs(remainder))
: value - remainder, step);
if (!isNaN(min)) {
if (snappedValue < min) {
snappedValue = min;
} else if (!isNaN(max) && snappedValue > max) {
snappedValue = min + Math.floor(roundToStepPrecision((max - min) / step, step)) * step;
}
} else if (!isNaN(max) && snappedValue > max) {
snappedValue = Math.floor(roundToStepPrecision(max / step, step)) * step;
}
// correct floating point behavior by rounding to step precision
snappedValue = roundToStepPrecision(snappedValue, step);
return snappedValue;
}
/* Takes a value and rounds off to the number of digits. */
export function toFixedNumber(value: number, digits: number, base: number = 10): number {
const pow = Math.pow(base, digits);
return Math.round(value * pow) / pow;
}
@@ -0,0 +1 @@
{"version":3,"names":["_traverseNode","require","_index","_removal","t","call","key","opts","debug","node","_call","_opts$this$node$type","type","fns","fn","ret","state","then","Error","_traverseFlags","isDenylisted","_this$opts$denylist","denylist","blacklist","includes","exports","isBlacklisted","restoreContext","path","context","visit","_this$opts$shouldSkip","_this$opts","shouldSkip","currentContext","shouldStop","traverseNode","scope","skipKeys","skip","skipKey","stop","SHOULD_SKIP","SHOULD_STOP","setScope","_this$opts2","_this$scope","noScope","parentPath","listKey","isMethod","isSwitchStatement","target","_path$opts","getScope","init","setContext","resync","removed","_resyncParent","_resyncList","_resyncKey","parent","container","Array","isArray","i","length","setKey","Object","keys","inList","newContainer","_resyncRemoved","_markRemoved","popContext","contexts","pop","undefined","pushContext","push","setup","_this$node","requeue","pathToQueue","maybeQueue","requeueComputedKeyAndDecorators","isPrivate","computed","get","decorators","decorator","_getQueueContexts"],"sources":["../../src/path/context.ts"],"sourcesContent":["// This file contains methods responsible for maintaining a TraversalContext.\n\nimport { traverseNode } from \"../traverse-node.ts\";\nimport { SHOULD_SKIP, SHOULD_STOP } from \"./index.ts\";\nimport { _markRemoved } from \"./removal.ts\";\nimport type TraversalContext from \"../context.ts\";\nimport type { VisitPhase } from \"../types.ts\";\nimport type NodePath from \"./index.ts\";\nimport * as t from \"@babel/types\";\n\nexport function call(this: NodePath, key: VisitPhase): boolean {\n const opts = this.opts;\n\n this.debug(key);\n\n if (this.node) {\n if (_call.call(this, opts[key])) return true;\n }\n\n if (this.node) {\n return _call.call(this, opts[this.node.type]?.[key]);\n }\n\n return false;\n}\n\nexport function _call(this: NodePath, fns?: Array<Function>): boolean {\n if (!fns) return false;\n\n for (const fn of fns) {\n if (!fn) continue;\n\n const node = this.node;\n if (!node) return true;\n\n const ret = fn.call(this.state, this, this.state);\n if (ret && typeof ret === \"object\" && typeof ret.then === \"function\") {\n throw new Error(\n `You appear to be using a plugin with an async traversal visitor, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, you may need to upgrade ` +\n `your @babel/core version.`,\n );\n }\n if (ret) {\n throw new Error(`Unexpected return value from visitor method ${fn}`);\n }\n\n // node has been replaced, it will have been requeued\n if (this.node !== node) return true;\n\n // this.shouldSkip || this.shouldStop || this.removed\n if (this._traverseFlags > 0) return true;\n }\n\n return false;\n}\n\nexport function isDenylisted(this: NodePath): boolean {\n // @ts-expect-error TODO(Babel 8): Remove blacklist\n const denylist = this.opts.denylist ?? this.opts.blacklist;\n return denylist?.includes(this.node.type);\n}\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM) {\n // eslint-disable-next-line no-restricted-globals\n exports.isBlacklisted = isDenylisted;\n}\n\nfunction restoreContext(path: NodePath, context: TraversalContext) {\n if (path.context !== context) {\n path.context = context;\n path.state = context.state;\n path.opts = context.opts;\n }\n}\n\nexport function visit(this: NodePath): boolean {\n if (!this.node) {\n return false;\n }\n\n if (this.isDenylisted()) {\n return false;\n }\n\n if (this.opts.shouldSkip?.(this)) {\n return false;\n }\n\n const currentContext = this.context;\n // Note: We need to check \"this.shouldSkip\" first because\n // another visitor can set it to true. Usually .shouldSkip is false\n // before calling the enter visitor, but it can be true in case of\n // a requeued node (e.g. by .replaceWith()) that is then marked\n // with .skip().\n if (this.shouldSkip || call.call(this, \"enter\")) {\n this.debug(\"Skip...\");\n return this.shouldStop;\n }\n restoreContext(this, currentContext);\n\n this.debug(\"Recursing into...\");\n this.shouldStop = traverseNode(\n this.node,\n this.opts,\n this.scope,\n this.state,\n this,\n this.skipKeys,\n );\n\n restoreContext(this, currentContext);\n\n call.call(this, \"exit\");\n\n return this.shouldStop;\n}\n\nexport function skip(this: NodePath) {\n this.shouldSkip = true;\n}\n\nexport function skipKey(this: NodePath, key: string) {\n if (this.skipKeys == null) {\n this.skipKeys = {};\n }\n this.skipKeys[key] = true;\n}\n\nexport function stop(this: NodePath) {\n // this.shouldSkip = true; this.shouldStop = true;\n this._traverseFlags |= SHOULD_SKIP | SHOULD_STOP;\n}\n\nexport function setScope(this: NodePath) {\n if (!process.env.BABEL_8_BREAKING && this.opts?.noScope) return;\n\n let path = this.parentPath;\n\n if (\n // SkiLine truncated
@@ -0,0 +1,38 @@
/**
* @import {Event} from 'micromark-util-types'
*/
/**
* @typedef {[number, number, Array<Event>]} Change
* @typedef {[number, number, number]} Jump
*/
/**
* Tracks a bunch of edits.
*/
export class EditMap {
/**
* Record of changes.
*
* @type {Array<Change>}
*/
map: Array<Change>;
/**
* Create an edit: a remove and/or add at a certain place.
*
* @param {number} index
* @param {number} remove
* @param {Array<Event>} add
* @returns {undefined}
*/
add(index: number, remove: number, add: Array<Event>): undefined;
/**
* Done, change the events.
*
* @param {Array<Event>} events
* @returns {undefined}
*/
consume(events: Array<Event>): undefined;
}
export type Change = [number, number, Array<Event>];
export type Jump = [number, number, number];
import type { Event } from 'micromark-util-types';
//# sourceMappingURL=edit-map.d.ts.map
@@ -0,0 +1,16 @@
/**
* Adds a specified number of minutes to a date.
* 向日期添加指定数量的分钟。
*
* @param date - The date to add minutes to. (要添加分钟的日期。)
* @param minutes - The number of minutes to add. (要添加的分钟数。)
* @returns A new date with the added minutes. (添加分钟后的新日期。)
* @example
* ```ts
* // Adding 30 minutes to a date (向日期添加30分钟)
* const originalDate = new Date('2023-10-01T12:00:00');
* addMinutes(originalDate, 30);
* console.log(originalDate.toISOString()); // Outputs: '2023-10-01T12:30:00.000Z' (输出: '2023-10-01T12:30:00.000Z')
* ```
*/
export default function addMinutes(date: Date, minutes: number): Date;
@@ -0,0 +1,824 @@
flf2a$ 8 7 20 -1 7
TUBULAR by Ron Fritz 8/94
Figlet Release 2.0
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
O~~@
O~~@
O~~@
O~ @
O~ @
@
O~~@
@@
O~ O~@
O~ O~@
@
@
@
@
@
@@
@
O~~ O~~ @
O~~~~~~ O~~~~@
O~~ O~~ @
O~~ O~~ @
O~~~~~~ O~~~~@
O~~ O~~ @
@@
O~~ @
O~ O~~ @
O~~ @
O~~ @
O~~@
O~~ O~~ @
O~~ @
@@
@
O~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~~O~~@
@@
@
@
O~~ O~~@
O~~ O~~ @
O~~ O~~ @
O~O~~ @
O~~ @
@@
@
@
O~~ O~~@
O~~ ~ O~~@
O~~ O~ O~~@
O~ O~ O~O~~@
O~~~ O~~@
@@
@
@
O~~ O~~@
O~ O~~ @
O~ @
O~ O~~ @
O~~ O~~@
@@
@
@
O~~ O~~@
O~~ O~~ @
O~~~ @
O~~ @
O~~ @
O~~ @@
@
@
O~~~~ O~~@
O~~ @
O~~ @
O~~ @
O~~~~~~~~@
@@
O~~@
O~~ @
O~~ @
O~~ @
O~~ @
O~~ @
O~~@
@@
O~@
O~@
O~@
@
O~@
O~@
O~@
@@
O~~ @
O~~ @
O~~ @
O~~@
O~~ @
O~~ @
O~~ @
@@
O~~ O~ @
O~ O~~@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@@ -0,0 +1,97 @@
/**
* License for programmatically and manually incorporated
* documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
*
* Copyright Node.js contributors. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
// NOTE: These definitions support Node.js and TypeScript 4.9 through 5.6.
// Reference required TypeScript libs:
/// <reference lib="es2020" />
// TypeScript backwards-compatibility definitions:
/// <reference path="../compatibility/index.d.ts" />
// Definitions specific to TypeScript 4.9 through 5.6:
/// <reference path="./globals.typedarray.d.ts" />
/// <reference path="./buffer.buffer.d.ts" />
// Definitions for Node.js modules that are not specific to any version of TypeScript:
/// <reference path="../globals.d.ts" />
/// <reference path="../web-globals/abortcontroller.d.ts" />
/// <reference path="../web-globals/domexception.d.ts" />
/// <reference path="../web-globals/events.d.ts" />
/// <reference path="../web-globals/fetch.d.ts" />
/// <reference path="../web-globals/navigator.d.ts" />
/// <reference path="../web-globals/storage.d.ts" />
/// <reference path="../assert.d.ts" />
/// <reference path="../assert/strict.d.ts" />
/// <reference path="../async_hooks.d.ts" />
/// <reference path="../buffer.d.ts" />
/// <reference path="../child_process.d.ts" />
/// <reference path="../cluster.d.ts" />
/// <reference path="../console.d.ts" />
/// <reference path="../constants.d.ts" />
/// <reference path="../crypto.d.ts" />
/// <reference path="../dgram.d.ts" />
/// <reference path="../diagnostics_channel.d.ts" />
/// <reference path="../dns.d.ts" />
/// <reference path="../dns/promises.d.ts" />
/// <reference path="../domain.d.ts" />
/// <reference path="../events.d.ts" />
/// <reference path="../fs.d.ts" />
/// <reference path="../fs/promises.d.ts" />
/// <reference path="../http.d.ts" />
/// <reference path="../http2.d.ts" />
/// <reference path="../https.d.ts" />
/// <reference path="../inspector.d.ts" />
/// <reference path="../inspector.generated.d.ts" />
/// <reference path="../module.d.ts" />
/// <reference path="../net.d.ts" />
/// <reference path="../os.d.ts" />
/// <reference path="../path.d.ts" />
/// <reference path="../perf_hooks.d.ts" />
/// <reference path="../process.d.ts" />
/// <reference path="../punycode.d.ts" />
/// <reference path="../querystring.d.ts" />
/// <reference path="../readline.d.ts" />
/// <reference path="../readline/promises.d.ts" />
/// <reference path="../repl.d.ts" />
/// <reference path="../sea.d.ts" />
/// <reference path="../sqlite.d.ts" />
/// <reference path="../stream.d.ts" />
/// <reference path="../stream/promises.d.ts" />
/// <reference path="../stream/consumers.d.ts" />
/// <reference path="../stream/web.d.ts" />
/// <reference path="../string_decoder.d.ts" />
/// <reference path="../test.d.ts" />
/// <reference path="../timers.d.ts" />
/// <reference path="../timers/promises.d.ts" />
/// <reference path="../tls.d.ts" />
/// <reference path="../trace_events.d.ts" />
/// <reference path="../tty.d.ts" />
/// <reference path="../url.d.ts" />
/// <reference path="../util.d.ts" />
/// <reference path="../v8.d.ts" />
/// <reference path="../vm.d.ts" />
/// <reference path="../wasi.d.ts" />
/// <reference path="../worker_threads.d.ts" />
/// <reference path="../zlib.d.ts" />
@@ -0,0 +1 @@
{"name":"console-control-strings","version":"1.1.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532127596,"integrity":"sha512-2kD5hJY9WtjDONMbJyc/QD3b9kx4DtDa5pcHYQLyuSjJJDaXtQGej8DXyJyFMLW4LzZbITWE/dm2VfhWLZtFLg==","mode":420,"size":791},"README.md":{"checkedAt":1794532127596,"integrity":"sha512-tGaOkyhknRpe49le5hV3YbuieGAsAWXQCDd5EeFEwb9E4gZIml7PkG62kkanDmqCzAxEA91PJdC7BHMnZMJo2Q==","mode":420,"size":4475},"LICENSE":{"checkedAt":1794532127596,"integrity":"sha512-Rnhjve7qKf8Gf6umpqbnAkG+savs994mTr/zazpJfk8+EksYBWD3gS/kGARH6ARYJ1MjMrrgCGA7BpVMx2gWBQ==","mode":420,"size":751},"index.js":{"checkedAt":1794532127596,"integrity":"sha512-y4VK7Ze5zf27ArmHwpaG3N2n9dpN560zF4AZYdNaAPGvqFk4JSjP7p1TXABLZl4lMRD42Bxm0lOTFpp9zUPL1g==","mode":420,"size":2339},"README.md~":{"checkedAt":1794532127596,"integrity":"sha512-z1DvOVVmbEm9afjR+JEyrdhCw9U6Sa2DwAs5wAFggylleYoJcC6+HrQMw59b6EjY3n0iKZuNC7nvtBHbJdbkrg==","mode":420,"size":4313}}}
@@ -0,0 +1,24 @@
let Declaration = require('../declaration')
let utils = require('../utils')
class BackgroundClip extends Declaration {
constructor(name, prefixes, all) {
super(name, prefixes, all)
if (this.prefixes) {
this.prefixes = utils.uniq(
this.prefixes.map(i => {
return i === '-ms-' ? '-webkit-' : i
})
)
}
}
check(decl) {
return decl.value.toLowerCase() === 'text'
}
}
BackgroundClip.names = ['background-clip']
module.exports = BackgroundClip
@@ -0,0 +1,13 @@
export declare type SourceLocation = {
line: number;
column: number;
};
export declare class LinesAndColumns {
private string;
private offsets;
constructor(string: string);
locationForIndex(index: number): SourceLocation | null;
indexForLocation(location: SourceLocation): number | null;
private lengthOfLine;
}
export default LinesAndColumns;
@@ -0,0 +1,37 @@
var baseForRight = require('./_baseForRight'),
castFunction = require('./_castFunction'),
keysIn = require('./keysIn');
/**
* This method is like `_.forIn` except that it iterates over properties of
* `object` in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forIn
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forInRight(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
*/
function forInRight(object, iteratee) {
return object == null
? object
: baseForRight(object, castFunction(iteratee), keysIn);
}
module.exports = forInRight;
@@ -0,0 +1,16 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"eqeqeq": ["error", "allow-null"],
"id-length": "off",
"new-cap": ["error", {
"capIsNewExceptions": [
"RequireObjectCoercible",
"ToObject",
],
}],
},
}
@@ -0,0 +1,83 @@
@echo off
REM -- Script requirements:
REM --
REM -- * git This program must be in the Path to check out
REM -- build-gyp. If that directory already exists, then
REM -- git isn't necessary, but if it is missing, no
REM -- commit hash will be embedded into binaries.
REM --
REM -- * python A non-Cygwin Python 2 python.exe must be in the
REM -- Path to run gyp.
REM --
REM -- * msbuild msbuild must be in the Path. It is probably
REM -- important to have msbuild from the correct MSVC
REM -- release.
REM --
REM -- The script's output binaries are in the src/Release/{Win32,x64}
REM -- directory.
REM -------------------------------------------------------------------------
REM -- Parse arguments
setlocal
cd %~dp0
set GYP_ARGS=
set MSVC_PLATFORM=x64
:ParamLoop
if "%1" == "" goto :ParamDone
if "%1" == "--msvc-platform" (
REM -- One of Win32 or x64.
set MSVC_PLATFORM=%2
shift && shift
goto :ParamLoop
)
if "%1" == "--gyp-msvs-version" (
set GYP_ARGS=%GYP_ARGS% -G msvs_version=%2
shift && shift
goto :ParamLoop
)
if "%1" == "--toolset" (
set GYP_ARGS=%GYP_ARGS% -D WINPTY_MSBUILD_TOOLSET=%2
shift && shift
goto :ParamLoop
)
if "%1" == "--commit-hash" (
set GYP_ARGS=%GYP_ARGS% -D WINPTY_COMMIT_HASH=%2
shift && shift
goto :ParamLoop
)
echo error: Unrecognized argument: %1
exit /b 1
:ParamDone
REM -------------------------------------------------------------------------
REM -- Check out GYP. GYP doesn't seem to have releases, so just use the
REM -- current master commit.
if not exist build-gyp (
git clone https://chromium.googlesource.com/external/gyp build-gyp || (
echo error: GYP clone failed
exit /b 1
)
)
REM -------------------------------------------------------------------------
REM -- Run gyp to generate MSVC project files.
cd src
call ..\build-gyp\gyp.bat winpty.gyp -I configurations.gypi %GYP_ARGS%
if errorlevel 1 (
echo error: GYP failed
exit /b 1
)
REM -------------------------------------------------------------------------
REM -- Compile the project.
msbuild winpty.sln /m /p:Platform=%MSVC_PLATFORM% || (
echo error: msbuild failed
exit /b 1
)
@@ -0,0 +1,897 @@
import type { StrictEqualUsingBranding } from './branding';
import type { ExpectAny, ExpectArray, ExpectBigInt, ExpectBoolean, ExpectFunction, ExpectNever, ExpectNull, ExpectNullable, ExpectNumber, ExpectObject, ExpectString, ExpectSymbol, ExpectUndefined, ExpectUnknown, ExpectVoid, MismatchInfo, Scolder } from './messages';
import type { ConstructorOverloadParameters, OverloadParameters, OverloadReturnTypes, OverloadsNarrowedByParameters } from './overloads';
import type { AValue, DeepPickMatchingProps, Extends, IsUnion, MismatchArgs, Not, StrictEqualUsingTSInternalIdenticalToOperator } from './utils';
export * from './branding';
export * from './messages';
export * from './overloads';
export * from './utils';
/**
* Represents the positive assertion methods available for type checking in the
* {@linkcode expectTypeOf()} utility.
*/
export interface PositiveExpectTypeOf<Actual> extends BaseExpectTypeOf<Actual, {
positive: true;
branded: false;
}> {
/**
* Similar to jest's `expect(...).toMatchObject(...)` but for types.
* Deeply "picks" the properties of the actual type based on the expected type, then performs a strict check to make sure the types match `Expected`.
*
* **Note**: optional properties on the {@linkcode Expected | expected type} are not allowed to be missing on the {@linkcode Actual | actual type}.
*
* @example
* ```ts
* expectTypeOf({ a: 1, b: 1 }).toMatchObjectType<{ a: number }>()
*
* expectTypeOf({ a: 1, b: 1 }).not.toMatchObjectType<{ a: number; c?: number }>()
* ```
*
* @param MISMATCH - The mismatch arguments.
* @returns `true`.
*/
toMatchObjectType: <Expected extends IsUnion<Expected> extends true ? 'toMatchObject does not support union types' : Not<Extends<Expected, Record<string, unknown>>> extends true ? 'toMatchObject only supports object types' : StrictEqualUsingTSInternalIdenticalToOperator<DeepPickMatchingProps<Actual, Expected>, Expected> extends true ? unknown : MismatchInfo<DeepPickMatchingProps<Actual, Expected>, Expected>>(...MISMATCH: MismatchArgs<StrictEqualUsingTSInternalIdenticalToOperator<DeepPickMatchingProps<Actual, Expected>, Expected>, true>) => true;
/**
* Check if your type extends the expected type
*
* A less strict version of {@linkcode toEqualTypeOf | .toEqualTypeOf()} that allows for extra properties.
* This is roughly equivalent to an `extends` constraint in a function type argument.
*
* @example
* ```ts
* expectTypeOf({ a: 1, b: 1 }).toExtend<{ a: number }>()
*
* expectTypeOf({ a: 1 }).not.toExtend<{ b: number }>()
* ```
*
* @param MISMATCH - The mismatch arguments.
* @returns `true`.
*/
toExtend: <Expected extends Extends<Actual, Expected> extends true ? unknown : MismatchInfo<Actual, Expected>>(...MISMATCH: MismatchArgs<Extends<Actual, Expected>, true>) => true;
toEqualTypeOf: {
/**
* Uses TypeScript's internal technique to check for type "identicalness".
*
* It will check if the types are fully equal to each other.
* It will not fail if two objects have different values, but the same type.
* It will fail however if an object is missing a property.
*
* **_Unexpected failure_**? For a more permissive but less performant
* check that accommodates for equivalent intersection types,
* use {@linkcode branded | .branded.toEqualTypeOf()}.
* @see {@link https://github.com/mmkal/expect-type#why-is-my-assertion-failing | The documentation for details}.
*
* @example
* <caption>Using generic type argument syntax</caption>
* ```ts
* expectTypeOf({ a: 1 }).toEqualTypeOf<{ a: number }>()
*
* expectTypeOf({ a: 1, b: 1 }).not.toEqualTypeOf<{ a: number }>()
* ```
*
* @example
* <caption>Using inferred type syntax by passing a value</caption>
* ```ts
* expectTypeOf({ a: 1 }).toEqualTypeOf({ a: 1 })
*
* expectTypeOf({ a: 1 }).toEqualTypeOf({ a: 2 })
* ```
*
* @param value - The value to compare against the expected type.
* @param MISMATCH - The mismatch arguments.
* @returns `true`.
*/
<Expected extends StrictEqualUsingTSInternalIdenticalToOperator<Actual, Expected> extends true ? unknown : MismatchInfo<Actual, Expected>>(value: Expected & AValue, // reason for `& AValue`: make sure this is only the selected overload when the end-user passes a value for an inferred typearg. The `Mismatch` type does match `AValue`.
...MISMATCH: MismatchArgs<StrictEqualUsingTSInternalIdenticalToOperator<Actual, Expected>, true>): true;
/**
* Uses TypeScript's internal technique to check for type "identicalness".
*
* It will check if the types are fully equal to each other.
* It will not fail if two objects have different values, but the same type.
* It will fail however if an object is missing a property.
*
* **_Unexpected failure_**? For a more permissive but less performant
* check that accommodates for equivalent intersection types,
* use {@linkcode branded | .branded.toEqualTypeOf()}.
* @see {@link https://github.com/mmkal/expect-type#why-is-my-assertion-failing | The documentation for details}.
*
* @example
* <caption>Using generic type argument syntax</caption>
* ```ts
* expectTypeOf({ a: 1 }).toEqualTypeOf<{ a: number }>()
*
* expectTypeOf({ a: 1, b: 1 }).not.toEqualTypeOf<{ a: number }>()
* ```
*
* @example
* <caption>Using inferred type syntax by passing a value</caption>
* ```ts
* expectTypeOf({ a: 1 }).toEqualTypeOf({ a: 1 })
*
* expectTypeOf({ a: 1 }).toEqualTypeOf({ a: 2 })
* ```
*
* @param MISMATCH - The mismatch arguments.
* @returns `true`.
*/
<Expected extends StrictEqualUsingTSInternalIdenticalToOperator<Actual, Expected> extends true ? unknown : MismatchInfo<Actual, Expected>>(...MISMATCH: MismatchArgs<StrictEqualUsingTSInternalIdenticalToOperator<Actual, Expected>, true>): true;
};
/**
* @deprecated Since v1.2.0 - Use either {@linkcode toMatchObjectType} or {@linkcode toExtend} instead
*
* - Use {@linkcode toMatchObjectType} to perform a strict check on a subset of your type's keys
* - Use {@linkcode toExtend} to check if your type extends the expected type
*/
toMatchTypeOf: {
/**
* @deprecated Since v1.2.0 - Use either {@linkcode toMatchObjectType} or {@linkcode toExtend} instead
*
* - Use {@linkcode toMatchObjectType} to perform a strict check on a subset of your type's keys
* - Use {@linkcode toExtend} to check if your type extends the expected type
*
* A less strict version of {@linkcode toEqualTypeOf | .toEqualTypeOf()}
* that allows for extra properties.
* This is roughly equivalent to an `extends` constraint
* in a function type argument.
*
* @example
* <caption>Using generic type argument syntax</caption>
* ```ts
* expectTypeOf({ a: 1, b: 1 }).toMatchTypeOf<{ a: number }>()
* ```
*
* @example
* <caption>Using inferred type syntax by passing a value</caption>
* ```ts
* expectTypeOf({ a: 1, b: 1 }).toMatchTypeOf({ a: 2 })
* ```
*
* @param value - The value to compare against the expected type.
* @param MISMATCH - The mismatch arguments.
* @returns `true`.
*/
<Expected extends Extends<Actual, Expected> extends true ? unknown : MismatchInfo<Actual, Expected>>(value: Expected & AValue, // reason for `& AValue`: make sure this is only the selected overload when the end-user passes a value for an inferred typearg. The `Mismatch` type does match `AValue`.
...MISMATCH: MismatchArgs<Extends<Actual, Expected>, true>): true;
/**
* @deprecated Since v1.2.0 - Use either {@linkcode toMatchObjectType} or {@linkcode toExtend} instead
*
* - Use {@linkcode toMatchObjectType} to perform a strict check on a subset of your type's keys
* - Use {@linkcode toExtend} to check if your type extends the expected type
*
* A less strict version of {@linkcode toEqualTypeOf | .toEqualTypeOf()}
* that allows for extra properties.
* This is roughly equivalent to an `extends` constraint
* in a function type argument.
*
* @example
* <caption>Using generic type argument syntax</caption>
* ```ts
* expectTypeOf({ a: 1, b: 1 }).toMatchTypeOf<{ a: number }>()
* ```
*
* @example
* <caption>Using inferred type syntax by passing a value</caption>
* ```ts
* expectTypeOf({ a: 1, b: 1 }).toMatchTypeOf({ a: 2 })
* ```
*
* @param MISMATCH - The mismatch arguments.
* @returns `true`.
*/
<Expected extends Extends<Actual, Expected> extends true ? unknown : MismatchInfo<Actual, Expected>>(...MISMATCH: MismatchArgs<Extends<Actual, Expected>, true>): true;
};
/**
* Checks whether an object has a given property.
*
* @example
* <caption>check that properties exist</caption>
* ```ts
* const obj = { a: 1, b: '' }
*
* expectTypeOf(obj).toHaveProperty('a')
*
* expectTypeOf(obj).not.toHaveProperty('c')
* ```
*
* @param key - The property key to check for.
* @param MISMATCH - The mismatch arguments.
* @returns `true`.
*/
toHaveProperty: <KeyType extends keyof Actual>(key: KeyType, ...MISMATCH: MismatchArgs<Extends<KeyType, keyof Actual>, true>) => KeyType extends keyof Actual ? PositiveExpectTypeOf<Actual[KeyType]> : true;
/**
* Inverts the result of the following assertions.
*
* @example
* ```ts
* expectTypeOf({ a: 1 }).not.toMatchTypeOf({ b: 1 })
* ```
*/
not: NegativeExpectTypeOf<Actual>;
/**
* Intersection types can cause issues with
* {@linkcode toEqualTypeOf | .toEqualTypeOf()}:
* ```ts
* // ❌ The following line doesn't compile, even though the types are arguably the same.
* expectTypeOf<{ a: 1 } & { b: 2 }>().toEqualTypeOf<{ a: 1; b: 2 }>()
* ```
* This helper works around this problem by using
* a more permissive but less performant check.
*
* __Note__: This comes at a performance cost, and can cause the compiler
* to 'give up' if used with excessively deep types, so use sparingly.
*
* @see {@link https://github.com/mmkal/expect-type/pull/21 | Reference}
*/
branded: {
/**
* Uses TypeScript's internal technique to check for type "identicalness".
*
* It will check if the types are fully equal to each other.
* It will not fail if two objects have different values, but the same type.
* It will fail however if an object is missing a property.
*
* **_Unexpected failure_**? For a more permissive but less performant
* check that accommodates for equivalent intersection types,
* use {@linkcode PositiveExpectTypeOf.branded | .branded.toEqualTypeOf()}.
* @see {@link https://github.com/mmkal/expect-type#why-is-my-assertion-failing | The documentation for details}.
*
* @example
* <caption>Using generic type argument syntax</caption>
* ```ts
* expectTypeOf({ a: 1 }).toEqualTypeOf<{ a: number }>()
*
* expectTypeOf({ a: 1, b: 1 }).not.toEqualTypeOf<{ a: number }>()
* ```
*
* @example
* <caption>Using inferred type syntax by passing a value</caption>
* ```ts
* expectTypeOf({ a: 1 }).toEqualTypeOf({ a: 1 })
*
* expectTypeOf({ a: 1 }).toEqualTypeOf({ a: 2 })
* ```
*
* @param MISMATCH - The mismatch arguments.
* @returns `true`.
*/
toEqualTypeOf: <Expected extends StrictEqualUsingBranding<Actual, Expected> extends true ? unknown : MismatchInfo<Actual, Expected>>(...MISMATCH: MismatchArgs<StrictEqualUsingBranding<Actual, Expected>, true>) => true;
};
}
/**
* Represents the negative expectation type for the {@linkcode Actual} type.
*/
export interface NegativeExpectTypeOf<Actual> extends BaseExpectTypeOf<Actual, {
positive: false;
}> {
/**
* Similar to jest's `expect(...).toMatchObject(...)` but for types.
* Deeply "picks" the properties of the actual type based on the expected type, then performs a strict check to make sure the types match `Expected`.
*
* **Note**: optional properties on the {@linkcode Expected | expected type} are not allowed to be missing on the {@linkcode Actual | actual type}.
*
* @example
* ```ts
* expectTypeOf({ a: 1, b: 1 }).toMatchObjectType<{ a: number }>()
*
* expectTypeOf({ a: 1, b: 1 }).not.toMatchObjectType<{ a: number; c?: number }>()
* ```
*
* @param MISMATCH - The mismatch arguments.
* @returns `true`.
*/
toMatchObjectType: <Expected>(...MISMATCH: MismatchArgs<StrictEqualUsingTSInternalIdenticalToOperator<Pick<Actual, keyof Actual & keyof Expected>, Expected>, false>) => true;
/**
* Check if your type extends the expected type
*
* A less strict version of {@linkcode PositiveExpectTypeOf.toEqualTypeOf | .toEqualTypeOf()} that allows for extra properties.
* This is roughly equivalent to an `extends` constraint in a function type argument.
*
* @example
* ```ts
* expectTypeOf({ a: 1, b: 1 }).toExtend<{ a: number }>()]
*
* expectTypeOf({ a: 1 }).not.toExtend<{ b: number }>()
* ```
*
* @param MISMATCH - The mismatch arguments.
* @returns `true`.
*/
toExtend<Expected>(...MISMATCH: MismatchArgs<Extends<Actual, Expected>, false>): true;
toEqualTypeOf: {
/**
* Uses TypeScript's internal technique to check for type "identicalness".
*
* It will check if the types are fully equal to each other.
* It will not fail if two objects have different values, but the same type.
* It will fail however if an object is missing a property.
*
* **_Unexpected failure_**? For a more permissive but less performant
* check that accommodates for equivalent intersection types,
* use {@linkcode PositiveExpectTypeOf.branded | .branded.toEqualTypeOf()}.
* @see {@link https://github.com/mmkal/expect-type#why-is-my-assertion-failing | The documentation for details}.
*
* @example
* <caption>Using generic type argument syntax</caption>
* ```ts
* expectTypeOf({ a: 1 }).toEqualTypeOf<{ a: number }>()
*
* expectTypeOf({ a: 1, b: 1 }).not.toEqualTypeOf<{ a: number }>()
* ```
*
* @example
* <caption>Using inferred type syntax by passing a value</caption>
* ```ts
* expectTypeOf({ a: 1 }).toEqualTypeOf({ a: 1 })
*
* expectTypeOf({ a: 1 }).toEqualTypeOf({ a: 2 })
* ```
*
* @param value - The value to compare against the expected type.
* @param MISMATCH - The mismatch arguments.
* @returns `true`.
*/
<Expected>(value: Expected & AValue, ...MISMATCH: MismatchArgs<StrictEqualUsingTSInternalIdenticalToOperator<Actual, Expected>, false>): true;
/**
* Uses TypeScript's internal technique to check for type "identicalness".
*
* It will check if the types are fully equal to each other.
* It will not fail if two objects have different values, but the same type.
* It will fail however if an object is missing a property.
*
* **_Unexpected failure_**? For a more permissive but less performant
* check that accommodates for equivalent intersection types,
* use {@linkcode PositiveExpectTypeOf.branded | .branded.toEqualTypeOf()}.
* @see {@link https://github.com/mmkal/expect-type#why-is-my-assertion-failing | The documentation for details}.
*
* @example
* <caption>Using generic type argument syntax</caption>
* ```ts
* expectTypeOf({ a: 1 }).toEqualTypeOf<{ a: number }>()
*
* expectTypeOf({ a: 1, b: 1 }).not.toEqualTypeOf<{ a: number }>()
* ```
*
* @example
* <caption>Using inferred type syntax by passing a value</caption>
* ```ts
* expectTypeOf({ a: 1 }).toEqualTypeOf({ a: 1 })
*
* expectTypeOf({ a: 1 }).toEqualTypeOf({ a: 2 })
* ```
*
* @param MISMATCH - The mismatch arguments.
* @returns `true`.
*/
<Expected>(...MISMATCH: MismatchArgs<StrictEqualUsingTSInternalIdenticalToOperator<Actual, Expected>, false>): true;
};
/**
* @deprecated Since v1.2.0 - Use either {@linkcode toMatchObjectType} or {@linkcode toExtend} instead
*
* - Use {@linkcode toMatchObjectType} to perform a strict check on a subset of your type's keys
* - Use {@linkcode toExtend} to check if your type extends the expected type
*/
toMatchTypeOf: {
/**
* @deprecated Since v1.2.0 - Use either {@linkcode toMatchObjectType} or {@linkcode toExtend} instead
*
* - Use {@linkcode toMatchObjectType} to perform a strict check on a subset of your type's keys
* - Use {@linkcode toExtend} to check if your type extends the expected type
*
* A less strict version of
* {@linkcode PositiveExpectTypeOf.toEqualTypeOf | .toEqualTypeOf()}
* that allows for extra properties.
* This is roughly equivalent to an `extends` constraint
* in a function type argument.
*
* @example
* <caption>Using generic type argument syntax</caption>
* ```ts
* expectTypeOf({ a: 1, b: 1 }).toMatchTypeOf<{ a: number }>()
* ```
*
* @example
* <caption>Using inferred type syntax by passing a value</caption>
* ```ts
* expectTypeOf({ a: 1, b: 1 }).toMatchTypeOf({ a: 2 })
* ```
*
* @param value - The value to compare against the expected type.
* @param MISMATCH - The mismatch arguments.
* @returns `true`.
*/
<Expected>(value: Expected & AValue, // reason for `& AValue`: make sure this is only the selected overload when the end-user passes a value for an inferred typearg. The `Mismatch` type does match `AValue`.
...MISMATCH: MismatchArgs<Extends<Actual, Expected>, false>): true;
/**
* @deprecated Since v1.2.0 - Use either {@linkcode toMatchObjectType} or {@linkcode toExtend} instead
*
* - Use {@linkcode toMatchObjectType} to perform a strict check on a subset of your type's keys
* - Use {@linkcode toExtend} to check if your type extends the expected type
*
* A less strict version of
* {@linkcode PositiveExpectTypeOf.toEqualTypeOf | .toEqualTypeOf()}
* that allows for extra properties.
* This is roughly equivalent to an `extends` constraint
* in a function type argument.
*
* @example
* <caption>Using generic type argument syntax</caption>
* ```ts
* expectTypeOf({ a: 1, b: 1 }).toMatchTypeOf<{ a: number }>()
* ```
*
* @example
* <caption>Using inferred type syntax by passing a value</caption>
* ```ts
* expectTypeOf({ a: 1, b: 1 }).toMatchTypeOf({ a: 2 })
* ```
*
* @param MISMATCH - The mismatch arguments.
* @returns `true`.
*/
<Expected>(...MISMATCH: MismatchArgs<Extends<Actual, Expected>, false>): true;
};
/**
* Checks whether an object has a given property.
*
* @example
* <caption>check that properties exist</caption>
* ```ts
* const obj = { a: 1, b: '' }
*
* expectTypeOf(obj).toHaveProperty('a')
*
* expectTypeOf(obj).not.toHaveProperty('c')
* ```
*
* @param key - The property key to check for.
* @param MISMATCH - The mismatch arguments.
* @returns `true`.
*/
toHaveProperty: <KeyType extends string | number | symbol>(key: KeyType, ...MISMATCH: MismatchArgs<Extends<KeyType, keyof Actual>, false>) => true;
}
/**
* Represents a conditional type that selects either
* {@linkcode PositiveExpectTypeOf} or {@linkcode NegativeExpectTypeOf} based
* on the value of the `positive` property in the {@linkcode Options} type.
*/
export type ExpectTypeOf<Actual, Options extends {
positive: boolean;
}> = Options['positive'] extends true ? PositiveExpectTypeOf<Actual> : NegativeExpectTypeOf<Actual>;
/**
* Represents the base interface for the
* {@linkcode expectTypeOf()} function.
* Provides a set of assertion methods to perform type checks on a value.
*/
export interface BaseExpectTypeOf<Actual, Options extends {
positive: boolean;
}> {
/**
* Checks whether the type of the value is `any`.
*/
toBeAny: Scolder<ExpectAny<Actual>, Options>;
/**
* Checks whether the type of the value is `unknown`.
*/
toBeUnknown: Scolder<ExpectUnknown<Actual>, Options>;
/**
* Checks whether the type of the value is `never`.
*/
toBeNever: Scolder<ExpectNever<Actual>, Options>;
/**
* Checks whether the type of the value is `function`.
*/
toBeFunction: Scolder<ExpectFunction<Actual>, Options>;
/**
* Checks whether the type of the value is `object`.
*/
toBeObject: Scolder<ExpectObject<Actual>, Options>;
/**
* Checks whether the type of the value is an {@linkcode Array}.
*/
toBeArray: Scolder<ExpectArray<Actual>, Options>;
/**
* Checks whether the type of the value is `number`.
*/
toBeNumber: Scolder<ExpectNumber<Actual>, Options>;
/**
* Checks whether the type of the value is `string`.
*/
toBeString: Scolder<ExpectString<Actual>, Options>;
/**
* Checks whether the type of the value is `boolean`.
*/
toBeBoolean: Scolder<ExpectBoolean<Actual>, Options>;
/**
* Checks whether the type of the value is `void`.
*/
toBeVoid: Scolder<ExpectVoid<Actual>, Options>;
/**
* Checks whether the type of the value is `symbol`.
*/
toBeSymbol: Scolder<ExpectSymbol<Actual>, Options>;
/**
* Checks whether the type of the value is `null`.
*/
toBeNull: Scolder<ExpectNull<Actual>, Options>;
/**
* Checks whether the type of the value is `undefined`.
*/
toBeUndefined: Scolder<ExpectUndefined<Actual>, Options>;
/**
* Checks whether the type of the value is `null` or `undefined`.
*/
toBeNullable: Scolder<ExpectNullable<Actual>, Options>;
/**
* Transform that type of the value via a callback.
*
* @param fn - A callback that transforms the input value. Note that this function is not actually called - it's only used for type inference.
* @returns A new type which can be used for further assertions.
*/
map: <T>(fn: (value: Actual) => T) => ExpectTypeOf<T, Options>;
/**
* Checks whether the type of the value is **`bigint`**.
*
* @example
* <caption>#### Distinguish between **`number`** and **`bigint`**</caption>
*
* ```ts
* import { expectTypeOf } from 'expect-type'
*
* const aVeryBigInteger = 10n ** 100n
*
* expectTypeOf(aVeryBigInteger).not.toBeNumber()
*
* expectTypeOf(aVeryBigInteger).toBeBigInt()
* ```
*
* @since 1.1.0
*/
toBeBigInt: Scolder<ExpectBigInt<Actual>, Options>;
/**
* Checks whether a function is callable with the given parameters.
*
* __Note__: You cannot negate this assertion with
* {@linkcode PositiveExpectTypeOf.not | .not}, you need to use
* `ts-expect-error` instead.
*
* @example
* ```ts
* const f = (a: number) => [a, a]
*
* expectTypeOf(f).toBeCallableWith(1)
* ```
*
* __Known Limitation__: This assertion will likely fail if you try to use it
* with a generic function or an overload.
* @see {@link https://github.com/mmkal/expect-type/issues/50 | This issue} for an example and a workaround.
*
* @param args - The arguments to check for callability.
* @returns `true`.
*/
toBeCallableWith: Options['positive'] extends true ? <Args extends OverloadParameters<Actual>>(...args: Args) => ExpectTypeOf<OverloadsNarrowedByParameters<Actual, Args>, Options> : never;
/**
* Checks whether a class is constructible with the given parameters.
*
* @example
* ```ts
* expectTypeOf(Date).toBeConstructibleWith('1970')
*
* expectTypeOf(Date).toBeConstructibleWith(0)
*
* expectTypeOf(Date).toBeConstructibleWith(new Date())
*
* expectTypeOf(Date).toBeConstructibleWith()
* ```
*
* @param args - The arguments to check for constructibility.
* @returns `true`.
*/
toBeConstructibleWith: Options['positive'] extends true ? <Args extends ConstructorOverloadParameters<Actual>>(...args: Args) => true : never;
/**
* Equivalent to the {@linkcode Extract} utility type.
* Helps narrow down complex union types.
*
* @example
* ```ts
* type ResponsiveProp<T> = T | T[] | { xs?: T; sm?: T; md?: T }
*
* interface CSSProperties {
* margin?: string
* padding?: string
* }
*
* function getResponsiveProp<T>(_props: T): ResponsiveProp<T> {
* return {}
* }
*
* const cssProperties: CSSProperties = { margin: '1px', padding: '2px' }
*
* expectTypeOf(getResponsiveProp(cssProperties))
* .extract<{ xs?: any }>() // extracts the last type from a union
* .toEqualTypeOf<{
* xs?: CSSProperties
* sm?: CSSProperties
* md?: CSSProperties
* }>()
*
* expectTypeOf(getResponsiveProp(cssProperties))
* .extract<unknown[]>() // extracts an array from a union
* .toEqualTypeOf<CSSProperties[]>()
* ```
*
* __Note__: If no type is found in the union, it will return `never`.
*
* @param v - The type to extract from the union.
* @returns The type after extracting the type from the union.
*/
extract: <V>(v?: V) => ExpectTypeOf<Extract<Actual, V>, Options>;
/**
* Equivalent to the {@linkcode Exclude} utility type.
* Removes types from a union.
*
* @example
* ```ts
* type ResponsiveProp<T> = T | T[] | { xs?: T; sm?: T; md?: T }
*
* interface CSSProperties {
* margin?: string
* padding?: string
* }
*
* function getResponsiveProp<T>(_props: T): ResponsiveProp<T> {
* return {}
* }
*
* const cssProperties: CSSProperties = { margin: '1px', padding: '2px' }
*
* expectTypeOf(getResponsiveProp(cssProperties))
* .exclude<unknown[]>()
* .exclude<{ xs?: unknown }>() // or just `.exclude<unknown[] | { xs?: unknown }>()`
* .toEqualTypeOf<CSSProperties>()
* ```
*/
exclude: <V>(v?: V) => ExpectTypeOf<Exclude<Actual, V>, Options>;
/**
* Equivalent to the {@linkcode Pick} utility type.
* Helps select a subset of properties from an object type.
*
* @example
* ```ts
* interface Person {
* name: string
* age: number
* }
*
* expectTypeOf<Person>()
* .pick<'name'>()
* .toEqualTypeOf<{ name: string }>()
* ```
*
* @param keyToPick - The property key to pick.
* @returns The type after picking the property.
*/
pick: <KeyToPick extends keyof Actual>(keyToPick?: KeyToPick) => ExpectTypeOf<Pick<Actual, KeyToPick>, Options>;
/**
* Equivalent to the {@linkcode Omit} utility type.
* Helps remove a subset of properties from an object type.
*
* @example
* ```ts
* interface Person {
* name: string
* age: number
* }
*
* expectTypeOf<Person>().omit<'name'>().toEqualTypeOf<{ age: number }>()
* ```
*
* @param keyToOmit - The property key to omit.
* @returns The type after omitting the property.
*/
omit: <KeyToOmit extends keyof Actual | (PropertyKey & Record<never, never>)>(keyToOmit?: KeyToOmit) => ExpectTypeOf<Omit<Actual, KeyToOmit>, Options>;
/**
* Extracts a certain function argument with `.parameter(number)` call to
* perform other assertions on it.
*
* @example
* ```ts
* function foo(a: number, b: string) {
* return [a, b]
* }
*
* expectTypeOf(foo).parameter(0).toBeNumber()
*
* expectTypeOf(foo).parameter(1).toBeString()
* ```
*
* @param index - The index of the parameter to extract.
* @returns The extracted parameter type.
*/
parameter: <Index extends number>(index: Index) => ExpectTypeOf<OverloadParameters<Actual>[Index], Options>;
/**
* Equivalent to the {@linkcode Parameters} utility type.
* Extracts function parameters to perform assertions on its value.
* Parameters are returned as an array.
*
* @example
* ```ts
* function noParam() {}
*
* function hasParam(s: string) {}
*
* expectTypeOf(noParam).parameters.toEqualTypeOf<[]>()
*
* expectTypeOf(hasParam).parameters.toEqualTypeOf<[string]>()
* ```
*/
parameters: ExpectTypeOf<OverloadParameters<Actual>, Options>;
/**
* Equivalent to the {@linkcode ConstructorParameters} utility type.
* Extracts constructor parameters as an array of values and
* perform assertions on them with this method.
*
* For overloaded constructors it will return a union of all possible parameter-tuples.
*
* @example
* ```ts
* expectTypeOf(Date).constructorParameters.toEqualTypeOf<
* [] | [string | number | Date]
* >()
* ```
*/
constructorParameters: ExpectTypeOf<ConstructorOverloadParameters<Actual>, Options>;
/**
* Equivalent to the {@linkcode ThisParameterType} utility type.
* Extracts the `this` parameter of a function to
* perform assertions on its value.
*
* @example
* ```ts
* function greet(this: { name: string }, message: string) {
* return `Hello ${this.name}, here's your message: ${message}`
* }
*
* expectTypeOf(greet).thisParameter.toEqualTypeOf<{ name: string }>()
* ```
*/
thisParameter: ExpectTypeOf<ThisParameterType<Actual>, Options>;
/**
* Equivalent to the {@linkcode InstanceType} utility type.
* Extracts the instance type of a class to perform assertions on.
*
* @example
* ```ts
* expectTypeOf(Date).instance.toHaveProperty('toISOString')
* ```
*/
instance: Actual extends new (...args: any[]) => infer I ? ExpectTypeOf<I, Options> : never;
/**
* Equivalent to the {@linkcode ReturnType} utility type.
* Extracts the return type of a function.
*
* @example
* ```ts
* expectTypeOf(() => {}).returns.toBeVoid()
*
* expectTypeOf((a: number) => [a, a]).returns.toEqualTypeOf([1, 2])
* ```
*/
returns: Actual extends Function ? ExpectTypeOf<OverloadReturnTypes<Actual>, Options> : never;
/**
* Extracts resolved value of a Promise,
* so you can perform other assertions on it.
*
* @example
* ```ts
* async function asyncFunc() {
* return 123
* }
*
* expectTypeOf(asyncFunc).returns.resolves.toBeNumber()
*
* expectTypeOf(Promise.resolve('string')).resolves.toBeString()
* ```
*
* Type Equivalent:
* ```ts
* type Resolves<PromiseType> = PromiseType extends PromiseLike<infer ResolvedType>
* ? ResolvedType
* : never
* ```
*/
resolves: Actual extends PromiseLike<infer ResolvedType> ? ExpectTypeOf<ResolvedType, Options> : never;
/**
* Extracts array item type to perform assertions on.
*
* @example
* ```ts
* expectTypeOf([1, 2, 3]).items.toEqualTypeOf<number>()
*
* expectTypeOf([1, 2, 3]).items.not.toEqualTypeOf<string>()
* ```
*
* __Type Equivalent__:
* ```ts
* type Items<ArrayType> = ArrayType extends ArrayLike<infer ItemType>
* ? ItemType
* : never
* ```
*/
items: Actual extends ArrayLike<infer ItemType> ? ExpectTypeOf<ItemType, Options> : never;
/**
* Extracts the type guarded by a function to perform assertions on.
*
* @example
* ```ts
* function isString(v: any): v is string {
* return typeof v === 'string'
* }
*
* expectTypeOf(isString).guards.toBeString()
* ```
*/
guards: Actual extends (v: any, ...args: any[]) => v is infer T ? ExpectTypeOf<T, Options> : never;
/**
* Extracts the type asserted by a function to perform assertions on.
*
* @example
* ```ts
* function assertNumber(v: any): asserts v is number {
* if (typeof v !== 'number')
* throw new TypeError('Nope !')
* }
*
* expectTypeOf(assertNumber).asserts.toBeNumber()
* ```
*/
asserts: Actual extends (v: any, ...args: any[]) => asserts v is infer T ? unknown extends T ? never : ExpectTypeOf<T, Options> : never;
}
/**
* Represents a function that allows asserting the expected type of a value.
*/
export type _ExpectTypeOf = {
/**
* Asserts the expected type of a value.
*
* @param actual - The actual value being asserted.
* @returns An object representing the expected type assertion.
*/
<Actual>(actual: Actual): ExpectTypeOf<Actual, {
positive: true;
branded: false;
}>;
/**
* Asserts the expected type of a value without providing an actual value.
*
* @returns An object representing the expected type assertion.
*/
<Actual>(): ExpectTypeOf<Actual, {
positive: true;
branded: false;
}>;
};
/**
* Similar to Jest's `expect`, but with type-awareness.
* Gives you access to a number of type-matchers that let you make assertions about the
* form of a reference or generic type parameter.
*
* @example
* ```ts
* import { foo, bar } from '../foo'
* import { expectTypeOf } from 'expect-type'
*
* test('foo types', () => {
* // make sure `foo` has type { a: number }
* expectTypeOf(foo).toMatchTypeOf({ a: 1 })
* expectTypeOf(foo).toHaveProperty('a').toBeNumber()
*
* // make sure `bar` is a function taking a string:
* expectTypeOf(bar).parameter(0).toBeString()
* expectTypeOf(bar).returns.not.toBeAny()
* })
* ```
*
* @description
* See the [full docs](https://npmjs.com/package/expect-type#documentation) for lots more examples.
*/
export declare const expectTypeOf: _ExpectTypeOf;
@@ -0,0 +1,96 @@
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
#ifndef NAN_TYPEDARRAY_CONTENTS_H_
#define NAN_TYPEDARRAY_CONTENTS_H_
template<typename T>
class TypedArrayContents {
public:
inline explicit TypedArrayContents(v8::Local<v8::Value> from) :
length_(0), data_(NULL) {
HandleScope scope;
size_t length = 0;
void* data = NULL;
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
if (from->IsArrayBufferView()) {
v8::Local<v8::ArrayBufferView> array =
v8::Local<v8::ArrayBufferView>::Cast(from);
const size_t byte_length = array->ByteLength();
const ptrdiff_t byte_offset = array->ByteOffset();
v8::Local<v8::ArrayBuffer> buffer = array->Buffer();
length = byte_length / sizeof(T);
// Actually it's 7.9 here but this would lead to ABI issues with Node.js 13
// using 7.8 till 13.2.0.
#if (V8_MAJOR_VERSION >= 8)
data = static_cast<char*>(buffer->GetBackingStore()->Data()) + byte_offset;
#else
data = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
#endif
}
#else
if (from->IsObject() && !from->IsNull()) {
v8::Local<v8::Object> array = v8::Local<v8::Object>::Cast(from);
MaybeLocal<v8::Value> buffer = Get(array,
New<v8::String>("buffer").ToLocalChecked());
MaybeLocal<v8::Value> byte_length = Get(array,
New<v8::String>("byteLength").ToLocalChecked());
MaybeLocal<v8::Value> byte_offset = Get(array,
New<v8::String>("byteOffset").ToLocalChecked());
if (!buffer.IsEmpty() &&
!byte_length.IsEmpty() && byte_length.ToLocalChecked()->IsUint32() &&
!byte_offset.IsEmpty() && byte_offset.ToLocalChecked()->IsUint32()) {
data = array->GetIndexedPropertiesExternalArrayData();
if(data) {
length = byte_length.ToLocalChecked()->Uint32Value() / sizeof(T);
}
}
}
#endif
#if defined(_MSC_VER) && _MSC_VER >= 1900 || __cplusplus >= 201103L
assert(reinterpret_cast<uintptr_t>(data) % alignof (T) == 0);
#elif defined(_MSC_VER) && _MSC_VER >= 1600 || defined(__GNUC__)
assert(reinterpret_cast<uintptr_t>(data) % __alignof(T) == 0);
#else
assert(reinterpret_cast<uintptr_t>(data) % sizeof (T) == 0);
#endif
length_ = length;
data_ = static_cast<T*>(data);
}
inline size_t length() const { return length_; }
inline T* operator*() { return data_; }
inline const T* operator*() const { return data_; }
private:
NAN_DISALLOW_ASSIGN_COPY_MOVE(TypedArrayContents)
// Disable heap allocation
void *operator new(size_t size);
void operator delete(void *, size_t) {
abort();
}
size_t length_;
T* data_;
};
#endif // NAN_TYPEDARRAY_CONTENTS_H_
@@ -0,0 +1 @@
module.exports={C:{"142":1.72437,"143":0.34525,"144":0.34525,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 145 146 147 3.5 3.6"},D:{"109":0.34525,"140":2.41488,"141":11.03675,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 142 143 144 145"},F:{_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"140":0.34525,"141":1.72437,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 142"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.4 15.5 15.6 16.0 16.1 16.2 16.3 16.4 16.5 16.6 17.0 17.1 17.2 17.3 17.4 17.5 17.6 18.0 18.1 18.2 18.3 18.4 18.5-18.6 26.0 26.1 26.2"},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00028,"5.0-5.1":0,"6.0-6.1":0.0011,"7.0-7.1":0.00083,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00248,"10.0-10.2":0.00028,"10.3":0.00468,"11.0-11.2":0.06943,"11.3-11.4":0.00165,"12.0-12.1":0.00055,"12.2-12.5":0.0135,"13.0-13.1":0,"13.2":0.00138,"13.3":0.00055,"13.4-13.7":0.0022,"14.0-14.4":0.00468,"14.5-14.8":0.00496,"15.0-15.1":0.00468,"15.2-15.3":0.00358,"15.4":0.00413,"15.5":0.00468,"15.6-15.8":0.06116,"16.0":0.00827,"16.1":0.01543,"16.2":0.00799,"16.3":0.01433,"16.4":0.00358,"16.5":0.00634,"16.6-16.7":0.08182,"17.0":0.00579,"17.1":0.00882,"17.2":0.00634,"17.3":0.00937,"17.4":0.01653,"17.5":0.02838,"17.6-17.7":0.07163,"18.0":0.01625,"18.1":0.03361,"18.2":0.01818,"18.3":0.05841,"18.4":0.03003,"18.5-18.6":1.53124,"26.0":0.18927,"26.1":0.00689},P:{_:"4 20 21 22 23 24 25 26 27 28 29 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{_:"0"},Q:{_:"14.9"},O:{_:"0"},H:{"0":0},L:{"0":78.62023}};
@@ -0,0 +1,44 @@
/**
* Copyright (c) 2019, Microsoft Corporation (MIT License).
*/
#define NODE_ADDON_API_DISABLE_DEPRECATED
#include <napi.h>
#include <windows.h>
static Napi::Value ApiConsoleProcessList(const Napi::CallbackInfo& info) {
Napi::Env env(info.Env());
if (info.Length() != 1 ||
!info[0].IsNumber()) {
throw Napi::Error::New(env, "Usage: getConsoleProcessList(shellPid)");
}
const DWORD pid = info[0].As<Napi::Number>().Uint32Value();
if (!FreeConsole()) {
throw Napi::Error::New(env, "FreeConsole failed");
}
if (!AttachConsole(pid)) {
throw Napi::Error::New(env, "AttachConsole failed");
}
auto processList = std::vector<DWORD>(64);
auto processCount = GetConsoleProcessList(&processList[0], static_cast<DWORD>(processList.size()));
if (processList.size() < processCount) {
processList.resize(processCount);
processCount = GetConsoleProcessList(&processList[0], static_cast<DWORD>(processList.size()));
}
FreeConsole();
Napi::Array result = Napi::Array::New(env);
for (DWORD i = 0; i < processCount; i++) {
result.Set(i, Napi::Number::New(env, processList[i]));
}
return result;
}
Napi::Object init(Napi::Env env, Napi::Object exports) {
exports.Set("getConsoleProcessList", Napi::Function::New(env, ApiConsoleProcessList));
return exports;
};
NODE_API_MODULE(NODE_GYP_MODULE_NAME, init);
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 typescript-eslint and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,60 @@
'use strict';
var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve);
var _ModuleCache = require('eslint-module-utils/ModuleCache');var _ModuleCache2 = _interopRequireDefault(_ModuleCache);
var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor);
var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} /**
* @fileOverview Ensures that an imported path exists, given resolution rules.
* @author Ben Mosher
*/module.exports = { meta: {
type: 'problem',
docs: {
category: 'Static analysis',
description: 'Ensure imports point to a file/module that can be resolved.',
url: (0, _docsUrl2['default'])('no-unresolved') },
schema: [
(0, _moduleVisitor.makeOptionsSchema)({
caseSensitive: { type: 'boolean', 'default': true },
caseSensitiveStrict: { type: 'boolean', 'default': false } })] },
create: function () {function create(context) {
var options = context.options[0] || {};
function checkSourceValue(source, node) {
// ignore type-only imports and exports
if (node.importKind === 'type' || node.exportKind === 'type') {
return;
}
var caseSensitive = !_resolve.CASE_SENSITIVE_FS && options.caseSensitive !== false;
var caseSensitiveStrict = !_resolve.CASE_SENSITIVE_FS && options.caseSensitiveStrict;
var resolvedPath = (0, _resolve2['default'])(source.value, context);
if (resolvedPath === undefined) {
context.report(
source, 'Unable to resolve path to module \'' + String(
source.value) + '\'.');
} else if (caseSensitive || caseSensitiveStrict) {
var cacheSettings = _ModuleCache2['default'].getSettings(context.settings);
if (!(0, _resolve.fileExistsWithCaseSync)(resolvedPath, cacheSettings, caseSensitiveStrict)) {
context.report(
source, 'Casing of ' + String(
source.value) + ' does not match the underlying filesystem.');
}
}
}
return (0, _moduleVisitor2['default'])(checkSourceValue, options);
}return create;}() };
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLC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MocmVzb2x2ZWRQYXRoLCBjYWNoZVNldHRpbmdzLCBjYXNlU2Vuc2l0aXZlU3RyaWN0KSkge1xuICAgICAgICAgIGNvbnRleHQucmVwb3J0KFxuICAgICAgICAgICAgc291cmNlLFxuICAgICAgICAgICAgYENhc2luZyBvZiAke3NvdXJjZS52YWx1ZX0gZG9lcyBub3QgbWF0Y2ggdGhlIHVuZGVybHlpbmcgZmlsZXN5c3RlbS5gLFxuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gbW9kdWxlVmlzaXRvcihjaGVja1NvdXJjZVZhbHVlLCBvcHRpb25zKTtcbiAgfSxcbn07XG4iXX0=
@@ -0,0 +1,722 @@
import { URL } from 'node:url';
import { Console } from 'node:console';
// SEE https://github.com/jsdom/jsdom/blob/master/lib/jsdom/living/interfaces.js
const LIVING_KEYS = [
"DOMException",
"EventTarget",
"NamedNodeMap",
"Node",
"Attr",
"Element",
"DocumentFragment",
"DOMImplementation",
"Document",
"XMLDocument",
"CharacterData",
"Text",
"CDATASection",
"ProcessingInstruction",
"Comment",
"DocumentType",
"NodeList",
"RadioNodeList",
"HTMLCollection",
"HTMLOptionsCollection",
"DOMStringMap",
"DOMTokenList",
"StyleSheetList",
"HTMLElement",
"HTMLHeadElement",
"HTMLTitleElement",
"HTMLBaseElement",
"HTMLLinkElement",
"HTMLMetaElement",
"HTMLStyleElement",
"HTMLBodyElement",
"HTMLHeadingElement",
"HTMLParagraphElement",
"HTMLHRElement",
"HTMLPreElement",
"HTMLUListElement",
"HTMLOListElement",
"HTMLLIElement",
"HTMLMenuElement",
"HTMLDListElement",
"HTMLDivElement",
"HTMLAnchorElement",
"HTMLAreaElement",
"HTMLBRElement",
"HTMLButtonElement",
"HTMLCanvasElement",
"HTMLDataElement",
"HTMLDataListElement",
"HTMLDetailsElement",
"HTMLDialogElement",
"HTMLDirectoryElement",
"HTMLFieldSetElement",
"HTMLFontElement",
"HTMLFormElement",
"HTMLHtmlElement",
"HTMLImageElement",
"HTMLInputElement",
"HTMLLabelElement",
"HTMLLegendElement",
"HTMLMapElement",
"HTMLMarqueeElement",
"HTMLMediaElement",
"HTMLMeterElement",
"HTMLModElement",
"HTMLOptGroupElement",
"HTMLOptionElement",
"HTMLOutputElement",
"HTMLPictureElement",
"HTMLProgressElement",
"HTMLQuoteElement",
"HTMLScriptElement",
"HTMLSelectElement",
"HTMLSlotElement",
"HTMLSourceElement",
"HTMLSpanElement",
"HTMLTableCaptionElement",
"HTMLTableCellElement",
"HTMLTableColElement",
"HTMLTableElement",
"HTMLTimeElement",
"HTMLTableRowElement",
"HTMLTableSectionElement",
"HTMLTemplateElement",
"HTMLTextAreaElement",
"HTMLUnknownElement",
"HTMLFrameElement",
"HTMLFrameSetElement",
"HTMLIFrameElement",
"HTMLEmbedElement",
"HTMLObjectElement",
"HTMLParamElement",
"HTMLVideoElement",
"HTMLAudioElement",
"HTMLTrackElement",
"HTMLFormControlsCollection",
"SVGElement",
"SVGGraphicsElement",
"SVGSVGElement",
"SVGTitleElement",
"SVGAnimatedString",
"SVGNumber",
"SVGStringList",
"Event",
"CloseEvent",
"CustomEvent",
"MessageEvent",
"ErrorEvent",
"HashChangeEvent",
"PopStateEvent",
"StorageEvent",
"ProgressEvent",
"PageTransitionEvent",
"SubmitEvent",
"UIEvent",
"FocusEvent",
"InputEvent",
"MouseEvent",
"KeyboardEvent",
"TouchEvent",
"CompositionEvent",
"WheelEvent",
"BarProp",
"External",
"Location",
"History",
"Screen",
"Crypto",
"Performance",
"Navigator",
"PluginArray",
"MimeTypeArray",
"Plugin",
"MimeType",
"FileReader",
"FormData",
"Blob",
"File",
"FileList",
"ValidityState",
"DOMParser",
"XMLSerializer",
"XMLHttpRequestEventTarget",
"XMLHttpRequestUpload",
"XMLHttpRequest",
"WebSocket",
"NodeFilter",
"NodeIterator",
"TreeWalker",
"AbstractRange",
"Range",
"StaticRange",
"Selection",
"Storage",
"CustomElementRegistry",
"ShadowRoot",
"MutationObserver",
"MutationRecord",
"Uint8Array",
"Uint16Array",
"Uint32Array",
"Uint8ClampedArray",
"Int8Array",
"Int16Array",
"Int32Array",
"Float32Array",
"Float64Array",
"ArrayBuffer",
"DOMRectReadOnly",
"DOMRect",
"Image",
"Audio",
"Option",
"CSS"
];
const OTHER_KEYS = [
"addEventListener",
"alert",
"blur",
"cancelAnimationFrame",
"close",
"confirm",
"createPopup",
"dispatchEvent",
"document",
"focus",
"frames",
"getComputedStyle",
"history",
"innerHeight",
"innerWidth",
"length",
"location",
"matchMedia",
"moveBy",
"moveTo",
"name",
"navigator",
"open",
"outerHeight",
"outerWidth",
"pageXOffset",
"pageYOffset",
"parent",
"postMessage",
"print",
"prompt",
"removeEventListener",
"requestAnimationFrame",
"resizeBy",
"resizeTo",
"screen",
"screenLeft",
"screenTop",
"screenX",
"screenY",
"scroll",
"scrollBy",
"scrollLeft",
"scrollTo",
"scrollTop",
"scrollX",
"scrollY",
"self",
"stop",
"top",
"Window",
"window"
];
const KEYS = LIVING_KEYS.concat(OTHER_KEYS);
const skipKeys = [
"window",
"self",
"top",
"parent"
];
function getWindowKeys(global, win, additionalKeys = []) {
const keysArray = [...additionalKeys, ...KEYS];
return new Set(keysArray.concat(Object.getOwnPropertyNames(win)).filter((k) => {
if (skipKeys.includes(k)) return false;
if (k in global) return keysArray.includes(k);
return true;
}));
}
function isClassLikeName(name) {
return name[0] === name[0].toUpperCase();
}
function populateGlobal(global, win, options = {}) {
const { bindFunctions = false } = options;
const keys = getWindowKeys(global, win, options.additionalKeys);
const originals = /* @__PURE__ */ new Map();
const overridenKeys = new Set([...KEYS, ...options.additionalKeys || []]);
const overrideObject = /* @__PURE__ */ new Map();
for (const key of keys) {
const boundFunction = bindFunctions && typeof win[key] === "function" && !isClassLikeName(key) && win[key].bind(win);
if (overridenKeys.has(key) && key in global) originals.set(key, global[key]);
Object.defineProperty(global, key, {
get() {
if (overrideObject.has(key)) return overrideObject.get(key);
if (boundFunction) return boundFunction;
return win[key];
},
set(v) {
overrideObject.set(key, v);
},
configurable: true
});
}
global.window = global;
global.self = global;
global.top = global;
global.parent = global;
if (global.global) global.global = global;
// rewrite defaultView to reference the same global context
if (global.document && global.document.defaultView) Object.defineProperty(global.document, "defaultView", {
get: () => global,
enumerable: true,
configurable: true
});
skipKeys.forEach((k) => keys.add(k));
return {
keys,
skipKeys,
originals
};
}
var edge = {
name: "edge-runtime",
viteEnvironment: "ssr",
async setupVM() {
const { EdgeVM } = await import('@edge-runtime/vm');
const vm = new EdgeVM({ extend: (context) => {
context.global = context;
context.Buffer = Buffer;
return context;
} });
return {
getVmContext() {
return vm.context;
},
teardown() {
// nothing to teardown
}
};
},
async setup(global) {
const { EdgeVM } = await import('@edge-runtime/vm');
const { keys, originals } = populateGlobal(global, new EdgeVM({ extend: (context) => {
context.global = context;
context.Buffer = Buffer;
KEYS.forEach((key) => {
if (key in global) context[key] = global[key];
});
return context;
} }).context, { bindFunctions: true });
return { teardown(global) {
keys.forEach((key) => delete global[key]);
originals.forEach((v, k) => global[k] = v);
} };
}
};
async function teardownWindow(win) {
if (win.close && win.happyDOM.abort) {
await win.happyDOM.abort();
win.close();
} else win.happyDOM.cancelAsync();
}
var happy = {
name: "happy-dom",
viteEnvironment: "client",
async setupVM({ happyDOM = {} }) {
const { Window } = await import('happy-dom');
let win = new Window({
...happyDOM,
console: console && globalThis.console ? globalThis.console : void 0,
url: happyDOM.url || "http://localhost:3000",
settings: {
...happyDOM.settings,
disableErrorCapturing: true
}
});
// TODO: browser doesn't expose Buffer, but a lot of dependencies use it
win.Buffer = Buffer;
// inject structuredClone if it exists
if (typeof structuredClone !== "undefined" && !win.structuredClone) win.structuredClone = structuredClone;
return {
getVmContext() {
return win;
},
async teardown() {
await teardownWindow(win);
win = void 0;
}
};
},
async setup(global, { happyDOM = {} }) {
// happy-dom v3 introduced a breaking change to Window, but
// provides GlobalWindow as a way to use previous behaviour
const { Window, GlobalWindow } = await import('happy-dom');
const win = new (GlobalWindow || Window)({
...happyDOM,
console: console && global.console ? global.console : void 0,
url: happyDOM.url || "http://localhost:3000",
settings: {
...happyDOM.settings,
disableErrorCapturing: true
}
});
const { keys, originals } = populateGlobal(global, win, {
bindFunctions: true,
additionalKeys: [
"Request",
"Response",
"MessagePort",
"fetch",
"Headers",
"AbortController",
"AbortSignal",
"URL",
"URLSearchParams",
"FormData"
]
});
return { async teardown(global) {
await teardownWindow(win);
keys.forEach((key) => delete global[key]);
originals.forEach((v, k) => global[k] = v);
} };
}
};
function catchWindowErrors(window) {
let userErrorListenerCount = 0;
function throwUnhandlerError(e) {
if (userErrorListenerCount === 0 && e.error != null) {
e.preventDefault();
process.emit("uncaughtException", e.error);
}
}
const addEventListener = window.addEventListener.bind(window);
const removeEventListener = window.removeEventListener.bind(window);
window.addEventListener("error", throwUnhandlerError);
window.addEventListener = function(...args) {
if (args[0] === "error") userErrorListenerCount++;
return addEventListener.apply(this, args);
};
window.removeEventListener = function(...args) {
if (args[0] === "error" && userErrorListenerCount) userErrorListenerCount--;
return removeEventListener.apply(this, args);
};
return function clearErrorHandlers() {
window.removeEventListener("error", throwUnhandlerError);
};
}
let NodeFormData_;
let NodeBlob_;
let NodeRequest_;
var jsdom = {
name: "jsdom",
viteEnvironment: "client",
async setupVM({ jsdom = {} }) {
// delay initialization because it takes ~1s
NodeFormData_ = globalThis.FormData;
NodeBlob_ = globalThis.Blob;
NodeRequest_ = globalThis.Request;
const { CookieJar, JSDOM, ResourceLoader, VirtualConsole } = await import('jsdom');
const { html = "<!DOCTYPE html>", userAgent, url = "http://localhost:3000", contentType = "text/html", pretendToBeVisual = true, includeNodeLocations = false, runScripts = "dangerously", resources, console = false, cookieJar = false,...restOptions } = jsdom;
let virtualConsole;
if (console && globalThis.console) {
virtualConsole = new VirtualConsole();
// jsdom <27
if ("sendTo" in virtualConsole) virtualConsole.sendTo(globalThis.console);
else virtualConsole.forwardTo(globalThis.console);
}
let dom = new JSDOM(html, {
pretendToBeVisual,
resources: resources ?? (userAgent ? new ResourceLoader({ userAgent }) : void 0),
runScripts,
url,
virtualConsole,
cookieJar: cookieJar ? new CookieJar() : void 0,
includeNodeLocations,
contentType,
userAgent,
...restOptions
});
const clearAddEventListenerPatch = patchAddEventListener(dom.window);
const clearWindowErrors = catchWindowErrors(dom.window);
const utils = createCompatUtils(dom.window);
// TODO: browser doesn't expose Buffer, but a lot of dependencies use it
dom.window.Buffer = Buffer;
dom.window.jsdom = dom;
dom.window.Request = createCompatRequest(utils);
dom.window.URL = createJSDOMCompatURL(utils);
for (const name of [
"structuredClone",
"BroadcastChannel",
"MessageChannel",
"MessagePort",
"TextEncoder",
"TextDecoder"
]) {
const value = globalThis[name];
if (typeof value !== "undefined" && typeof dom.window[name] === "undefined") dom.window[name] = value;
}
for (const name of [
"fetch",
"Response",
"Headers",
"AbortController",
"AbortSignal",
"URLSearchParams"
]) {
const value = globalThis[name];
if (typeof value !== "undefined") dom.window[name] = value;
}
return {
getVmContext() {
return dom.getInternalVMContext();
},
teardown() {
clearAddEventListenerPatch();
clearWindowErrors();
dom.window.close();
dom = void 0;
}
};
},
async setup(global, { jsdom = {} }) {
// delay initialization because it takes ~1s
NodeFormData_ = globalThis.FormData;
NodeBlob_ = globalThis.Blob;
NodeRequest_ = globalThis.Request;
const { CookieJar, JSDOM, ResourceLoader, VirtualConsole } = await import('jsdom');
const { html = "<!DOCTYPE html>", userAgent, url = "http://localhost:3000", contentType = "text/html", pretendToBeVisual = true, includeNodeLocations = false, runScripts = "dangerously", resources, console = false, cookieJar = false,...restOptions } = jsdom;
let virtualConsole;
if (console && globalThis.console) {
virtualConsole = new VirtualConsole();
// jsdom <27
if ("sendTo" in virtualConsole) virtualConsole.sendTo(globalThis.console);
else virtualConsole.forwardTo(globalThis.console);
}
const dom = new JSDOM(html, {
pretendToBeVisual,
resources: resources ?? (userAgent ? new ResourceLoader({ userAgent }) : void 0),
runScripts,
url,
virtualConsole,
cookieJar: cookieJar ? new CookieJar() : void 0,
includeNodeLocations,
contentType,
userAgent,
...restOptions
});
const clearAddEventListenerPatch = patchAddEventListener(dom.window);
const { keys, originals } = populateGlobal(global, dom.window, { bindFunctions: true });
const clearWindowErrors = catchWindowErrors(global);
const utils = createCompatUtils(dom.window);
global.jsdom = dom;
global.Request = createCompatRequest(utils);
global.URL = createJSDOMCompatURL(utils);
return { teardown(global) {
clearAddEventListenerPatch();
clearWindowErrors();
dom.window.close();
delete global.jsdom;
keys.forEach((key) => delete global[key]);
originals.forEach((v, k) => global[k] = v);
} };
}
};
function createCompatRequest(utils) {
return class Request extends NodeRequest_ {
constructor(...args) {
const [input, init] = args;
if (init?.body != null) {
const compatInit = { ...init };
if (init.body instanceof utils.window.Blob) compatInit.body = utils.makeCompatBlob(init.body);
if (init.body instanceof utils.window.FormData) compatInit.body = utils.makeCompatFormData(init.body);
super(input, compatInit);
} else super(...args);
}
static [Symbol.hasInstance](instance) {
return instance instanceof NodeRequest_;
}
};
}
function createJSDOMCompatURL(utils) {
return class URL$1 extends URL {
static createObjectURL(blob) {
if (blob instanceof utils.window.Blob) {
const compatBlob = utils.makeCompatBlob(blob);
return URL.createObjectURL(compatBlob);
}
return URL.createObjectURL(blob);
}
static [Symbol.hasInstance](instance) {
return instance instanceof URL;
}
};
}
function createCompatUtils(window) {
// this returns a hidden Symbol(impl)
// this is cursed, and jsdom should just implement fetch API itself
const implSymbol = Object.getOwnPropertySymbols(Object.getOwnPropertyDescriptors(new window.Blob()))[0];
const utils = {
window,
makeCompatFormData(formData) {
const nodeFormData = new NodeFormData_();
formData.forEach((value, key) => {
if (value instanceof window.Blob) nodeFormData.append(key, utils.makeCompatBlob(value));
else nodeFormData.append(key, value);
});
return nodeFormData;
},
makeCompatBlob(blob) {
const buffer = blob[implSymbol]._buffer;
return new NodeBlob_([buffer], { type: blob.type });
}
};
return utils;
}
function patchAddEventListener(window) {
const JSDOMAbortSignal = window.AbortSignal;
const JSDOMAbortController = window.AbortController;
const originalAddEventListener = window.EventTarget.prototype.addEventListener;
window.EventTarget.prototype.addEventListener = function addEventListener(type, callback, options) {
if (typeof options === "object" && options.signal != null) {
const { signal,...otherOptions } = options;
// - this happens because AbortSignal is provided by Node.js,
// but jsdom APIs require jsdom's AbortSignal, while Node APIs
// (like fetch and Request) require a Node.js AbortSignal
// - disable narrow typing with "as any" because we need it later
if (!(signal instanceof JSDOMAbortSignal)) {
const jsdomCompatOptions = Object.create(null);
Object.assign(jsdomCompatOptions, otherOptions);
// use jsdom-native abort controller instead and forward the
// previous one with `addEventListener`
const jsdomAbortController = new JSDOMAbortController();
signal.addEventListener("abort", () => {
jsdomAbortController.abort(signal.reason);
});
jsdomCompatOptions.signal = jsdomAbortController.signal;
return originalAddEventListener.call(this, type, callback, jsdomCompatOptions);
}
}
return originalAddEventListener.call(this, type, callback, options);
};
return () => {
window.EventTarget.prototype.addEventListener = originalAddEventListener;
};
}
// some globals we do not want, either because deprecated or we set it ourselves
const denyList = new Set([
"GLOBAL",
"root",
"global",
"Buffer",
"ArrayBuffer",
"Uint8Array"
]);
const nodeGlobals = /* @__PURE__ */ new Map();
function populateNodeGlobals() {
if (nodeGlobals.size !== 0) return;
const names = Object.getOwnPropertyNames(globalThis);
const length = names.length;
for (let i = 0; i < length; i++) {
const globalName = names[i];
if (!denyList.has(globalName)) {
const descriptor = Object.getOwnPropertyDescriptor(globalThis, globalName);
if (!descriptor) throw new Error(`No property descriptor for ${globalName}, this is a bug in Vitest.`);
nodeGlobals.set(globalName, descriptor);
}
}
}
var node = {
name: "node",
viteEnvironment: "ssr",
async setupVM() {
populateNodeGlobals();
const vm = await import('node:vm');
let context = vm.createContext();
let global = vm.runInContext("this", context);
const contextGlobals = new Set(Object.getOwnPropertyNames(global));
for (const [nodeGlobalsKey, descriptor] of nodeGlobals) if (!contextGlobals.has(nodeGlobalsKey)) if (descriptor.configurable) Object.defineProperty(global, nodeGlobalsKey, {
configurable: true,
enumerable: descriptor.enumerable,
get() {
// @ts-expect-error: no index signature
const val = globalThis[nodeGlobalsKey];
// override lazy getter
Object.defineProperty(global, nodeGlobalsKey, {
configurable: true,
enumerable: descriptor.enumerable,
value: val,
writable: descriptor.writable === true || nodeGlobalsKey === "performance"
});
return val;
},
set(val) {
// override lazy getter
Object.defineProperty(global, nodeGlobalsKey, {
configurable: true,
enumerable: descriptor.enumerable,
value: val,
writable: true
});
}
});
else if ("value" in descriptor) Object.defineProperty(global, nodeGlobalsKey, {
configurable: false,
enumerable: descriptor.enumerable,
value: descriptor.value,
writable: descriptor.writable
});
else Object.defineProperty(global, nodeGlobalsKey, {
configurable: false,
enumerable: descriptor.enumerable,
get: descriptor.get,
set: descriptor.set
});
global.global = global;
global.Buffer = Buffer;
global.ArrayBuffer = ArrayBuffer;
// TextEncoder (global or via 'util') references a Uint8Array constructor
// different than the global one used by users in tests. This makes sure the
// same constructor is referenced by both.
global.Uint8Array = Uint8Array;
return {
getVmContext() {
return context;
},
teardown() {
context = void 0;
global = void 0;
}
};
},
async setup(global) {
global.console.Console = Console;
return { teardown(global) {
delete global.console.Console;
} };
}
};
const environments = {
node,
jsdom,
"happy-dom": happy,
"edge-runtime": edge
};
export { environments as e, populateGlobal as p };
@@ -0,0 +1,10 @@
/** Symbol key applied to transform types */
export declare const TransformKind: unique symbol;
/** Symbol key applied to readonly types */
export declare const ReadonlyKind: unique symbol;
/** Symbol key applied to optional types */
export declare const OptionalKind: unique symbol;
/** Symbol key applied to types */
export declare const Hint: unique symbol;
/** Symbol key applied to types */
export declare const Kind: unique symbol;
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAoBM,SAAS,0CAAc,KAAyB;IACrD,IAAI,aAAC,SAAS,EAAE,GAAG,YAAW,GAAG;IACjC,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAEhE,IAAI,SAAS,CAAA,GAAA,+BAAQ,EAAE,YAAY,gBAAgB,MAAM,CAAC;IAE1D,IAAI,UAAU;QACZ,IAAI,WACF;IAEJ;IAEA,qBACE,0DAAC,CAAA,GAAA,6CAAa,uBACZ,0DAAC;QACE,GAAG,MAAM;QACV,UAAU;QACV,SAAS;QACT,OAAO;YAAC,OAAO;YAAG,QAAQ;QAAC;;AAGnC","sources":["packages/@react-aria/overlays/src/DismissButton.tsx"],"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 {AriaLabelingProps, DOMProps} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React, {JSX} from 'react';\nimport {useLabels} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {VisuallyHidden} from '@react-aria/visually-hidden';\n\nexport interface DismissButtonProps extends AriaLabelingProps, DOMProps {\n /** Called when the dismiss button is activated. */\n onDismiss?: () => void\n}\n\n/**\n * A visually hidden button that can be used to allow screen reader\n * users to dismiss a modal or popup when there is no visual\n * affordance to do so.\n */\nexport function DismissButton(props: DismissButtonProps): JSX.Element {\n let {onDismiss, ...otherProps} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/overlays');\n\n let labels = useLabels(otherProps, stringFormatter.format('dismiss'));\n\n let onClick = () => {\n if (onDismiss) {\n onDismiss();\n }\n };\n\n return (\n <VisuallyHidden>\n <button\n {...labels}\n tabIndex={-1}\n onClick={onClick}\n style={{width: 1, height: 1}} />\n </VisuallyHidden>\n );\n}\n"],"names":[],"version":3,"file":"DismissButton.main.js.map"}
@@ -0,0 +1 @@
{"version":3,"file":"resolve-uri.umd.js","sources":["../src/resolve-uri.ts"],"sourcesContent":["// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n\ntype Url = {\n scheme: string;\n user: string;\n host: string;\n port: string;\n path: string;\n query: string;\n hash: string;\n type: UrlType;\n};\n\nconst enum UrlType {\n Empty = 1,\n Hash = 2,\n Query = 3,\n RelativePath = 4,\n AbsolutePath = 5,\n SchemeRelative = 6,\n Absolute = 7,\n}\n\nfunction isAbsoluteUrl(input: string): boolean {\n return schemeRegex.test(input);\n}\n\nfunction isSchemeRelativeUrl(input: string): boolean {\n return input.startsWith('//');\n}\n\nfunction isAbsolutePath(input: string): boolean {\n return input.startsWith('/');\n}\n\nfunction isFileUrl(input: string): boolean {\n return input.startsWith('file:');\n}\n\nfunction isRelative(input: string): boolean {\n return /^[.?#]/.test(input);\n}\n\nfunction parseAbsoluteUrl(input: string): Url {\n const match = urlRegex.exec(input)!;\n return makeUrl(\n match[1],\n match[2] || '',\n match[3],\n match[4] || '',\n match[5] || '/',\n match[6] || '',\n match[7] || '',\n );\n}\n\nfunction parseFileUrl(input: string): Url {\n const match = fileRegex.exec(input)!;\n const path = match[2];\n return makeUrl(\n 'file:',\n '',\n match[1] || '',\n '',\n isAbsolutePath(path) ? path : '/' + path,\n match[3] || '',\n match[4] || '',\n );\n}\n\nfunction makeUrl(\n scheme: string,\n user: string,\n host: string,\n port: string,\n path: string,\n query: string,\n hash: string,\n): Url {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: UrlType.Absolute,\n };\n}\n\nfunction parseUrl(input: string): Url {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = UrlType.SchemeRelative;\n return url;\n }\n\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = UrlType.AbsolutePath;\n return url;\n }\n\n if (isFileUrl(input)) return parseFileUrl(input);\n\n if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);\n\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? UrlType.Query\n : input.startsWith('#')\n ? UrlType.Hash\n : UrlType.RelativePath\n : UrlType.Empty;\n return url;\n}\n\nfunction stripPathFilename(path: string): string {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..')) return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nfunction mergePaths(url: Url, base: Url) {\n normalizePath(base, base.type);\n\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n } else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url: Url, type: UrlType) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" willLine truncated
@@ -0,0 +1,219 @@
'use strict';
var utils = require('../utils.js');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
var paddedBlocks = utils.createRule({
name: "padded-blocks",
package: "js",
meta: {
type: "layout",
docs: {
description: "Require or disallow padding within blocks"
},
fixable: "whitespace",
schema: [
{
oneOf: [
{
type: "string",
enum: ["always", "never"]
},
{
type: "object",
properties: {
blocks: {
type: "string",
enum: ["always", "never"]
},
switches: {
type: "string",
enum: ["always", "never"]
},
classes: {
type: "string",
enum: ["always", "never"]
}
},
additionalProperties: false,
minProperties: 1
}
]
},
{
type: "object",
properties: {
allowSingleLineBlocks: {
type: "boolean"
}
},
additionalProperties: false
}
],
messages: {
alwaysPadBlock: "Block must be padded by blank lines.",
neverPadBlock: "Block must not be padded by blank lines."
}
},
create(context) {
const options = {};
const typeOptions = context.options[0] || "always";
const exceptOptions = context.options[1] || {};
if (typeof typeOptions === "string") {
const shouldHavePadding = typeOptions === "always";
options.blocks = shouldHavePadding;
options.switches = shouldHavePadding;
options.classes = shouldHavePadding;
} else {
if (Object.prototype.hasOwnProperty.call(typeOptions, "blocks"))
options.blocks = typeOptions.blocks === "always";
if (Object.prototype.hasOwnProperty.call(typeOptions, "switches"))
options.switches = typeOptions.switches === "always";
if (Object.prototype.hasOwnProperty.call(typeOptions, "classes"))
options.classes = typeOptions.classes === "always";
}
if (Object.prototype.hasOwnProperty.call(exceptOptions, "allowSingleLineBlocks"))
options.allowSingleLineBlocks = exceptOptions.allowSingleLineBlocks === true;
const sourceCode = context.sourceCode;
function getOpenBrace(node) {
if (node.type === "SwitchStatement")
return sourceCode.getTokenBefore(node.cases[0]);
if (node.type === "StaticBlock")
return sourceCode.getFirstToken(node, { skip: 1 });
return sourceCode.getFirstToken(node);
}
function isComment(node) {
return node.type === "Line" || node.type === "Block";
}
function isPaddingBetweenTokens(first, second) {
return second.loc.start.line - first.loc.end.line >= 2;
}
function getFirstBlockToken(token) {
let prev;
let first = token;
do {
prev = first;
first = sourceCode.getTokenAfter(first, { includeComments: true });
} while (isComment(first) && first.loc.start.line === prev.loc.end.line);
return first;
}
function getLastBlockToken(token) {
let last = token;
let next;
do {
next = last;
last = sourceCode.getTokenBefore(last, { includeComments: true });
} while (isComment(last) && last.loc.end.line === next.loc.start.line);
return last;
}
function requirePaddingFor(node) {
switch (node.type) {
case "BlockStatement":
case "StaticBlock":
return options.blocks;
case "SwitchStatement":
return options.switches;
case "ClassBody":
return options.classes;
/* c8 ignore next */
default:
throw new Error("unreachable");
}
}
function checkPadding(node) {
const openBrace = getOpenBrace(node);
const firstBlockToken = getFirstBlockToken(openBrace);
const tokenBeforeFirst = sourceCode.getTokenBefore(firstBlockToken, { includeComments: true });
const closeBrace = sourceCode.getLastToken(node);
const lastBlockToken = getLastBlockToken(closeBrace);
const tokenAfterLast = sourceCode.getTokenAfter(lastBlockToken, { includeComments: true });
const blockHasTopPadding = isPaddingBetweenTokens(tokenBeforeFirst, firstBlockToken);
const blockHasBottomPadding = isPaddingBetweenTokens(lastBlockToken, tokenAfterLast);
if (options.allowSingleLineBlocks && utils.isTokenOnSameLine(tokenBeforeFirst, tokenAfterLast))
return;
if (requirePaddingFor(node)) {
if (!blockHasTopPadding) {
context.report({
node,
loc: {
start: tokenBeforeFirst.loc.start,
end: firstBlockToken.loc.start
},
fix(fixer) {
return fixer.insertTextAfter(tokenBeforeFirst, "\n");
},
messageId: "alwaysPadBlock"
});
}
if (!blockHasBottomPadding) {
context.report({
node,
loc: {
end: tokenAfterLast.loc.start,
start: lastBlockToken.loc.end
},
fix(fixer) {
return fixer.insertTextBefore(tokenAfterLast, "\n");
},
messageId: "alwaysPadBlock"
});
}
} else {
if (blockHasTopPadding) {
context.report({
node,
loc: {
start: tokenBeforeFirst.loc.start,
end: firstBlockToken.loc.start
},
fix(fixer) {
return fixer.replaceTextRange([tokenBeforeFirst.range[1], firstBlockToken.range[0] - firstBlockToken.loc.start.column], "\n");
},
messageId: "neverPadBlock"
});
}
if (blockHasBottomPadding) {
context.report({
node,
loc: {
end: tokenAfterLast.loc.start,
start: lastBlockToken.loc.end
},
messageId: "neverPadBlock",
fix(fixer) {
return fixer.replaceTextRange([lastBlockToken.range[1], tokenAfterLast.range[0] - tokenAfterLast.loc.start.column], "\n");
}
});
}
}
}
const rule = {};
if (Object.prototype.hasOwnProperty.call(options, "switches")) {
rule.SwitchStatement = function(node) {
if (node.cases.length === 0)
return;
checkPadding(node);
};
}
if (Object.prototype.hasOwnProperty.call(options, "blocks")) {
rule.BlockStatement = function(node) {
if (node.body.length === 0)
return;
checkPadding(node);
};
rule.StaticBlock = rule.BlockStatement;
}
if (Object.prototype.hasOwnProperty.call(options, "classes")) {
rule.ClassBody = function(node) {
if (node.body.length === 0)
return;
checkPadding(node);
};
}
return rule;
}
});
module.exports = paddedBlocks;
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 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","2":"C L"},C:{"1":"0 1 2 3 4 5 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 FB bB 0C 1C"},D:{"1":"0 1 2 3 4 5 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 AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB"},E:{"1":"C L M G 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 A B 2C ZC 3C 4C 5C 6C aC"},F:{"1":"0 1 2 3 4 5 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":"6 7 8 9 F B C G N O P aB AB BB FD GD HD ID NC uC JD OC"},G:{"1":"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 RD SD TD"},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:{"1":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:4,C:"Beacon API",D:true};
@@ -0,0 +1,6 @@
{
"private": true,
"types": "../dist/m.d.ts",
"main": "../dist/cjs/m.js",
"module": "../dist/es/m.mjs"
}
@@ -0,0 +1,27 @@
var createCompounder = require('./_createCompounder');
/**
* Converts `string`, as space separated words, to upper case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the upper cased string.
* @example
*
* _.upperCase('--foo-bar');
* // => 'FOO BAR'
*
* _.upperCase('fooBar');
* // => 'FOO BAR'
*
* _.upperCase('__foo_bar__');
* // => 'FOO BAR'
*/
var upperCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + word.toUpperCase();
});
module.exports = upperCase;
@@ -0,0 +1 @@
{"name":"micromark-extension-gfm-table","version":"2.1.1","requiresBuild":false,"files":{"license":{"checkedAt":1794532116178,"integrity":"sha512-ic4iF2Ap25Sn5T9MMw7nJ9C20WL6V01rybBBQi2Qx8cQC9/ERFEqGnove1HT65tK2TIKM30PZoOV3Qbz2FE//A==","mode":420,"size":1094},"dev/lib/edit-map.js":{"checkedAt":1794532116179,"integrity":"sha512-n1smAe7GpVkQLNGNmVrE4EFT+mHCYDarath5qbv+wYXlMqkNpR8UMSwA4j7e5y++76vA8pdIU//d1SZcj+Lq1A==","mode":420,"size":5293},"lib/edit-map.js":{"checkedAt":1794532116179,"integrity":"sha512-axD/LIX5+e7JIbJHJExbAkP3SlyReuE0LqpxpPjCf4aY4aomtr/3PVQQrR0M0k4m07DR30CxBF3loWPny2Xg6g==","mode":420,"size":5284},"dev/lib/html.js":{"checkedAt":1794532116179,"integrity":"sha512-1bkqZwzCWX0lFMsvSiqBz+JIeu14fNEQyrikcv2YR8tzThPmjNHsbN0VYIVivjCBTKafbc47+Q4bO9j7u9PpeQ==","mode":420,"size":4439},"lib/html.js":{"checkedAt":1794532116179,"integrity":"sha512-dNTC9opalZNqECWCTY/PERGlQg1kmy5VfjOXnqKQnKFcdbyW7keXV8buyWaPEeO6Kwj26vL1C0UeKbCcdWqwGQ==","mode":420,"size":3820},"dev/index.js":{"checkedAt":1794532116179,"integrity":"sha512-tIuvjGr5JIGXFLopDgj5pRbNO4R4iZuYQaV/4emPSFyvFUBVBccP1f9j4qHxq5XIIL3ARsZsfRMk6uz9zfnpOw==","mode":420,"size":84},"index.js":{"checkedAt":1794532116180,"integrity":"sha512-emODInD2vS9J/C2LABUjhcsr0/Bch10cQbk5a39d6BBL8hkc9V+SKmvcgx8Rj3eL2vvrQOQj5emXFEw7AIwHyA==","mode":420,"size":89},"dev/lib/infer.js":{"checkedAt":1794532116180,"integrity":"sha512-8MiehxBLrqWULjqBu9PAgin5or6r5s0f3+mTfS2DlqiSO9MoIGFz3+LW/5u47GqXVtelD6G8R52Kwg0F37QXrg==","mode":420,"size":1658},"lib/infer.js":{"checkedAt":1794532116180,"integrity":"sha512-C+ya+jDbX6UfDi9It1yxF/Tnl0iTqLFxsIK5DPU2Zmq6KkhXt+a7DTb1tApKYoM3dWL06ZVMrLnKXcmN/1Q83A==","mode":420,"size":1511},"dev/lib/syntax.js":{"checkedAt":1794532116180,"integrity":"sha512-hWSQcP96Yrn9UtRAD4YiSomYFxSC/Rd3ME6poDdl+hcYwzx58z1VMHhj+nLgcRN5pdbWcIIMOhjCaiWH7XM7+A==","mode":420,"size":21916},"lib/syntax.js":{"checkedAt":1794532116180,"integrity":"sha512-iWs8dyaOdWz+lId5mM/WsLmPtlCRqLdO0hHOrF4JstLsX2aAvGw+gwQjAGC0nIWcP8mapjiJZjdvYDW/VNSMGQ==","mode":420,"size":20730},"package.json":{"checkedAt":1794532116181,"integrity":"sha512-08W7YGMB/6C/EPJ5Sa0INpQMp2Tcpqfg15qdjPuBc4HjmhJw/pPQ7p1izM/B/lS2GmP1eH5p5qmQlrG04UOCgA==","mode":420,"size":3205},"dev/lib/edit-map.d.ts.map":{"checkedAt":1794532116181,"integrity":"sha512-lxewknYHupIulQI4sHiY30tmd/KairGr3FLXdJotZEbUzdKEbn9MxBt3MbYCYlZmaCtK8GwiS4A9C5WYjMJt6w==","mode":420,"size":451},"lib/edit-map.d.ts.map":{"checkedAt":1794532116181,"integrity":"sha512-lxewknYHupIulQI4sHiY30tmd/KairGr3FLXdJotZEbUzdKEbn9MxBt3MbYCYlZmaCtK8GwiS4A9C5WYjMJt6w==","mode":420,"size":451},"dev/lib/html.d.ts.map":{"checkedAt":1794532116182,"integrity":"sha512-7nuiJDksrpu5clCm1f9aEpOLdHoz93RU/3wiI7RyzxBtwCWk+9DT/of6BJAjAsRx+dEeH83fpNYOUZNQfQgJCQ==","mode":420,"size":148},"lib/html.d.ts.map":{"checkedAt":1794532116182,"integrity":"sha512-7nuiJDksrpu5clCm1f9aEpOLdHoz93RU/3wiI7RyzxBtwCWk+9DT/of6BJAjAsRx+dEeH83fpNYOUZNQfQgJCQ==","mode":420,"size":148},"dev/lib/infer.d.ts.map":{"checkedAt":1794532116182,"integrity":"sha512-bB3wYvId2x0MDzutEd8/xT94bGwpLWXeyuY1Sz7GX890ZAAOxXEWMDauQwy+6IrVoVu3r0FIegRqxLN8hF85ug==","mode":420,"size":259},"lib/infer.d.ts.map":{"checkedAt":1794532116182,"integrity":"sha512-bB3wYvId2x0MDzutEd8/xT94bGwpLWXeyuY1Sz7GX890ZAAOxXEWMDauQwy+6IrVoVu3r0FIegRqxLN8hF85ug==","mode":420,"size":259},"dev/lib/syntax.d.ts.map":{"checkedAt":1794532116182,"integrity":"sha512-i3BfqmiI5VjwPx4hac34cvgUSMMsAlYLbCGRawWqv3iBcqrmFXcDJcBEiXdnXfALhBZLEwJziR5Udt51y21edA==","mode":420,"size":250},"lib/syntax.d.ts.map":{"checkedAt":1794532116182,"integrity":"sha512-i3BfqmiI5VjwPx4hac34cvgUSMMsAlYLbCGRawWqv3iBcqrmFXcDJcBEiXdnXfALhBZLEwJziR5Udt51y21edA==","mode":420,"size":250},"readme.md":{"checkedAt":1794532116183,"integrity":"sha512-wF+mNxYPXFYpJ5v/Jta6306BKCeqPyJnL0TWEzoN9hO+VXXUMYmtaTJgo/rTAPygSiMsBkv7B8Fb0GEepVavvQ==","mode":420,"size":13505},"dev/lib/edit-map.d.ts":{"checkedAt":1794532116183,"integrity":"sha512-txse+tuD0FgAfftprCDeRP0tGQwXoreq7MLFG0En6ndSVIc11e2/GvCPqvk2HeeanrVP3zeoYdypJHlcD5SVsg==","mode":420,"size":950},"lib/edit-map.d.ts":{"checkedAt":1794532116183,"integrity":"sha512-txse+tuD0FgAfftprCDeRP0tGQwXoreq7MLFG0En6ndSVIc11e2/GvCPqvk2HeeanrVP3zeoYdypJHlcD5SVsg==","mode":420,"size":950},"dev/lib/html.d.ts":{"checkedAt":1794532116183,"integrity":"sha512-LBgAFNYoj6+Q4AI2lzSI490Po8L10Dxqhh1poi/+fuc/lYM4JpyB/yqZk9tvkqZS2Jw6HTyW3pKWbz2tYPYLdg==","mode":420,"size":403},"lib/html.d.ts":{"checkedAt":1794532116183,"integrity":"sha512-LBgAFNYoj6+Q4AI2lzSI490Po8L10Dxqhh1poi/+fuc/lYM4JpyB/yqZk9tvkqZS2Jw6HTyW3pKWbz2tYPYLdg==","mode":420,"size":403},"dev/index.d.ts":{"checkedAt":1794532116183,"integrity":"sha512-/7/Nx+kL2uVR0e/lb0vVuCBbGVNzk+3YAw4eowoxVYsQeDgxBk579IGGicMtz4rE9dc1idC5ST6C7253TT3s+A==","mode":420,"size":1273},"index.d.ts":{"checkedAt":1794532116183,"integrity":"sha512-/7/Nx+kL2uVR0e/lb0vVuCBbGVNzk+3YAw4eowoxVYsQeDgxBk579IGGicMtz4rE9dc1idC5ST6C7253TT3s+A==","mode":420,"size":1273},"dev/lib/infer.d.ts":{"checkedAt":1794532116183,"integrity":"sha512-UF2Line truncated
@@ -0,0 +1 @@
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/common/helpers.ts"],"names":[],"mappings":";;;AAKA,iCAAwC;AACxC,2CAMqB;AACrB,iCAAiC;AACjC,2CAA8C;AAC9C,2BAA2B;AAE3B;;;;GAIG;AACH,SAAS,0BAA0B,CACjC,OAA2B,EAC3B,gBAAgB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC;IAEnD,8BAA8B;IAC9B,IAAI,CAAC,wBAA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C,EAAE,CAAC,EAAE,CAAC;QACnB,wBAAwB;QACxB,MAAM,OAAO,GAAG,IAAI,qBAAQ,CAAC,EAAE,CAAC,CAAC;QACjC,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACxC,CAAC;SAAM,IAAI,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;QAC1B,wBAAwB;QACxB,MAAM,OAAO,GAAG,IAAI,qBAAQ,CAAC,EAAE,CAAC,CAAC;QACjC,OAAO,MAAM,CAAC,IAAI,CAChB,OAAO;aACJ,aAAa,EAAE;aACf,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;aAC1C,IAAI,CAAC,EAAE,CAAC,EACX,KAAK,CACNLine truncated
@@ -0,0 +1,123 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Record = Record;
exports.RecordPattern = RecordPattern;
exports.RecordKey = RecordKey;
exports.RecordValue = RecordValue;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
const index_2 = require("../never/index");
const index_3 = require("../number/index");
const index_4 = require("../object/index");
const index_5 = require("../string/index");
const index_6 = require("../union/index");
const index_7 = require("../template-literal/index");
const index_8 = require("../patterns/index");
const index_9 = require("../indexed/index");
// ------------------------------------------------------------------
// ValueGuard
// ------------------------------------------------------------------
const value_1 = require("../guard/value");
// ------------------------------------------------------------------
// TypeGuard
// ------------------------------------------------------------------
const kind_1 = require("../guard/kind");
// ------------------------------------------------------------------
// RecordCreateFromPattern
// ------------------------------------------------------------------
// prettier-ignore
function RecordCreateFromPattern(pattern, T, options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Record', type: 'object', patternProperties: { [pattern]: T } }, options);
}
// ------------------------------------------------------------------
// RecordCreateFromKeys
// ------------------------------------------------------------------
// prettier-ignore
function RecordCreateFromKeys(K, T, options) {
const result = {};
for (const K2 of K)
result[K2] = T;
return (0, index_4.Object)(result, { ...options, [index_1.Hint]: 'Record' });
}
// prettier-ignore
function FromTemplateLiteralKey(K, T, options) {
return ((0, index_7.IsTemplateLiteralFinite)(K)
? RecordCreateFromKeys((0, index_9.IndexPropertyKeys)(K), T, options)
: RecordCreateFromPattern(K.pattern, T, options));
}
// prettier-ignore
function FromUnionKey(key, type, options) {
return RecordCreateFromKeys((0, index_9.IndexPropertyKeys)((0, index_6.Union)(key)), type, options);
}
// prettier-ignore
function FromLiteralKey(key, type, options) {
return RecordCreateFromKeys([key.toString()], type, options);
}
// prettier-ignore
function FromRegExpKey(key, type, options) {
return RecordCreateFromPattern(key.source, type, options);
}
// prettier-ignore
function FromStringKey(key, type, options) {
const pattern = (0, value_1.IsUndefined)(key.pattern) ? index_8.PatternStringExact : key.pattern;
return RecordCreateFromPattern(pattern, type, options);
}
// prettier-ignore
function FromAnyKey(_, type, options) {
return RecordCreateFromPattern(index_8.PatternStringExact, type, options);
}
// prettier-ignore
function FromNeverKey(_key, type, options) {
return RecordCreateFromPattern(index_8.PatternNeverExact, type, options);
}
// prettier-ignore
function FromBooleanKey(_key, type, options) {
return (0, index_4.Object)({ true: type, false: type }, options);
}
// prettier-ignore
function FromIntegerKey(_key, type, options) {
return RecordCreateFromPattern(index_8.PatternNumberExact, type, options);
}
// prettier-ignore
function FromNumberKey(_, type, options) {
return RecordCreateFromPattern(index_8.PatternNumberExact, type, options);
}
// ------------------------------------------------------------------
// TRecordOrObject
// ------------------------------------------------------------------
/** `[Json]` Creates a Record type */
function Record(key, type, options = {}) {
// prettier-ignore
return ((0, kind_1.IsUnion)(key) ? FromUnionKey(key.anyOf, type, options) :
(0, kind_1.IsTemplateLiteral)(key) ? FromTemplateLiteralKey(key, type, options) :
(0, kind_1.IsLiteral)(key) ? FromLiteralKey(key.const, type, options) :
(0, kind_1.IsBoolean)(key) ? FromBooleanKey(key, type, options) :
(0, kind_1.IsInteger)(key) ? FromIntegerKey(key, type, options) :
(0, kind_1.IsNumber)(key) ? FromNumberKey(key, type, options) :
(0, kind_1.IsRegExp)(key) ? FromRegExpKey(key, type, options) :
(0, kind_1.IsString)(key) ? FromStringKey(key, type, options) :
(0, kind_1.IsAny)(key) ? FromAnyKey(key, type, options) :
(0, kind_1.IsNever)(key) ? FromNeverKey(key, type, options) :
(0, index_2.Never)(options));
}
// ------------------------------------------------------------------
// Record Utilities
// ------------------------------------------------------------------
/** Gets the Records Pattern */
function RecordPattern(record) {
return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
}
/** Gets the Records Key Type */
// prettier-ignore
function RecordKey(type) {
const pattern = RecordPattern(type);
return (pattern === index_8.PatternStringExact ? (0, index_5.String)() :
pattern === index_8.PatternNumberExact ? (0, index_3.Number)() :
(0, index_5.String)({ pattern }));
}
/** Gets a Record Value Type */
// prettier-ignore
function RecordValue(type) {
return type.patternProperties[RecordPattern(type)];
}
@@ -0,0 +1,6 @@
import { TSESLint } from '@typescript-eslint/utils';
import type { Selector } from './naming-convention-utils';
export type MessageIds = 'doesNotMatchFormat' | 'doesNotMatchFormatTrimmed' | 'missingAffix' | 'missingUnderscore' | 'satisfyCustom' | 'unexpectedUnderscore';
export type Options = Selector[];
declare const _default: TSESLint.RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, TSESLint.RuleListener>;
export default _default;
@@ -0,0 +1,91 @@
'use strict'
// just pre-load all the stuff that index.js lazily exports
const internalRe = require('./internal/re')
const constants = require('./internal/constants')
const SemVer = require('./classes/semver')
const identifiers = require('./internal/identifiers')
const parse = require('./functions/parse')
const valid = require('./functions/valid')
const clean = require('./functions/clean')
const inc = require('./functions/inc')
const diff = require('./functions/diff')
const major = require('./functions/major')
const minor = require('./functions/minor')
const patch = require('./functions/patch')
const prerelease = require('./functions/prerelease')
const compare = require('./functions/compare')
const rcompare = require('./functions/rcompare')
const compareLoose = require('./functions/compare-loose')
const compareBuild = require('./functions/compare-build')
const sort = require('./functions/sort')
const rsort = require('./functions/rsort')
const gt = require('./functions/gt')
const lt = require('./functions/lt')
const eq = require('./functions/eq')
const neq = require('./functions/neq')
const gte = require('./functions/gte')
const lte = require('./functions/lte')
const cmp = require('./functions/cmp')
const coerce = require('./functions/coerce')
const Comparator = require('./classes/comparator')
const Range = require('./classes/range')
const satisfies = require('./functions/satisfies')
const toComparators = require('./ranges/to-comparators')
const maxSatisfying = require('./ranges/max-satisfying')
const minSatisfying = require('./ranges/min-satisfying')
const minVersion = require('./ranges/min-version')
const validRange = require('./ranges/valid')
const outside = require('./ranges/outside')
const gtr = require('./ranges/gtr')
const ltr = require('./ranges/ltr')
const intersects = require('./ranges/intersects')
const simplifyRange = require('./ranges/simplify')
const subset = require('./ranges/subset')
module.exports = {
parse,
valid,
clean,
inc,
diff,
major,
minor,
patch,
prerelease,
compare,
rcompare,
compareLoose,
compareBuild,
sort,
rsort,
gt,
lt,
eq,
neq,
gte,
lte,
cmp,
coerce,
Comparator,
Range,
satisfies,
toComparators,
maxSatisfying,
minSatisfying,
minVersion,
validRange,
outside,
gtr,
ltr,
intersects,
simplifyRange,
subset,
SemVer,
re: internalRe.re,
src: internalRe.src,
tokens: internalRe.t,
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
RELEASE_TYPES: constants.RELEASE_TYPES,
compareIdentifiers: identifiers.compareIdentifiers,
rcompareIdentifiers: identifiers.rcompareIdentifiers,
}
@@ -0,0 +1,5 @@
var assertClassBrand = require("./assertClassBrand.js");
function _classPrivateMethodGet(s, a, r) {
return assertClassBrand(a, s), r;
}
module.exports = _classPrivateMethodGet, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,39 @@
import castPath from './_castPath.js';
import isArguments from './isArguments.js';
import isArray from './isArray.js';
import isIndex from './_isIndex.js';
import isLength from './isLength.js';
import toKey from './_toKey.js';
/**
* Checks if `path` exists on `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @param {Function} hasFunc The function to check properties.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
*/
function hasPath(object, path, hasFunc) {
path = castPath(path, object);
var index = -1,
length = path.length,
result = false;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result || ++index != length) {
return result;
}
length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isArguments(object));
}
export default hasPath;
@@ -0,0 +1,7 @@
'use strict'
const u = require('universalify').fromPromise
module.exports = {
copy: u(require('./copy')),
copySync: require('./copy-sync')
}
@@ -0,0 +1,8 @@
import _typeof from "./typeof.js";
import assertThisInitialized from "./assertThisInitialized.js";
function _possibleConstructorReturn(t, e) {
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
return assertThisInitialized(t);
}
export { _possibleConstructorReturn as default };
@@ -0,0 +1,79 @@
var $6SsBH$reactstatelyform = require("@react-stately/form");
var $6SsBH$reactstatelyutils = require("@react-stately/utils");
var $6SsBH$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useCheckboxGroupState", () => $943f4c622056df75$export$daff6da51032a415);
/*
* 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 $943f4c622056df75$export$daff6da51032a415(props = {}) {
let [selectedValues, setValue] = (0, $6SsBH$reactstatelyutils.useControlledState)(props.value, props.defaultValue || [], props.onChange);
let [initialValues] = (0, $6SsBH$react.useState)(selectedValues);
let isRequired = !!props.isRequired && selectedValues.length === 0;
let invalidValues = (0, $6SsBH$react.useRef)(new Map());
let validation = (0, $6SsBH$reactstatelyform.useFormValidationState)({
...props,
value: selectedValues
});
let isInvalid = validation.displayValidation.isInvalid;
var _props_defaultValue, _props_validationState;
const state = {
...validation,
value: selectedValues,
defaultValue: (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : initialValues,
setValue (value) {
if (props.isReadOnly || props.isDisabled) return;
setValue(value);
},
isDisabled: props.isDisabled || false,
isReadOnly: props.isReadOnly || false,
isSelected (value) {
return selectedValues.includes(value);
},
addValue (value) {
if (props.isReadOnly || props.isDisabled) return;
if (!selectedValues.includes(value)) {
selectedValues = selectedValues.concat(value);
setValue(selectedValues);
}
},
removeValue (value) {
if (props.isReadOnly || props.isDisabled) return;
if (selectedValues.includes(value)) setValue(selectedValues.filter((existingValue)=>existingValue !== value));
},
toggleValue (value) {
if (props.isReadOnly || props.isDisabled) return;
if (selectedValues.includes(value)) setValue(selectedValues.filter((existingValue)=>existingValue !== value));
else setValue(selectedValues.concat(value));
},
setInvalid (value, v) {
let s = new Map(invalidValues.current);
if (v.isInvalid) s.set(value, v);
else s.delete(value);
invalidValues.current = s;
validation.updateValidation((0, $6SsBH$reactstatelyform.mergeValidation)(...s.values()));
},
validationState: (_props_validationState = props.validationState) !== null && _props_validationState !== void 0 ? _props_validationState : isInvalid ? 'invalid' : null,
isInvalid: isInvalid,
isRequired: isRequired
};
return state;
}
//# sourceMappingURL=useCheckboxGroupState.main.js.map
@@ -0,0 +1,68 @@
var $64fc3370e682155f$exports = require("./utils.main.js");
var $6d1SX$reactariautils = require("@react-aria/utils");
var $6d1SX$reactarialabel = require("@react-aria/label");
var $6d1SX$reactariainteractions = require("@react-aria/interactions");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useCheckboxGroup", () => $253685172d17db7d$export$49ff6f28c54f1cbe);
/*
* 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 $253685172d17db7d$export$49ff6f28c54f1cbe(props, state) {
let { isDisabled: isDisabled, name: name, validationBehavior: validationBehavior = 'aria' } = props;
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $6d1SX$reactarialabel.useField)({
...props,
// Checkbox group is not an HTML input element so it
// shouldn't be labeled by a <label> element.
labelElementType: 'span',
isInvalid: isInvalid,
errorMessage: props.errorMessage || validationErrors
});
(0, $64fc3370e682155f$exports.checkboxGroupData).set(state, {
name: name,
descriptionId: descriptionProps.id,
errorMessageId: errorMessageProps.id,
validationBehavior: validationBehavior
});
let domProps = (0, $6d1SX$reactariautils.filterDOMProps)(props, {
labelable: true
});
let { focusWithinProps: focusWithinProps } = (0, $6d1SX$reactariainteractions.useFocusWithin)({
onBlurWithin: props.onBlur,
onFocusWithin: props.onFocus,
onFocusWithinChange: props.onFocusChange
});
return {
groupProps: (0, $6d1SX$reactariautils.mergeProps)(domProps, {
role: 'group',
'aria-disabled': isDisabled || undefined,
...fieldProps,
...focusWithinProps
}),
labelProps: labelProps,
descriptionProps: descriptionProps,
errorMessageProps: errorMessageProps,
isInvalid: isInvalid,
validationErrors: validationErrors,
validationDetails: validationDetails
};
}
//# sourceMappingURL=useCheckboxGroup.main.js.map
@@ -0,0 +1 @@
{"version":3,"file":"forbid-foreign-prop-types.d.ts","sourceRoot":"","sources":["forbid-foreign-prop-types.js"],"names":[],"mappings":"wBAeW,OAAO,QAAQ,EAAE,IAAI,CAAC,UAAU"}
@@ -0,0 +1,34 @@
var baseUnset = require('./_baseUnset');
/**
* Removes the property at `path` of `object`.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 7 } }] };
* _.unset(object, 'a[0].b.c');
* // => true
*
* console.log(object);
* // => { 'a': [{ 'b': {} }] };
*
* _.unset(object, ['a', '0', 'b', 'c']);
* // => true
*
* console.log(object);
* // => { 'a': [{ 'b': {} }] };
*/
function unset(object, path) {
return object == null ? true : baseUnset(object, path);
}
module.exports = unset;
@@ -0,0 +1,25 @@
var baseFlatten = require('./_baseFlatten');
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* Recursively flattens `array`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flattenDeep([1, [2, [3, [4]], 5]]);
* // => [1, 2, 3, 4, 5]
*/
function flattenDeep(array) {
var length = array == null ? 0 : array.length;
return length ? baseFlatten(array, INFINITY) : [];
}
module.exports = flattenDeep;
@@ -0,0 +1,3 @@
"use strict";
/* eslint-disable @typescript-eslint/no-namespace */
Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,44 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReturnType = ReturnType;
const type_1 = require("../create/type");
const index_1 = require("../never/index");
const KindGuard = __importStar(require("../guard/kind"));
/** `[JavaScript]` Extracts the ReturnType from the given Function type */
function ReturnType(schema, options) {
return (KindGuard.IsFunction(schema) ? (0, type_1.CreateType)(schema.returns, options) : (0, index_1.Never)(options));
}
@@ -0,0 +1,27 @@
import { PluginFunc, OpUnitType, ConfigType } from 'dayjs'
declare const plugin: PluginFunc
export = plugin
type ISOUnitType = OpUnitType | 'isoWeek';
declare module 'dayjs' {
interface Dayjs {
isoWeekYear(): number
isoWeek(): number
isoWeek(value: number): Dayjs
isoWeekday(): number
isoWeekday(value: number): Dayjs
startOf(unit: ISOUnitType): Dayjs
endOf(unit: ISOUnitType): Dayjs
isSame(date?: ConfigType, unit?: ISOUnitType): boolean
isBefore(date?: ConfigType, unit?: ISOUnitType): boolean
isAfter(date?: ConfigType, unit?: ISOUnitType): boolean
}
}
@@ -0,0 +1,9 @@
import type { TSchema } from '../schema/index.mjs';
import type { TProperties } from '../object/index.mjs';
import { Kind } from '../symbols/index.mjs';
export interface TMappedResult<T extends TProperties = TProperties> extends TSchema {
[Kind]: 'MappedResult';
properties: T;
static: unknown;
}
export declare function MappedResult<T extends TProperties>(properties: T): TMappedResult<T>;
@@ -0,0 +1 @@
{"name":"scroll-into-view-if-needed","version":"3.0.10","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532108799,"integrity":"sha512-H1mVNTrO8AVcyqc59cSLhZR4lTJYT1VWmmL7GLm2Lq20Nl0nRUEInNxAq+blmyA3jpEoSL8QYCypwdkUyBm/qA==","mode":420,"size":1067},"dist/index.cjs":{"checkedAt":1794532108799,"integrity":"sha512-ShShxpnE5u62B3pf1TSdY03JJTFl804rf+RDyb6atbCuNLbweQyQNHBQPqRsQimS67Kk64GBbHMbzRiWhAcjvQ==","mode":420,"size":669},"dist/index.js":{"checkedAt":1794532108799,"integrity":"sha512-uf6RqdpwNTMk+I62YXQuFYm8PRJ0JURMht5PlGGpsW1dXS8DH1+sE48PCNto5X8cjZlgDh0qqmmj7m45hiLanA==","mode":420,"size":655},"package.json":{"checkedAt":1794532108799,"integrity":"sha512-B15RG8S0ritzR8QwEWAB6nByG+5DJmbhY8igfivCSyTYM0YuTeExxQJNw43wYOfT9dgJqW7BJO7ySMSSjdbCTQ==","mode":420,"size":2028},"dist/index.cjs.map":{"checkedAt":1794532108799,"integrity":"sha512-kxUtELsqpH+PeRzAkJoYYHmjqaATwf7EC86EiZmZv2rXjKSjXe+g/y+u6xejtMptqmUs5GlfT0tOGFpOKKk5Ug==","mode":420,"size":5720},"dist/index.js.map":{"checkedAt":1794532108799,"integrity":"sha512-Qv1zFmVTv0RF0T3aQzSKYNqWVbqVGXR3cB7AMcL42BqM3hk+bh4QIyOtWew37iibn+rz8AiZ4lpP5w/1E6t9XQ==","mode":420,"size":5710},"README.md":{"checkedAt":1794532108799,"integrity":"sha512-JSD2ccUopFGz2YkdOxN0U03mCSRqsOc2gMlEB0KiszQ+V6Qah/ZobPIoRz7ZhGKXaNiNlZQunrNT74T2M3z6hA==","mode":420,"size":17570},"dist/index.d.ts":{"checkedAt":1794532108800,"integrity":"sha512-1m3WSvS+u+crlym7eR9VLHdSuZ7Wb0dKHzQGvteT6woGmNZwxKd66zeQd1UtCVW88rQQ+79T7QmQ4VO5qVYfXw==","mode":420,"size":2454},"src/index.ts":{"checkedAt":1794532108800,"integrity":"sha512-XevDsfuayaFuiQdZtOycODfFol1gFKu+2mNLJhJCs1JL+ZZ1NDm688tRa3Neo4sUFMXY4mm1XBctvTzEf8mh1Q==","mode":420,"size":4502},"src/types.ts":{"checkedAt":1794532108800,"integrity":"sha512-u+JCK8wEP+C9OBTKKhi9GIMT+CPEwqBx2djFsO8MoKaE8KuUMyZgOdcdYi7pTJui4dGsyrrko8OeUWrIwSqx6w==","mode":420,"size":1134}}}
@@ -0,0 +1,83 @@
/**
* @file ttf转icon
* @author mengke01(kekee000@gmail.com)
*/
import TTFReader from './ttfreader';
import error from './error';
import config from './data/default';
import {getSymbolId} from './ttf2symbol';
/**
* listUnicode
*
* @param {Array} unicode unicode
* @return {string} unicode string
*/
function listUnicode(unicode) {
return unicode.map((u) => '\\' + u.toString(16)).join(',');
}
/**
* ttf数据结构转icon数据结构
*
* @param {ttfObject} ttf ttfObject对象
* @param {Object} options 选项
* @param {Object} options.metadata 字体相关的信息
* @param {Object} options.iconPrefix icon 前缀
* @return {Object} icon obj
*/
function ttfobject2icon(ttf, options = {}) {
const glyfList = [];
// glyf 信息
const filtered = ttf.glyf.filter((g) => g.name !== '.notdef'
&& g.name !== '.null'
&& g.name !== 'nonmarkingreturn'
&& g.unicode && g.unicode.length);
filtered.forEach((g, i) => {
glyfList.push({
code: '&#x' + g.unicode[0].toString(16) + ';',
codeName: listUnicode(g.unicode),
name: g.name,
id: getSymbolId(g, i)
});
});
return {
fontFamily: ttf.name.fontFamily || config.name.fontFamily,
iconPrefix: options.iconPrefix || 'icon',
glyfList
};
}
/**
* ttf格式转换成icon
*
* @param {ArrayBuffer|ttfObject} ttfBuffer ttf缓冲数组或者ttfObject对象
* @param {Object} options 选项
* @param {Object} options.metadata 字体相关的信息
*
* @return {Object} icon object
*/
export default function ttf2icon(ttfBuffer, options = {}) {
// 读取ttf二进制流
if (ttfBuffer instanceof ArrayBuffer) {
const reader = new TTFReader();
const ttfObject = reader.read(ttfBuffer);
reader.dispose();
return ttfobject2icon(ttfObject, options);
}
// 读取ttfObject
else if (ttfBuffer.version && ttfBuffer.glyf) {
return ttfobject2icon(ttfBuffer, options);
}
error.raise(10101);
}
@@ -0,0 +1,195 @@
/*!
Copyright 2013 Lovell Fuller and others.
SPDX-License-Identifier: Apache-2.0
*/
const color = require('@img/colour');
const is = require('./is');
/**
* Colourspaces.
* @private
*/
const colourspace = {
multiband: 'multiband',
'b-w': 'b-w',
bw: 'b-w',
cmyk: 'cmyk',
srgb: 'srgb'
};
/**
* Tint the image using the provided colour.
* An alpha channel may be present and will be unchanged by the operation.
*
* @example
* const output = await sharp(input)
* .tint({ r: 255, g: 240, b: 16 })
* .toBuffer();
*
* @param {string|Object} tint - Parsed by the [color](https://www.npmjs.org/package/color) module.
* @returns {Sharp}
* @throws {Error} Invalid parameter
*/
function tint (tint) {
this._setBackgroundColourOption('tint', tint);
return this;
}
/**
* Convert to 8-bit greyscale; 256 shades of grey.
* This is a linear operation. If the input image is in a non-linear colour space such as sRGB, use `gamma()` with `greyscale()` for the best results.
* By default the output image will be web-friendly sRGB and contain three (identical) colour channels.
* This may be overridden by other sharp operations such as `toColourspace('b-w')`,
* which will produce an output image containing one colour channel.
* An alpha channel may be present, and will be unchanged by the operation.
*
* @example
* const output = await sharp(input).greyscale().toBuffer();
*
* @param {Boolean} [greyscale=true]
* @returns {Sharp}
*/
function greyscale (greyscale) {
this.options.greyscale = is.bool(greyscale) ? greyscale : true;
return this;
}
/**
* Alternative spelling of `greyscale`.
* @param {Boolean} [grayscale=true]
* @returns {Sharp}
*/
function grayscale (grayscale) {
return this.greyscale(grayscale);
}
/**
* Set the pipeline colourspace.
*
* The input image will be converted to the provided colourspace at the start of the pipeline.
* All operations will use this colourspace before converting to the output colourspace,
* as defined by {@link #tocolourspace toColourspace}.
*
* @since 0.29.0
*
* @example
* // Run pipeline in 16 bits per channel RGB while converting final result to 8 bits per channel sRGB.
* await sharp(input)
* .pipelineColourspace('rgb16')
* .toColourspace('srgb')
* .toFile('16bpc-pipeline-to-8bpc-output.png')
*
* @param {string} [colourspace] - pipeline colourspace e.g. `rgb16`, `scrgb`, `lab`, `grey16` [...](https://www.libvips.org/API/current/enum.Interpretation.html)
* @returns {Sharp}
* @throws {Error} Invalid parameters
*/
function pipelineColourspace (colourspace) {
if (!is.string(colourspace)) {
throw is.invalidParameterError('colourspace', 'string', colourspace);
}
this.options.colourspacePipeline = colourspace;
return this;
}
/**
* Alternative spelling of `pipelineColourspace`.
* @param {string} [colorspace] - pipeline colorspace.
* @returns {Sharp}
* @throws {Error} Invalid parameters
*/
function pipelineColorspace (colorspace) {
return this.pipelineColourspace(colorspace);
}
/**
* Set the output colourspace.
* By default output image will be web-friendly sRGB, with additional channels interpreted as alpha channels.
*
* @example
* // Output 16 bits per pixel RGB
* await sharp(input)
* .toColourspace('rgb16')
* .toFile('16-bpp.png')
*
* @param {string} [colourspace] - output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...](https://www.libvips.org/API/current/enum.Interpretation.html)
* @returns {Sharp}
* @throws {Error} Invalid parameters
*/
function toColourspace (colourspace) {
if (!is.string(colourspace)) {
throw is.invalidParameterError('colourspace', 'string', colourspace);
}
this.options.colourspace = colourspace;
return this;
}
/**
* Alternative spelling of `toColourspace`.
* @param {string} [colorspace] - output colorspace.
* @returns {Sharp}
* @throws {Error} Invalid parameters
*/
function toColorspace (colorspace) {
return this.toColourspace(colorspace);
}
/**
* Create a RGBA colour array from a given value.
* @private
* @param {string|Object} value
* @throws {Error} Invalid value
*/
function _getBackgroundColourOption (value) {
if (
is.object(value) ||
(is.string(value) && value.length >= 3 && value.length <= 200)
) {
const colour = color(value);
return [
colour.red(),
colour.green(),
colour.blue(),
Math.round(colour.alpha() * 255)
];
} else {
throw is.invalidParameterError('background', 'object or string', value);
}
}
/**
* Update a colour attribute of the this.options Object.
* @private
* @param {string} key
* @param {string|Object} value
* @throws {Error} Invalid value
*/
function _setBackgroundColourOption (key, value) {
if (is.defined(value)) {
this.options[key] = _getBackgroundColourOption(value);
}
}
/**
* Decorate the Sharp prototype with colour-related functions.
* @module Sharp
* @private
*/
module.exports = (Sharp) => {
Object.assign(Sharp.prototype, {
// Public
tint,
greyscale,
grayscale,
pipelineColourspace,
pipelineColorspace,
toColourspace,
toColorspace,
// Private
_getBackgroundColourOption,
_setBackgroundColourOption
});
// Class attributes
Sharp.colourspace = colourspace;
Sharp.colorspace = colourspace;
};
@@ -0,0 +1,61 @@
type Func<T extends any[], R> = (...a: T) => R
/**
* Composes single-argument functions from right to left. The rightmost
* function can take multiple arguments as it provides the signature for the
* resulting composite function.
*
* @param funcs The functions to compose.
* @returns A function obtained by composing the argument functions from right
* to left. For example, `compose(f, g, h)` is identical to doing
* `(...args) => f(g(h(...args)))`.
*/
export default function compose(): <R>(a: R) => R
export default function compose<F extends Function>(f: F): F
/* two functions */
export default function compose<A, T extends any[], R>(
f1: (a: A) => R,
f2: Func<T, A>
): Func<T, R>
/* three functions */
export default function compose<A, B, T extends any[], R>(
f1: (b: B) => R,
f2: (a: A) => B,
f3: Func<T, A>
): Func<T, R>
/* four functions */
export default function compose<A, B, C, T extends any[], R>(
f1: (c: C) => R,
f2: (b: B) => C,
f3: (a: A) => B,
f4: Func<T, A>
): Func<T, R>
/* rest */
export default function compose<R>(
f1: (a: any) => R,
...funcs: Function[]
): (...args: any[]) => R
export default function compose<R>(...funcs: Function[]): (...args: any[]) => R
export default function compose(...funcs: Function[]) {
if (funcs.length === 0) {
// infer the argument type so it is usable in inference down the line
return <T>(arg: T) => arg
}
if (funcs.length === 1) {
return funcs[0]
}
return funcs.reduce(
(a, b) =>
(...args: any) =>
a(b(...args))
)
}
@@ -0,0 +1,57 @@
# has-proto <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
Does this environment have the ability to set the [[Prototype]] of an object on creation with `__proto__`?
## Example
```js
var hasProto = require('has-proto');
var assert = require('assert');
assert.equal(typeof hasProto(), 'boolean');
var hasProtoAccessor = require('has-proto/accessor')();
if (hasProtoAccessor) {
assert.equal([].__proto__, Array.prototype);
} else {
assert(!('__proto__' in Object.prototype));
}
var hasProtoMutator = require('has-proto/mutator');
var obj = {};
assert('toString' in obj);
obj.__proto__ = null;
if (hasProtoMutator) {
assert(!('toString' in obj));
} else {
assert('toString' in obj);
assert.equal(obj.__proto__, null);
}
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/has-proto
[npm-version-svg]: https://versionbadg.es/inspect-js/has-proto.svg
[deps-svg]: https://david-dm.org/inspect-js/has-proto.svg
[deps-url]: https://david-dm.org/inspect-js/has-proto
[dev-deps-svg]: https://david-dm.org/inspect-js/has-proto/dev-status.svg
[dev-deps-url]: https://david-dm.org/inspect-js/has-proto#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/has-proto.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/has-proto.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/has-proto.svg
[downloads-url]: https://npm-stat.com/charts.html?package=has-proto
[codecov-image]: https://codecov.io/gh/inspect-js/has-proto/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/has-proto/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-proto
[actions-url]: https://github.com/inspect-js/has-proto/actions
@@ -0,0 +1 @@
{"name":"dayjs","version":"1.11.19","requiresBuild":false,"files":{".editorconfig":{"checkedAt":1794532111063,"integrity":"sha512-nulQxO/rK0Z77XAwye0zDlD38ZYcVcU4h+FeZhxRUmRfjnBU3LKQOwSmt/oP65bCLEExR6oVxv1heuSw4Zz/mw==","mode":420,"size":94},"LICENSE":{"checkedAt":1794532111064,"integrity":"sha512-lJWlfOtpGdzEuSDs/oKYI/0hzbzVZg9NyV3UvdYxJYykm/PUO2TXoRaTskLXEiiaCBHm+236emtVUbIZAXuh6Q==","mode":420,"size":1072},"plugin/advancedFormat.js":{"checkedAt":1794532111064,"integrity":"sha512-iPGj6WdOM1as3FxSpXsRTD/uNqV0CSQFaXErVo+dgUqtWi+KbKvewG1Z3eW5z4OIJgvS5E6M3G42lAt/QnXT9w==","mode":420,"size":1098},"esm/locale/af.js":{"checkedAt":1794532111064,"integrity":"sha512-ETKhD5d9e83LAtdFkXqSZnh/5BbTRLqclAJz8qBYi+T5JD6Q6ALOb/fyJS3OXpDiiRymhNuQQtGHHoX9w/hBTA==","mode":420,"size":1037},"locale/af.js":{"checkedAt":1794532111064,"integrity":"sha512-8ai+IUs/uyrjisFSCD+RQ9DbBDP757p5xKq5KPanBhBDOI8NlcpnzX7nWZM4sbq29/LF9xjKQGoQefMFSDoleQ==","mode":420,"size":1139},"esm/locale/am.js":{"checkedAt":1794532111064,"integrity":"sha512-VaU8icC+cxv/afKqGbux4zRPhYeyBnIiOVoqoYCTsv6mH2sgS1P+O3WEfdo3jTYQ2EA3yB8a+8GYolln6GbWDw==","mode":420,"size":1382},"locale/am.js":{"checkedAt":1794532111064,"integrity":"sha512-4xS0vFFqQSjSDQadjXp1CiacbS+4UI5lACo/2CK6d0QVWd09sa4yFupPljMGPRGTUc2lDxvXr/VgNaqvhgElng==","mode":420,"size":1477},"esm/locale/ar-dz.js":{"checkedAt":1794532111065,"integrity":"sha512-d6AFWmZHq2D0AKJwevVI/WsMr1H5lNdnxuLziQllhi1KG9SzQqTG7zPAl8A+NW6mBqPaueUyjgYxqf3zcgbVKQ==","mode":420,"size":1345},"locale/ar-dz.js":{"checkedAt":1794532111065,"integrity":"sha512-FRItOWCdmbjW3igBrZk2P/J0OPSa5MECh+q611pL9aCHkB208YonQ71vx8ZH9pRXkuZhX/ag8bJFRw97p8pxhA==","mode":420,"size":1409},"esm/locale/ar-iq.js":{"checkedAt":1794532111065,"integrity":"sha512-nOlv5dMs0+3xJ2ejzh1KO1szv3HOMIg1wxwqu4JSfYN3NuU5e+AimLfG9IwimwUIUNKHSsG/8AV+2ooTr4705Q==","mode":420,"size":1421},"locale/ar-iq.js":{"checkedAt":1794532111065,"integrity":"sha512-KGLsJMSf5eFlZ2fiwZ7jyrJDkifyFeTPDPyHd83hq9QDsQLn/3rDljnirWAIigOpyk3JQxW7c5TJFG0uCr1mQg==","mode":420,"size":1483},"esm/locale/ar-kw.js":{"checkedAt":1794532111065,"integrity":"sha512-TVc8O6lP0rGXAUUSSqFyHWq3+T0kXHzNeFboJWWYFi438qVB94knzHUPUVRmSHPXdR//4lbLsoWKVL0R75Ho9Q==","mode":420,"size":1324},"locale/ar-kw.js":{"checkedAt":1794532111065,"integrity":"sha512-3Boeox4yD1KaRnesS5MCbJ8p1BPB4TYXF589zNgp3EY9fPqZpu/9qzuB1N8InKyUwFwWLI5BSfVc05DwWFPoHQ==","mode":420,"size":1389},"esm/locale/ar-ly.js":{"checkedAt":1794532111066,"integrity":"sha512-tlu+Tv9OG7djdKpswtaPOdFOqqq8bAt/OMlG8CYbDzp1IEZ9dILFjVT+nKhiZyeSQdpGc83CVjtkO2En4MzGGA==","mode":420,"size":1064},"locale/ar-ly.js":{"checkedAt":1794532111066,"integrity":"sha512-rv2bqfaK7jOONPrCO3Sa/JjxlzZsgxSHlIx0ljgyNFBE3bKSJhn4LW9hUfy89xUkRiRl66JlYsgoiEfvpMbW9g==","mode":420,"size":1211},"esm/locale/ar-ma.js":{"checkedAt":1794532111066,"integrity":"sha512-r6qDcT7rA+1La3AQJeqm5LoigU/4xsE0NLM4gawiayHQllaAA/uVqkGIITwCQO+GXJSDga3k9GICFulK9mVhjQ==","mode":420,"size":1341},"locale/ar-ma.js":{"checkedAt":1794532111066,"integrity":"sha512-G2NK3RNmUATa3iG2HCdMT3axr4PNnJQPCThL4VqDMBbBkMK53u7POZyAeLTe4OthA9/2GBwm3Sb45wEUWJnQ6g==","mode":420,"size":1401},"esm/locale/ar-sa.js":{"checkedAt":1794532111066,"integrity":"sha512-DwehljoRK4eOinU4wGAn4rJqs/pKkxggICnSEQmsiN8/GLW/NOhqTTF3U7gUVVMvYp9xPR9teZMwEt1OgiNV8A==","mode":420,"size":1350},"locale/ar-sa.js":{"checkedAt":1794532111067,"integrity":"sha512-MeAiIHw/DIQsDhmrdlCpUvtLCsZLrEJvuCCAOTJ+bmfsd4LXLf6+GmF+U/HC46kDUPvCtGoKlDkxVedTXnFTeQ==","mode":420,"size":1409},"esm/locale/ar-tn.js":{"checkedAt":1794532111067,"integrity":"sha512-PCpm3VloWTesrI8rZqSfhS8U4q1PwlxHBCvaQfIlRqyskaJsX2FP7HgOo8DayfkK75JklDPNYcrUZtMn1ZqrZQ==","mode":420,"size":1346},"locale/ar-tn.js":{"checkedAt":1794532111067,"integrity":"sha512-djOV07ACq8HfXPyuJjb+LxJ/BH6Oj6uEV4AnNa+NLakZpOMkKt8M0GMrJfgi5QZKPodsEigIFlDn8Rc29FpSjA==","mode":420,"size":1405},"esm/locale/ar.js":{"checkedAt":1794532111067,"integrity":"sha512-M8z2ajBwKaQFaJRtQlxpDW/KsEHtI31+p9NuBn05NPPWokSWsQOrODHD3XRF3kyvY0WYoAX6dBj8dSQEIyIiFQ==","mode":420,"size":2086},"locale/ar.js":{"checkedAt":1794532111067,"integrity":"sha512-dkV/m5T0sFc1CbFssNofsZ/I/2zdZLF2llbVvin8xaa69FCJ/1Xxo2PlZWilX2wJc613/+ho2EZcvEKTFwqt1Q==","mode":420,"size":1728},"plugin/arraySupport.js":{"checkedAt":1794532111067,"integrity":"sha512-iYJm4UDSVaWSKlGz0PTMECttgX4Vf5PqUQggMczbL+FCb3cMRIF/p7wHKI3TCCFR2BsPV2Q82iOUnmN/lDXSJg==","mode":420,"size":576},"esm/locale/az.js":{"checkedAt":1794532111068,"integrity":"sha512-UytdJg1U8S5Xg7lYlTYBkyVutfKWWoQ6nNrkMC1mNUhW7Va0NWW7hQsjjxarDQl84yRVC8L8KWWXDF8laz+Zvg==","mode":420,"size":1084},"locale/az.js":{"checkedAt":1794532111068,"integrity":"sha512-G1QusnNrpgFr59yhpMuRa3lQQmkqyegREg8GpKiM195x9z338E60vmjLIl2V86ZbrGPC5bpG7xwejLjNKxfZAQ==","mode":420,"size":1184},"plugin/badMutable.js":{"checkedAt":1794532111068,"integrity":"sha512-xKIG35th5Feo5brcc18vfu9NhlJBgcwVpVgxQuqxGdMuxt8bpNosYQqehG7hq0ZtjTZHpnO06jz2LedsOnCZww==","mode":420,"size":987},"esm/locale/be.js":{"checkedAt":1794532111068,"integrity":"sha512-xVT7pMLine truncated
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getESLintCoreRule = void 0;
exports.maybeGetESLintCoreRule = maybeGetESLintCoreRule;
const utils_1 = require("@typescript-eslint/utils");
const use_at_your_own_risk_1 = require("eslint/use-at-your-own-risk");
const getESLintCoreRule = (ruleId) => utils_1.ESLintUtils.nullThrows(use_at_your_own_risk_1.builtinRules.get(ruleId), `ESLint's core rule '${ruleId}' not found.`);
exports.getESLintCoreRule = getESLintCoreRule;
function maybeGetESLintCoreRule(ruleId) {
try {
return (0, exports.getESLintCoreRule)(ruleId);
}
catch {
return null;
}
}
@@ -0,0 +1,15 @@
'use strict';
var $TypeError = require('es-errors/type');
var isInteger = require('math-intrinsics/isInteger');
var callBound = require('call-bound');
var $slice = callBound('String.prototype.slice');
// https://262.ecma-international.org/12.0/#substring
module.exports = function substring(S, inclusiveStart, exclusiveEnd) {
if (typeof S !== 'string' || !isInteger(inclusiveStart) || (arguments.length > 2 && !isInteger(exclusiveEnd))) {
throw new $TypeError('`S` must be a String, and `inclusiveStart` and `exclusiveEnd` must be integers');
}
return $slice(S, inclusiveStart, arguments.length > 2 ? exclusiveEnd : S.length);
};
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,oBAAoB,CAAC,sdAAgF,CAAC;AAC1H","sources":["packages/@react-aria/menu/intl/bg-BG.json"],"sourcesContent":["{\n \"longPressMessage\": \"Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто\"\n}\n"],"names":[],"version":3,"file":"bg-BG.main.js.map"}
@@ -0,0 +1,13 @@
import * as react from 'react';
import { ContextType } from './use-avatar-group.js';
import '@heroui/system';
import '@heroui/theme';
import '@heroui/react-utils';
import './avatar.js';
import './use-avatar.js';
import 'tailwind-variants';
declare const AvatarGroupProvider: react.Provider<ContextType>;
declare const useAvatarGroupContext: () => ContextType;
export { AvatarGroupProvider, useAvatarGroupContext };
@@ -0,0 +1,12 @@
'use strict';
var modulo = require('./modulo');
var msPerDay = require('../helpers/timeConstants').msPerDay;
// https://262.ecma-international.org/5.1/#sec-15.9.1.2
module.exports = function TimeWithinDay(t) {
return modulo(t, msPerDay);
};
@@ -0,0 +1 @@
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["safe.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,4BATW,KAAK,SAEL,MAAM,GAAG,IAAI,GAAG,SAAS,UAEzB,UAAU,GAER,MAAM,CAoGlB;2BAhImC,wBAAwB;gCAAxB,wBAAwB"}
@@ -0,0 +1,80 @@
# ModuleImporter
by [Nicholas C. Zakas](https://humanwhocodes.com)
If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate).
## Description
A utility for seamlessly importing modules in Node.js regardless if they are CommonJS or ESM format. Under the hood, this uses `import()` and relies on Node.js's CommonJS compatibility to work correctly. This ensures that the correct locations and formats are used for CommonJS so you can call one method and not worry about any compatibility issues.
The problem with the default `import()` is that it always resolves relative to the file location in which it is called. If you want to resolve from a different location, you need to jump through a few hoops to achieve that. This package makes it easy to both resolve and import modules from any directory.
## Usage
### Node.js
Install using [npm][npm] or [yarn][yarn]:
```
npm install @humanwhocodes/module-importer
# or
yarn add @humanwhocodes/module-importer
```
Import into your Node.js project:
```js
// CommonJS
const { ModuleImporter } = require("@humanwhocodes/module-importer");
// ESM
import { ModuleImporter } from "@humanwhocodes/module-importer";
```
### Bun
Install using this command:
```
bun add @humanwhocodes/module-importer
```
Import into your Bun project:
```js
import { ModuleImporter } from "@humanwhocodes/module-importer";
```
## API
After importing, create a new instance of `ModuleImporter` to start emitting events:
```js
// cwd can be omitted to use process.cwd()
const importer = new ModuleImporter(cwd);
// you can resolve the location of any package
const location = importer.resolve("./some-file.cjs");
// you can also import directly
const module = importer.import("./some-file.cjs");
```
For both `resolve()` and `import()`, you can pass in package names and filenames.
## Developer Setup
1. Fork the repository
2. Clone your fork
3. Run `npm install` to setup dependencies
4. Run `npm test` to run tests
## License
Apache 2.0
[npm]: https://npmjs.com/
[yarn]: https://yarnpkg.com/
@@ -0,0 +1 @@
{"name":"buffer-to-vinyl","version":"1.1.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532118479,"integrity":"sha512-JDa7wR4k7iKRGyobMvraMaQs7hRRfbFqh7cnl+45p7EPXPi6luV7gjFWGcHcbRyj7+md/to3Qx+3qLVNZLsISQ==","mode":436,"size":681},"index.js":{"checkedAt":1794532118479,"integrity":"sha512-SDKBJFL7pmxbeYLw4YOxPpumTzpu5LosoCzD1e7Mcndqit42ji2Kbne976DBxyU0aGOGKi4u3m2TEwW85Tpexg==","mode":436,"size":523},"license":{"checkedAt":1794532118479,"integrity":"sha512-SIwlcbOSq9wefE+wUWnfLc7BZ3Yr7z12d0unUIxZOlZMcu1SnR6xlA+rsAW447CvUl4A/A2dMt25ltWo5cMQcQ==","mode":436,"size":1107},"readme.md":{"checkedAt":1794532118479,"integrity":"sha512-Yq77NXTiUixR0M/fHBncGE67IJu5YcPtZXiFoSJ+49ZEgJ4kjuVZx0hSGAucvUR0FYRAs7tVcpSWCA0kf1lNeQ==","mode":436,"size":634}}}
@@ -0,0 +1 @@
{"version":3,"file":"BaseClassElementMetadata.js","sourceRoot":"","sources":["../../../../src/metadata/models/BaseClassElementMetadata.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
{
"name": "yazl",
"version": "2.5.1",
"description": "yet another zip library for node",
"main": "index.js",
"scripts": {
"test": "node test/test.js",
"test-cov": "istanbul cover test/test.js",
"test-travis": "istanbul cover --report lcovonly test/test.js"
},
"repository": {
"type": "git",
"url": "https://github.com/thejoshwolfe/yazl.git"
},
"keywords": [
"zip",
"stream",
"archive",
"file"
],
"author": "Josh Wolfe <thejoshwolfe@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/thejoshwolfe/yazl/issues"
},
"homepage": "https://github.com/thejoshwolfe/yazl",
"dependencies": {
"buffer-crc32": "~0.2.3"
},
"devDependencies": {
"bl": "~0.9.3",
"istanbul": "^0.4.5",
"yauzl": "~2.3.1"
},
"files": [
"index.js"
]
}
@@ -0,0 +1 @@
{"version":3,"file":"isInstanceBindingNode.d.ts","sourceRoot":"","sources":["../../../../src/planning/calculations/isInstanceBindingNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,qBAAqB,GAC1B,IAAI,IAAI,mBAAmB,CAE7B"}
@@ -0,0 +1,26 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2023_array = void 0;
const base_config_1 = require("./base-config");
exports.es2023_array = {
libs: [],
variables: [
['Array', base_config_1.TYPE],
['ReadonlyArray', base_config_1.TYPE],
['Int8Array', base_config_1.TYPE],
['Uint8Array', base_config_1.TYPE],
['Uint8ClampedArray', base_config_1.TYPE],
['Int16Array', base_config_1.TYPE],
['Uint16Array', base_config_1.TYPE],
['Int32Array', base_config_1.TYPE],
['Uint32Array', base_config_1.TYPE],
['Float32Array', base_config_1.TYPE],
['Float64Array', base_config_1.TYPE],
['BigInt64Array', base_config_1.TYPE],
['BigUint64Array', base_config_1.TYPE],
],
};
@@ -0,0 +1,36 @@
import { GetPacketStatusDepends } from '../../action/packet/GetPacketStatus';
import { Static } from '@sinclair/typebox';
declare const PayloadSchema: import("@sinclair/typebox").TObject<{
character: import("@sinclair/typebox").TString;
group_id: import("@sinclair/typebox").TString;
text: import("@sinclair/typebox").TString;
}>;
type PayloadType = Static<typeof PayloadSchema>;
declare const ReturnSchema: import("@sinclair/typebox").TObject<{
message_id: import("@sinclair/typebox").TNumber;
}>;
type ReturnType = Static<typeof ReturnSchema>;
export declare class SendGroupAiRecord extends GetPacketStatusDepends<PayloadType, ReturnType> {
actionName: "send_group_ai_record";
payloadSchema: import("@sinclair/typebox").TObject<{
character: import("@sinclair/typebox").TString;
group_id: import("@sinclair/typebox").TString;
text: import("@sinclair/typebox").TString;
}>;
returnSchema: import("@sinclair/typebox").TObject<{
message_id: import("@sinclair/typebox").TNumber;
}>;
actionSummary: string;
actionDescription: string;
actionTags: string[];
payloadExample: {
character: string;
group_id: string;
text: string;
};
returnExample: {};
_handle(payload: PayloadType): Promise<{
message_id: number;
}>;
}
export {};
@@ -0,0 +1,22 @@
"use strict";
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAllCommentsFromNodes = void 0;
var getAllCommentsFromNodes = function (nodes) {
return nodes.reduce(function (acc, node) {
if (Array.isArray(node.leadingComments) &&
node.leadingComments.length > 0) {
acc = __spreadArray(__spreadArray([], acc, true), node.leadingComments, true);
}
return acc;
}, []);
};
exports.getAllCommentsFromNodes = getAllCommentsFromNodes;
@@ -0,0 +1,58 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
module.exports = class LogInfoPlugin {
/**
* @param {string | ResolveStepHook} source source
*/
constructor(source) {
this.source = source;
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
const { source } = this;
resolver
.getHook(this.source)
.tapAsync("LogInfoPlugin", (request, resolveContext, callback) => {
if (!resolveContext.log) return callback();
const { log } = resolveContext;
const prefix = `[${source}] `;
if (request.path) {
log(`${prefix}Resolving in directory: ${request.path}`);
}
if (request.request) {
log(`${prefix}Resolving request: ${request.request}`);
}
if (request.module) log(`${prefix}Request is an module request.`);
if (request.directory) log(`${prefix}Request is a directory request.`);
if (request.query) {
log(`${prefix}Resolving request query: ${request.query}`);
}
if (request.fragment) {
log(`${prefix}Resolving request fragment: ${request.fragment}`);
}
if (request.descriptionFilePath) {
log(
`${prefix}Has description data from ${request.descriptionFilePath}`,
);
}
if (request.relativePath) {
log(
`${prefix}Relative path from description file is: ${request.relativePath}`,
);
}
callback();
});
}
};
@@ -0,0 +1,24 @@
/**
* The base implementation of `_.sum` and `_.sumBy` without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {number} Returns the sum.
*/
function baseSum(array, iteratee) {
var result,
index = -1,
length = array.length;
while (++index < length) {
var current = iteratee(array[index]);
if (current !== undefined) {
result = result === undefined ? current : (result + current);
}
}
return result;
}
module.exports = baseSum;
@@ -0,0 +1,72 @@
# Updating the npm-bundled version of node-gyp
**Note: These instructions are (only) tested and known to work with npm 8 and older.**
**Note: These instructions will be undone if you reinstall or upgrade npm or node! For a more permanent (and simpler) solution, see [Force-npm-to-use-global-node-gyp.md](Force-npm-to-use-global-node-gyp.md). (npm 6 or older only!)**
[Many issues](https://github.com/nodejs/node-gyp/issues?q=label%3A"ERR!+node-gyp+-v+<%3D+v9.x.x") are opened by users who are
not running a [current version of node-gyp](https://github.com/nodejs/node-gyp/releases).
`npm` bundles its own, internal, copy of `node-gyp`. This internal copy is independent of any globally installed copy of node-gyp that
may have been installed via `npm install -g node-gyp`.
This means that while `node-gyp` doesn't get installed into your `$PATH` by default, npm still keeps its own copy to invoke when you
attempt to `npm install` a native add-on.
Sometimes, you may need to update npm's internal node-gyp to a newer version than what is installed. A simple `npm install -g node-gyp`
_won't_ do the trick since npm will still continue to use its internal copy over the global one.
So instead:
## Version of npm
We need to start by knowing your version of `npm`:
```bash
npm --version
```
## Linux, macOS, Solaris, etc.
Unix is easy. Just run the following command.
If your npm is version ___7 or 8___, do:
```bash
$ npm explore npm/node_modules/@npmcli/run-script -g -- npm_config_global=false npm install node-gyp@latest
```
Else if your npm is version ___less than 7___, do:
```bash
$ npm explore npm/node_modules/npm-lifecycle -g -- npm install node-gyp@latest
```
If the command fails with a permissions error, please try `sudo` and then the command.
## Windows
Windows is a bit trickier, since `npm` might be installed to the "Program Files" directory, which needs admin privileges in order to
modify on current Windows. Therefore, run the following commands __inside a `cmd.exe` started with "Run as Administrator"__:
First we need to find the location of `node`. If you don't already know the location that `node.exe` got installed to, then run:
```bash
$ where node
```
Now `cd` to the directory that `node.exe` is contained in e.g.:
```bash
$ cd "C:\Program Files\nodejs"
```
If your npm version is ___7 or 8___, do:
```bash
cd node_modules\npm\node_modules\@npmcli\run-script
```
Else if your npm version is ___less than 7___, do:
```bash
cd node_modules\npm\node_modules\npm-lifecycle
```
Finish by running:
```bash
$ npm install node-gyp@latest
```
@@ -0,0 +1 @@
export { createSelectorCreator, weakMapMemoize } from 'reselect'
@@ -0,0 +1,116 @@
{
"name": "@sinclair/typebox",
"version": "0.34.48",
"description": "Json Schema Type Builder with Static Type Resolution for TypeScript",
"keywords": [
"typescript",
"json-schema",
"validate",
"typecheck"
],
"author": "sinclairzx81",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/sinclairzx81/typebox-legacy"
},
"scripts": {
"test": "echo test"
},
"types": "./build/cjs/index.d.ts",
"main": "./build/cjs/index.js",
"module": "./build/esm/index.mjs",
"esm.sh": {
"bundle": false
},
"sideEffects": [
"./build/esm/type/registry/format.mjs",
"./build/esm/type/registry/type.mjs",
"./build/esm/type/system/policy.mjs",
"./build/cjs/type/registry/format.js",
"./build/cjs/type/registry/type.js",
"./build/cjs/type/system/policy.js"
],
"exports": {
".": {
"require": {
"types": "./build/cjs/index.d.ts",
"default": "./build/cjs/index.js"
},
"import": {
"types": "./build/esm/index.d.mts",
"default": "./build/esm/index.mjs"
}
},
"./compiler": {
"require": {
"types": "./build/cjs/compiler/index.d.ts",
"default": "./build/cjs/compiler/index.js"
},
"import": {
"types": "./build/esm/compiler/index.d.mts",
"default": "./build/esm/compiler/index.mjs"
}
},
"./errors": {
"require": {
"types": "./build/cjs/errors/index.d.ts",
"default": "./build/cjs/errors/index.js"
},
"import": {
"types": "./build/esm/errors/index.d.mts",
"default": "./build/esm/errors/index.mjs"
}
},
"./parser": {
"require": {
"types": "./build/cjs/parser/index.d.ts",
"default": "./build/cjs/parser/index.js"
},
"import": {
"types": "./build/esm/parser/index.d.mts",
"default": "./build/esm/parser/index.mjs"
}
},
"./syntax": {
"require": {
"types": "./build/cjs/syntax/index.d.ts",
"default": "./build/cjs/syntax/index.js"
},
"import": {
"types": "./build/esm/syntax/index.d.mts",
"default": "./build/esm/syntax/index.mjs"
}
},
"./system": {
"require": {
"types": "./build/cjs/system/index.d.ts",
"default": "./build/cjs/system/index.js"
},
"import": {
"types": "./build/esm/system/index.d.mts",
"default": "./build/esm/system/index.mjs"
}
},
"./type": {
"require": {
"types": "./build/cjs/type/index.d.ts",
"default": "./build/cjs/type/index.js"
},
"import": {
"types": "./build/esm/type/index.d.mts",
"default": "./build/esm/type/index.mjs"
}
},
"./value": {
"require": {
"types": "./build/cjs/value/index.d.ts",
"default": "./build/cjs/value/index.js"
},
"import": {
"types": "./build/esm/value/index.d.mts",
"default": "./build/esm/value/index.mjs"
}
}
}
}
@@ -0,0 +1 @@
{"version":3,"file":"ClassMetadataFixtures.js","sourceRoot":"","sources":["../../../../src/metadata/fixtures/ClassMetadataFixtures.ts"],"names":[],"mappings":";;;AAAA,4CAAsE;AAEtE,MAAa,qBAAqB;IACzB,MAAM,KAAK,GAAG;QACnB,MAAM,OAAO,GAAkB;YAC7B,oBAAoB,EAAE,EAAE;YACxB,SAAS,EAAE;gBACT,wBAAwB,EAAE,IAAI,GAAG,EAAE;gBACnC,qBAAqB,EAAE,IAAI,GAAG,EAAE;aACjC;YACD,UAAU,EAAE,IAAI,GAAG,EAAE;YACrB,KAAK,EAAE,SAAS;SACjB,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,MAAM,KAAK,gBAAgB;QAChC,MAAM,OAAO,GAAkB;YAC7B,GAAG,qBAAqB,CAAC,GAAG;YAC5B,KAAK,EAAE,yBAAkB,CAAC,OAAO;SAClC,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,MAAM,KAAK,kBAAkB;QAClC,MAAM,OAAO,GAAkB;YAC7B,GAAG,qBAAqB,CAAC,GAAG;YAC5B,KAAK,EAAE,SAAS;SACjB,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAhCD,sDAgCC"}
@@ -0,0 +1,111 @@
/*
* 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.
*/
// Data from https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/weekData.json
// Locales starting on Sunday have been removed for compression.
export const weekStartData = {
'001': 1,
AD: 1,
AE: 6,
AF: 6,
AI: 1,
AL: 1,
AM: 1,
AN: 1,
AR: 1,
AT: 1,
AU: 1,
AX: 1,
AZ: 1,
BA: 1,
BE: 1,
BG: 1,
BH: 6,
BM: 1,
BN: 1,
BY: 1,
CH: 1,
CL: 1,
CM: 1,
CN: 1,
CR: 1,
CY: 1,
CZ: 1,
DE: 1,
DJ: 6,
DK: 1,
DZ: 6,
EC: 1,
EE: 1,
EG: 6,
ES: 1,
FI: 1,
FJ: 1,
FO: 1,
FR: 1,
GB: 1,
GE: 1,
GF: 1,
GP: 1,
GR: 1,
HR: 1,
HU: 1,
IE: 1,
IQ: 6,
IR: 6,
IS: 1,
IT: 1,
JO: 6,
KG: 1,
KW: 6,
KZ: 1,
LB: 1,
LI: 1,
LK: 1,
LT: 1,
LU: 1,
LV: 1,
LY: 6,
MC: 1,
MD: 1,
ME: 1,
MK: 1,
MN: 1,
MQ: 1,
MV: 5,
MY: 1,
NL: 1,
NO: 1,
NZ: 1,
OM: 6,
PL: 1,
QA: 6,
RE: 1,
RO: 1,
RS: 1,
RU: 1,
SD: 6,
SE: 1,
SI: 1,
SK: 1,
SM: 1,
SY: 6,
TJ: 1,
TM: 1,
TR: 1,
UA: 1,
UY: 1,
UZ: 1,
VA: 1,
VN: 1,
XK: 1
};
@@ -0,0 +1,25 @@
{
"author": "Felix Geisendörfer <felix@debuggable.com> (http://debuggable.com/)",
"name": "combined-stream",
"description": "A stream that emits multiple other streams one after another.",
"version": "1.0.8",
"homepage": "https://github.com/felixge/node-combined-stream",
"repository": {
"type": "git",
"url": "git://github.com/felixge/node-combined-stream.git"
},
"main": "./lib/combined_stream",
"scripts": {
"test": "node test/run.js"
},
"engines": {
"node": ">= 0.8"
},
"dependencies": {
"delayed-stream": "~1.0.0"
},
"devDependencies": {
"far": "~0.0.7"
},
"license": "MIT"
}
@@ -0,0 +1,20 @@
import type { Assert, Trim } from '../helpers/index.mjs';
import type { TTemplateLiteral, TTemplateLiteralKind } from './index.mjs';
import { type TLiteral } from '../literal/index.mjs';
import { type TBoolean } from '../boolean/index.mjs';
import { type TBigInt } from '../bigint/index.mjs';
import { type TNumber } from '../number/index.mjs';
import { type TString } from '../string/index.mjs';
import { type TUnionEvaluated } from '../union/index.mjs';
declare function FromUnion(syntax: string): IterableIterator<TTemplateLiteralKind>;
declare function FromTerminal(syntax: string): IterableIterator<TTemplateLiteralKind>;
type FromUnionLiteral<T extends string> = T extends `${infer L}|${infer R}` ? [TLiteral<Trim<L>>, ...FromUnionLiteral<R>] : T extends `${infer L}` ? [TLiteral<Trim<L>>] : [
];
type FromUnion<T extends string> = TUnionEvaluated<FromUnionLiteral<T>>;
type FromTerminal<T extends string> = T extends 'boolean' ? TBoolean : T extends 'bigint' ? TBigInt : T extends 'number' ? TNumber : T extends 'string' ? TString : FromUnion<T>;
type FromString<T extends string> = T extends `{${infer L}}${infer R}` ? [FromTerminal<L>, ...FromString<R>] : T extends `${infer L}$\{${infer R1}\}${infer R2}` ? [TLiteral<L>, ...FromString<`{${R1}}`>, ...FromString<R2>] : T extends `${infer L}$\{${infer R1}\}` ? [TLiteral<L>, ...FromString<`{${R1}}`>] : T extends `${infer L}` ? [TLiteral<L>] : [
];
export type TTemplateLiteralSyntax<T extends string> = (TTemplateLiteral<Assert<FromString<T>, TTemplateLiteralKind[]>>);
/** Parses TemplateLiteralSyntax and returns a tuple of TemplateLiteralKinds */
export declare function TemplateLiteralSyntax(syntax: string): TTemplateLiteralKind[];
export {};
@@ -0,0 +1,361 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var react = require('react');
function useCombinedRefs() {
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
refs[_key] = arguments[_key];
}
return react.useMemo(() => node => {
refs.forEach(ref => ref(node));
}, // eslint-disable-next-line react-hooks/exhaustive-deps
refs);
}
// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js
const canUseDOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';
function isWindow(element) {
const elementString = Object.prototype.toString.call(element);
return elementString === '[object Window]' || // In Electron context the Window object serializes to [object global]
elementString === '[object global]';
}
function isNode(node) {
return 'nodeType' in node;
}
function getWindow(target) {
var _target$ownerDocument, _target$ownerDocument2;
if (!target) {
return window;
}
if (isWindow(target)) {
return target;
}
if (!isNode(target)) {
return window;
}
return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window;
}
function isDocument(node) {
const {
Document
} = getWindow(node);
return node instanceof Document;
}
function isHTMLElement(node) {
if (isWindow(node)) {
return false;
}
return node instanceof getWindow(node).HTMLElement;
}
function isSVGElement(node) {
return node instanceof getWindow(node).SVGElement;
}
function getOwnerDocument(target) {
if (!target) {
return document;
}
if (isWindow(target)) {
return target.document;
}
if (!isNode(target)) {
return document;
}
if (isDocument(target)) {
return target;
}
if (isHTMLElement(target) || isSVGElement(target)) {
return target.ownerDocument;
}
return document;
}
/**
* A hook that resolves to useEffect on the server and useLayoutEffect on the client
* @param callback {function} Callback function that is invoked when the dependencies of the hook change
*/
const useIsomorphicLayoutEffect = canUseDOM ? react.useLayoutEffect : react.useEffect;
function useEvent(handler) {
const handlerRef = react.useRef(handler);
useIsomorphicLayoutEffect(() => {
handlerRef.current = handler;
});
return react.useCallback(function () {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return handlerRef.current == null ? void 0 : handlerRef.current(...args);
}, []);
}
function useInterval() {
const intervalRef = react.useRef(null);
const set = react.useCallback((listener, duration) => {
intervalRef.current = setInterval(listener, duration);
}, []);
const clear = react.useCallback(() => {
if (intervalRef.current !== null) {
clearInterval(intervalRef.current);
intervalRef.current = null;
}
}, []);
return [set, clear];
}
function useLatestValue(value, dependencies) {
if (dependencies === void 0) {
dependencies = [value];
}
const valueRef = react.useRef(value);
useIsomorphicLayoutEffect(() => {
if (valueRef.current !== value) {
valueRef.current = value;
}
}, dependencies);
return valueRef;
}
function useLazyMemo(callback, dependencies) {
const valueRef = react.useRef();
return react.useMemo(() => {
const newValue = callback(valueRef.current);
valueRef.current = newValue;
return newValue;
}, // eslint-disable-next-line react-hooks/exhaustive-deps
[...dependencies]);
}
function useNodeRef(onChange) {
const onChangeHandler = useEvent(onChange);
const node = react.useRef(null);
const setNodeRef = react.useCallback(element => {
if (element !== node.current) {
onChangeHandler == null ? void 0 : onChangeHandler(element, node.current);
}
node.current = element;
}, //eslint-disable-next-line
[]);
return [node, setNodeRef];
}
function usePrevious(value) {
const ref = react.useRef();
react.useEffect(() => {
ref.current = value;
}, [value]);
return ref.current;
}
let ids = {};
function useUniqueId(prefix, value) {
return react.useMemo(() => {
if (value) {
return value;
}
const id = ids[prefix] == null ? 0 : ids[prefix] + 1;
ids[prefix] = id;
return prefix + "-" + id;
}, [prefix, value]);
}
function createAdjustmentFn(modifier) {
return function (object) {
for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
adjustments[_key - 1] = arguments[_key];
}
return adjustments.reduce((accumulator, adjustment) => {
const entries = Object.entries(adjustment);
for (const [key, valueAdjustment] of entries) {
const value = accumulator[key];
if (value != null) {
accumulator[key] = value + modifier * valueAdjustment;
}
}
return accumulator;
}, { ...object
});
};
}
const add = /*#__PURE__*/createAdjustmentFn(1);
const subtract = /*#__PURE__*/createAdjustmentFn(-1);
function hasViewportRelativeCoordinates(event) {
return 'clientX' in event && 'clientY' in event;
}
function isKeyboardEvent(event) {
if (!event) {
return false;
}
const {
KeyboardEvent
} = getWindow(event.target);
return KeyboardEvent && event instanceof KeyboardEvent;
}
function isTouchEvent(event) {
if (!event) {
return false;
}
const {
TouchEvent
} = getWindow(event.target);
return TouchEvent && event instanceof TouchEvent;
}
/**
* Returns the normalized x and y coordinates for mouse and touch events.
*/
function getEventCoordinates(event) {
if (isTouchEvent(event)) {
if (event.touches && event.touches.length) {
const {
clientX: x,
clientY: y
} = event.touches[0];
return {
x,
y
};
} else if (event.changedTouches && event.changedTouches.length) {
const {
clientX: x,
clientY: y
} = event.changedTouches[0];
return {
x,
y
};
}
}
if (hasViewportRelativeCoordinates(event)) {
return {
x: event.clientX,
y: event.clientY
};
}
return null;
}
const CSS = /*#__PURE__*/Object.freeze({
Translate: {
toString(transform) {
if (!transform) {
return;
}
const {
x,
y
} = transform;
return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)";
}
},
Scale: {
toString(transform) {
if (!transform) {
return;
}
const {
scaleX,
scaleY
} = transform;
return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")";
}
},
Transform: {
toString(transform) {
if (!transform) {
return;
}
return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(' ');
}
},
Transition: {
toString(_ref) {
let {
property,
duration,
easing
} = _ref;
return property + " " + duration + "ms " + easing;
}
}
});
const SELECTOR = 'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]';
function findFirstFocusableNode(element) {
if (element.matches(SELECTOR)) {
return element;
}
return element.querySelector(SELECTOR);
}
exports.CSS = CSS;
exports.add = add;
exports.canUseDOM = canUseDOM;
exports.findFirstFocusableNode = findFirstFocusableNode;
exports.getEventCoordinates = getEventCoordinates;
exports.getOwnerDocument = getOwnerDocument;
exports.getWindow = getWindow;
exports.hasViewportRelativeCoordinates = hasViewportRelativeCoordinates;
exports.isDocument = isDocument;
exports.isHTMLElement = isHTMLElement;
exports.isKeyboardEvent = isKeyboardEvent;
exports.isNode = isNode;
exports.isSVGElement = isSVGElement;
exports.isTouchEvent = isTouchEvent;
exports.isWindow = isWindow;
exports.subtract = subtract;
exports.useCombinedRefs = useCombinedRefs;
exports.useEvent = useEvent;
exports.useInterval = useInterval;
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
exports.useLatestValue = useLatestValue;
exports.useLazyMemo = useLazyMemo;
exports.useNodeRef = useNodeRef;
exports.usePrevious = usePrevious;
exports.useUniqueId = useUniqueId;
//# sourceMappingURL=utilities.cjs.development.js.map
@@ -0,0 +1,627 @@
export default `flf2a$ 6 5 10 0 13
weird.flf (version 2)
by: Bas Meijer meijer@info.win.tue.nl bas@damek.kth.se
fixed by: Ryan Youck youck@cs.uregina.ca
some special characters '#%*' etc. are not matching, they are from other fonts.
Explanation of first line:
flf2 - "magic number" for file identification
a - should always be \`a', for now
$ - the "hardblank" -- prints as a blank, but can't be smushed
6 - height of a character
5 - height of a character, not including descenders
20 - max line length (excluding comment lines) + a fudge factor
15 - default smushmode for this font (like "-m 15" on command line)
13 - number of comment lines
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
@
$ / $@
$( $@
$| $@
$_ $@
@@
@
$//$@
$ $@
$ $@
$ @
@@
@
. . @
-+-+-@
-+-+-@
\` \` @
@@
$ ,_$@
$/| |@
(_|_$@
| )@
|_|/$@
$ \` $@@
@
o /@
$ /$@
$/ $@
/ o@
@@
_ @
$/ |$@
(__/$@
$/ \\)@
|__/\\@
@@
@
$/$@
$ $@
$ $@
$ @
@@
@
/@
| @
| @
| @
\\@@
@
\\ @
|@
|@
|@
/ @@
@
@
.|.@
-*-@
'|\`@
@@
@
@
| @
-+- @
| @
@@
@
$ $@
$ $@
$ $@
$ $@
/ $@@
@
$ $@
$___$@
$ $@
$ $@
@@
@
$ $@
$ $@
$ $@
$ $@
- $@@
@
/@
/ @
/ @
/ @
@@
__ @
$/ |@
( |@
| )@
|__/$@
@@
_ @
$/| $@
( | $@
$ | )@
$_|/$@
@@
__ @
$/ )@
( /$@
$ / )@
$/_/$@
@@
__ @
$ |@
$___|@
$ )@
$__/$@
@@
@
$/ |@
(___|@
$ )@
$ /$@
@@
__ @
$/ $@
|___$@
$ )@
$__/$@
@@
__ @
$/ $@
(___$@
| )@
|__/$@
@@
__ @
$/ |@
( |@
$ )@
$ /$@
@@
__ @
$/ |@
(___|@
| )@
|__/$@
@@
__ @
$/ |@
(___|@
$ )@
$__/$@
@@
@
$ $@
$_ $@
$ $@
$- $@
@@
@
$ $@
$_ $@
$ $@
$/ $@
@@
@
$/@
/$@
\\$@
$\\@
@@
$@
$@
___$@
___$@
$@
$@@
@
\\$@
$\\@
$/@
/$@
@@
__ @
$/ |@
( _|@
$ / $@
$_ $@
@@
__ @
$/ |@
( O_/@
| $@
|__/$@
@@
__ @
$/ |@
(___|@
| )@
| /$@
@@
__ @
|/ |@
|___|@
| )@
|__/$@
@@
__ @
$/ $@
( $@
| )@
|__/$@
@@
__ @
|/ |@
| |@
| )@
|__/$@
@@
__ @
$/ $@
(___$@
| $@
|__ $@
@@
___@
$/ $@
(___$@
| $@
| $@
@@
__ @
$/ $@
( __$@
| )@
|__/$@
@@
@
$/ |@
(___|@
| )@
| /$@
@@
@
$/@
($@
|$@
|$@
@@
@
$|@
$|@
$)@
_/$@
@@
@
$/ |@
(___|@
|\\ $@
| \\ $@
@@
@
$/ $@
( $@
| )@
|__/$@
@@
@
$/|/|@
( / |@
| )@
| /$@
@@
@
$/| |@
( | |@
| | )@
| |/$@
@@
__ @
$/ |@
( |@
| )@
|__/$@
@@
__ @
$/ |@
(___|@
| $@
| $@
@@
__ @
$/ |@
( |@
| \\)@
|__/\\@
@@
__ @
$/ |@
(___|@
|\\ $@
| \\ $@
@@
__ @
$/ $@
(___$@
$ )@
$__/$@
@@
__@
$/|$@
( |$@
$ |$@
$ |$@
@@
@
$/ |@
( |@
| )@
|__/$@
@@
@
$/ |@
( |@
$\\ )@
$ \\/$@
@@
@
$/ |@
( |@
| / )@
|/|/$@
@@
@
$/ /$@
(_/_$@
$/ )@
/ /$@
@@
@
$/ |@
(___|@
$ )@
$__/$@
@@
__ @
$/ /$@
( / $@
$/ )@
/__/$@
@@
_@
| @
| @
: @
| @
\`-@@
@
\\ @
\\ @
\\ @
\\@
@@
_ @
|@
|@
:@
|@
-'@@
_ @
/ \\@
$ $@
$ $@
@
@@
@
@
$ $@
$ $@
$ $@
$---$@@
@
$\\$@
$ $@
$ $@
$ @
@@
@
@
$___$@
| )@
|__/|@
@@
@
$/ @
(___$@
| )@
|__/$@
@@
@
@
$___$@
| $@
|__ $@
@@
@
|@
$___|@
| )@
|__/$@
@@
@
@
$___$@
|___)@
|__ $@
@@
__ @
$/ $@
( $@
|___$@
| $@
@@
@
@
$___$@
| )@
|__/$@
__/ @@
@
$/ @
(___$@
| )@
| /$@
@@
@
$/@
$$@
|$@
|$@
@@
@
$ |@
$ $@
$ )@
$/$@
__/ @@
@
$/ @
( $@
|___)@
| \\ $@
@@
@
$/@
($@
|$@
|$@
@@
@
@
$_ _$@
| | )@
| /$@
@@
@
@
$___$@
| )@
| /$@
@@
@
@
$___$@
| )@
|__/$@
@@
@
@
$___$@
| )@
|__/$@
| @@
@
@
$___$@
| )@
|__/|@
|@@
@
@
$___$@
| )@
| $@
@@
@
@
$___$@
|___$@
$__/$@
@@
@
$/ @
(___$@
| $@
|__ $@
@@
@
@
$ $@
| )@
|__/$@
@@
@
@
$ $@
$\\ )@
$ \\/$@
@@
@
@
$ $@
| )@
|/\\/$@
@@
@
@
$ $@
(_/_$@
$/ /$@
@@
@
@
$ $@
\\ )@
$\\_/$@
/ @@
@
@
$___$@
$__/$@
/__ $@
@@
_@
$| @
_| @
: @
$| @
\`-@@
$@
|$@
($@
|$@
|$@
$@@
_ @
|$@
|_@
: @
|$@
-' @@
_ @
/ \\_/@
$ $@
$ $@
@
@@
$-__-@
$/ |@
(___|@
| )@
| /$@
@@
$-__-@
$/ |@
( |@
| )@
|__/$@
@@
$- -@
$/ |@
( |@
| )@
|__/$@
@@
@
$ $@
-___-@
| )@
|__/|@
@@
@
$ $@
-___-@
| )@
|__/$@
@@
@
$ $@
- -$@
| )@
|__/$@
@@
__ @
|/ |@
|___|@
| )@
|__/$@
| $@@
`
@@ -0,0 +1,46 @@
var $gP8Dl$reactariautils = require("@react-aria/utils");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "isNonContiguousSelectionModifier", () => $ee0bdf4faa47f2a8$export$d3e3bd3e26688c04);
$parcel$export(module.exports, "getItemElement", () => $ee0bdf4faa47f2a8$export$c3d8340acf92597f);
$parcel$export(module.exports, "useCollectionId", () => $ee0bdf4faa47f2a8$export$881eb0d9f3605d9d);
$parcel$export(module.exports, "getCollectionId", () => $ee0bdf4faa47f2a8$export$6aeb1680a0ae8741);
/*
* 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 $ee0bdf4faa47f2a8$export$d3e3bd3e26688c04(e) {
// Ctrl + Arrow Up/Arrow Down has a system wide meaning on macOS, so use Alt instead.
// On Windows and Ubuntu, Alt + Space has a system wide meaning.
return (0, $gP8Dl$reactariautils.isAppleDevice)() ? e.altKey : e.ctrlKey;
}
function $ee0bdf4faa47f2a8$export$c3d8340acf92597f(collectionRef, key) {
var _collectionRef_current, _collectionRef_current1;
let selector = `[data-key="${CSS.escape(String(key))}"]`;
let collection = (_collectionRef_current = collectionRef.current) === null || _collectionRef_current === void 0 ? void 0 : _collectionRef_current.dataset.collection;
if (collection) selector = `[data-collection="${CSS.escape(collection)}"]${selector}`;
return (_collectionRef_current1 = collectionRef.current) === null || _collectionRef_current1 === void 0 ? void 0 : _collectionRef_current1.querySelector(selector);
}
const $ee0bdf4faa47f2a8$var$collectionMap = new WeakMap();
function $ee0bdf4faa47f2a8$export$881eb0d9f3605d9d(collection) {
let id = (0, $gP8Dl$reactariautils.useId)();
$ee0bdf4faa47f2a8$var$collectionMap.set(collection, id);
return id;
}
function $ee0bdf4faa47f2a8$export$6aeb1680a0ae8741(collection) {
return $ee0bdf4faa47f2a8$var$collectionMap.get(collection);
}
//# sourceMappingURL=utils.main.js.map
@@ -0,0 +1,27 @@
{
"name": "util-deprecate",
"version": "1.0.2",
"description": "The Node.js `util.deprecate()` function with browser support",
"main": "node.js",
"browser": "browser.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git://github.com/TooTallNate/util-deprecate.git"
},
"keywords": [
"util",
"deprecate",
"browserify",
"browser",
"node"
],
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/TooTallNate/util-deprecate/issues"
},
"homepage": "https://github.com/TooTallNate/util-deprecate"
}
@@ -0,0 +1 @@
{"version":3,"names":["_assertThisInitialized","require","_possibleConstructorReturn","self","value","TypeError","assertThisInitialized"],"sources":["../../src/helpers/possibleConstructorReturn.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport assertThisInitialized from \"./assertThisInitialized.ts\";\n\nexport default function _possibleConstructorReturn(\n self: object | undefined,\n value: unknown,\n) {\n if (value && (typeof value === \"object\" || typeof value === \"function\")) {\n return value;\n } else if (value !== void 0) {\n throw new TypeError(\n \"Derived constructors may only return object or undefined\",\n );\n }\n\n return assertThisInitialized(self);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,sBAAA,GAAAC,OAAA;AAEe,SAASC,0BAA0BA,CAChDC,IAAwB,EACxBC,KAAc,EACd;EACA,IAAIA,KAAK,KAAK,OAAOA,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,UAAU,CAAC,EAAE;IACvE,OAAOA,KAAK;EACd,CAAC,MAAM,IAAIA,KAAK,KAAK,KAAK,CAAC,EAAE;IAC3B,MAAM,IAAIC,SAAS,CACjB,0DACF,CAAC;EACH;EAEA,OAAO,IAAAC,8BAAqB,EAACH,IAAI,CAAC;AACpC","ignoreList":[]}
@@ -0,0 +1,154 @@
import * as asn1js from "asn1js";
import * as converters from "./converters";
import { AsnPropTypes, AsnTypeTypes } from "./enums";
import { isConvertible, isArrayEqual } from "./helper";
import { schemaStorage } from "./storage";
export class AsnSerializer {
static serialize(obj) {
if (obj instanceof asn1js.BaseBlock) {
return obj.toBER(false);
}
return this.toASN(obj).toBER(false);
}
static toASN(obj) {
if (obj && typeof obj === "object" && isConvertible(obj)) {
return obj.toASN();
}
if (!(obj && typeof obj === "object")) {
throw new TypeError("Parameter 1 should be type of Object.");
}
const target = obj.constructor;
const schema = schemaStorage.get(target);
schemaStorage.cache(target);
let asn1Value = [];
if (schema.itemType) {
if (!Array.isArray(obj)) {
throw new TypeError("Parameter 1 should be type of Array.");
}
if (typeof schema.itemType === "number") {
const converter = converters.defaultConverter(schema.itemType);
if (!converter) {
throw new Error(`Cannot get default converter for array item of ${target.name} ASN1 schema`);
}
asn1Value = obj.map((o) => converter.toASN(o));
}
else {
asn1Value = obj.map((o) => this.toAsnItem({ type: schema.itemType }, "[]", target, o));
}
}
else {
for (const key in schema.items) {
const schemaItem = schema.items[key];
const objProp = obj[key];
if (objProp === undefined ||
schemaItem.defaultValue === objProp ||
(typeof schemaItem.defaultValue === "object" &&
typeof objProp === "object" &&
isArrayEqual(this.serialize(schemaItem.defaultValue), this.serialize(objProp)))) {
continue;
}
const asn1Item = AsnSerializer.toAsnItem(schemaItem, key, target, objProp);
if (typeof schemaItem.context === "number") {
if (schemaItem.implicit) {
if (!schemaItem.repeated &&
(typeof schemaItem.type === "number" || isConvertible(schemaItem.type))) {
const value = {};
value.valueHex =
asn1Item instanceof asn1js.Null
? asn1Item.valueBeforeDecodeView
: asn1Item.valueBlock.toBER();
asn1Value.push(new asn1js.Primitive({
optional: schemaItem.optional,
idBlock: {
tagClass: 3,
tagNumber: schemaItem.context,
},
...value,
}));
}
else {
asn1Value.push(new asn1js.Constructed({
optional: schemaItem.optional,
idBlock: {
tagClass: 3,
tagNumber: schemaItem.context,
},
value: asn1Item.valueBlock.value,
}));
}
}
else {
asn1Value.push(new asn1js.Constructed({
optional: schemaItem.optional,
idBlock: {
tagClass: 3,
tagNumber: schemaItem.context,
},
value: [asn1Item],
}));
}
}
else if (schemaItem.repeated) {
asn1Value = asn1Value.concat(asn1Item);
}
else {
asn1Value.push(asn1Item);
}
}
}
let asnSchema;
switch (schema.type) {
case AsnTypeTypes.Sequence:
asnSchema = new asn1js.Sequence({ value: asn1Value });
break;
case AsnTypeTypes.Set:
asnSchema = new asn1js.Set({ value: asn1Value });
break;
case AsnTypeTypes.Choice:
if (!asn1Value[0]) {
throw new Error(`Schema '${target.name}' has wrong data. Choice cannot be empty.`);
}
asnSchema = asn1Value[0];
break;
}
return asnSchema;
}
static toAsnItem(schemaItem, key, target, objProp) {
let asn1Item;
if (typeof schemaItem.type === "number") {
const converter = schemaItem.converter;
if (!converter) {
throw new Error(`Property '${key}' doesn't have converter for type ${AsnPropTypes[schemaItem.type]} in schema '${target.name}'`);
}
if (schemaItem.repeated) {
if (!Array.isArray(objProp)) {
throw new TypeError("Parameter 'objProp' should be type of Array.");
}
const items = Array.from(objProp, (element) => converter.toASN(element));
const Container = schemaItem.repeated === "sequence" ? asn1js.Sequence : asn1js.Set;
asn1Item = new Container({
value: items,
});
}
else {
asn1Item = converter.toASN(objProp);
}
}
else {
if (schemaItem.repeated) {
if (!Array.isArray(objProp)) {
throw new TypeError("Parameter 'objProp' should be type of Array.");
}
const items = Array.from(objProp, (element) => this.toASN(element));
const Container = schemaItem.repeated === "sequence" ? asn1js.Sequence : asn1js.Set;
asn1Item = new Container({
value: items,
});
}
else {
asn1Item = this.toASN(objProp);
}
}
return asn1Item;
}
}
@@ -0,0 +1,35 @@
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
import {useRef as $azsE2$useRef} from "react";
/*
* Copyright 2024 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 $ca9b37712f007381$export$72ef708ab07251f1(effect, dependencies) {
const isInitialMount = (0, $azsE2$useRef)(true);
const lastDeps = (0, $azsE2$useRef)(null);
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
isInitialMount.current = true;
return ()=>{
isInitialMount.current = false;
};
}, []);
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (isInitialMount.current) isInitialMount.current = false;
else if (!lastDeps.current || dependencies.some((dep, i)=>!Object.is(dep, lastDeps[i]))) effect();
lastDeps.current = dependencies;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, dependencies);
}
export {$ca9b37712f007381$export$72ef708ab07251f1 as useUpdateLayoutEffect};
//# sourceMappingURL=useUpdateLayoutEffect.module.js.map
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=updateMaybeClassMetadataPreDestroy.spec.d.ts.map
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more