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

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

No files matched your search

@@ -0,0 +1,6 @@
/**
* Tests a provided value against a ValueType
*/
const testValueType = (v) => (type) => type.test(v);
export { testValueType };
@@ -0,0 +1,55 @@
import { Address4 } from './ipv4';
import { Address6 } from './ipv6';
export interface ReverseFormOptions {
omitSuffix?: boolean;
}
export function isInSubnet(this: Address4 | Address6, address: Address4 | Address6) {
if (this.subnetMask < address.subnetMask) {
return false;
}
if (this.mask(address.subnetMask) === address.mask()) {
return true;
}
return false;
}
export function isCorrect(defaultBits: number) {
return function (this: Address4 | Address6) {
if (this.addressMinusSuffix !== this.correctForm()) {
return false;
}
if (this.subnetMask === defaultBits && !this.parsedSubnet) {
return true;
}
return this.parsedSubnet === String(this.subnetMask);
};
}
export function numberToPaddedHex(number: number) {
return number.toString(16).padStart(2, '0');
}
export function stringToPaddedHex(numberString: string) {
return numberToPaddedHex(parseInt(numberString, 10));
}
/**
* @param binaryValue Binary representation of a value (e.g. `10`)
* @param position Byte position, where 0 is the least significant bit
*/
export function testBit(binaryValue: string, position: number): boolean {
const { length } = binaryValue;
if (position > length) {
return false;
}
const positionInString = length - position;
return binaryValue.substring(positionInString, positionInString + 1) === '1';
}
@@ -0,0 +1,40 @@
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(require("./core"), require("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
/**
* ISO/IEC 9797-1 Padding Method 2.
*/
CryptoJS.pad.Iso97971 = {
pad: function (data, blockSize) {
// Add 0x80 byte
data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));
// Zero pad the rest
CryptoJS.pad.ZeroPadding.pad(data, blockSize);
},
unpad: function (data) {
// Remove zero padding
CryptoJS.pad.ZeroPadding.unpad(data);
// Remove one more byte -- the 0x80 byte
data.sigBytes--;
}
};
return CryptoJS.pad.Iso97971;
}));
@@ -0,0 +1,3 @@
declare function isWeakSet<V extends WeakKey = object>(value: unknown): value is WeakSet<V>;
export = isWeakSet;
@@ -0,0 +1,5 @@
import { Intrinsic } from './intrinsic.mjs';
/** `[Json]` Intrinsic function to Uppercase LiteralString types */
export function Uppercase(T, options = {}) {
return Intrinsic(T, 'Uppercase', options);
}
@@ -0,0 +1,42 @@
"use strict"
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils")
const { getSourceCode } = require("eslint-compat-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Intl.PluralRules` object.",
category: "ES2018-Intl-API",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-intl-pluralrules.html",
},
fixable: null,
messages: {
forbidden: "ES2018 Intl API '{{name}}' object is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"(program) {
const sourceCode = getSourceCode(context)
const tracker = new ReferenceTracker(
sourceCode.getScope(program),
)
for (const { node, path } of tracker.iterateGlobalReferences({
Intl: {
PluralRules: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('isElement', require('../isElement'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,241 @@
/**
* @import {
* Code,
* Construct,
* Event,
* Point,
* Resolver,
* State,
* TokenizeContext,
* Tokenizer,
* Token
* } from 'micromark-util-types'
*/
import { push, splice } from 'micromark-util-chunked';
import { classifyCharacter } from 'micromark-util-classify-character';
import { resolveAll } from 'micromark-util-resolve-all';
/** @type {Construct} */
export const attention = {
name: 'attention',
resolveAll: resolveAllAttention,
tokenize: tokenizeAttention
};
/**
* Take all events and resolve attention to emphasis or strong.
*
* @type {Resolver}
*/
// eslint-disable-next-line complexity
function resolveAllAttention(events, context) {
let index = -1;
/** @type {number} */
let open;
/** @type {Token} */
let group;
/** @type {Token} */
let text;
/** @type {Token} */
let openingSequence;
/** @type {Token} */
let closingSequence;
/** @type {number} */
let use;
/** @type {Array<Event>} */
let nextEvents;
/** @type {number} */
let offset;
// Walk through all events.
//
// Note: performance of this is fine on an mb of normal markdown, but it’s
// a bottleneck for malicious stuff.
while (++index < events.length) {
// Find a token that can close.
if (events[index][0] === 'enter' && events[index][1].type === 'attentionSequence' && events[index][1]._close) {
open = index;
// Now walk back to find an opener.
while (open--) {
// Find a token that can open the closer.
if (events[open][0] === 'exit' && events[open][1].type === 'attentionSequence' && events[open][1]._open &&
// If the markers are the same:
context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0)) {
// If the opening can close or the closing can open,
// and the close size *is not* a multiple of three,
// but the sum of the opening and closing size *is* multiple of three,
// then don’t match.
if ((events[open][1]._close || events[index][1]._open) && (events[index][1].end.offset - events[index][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index][1].end.offset - events[index][1].start.offset) % 3)) {
continue;
}
// Number of markers to use from the sequence.
use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;
const start = {
...events[open][1].end
};
const end = {
...events[index][1].start
};
movePoint(start, -use);
movePoint(end, use);
openingSequence = {
type: use > 1 ? "strongSequence" : "emphasisSequence",
start,
end: {
...events[open][1].end
}
};
closingSequence = {
type: use > 1 ? "strongSequence" : "emphasisSequence",
start: {
...events[index][1].start
},
end
};
text = {
type: use > 1 ? "strongText" : "emphasisText",
start: {
...events[open][1].end
},
end: {
...events[index][1].start
}
};
group = {
type: use > 1 ? "strong" : "emphasis",
start: {
...openingSequence.start
},
end: {
...closingSequence.end
}
};
events[open][1].end = {
...openingSequence.start
};
events[index][1].start = {
...closingSequence.end
};
nextEvents = [];
// If there are more markers in the opening, add them before.
if (events[open][1].end.offset - events[open][1].start.offset) {
nextEvents = push(nextEvents, [['enter', events[open][1], context], ['exit', events[open][1], context]]);
}
// Opening.
nextEvents = push(nextEvents, [['enter', group, context], ['enter', openingSequence, context], ['exit', openingSequence, context], ['enter', text, context]]);
// Always populated by defaults.
// Between.
nextEvents = push(nextEvents, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + 1, index), context));
// Closing.
nextEvents = push(nextEvents, [['exit', text, context], ['enter', closingSequence, context], ['exit', closingSequence, context], ['exit', group, context]]);
// If there are more markers in the closing, add them after.
if (events[index][1].end.offset - events[index][1].start.offset) {
offset = 2;
nextEvents = push(nextEvents, [['enter', events[index][1], context], ['exit', events[index][1], context]]);
} else {
offset = 0;
}
splice(events, open - 1, index - open + 3, nextEvents);
index = open + nextEvents.length - offset - 2;
break;
}
}
}
}
// Remove remaining sequences.
index = -1;
while (++index < events.length) {
if (events[index][1].type === 'attentionSequence') {
events[index][1].type = 'data';
}
}
return events;
}
/**
* @this {TokenizeContext}
* Context.
* @type {Tokenizer}
*/
function tokenizeAttention(effects, ok) {
const attentionMarkers = this.parser.constructs.attentionMarkers.null;
const previous = this.previous;
const before = classifyCharacter(previous);
/** @type {NonNullable<Code>} */
let marker;
return start;
/**
* Before a sequence.
*
* ```markdown
* > | **
* ^
* ```
*
* @type {State}
*/
function start(code) {
marker = code;
effects.enter('attentionSequence');
return inside(code);
}
/**
* In a sequence.
*
* ```markdown
* > | **
* ^^
* ```
*
* @type {State}
*/
function inside(code) {
if (code === marker) {
effects.consume(code);
return inside;
}
const token = effects.exit('attentionSequence');
// To do: next major: move this to resolver, just like `markdown-rs`.
const after = classifyCharacter(code);
// Always populated by defaults.
const open = !after || after === 2 && before || attentionMarkers.includes(code);
const close = !before || before === 2 && after || attentionMarkers.includes(previous);
token._open = Boolean(marker === 42 ? open : open && (before || !close));
token._close = Boolean(marker === 42 ? close : close && (after || !open));
return ok(code);
}
}
/**
* Move a point a bit.
*
* Note: `move` only works inside lines! It’s not possible to move past other
* chunks (replacement characters, tabs, or line endings).
*
* @param {Point} point
* Point.
* @param {number} offset
* Amount to move.
* @returns {undefined}
* Nothing.
*/
function movePoint(point, offset) {
point.column += offset;
point.offset += offset;
point._bufferIndex += offset;
}
@@ -0,0 +1,31 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
interface DateConstructor {
/**
* Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
* @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
* @param monthIndex The month as a number between 0 and 11 (January to December).
* @param date The date as a number between 1 and 31.
* @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.
* @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.
* @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
* @param ms A number from 0 to 999 that specifies the milliseconds.
*/
UTC(year: number, monthIndex?: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;
}
@@ -0,0 +1 @@
{"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/signals.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,OAAO,EAAO,CAAA"}
@@ -0,0 +1,33 @@
function resolveMemberExpressions(object = {}, property = {}) {
if (object.type === 'JSXMemberExpression') {
return `${resolveMemberExpressions(object.object, object.property)}.${property.name}`;
}
return `${object.name}.${property.name}`;
}
/**
* Returns the tagName associated with a JSXElement.
*/
export default function elementType(node = {}) {
const { name } = node;
if (node.type === 'JSXOpeningFragment') {
return '<>';
}
if (!name) {
throw new Error('The argument provided is not a JSXElement node.');
}
if (name.type === 'JSXMemberExpression') {
const { object = {}, property = {} } = name;
return resolveMemberExpressions(object, property);
}
if (name.type === 'JSXNamespacedName') {
return `${name.namespace.name}:${name.name.name}`;
}
return node.name.name;
}
@@ -0,0 +1 @@
{"version":3,"file":"updateMaybeClassMetadataPostConstructor.spec.d.ts","sourceRoot":"","sources":["../../../../src/metadata/actions/updateMaybeClassMetadataPostConstructor.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
'use strict'
// Note: this is the semver.org version of the spec that it implements
// Not necessarily the package version of this code.
const SEMVER_SPEC_VERSION = '2.0.0'
const MAX_LENGTH = 256
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
/* istanbul ignore next */ 9007199254740991
// Max safe segment length for coercion.
const MAX_SAFE_COMPONENT_LENGTH = 16
// Max safe length for a build identifier. The max length minus 6 characters for
// the shortest version with a build 0.0.0+BUILD.
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
const RELEASE_TYPES = [
'major',
'premajor',
'minor',
'preminor',
'patch',
'prepatch',
'prerelease',
]
module.exports = {
MAX_LENGTH,
MAX_SAFE_COMPONENT_LENGTH,
MAX_SAFE_BUILD_LENGTH,
MAX_SAFE_INTEGER,
RELEASE_TYPES,
SEMVER_SPEC_VERSION,
FLAG_INCLUDE_PRERELEASE: 0b001,
FLAG_LOOSE: 0b010,
}
@@ -0,0 +1,161 @@
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*
* @deprecated since v4.2.0
* This rule was based on an invalid assumption.
* No meaning.
*/
"use strict"
const path = require("path")
const { getPackageJson } = require("../util/get-package-json")
const mergeVisitorsInPlace = require("../util/merge-visitors-in-place")
const visitImport = require("../util/visit-import")
const visitRequire = require("../util/visit-require")
/** @type {Set<string|undefined>} */
const CORE_MODULES = new Set([
"assert",
"buffer",
"child_process",
"cluster",
"console",
"constants",
"crypto",
"dgram",
"dns",
/* "domain", */
"events",
"fs",
"http",
"https",
"module",
"net",
"os",
"path",
/* "punycode", */
"querystring",
"readline",
"repl",
"stream",
"string_decoder",
"timers",
"tls",
"tty",
"url",
"util",
"vm",
"zlib",
])
const BACK_SLASH = /\\/gu
/**
* @typedef {[
* {
* allow?: string[];
* ignoreDirectDependencies?: boolean;
* ignoreIndirectDependencies?: boolean;
* }?
* ]} RuleOptions
*/
/** @type {import('./rule-module').RuleModule<{RuleOptions: RuleOptions}>} */
module.exports = {
meta: {
docs: {
description:
"disallow third-party modules which are hiding core modules",
recommended: false,
url: "https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-hide-core-modules.md",
},
type: "problem",
deprecated: true,
fixable: null,
schema: [
{
type: "object",
properties: {
allow: {
type: "array",
items: { enum: Array.from(CORE_MODULES) },
additionalItems: false,
uniqueItems: true,
},
ignoreDirectDependencies: { type: "boolean" },
ignoreIndirectDependencies: { type: "boolean" },
},
additionalProperties: false,
},
],
messages: {
unexpectedImport:
"Unexpected import of third-party module '{{name}}'.",
},
},
create(context) {
const filename = context.filename ?? context.getFilename()
if (filename === "<input>") {
return {}
}
const filePath = path.resolve(filename)
const dirPath = path.dirname(filePath)
const packageJson = getPackageJson(filePath)
/** @type {Set<string|undefined>} */
const deps = new Set([
...Object.keys(packageJson?.dependencies ?? {}),
...Object.keys(packageJson?.devDependencies ?? {}),
])
const options = context.options[0] || {}
const allow = /** @type {(string|undefined)[]} */ (options.allow || [])
const ignoreDirectDependencies = Boolean(
options.ignoreDirectDependencies
)
const ignoreIndirectDependencies = Boolean(
options.ignoreIndirectDependencies
)
/** @type {import('../util/import-target.js')[]} */
const targets = []
return [
visitImport(context, { includeCore: true }, importTargets =>
targets.push(...importTargets)
),
visitRequire(context, { includeCore: true }, requireTargets =>
targets.push(...requireTargets)
),
{
"Program:exit"() {
for (const target of targets.filter(
t =>
CORE_MODULES.has(t.moduleName) &&
t.moduleName === t.name
)) {
const name = target.moduleName
const allowed =
allow.indexOf(name) !== -1 ||
(ignoreDirectDependencies && deps.has(name)) ||
(ignoreIndirectDependencies && !deps.has(name))
if (allowed) {
continue
}
if (target.filePath == null) {
continue
}
context.report({
node: target.node,
messageId: "unexpectedImport",
data: {
name: path
.relative(dirPath, target.filePath)
.replace(BACK_SLASH, "/"),
},
})
}
},
},
].reduce(mergeVisitorsInPlace, {})
},
}
@@ -0,0 +1,62 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.decodeFirst = decodeFirst;
exports.encode = encode;
/**
* A runtime-agnostic collection of methods for working with CBOR encoding
* @module
*/
const tinyCbor = __importStar(require("@levischuck/tiny-cbor"));
/**
* Whatever CBOR encoder is used should keep CBOR data the same length when data is re-encoded
*
* MOST CRITICALLY, this means the following needs to be true of whatever CBOR library we use:
* - CBOR Map type values MUST decode to JavaScript Maps
* - CBOR tag 64 (uint8 Typed Array) MUST NOT be used when encoding Uint8Arrays back to CBOR
*
* So long as these requirements are maintained, then CBOR sequences can be encoded and decoded
* freely while maintaining their lengths for the most accurate pointer movement across them.
*/
/**
* Decode and return the first item in a sequence of CBOR-encoded values
*
* @param input The CBOR data to decode
* @param asObject (optional) Whether to convert any CBOR Maps into JavaScript Objects. Defaults to
* `false`
*/
function decodeFirst(input) {
// Make a copy so we don't mutate the original
const _input = new Uint8Array(input);
const decoded = tinyCbor.decodePartialCBOR(_input, 0);
const [first] = decoded;
return first;
}
/**
* Encode data to CBOR
*/
function encode(input) {
return tinyCbor.encodeCBOR(input);
}
@@ -0,0 +1 @@
{"name":"github-from-package","version":"0.0.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532102140,"integrity":"sha512-pPg4OVJVZZnpLU/n35B+fG2JceiBx7Oq10UMum2i/AGNn0X3AAMkGOskOFECRS9tV1ti3ZYFGQzMSpD1pqo+fg==","mode":438,"size":753},"LICENSE":{"checkedAt":1794532092782,"integrity":"sha512-UYETA37gNUDKrmMFiphSX5pKZ0Jb2MNZb2l77Vrh0gU/5292uFpO77gMxRn3sD02jPS0RSiMTKfKy151I/M5Yg==","mode":438,"size":1073},"index.js":{"checkedAt":1794532102140,"integrity":"sha512-yGcyCQ3a36Sqmbg+LaTO5HIuHOkkJsJqiM/Shg17Pf7wObkt0o3dk6pySCQFDrYSn0q3rEVlfav+S0bbyxGNew==","mode":438,"size":406},"example/package.json":{"checkedAt":1794532102140,"integrity":"sha512-FfAlp0Vr7VOWWOefauC62NRPEmEbZ/1diOyqXotxLrQdSG7QuG1QjocqEOPIkjB8Hj9p3nYYT3K9UK0onrlWAA==","mode":438,"size":143},"example/url.js":{"checkedAt":1794532102140,"integrity":"sha512-j75Fh+gkz2ktyiE5PbmFciBdu5hw/Jfs/scjY/ZGbOufVUoIiwcOJMiWEPjc/NqlJRxaGroZtGyi3epcz0yufQ==","mode":438,"size":92},"readme.markdown":{"checkedAt":1794532102140,"integrity":"sha512-JFTO4h+Vk1Esa7MnIXZcO0MRCG5KC2urdM64WARcrFj2N7QCqRael2xgUZbGs9Myj47RnPG1hIrKam2tqYQcEg==","mode":438,"size":895},"test/url.js":{"checkedAt":1794532102140,"integrity":"sha512-Nrxqk+fw/7Avggm6at8ajGFj1qtaiPBHtu8R1yuZXoJNdJjmS6LQ00UvxhYmy0kgH3/tVNUfhYFB8NhYXecFJg==","mode":438,"size":611},"test/c.json":{"checkedAt":1794532102141,"integrity":"sha512-MomVsqCfm0VPF4RHeYLyh3scPMVY5Pz+uh302ownKu4DIgb4JUnsINK+N1QFzwQXeckTgsrLddqFMERQRSLsNA==","mode":438,"size":110},"test/e.json":{"checkedAt":1794532102141,"integrity":"sha512-9a2KdROHSNoz57xx6Bp79fAk68aQneEhe8jbxxKIwt3mb36sRXC5wI5SVkmyFOZQweOAJIbzgGthZUU/V4QwMw==","mode":438,"size":110},"test/b.json":{"checkedAt":1794532102141,"integrity":"sha512-o4Uhw68lOyx+wl5iz23w73eDufzg1w6H9RYaZmHarrXXhm6Avges8xWjTRTjTCrdEEPupN6QDRAtulOkAhN38A==","mode":438,"size":106},"test/a.json":{"checkedAt":1794532102140,"integrity":"sha512-FfAlp0Vr7VOWWOefauC62NRPEmEbZ/1diOyqXotxLrQdSG7QuG1QjocqEOPIkjB8Hj9p3nYYT3K9UK0onrlWAA==","mode":438,"size":143},"test/d.json":{"checkedAt":1794532102141,"integrity":"sha512-QFgreSpbolEKCuybxkQwsXdhe6BqGCJ0vsFG+cKtTeJuzpgpcENg50xyK9omEWZW3Y6sfD5Cess+EaGXYmeHig==","mode":438,"size":123},".travis.yml":{"checkedAt":1794532102141,"integrity":"sha512-0t5W4F7vWvQdQxTh0QkmYgywpQ2smUiVnAG/bd0H+ItXEzMCjzNT3Xm5FSupiMUn97EPr8VRwAnxtL7cC8lK4w==","mode":438,"size":43}}}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=PlanResultCacheManager.spec.d.ts.map
@@ -0,0 +1,35 @@
import { isoCrypto } from './iso/index.js';
import { decodeCredentialPublicKey } from './decodeCredentialPublicKey.js';
import { convertX509PublicKeyToCOSE } from './convertX509PublicKeyToCOSE.js';
/**
* Verify an authenticator's signature
*/
export function verifySignature(opts) {
const { signature, data, credentialPublicKey, x509Certificate, hashAlgorithm, } = opts;
if (!x509Certificate && !credentialPublicKey) {
throw new Error('Must declare either "leafCert" or "credentialPublicKey"');
}
if (x509Certificate && credentialPublicKey) {
throw new Error('Must not declare both "leafCert" and "credentialPublicKey"');
}
let cosePublicKey = new Map();
if (credentialPublicKey) {
cosePublicKey = decodeCredentialPublicKey(credentialPublicKey);
}
else if (x509Certificate) {
cosePublicKey = convertX509PublicKeyToCOSE(x509Certificate);
}
return _verifySignatureInternals.stubThis(isoCrypto.verify({
cosePublicKey,
signature,
data,
shaHashOverride: hashAlgorithm,
}));
}
/**
* Make it possible to stub the return value during testing
* @ignore Don't include this in docs output
*/
export const _verifySignatureInternals = {
stubThis: (value) => value,
};
@@ -0,0 +1 @@
export function clsx(){for(var t,r=0,e="",n=arguments.length;r<n;r++)(t=arguments[r])&&"string"==typeof t&&(e+=(e&&" ")+t);return e}export default clsx;
@@ -0,0 +1,235 @@
/**
* @fileoverview Rule to disallow Math.pow in favor of the ** operator
* @author Milos Djermanovic
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
const { CALL, ReferenceTracker } = require("@eslint-community/eslint-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const PRECEDENCE_OF_EXPONENTIATION_EXPR = astUtils.getPrecedence({
type: "BinaryExpression",
operator: "**",
});
/**
* Determines whether the given node needs parens if used as the base in an exponentiation binary expression.
* @param {ASTNode} base The node to check.
* @returns {boolean} `true` if the node needs to be parenthesised.
*/
function doesBaseNeedParens(base) {
return (
// '**' is right-associative, parens are needed when Math.pow(a ** b, c) is converted to (a ** b) ** c
astUtils.getPrecedence(base) <= PRECEDENCE_OF_EXPONENTIATION_EXPR ||
// An unary operator cannot be used immediately before an exponentiation expression
base.type === "AwaitExpression" ||
base.type === "UnaryExpression"
);
}
/**
* Determines whether the given node needs parens if used as the exponent in an exponentiation binary expression.
* @param {ASTNode} exponent The node to check.
* @returns {boolean} `true` if the node needs to be parenthesised.
*/
function doesExponentNeedParens(exponent) {
// '**' is right-associative, there is no need for parens when Math.pow(a, b ** c) is converted to a ** b ** c
return astUtils.getPrecedence(exponent) < PRECEDENCE_OF_EXPONENTIATION_EXPR;
}
/**
* Determines whether an exponentiation binary expression at the place of the given node would need parens.
* @param {ASTNode} node A node that would be replaced by an exponentiation binary expression.
* @param {SourceCode} sourceCode A SourceCode object.
* @returns {boolean} `true` if the expression needs to be parenthesised.
*/
function doesExponentiationExpressionNeedParens(node, sourceCode) {
const parent =
node.parent.type === "ChainExpression"
? node.parent.parent
: node.parent;
const parentPrecedence = astUtils.getPrecedence(parent);
const needsParens =
parent.type === "ClassDeclaration" ||
(parent.type.endsWith("Expression") &&
(parentPrecedence === -1 ||
parentPrecedence >= PRECEDENCE_OF_EXPONENTIATION_EXPR) &&
!(
parent.type === "BinaryExpression" &&
parent.operator === "**" &&
parent.right === node
) &&
!(
(parent.type === "CallExpression" ||
parent.type === "NewExpression") &&
parent.arguments.includes(node)
) &&
!(
parent.type === "MemberExpression" &&
parent.computed &&
parent.property === node
) &&
!(parent.type === "ArrayExpression"));
return needsParens && !astUtils.isParenthesised(sourceCode, node);
}
/**
* Optionally parenthesizes given text.
* @param {string} text The text to parenthesize.
* @param {boolean} shouldParenthesize If `true`, the text will be parenthesised.
* @returns {string} parenthesised or unchanged text.
*/
function parenthesizeIfShould(text, shouldParenthesize) {
return shouldParenthesize ? `(${text})` : text;
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"Disallow the use of `Math.pow` in favor of the `**` operator",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/prefer-exponentiation-operator",
},
schema: [],
fixable: "code",
messages: {
useExponentiation: "Use the '**' operator instead of 'Math.pow'.",
},
},
create(context) {
const sourceCode = context.sourceCode;
/**
* Reports the given node.
* @param {ASTNode} node 'Math.pow()' node to report.
* @returns {void}
*/
function report(node) {
context.report({
node,
messageId: "useExponentiation",
fix(fixer) {
if (
node.arguments.length !== 2 ||
node.arguments.some(
arg => arg.type === "SpreadElement",
) ||
sourceCode.getCommentsInside(node).length > 0
) {
return null;
}
const base = node.arguments[0],
exponent = node.arguments[1],
baseText = sourceCode.getText(base),
exponentText = sourceCode.getText(exponent),
shouldParenthesizeBase = doesBaseNeedParens(base),
shouldParenthesizeExponent =
doesExponentNeedParens(exponent),
shouldParenthesizeAll =
doesExponentiationExpressionNeedParens(
node,
sourceCode,
);
let prefix = "",
suffix = "";
if (!shouldParenthesizeAll) {
if (!shouldParenthesizeBase) {
const firstReplacementToken =
sourceCode.getFirstToken(base),
tokenBefore = sourceCode.getTokenBefore(node);
if (
tokenBefore &&
tokenBefore.range[1] === node.range[0] &&
!astUtils.canTokensBeAdjacent(
tokenBefore,
firstReplacementToken,
)
) {
prefix = " "; // a+Math.pow(++b, c) -> a+ ++b**c
}
}
if (!shouldParenthesizeExponent) {
const lastReplacementToken =
sourceCode.getLastToken(exponent),
tokenAfter = sourceCode.getTokenAfter(node);
if (
tokenAfter &&
node.range[1] === tokenAfter.range[0] &&
!astUtils.canTokensBeAdjacent(
lastReplacementToken,
tokenAfter,
)
) {
suffix = " "; // Math.pow(a, b)in c -> a**b in c
}
}
}
const baseReplacement = parenthesizeIfShould(
baseText,
shouldParenthesizeBase,
),
exponentReplacement = parenthesizeIfShould(
exponentText,
shouldParenthesizeExponent,
),
replacement = parenthesizeIfShould(
`${baseReplacement}**${exponentReplacement}`,
shouldParenthesizeAll,
);
return fixer.replaceText(
node,
`${prefix}${replacement}${suffix}`,
);
},
});
}
return {
Program(node) {
const scope = sourceCode.getScope(node);
const tracker = new ReferenceTracker(scope);
const trackMap = {
Math: {
pow: { [CALL]: true },
},
};
for (const { node: refNode } of tracker.iterateGlobalReferences(
trackMap,
)) {
report(refNode);
}
},
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAe,MAAM,UAAU,CAAA;AAI3C,KAAK,QAAQ,GACT,KAAK,GACL,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,CAAA;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED,eAAO,MAAM,SAAS;QACjB,MAAM,WACA,MAAM,YACN,gBAAgB;;;sBAuGf,MAAM,YAAW,gBAAgB,SACvC,MAAM;oBAOkB,gBAAgB,KAAG,gBAAgB;2BA6EtD,MAAM,YACN,gBAAgB;sBA2BK,MAAM,YAAW,gBAAgB;kBAKzD,MAAM,EAAE,WACL,MAAM,YACN,gBAAgB;;;;;CArN1B,CAAA;AA+DD,KAAK,GAAG,GAAG,IAAI,GAAG,GAAG,CAAA;AAOrB,eAAO,MAAM,GAAG,KAAgE,CAAA;AAGhF,eAAO,MAAM,QAAQ,eAAwB,CAAA;AAmB7C,eAAO,MAAM,MAAM,YACP,MAAM,YAAW,gBAAgB,SACvC,MAAM,YACsB,CAAA;AAMlC,eAAO,MAAM,QAAQ,QAAS,gBAAgB,KAAG,gBA+DhD,CAAA;AAaD,eAAO,MAAM,WAAW,YACb,MAAM,YACN,gBAAgB,aAY1B,CAAA;AAeD,eAAO,MAAM,MAAM,YAAa,MAAM,YAAW,gBAAgB,qBACvB,CAAA;AAG1C,eAAO,MAAM,KAAK,SACV,MAAM,EAAE,WACL,MAAM,YACN,gBAAgB,aAQ1B,CAAA;AAQD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,QAAQ,CAAA;AACrE,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,KAAK,CAAA;AAErD,qBAAa,SAAS;IACpB,OAAO,EAAE,gBAAgB,CAAA;IACzB,GAAG,EAAE,mBAAmB,EAAE,EAAE,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;IAEf,oBAAoB,EAAE,OAAO,CAAA;IAC7B,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,OAAO,CAAA;IACd,uBAAuB,EAAE,OAAO,CAAA;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAA;IACrB,MAAM,EAAE,OAAO,CAAA;IAEf,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,QAAQ,CAAA;IAClB,kBAAkB,EAAE,OAAO,CAAA;IAE3B,MAAM,EAAE,KAAK,GAAG,IAAI,GAAG,QAAQ,CAAA;gBACnB,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAkC3D,QAAQ,IAAI,OAAO;IAYnB,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE;IAEjB,IAAI;IA0FJ,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IA8BhC,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IAiB/C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IAoBtC,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IA6D7C,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IA0F1C,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE;IAkBxD,UAAU,CACR,CAAC,EAAE,MAAM,EAAE,EACX,CAAC,EAAE,MAAM,EAAE,EACX,YAAY,GAAE,OAAe,GAC5B,KAAK,GAAG,MAAM,EAAE;IA+CnB,WAAW;IAqBX,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,OAAO,GAAE,OAAe;IAiNzE,WAAW;IAIX,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IAiDnC,MAAM;IAsFN,UAAU,CAAC,CAAC,EAAE,MAAM;IAepB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,UAAe;IAiEvC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,gBAAgB;CAGtC;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAKM,MAAM;IA2BX,qBAA8B;QAC5B,OAAO,IAAI,CAAC,WAAW,CAAC,gBAAgB;IAC1C;IAEA,iBAAuB;QACrB,IAAI,CAAC,gBAAgB,GAAG;QACxB,IAAI,CAAC,WAAW,CAAC,cAAc;IACjC;IAEA,kBAAwB;QACtB,IAAI,CAAC,WAAW,CAAC,eAAe;QAChC,IAAI,CAAC,oBAAoB,GAAG,IAAM;IACpC;IAEA,uBAAgC;QAC9B,OAAO;IACT;IAEA,UAAU,CAAC;IAhCX,YAAY,IAAY,EAAE,WAAuB,CAAE;QACjD,IAAI,CAAC,WAAW,GAAG;QACnB,IAAI,CAAC,MAAM,GAAG,YAAY,MAAM;QAChC,IAAI,CAAC,aAAa,GAAG,YAAY,aAAa;QAC9C,IAAI,CAAC,aAAa,GAAG,YAAY,aAAa;QAC9C,IAAI,CAAC,OAAO,GAAG,YAAY,OAAO;QAClC,IAAI,CAAC,UAAU,GAAG,YAAY,UAAU;QACxC,IAAI,CAAC,gBAAgB,GAAG,YAAY,gBAAgB;QACpD,IAAI,CAAC,UAAU,GAAG,YAAY,UAAU;QACxC,IAAI,CAAC,SAAS,GAAG,YAAY,SAAS;QACtC,IAAI,CAAC,SAAS,GAAG,YAAY,SAAS;QACtC,IAAI,CAAC,IAAI,GAAG;IACd;AAqBF;AAEO,SAAS,0CAAwC,MAA4C;IAClG,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;QACpB,WAAW;QACX,UAAU;IACZ;IAEA,mDAAmD;IAEnD,CAAA,GAAA,qCAAc,EAAE;QACd,MAAM,QAAQ,SAAS,OAAO;QAC9B,OAAO;YACL,IAAI,MAAM,QAAQ,EAAE;gBAClB,MAAM,QAAQ,CAAC,UAAU;gBACzB,MAAM,QAAQ,GAAG;YACnB;QACF;IACF,GAAG,EAAE;IAEL,IAAI,eAAe,CAAA,GAAA,oCAAa,EAAE,CAAC;QACjC,mBAAA,6BAAA,OAAS;IACX;IAEA,wDAAwD;IACxD,OAAO,CAAA,GAAA,wBAAU,EAAE,CAAC;QAClB,wGAAwG;QACxG,sGAAsG;QACtG,6FAA6F;QAC7F,qGAAqG;QACrG,IACE,EAAE,MAAM,YAAY,qBACpB,EAAE,MAAM,YAAY,oBACpB,EAAE,MAAM,YAAY,uBACpB,EAAE,MAAM,YAAY,mBACpB;YACA,SAAS,OAAO,CAAC,SAAS,GAAG;YAE7B,IAAI,SAAS,EAAE,MAAM;YACrB,IAAI,gBAA2D,CAAC;gBAC9D,SAAS,OAAO,CAAC,SAAS,GAAG;gBAE7B,IAAI,OAAO,QAAQ,EACjB,uEAAuE;gBACvE,aAAa,IAAI,0CAAoB,QAAQ;gBAG/C,qEAAqE;gBACrE,IAAI,SAAS,OAAO,CAAC,QAAQ,EAAE;oBAC7B,SAAS,OAAO,CAAC,QAAQ,CAAC,UAAU;oBACpC,SAAS,OAAO,CAAC,QAAQ,GAAG;gBAC9B;YACF;YAEA,OAAO,gBAAgB,CAAC,YAAY,eAAe;gBAAC,MAAM;YAAI;YAE9D,SAAS,OAAO,CAAC,QAAQ,GAAG,IAAI,iBAAiB;gBAC/C,IAAI,SAAS,OAAO,CAAC,SAAS,IAAI,OAAO,QAAQ,EAAE;wBACjD;qBAAA,6BAAA,SAAS,OAAO,CAAC,QAAQ,cAAzB,iDAAA,2BAA2B,UAAU;oBACrC,IAAI,kBAAkB,WAAW,SAAS,aAAa,GAAG,OAAO,SAAS,aAAa;oBACvF,OAAO,aAAa,CAAC,IAAI,WAAW,QAAQ;wBAAC,eAAe;oBAAe;oBAC3E,OAAO,aAAa,CAAC,IAAI,WAAW,YAAY;wBAAC,SAAS;wBAAM,eAAe;oBAAe;gBAChG;YACF;YAEA,SAAS,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ;gBAAC,YAAY;gBAAM,iBAAiB;oBAAC;iBAAW;YAAA;QAC5F;IACF,GAAG;QAAC;KAAa;AACnB","sources":["packages/@react-aria/interactions/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusEvent as ReactFocusEvent, useCallback, useRef} from 'react';\nimport {useEffectEvent, useLayoutEffect} from '@react-aria/utils';\n\nexport class SyntheticFocusEvent<Target = Element> implements ReactFocusEvent<Target> {\n nativeEvent: FocusEvent;\n target: EventTarget & Target;\n currentTarget: EventTarget & Target;\n relatedTarget: Element;\n bubbles: boolean;\n cancelable: boolean;\n defaultPrevented: boolean;\n eventPhase: number;\n isTrusted: boolean;\n timeStamp: number;\n type: string;\n\n constructor(type: string, nativeEvent: FocusEvent) {\n this.nativeEvent = nativeEvent;\n this.target = nativeEvent.target as EventTarget & Target;\n this.currentTarget = nativeEvent.currentTarget as EventTarget & Target;\n this.relatedTarget = nativeEvent.relatedTarget as Element;\n this.bubbles = nativeEvent.bubbles;\n this.cancelable = nativeEvent.cancelable;\n this.defaultPrevented = nativeEvent.defaultPrevented;\n this.eventPhase = nativeEvent.eventPhase;\n this.isTrusted = nativeEvent.isTrusted;\n this.timeStamp = nativeEvent.timeStamp;\n this.type = type;\n }\n\n isDefaultPrevented(): boolean {\n return this.nativeEvent.defaultPrevented;\n }\n\n preventDefault(): void {\n this.defaultPrevented = true;\n this.nativeEvent.preventDefault();\n }\n\n stopPropagation(): void {\n this.nativeEvent.stopPropagation();\n this.isPropagationStopped = () => true;\n }\n\n isPropagationStopped(): boolean {\n return false;\n }\n\n persist() {}\n}\n\nexport function useSyntheticBlurEvent<Target = Element>(onBlur: (e: ReactFocusEvent<Target>) => void) {\n let stateRef = useRef({\n isFocused: false,\n observer: null as MutationObserver | null\n });\n\n // Clean up MutationObserver on unmount. See below.\n \n useLayoutEffect(() => {\n const state = stateRef.current;\n return () => {\n if (state.observer) {\n state.observer.disconnect();\n state.observer = null;\n }\n };\n }, []);\n\n let dispatchBlur = useEffectEvent((e: SyntheticFocusEvent<Target>) => {\n onBlur?.(e);\n });\n\n // This function is called during a React onFocus event.\n return useCalLine truncated
@@ -0,0 +1,9 @@
const parse = require('./parse')
const stringify = require('./stringify')
const JSON5 = {
parse,
stringify,
}
module.exports = JSON5
@@ -0,0 +1,212 @@
# negotiator
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][github-actions-ci-image]][github-actions-ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]
An HTTP content negotiator for Node.js
## Installation
```sh
$ npm install negotiator
```
## API
```js
var Negotiator = require('negotiator')
```
### Accept Negotiation
```js
availableMediaTypes = ['text/html', 'text/plain', 'application/json']
// The negotiator constructor receives a request object
negotiator = new Negotiator(request)
// Let's say Accept header is 'text/html, application/*;q=0.2, image/jpeg;q=0.8'
negotiator.mediaTypes()
// -> ['text/html', 'image/jpeg', 'application/*']
negotiator.mediaTypes(availableMediaTypes)
// -> ['text/html', 'application/json']
negotiator.mediaType(availableMediaTypes)
// -> 'text/html'
```
You can check a working example at `examples/accept.js`.
#### Methods
##### mediaType()
Returns the most preferred media type from the client.
##### mediaType(availableMediaType)
Returns the most preferred media type from a list of available media types.
##### mediaTypes()
Returns an array of preferred media types ordered by the client preference.
##### mediaTypes(availableMediaTypes)
Returns an array of preferred media types ordered by priority from a list of
available media types.
### Accept-Language Negotiation
```js
negotiator = new Negotiator(request)
availableLanguages = ['en', 'es', 'fr']
// Let's say Accept-Language header is 'en;q=0.8, es, pt'
negotiator.languages()
// -> ['es', 'pt', 'en']
negotiator.languages(availableLanguages)
// -> ['es', 'en']
language = negotiator.language(availableLanguages)
// -> 'es'
```
You can check a working example at `examples/language.js`.
#### Methods
##### language()
Returns the most preferred language from the client.
##### language(availableLanguages)
Returns the most preferred language from a list of available languages.
##### languages()
Returns an array of preferred languages ordered by the client preference.
##### languages(availableLanguages)
Returns an array of preferred languages ordered by priority from a list of
available languages.
### Accept-Charset Negotiation
```js
availableCharsets = ['utf-8', 'iso-8859-1', 'iso-8859-5']
negotiator = new Negotiator(request)
// Let's say Accept-Charset header is 'utf-8, iso-8859-1;q=0.8, utf-7;q=0.2'
negotiator.charsets()
// -> ['utf-8', 'iso-8859-1', 'utf-7']
negotiator.charsets(availableCharsets)
// -> ['utf-8', 'iso-8859-1']
negotiator.charset(availableCharsets)
// -> 'utf-8'
```
You can check a working example at `examples/charset.js`.
#### Methods
##### charset()
Returns the most preferred charset from the client.
##### charset(availableCharsets)
Returns the most preferred charset from a list of available charsets.
##### charsets()
Returns an array of preferred charsets ordered by the client preference.
##### charsets(availableCharsets)
Returns an array of preferred charsets ordered by priority from a list of
available charsets.
### Accept-Encoding Negotiation
```js
availableEncodings = ['identity', 'gzip']
negotiator = new Negotiator(request)
// Let's say Accept-Encoding header is 'gzip, compress;q=0.2, identity;q=0.5'
negotiator.encodings()
// -> ['gzip', 'identity', 'compress']
negotiator.encodings(availableEncodings)
// -> ['gzip', 'identity']
negotiator.encoding(availableEncodings)
// -> 'gzip'
```
You can check a working example at `examples/encoding.js`.
#### Methods
##### encoding()
Returns the most preferred encoding from the client.
##### encoding(availableEncodings)
Returns the most preferred encoding from a list of available encodings.
##### encoding(availableEncodings, preferred)
Returns the most preferred encoding from a list of available encodings, while prioritizing based on `preferred` array between same-quality encodings.
##### encodings()
Returns an array of preferred encodings ordered by the client preference.
##### encodings(availableEncodings)
Returns an array of preferred encodings ordered by priority from a list of
available encodings.
##### encodings(availableEncodings, preferred)
Returns an array of preferred encodings ordered by priority from a list of
available encodings, while prioritizing based on `preferred` array between same-quality encodings.
## See Also
The [accepts](https://npmjs.org/package/accepts#readme) module builds on
this module and provides an alternative interface, mime type validation,
and more.
## License
[MIT](LICENSE)
[npm-image]: https://img.shields.io/npm/v/negotiator.svg
[npm-url]: https://npmjs.org/package/negotiator
[node-version-image]: https://img.shields.io/node/v/negotiator.svg
[node-version-url]: https://nodejs.org/en/download/
[coveralls-image]: https://img.shields.io/coveralls/jshttp/negotiator/master.svg
[coveralls-url]: https://coveralls.io/r/jshttp/negotiator?branch=master
[downloads-image]: https://img.shields.io/npm/dm/negotiator.svg
[downloads-url]: https://npmjs.org/package/negotiator
[github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/negotiator/ci/master?label=ci
[github-actions-ci-url]: https://github.com/jshttp/negotiator/actions/workflows/ci.yml
@@ -0,0 +1,147 @@
import { __assign, __awaiter, __generator, __read, __spreadArray } from "tslib";
import { useMemo, useRef, useState } from 'react';
import useEventListener from '../useEventListener';
import useMemoizedFn from '../useMemoizedFn';
import useRequest from '../useRequest';
import useUpdateEffect from '../useUpdateEffect';
import { getTargetElement } from '../utils/domTarget';
import { getClientHeight, getScrollHeight, getScrollTop } from '../utils/rect';
var useInfiniteScroll = function (service, options) {
if (options === void 0) { options = {}; }
var target = options.target, isNoMore = options.isNoMore, _a = options.threshold, threshold = _a === void 0 ? 100 : _a, _b = options.direction, direction = _b === void 0 ? 'bottom' : _b, _c = options.reloadDeps, reloadDeps = _c === void 0 ? [] : _c, manual = options.manual, onBefore = options.onBefore, onSuccess = options.onSuccess, onError = options.onError, onFinally = options.onFinally;
var _d = __read(useState(), 2), finalData = _d[0], setFinalData = _d[1];
var _e = __read(useState(false), 2), loadingMore = _e[0], setLoadingMore = _e[1];
var isScrollToTop = direction === 'top';
// lastScrollTop is used to determine whether the scroll direction is up or down
var lastScrollTop = useRef(undefined);
// scrollBottom is used to record the distance from the bottom of the scroll bar
var scrollBottom = useRef(0);
var noMore = useMemo(function () {
if (!isNoMore) {
return false;
}
return isNoMore(finalData);
}, [finalData]);
var _f = useRequest(function (lastData) { return __awaiter(void 0, void 0, void 0, function () {
var currentData;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, service(lastData)];
case 1:
currentData = _a.sent();
return [2 /*return*/, { currentData: currentData, lastData: lastData }];
}
});
}); }, {
manual: manual,
onFinally: function (_, d, e) {
setLoadingMore(false);
onFinally === null || onFinally === void 0 ? void 0 : onFinally(d === null || d === void 0 ? void 0 : d.currentData, e);
},
onBefore: function () { return onBefore === null || onBefore === void 0 ? void 0 : onBefore(); },
onSuccess: function (d) {
var _a, _b, _c;
if (!d.lastData) {
setFinalData(__assign(__assign({}, d.currentData), { list: __spreadArray([], __read(((_a = d.currentData.list) !== null && _a !== void 0 ? _a : [])), false) }));
}
else {
setFinalData(__assign(__assign({}, d.currentData), { list: isScrollToTop
? __spreadArray(__spreadArray([], __read(d.currentData.list), false), __read(((_b = d.lastData.list) !== null && _b !== void 0 ? _b : [])), false) : __spreadArray(__spreadArray([], __read(((_c = d.lastData.list) !== null && _c !== void 0 ? _c : [])), false), __read(d.currentData.list), false) }));
}
setTimeout(function () {
if (isScrollToTop) {
var el = getTargetElement(target);
el = el === document ? document.documentElement : el;
if (el) {
var scrollHeight = getScrollHeight(el);
el.scrollTo(0, scrollHeight - scrollBottom.current);
}
}
else {
// eslint-disable-next-line @typescript-eslint/no-use-before-define
scrollMethod();
}
});
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(d.currentData);
},
onError: function (e) { return onError === null || onError === void 0 ? void 0 : onError(e); },
}), loading = _f.loading, error = _f.error, run = _f.run, runAsync = _f.runAsync, cancel = _f.cancel;
var loadMore = useMemoizedFn(function () {
if (noMore) {
return;
}
setLoadingMore(true);
run(finalData);
});
var runAsyncForCurrent = function (data) { return __awaiter(void 0, void 0, void 0, function () {
var res;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, runAsync(data)];
case 1:
res = _a.sent();
return [2 /*return*/, res.currentData];
}
});
}); };
var loadMoreAsync = useMemoizedFn(function () {
if (noMore) {
return Promise.reject();
}
setLoadingMore(true);
return runAsyncForCurrent(finalData);
});
var reload = function () {
setLoadingMore(false);
return run();
};
var reloadAsync = function () {
setLoadingMore(false);
return runAsyncForCurrent();
};
var scrollMethod = function () {
var el = getTargetElement(target);
if (!el) {
return;
}
var targetEl = el === document ? document.documentElement : el;
var scrollTop = getScrollTop(targetEl);
var scrollHeight = getScrollHeight(targetEl);
var clientHeight = getClientHeight(targetEl);
if (isScrollToTop) {
if (lastScrollTop.current !== undefined &&
lastScrollTop.current > scrollTop &&
scrollTop <= threshold) {
loadMore();
}
lastScrollTop.current = scrollTop;
scrollBottom.current = scrollHeight - scrollTop;
}
else if (scrollHeight - scrollTop <= clientHeight + threshold) {
loadMore();
}
};
useEventListener('scroll', function () {
if (loading || loadingMore) {
return;
}
scrollMethod();
}, { target: target });
useUpdateEffect(function () {
run();
}, __spreadArray([], __read(reloadDeps), false));
return {
data: finalData,
loading: !loadingMore && loading,
error: error,
loadingMore: loadingMore,
noMore: noMore,
loadMore: loadMore,
loadMoreAsync: loadMoreAsync,
reload: useMemoizedFn(reload),
reloadAsync: useMemoizedFn(reloadAsync),
mutate: setFinalData,
cancel: cancel,
};
};
export default useInfiniteScroll;
@@ -0,0 +1,117 @@
/**
* @fileoverview Require component props to be typed as read-only.
* @author Luke Zapart
*/
'use strict';
const flatMap = require('array.prototype.flatmap');
const values = require('object.values');
const Components = require('../util/Components');
const docsUrl = require('../util/docsUrl');
const report = require('../util/report');
function isFlowPropertyType(node) {
return node.type === 'ObjectTypeProperty';
}
function isTypescriptPropertyType(node) {
return node.type === 'TSPropertySignature';
}
function isCovariant(node) {
return (node.variance && node.variance.kind === 'plus')
|| (
node.parent
&& node.parent.parent
&& node.parent.parent.parent
&& node.parent.parent.parent.id
&& node.parent.parent.parent.id.name === '$ReadOnly'
);
}
function isReadonly(node) {
return (
node.typeAnnotation
&& node.typeAnnotation.parent
&& node.typeAnnotation.parent.readonly
);
}
// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------
const messages = {
readOnlyProp: 'Prop \'{{name}}\' should be read-only.',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Enforce that props are read-only',
category: 'Stylistic Issues',
recommended: false,
url: docsUrl('prefer-read-only-props'),
},
fixable: 'code',
messages,
schema: [],
},
create: Components.detect((context, components) => {
function reportReadOnlyProp(prop, propName, fixer) {
report(context, messages.readOnlyProp, 'readOnlyProp', {
node: prop.node,
data: {
name: propName,
},
fix: fixer,
});
}
return {
'Program:exit'() {
flatMap(
values(components.list()),
(component) => component.declaredPropTypes || []
).forEach((declaredPropTypes) => {
Object.keys(declaredPropTypes).forEach((propName) => {
const prop = declaredPropTypes[propName];
if (!prop.node) {
return;
}
if (isFlowPropertyType(prop.node)) {
if (!isCovariant(prop.node)) {
reportReadOnlyProp(prop, propName, (fixer) => {
if (!prop.node.variance) {
// Insert covariance
return fixer.insertTextBefore(prop.node, '+');
}
// Replace contravariance with covariance
return fixer.replaceText(prop.node.variance, '+');
});
}
return;
}
if (isTypescriptPropertyType(prop.node)) {
if (!isReadonly(prop.node)) {
reportReadOnlyProp(prop, propName, (fixer) => (
fixer.insertTextBefore(prop.node, 'readonly ')
));
}
}
});
});
},
};
}),
};
@@ -0,0 +1,125 @@
export type ObjectDefinition = $typests.ObjectDefinition;
export type PropertyDefinition = $typests.PropertyDefinition;
/**
* @fileoverview Merge Strategy
*/
/**
* Container class for several different merge strategies.
*/
export class MergeStrategy {
/**
* Merges two keys by overwriting the first with the second.
* @param {*} value1 The value from the first object key.
* @param {*} value2 The value from the second object key.
* @returns {*} The second value.
*/
static overwrite(value1: any, value2: any): any;
/**
* Merges two keys by replacing the first with the second only if the
* second is defined.
* @param {*} value1 The value from the first object key.
* @param {*} value2 The value from the second object key.
* @returns {*} The second value if it is defined.
*/
static replace(value1: any, value2: any): any;
/**
* Merges two properties by assigning properties from the second to the first.
* @param {*} value1 The value from the first object key.
* @param {*} value2 The value from the second object key.
* @returns {*} A new object containing properties from both value1 and
* value2.
*/
static assign(value1: any, value2: any): any;
}
/**
* Represents an object validation/merging schema.
*/
export class ObjectSchema {
/**
* Creates a new instance.
* @param {ObjectDefinition} definitions The schema definitions.
* @throws {Error} When the definitions are missing or invalid.
*/
constructor(definitions: ObjectDefinition);
/**
* Determines if a strategy has been registered for the given object key.
* @param {string} key The object key to find a strategy for.
* @returns {boolean} True if the key has a strategy registered, false if not.
*/
hasKey(key: string): boolean;
/**
* Merges objects together to create a new object comprised of the keys
* of the all objects. Keys are merged based on the each key's merge
* strategy.
* @param {...Object} objects The objects to merge.
* @returns {Object} A new object with a mix of all objects' keys.
* @throws {TypeError} If any object is invalid.
*/
merge(...objects: any[]): any;
/**
* Validates an object's keys based on the validate strategy for each key.
* @param {Object} object The object to validate.
* @returns {void}
* @throws {Error} When the object is invalid.
*/
validate(object: any): void;
#private;
}
/**
* @fileoverview Validation Strategy
*/
/**
* Container class for several different validation strategies.
*/
export class ValidationStrategy {
/**
* Validates that a value is an array.
* @param {*} value The value to validate.
* @returns {void}
* @throws {TypeError} If the value is invalid.
*/
static array(value: any): void;
/**
* Validates that a value is a boolean.
* @param {*} value The value to validate.
* @returns {void}
* @throws {TypeError} If the value is invalid.
*/
static boolean(value: any): void;
/**
* Validates that a value is a number.
* @param {*} value The value to validate.
* @returns {void}
* @throws {TypeError} If the value is invalid.
*/
static number(value: any): void;
/**
* Validates that a value is a object.
* @param {*} value The value to validate.
* @returns {void}
* @throws {TypeError} If the value is invalid.
*/
static object(value: any): void;
/**
* Validates that a value is a object or null.
* @param {*} value The value to validate.
* @returns {void}
* @throws {TypeError} If the value is invalid.
*/
static "object?"(value: any): void;
/**
* Validates that a value is a string.
* @param {*} value The value to validate.
* @returns {void}
* @throws {TypeError} If the value is invalid.
*/
static string(value: any): void;
/**
* Validates that a value is a non-empty string.
* @param {*} value The value to validate.
* @returns {void}
* @throws {TypeError} If the value is invalid.
*/
static "string!"(value: any): void;
}
import type * as $typests from "./types.cts";
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Referencer = void 0;
var Referencer_1 = require("./Referencer");
Object.defineProperty(exports, "Referencer", { enumerable: true, get: function () { return Referencer_1.Referencer; } });
@@ -0,0 +1,83 @@
import Stack from './_Stack.js';
import equalArrays from './_equalArrays.js';
import equalByTag from './_equalByTag.js';
import equalObjects from './_equalObjects.js';
import getTag from './_getTag.js';
import isArray from './isArray.js';
import isBuffer from './isBuffer.js';
import isTypedArray from './isTypedArray.js';
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
objectTag = '[object Object]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* A specialized version of `baseIsEqual` for arrays and objects which performs
* deep comparisons and tracks traversed objects enabling objects with circular
* references to be compared.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
var objIsArr = isArray(object),
othIsArr = isArray(other),
objTag = objIsArr ? arrayTag : getTag(object),
othTag = othIsArr ? arrayTag : getTag(other);
objTag = objTag == argsTag ? objectTag : objTag;
othTag = othTag == argsTag ? objectTag : othTag;
var objIsObj = objTag == objectTag,
othIsObj = othTag == objectTag,
isSameTag = objTag == othTag;
if (isSameTag && isBuffer(object)) {
if (!isBuffer(other)) {
return false;
}
objIsArr = true;
objIsObj = false;
}
if (isSameTag && !objIsObj) {
stack || (stack = new Stack);
return (objIsArr || isTypedArray(object))
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
}
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object.value() : object,
othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack);
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack);
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
}
export default baseIsEqualDeep;
@@ -0,0 +1,9 @@
function _applyDecoratedDescriptor(i, e, r, n, l) {
var a = {};
return Object.keys(n).forEach(function (i) {
a[i] = n[i];
}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) {
return n(i, e, r) || r;
}, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a;
}
module.exports = _applyDecoratedDescriptor, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1 @@
{"mappings":"AAAA;;;;;;;;;;CAUC,GAoBM,SAAS,0CAAsB,OAAyB;IAC7D,IAAI,+CACF,QAAQ,KAAK,CAAC;QAAC,eAAe;IAAI;SAC7B;QACL,IAAI,qBAAqB,4CAAsB;QAC/C,QAAQ,KAAK;QACb,4CAAsB;IACxB;AACF;AAEA,IAAI,oDAA8C;AAClD,SAAS;IACP,IAAI,qDAA+B,MAAM;QACvC,oDAA8B;QAC9B,IAAI;YACF,IAAI,YAAY,SAAS,aAAa,CAAC;YACvC,UAAU,KAAK,CAAC;gBACd,IAAI,iBAAgB;oBAClB,oDAA8B;oBAC9B,OAAO;gBACT;YACF;QACF,EAAE,OAAM;QACN,SAAS;QACX;IACF;IAEA,OAAO;AACT;AAEA,SAAS,4CAAsB,OAAyB;IACtD,IAAI,SAAS,QAAQ,UAAU;IAC/B,IAAI,qBAA0C,EAAE;IAChD,IAAI,uBAAuB,SAAS,gBAAgB,IAAI,SAAS,eAAe;IAEhF,MAAO,kBAAkB,eAAe,WAAW,qBAAsB;QACvE,IACE,OAAO,YAAY,GAAG,OAAO,YAAY,IACzC,OAAO,WAAW,GAAG,OAAO,WAAW,EAEvC,mBAAmB,IAAI,CAAC;YACtB,SAAS;YACT,WAAW,OAAO,SAAS;YAC3B,YAAY,OAAO,UAAU;QAC/B;QAEF,SAAS,OAAO,UAAU;IAC5B;IAEA,IAAI,gCAAgC,aAClC,mBAAmB,IAAI,CAAC;QACtB,SAAS;QACT,WAAW,qBAAqB,SAAS;QACzC,YAAY,qBAAqB,UAAU;IAC7C;IAGF,OAAO;AACT;AAEA,SAAS,4CAAsB,kBAAuC;IACpE,KAAK,IAAI,WAAC,OAAO,aAAE,SAAS,cAAE,UAAU,EAAC,IAAI,mBAAoB;QAC/D,QAAQ,SAAS,GAAG;QACpB,QAAQ,UAAU,GAAG;IACvB;AACF","sources":["packages/@react-aria/utils/src/focusWithoutScrolling.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusableElement} from '@react-types/shared';\n\n// This is a polyfill for element.focus({preventScroll: true});\n// Currently necessary for Safari and old Edge:\n// https://caniuse.com/#feat=mdn-api_htmlelement_focus_preventscroll_option\n// See https://bugs.webkit.org/show_bug.cgi?id=178583\n//\n\n// Original licensing for the following methods can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/calvellido/focus-options-polyfill\n\ninterface ScrollableElement {\n element: HTMLElement,\n scrollTop: number,\n scrollLeft: number\n}\n\nexport function focusWithoutScrolling(element: FocusableElement) {\n if (supportsPreventScroll()) {\n element.focus({preventScroll: true});\n } else {\n let scrollableElements = getScrollableElements(element);\n element.focus();\n restoreScrollPosition(scrollableElements);\n }\n}\n\nlet supportsPreventScrollCached: boolean | null = null;\nfunction supportsPreventScroll() {\n if (supportsPreventScrollCached == null) {\n supportsPreventScrollCached = false;\n try {\n let focusElem = document.createElement('div');\n focusElem.focus({\n get preventScroll() {\n supportsPreventScrollCached = true;\n return true;\n }\n });\n } catch {\n // Ignore\n }\n }\n\n return supportsPreventScrollCached;\n}\n\nfunction getScrollableElements(element: FocusableElement): ScrollableElement[] {\n let parent = element.parentNode;\n let scrollableElements: ScrollableElement[] = [];\n let rootScrollingElement = document.scrollingElement || document.documentElement;\n\n while (parent instanceof HTMLElement && parent !== rootScrollingElement) {\n if (\n parent.offsetHeight < parent.scrollHeight ||\n parent.offsetWidth < parent.scrollWidth\n ) {\n scrollableElements.push({\n element: parent,\n scrollTop: parent.scrollTop,\n scrollLeft: parent.scrollLeft\n });\n }\n parent = parent.parentNode;\n }\n\n if (rootScrollingElement instanceof HTMLElement) {\n scrollableElements.push({\n element: rootScrollingElement,\n scrollTop: rootScrollingElement.scrollTop,\n scrollLeft: rootScrollingElement.scrollLeft\n });\n }\n\n return scrollableElements;\n}\n\nfunction restoreScrollPosition(scrollableElements: ScrollableElement[]) {\n for (let {element, scrollTop, scrollLeft} of scrollableElements) {\n element.scrollTop = scrollTop;\n element.scrollLeft = scrollLeft;\n }\n}\n"],"names":[],"version":3,"file":"focusWithoutScrolling.module.js.map"}
@@ -0,0 +1,447 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.encodeCBOR = exports.decodeCBOR = exports.decodePartialCBOR = exports.CBORTag = void 0;
const cbor_internal_js_1 = require("./cbor_internal.js");
/**
* A value which is wrapped with a CBOR Tag.
* Several tags are registered with defined meanings like 0 for a date string.
* These meanings are **not interpreted** when decoded or encoded.
*
* This class is an immutable record.
* If the tag number or value needs to change, then construct a new tag
*/
class CBORTag {
/**
* Wrap a value with a tag number.
* When encoded, this tag will be attached to the value.
*
* @param tag Tag number
* @param value Wrapped value
*/
constructor(tag, value) {
Object.defineProperty(this, "tagId", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "tagValue", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.tagId = tag;
this.tagValue = value;
}
/**
* Read the tag number
*/
get tag() {
return this.tagId;
}
/**
* Read the value
*/
get value() {
return this.tagValue;
}
}
exports.CBORTag = CBORTag;
function decodeUnsignedInteger(data, argument, index) {
return (0, cbor_internal_js_1.decodeLength)(data, argument, index);
}
function decodeNegativeInteger(data, argument, index) {
const [value, length] = decodeUnsignedInteger(data, argument, index);
return [-value - 1, length];
}
function decodeByteString(data, argument, index) {
const [lengthValue, lengthConsumed] = (0, cbor_internal_js_1.decodeLength)(data, argument, index);
const dataStartIndex = index + lengthConsumed;
return [
new Uint8Array(data.buffer.slice(dataStartIndex, dataStartIndex + lengthValue)),
lengthConsumed + lengthValue,
];
}
const TEXT_DECODER = new TextDecoder();
function decodeString(data, argument, index) {
const [value, length] = decodeByteString(data, argument, index);
return [TEXT_DECODER.decode(value), length];
}
function decodeArray(data, argument, index) {
if (argument === 0) {
return [[], 1];
}
const [length, lengthConsumed] = (0, cbor_internal_js_1.decodeLength)(data, argument, index);
let consumedLength = lengthConsumed;
const value = [];
for (let i = 0; i < length; i++) {
const remainingDataLength = data.byteLength - index - consumedLength;
if (remainingDataLength <= 0) {
throw new Error("array is not supported or well formed");
}
const [decodedValue, consumed] = decodeNext(data, index + consumedLength);
value.push(decodedValue);
consumedLength += consumed;
}
return [value, consumedLength];
}
const MAP_ERROR = "Map is not supported or well formed";
function decodeMap(data, argument, index) {
if (argument === 0) {
return [new Map(), 1];
}
const [length, lengthConsumed] = (0, cbor_internal_js_1.decodeLength)(data, argument, index);
let consumedLength = lengthConsumed;
const result = new Map();
for (let i = 0; i < length; i++) {
let remainingDataLength = data.byteLength - index - consumedLength;
if (remainingDataLength <= 0) {
throw new Error(MAP_ERROR);
}
// Load key
const [key, keyConsumed] = decodeNext(data, index + consumedLength);
consumedLength += keyConsumed;
remainingDataLength -= keyConsumed;
// Check that there's enough to have a value
if (remainingDataLength <= 0) {
throw new Error(MAP_ERROR);
}
// Technically CBOR maps can have any type as the key, and so can JS Maps
// However, JS Maps can only reference such keys as references which would
// require key iteration and pattern matching.
// For simplicity, since such keys are not in use with WebAuthn, this
// capability is not implemented and the types are restricted to strings
// and numbers.
if (typeof key !== "string" && typeof key !== "number") {
throw new Error(MAP_ERROR);
}
// CBOR Maps are not well formed if there are duplicate keys
if (result.has(key)) {
throw new Error(MAP_ERROR);
}
// Load value
const [value, valueConsumed] = decodeNext(data, index + consumedLength);
consumedLength += valueConsumed;
result.set(key, value);
}
return [result, consumedLength];
}
function decodeFloat16(data, index) {
if (index + 3 > data.byteLength) {
throw new Error("CBOR stream ended before end of Float 16");
}
// Skip the first byte
const result = data.getUint16(index + 1, false);
// A minimal selection of supported values
if (result == 0x7c00) {
return [Infinity, 3];
}
else if (result == 0x7e00) {
return [NaN, 3];
}
else if (result == 0xfc00) {
return [-Infinity, 3];
}
throw new Error("Float16 data is unsupported");
}
function decodeFloat32(data, index) {
if (index + 5 > data.byteLength) {
throw new Error("CBOR stream ended before end of Float 32");
}
// Skip the first byte
const result = data.getFloat32(index + 1, false);
// First byte + 4 byte float
return [result, 5];
}
function decodeFloat64(data, index) {
if (index + 9 > data.byteLength) {
throw new Error("CBOR stream ended before end of Float 64");
}
// Skip the first byte
const result = data.getFloat64(index + 1, false);
// First byte + 8 byte float
return [result, 9];
}
function decodeTag(data, argument, index) {
const [tag, tagBytes] = (0, cbor_internal_js_1.decodeLength)(data, argument, index);
const [value, valueBytes] = decodeNext(data, index + tagBytes);
return [new CBORTag(tag, value), tagBytes + valueBytes];
}
function decodeNext(data, index) {
if (index >= data.byteLength) {
throw new Error("CBOR stream ended before tag value");
}
const byte = data.getUint8(index);
const majorType = byte >> 5;
const argument = byte & 0x1f;
switch (majorType) {
case cbor_internal_js_1.MAJOR_TYPE_UNSIGNED_INTEGER: {
return decodeUnsignedInteger(data, argument, index);
}
case cbor_internal_js_1.MAJOR_TYPE_NEGATIVE_INTEGER: {
return decodeNegativeInteger(data, argument, index);
}
case cbor_internal_js_1.MAJOR_TYPE_BYTE_STRING: {
return decodeByteString(data, argument, index);
}
case cbor_internal_js_1.MAJOR_TYPE_TEXT_STRING: {
return decodeString(data, argument, index);
}
case cbor_internal_js_1.MAJOR_TYPE_ARRAY: {
return decodeArray(data, argument, index);
}
case cbor_internal_js_1.MAJOR_TYPE_MAP: {
return decodeMap(data, argument, index);
}
case cbor_internal_js_1.MAJOR_TYPE_TAG: {
return decodeTag(data, argument, index);
}
case cbor_internal_js_1.MAJOR_TYPE_SIMPLE_OR_FLOAT: {
switch (argument) {
case 20:
return [false, 1];
case 21:
return [true, 1];
case 22:
return [null, 1];
case 23:
return [undefined, 1];
// 24: Simple value (value 32..255 in following byte)
case 25: // IEEE 754 Half-Precision Float (16 bits follow)
return decodeFloat16(data, index);
case 26: // IEEE 754 Single-Precision Float (32 bits follow)
return decodeFloat32(data, index);
case 27: // IEEE 754 Double-Precision Float (64 bits follow)
return decodeFloat64(data, index);
// 28-30: Reserved, not well-formed in the present document
// 31: "break" stop code for indefinite-length items
}
}
}
throw new Error(`Unsupported or not well formed at ${index}`);
}
function encodeSimple(data) {
if (data === true) {
return 0xf5;
}
else if (data === false) {
return 0xf4;
}
else if (data === null) {
return 0xf6;
}
// Else undefined
return 0xf7;
}
function encodeFloat(data) {
if (Math.fround(data) == data || !Number.isFinite(data) || Number.isNaN(data)) {
// Float32
const output = new Uint8Array(5);
output[0] = 0xfa;
const view = new DataView(output.buffer);
view.setFloat32(1, data, false);
return output;
}
else {
// Float64
const output = new Uint8Array(9);
output[0] = 0xfb;
const view = new DataView(output.buffer);
view.setFloat64(1, data, false);
return output;
}
}
function encodeNumber(data) {
if (typeof data == "number") {
if (Number.isSafeInteger(data)) {
// Encode integer
if (data < 0) {
return (0, cbor_internal_js_1.encodeLength)(cbor_internal_js_1.MAJOR_TYPE_NEGATIVE_INTEGER, Math.abs(data));
}
else {
return (0, cbor_internal_js_1.encodeLength)(cbor_internal_js_1.MAJOR_TYPE_UNSIGNED_INTEGER, data);
}
}
return [encodeFloat(data)];
}
else {
if (data < 0n) {
return (0, cbor_internal_js_1.encodeLength)(cbor_internal_js_1.MAJOR_TYPE_NEGATIVE_INTEGER, data * -1n);
}
else {
return (0, cbor_internal_js_1.encodeLength)(cbor_internal_js_1.MAJOR_TYPE_UNSIGNED_INTEGER, data);
}
}
}
const ENCODER = new TextEncoder();
function encodeString(data, output) {
output.push(...(0, cbor_internal_js_1.encodeLength)(cbor_internal_js_1.MAJOR_TYPE_TEXT_STRING, data.length));
output.push(ENCODER.encode(data));
}
function encodeBytes(data, output) {
output.push(...(0, cbor_internal_js_1.encodeLength)(cbor_internal_js_1.MAJOR_TYPE_BYTE_STRING, data.length));
output.push(data);
}
function encodeArray(data, output) {
output.push(...(0, cbor_internal_js_1.encodeLength)(cbor_internal_js_1.MAJOR_TYPE_ARRAY, data.length));
for (const element of data) {
encodePartialCBOR(element, output);
}
}
function encodeMap(data, output) {
output.push(new Uint8Array((0, cbor_internal_js_1.encodeLength)(cbor_internal_js_1.MAJOR_TYPE_MAP, data.size)));
for (const [key, value] of data.entries()) {
encodePartialCBOR(key, output);
encodePartialCBOR(value, output);
}
}
function encodeTag(tag, output) {
output.push(...(0, cbor_internal_js_1.encodeLength)(cbor_internal_js_1.MAJOR_TYPE_TAG, tag.tag));
encodePartialCBOR(tag.value, output);
}
function encodePartialCBOR(data, output) {
if (typeof data == "boolean" || data === null || data == undefined) {
output.push(encodeSimple(data));
return;
}
if (typeof data == "number" || typeof data == "bigint") {
output.push(...encodeNumber(data));
return;
}
if (typeof data == "string") {
encodeString(data, output);
return;
}
if (data instanceof Uint8Array) {
encodeBytes(data, output);
return;
}
if (Array.isArray(data)) {
encodeArray(data, output);
return;
}
if (data instanceof Map) {
encodeMap(data, output);
return;
}
if (data instanceof CBORTag) {
encodeTag(data, output);
return;
}
throw new Error("Not implemented");
}
/**
* Like {decodeCBOR}, but the length of the data is unknown and there is likely
* more -- possibly unrelated non-CBOR -- data afterwards.
*
* Examples:
*
* ```ts
* import {decodePartialCBOR} from './cbor.ts'
* decodePartialCBOR(new Uint8Array([1, 2, 245, 3, 4]), 2)
* // returns [true, 1]
* // It did not decode the leading [1, 2] or trailing [3, 4]
* ```
*
* @param data a data stream to read data from
* @param index where to start reading in the data stream
* @returns a tuple of the value followed by bytes read.
* @throws {Error}
* When the data stream ends early or the CBOR data is not well formed
*/
function decodePartialCBOR(data, index) {
if (data.byteLength === 0 || data.byteLength <= index || index < 0) {
throw new Error("No data");
}
if (data instanceof Uint8Array) {
return decodeNext(new DataView(data.buffer), index);
}
else if (data instanceof ArrayBuffer) {
return decodeNext(new DataView(data), index);
}
// otherwise, it is a data view
return decodeNext(data, index);
}
exports.decodePartialCBOR = decodePartialCBOR;
/**
* Decode CBOR data from a binary stream
*
* The entire data stream from [0, length) will be consumed.
* If you require a partial decoding, see {decodePartialCBOR}.
*
* Examples:
*
* ```ts
* import {decodeCBOR, CBORTag, CBORType} from './cbor.ts'
* decodeCBOR(new Uint8Array([162, 99, 107, 101, 121, 101, 118, 97, 108, 117, 101, 1, 109, 97, 110, 111, 116, 104, 101, 114, 32, 118, 97, 108, 117, 101]));
* // returns new Map<string | number, CBORType>([
* // ["key", "value"],
* // [1, "another value"]
* // ]);
*
* const taggedItem = new Uint8Array([217, 4, 210, 101, 104, 101, 108, 108, 111]);
* decodeCBOR(new DataView(taggedItem.buffer))
* // returns new CBORTag(1234, "hello")
* ```
*
* @param data a data stream, multiple types are supported
* @returns
*/
function decodeCBOR(data) {
const [value, length] = decodePartialCBOR(data, 0);
if (length !== data.byteLength) {
throw new Error(`Data was decoded, but the whole stream was not processed ${length} != ${data.byteLength}`);
}
return value;
}
exports.decodeCBOR = decodeCBOR;
/**
* Encode a supported structure to a CBOR byte string.
*
* Example:
*
* ```ts
* import {encodeCBOR, CBORType, CBORTag} from './cbor.ts'
* encodeCBOR(new Map<string | number, CBORType>([
* ["key", "value"],
* [1, "another value"]
* ]));
* // returns new Uint8Array([162, 99, 107, 101, 121, 101, 118, 97, 108, 117, 101, 1, 109, 97, 110, 111, 116, 104, 101, 114, 32 118, 97, 108, 117, 101])
*
* encodeCBOR(new CBORTag(1234, "hello"))
* // returns new UInt8Array([217, 4, 210, 101, 104, 101, 108, 108, 111])
* ```
*
* @param data Data to encode
* @returns A byte string as a Uint8Array
* @throws Error
* if unsupported data is found during encoding
*/
function encodeCBOR(data) {
const results = [];
encodePartialCBOR(data, results);
let length = 0;
for (const result of results) {
if (typeof result == "number") {
length += 1;
}
else {
length += result.length;
}
}
const output = new Uint8Array(length);
let index = 0;
for (const result of results) {
if (typeof result == "number") {
output[index] = result;
index += 1;
}
else {
output.set(result, index);
index += result.length;
}
}
return output;
}
exports.encodeCBOR = encodeCBOR;
@@ -0,0 +1,42 @@
{
"name": "bytes",
"description": "Utility to parse a string bytes to bytes and vice-versa",
"version": "3.1.2",
"author": "TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)",
"contributors": [
"Jed Watson <jed.watson@me.com>",
"Théo FIDRY <theo.fidry@gmail.com>"
],
"license": "MIT",
"keywords": [
"byte",
"bytes",
"utility",
"parse",
"parser",
"convert",
"converter"
],
"repository": "visionmedia/bytes.js",
"devDependencies": {
"eslint": "7.32.0",
"eslint-plugin-markdown": "2.2.1",
"mocha": "9.2.0",
"nyc": "15.1.0"
},
"files": [
"History.md",
"LICENSE",
"Readme.md",
"index.js"
],
"engines": {
"node": ">= 0.8"
},
"scripts": {
"lint": "eslint .",
"test": "mocha --check-leaks --reporter spec",
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test"
}
}
@@ -0,0 +1,6 @@
/**
* Returns black or white for best contrast depending on the luminosity of the
* given color.
*/
declare function readableColor(color: string): string;
export default readableColor;
@@ -0,0 +1,10 @@
import { PluginFunc } from 'dayjs/esm'
declare const plugin: PluginFunc
export = plugin
declare module 'dayjs/esm' {
interface Dayjs {
isoWeeksInYear(): number
}
}
@@ -0,0 +1,146 @@
'use strict';var _contextCompat = require('eslint-module-utils/contextCompat');
var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}
function getImportValue(node) {
return node.type === 'ImportDeclaration' ?
node.source.value :
node.moduleReference.expression.value;
}
module.exports = {
meta: {
type: 'suggestion',
docs: {
category: 'Style guide',
description: 'Ensure all imports appear before other statements.',
url: (0, _docsUrl2['default'])('first') },
fixable: 'code',
schema: [
{
type: 'string',
'enum': ['absolute-first', 'disable-absolute-first'] }] },
create: function () {function create(context) {
function isPossibleDirective(node) {
return node.type === 'ExpressionStatement' &&
node.expression.type === 'Literal' &&
typeof node.expression.value === 'string';
}
return {
Program: function () {function Program(n) {
var body = n.body;
if (!body) {
return;
}
var absoluteFirst = context.options[0] === 'absolute-first';
var message = 'Import in body of module; reorder to top.';
var sourceCode = (0, _contextCompat.getSourceCode)(context);
var originSourceCode = sourceCode.getText();
var nonImportCount = 0;
var anyExpressions = false;
var anyRelative = false;
var lastLegalImp = null;
var errorInfos = [];
var shouldSort = true;
var lastSortNodesIndex = 0;
body.forEach(function (node, index) {
if (!anyExpressions && isPossibleDirective(node)) {
return;
}
anyExpressions = true;
if (node.type === 'ImportDeclaration' || node.type === 'TSImportEqualsDeclaration') {
if (absoluteFirst) {
if (/^\./.test(getImportValue(node))) {
anyRelative = true;
} else if (anyRelative) {
context.report({
node: node.type === 'ImportDeclaration' ? node.source : node.moduleReference,
message: 'Absolute imports should come before relative imports.' });
}
}
if (nonImportCount > 0) {var _iteratorNormalCompletion = true;var _didIteratorError = false;var _iteratorError = undefined;try {
for (var _iterator = (0, _contextCompat.getDeclaredVariables)(context, node)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var variable = _step.value;
if (!shouldSort) {break;}
var references = variable.references;
if (references.length) {var _iteratorNormalCompletion2 = true;var _didIteratorError2 = false;var _iteratorError2 = undefined;try {
for (var _iterator2 = references[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {var reference = _step2.value;
if (reference.identifier.range[0] < node.range[1]) {
shouldSort = false;
break;
}
}} catch (err) {_didIteratorError2 = true;_iteratorError2 = err;} finally {try {if (!_iteratorNormalCompletion2 && _iterator2['return']) {_iterator2['return']();}} finally {if (_didIteratorError2) {throw _iteratorError2;}}}
}
}} catch (err) {_didIteratorError = true;_iteratorError = err;} finally {try {if (!_iteratorNormalCompletion && _iterator['return']) {_iterator['return']();}} finally {if (_didIteratorError) {throw _iteratorError;}}}
shouldSort && (lastSortNodesIndex = errorInfos.length);
errorInfos.push({
node: node,
range: [body[index - 1].range[1], node.range[1]] });
} else {
lastLegalImp = node;
}
} else {
nonImportCount++;
}
});
if (!errorInfos.length) {return;}
errorInfos.forEach(function (errorInfo, index) {
var node = errorInfo.node;
var infos = {
node: node,
message: message };
if (index < lastSortNodesIndex) {
infos.fix = function (fixer) {
return fixer.insertTextAfter(node, '');
};
} else if (index === lastSortNodesIndex) {
var sortNodes = errorInfos.slice(0, lastSortNodesIndex + 1);
infos.fix = function (fixer) {
var removeFixers = sortNodes.map(function (_errorInfo) {
return fixer.removeRange(_errorInfo.range);
});
var range = [0, removeFixers[removeFixers.length - 1].range[1]];
var insertSourceCode = sortNodes.map(function (_errorInfo) {
var nodeSourceCode = String.prototype.slice.apply(
originSourceCode, _errorInfo.range);
if (/\S/.test(nodeSourceCode[0])) {
return '\n' + String(nodeSourceCode);
}
return nodeSourceCode;
}).join('');
var insertFixer = null;
var replaceSourceCode = '';
if (!lastLegalImp) {
insertSourceCode = insertSourceCode.trim() + insertSourceCode.match(/^(\s+)/)[0];
}
insertFixer = lastLegalImp ?
fixer.insertTextAfter(lastLegalImp, insertSourceCode) :
fixer.insertTextBefore(body[0], insertSourceCode);
var fixers = [insertFixer].concat(removeFixers);
fixers.forEach(function (computedFixer, i) {
replaceSourceCode += originSourceCode.slice(
fixers[i - 1] ? fixers[i - 1].range[1] : 0, computedFixer.range[0]) +
computedFixer.text;
});
return fixer.replaceTextRange(range, replaceSourceCode);
};
}
context.report(infos);
});
}return Program;}() };
}return create;}() };
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9maXJzdC5qcyJdLCJuYW1lcyI6WyJnZXRJbXBvcnRWYWx1ZSIsIm5vZGUiLCJ0eXBlIiwic291cmNlIiwidmFsdWUiLCJtb2R1bGVSZWZlcmVuY2UiLCJleHByZXNzaW9uIiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJkb2NzIiwiY2F0ZWdvcnkiLCJkZXNjcmlwdGlvbiIsInVybCIsImZpeGFibGUiLCJzY2hlbWEiLCJjcmVhdGUiLCJjb250ZXh0IiwiaXNQb3NzaWJsZURpcmVjdGl2ZSIsIlByb2dyYW0iLCJuIiwiYm9keSIsImFic29sdXRlRmlyc3QiLCJvcHRpb25zIiwibWVzc2FnZSIsInNvdXJjZUNvZGUiLCJvcmlnaW5Tb3VyY2VDb2RlIiwiZ2V0VGV4dCIsIm5vbkltcG9ydENvdW50IiwiYW55RXhwcmVzc2lvbnMiLCJhbnlSZWxhdGl2ZSIsImxhc3RMZWdhbEltcCIsImVycm9ySW5mb3MiLCJzaG91bGRTb3J0IiwibGFzdFNvcnROb2Rlc0luZGV4IiwiZm9yRWFjaCIsImluZGV4IiwidGVzdCIsInJlcG9ydCIsInZhcmlhYmxlIiwicmVmZXJlbmNlcyIsImxlbmd0aCIsInJlZmVyZW5jZSIsImlkZW50aWZpZXIiLCJyYW5nZSIsInB1c2giLCJlcnJvckluZm8iLCJpbmZvcyIsImZpeCIsImZpeGVyIiwiaW5zZXJ0VGV4dEFmdGVyIiwic29ydE5vZGVzIiwic2xpY2UiLCJyZW1vdmVGaXhlcnMiLCJtYXAiLCJfZXJyb3JJbmZvIiwicmVtb3ZlUmFuZ2UiLCJpbnNlcnRTb3VyY2VDb2RlIiwibm9kZVNvdXJjZUNvZGUiLCJTdHJpbmciLCJwcm90b3R5cGUiLCJhcHBseSIsImpvaW4iLCJpbnNlcnRGaXhlciIsInJlcGxhY2VTb3VyY2VDb2RlIiwidHJpbSIsIm1hdGNoIiwiaW5zZXJ0VGV4dEJlZm9yZSIsImZpeGVycyIsImNvbmNhdCIsImNvbXB1dGVkRml4ZXIiLCJpIiwidGV4dCIsInJlcGxhY2VUZXh0UmFuZ2UiXSwibWFwcGluZ3MiOiJhQUFBOztBQUVBLHFDOztBQUVBLFNBQVNBLGNBQVQsQ0FBd0JDLElBQXhCLEVBQThCO0FBQzVCLFNBQU9BLEtBQUtDLElBQUwsS0FBYyxtQkFBZDtBQUNIRCxPQUFLRSxNQUFMLENBQVlDLEtBRFQ7QUFFSEgsT0FBS0ksZUFBTCxDQUFxQkMsVUFBckIsQ0FBZ0NGLEtBRnBDO0FBR0Q7O0FBRURHLE9BQU9DLE9BQVAsR0FBaUI7QUFDZkMsUUFBTTtBQUNKUCxVQUFNLFlBREY7QUFFSlEsVUFBTTtBQUNKQyxnQkFBVSxhQUROO0FBRUpDLG1CQUFhLG9EQUZUO0FBR0pDLFdBQUssMEJBQVEsT0FBUixDQUhELEVBRkY7O0FBT0pDLGFBQVMsTUFQTDtBQVFKQyxZQUFRO0FBQ047QUFDRWIsWUFBTSxRQURSO0FBRUUsY0FBTSxDQUFDLGdCQUFELEVBQW1CLHdCQUFuQixDQUZSLEVBRE0sQ0FSSixFQURTOzs7OztBQWlCZmMsUUFqQmUsK0JBaUJSQyxPQWpCUSxFQWlCQztBQUNkLGVBQVNDLG1CQUFULENBQTZCakIsSUFBN0IsRUFBbUM7QUFDakMsZUFBT0EsS0FBS0MsSUFBTCxLQUFjLHFCQUFkO0FBQ0ZELGFBQUtLLFVBQUwsQ0FBZ0JKLElBQWhCLEtBQXlCLFNBRHZCO0FBRUYsZUFBT0QsS0FBS0ssVUFBTCxDQUFnQkYsS0FBdkIsS0FBaUMsUUFGdEM7QUFHRDs7QUFFRCxhQUFPO0FBQ0xlLGVBREssZ0NBQ0dDLENBREgsRUFDTTtBQUNULGdCQUFNQyxPQUFPRCxFQUFFQyxJQUFmO0FBQ0EsZ0JBQUksQ0FBQ0EsSUFBTCxFQUFXO0FBQ1Q7QUFDRDtBQUNELGdCQUFNQyxnQkFBZ0JMLFFBQVFNLE9BQVIsQ0FBZ0IsQ0FBaEIsTUFBdUIsZ0JBQTdDO0FBQ0EsZ0JBQU1DLFVBQVUsMkNBQWhCO0FBQ0EsZ0JBQU1DLGFBQWEsa0NBQWNSLE9BQWQsQ0FBbkI7QUFDQSxnQkFBTVMsbUJBQW1CRCxXQUFXRSxPQUFYLEVBQXpCO0FBQ0EsZ0JBQUlDLGlCQUFpQixDQUFyQjtBQUNBLGdCQUFJQyxpQkFBaUIsS0FBckI7QUFDQSxnQkFBSUMsY0FBYyxLQUFsQjtBQUNBLGdCQUFJQyxlQUFlLElBQW5CO0FBQ0EsZ0JBQU1DLGFBQWEsRUFBbkI7QUFDQSxnQkFBSUMsYUFBYSxJQUFqQjtBQUNBLGdCQUFJQyxxQkFBcUIsQ0FBekI7QUFDQWIsaUJBQUtjLE9BQUwsQ0FBYSxVQUFVbEMsSUFBVixFQUFnQm1DLEtBQWhCLEVBQXVCO0FBQ2xDLGtCQUFJLENBQUNQLGNBQUQsSUFBbUJYLG9CQUFvQmpCLElBQXBCLENBQXZCLEVBQWtEO0FBQ2hEO0FBQ0Q7O0FBRUQ0QiwrQkFBaUIsSUFBakI7O0FBRUEsa0JBQUk1QixLQUFLQyxJQUFMLEtBQWMsbUJBQWQsSUFBcUNELEtBQUtDLElBQUwsS0FBYywyQkFBdkQsRUFBb0Y7QUFDbEYsb0JBQUlvQixhQUFKLEVBQW1CO0FBQ2pCLHNCQUFLLEtBQUQsQ0FBUWUsSUFBUixDQUFhckMsZUFBZUMsSUFBZixDQUFiLENBQUosRUFBd0M7QUFDdEM2QixrQ0FBYyxJQUFkO0FBQ0QsbUJBRkQsTUFFTyxJQUFJQSxXQUFKLEVBQWlCO0FBQ3RCYiw0QkFBUXFCLE1BQVIsQ0FBZTtBQUNickMsNEJBQU1BLEtBQUtDLElBQUwsS0FBYyxtQkFBZCxHQUFvQ0QsS0FBS0UsTUFBekMsR0FBa0RGLEtBQUtJLGVBRGhEO0FBRWJtQiwrQkFBUyx1REFGSSxFQUFmOztBQUlEO0FBQ0Y7QUFDRCxvQkFBSUksaUJBQWlCLENBQXJCLEVBQXdCO0FBQ3RCLHlDQUF1Qix5Q0FBcUJYLE9BQXJCLEVBQThCaEIsSUFBOUIsQ0FBdkIsOEhBQTRELEtBQWpEc0MsUUFBaUQ7QUFDMUQsMEJBQUksQ0FBQ04sVUFBTCxFQUFpQixDQUFFLE1BQVE7QUFDM0IsMEJBQU1PLGFBQWFELFNBQVNDLFVBQTVCO0FBQ0EsMEJBQUlBLFdBQVdDLE1BQWYsRUFBdUI7QUFDckIsZ0RBQXdCRCxVQUF4QixtSUFBb0MsS0FBekJFLFNBQXlCO0FBQ2xDLGdDQUFJQSxVQUFVQyxVQUFWLENBQXFCQyxLQUFyQixDQUEyQixDQUEzQixJQUFnQzNDLEtBQUsyQyxLQUFMLENBQVcsQ0FBWCxDQUFwQyxFQUFtRDtBQUNqRFgsMkNBQWEsS0FBYjtBQUNBO0FBQ0Q7QUFDRiwyQkFOb0I7QUFPdEI7QUFDRixxQkFacUI7QUFhdEJBLGlDQUFlQyxxQkFBcUJGLFdBQVdTLE1BQS9DO0FBQ0FULDZCQUFXYSxJQUFYLENBQWdCO0FBQ2Q1Qyw4QkFEYztBQUVkMkMsMkJBQU8sQ0FBQ3ZCLEtBQUtlLFFBQVEsQ0FBYixFQUFnQlEsS0FBaEIsQ0FBc0IsQ0FBdEIsQ0FBRCxFQUEyQjNDLEtBQUsyQyxLQUFMLENBQVcsQ0FBWCxDQUEzQixDQUZPLEVBQWhCOztBQUlELGlCQWxCRCxNQWtCTztBQUNMYixpQ0FBZTlCLElBQWY7QUFDRDtBQUNGLGVBaENELE1BZ0NPO0FBQ0wyQjtBQUNEO0FBQ0YsYUExQ0Q7QUEyQ0EsZ0JBQUksQ0FBQ0ksV0FBV1MsTUFBaEIsRUFBd0IsQ0FBRSxPQUFTO0FBQ25DVCx1QkFBV0csT0FBWCxDQUFtQixVQUFVVyxTQUFWLEVBQXFCVixLQUFyQixFQUE0QjtBQUM3QyxrQkFBTW5DLE9BQU82QyxVQUFVN0MsSUFBdkI7QUFDQSxrQkFBTThDLFFBQVE7QUFDWjlDLDBCQURZO0FBRVp1QixnQ0FGWSxFQUFkOztBQUlBLGtCQUFJWSxRQUFRRixrQkFBWixFQUFnQztBQUM5QmEsc0JBQU1DLEdBQU4sR0FBWSxVQUFVQyxLQUFWLEVBQWlCO0FBQzNCLHlCQUFPQSxNQUFNQyxlQUFOLENBQXNCakQsSUFBdEIsRUFBNEIsRUFBNUIsQ0FBUDtBQUNELGlCQUZEO0FBR0QsZUFKRCxNQUlPLElBQUltQyxVQUFVRixrQkFBZCxFQUFrQztBQUN2QyxvQkFBTWlCLFlBQVluQixXQUFXb0IsS0FBWCxDQUFpQixDQUFqQixFQUFvQmxCLHFCQUFxQixDQUF6QyxDQUFsQjtBQUNBYSxzQkFBTUMsR0FBTixHQUFZLFVBQVVDLEtBQVYsRUFBaUI7QUFDM0Isc0JBQU1JLGVBQWVGLFVBQVVHLEdBQVYsQ0FBYyxVQUFVQyxVQUFWLEVBQXNCO0FBQ3ZELDJCQUFPTixNQUFNTyxXQUFOLENBQWtCRCxXQUFXWCxLQUE3QixDQUFQO0FBQ0QsbUJBRm9CLENBQXJCO0FBR0Esc0JBQU1BLFFBQVEsQ0FBQyxDQUFELEVBQUlLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GACjB,OAAO,GACP,MAAM,GACN,QAAQ,GACR,YAAY,GACZ,aAAa,GACb,mBAAmB,GACnB,YAAY,GACZ,UAAU,GACV,eAAe,GACf,QAAQ,GACR,iBAAiB,GACjB,WAAW,GACX,OAAO,GACP,SAAS,GACT,UAAU,GACV,qBAAqB,GACrB,mBAAmB,GACnB,QAAQ,GACR,iBAAiB,GACjB,eAAe,GACf,MAAM,GACN,OAAO,GACP,UAAU,GACV,QAAQ,CAAC"}
@@ -0,0 +1,9 @@
/**
* @fileoverview the `recommended-script` config for `eslint.config.js`
* @author 唯然<weiran.zsd@outlook.com>
* @deprecated use `flat/recommended-script` instead
*/
"use strict"
module.exports = require("../lib/index.js").configs["flat/recommended-script"]
@@ -0,0 +1,30 @@
var SafeContents_1;
import { __decorate } from "tslib";
import { AsnArray, AsnType, AsnTypeTypes, AsnProp, AsnPropTypes } from "@peculiar/asn1-schema";
import { PKCS12Attribute } from "./attribute";
export class SafeBag {
constructor(params = {}) {
this.bagId = "";
this.bagValue = new ArrayBuffer(0);
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
], SafeBag.prototype, "bagId", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Any, context: 0 })
], SafeBag.prototype, "bagValue", void 0);
__decorate([
AsnProp({ type: PKCS12Attribute, repeated: "set", optional: true })
], SafeBag.prototype, "bagAttributes", void 0);
let SafeContents = SafeContents_1 = class SafeContents extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, SafeContents_1.prototype);
}
};
SafeContents = SafeContents_1 = __decorate([
AsnType({ type: AsnTypeTypes.Sequence, itemType: SafeBag })
], SafeContents);
export { SafeContents };
@@ -0,0 +1,10 @@
const fs = require('fs')
const version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version
const versArr = version.replace(/^v/, '').split('.')
const hasNative = +versArr[0] > 10 || +versArr[0] === 10 && +versArr[1] >= 12
const useNative = !hasNative ? () => false : opts => opts.mkdir === fs.mkdir
const useNativeSync = !hasNative ? () => false : opts => opts.mkdirSync === fs.mkdirSync
module.exports = {useNative, useNativeSync}
@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.id_sect571r1 = exports.id_sect571k1 = exports.id_secp521r1 = exports.id_sect409r1 = exports.id_sect409k1 = exports.id_secp384r1 = exports.id_sect283r1 = exports.id_sect283k1 = exports.id_secp256r1 = exports.id_sect233r1 = exports.id_sect233k1 = exports.id_secp224r1 = exports.id_sect163r2 = exports.id_sect163k1 = exports.id_secp192r1 = exports.id_ecdsaWithSHA512 = exports.id_ecdsaWithSHA384 = exports.id_ecdsaWithSHA256 = exports.id_ecdsaWithSHA224 = exports.id_ecdsaWithSHA1 = exports.id_ecMQV = exports.id_ecDH = exports.id_ecPublicKey = void 0;
exports.id_ecPublicKey = "1.2.840.10045.2.1";
exports.id_ecDH = "1.3.132.1.12";
exports.id_ecMQV = "1.3.132.1.13";
exports.id_ecdsaWithSHA1 = "1.2.840.10045.4.1";
exports.id_ecdsaWithSHA224 = "1.2.840.10045.4.3.1";
exports.id_ecdsaWithSHA256 = "1.2.840.10045.4.3.2";
exports.id_ecdsaWithSHA384 = "1.2.840.10045.4.3.3";
exports.id_ecdsaWithSHA512 = "1.2.840.10045.4.3.4";
exports.id_secp192r1 = "1.2.840.10045.3.1.1";
exports.id_sect163k1 = "1.3.132.0.1";
exports.id_sect163r2 = "1.3.132.0.15";
exports.id_secp224r1 = "1.3.132.0.33";
exports.id_sect233k1 = "1.3.132.0.26";
exports.id_sect233r1 = "1.3.132.0.27";
exports.id_secp256r1 = "1.2.840.10045.3.1.7";
exports.id_sect283k1 = "1.3.132.0.16";
exports.id_sect283r1 = "1.3.132.0.17";
exports.id_secp384r1 = "1.3.132.0.34";
exports.id_sect409k1 = "1.3.132.0.36";
exports.id_sect409r1 = "1.3.132.0.37";
exports.id_secp521r1 = "1.3.132.0.35";
exports.id_sect571k1 = "1.3.132.0.38";
exports.id_sect571r1 = "1.3.132.0.39";
@@ -0,0 +1,122 @@
"use strict";
/**
* Copyright (c) 2020, Microsoft Corporation (MIT License).
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConoutConnection = void 0;
var worker_threads_1 = require("worker_threads");
var conout_1 = require("./shared/conout");
var path_1 = require("path");
var eventEmitter2_1 = require("./eventEmitter2");
/**
* The amount of time to wait for additional data after the conpty shell process has exited before
* shutting down the worker and sockets. The timer will be reset if a new data event comes in after
* the timer has started.
*/
var FLUSH_DATA_INTERVAL = 1000;
/**
* Connects to and manages the lifecycle of the conout socket. This socket must be drained on
* another thread in order to avoid deadlocks where Conpty waits for the out socket to drain
* when `ClosePseudoConsole` is called. This happens when data is being written to the terminal when
* the pty is closed.
*
* See also:
* - https://github.com/microsoft/node-pty/issues/375
* - https://github.com/microsoft/vscode/issues/76548
* - https://github.com/microsoft/terminal/issues/1810
* - https://docs.microsoft.com/en-us/windows/console/closepseudoconsole
*/
var ConoutConnection = /** @class */ (function () {
function ConoutConnection(_conoutPipeName) {
var _this = this;
this._conoutPipeName = _conoutPipeName;
this._isDisposed = false;
this._onReady = new eventEmitter2_1.EventEmitter2();
var workerData = { conoutPipeName: _conoutPipeName };
var scriptPath = __dirname.replace('node_modules.asar', 'node_modules.asar.unpacked');
this._worker = new worker_threads_1.Worker(path_1.join(scriptPath, 'worker/conoutSocketWorker.js'), { workerData: workerData });
this._worker.on('message', function (message) {
switch (message) {
case 1 /* READY */:
_this._onReady.fire();
return;
default:
console.warn('Unexpected ConoutWorkerMessage', message);
}
});
}
Object.defineProperty(ConoutConnection.prototype, "onReady", {
get: function () { return this._onReady.event; },
enumerable: false,
configurable: true
});
ConoutConnection.prototype.dispose = function () {
if (this._isDisposed) {
return;
}
this._isDisposed = true;
// Drain all data from the socket before closing
this._drainDataAndClose();
};
ConoutConnection.prototype.connectSocket = function (socket) {
socket.connect(conout_1.getWorkerPipeName(this._conoutPipeName));
};
ConoutConnection.prototype._drainDataAndClose = function () {
var _this = this;
if (this._drainTimeout) {
clearTimeout(this._drainTimeout);
}
this._drainTimeout = setTimeout(function () { return _this._destroySocket(); }, FLUSH_DATA_INTERVAL);
};
ConoutConnection.prototype._destroySocket = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this._worker.terminate()];
case 1:
_a.sent();
return [2 /*return*/];
}
});
});
};
return ConoutConnection;
}());
exports.ConoutConnection = ConoutConnection;
//# sourceMappingURL=windowsConoutConnection.js.map
@@ -0,0 +1,45 @@
{
"name": "node-abi",
"version": "3.80.0",
"description": "Get the Node ABI for a given target and runtime, and vice versa.",
"main": "index.js",
"scripts": {
"test": "tape test/index.js",
"update-abi-registry": "node --unhandled-rejections=strict scripts/update-abi-registry.js"
},
"files": [
"abi_registry.json"
],
"repository": {
"type": "git",
"url": "git+https://github.com/electron/node-abi.git"
},
"keywords": [
"node",
"electron",
"node_module_version",
"abi",
"v8"
],
"author": "Lukas Geiger",
"license": "MIT",
"bugs": {
"url": "https://github.com/electron/node-abi/issues"
},
"homepage": "https://github.com/electron/node-abi#readme",
"devDependencies": {
"@semantic-release/npm": "13.0.0-alpha.15",
"semantic-release": "^24.2.7",
"tape": "^5.3.1"
},
"dependencies": {
"semver": "^7.3.5"
},
"engines": {
"node": ">=10"
},
"publishConfig": {
"provenance": true
},
"packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f"
}
@@ -0,0 +1,592 @@
import { TypeSystemPolicy } from '../system/index.mjs';
import { KeyOfPattern } from '../type/keyof/index.mjs';
import { TypeRegistry, FormatRegistry } from '../type/registry/index.mjs';
import { ExtendsUndefinedCheck } from '../type/extends/extends-undefined.mjs';
import { GetErrorFunction } from './function.mjs';
import { TypeBoxError } from '../type/error/index.mjs';
import { Deref } from '../value/deref/index.mjs';
import { Hash } from '../value/hash/index.mjs';
import { Check } from '../value/check/index.mjs';
import { Kind } from '../type/symbols/index.mjs';
import { Never } from '../type/never/index.mjs';
// ------------------------------------------------------------------
// ValueGuard
// ------------------------------------------------------------------
// prettier-ignore
import { IsArray, IsUint8Array, IsDate, IsPromise, IsFunction, IsAsyncIterator, IsIterator, IsBoolean, IsNumber, IsBigInt, IsString, IsSymbol, IsInteger, IsNull, IsUndefined } from '../value/guard/index.mjs';
// ------------------------------------------------------------------
// ValueErrorType
// ------------------------------------------------------------------
export var ValueErrorType;
(function (ValueErrorType) {
ValueErrorType[ValueErrorType["ArrayContains"] = 0] = "ArrayContains";
ValueErrorType[ValueErrorType["ArrayMaxContains"] = 1] = "ArrayMaxContains";
ValueErrorType[ValueErrorType["ArrayMaxItems"] = 2] = "ArrayMaxItems";
ValueErrorType[ValueErrorType["ArrayMinContains"] = 3] = "ArrayMinContains";
ValueErrorType[ValueErrorType["ArrayMinItems"] = 4] = "ArrayMinItems";
ValueErrorType[ValueErrorType["ArrayUniqueItems"] = 5] = "ArrayUniqueItems";
ValueErrorType[ValueErrorType["Array"] = 6] = "Array";
ValueErrorType[ValueErrorType["AsyncIterator"] = 7] = "AsyncIterator";
ValueErrorType[ValueErrorType["BigIntExclusiveMaximum"] = 8] = "BigIntExclusiveMaximum";
ValueErrorType[ValueErrorType["BigIntExclusiveMinimum"] = 9] = "BigIntExclusiveMinimum";
ValueErrorType[ValueErrorType["BigIntMaximum"] = 10] = "BigIntMaximum";
ValueErrorType[ValueErrorType["BigIntMinimum"] = 11] = "BigIntMinimum";
ValueErrorType[ValueErrorType["BigIntMultipleOf"] = 12] = "BigIntMultipleOf";
ValueErrorType[ValueErrorType["BigInt"] = 13] = "BigInt";
ValueErrorType[ValueErrorType["Boolean"] = 14] = "Boolean";
ValueErrorType[ValueErrorType["DateExclusiveMaximumTimestamp"] = 15] = "DateExclusiveMaximumTimestamp";
ValueErrorType[ValueErrorType["DateExclusiveMinimumTimestamp"] = 16] = "DateExclusiveMinimumTimestamp";
ValueErrorType[ValueErrorType["DateMaximumTimestamp"] = 17] = "DateMaximumTimestamp";
ValueErrorType[ValueErrorType["DateMinimumTimestamp"] = 18] = "DateMinimumTimestamp";
ValueErrorType[ValueErrorType["DateMultipleOfTimestamp"] = 19] = "DateMultipleOfTimestamp";
ValueErrorType[ValueErrorType["Date"] = 20] = "Date";
ValueErrorType[ValueErrorType["Function"] = 21] = "Function";
ValueErrorType[ValueErrorType["IntegerExclusiveMaximum"] = 22] = "IntegerExclusiveMaximum";
ValueErrorType[ValueErrorType["IntegerExclusiveMinimum"] = 23] = "IntegerExclusiveMinimum";
ValueErrorType[ValueErrorType["IntegerMaximum"] = 24] = "IntegerMaximum";
ValueErrorType[ValueErrorType["IntegerMinimum"] = 25] = "IntegerMinimum";
ValueErrorType[ValueErrorType["IntegerMultipleOf"] = 26] = "IntegerMultipleOf";
ValueErrorType[ValueErrorType["Integer"] = 27] = "Integer";
ValueErrorType[ValueErrorType["IntersectUnevaluatedProperties"] = 28] = "IntersectUnevaluatedProperties";
ValueErrorType[ValueErrorType["Intersect"] = 29] = "Intersect";
ValueErrorType[ValueErrorType["Iterator"] = 30] = "Iterator";
ValueErrorType[ValueErrorType["Kind"] = 31] = "Kind";
ValueErrorType[ValueErrorType["Literal"] = 32] = "Literal";
ValueErrorType[ValueErrorType["Never"] = 33] = "Never";
ValueErrorType[ValueErrorType["Not"] = 34] = "Not";
ValueErrorType[ValueErrorType["Null"] = 35] = "Null";
ValueErrorType[ValueErrorType["NumberExclusiveMaximum"] = 36] = "NumberExclusiveMaximum";
ValueErrorType[ValueErrorType["NumberExclusiveMinimum"] = 37] = "NumberExclusiveMinimum";
ValueErrorType[ValueErrorType["NumberMaximum"] = 38] = "NumberMaximum";
ValueErrorType[ValueErrorType["NumberMinimum"] = 39] = "NumberMinimum";
ValueErrorType[ValueErrorType["NumberMultipleOf"] = 40] = "NumberMultipleOf";
ValueErrorType[ValueErrorType["Number"] = 41] = "Number";
ValueErrorType[ValueErrorType["ObjectAdditionalProperties"] = 42] = "ObjectAdditionalProperties";
ValueErrorType[ValueErrorType["ObjectMaxProperties"] = 43] = "ObjectMaxProperties";
ValueErrorType[ValueErrorType["ObjectMinProperties"] = 44] = "ObjectMinProperties";
ValueErrorType[ValueErrorType["ObjectRequiredProperty"] = 45] = "ObjectRequiredProperty";
ValueErrorType[ValueErrorType["Object"] = 46] = "Object";
ValueErrorType[ValueErrorType["Promise"] = 47] = "Promise";
ValueErrorType[ValueErrorType["RegExp"] = 48] = "RegExp";
ValueErrorType[ValueErrorType["StringFormatUnknown"] = 49] = "StringFormatUnknown";
ValueErrorType[ValueErrorType["StringFormat"] = 50] = "StringFormat";
ValueErrorType[ValueErrorType["StringMaxLength"] = 51] = "StringMaxLength";
ValueErrorType[ValueErrorType["StringMinLength"] = 52] = "StringMinLength";
ValueErrorType[ValueErrorType["StringPattern"] = 53] = "StringPattern";
ValueErrorType[ValueErrorType["String"] = 54] = "String";
ValueErrorType[ValueErrorType["Symbol"] = 55] = "Symbol";
ValueErrorType[ValueErrorType["TupleLength"] = 56] = "TupleLength";
ValueErrorType[ValueErrorType["Tuple"] = 57] = "Tuple";
ValueErrorType[ValueErrorType["Uint8ArrayMaxByteLength"] = 58] = "Uint8ArrayMaxByteLength";
ValueErrorType[ValueErrorType["Uint8ArrayMinByteLength"] = 59] = "Uint8ArrayMinByteLength";
ValueErrorType[ValueErrorType["Uint8Array"] = 60] = "Uint8Array";
ValueErrorType[ValueErrorType["Undefined"] = 61] = "Undefined";
ValueErrorType[ValueErrorType["Union"] = 62] = "Union";
ValueErrorType[ValueErrorType["Void"] = 63] = "Void";
})(ValueErrorType || (ValueErrorType = {}));
// ------------------------------------------------------------------
// ValueErrors
// ------------------------------------------------------------------
export class ValueErrorsUnknownTypeError extends TypeBoxError {
constructor(schema) {
super('Unknown type');
this.schema = schema;
}
}
// ------------------------------------------------------------------
// EscapeKey
// ------------------------------------------------------------------
function EscapeKey(key) {
return key.replace(/~/g, '~0').replace(/\//g, '~1'); // RFC6901 Path
}
// ------------------------------------------------------------------
// Guards
// ------------------------------------------------------------------
function IsDefined(value) {
return value !== undefined;
}
// ------------------------------------------------------------------
// ValueErrorIterator
// ------------------------------------------------------------------
export class ValueErrorIterator {
constructor(iterator) {
this.iterator = iterator;
}
[Symbol.iterator]() {
return this.iterator;
}
/** Returns the first value error or undefined if no errors */
First() {
const next = this.iterator.next();
return next.done ? undefined : next.value;
}
}
// --------------------------------------------------------------------------
// Create
// --------------------------------------------------------------------------
function Create(errorType, schema, path, value, errors = []) {
return {
type: errorType,
schema,
path,
value,
message: GetErrorFunction()({ errorType, path, schema, value, errors }),
errors,
};
}
// --------------------------------------------------------------------------
// Types
// --------------------------------------------------------------------------
function* FromAny(schema, references, path, value) { }
function* FromArgument(schema, references, path, value) { }
function* FromArray(schema, references, path, value) {
if (!IsArray(value)) {
return yield Create(ValueErrorType.Array, schema, path, value);
}
if (IsDefined(schema.minItems) && !(value.length >= schema.minItems)) {
yield Create(ValueErrorType.ArrayMinItems, schema, path, value);
}
if (IsDefined(schema.maxItems) && !(value.length <= schema.maxItems)) {
yield Create(ValueErrorType.ArrayMaxItems, schema, path, value);
}
for (let i = 0; i < value.length; i++) {
yield* Visit(schema.items, references, `${path}/${i}`, value[i]);
}
// prettier-ignore
if (schema.uniqueItems === true && !((function () { const set = new Set(); for (const element of value) {
const hashed = Hash(element);
if (set.has(hashed)) {
return false;
}
else {
set.add(hashed);
}
} return true; })())) {
yield Create(ValueErrorType.ArrayUniqueItems, schema, path, value);
}
// contains
if (!(IsDefined(schema.contains) || IsDefined(schema.minContains) || IsDefined(schema.maxContains))) {
return;
}
const containsSchema = IsDefined(schema.contains) ? schema.contains : Never();
const containsCount = value.reduce((acc, value, index) => (Visit(containsSchema, references, `${path}${index}`, value).next().done === true ? acc + 1 : acc), 0);
if (containsCount === 0) {
yield Create(ValueErrorType.ArrayContains, schema, path, value);
}
if (IsNumber(schema.minContains) && containsCount < schema.minContains) {
yield Create(ValueErrorType.ArrayMinContains, schema, path, value);
}
if (IsNumber(schema.maxContains) && containsCount > schema.maxContains) {
yield Create(ValueErrorType.ArrayMaxContains, schema, path, value);
}
}
function* FromAsyncIterator(schema, references, path, value) {
if (!IsAsyncIterator(value))
yield Create(ValueErrorType.AsyncIterator, schema, path, value);
}
function* FromBigInt(schema, references, path, value) {
if (!IsBigInt(value))
return yield Create(ValueErrorType.BigInt, schema, path, value);
if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {
yield Create(ValueErrorType.BigIntExclusiveMaximum, schema, path, value);
}
if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {
yield Create(ValueErrorType.BigIntExclusiveMinimum, schema, path, value);
}
if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {
yield Create(ValueErrorType.BigIntMaximum, schema, path, value);
}
if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {
yield Create(ValueErrorType.BigIntMinimum, schema, path, value);
}
if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === BigInt(0))) {
yield Create(ValueErrorType.BigIntMultipleOf, schema, path, value);
}
}
function* FromBoolean(schema, references, path, value) {
if (!IsBoolean(value))
yield Create(ValueErrorType.Boolean, schema, path, value);
}
function* FromConstructor(schema, references, path, value) {
yield* Visit(schema.returns, references, path, value.prototype);
}
function* FromDate(schema, references, path, value) {
if (!IsDate(value))
return yield Create(ValueErrorType.Date, schema, path, value);
if (IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) {
yield Create(ValueErrorType.DateExclusiveMaximumTimestamp, schema, path, value);
}
if (IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) {
yield Create(ValueErrorType.DateExclusiveMinimumTimestamp, schema, path, value);
}
if (IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) {
yield Create(ValueErrorType.DateMaximumTimestamp, schema, path, value);
}
if (IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) {
yield Create(ValueErrorType.DateMinimumTimestamp, schema, path, value);
}
if (IsDefined(schema.multipleOfTimestamp) && !(value.getTime() % schema.multipleOfTimestamp === 0)) {
yield Create(ValueErrorType.DateMultipleOfTimestamp, schema, path, value);
}
}
function* FromFunction(schema, references, path, value) {
if (!IsFunction(value))
yield Create(ValueErrorType.Function, schema, path, value);
}
function* FromImport(schema, references, path, value) {
const definitions = globalThis.Object.values(schema.$defs);
const target = schema.$defs[schema.$ref];
yield* Visit(target, [...references, ...definitions], path, value);
}
function* FromInteger(schema, references, path, value) {
if (!IsInteger(value))
return yield Create(ValueErrorType.Integer, schema, path, value);
if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {
yield Create(ValueErrorType.IntegerExclusiveMaximum, schema, path, value);
}
if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {
yield Create(ValueErrorType.IntegerExclusiveMinimum, schema, path, value);
}
if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {
yield Create(ValueErrorType.IntegerMaximum, schema, path, value);
}
if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {
yield Create(ValueErrorType.IntegerMinimum, schema, path, value);
}
if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) {
yield Create(ValueErrorType.IntegerMultipleOf, schema, path, value);
}
}
function* FromIntersect(schema, references, path, value) {
let hasError = false;
for (const inner of schema.allOf) {
for (const error of Visit(inner, references, path, value)) {
hasError = true;
yield error;
}
}
if (hasError) {
return yield Create(ValueErrorType.Intersect, schema, path, value);
}
if (schema.unevaluatedProperties === false) {
const keyCheck = new RegExp(KeyOfPattern(schema));
for (const valueKey of Object.getOwnPropertyNames(value)) {
if (!keyCheck.test(valueKey)) {
yield Create(ValueErrorType.IntersectUnevaluatedProperties, schema, `${path}/${valueKey}`, value);
}
}
}
if (typeof schema.unevaluatedProperties === 'object') {
const keyCheck = new RegExp(KeyOfPattern(schema));
for (const valueKey of Object.getOwnPropertyNames(value)) {
if (!keyCheck.test(valueKey)) {
const next = Visit(schema.unevaluatedProperties, references, `${path}/${valueKey}`, value[valueKey]).next();
if (!next.done)
yield next.value; // yield interior
}
}
}
}
function* FromIterator(schema, references, path, value) {
if (!IsIterator(value))
yield Create(ValueErrorType.Iterator, schema, path, value);
}
function* FromLiteral(schema, references, path, value) {
if (!(value === schema.const))
yield Create(ValueErrorType.Literal, schema, path, value);
}
function* FromNever(schema, references, path, value) {
yield Create(ValueErrorType.Never, schema, path, value);
}
function* FromNot(schema, references, path, value) {
if (Visit(schema.not, references, path, value).next().done === true)
yield Create(ValueErrorType.Not, schema, path, value);
}
function* FromNull(schema, references, path, value) {
if (!IsNull(value))
yield Create(ValueErrorType.Null, schema, path, value);
}
function* FromNumber(schema, references, path, value) {
if (!TypeSystemPolicy.IsNumberLike(value))
return yield Create(ValueErrorType.Number, schema, path, value);
if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {
yield Create(ValueErrorType.NumberExclusiveMaximum, schema, path, value);
}
if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {
yield Create(ValueErrorType.NumberExclusiveMinimum, schema, path, value);
}
if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {
yield Create(ValueErrorType.NumberMaximum, schema, path, value);
}
if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {
yield Create(ValueErrorType.NumberMinimum, schema, path, value);
}
if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) {
yield Create(ValueErrorType.NumberMultipleOf, schema, path, value);
}
}
function* FromObject(schema, references, path, value) {
if (!TypeSystemPolicy.IsObjectLike(value))
return yield Create(ValueErrorType.Object, schema, path, value);
if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) {
yield Create(ValueErrorType.ObjectMinProperties, schema, path, value);
}
if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {
yield Create(ValueErrorType.ObjectMaxProperties, schema, path, value);
}
const requiredKeys = Array.isArray(schema.required) ? schema.required : [];
const knownKeys = Object.getOwnPropertyNames(schema.properties);
const unknownKeys = Object.getOwnPropertyNames(value);
for (const requiredKey of requiredKeys) {
if (unknownKeys.includes(requiredKey))
continue;
yield Create(ValueErrorType.ObjectRequiredProperty, schema.properties[requiredKey], `${path}/${EscapeKey(requiredKey)}`, undefined);
}
if (schema.additionalProperties === false) {
for (const valueKey of unknownKeys) {
if (!knownKeys.includes(valueKey)) {
yield Create(ValueErrorType.ObjectAdditionalProperties, schema, `${path}/${EscapeKey(valueKey)}`, value[valueKey]);
}
}
}
if (typeof schema.additionalProperties === 'object') {
for (const valueKey of unknownKeys) {
if (knownKeys.includes(valueKey))
continue;
yield* Visit(schema.additionalProperties, references, `${path}/${EscapeKey(valueKey)}`, value[valueKey]);
}
}
for (const knownKey of knownKeys) {
const property = schema.properties[knownKey];
if (schema.required && schema.required.includes(knownKey)) {
yield* Visit(property, references, `${path}/${EscapeKey(knownKey)}`, value[knownKey]);
if (ExtendsUndefinedCheck(schema) && !(knownKey in value)) {
yield Create(ValueErrorType.ObjectRequiredProperty, property, `${path}/${EscapeKey(knownKey)}`, undefined);
}
}
else {
if (TypeSystemPolicy.IsExactOptionalProperty(value, knownKey)) {
yield* Visit(property, references, `${path}/${EscapeKey(knownKey)}`, value[knownKey]);
}
}
}
}
function* FromPromise(schema, references, path, value) {
if (!IsPromise(value))
yield Create(ValueErrorType.Promise, schema, path, value);
}
function* FromRecord(schema, references, path, value) {
if (!TypeSystemPolicy.IsRecordLike(value))
return yield Create(ValueErrorType.Object, schema, path, value);
if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) {
yield Create(ValueErrorType.ObjectMinProperties, schema, path, value);
}
if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {
yield Create(ValueErrorType.ObjectMaxProperties, schema, path, value);
}
const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0];
const regex = new RegExp(patternKey);
for (const [propertyKey, propertyValue] of Object.entries(value)) {
if (regex.test(propertyKey))
yield* Visit(patternSchema, references, `${path}/${EscapeKey(propertyKey)}`, propertyValue);
}
if (typeof schema.additionalProperties === 'object') {
for (const [propertyKey, propertyValue] of Object.entries(value)) {
if (!regex.test(propertyKey))
yield* Visit(schema.additionalProperties, references, `${path}/${EscapeKey(propertyKey)}`, propertyValue);
}
}
if (schema.additionalProperties === false) {
for (const [propertyKey, propertyValue] of Object.entries(value)) {
if (regex.test(propertyKey))
continue;
return yield Create(ValueErrorType.ObjectAdditionalProperties, schema, `${path}/${EscapeKey(propertyKey)}`, propertyValue);
}
}
}
function* FromRef(schema, references, path, value) {
yield* Visit(Deref(schema, references), references, path, value);
}
function* FromRegExp(schema, references, path, value) {
if (!IsString(value))
return yield Create(ValueErrorType.String, schema, path, value);
if (IsDefined(schema.minLength) && !(value.length >= schema.minLength)) {
yield Create(ValueErrorType.StringMinLength, schema, path, value);
}
if (IsDefined(schema.maxLength) && !(value.length <= schema.maxLength)) {
yield Create(ValueErrorType.StringMaxLength, schema, path, value);
}
const regex = new RegExp(schema.source, schema.flags);
if (!regex.test(value)) {
return yield Create(ValueErrorType.RegExp, schema, path, value);
}
}
function* FromString(schema, references, path, value) {
if (!IsString(value))
return yield Create(ValueErrorType.String, schema, path, value);
if (IsDefined(schema.minLength) && !(value.length >= schema.minLength)) {
yield Create(ValueErrorType.StringMinLength, schema, path, value);
}
if (IsDefined(schema.maxLength) && !(value.length <= schema.maxLength)) {
yield Create(ValueErrorType.StringMaxLength, schema, path, value);
}
if (IsString(schema.pattern)) {
const regex = new RegExp(schema.pattern);
if (!regex.test(value)) {
yield Create(ValueErrorType.StringPattern, schema, path, value);
}
}
if (IsString(schema.format)) {
if (!FormatRegistry.Has(schema.format)) {
yield Create(ValueErrorType.StringFormatUnknown, schema, path, value);
}
else {
const format = FormatRegistry.Get(schema.format);
if (!format(value)) {
yield Create(ValueErrorType.StringFormat, schema, path, value);
}
}
}
}
function* FromSymbol(schema, references, path, value) {
if (!IsSymbol(value))
yield Create(ValueErrorType.Symbol, schema, path, value);
}
function* FromTemplateLiteral(schema, references, path, value) {
if (!IsString(value))
return yield Create(ValueErrorType.String, schema, path, value);
const regex = new RegExp(schema.pattern);
if (!regex.test(value)) {
yield Create(ValueErrorType.StringPattern, schema, path, value);
}
}
function* FromThis(schema, references, path, value) {
yield* Visit(Deref(schema, references), references, path, value);
}
function* FromTuple(schema, references, path, value) {
if (!IsArray(value))
return yield Create(ValueErrorType.Tuple, schema, path, value);
if (schema.items === undefined && !(value.length === 0)) {
return yield Create(ValueErrorType.TupleLength, schema, path, value);
}
if (!(value.length === schema.maxItems)) {
return yield Create(ValueErrorType.TupleLength, schema, path, value);
}
if (!schema.items) {
return;
}
for (let i = 0; i < schema.items.length; i++) {
yield* Visit(schema.items[i], references, `${path}/${i}`, value[i]);
}
}
function* FromUndefined(schema, references, path, value) {
if (!IsUndefined(value))
yield Create(ValueErrorType.Undefined, schema, path, value);
}
function* FromUnion(schema, references, path, value) {
if (Check(schema, references, value))
return;
const errors = schema.anyOf.map((variant) => new ValueErrorIterator(Visit(variant, references, path, value)));
yield Create(ValueErrorType.Union, schema, path, value, errors);
}
function* FromUint8Array(schema, references, path, value) {
if (!IsUint8Array(value))
return yield Create(ValueErrorType.Uint8Array, schema, path, value);
if (IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) {
yield Create(ValueErrorType.Uint8ArrayMaxByteLength, schema, path, value);
}
if (IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength)) {
yield Create(ValueErrorType.Uint8ArrayMinByteLength, schema, path, value);
}
}
function* FromUnknown(schema, references, path, value) { }
function* FromVoid(schema, references, path, value) {
if (!TypeSystemPolicy.IsVoidLike(value))
yield Create(ValueErrorType.Void, schema, path, value);
}
function* FromKind(schema, references, path, value) {
const check = TypeRegistry.Get(schema[Kind]);
if (!check(schema, value))
yield Create(ValueErrorType.Kind, schema, path, value);
}
function* Visit(schema, references, path, value) {
const references_ = IsDefined(schema.$id) ? [...references, schema] : references;
const schema_ = schema;
switch (schema_[Kind]) {
case 'Any':
return yield* FromAny(schema_, references_, path, value);
case 'Argument':
return yield* FromArgument(schema_, references_, path, value);
case 'Array':
return yield* FromArray(schema_, references_, path, value);
case 'AsyncIterator':
return yield* FromAsyncIterator(schema_, references_, path, value);
case 'BigInt':
return yield* FromBigInt(schema_, references_, path, value);
case 'Boolean':
return yield* FromBoolean(schema_, references_, path, value);
case 'Constructor':
return yield* FromConstructor(schema_, references_, path, value);
case 'Date':
return yield* FromDate(schema_, references_, path, value);
case 'Function':
return yield* FromFunction(schema_, references_, path, value);
case 'Import':
return yield* FromImport(schema_, references_, path, value);
case 'Integer':
return yield* FromInteger(schema_, references_, path, value);
case 'Intersect':
return yield* FromIntersect(schema_, references_, path, value);
case 'Iterator':
return yield* FromIterator(schema_, references_, path, value);
case 'Literal':
return yield* FromLiteral(schema_, references_, path, value);
case 'Never':
return yield* FromNever(schema_, references_, path, value);
case 'Not':
return yield* FromNot(schema_, references_, path, value);
case 'Null':
return yield* FromNull(schema_, references_, path, value);
case 'Number':
return yield* FromNumber(schema_, references_, path, value);
case 'Object':
return yield* FromObject(schema_, references_, path, value);
case 'Promise':
return yield* FromPromise(schema_, references_, path, value);
case 'Record':
return yield* FromRecord(schema_, references_, path, value);
case 'Ref':
return yield* FromRef(schema_, references_, path, value);
case 'RegExp':
return yield* FromRegExp(schema_, references_, path, value);
case 'String':
return yield* FromString(schema_, references_, path, value);
case 'Symbol':
return yield* FromSymbol(schema_, references_, path, value);
case 'TemplateLiteral':
return yield* FromTemplateLiteral(schema_, references_, path, value);
case 'This':
return yield* FromThis(schema_, references_, path, value);
case 'Tuple':
return yield* FromTuple(schema_, references_, path, value);
case 'Undefined':
return yield* FromUndefined(schema_, references_, path, value);
case 'Union':
return yield* FromUnion(schema_, references_, path, value);
case 'Uint8Array':
return yield* FromUint8Array(schema_, references_, path, value);
case 'Unknown':
return yield* FromUnknown(schema_, references_, path, value);
case 'Void':
return yield* FromVoid(schema_, references_, path, value);
default:
if (!TypeRegistry.Has(schema_[Kind]))
throw new ValueErrorsUnknownTypeError(schema);
return yield* FromKind(schema_, references_, path, value);
}
}
/** Returns an iterator for each error in this value. */
export function Errors(...args) {
const iterator = args.length === 3 ? Visit(args[0], args[1], '', args[2]) : Visit(args[0], [], '', args[1]);
return new ValueErrorIterator(iterator);
}
@@ -0,0 +1 @@
{"name":"@eslint/js","version":"9.39.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532092604,"integrity":"sha512-T2C622nmNAYjHKhwFTSb65JUU30ZjZOqvq70hIj012qeopB+QvPXqCYYfR7RUeDUJ8RKUkGyr4D6keNLw4bJ9g==","mode":420,"size":1094},"src/configs/eslint-all.js":{"checkedAt":1794532093590,"integrity":"sha512-zOIGNh8K4vLgucktnDHff65uGG8iz+PjgLNYWHsuS1EvDA3dajcY+b5wwDGG4U9TMhiI/H7eG6z9HvXPuduclg==","mode":420,"size":7776},"src/configs/eslint-recommended.js":{"checkedAt":1794532093590,"integrity":"sha512-3WDUXoW7lNOtzPTsT9//M4A7fXMjM4yFSFNL1ImqwH7BDi94aZMzZYZ1fLgKukbAoE5jrAQAHsvGPc3MJ2rEMg==","mode":420,"size":2753},"src/index.js":{"checkedAt":1794532093590,"integrity":"sha512-G/UB3/5e5UIkr+qibMCP05okVX+ZPYRPnDjrcg6O5xznQgalcPw9VYigDM3E+HUEnzKH0Q146ssfweqjDc614A==","mode":420,"size":499},"package.json":{"checkedAt":1794532093591,"integrity":"sha512-zn1wpTJH7iJSs9QZiBFV/tcXOamjMY2hHTeUqKrp1lO9O8ney6MCKpeElECg+lE2t5ZKhlmsB5un3TobEPL18Q==","mode":420,"size":783},"README.md":{"checkedAt":1794532093591,"integrity":"sha512-GnTe5tYiNg79Dy8J/iHflVUVPFhTyBvq0ILa+DCeS7JDcKwshyLt9LcBwEnkyejXNpM0UPxFjNcOvfXXrDFhXQ==","mode":420,"size":2577},"types/index.d.ts":{"checkedAt":1794532093591,"integrity":"sha512-liSbaqfN7j+ddg90zcA0vHqhoRhNLp3S9bXuejJx4PkgabCMjHd0gzz9rjwiKQNe++2BNugrtZeXscvnzyr9Lg==","mode":420,"size":316}}}
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = removePropertiesDeep;
var _traverseFast = require("../traverse/traverseFast.js");
var _removeProperties = require("./removeProperties.js");
function removePropertiesDeep(tree, opts) {
(0, _traverseFast.default)(tree, _removeProperties.default, opts);
return tree;
}
//# sourceMappingURL=removePropertiesDeep.js.map
@@ -0,0 +1,7 @@
'use strict';
var iterate = require('iterate-iterator');
module.exports = function testIterator(iterator, expected, t, msg) {
t.deepEqual(iterate(iterator), expected, 'iterator yields expected values: ' + msg);
};
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('invoke', require('../invoke'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,7 @@
'use strict';
// https://262.ecma-international.org/11.0/#sec-isbigintelementtype
module.exports = function IsBigIntElementType(type) {
return type === 'BigUint64' || type === 'BigInt64';
};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 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 M G N O P Q H R S T U V W X Y Z a b c d e f g"},C:{"1":"0 1 2 3 4 5 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 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 0C 1C"},D:{"1":"0 1 2 3 4 5 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 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 e f","66":"a b c d"},E:{"2":"J ZB K D E F A B C L M G 2C ZC 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED"},F:{"1":"0 1 2 3 4 5 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 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 FD GD HD ID NC uC JD OC"},G:{"2":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"2":"hD"},I:{"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 AB BB CB DB EB FB SC yD","2":"J oD pD qD rD sD aC tD uD vD wD xD QC RC"},Q:{"2":"zD"},R:{"1":"0D"},S:{"2":"1D 2D"}},B:5,C:"WebTransport",D:true};
@@ -0,0 +1,106 @@
import { __read } from "tslib";
import { useState } from 'react';
import useEventListener from '../useEventListener';
import useMemoizedFn from '../useMemoizedFn';
import useUpdateEffect from '../useUpdateEffect';
import { isFunction, isUndef } from '../utils';
export var SYNC_STORAGE_EVENT_NAME = 'AHOOKS_SYNC_STORAGE_EVENT_NAME';
export function createUseStorageState(getStorage) {
function useStorageState(key, options) {
if (options === void 0) { options = {}; }
var storage;
var _a = options.listenStorageChange, listenStorageChange = _a === void 0 ? false : _a, _b = options.onError, onError = _b === void 0 ? function (e) {
console.error(e);
} : _b;
// https://github.com/alibaba/hooks/issues/800
try {
storage = getStorage();
}
catch (err) {
onError(err);
}
var serializer = function (value) {
if (options.serializer) {
return options.serializer(value);
}
return JSON.stringify(value);
};
var deserializer = function (value) {
if (options.deserializer) {
return options.deserializer(value);
}
return JSON.parse(value);
};
function getStoredValue() {
try {
var raw = storage === null || storage === void 0 ? void 0 : storage.getItem(key);
if (raw) {
return deserializer(raw);
}
}
catch (e) {
onError(e);
}
if (isFunction(options.defaultValue)) {
return options.defaultValue();
}
return options.defaultValue;
}
var _c = __read(useState(getStoredValue), 2), state = _c[0], setState = _c[1];
useUpdateEffect(function () {
setState(getStoredValue());
}, [key]);
var updateState = function (value) {
var currentState = isFunction(value) ? value(state) : value;
if (!listenStorageChange) {
setState(currentState);
}
try {
var newValue = void 0;
var oldValue = storage === null || storage === void 0 ? void 0 : storage.getItem(key);
if (isUndef(currentState)) {
newValue = null;
storage === null || storage === void 0 ? void 0 : storage.removeItem(key);
}
else {
newValue = serializer(currentState);
storage === null || storage === void 0 ? void 0 : storage.setItem(key, newValue);
}
dispatchEvent(
// send custom event to communicate within same page
// importantly this should not be a StorageEvent since those cannot
// be constructed with a non-built-in storage area
new CustomEvent(SYNC_STORAGE_EVENT_NAME, {
detail: {
key: key,
newValue: newValue,
oldValue: oldValue,
storageArea: storage,
},
}));
}
catch (e) {
onError(e);
}
};
var syncState = function (event) {
if (event.key !== key || event.storageArea !== storage) {
return;
}
setState(getStoredValue());
};
var syncStateFromCustomEvent = function (event) {
syncState(event.detail);
};
// from another document
useEventListener('storage', syncState, {
enable: listenStorageChange,
});
// from the same document but different hooks
useEventListener(SYNC_STORAGE_EVENT_NAME, syncStateFromCustomEvent, {
enable: listenStorageChange,
});
return [state, useMemoizedFn(updateState)];
}
return useStorageState;
}
@@ -0,0 +1,730 @@
export default `flf2a$ 7 5 16 -1 14
smpoison.flf figletized by Vinney Thai <ssfiit@eris.cc.umb.edu>
poison font composed David Issel <dissel@nunic.nu.edu>
date: Nov 18, 1994
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
7 - height of a character
5 - height of a character, not including descenders
16 - max line length (excluding comment lines) + a fudge factor
-1 - default smushmode for this font (like "-m 0" on command line)
14 - number of comment lines
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
@
@@@$@
@@@$@
!@!$@
$ @
:.:$@
@@
@
@@@ @@@$@
!@ !@$ @
$ $ @
$ $ @
$ $ @
@@
@
@@@ @@@$ @
@@@!@@@@@$@
@!@ !@!$ @
!!!:!!!!:$@
:: : :$ @
@@
@@$ @
@@@@@$ @
!@@!!$ @
!@@!!$ @
!!:!$@
:.:.:$ @
:$ @@
@
@@ @@$@
@@!$@
@@!$ @
!!:$ @
:. ::$@
@@
@
@@@@@$ @
@@! @@@$ @
!@!@!$ @
!!: !!!$ @
:.: : .:$@
@@
@
@@@$@
!@$ @
$ @
$ @
$ @
@@
@@@$@
@@@$ @
@@@$ @
!@!$ @
!!!$ @
!:!$ @
: :$@@
@@@$ @
@@@$@
@@@$@
!@!$@
!!!$@
!:!$@
: :$ @@
@
@@@ @@@$ @
@@!!@@$ @
!!!@@!@!!!$@
!:::!!$ @
:.: .::$ @
@@
@
@@@$ @
@@@$ @
@!@!@!@!@$@
!!!$ @
: :$ @
@@
@
$ @
$ @
$ @
!:!$@
::$ @
:$ @@
@
$ @
$ @
@!@!@!@!$@
$ @
$ @
@@
@
$ @
$ @
$ @
!:!$@
:::$@
@@
@@@$@
@@@$ @
@@@$ @
!!@$ @
!!!$ @
:!:$ @
: :$ @@
@
@@@@@@$ @
@@! @@@$@
@!@ !@!$@
!!: !!!$@
: : ::$ @
@@
@
@@@$@
@@@@$@
!@!$@
!!!$@
::$ @
@@
@
@@@@@@$ @
@@ @@@$@
.!!@!$ @
!!:$ @
:.:: :::$@
@@
@
@@@@@@$ @
@@!$@
@!!!:$ @
!!:$@
::: ::$ @
@@
@
@@@ @@@$@
@@@ @@@$@
@!@!@!@!$@
!!!$@
: :$@
@@
@
@@@@@@@$@
!@@$ @
!!@@!!$ @
!:!$@
:: : :$ @
@@
@
@@@@@$ @
@@!@$ @
@!@!@!@$ @
!!: !!!$@
: : ::$ @
@@
@
@@@@@@@@$@
@@!$@
@!!$ @
.!!:$ @
: :$ @
@@
@
@@@@@@$ @
@@! @@@$@
!@!@!@$ @
!!: !!!$@
:.:: :$ @
@@
@
@@@@@@$ @
@@! @@@$@
@!@@!@!$@
!!:$@
: :::$ @
@@
@
@@@$@
@@!$@
$ @
!:!$@
:::$@
@@
@
@@@$@
@@!$@
$ @
!:!$@
::$ @
:$ @@
@@@$@
@@@$ @
@@!$ @
!@!$ @
!!!$ @
:!:$ @
: :$@@
@
$ @
@@@!@@@@$@
$ @
!!!:!!!!$@
$ @
@@
@@@$ @
@@@$ @
@@!$ @
!@!$@
!!!$ @
:!:$ @
: :$ @@
@
@@@@@@$ @
@@! @@@$@
.!@!$ @
""$ @
::$ @
@@
@
@@@@@@@$ @
!@@ !@@$@
!@! @!@!@$@
:!!$ @
:: :: :$ @
@@
@
@@@@@@$ @
@@! @@@$@
@!@!@!@!$@
!!: !!!$@
: : :$@
@@
@
@@@@@@@$ @
@@! @@@$@
@!@!@!@$ @
!!: !!!$@
:: : ::$ @
@@
@
@@@@@@@$@
!@@$ @
!@!$ @
:!!$ @
:: :: :$@
@@
@
@@@@@@@$ @
@@! @@@$@
@!@ !@!$@
!!: !!!$@
:: : :$ @
@@
@
@@@@@@@@$@
@@!$ @
@!!!:!$ @
!!:$ @
: :: ::$ @
@@
@
@@@@@@@@$@
@@!$ @
@!!!:!$ @
!!:$ @
:$ @
@@
@
@@@@@@@$ @
!@@$ @
!@! @!@!@$@
:!! !!:$@
:: :: :$ @
@@
@
@@@ @@@$@
@@! @@@$@
@!@!@!@!$@
!!: !!!$@
: : :$@
@@
@
@@@$@
@@!$@
!!@$@
!!:$@
:$ @
@@
@
@@@$@
@@!$@
!!@$@
. .!!$ @
::.::$ @
@@
@
@@@ @@@$@
@@! !@@$@
@!@@!@!$ @
!!: :!!$ @
: :::$@
@@
@
@@@$ @
@@!$ @
@!!$ @
!!:$ @
: ::.: :$@
@@
@
@@@@@@@@@@$ @
@@! @@! @@!$@
@!! !!@ @!@$@
!!: !!:$@
: :$ @
@@
@
@@@ @@@$@
@@!@!@@@$@
@!@@!!@!$@
!!: !!!$@
:: :$ @
@@
@
@@@@@@$ @
@@! @@@$@
@!@ !@!$@
!!: !!!$@
: :. :$ @
@@
@
@@@@@@@$ @
@@! @@@$@
@!@@!@!$ @
!!:$ @
:$ @
@@
@
@@@@@@$ @
@@! @@@$ @
@!@ !@!$ @
!!:!!:!:$ @
: :. :::$@
@@
@
@@@@@@@$ @
@@! @@@$@
@!@!!@!$ @
!!: :!!$ @
: : :$@
@@
@
@@@@@@$@
!@@$ @
!@@!!$ @
!:!$@
::.: :$ @
@@
@
@@@@@@@$@
@!!$ @
@!!$ @
!!:$ @
:$ @
@@
@
@@@ @@@$@
@@! @@@$@
@!@ !@!$@
!!: !!!$@
:.:: :$ @
@@
@
@@@ @@@$@
@@! @@@$@
@!@ !@!$@
!: .:!$ @
::$ @
@@
@
@@@ @@@ @@@$@
@@! @@! @@!$@
@!! !!@ @!@$@
!: !!: !!$ @
::.: :::$ @
@@
@
@@@ @@@$@
@@! !@@$@
!@@!@!$ @
!: :!!$ @
::: :::$@
@@
@
@@@ @@@$@
@@! !@@$@
!@!@!$ @
!!:$ @
.:$ @
@@
@
@@@@@@@@$@
@@!$@
@!!$ @
!!:$ @
:.::.: :$@
@@
@@@@@$@
@@@$ @
@@!$ @
!!@$ @
!!!$ @
:!:$ @
: :.:$@@
@@@$ @
@@@$ @
@@!$ @
!!@$ @
!!!$ @
:!:$ @
: :$@@
@@@@@$@
@@@$@
@@!$@
!!@$@
!!!$@
:!:$@
:.: :$@@
@
@@@@$ @
@!@ !@@$@
$ @
$ @
$ @
@@
@
$ @
$ @
$ @
$ @
.......$ @
: :: : :$@@
@
@@@$@
!@$@
$ @
$ @
$ @
@@
@
@@@@@@$ @
@@! @@@$@
@!@!@!@!$@
!!: !!!$@
: : :$@
@@
@
@@@@@@@$ @
@@! @@@$@
@!@!@!@$ @
!!: !!!$@
:: : ::$ @
@@
@
@@@@@@@$@
!@@$ @
!@!$ @
:!!$ @
:: :: :$@
@@
@
@@@@@@@$ @
@@! @@@$@
@!@ !@!$@
!!: !!!$@
:: : :$ @
@@
@
@@@@@@@@$@
@@!$ @
@!!!:!$ @
!!:$ @
: :: ::$ @
@@
@
@@@@@@@@$@
@@!$ @
@!!!:!$ @
!!:$ @
:$ @
@@
@
@@@@@@@$ @
!@@$ @
!@! @!@!@$@
:!! !!:$@
:: :: :$ @
@@
@
@@@ @@@$@
@@! @@@$@
@!@!@!@!$@
!!: !!!$@
: : :$@
@@
@
@@@$@
@@!$@
!!@$@
!!:$@
:$ @
@@
@
@@@$@
@@!$@
!!@$@
. .!!$ @
::.::$ @
@@
@
@@@ @@@$@
@@! !@@$@
@!@@!@!$ @
!!: :!!$ @
: :::$@
@@
@
@@@$ @
@@!$ @
@!!$ @
!!:$ @
: ::.: :$@
@@
@
@@@@@@@@@@$ @
@@! @@! @@!$@
@!! !!@ @!@$@
!!: !!:$@
: :$ @
@@
@
@@@ @@@$@
@@!@!@@@$@
@!@@!!@!$@
!!: !!!$@
:: :$ @
@@
@
@@@@@@$ @
@@! @@@$@
@!@ !@!$@
!!: !!!$@
: :. :$ @
@@
@
@@@@@@@$ @
@@! @@@$@
@!@@!@!$ @
!!:$ @
:$ @
@@
@
@@@@@@$ @
@@! @@@$ @
@!@ !@!$ @
!!:!!:!:$ @
: :. :::$@
@@
@
@@@@@@@$ @
@@! @@@$@
@!@!!@!$ @
!!: :!!$ @
: : :$@
@@
@
@@@@@@$@
!@@$ @
!@@!!$ @
!:!$@
::.: :$ @
@@
@
@@@@@@@$@
@!!$ @
@!!$ @
!!:$ @
:$ @
@@
@
@@@ @@@$@
@@! @@@$@
@!@ !@!$@
!!: !!!$@
:.:: :$ @
@@
@
@@@ @@@$@
@@! @@@$@
@!@ !@!$@
!: .:!$ @
::$ @
@@
@
@@@ @@@ @@@$@
@@! @@! @@!$@
@!! !!@ @!@$@
!: !!: !!$ @
::.: :::$ @
@@
@
@@@ @@@$@
@@! !@@$@
!@@!@!$ @
!: :!!$ @
::: :::$@
@@
@
@@@ @@@$@
@@! !@@$@
!@!@!$ @
!!:$ @
.:$ @
@@
@
@@@@@@@@$@
@@!$@
@!!$ @
!!:$ @
:.::.: :$@
@@
@@@$@
@@@$ @
@@!$ @
!!@$ @
!!!$ @
:!:$ @
: :$@@
@@@$@
@@@$@
@@!$@
$ @
!!!$@
:!:$@
: :$@@
@@@$ @
@@@$ @
@@!$ @
!!@$@
!!!$ @
:!:$ @
: :$ @@
@
@@@ @@$@
@@ @@@$ @
$ @
$ @
$ @
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,41 @@
import { createMockInstance } from '@vitest/spy';
import { M as ModuleMocker, r as rpc, c as createCompilerHints, h as hot } from './chunk-mocker.js';
import './index.js';
import './chunk-registry.js';
import './chunk-pathe.M-eThtNZ.js';
function registerModuleMocker(interceptor) {
const mocker = new ModuleMocker(interceptor(__VITEST_GLOBAL_THIS_ACCESSOR__), {
resolveId(id, importer) {
return rpc("vitest:mocks:resolveId", {
id,
importer
});
},
resolveMock(id, importer, options) {
return rpc("vitest:mocks:resolveMock", {
id,
importer,
options
});
},
async invalidate(ids) {
return rpc("vitest:mocks:invalidate", { ids });
}
}, createMockInstance, { root: __VITEST_MOCKER_ROOT__ });
globalThis[__VITEST_GLOBAL_THIS_ACCESSOR__] = mocker;
registerNativeFactoryResolver(mocker);
return createCompilerHints({ globalThisKey: __VITEST_GLOBAL_THIS_ACCESSOR__ });
}
function registerNativeFactoryResolver(mocker) {
hot.on("vitest:interceptor:resolve", async (url) => {
const exports$1 = await mocker.resolveFactoryModule(url);
const keys = Object.keys(exports$1);
hot.send("vitest:interceptor:resolved", {
url,
keys
});
});
}
export { registerModuleMocker, registerNativeFactoryResolver };
@@ -0,0 +1,18 @@
/**
* Removes `key` and its value from the stack.
*
* @private
* @name delete
* @memberOf Stack
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function stackDelete(key) {
var data = this.__data__,
result = data['delete'](key);
this.size = data.size;
return result;
}
module.exports = stackDelete;
@@ -0,0 +1,106 @@
{
"name": "define-data-property",
"version": "1.1.4",
"description": "Define a data property on an object. Will fall back to assignment in an engine without descriptors.",
"main": "index.js",
"types": "./index.d.ts",
"exports": {
".": "./index.js",
"./package.json": "./package.json"
},
"sideEffects": false,
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"tsc": "tsc -p .",
"prelint": "evalmd README.md",
"lint": "eslint --ext=js,mjs .",
"postlint": "npm run tsc",
"pretest": "npm run lint",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only",
"posttest": "aud --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/ljharb/define-data-property.git"
},
"keywords": [
"define",
"data",
"property",
"object",
"accessor",
"javascript",
"ecmascript",
"enumerable",
"configurable",
"writable"
],
"author": "Jordan Harband <ljharb@gmail.com>",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/ljharb/define-data-property/issues"
},
"homepage": "https://github.com/ljharb/define-data-property#readme",
"dependencies": {
"es-define-property": "^1.0.0",
"es-errors": "^1.3.0",
"gopd": "^1.0.1"
},
"devDependencies": {
"@ljharb/eslint-config": "^21.1.0",
"@types/call-bind": "^1.0.5",
"@types/define-properties": "^1.1.5",
"@types/es-value-fixtures": "^1.4.4",
"@types/for-each": "^0.3.3",
"@types/get-intrinsic": "^1.2.2",
"@types/gopd": "^1.0.3",
"@types/has-property-descriptors": "^1.0.3",
"@types/object-inspect": "^1.8.4",
"@types/object.getownpropertydescriptors": "^2.1.4",
"@types/tape": "^5.6.4",
"aud": "^2.0.4",
"auto-changelog": "^2.4.0",
"es-value-fixtures": "^1.4.2",
"eslint": "=8.8.0",
"evalmd": "^0.0.19",
"for-each": "^0.3.3",
"hasown": "^2.0.1",
"in-publish": "^2.0.1",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"object-inspect": "^1.13.1",
"object.getownpropertydescriptors": "^2.1.7",
"reflect.ownkeys": "^1.1.4",
"safe-publish-latest": "^2.0.0",
"tape": "^5.7.4",
"typescript": "next"
},
"engines": {
"node": ">= 0.4"
},
"testling": {
"files": "test/index.js"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows",
"types/reflect.ownkeys"
]
}
}
@@ -0,0 +1,64 @@
import { Collection, Key, Node, CollectionStateBase, LayoutDelegate, SingleSelection } from "@react-types/shared";
import { MultipleSelectionStateProps, SelectionManager } from "@react-stately/selection";
export class ListCollection<T> implements Collection<Node<T>> {
constructor(nodes: Iterable<Node<T>>);
[Symbol.iterator](): IterableIterator<Node<T>>;
get size(): number;
getKeys(): IterableIterator<Key>;
getKeyBefore(key: Key): Key | null;
getKeyAfter(key: Key): Key | null;
getFirstKey(): Key | null;
getLastKey(): Key | null;
getItem(key: Key): Node<T> | null;
at(idx: number): Node<T> | null;
getChildren(key: Key): Iterable<Node<T>>;
}
export interface ListProps<T> extends CollectionStateBase<T>, MultipleSelectionStateProps {
/** Filter function to generate a filtered list of nodes. */
filter?: (nodes: Iterable<Node<T>>) => Iterable<Node<T>>;
/** @private */
suppressTextValueWarning?: boolean;
/**
* A delegate object that provides layout information for items in the collection.
* This can be used to override the behavior of shift selection.
*/
layoutDelegate?: LayoutDelegate;
}
export interface ListState<T> {
/** A collection of items in the list. */
collection: Collection<Node<T>>;
/** A set of items that are disabled. */
disabledKeys: Set<Key>;
/** A selection manager to read and update multiple selection state. */
selectionManager: SelectionManager;
}
/**
* Provides state management for list-like components. Handles building a collection
* of items from props, and manages multiple selection state.
*/
export function useListState<T extends object>(props: ListProps<T>): ListState<T>;
/**
* Filters a collection using the provided filter function and returns a new ListState.
*/
export function UNSTABLE_useFilteredListState<T extends object>(state: ListState<T>, filterFn: ((nodeValue: string, node: Node<T>) => boolean) | null | undefined): ListState<T>;
export interface SingleSelectListProps<T> extends CollectionStateBase<T>, Omit<SingleSelection, 'disallowEmptySelection'> {
/** Filter function to generate a filtered list of nodes. */
filter?: (nodes: Iterable<Node<T>>) => Iterable<Node<T>>;
/** @private */
suppressTextValueWarning?: boolean;
}
export interface SingleSelectListState<T> extends ListState<T> {
/** The key for the currently selected item. */
readonly selectedKey: Key | null;
/** Sets the selected key. */
setSelectedKey(key: Key | null): void;
/** The value of the currently selected item. */
readonly selectedItem: Node<T> | null;
}
/**
* Provides state management for list-like components with single selection.
* Handles building a collection of items from props, and manages selection state.
*/
export function useSingleSelectListState<T extends object>(props: SingleSelectListProps<T>): SingleSelectListState<T>;
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,18 @@
module.exports = function walk(nodes, cb, bubble) {
var i, max, node, result
for (i = 0, max = nodes.length; i < max; i += 1) {
node = nodes[i]
if (!bubble) {
result = cb(node, i, nodes)
}
if (result !== false && node.type === 'function' && Array.isArray(node.nodes)) {
walk(node.nodes, cb, bubble)
}
if (bubble) {
cb(node, i, nodes)
}
}
}
@@ -0,0 +1,420 @@
flf2a$ 4 3 11 1 11 0 16769 0
Author :
Date : 2008/8/28 1:12:58
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
$ $#
$ $#
$ $#
$ $##
!#
$#
$#
$##
"#
$#
$#
$##
##
$#
$#
$##
$#
$#
$#
$##
%#
$#
$#
$##
&#
$#
$#
$##
'#
$#
$#
$##
(#
$#
$#
$##
)#
$#
$#
$##
*#
$#
$#
$##
+#
$#
$#
$##
,#
$#
$#
$##
-#
$#
$#
$##
.#
$#
$#
$##
/#
$#
$#
$##
0#
$#
$#
$##
1#
$#
$#
$##
2#
$#
$#
$##
3#
$#
$#
$##
4#
$#
$#
$##
5#
$#
$#
$##
6#
$#
$#
$##
7#
$#
$#
$##
8#
$#
$#
$##
9#
$#
$#
$##
:#
$#
$#
$##
;#
$#
$#
$##
<#
$#
$#
$##
=#
$#
$#
$##
>#
$#
$#
$##
?#
$#
$#
$##
@#
$#
$#
$##
___, $#
(-|_\_,#
_| )$#
( $##
___,$#
(-|_)$#
_|__)#
( $##
____ $#
(-/ `$#
\___,#
$##
____,#
(-| \#
_|__/#
( $##
____,#
(-|_,$#
_|__,#
( $##
____,#
(-|_,$#
_| $#
( $##
____ $#
(-/ `_,#
\___)$#
$##
__ _,#
(-|__| $#
_| |_,#
( $##
____,#
(-| $#
_|__,#
( $##
____,#
(-| $#
_ | $#
(__/ $##
__ _,#
(-|_/ $#
_| \_,#
( $##
__ $#
(-| $#
_|__,#
( $##
_____, $#
(-| | | $#
_| | |_,#
( $##
____, $#
(-| | $#
_| |_,#
( $##
____,#
(-/ \#
\__/#
$##
___,#
(-|_)#
_| $#
( $##
____, $#
(-/ \ $#
\__\_,#
$##
___, $#
(-|_) $#
_| \_,#
( $##
____$#
(-(__`#
____)#
( $##
____,#
(-| $#
_| $#
( $##
__ _,#
(-| | $#
|__|_,#
$##
__ _,#
(-\ | $#
\| $#
$##
__ _,#
(-| | | $#
_|_|_| $#
( $##
_ __,#
(-\_/ $#
_/ \_,$#
( $##
__ _,#
(-\ | $#
\| $#
(__/ $##
___,$#
(- / $#
,/__,#
$##
[#
$#
$#
$##
\#
$#
$#
$##
]#
$#
$#
$##
^#
$#
$#
$##
_#
$#
$#
$##
`#
$#
$#
$##
___, $#
(-|_\_,#
_| )$#
( $##
___,$#
(-|_)$#
_|__)#
( $##
____ $#
(-/ `$#
\___,#
$##
____,#
(-| \#
_|__/#
( $##
____,#
(-|_,$#
_|__,#
( $##
____,#
(-|_,$#
_| $#
( $##
____ $#
(-/ `_,#
\___)$#
$##
__ _,#
(-|__| $#
_| |_,#
( $##
____,#
(-| $#
_|__,#
( $##
____,#
(-| $#
_ | $#
(__/ $##
__ _,#
(-|_/ $#
_| \_,#
( $##
__ $#
(-| $#
_|__,#
( $##
_____, $#
(-| | | $#
_| | |_,#
( $##
____, $#
(-| | $#
_| |_,#
( $##
____,#
(-/ \#
\__/#
$##
___,#
(-|_)#
_| $#
( $##
____, $#
(-/ \ $#
\__\_,#
$##
___, $#
(-|_) $#
_| \_,#
( $##
____$#
(-(__`#
____)#
( $##
____,#
(-| $#
_| $#
( $##
__ _,#
(-| | $#
|__|_,#
$##
__ _,#
(-\ | $#
\| $#
$##
__ _,#
(-| | | $#
_|_|_| $#
( $##
_ __,#
(-\_/ $#
_/ \_,$#
( $##
__ _,#
(-\ | $#
\| $#
(__/ $##
___,$#
(- / $#
,/__,#
$##
{#
$#
$#
$##
|#
$#
$#
$##
}#
$#
$#
$##
~#
$#
$#
$##
___, $#
(-|_\_,$#
_| ) $#
( $##
____,$#
(-/ \$#
\__/$#
$##
__ _,$#
(-| | $#
|__|_,$#
$##
___, $#
(-|_\_,$#
_| ) $#
( $##
____,$#
(-/ \$#
\__/$#
$##
__ _,$#
(-| | $#
|__|_,$#
$##
ß#
$#
$#
$##
@@ -0,0 +1,26 @@
'use strict';
var supportsDescriptors = require('define-properties').supportsDescriptors;
var getPolyfill = require('./polyfill');
var gOPD = require('gopd');
var defineProperty = Object.defineProperty;
var $TypeError = require('es-errors');
var getProto = require('get-proto');
var regex = /a/;
module.exports = function shimFlags() {
if (!supportsDescriptors || !getProto) {
throw new $TypeError('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
}
var polyfill = getPolyfill();
var proto = getProto(regex);
var descriptor = gOPD(proto, 'flags');
if (!descriptor || descriptor.get !== polyfill) {
defineProperty(proto, 'flags', {
configurable: true,
enumerable: false,
get: polyfill
});
}
return polyfill;
};
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,eAAe,CAAC,QAAQ,CAAC;AAC7C","sources":["packages/@react-aria/breadcrumbs/intl/sl-SI.json"],"sourcesContent":["{\n \"breadcrumbs\": \"Drobtine\"\n}\n"],"names":[],"version":3,"file":"sl-SI.main.js.map"}
@@ -0,0 +1,6 @@
import {
DeleteDocumentBulkIcon
} from "../chunk-NXV7NGR3.mjs";
export {
DeleteDocumentBulkIcon
};
@@ -0,0 +1,24 @@
import type { TSchema } from '../schema/index';
import { type ZeroString, type UnionToTuple, type TIncrement } from '../helpers/index';
import type { TRecursive } from '../recursive/index';
import type { TIntersect } from '../intersect/index';
import type { TUnion } from '../union/index';
import type { TTuple } from '../tuple/index';
import type { TArray } from '../array/index';
import type { TObject, TProperties } from '../object/index';
import { type TSetUnionMany, type TSetIntersectMany } from '../sets/index';
type TFromRest<Types extends TSchema[], Result extends PropertyKey[][] = []> = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest<R, [...Result, TKeyOfPropertyKeys<L>]> : Result);
type TFromIntersect<Types extends TSchema[], PropertyKeysArray extends PropertyKey[][] = TFromRest<Types>, PropertyKeys extends PropertyKey[] = TSetUnionMany<PropertyKeysArray>> = PropertyKeys;
type TFromUnion<Types extends TSchema[], PropertyKeysArray extends PropertyKey[][] = TFromRest<Types>, PropertyKeys extends PropertyKey[] = TSetIntersectMany<PropertyKeysArray>> = PropertyKeys;
type TFromTuple<Types extends TSchema[], Indexer extends string = ZeroString, Acc extends PropertyKey[] = []> = Types extends [infer _ extends TSchema, ...infer R extends TSchema[]] ? TFromTuple<R, TIncrement<Indexer>, [...Acc, Indexer]> : Acc;
type TFromArray<_ extends TSchema> = ([
'[number]'
]);
type TFromProperties<Properties extends TProperties> = (UnionToTuple<keyof Properties>);
export type TKeyOfPropertyKeys<Type extends TSchema> = (Type extends TRecursive<infer Type extends TSchema> ? TKeyOfPropertyKeys<Type> : Type extends TIntersect<infer Types extends TSchema[]> ? TFromIntersect<Types> : Type extends TUnion<infer Types extends TSchema[]> ? TFromUnion<Types> : Type extends TTuple<infer Types extends TSchema[]> ? TFromTuple<Types> : Type extends TArray<infer Type extends TSchema> ? TFromArray<Type> : Type extends TObject<infer Properties extends TProperties> ? TFromProperties<Properties> : [
]);
/** Returns a tuple of PropertyKeys derived from the given TSchema. */
export declare function KeyOfPropertyKeys<Type extends TSchema>(type: Type): TKeyOfPropertyKeys<Type>;
/** Returns a regular expression pattern derived from the given TSchema */
export declare function KeyOfPattern(schema: TSchema): string;
export {};
@@ -0,0 +1,18 @@
{
"name": "@react-types/shared",
"version": "3.26.0",
"description": "Spectrum UI components in React",
"license": "Apache-2.0",
"types": "src/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/adobe/react-spectrum"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
},
"publishConfig": {
"access": "public"
},
"gitHead": "71f0ef23053f9e03ee7e97df736e8b083e006849"
}
@@ -0,0 +1,3 @@
import type { DependencyList } from 'react';
declare function depsAreSame(oldDeps: DependencyList, deps: DependencyList): boolean;
export default depsAreSame;
@@ -0,0 +1,50 @@
import { OneBotAction } from '../../action/OneBotAction';
import { NetworkAdapterConfig } from '../../config/config';
import { Static } from '@sinclair/typebox';
export declare const GetRecentContactPayloadSchema: import("@sinclair/typebox").TObject<{
count: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString]>;
}>;
export type GetRecentContactPayload = Static<typeof GetRecentContactPayloadSchema>;
export declare const GetRecentContactReturnSchema: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
lastestMsg: import("@sinclair/typebox").TAny;
peerUin: import("@sinclair/typebox").TString;
remark: import("@sinclair/typebox").TString;
msgTime: import("@sinclair/typebox").TString;
chatType: import("@sinclair/typebox").TNumber;
msgId: import("@sinclair/typebox").TString;
sendNickName: import("@sinclair/typebox").TString;
sendMemberName: import("@sinclair/typebox").TString;
peerName: import("@sinclair/typebox").TString;
}>>;
export type GetRecentContactReturn = Static<typeof GetRecentContactReturnSchema>;
export default class GetRecentContact extends OneBotAction<GetRecentContactPayload, GetRecentContactReturn> {
actionName: "get_recent_contact";
payloadSchema: import("@sinclair/typebox").TObject<{
count: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString]>;
}>;
returnSchema: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
lastestMsg: import("@sinclair/typebox").TAny;
peerUin: import("@sinclair/typebox").TString;
remark: import("@sinclair/typebox").TString;
msgTime: import("@sinclair/typebox").TString;
chatType: import("@sinclair/typebox").TNumber;
msgId: import("@sinclair/typebox").TString;
sendNickName: import("@sinclair/typebox").TString;
sendMemberName: import("@sinclair/typebox").TString;
peerName: import("@sinclair/typebox").TString;
}>>;
actionSummary: string;
actionDescription: string;
actionTags: string[];
payloadExample: {
count: number;
};
returnExample: {
peerUin: string;
peerName: string;
msgTime: string;
msgId: string;
lastestMsg: {};
}[];
_handle(payload: GetRecentContactPayload, _adapter: string, config: NetworkAdapterConfig): Promise<GetRecentContactReturn>;
}
@@ -0,0 +1,485 @@
// src/common/assertion.ts
var __DEV__ = process.env.NODE_ENV !== "production";
var __TEST__ = process.env.NODE_ENV === "test";
function isArray(value) {
return Array.isArray(value);
}
function isEmptyArray(value) {
return isArray(value) && value.length === 0;
}
function isObject(value) {
const type = typeof value;
return value != null && (type === "object" || type === "function") && !isArray(value);
}
function isEmptyObject(value) {
return isObject(value) && Object.keys(value).length === 0;
}
function isEmpty(value) {
if (isArray(value)) return isEmptyArray(value);
if (isObject(value)) return isEmptyObject(value);
if (value == null || value === "") return true;
return false;
}
function isFunction(value) {
return typeof value === "function";
}
var dataAttr = (condition) => condition ? "true" : void 0;
var isNumeric = (value) => value != null && parseInt(value.toString(), 10) > 0;
// src/common/clsx.ts
function toVal(mix) {
var k, y, str = "";
if (typeof mix === "string" || typeof mix === "number") {
str += mix;
} else if (typeof mix === "object") {
if (Array.isArray(mix)) {
for (k = 0; k < mix.length; k++) {
if (mix[k]) {
if (y = toVal(mix[k])) {
str && (str += " ");
str += y;
}
}
}
} else {
for (k in mix) {
if (mix[k]) {
str && (str += " ");
str += k;
}
}
}
}
return str;
}
function clsx(...args) {
var i = 0, tmp, x, str = "";
while (i < args.length) {
if (tmp = args[i++]) {
if (x = toVal(tmp)) {
str && (str += " ");
str += x;
}
}
}
return str;
}
// src/common/object.ts
var renameProp = (oldProp, newProp, { [oldProp]: old, ...others }) => ({
[newProp]: old,
...others
});
var copyObject = (obj) => {
if (!isObject(obj)) return obj;
if (obj instanceof Array) return [...obj];
return { ...obj };
};
var omitObject = (obj, omitKeys) => {
if (!isObject(obj)) return obj;
if (obj instanceof Array) return [...obj];
const newObj = { ...obj };
omitKeys.forEach((key) => newObj[key] && delete newObj[key]);
return newObj;
};
var cleanObject = (obj) => {
if (!isObject(obj)) return obj;
if (obj instanceof Array) return [...obj];
const newObj = { ...obj };
Object.keys(newObj).forEach((key) => {
if (newObj[key] === void 0 || newObj[key] === null) {
delete newObj[key];
}
});
return newObj;
};
var cleanObjectKeys = (obj, keys = []) => {
if (!isObject(obj)) return obj;
if (obj instanceof Array) return [...obj];
const newObj = { ...obj };
keys.forEach((key) => {
if (newObj[key]) {
delete newObj[key];
}
});
return newObj;
};
var getKeyValue = (obj, key) => {
if (!isObject(obj)) return obj;
if (obj instanceof Array) return [...obj];
return obj[key];
};
var getProp = (obj, path, fallback, index) => {
const key = typeof path === "string" ? path.split(".") : [path];
for (index = 0; index < key.length; index += 1) {
if (!obj) break;
obj = obj[key[index]];
}
return obj === void 0 ? fallback : obj;
};
var arrayToObject = (arr) => {
if (!arr.length || !Array.isArray(arr)) return {};
return arr.reduce((acc, item) => {
return { ...acc, ...item };
}, {});
};
function compact(object) {
const clone = Object.assign({}, object);
for (let key in clone) {
if (clone[key] === void 0) delete clone[key];
}
return clone;
}
// src/common/text.ts
var safeText = (text) => {
if ((text == null ? void 0 : text.length) <= 4) return text;
return text == null ? void 0 : text.slice(0, 3);
};
var safeInitials = (text) => {
const initials = (text == null ? void 0 : text.trim().split(/[\s\-_.]+/).filter(Boolean).map((word) => word.charAt(0).toUpperCase()).join("")) || "";
return safeText(initials);
};
var safeAriaLabel = (...texts) => {
let ariaLabel = " ";
for (const text of texts) {
if (typeof text === "string" && text.length > 0) {
ariaLabel = text;
break;
}
}
return ariaLabel;
};
// src/common/dimensions.ts
var getMargin = (num) => {
return `calc(${num * 15.25}pt + 1px * ${num - 1})`;
};
// src/common/functions.ts
var capitalize = (s) => {
return s ? s.charAt(0).toUpperCase() + s.slice(1).toLowerCase() : "";
};
function callAllHandlers(...fns) {
return function func(event) {
fns.some((fn) => {
fn == null ? void 0 : fn(event);
return event == null ? void 0 : event.defaultPrevented;
});
};
}
function callAll(...fns) {
return function mergedFn(arg) {
fns.forEach((fn) => {
fn == null ? void 0 : fn(arg);
});
};
}
function extractProperty(key, defaultValue, ...objs) {
let result = defaultValue;
for (const obj of objs) {
if (obj && key in obj && !!obj[key]) {
result = obj[key];
}
}
return result;
}
function getUniqueID(prefix) {
return `${prefix}-${Math.floor(Math.random() * 1e6)}`;
}
function removeEvents(input) {
for (const key in input) {
if (key.startsWith("on")) {
delete input[key];
}
}
return input;
}
function objectToDeps(obj) {
if (!obj || typeof obj !== "object") {
return "";
}
try {
return JSON.stringify(obj);
} catch {
return "";
}
}
function debounce(func, waitMilliseconds = 0) {
let timeout;
return function(...args) {
const later = () => {
timeout = void 0;
func.apply(this, args);
};
if (timeout !== void 0) {
clearTimeout(timeout);
}
timeout = setTimeout(later, waitMilliseconds);
};
}
function uniqBy(arr, iteratee) {
if (typeof iteratee === "string") {
iteratee = (item) => item[iteratee];
}
return arr.filter((x, i, self) => i === self.findIndex((y) => iteratee(x) === iteratee(y)));
}
var omit = (obj, keys) => {
const res = Object.assign({}, obj);
keys.forEach((key) => {
delete res[key];
});
return res;
};
var kebabCase = (s) => {
return s.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
};
var mapKeys = (obj, iteratee) => {
return Object.fromEntries(
Object.entries(obj).map(([key, value]) => [iteratee(value, key), value])
);
};
var get = (object, path, defaultValue) => {
const keys = Array.isArray(path) ? path : path.replace(/\[(\d+)\]/g, ".$1").split(".");
let res = object;
for (const key of keys) {
res = res == null ? void 0 : res[key];
if (res === void 0) {
return defaultValue;
}
}
return res;
};
var intersectionBy = (...args) => {
if (args.length < 2) {
throw new Error("intersectionBy requires at least two arrays and an iteratee");
}
const iteratee = args[args.length - 1];
const arrays = args.slice(0, -1);
if (arrays.length === 0) {
return [];
}
const getIterateeValue = (item) => {
if (typeof iteratee === "function") {
return iteratee(item);
} else if (typeof iteratee === "string") {
return item[iteratee];
} else {
throw new Error("Iteratee must be a function or a string key of the array elements");
}
};
const [first, ...rest] = arrays;
const transformedFirst = first.map((item) => getIterateeValue(item));
const transformedSets = rest.map(
(array) => new Set(array.map((item) => getIterateeValue(item)))
);
const res = [];
const seen = /* @__PURE__ */ new Set();
for (let i = 0; i < first.length; i++) {
const item = first[i];
const transformed = transformedFirst[i];
if (seen.has(transformed)) {
continue;
}
const existsInAll = transformedSets.every((set) => set.has(transformed));
if (existsInAll) {
res.push(item);
seen.add(transformed);
}
}
return res;
};
// src/common/numbers.ts
function range(start, end) {
const length = end - start + 1;
return Array.from({ length }, (_, index) => index + start);
}
function clamp(value, min, max) {
return Math.min(Math.max(value, min), max);
}
function clampPercentage(value, max = 100) {
return Math.min(Math.max(value, 0), max);
}
// src/common/console.ts
var warningStack = {};
function warn(message, component, ...args) {
const tag = component ? ` [${component}]` : " ";
const log = `[Hero UI]${tag}: ${message}`;
if (typeof console === "undefined") return;
if (warningStack[log]) return;
warningStack[log] = true;
if (process.env.NODE_ENV !== "production") {
return console.warn(log, args);
}
}
// src/common/dates.ts
function getGregorianYearOffset(identifier) {
switch (identifier) {
case "buddhist":
return 543;
case "ethiopic":
case "ethioaa":
return -8;
case "coptic":
return -284;
case "hebrew":
return 3760;
case "indian":
return -78;
case "islamic-civil":
case "islamic-tbla":
case "islamic-umalqura":
return -579;
case "persian":
return -600;
case "roc":
case "japanese":
case "gregory":
default:
return 0;
}
}
// src/common/regex.ts
var isPatternNumeric = (pattern) => {
const numericPattern = /(^|\W)[0-9](\W|$)/;
return numericPattern.test(pattern) && !/[^\d\^$\[\]\(\)\*\+\-\.\|]/.test(pattern);
};
// src/common/ra.ts
function chain(...callbacks) {
return (...args) => {
for (let callback of callbacks) {
if (typeof callback === "function") {
callback(...args);
}
}
};
}
var idsUpdaterMap = /* @__PURE__ */ new Map();
function mergeIds(idA, idB) {
if (idA === idB) {
return idA;
}
let setIdsA = idsUpdaterMap.get(idA);
if (setIdsA) {
setIdsA.forEach((ref) => ref.current = idB);
return idB;
}
let setIdsB = idsUpdaterMap.get(idB);
if (setIdsB) {
setIdsB.forEach((ref) => ref.current = idA);
return idA;
}
return idB;
}
function mergeProps(...args) {
let result = { ...args[0] };
for (let i = 1; i < args.length; i++) {
let props = args[i];
for (let key in props) {
let a = result[key];
let b = props[key];
if (typeof a === "function" && typeof b === "function" && // This is a lot faster than a regex.
key[0] === "o" && key[1] === "n" && key.charCodeAt(2) >= /* 'A' */
65 && key.charCodeAt(2) <= /* 'Z' */
90) {
result[key] = chain(a, b);
} else if ((key === "className" || key === "UNSAFE_className") && typeof a === "string" && typeof b === "string") {
result[key] = clsx(a, b);
} else if (key === "id" && a && b) {
result.id = mergeIds(a, b);
} else {
result[key] = b !== void 0 ? b : a;
}
}
}
return result;
}
function mergeRefs(...refs) {
if (refs.length === 1 && refs[0]) {
return refs[0];
}
return (value) => {
let hasCleanup = false;
const cleanups = refs.map((ref) => {
const cleanup = setRef(ref, value);
hasCleanup || (hasCleanup = typeof cleanup == "function");
return cleanup;
});
if (hasCleanup) {
return () => {
cleanups.forEach((cleanup, i) => {
if (typeof cleanup === "function") {
cleanup == null ? void 0 : cleanup();
} else {
setRef(refs[i], null);
}
});
};
}
};
}
function setRef(ref, value) {
if (typeof ref === "function") {
return () => ref(value);
} else if (ref != null) {
if ("current" in ref) {
ref.current = value;
}
}
}
export {
__DEV__,
__TEST__,
arrayToObject,
callAll,
callAllHandlers,
capitalize,
chain,
clamp,
clampPercentage,
cleanObject,
cleanObjectKeys,
clsx,
compact,
copyObject,
dataAttr,
debounce,
extractProperty,
get,
getGregorianYearOffset,
getKeyValue,
getMargin,
getProp,
getUniqueID,
idsUpdaterMap,
intersectionBy,
isArray,
isEmpty,
isEmptyArray,
isEmptyObject,
isFunction,
isNumeric,
isObject,
isPatternNumeric,
kebabCase,
mapKeys,
mergeIds,
mergeProps,
mergeRefs,
objectToDeps,
omit,
omitObject,
range,
removeEvents,
renameProp,
safeAriaLabel,
safeInitials,
safeText,
uniqBy,
warn
};
@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var docPrologueRole = {
abstract: false,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author'],
prohibitedProps: [],
props: {
'aria-disabled': null,
'aria-errormessage': null,
'aria-expanded': null,
'aria-haspopup': null,
'aria-invalid': null
},
relatedConcepts: [{
concept: {
name: 'prologue [EPUB-SSV]'
},
module: 'EPUB'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'structure', 'section', 'landmark']]
};
var _default = exports.default = docPrologueRole;
@@ -0,0 +1,732 @@
flf2a 7 5 10 -1 17
Alphabet by Wendell Hicken 11/93 (whicken@parasoft.com)
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)
12 - number of comment lines
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
 @
 @
 @
 @
 @
 @
 @@
!!! @
!!! @
!!! @
@
!!! @
@
@@
'' '' @
'' '' @
@
@
@
@
@@
# # @
##### @
# # @
##### @
# # @
@
@@
$ $ @
$$$$$ @
$ $ $ @
$$$$$ @
$ $ $ @
$$$$$ @
$ $ @@
% %% @
%% @
%% @
%% @
%% % @
@
@@
&& @
& & @
&&& &@
& & & @
&&&& @
@
@@
'' @
'' @
@
@
@
@
@@
(( @
(( @
(( @
(( @
(( @
@
@@
)) @
)) @
)) @
)) @
)) @
@
@@
@
* * * @
*** @
***** @
*** @
* * * @
@@
@
+ @
+++ @
+ @
@
@
@@
@
@
@
@
,, @
, @
@@
@
@
--- @
@
@
@
@@
@
@
@
.. @
.. @
@
@@
//@
// @
// @
// @
// @
@
@@
000 @
0 00 @
0 0 0 @
00 0 @
000 @
@
@@
11 @
111 @
11 @
11 @
11l1 @
@
@@
22 @
2 2 @
2 @
2 @
2222 @
@
@@
333 @
3 @
33 @
3 @
333 @
@
@@
4 4 @
4 4 @
4444 @
4 @
4 @
@
@@
5555 @
5 @
555 @
5 @
555 @
@
@@
6 @
6 @
6666 @
6 6 @
666 @
@
@@
77777 @
7 @
7 @
7 @
7 @
@
@@
888 @
8 8 @
888 @
8 8 @
888 @
@
@@
9999 @
9 9 @
9999 @
9 @
9 @
@
@@
@
:: @
@
:: @
@
@
@@
@
;; @
@
;; @
; @
@
@@
<< @
<< @
<< @
<< @
<< @
@
@@
@
=== @
@
=== @
@
@
@@
>> @
>> @
>> @
>> @
>> @
@
@@
??? @
? ? @
? @
? @
? @
@
@@
@@@ @
@ @ @
@ @@ @
@ @
@@@ @
@
@@
AA @
A A @
AAAA @
A A @
A A @
@
@@
BBBB @
B B @
BBBB @
B B @
BBBB @
@
@@
CCC @
C @
C @
C @
CCC @
@
@@
DDD @
D D @
D D @
D D @
DDD @
@
@@
EEEE @
E @
EEE @
E @
EEEE @
@
@@
FFFF @
F @
FFF @
F @
F @
@
@@
GGG @
G @
G GG @
G G @
GGG @
@
@@
H H @
H H @
HHHH @
H H @
H H @
@
@@
III @
I @
I @
I @
III @
@
@@
J @
J @
J @
J J @
JJJ @
@
@@
K K @
K K @
KK @
K K @
K K @
@
@@
L @
L @
L @
L @
LLLL @
@
@@
M M @
MM MM @
M M M @
M M @
M M @
@
@@
N N @
NN N @
N N N @
N NN @
N N @
@
@@
OOO @
O O @
O O @
O O @
OOO @
@
@@
PPPP @
P P @
PPPP @
P @
P @
@
@@
QQQ @
Q Q @
Q Q @
Q QQ @
QQQQ @
Q @
@@
RRRR @
R R @
RRRR @
R R @
R RR @
@
@@
SSS @
S @
SSS @
S @
SSSS @
@
@@
TTTTTT @
TT @
TT @
TT @
TT @
@
@@
U U @
U U @
U U @
U U @
UUU @
@
@@
V V @
V V @
V V @
V V @
V @
@
@@
W W @
W W @
W W W @
W W W @
W W @
@
@@
X X @
X X @
X @
X X @
X X @
@
@@
Y Y @
Y Y @
Y @
Y @
Y @
@
@@
ZZZZZ @
Z @
Z @
Z @
ZZZZZ @
@
@@
[[[[ @
[[ @
[[ @
[[ @
[[[[ @
@
@@
\\ @
\\ @
\\ @
\\ @
\\@
@
@@
]]]] @
]] @
]] @
]] @
]]]] @
@
@@
^^ @
^ ^ @
@
@
@
@
@@
@
@
@
@
____@
____@
@@
`` @
@
@
@
@
@
@@
@
@
aa @
a a @
aaa @
@
@@
b @
b @
bbb @
b b @
bbb @
@
@@
@
@
ccc @
c @
ccc @
@
@@
d @
d @
ddd @
d d @
ddd @
@
@@
@
@
eee @
e e @
ee @
@
@@
ff @
f @
fff @
f @
f @
@
@@
@
@
ggg @
g g @
ggg @
g @
ggg @@
h @
h @
hhh @
h h @
h h @
@
@@
@
ii @
@
ii @
ii @
@
@@
@
j @
@
j @
j @
j j @
jj @@
k @
k k @
kk @
k k @
k k @
@
@@
l @
l @
l @
l @
l @
@
@@
@
@
mmmm @
m m m @
m m m @
@
@@
@
@
nnn @
n n @
n n @
@
@@
@
@
ooo @
o o @
ooo @
@
@@
@
@
ppp @
p p @
ppp @
p @
p @@
@
@
qqq @
q q @
qqq @
q @
qq @@
@
@
rrr @
r @
r @
@
@@
@
@
ss @
s @
ss @
@
@@
t @
t @
ttt @
t @
tt @
@
@@
@
@
u u @
u u @
uuu @
@
@@
@
@
v v @
v v @
v @
@
@@
@
@
w w @
w w w @
w w @
@
@@
@
@
x x @
x @
x x @
@
@@
@
@
y y @
y y @
yyy @
y @
yyy @@
@
@
zz @
z @
zz @
@
@@
{{ @
{{ @
{{ @
{{ @
{{ @
@
@@
||@
||@
||@
||@
||@
||@
@@
}} @
}} @
}} @
}} @
}} @
@
@@
@
~ ~ @
~ ~ @
@
@
@
@@
o o @
AA @
A A @
AAAA @
A A @
@
@@
o o @
OOO @
O O @
O O @
OOO @
@
@@
o o @
U U @
U U @
U U @
UUU @
@
@@
o o @
@
aa @
a a @
aaa @
@
@@
o o @
@
ooo @
o o @
ooo @
@
@@
o o @
@
u u @
u u @
uuu @
@
@@
BBBB @
B B @
BBBB @
B B @
BBBB @
B @
@@
@@ -0,0 +1,38 @@
"use client";
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/navbar-context.ts
var navbar_context_exports = {};
__export(navbar_context_exports, {
NavbarProvider: () => NavbarProvider,
useNavbarContext: () => useNavbarContext
});
module.exports = __toCommonJS(navbar_context_exports);
var import_react_utils = require("@heroui/react-utils");
var [NavbarProvider, useNavbarContext] = (0, import_react_utils.createContext)({
name: "NavbarContext",
strict: true,
errorMessage: "useNavbarContext: `context` is undefined. Seems you forgot to wrap component within <Navbar />"
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
NavbarProvider,
useNavbarContext
});
@@ -0,0 +1,24 @@
import baseSortedIndex from './_baseSortedIndex.js';
/**
* Uses a binary search to determine the lowest index at which `value`
* should be inserted into `array` in order to maintain its sort order.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* _.sortedIndex([30, 50], 40);
* // => 1
*/
function sortedIndex(array, value) {
return baseSortedIndex(array, value);
}
export default sortedIndex;
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"E F A B","4":"wC","132":"K D"},B:{"1":"0 1 2 3 4 5 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC 0C 1C","36":"xC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC"},E:{"1":"J ZB K D E F A B C L M G 2C ZC 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED"},F:{"1":"0 1 2 3 4 5 6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z FD GD HD ID NC uC JD OC"},G:{"1":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"1":"hD"},I:{"1":"TC J I iD jD kD lD vC mD nD"},J:{"1":"D A"},K:{"1":"A B C H NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"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:2,C:"CSS inline-block",D:true};
@@ -0,0 +1,41 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("eslint-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Map` class.",
category: "ES2015",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-map.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' class is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"() {
const tracker = new ReferenceTracker(context.getScope())
for (const { node, path } of tracker.iterateGlobalReferences({
Map: { [READ]: true },
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1,116 @@
/*
* 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 {DOMAttributes, Key, KeyboardDelegate} from '@react-types/shared';
import {KeyboardEvent, useRef} from 'react';
import {MultipleSelectionManager} from '@react-stately/selection';
/**
* Controls how long to wait before clearing the typeahead buffer.
*/
const TYPEAHEAD_DEBOUNCE_WAIT_MS = 1000; // 1 second
export interface AriaTypeSelectOptions {
/**
* A delegate that returns collection item keys with respect to visual layout.
*/
keyboardDelegate: KeyboardDelegate,
/**
* An interface for reading and updating multiple selection state.
*/
selectionManager: MultipleSelectionManager,
/**
* Called when an item is focused by typing.
*/
onTypeSelect?: (key: Key) => void
}
export interface TypeSelectAria {
/**
* Props to be spread on the owner of the options.
*/
typeSelectProps: DOMAttributes
}
/**
* Handles typeahead interactions with collections.
*/
export function useTypeSelect(options: AriaTypeSelectOptions): TypeSelectAria {
let {keyboardDelegate, selectionManager, onTypeSelect} = options;
let state = useRef<{search: string, timeout: ReturnType<typeof setTimeout> | undefined}>({
search: '',
timeout: undefined
}).current;
let onKeyDown = (e: KeyboardEvent) => {
let character = getStringForKey(e.key);
if (!character || e.ctrlKey || e.metaKey || !e.currentTarget.contains(e.target as HTMLElement) || (state.search.length === 0 && character === ' ')) {
return;
}
// Do not propagate the Spacebar event if it's meant to be part of the search.
// When we time out, the search term becomes empty, hence the check on length.
// Trimming is to account for the case of pressing the Spacebar more than once,
// which should cycle through the selection/deselection of the focused item.
if (character === ' ' && state.search.trim().length > 0) {
e.preventDefault();
if (!('continuePropagation' in e)) {
e.stopPropagation();
}
}
state.search += character;
if (keyboardDelegate.getKeyForSearch != null) {
// Use the delegate to find a key to focus.
// Prioritize items after the currently focused item, falling back to searching the whole list.
let key = keyboardDelegate.getKeyForSearch(state.search, selectionManager.focusedKey);
// If no key found, search from the top.
if (key == null) {
key = keyboardDelegate.getKeyForSearch(state.search);
}
if (key != null) {
selectionManager.setFocusedKey(key);
if (onTypeSelect) {
onTypeSelect(key);
}
}
}
clearTimeout(state.timeout);
state.timeout = setTimeout(() => {
state.search = '';
}, TYPEAHEAD_DEBOUNCE_WAIT_MS);
};
return {
typeSelectProps: {
// Using a capturing listener to catch the keydown event before
// other hooks in order to handle the Spacebar event.
onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown : undefined
}
};
}
function getStringForKey(key: string) {
// If the key is of length 1, it is an ASCII value.
// Otherwise, if there are no ASCII characters in the key name,
// it is a Unicode character.
// See https://www.w3.org/TR/uievents-key/
if (key.length === 1 || !/^[A-Z]/i.test(key)) {
return key;
}
return '';
}
@@ -0,0 +1,57 @@
'use strict';
/**
* Applies the JSON.parse reviver algorithm as defined in the ECMA-262 spec,
* in section 24.5.1.1 "Runtime Semantics: InternalizeJSONProperty" of the
* 2021 edition: https://tc39.es/ecma262/#sec-json.parse
*
* Includes extensions for handling Map and Set objects.
*/
function applyReviver(reviver, obj, key, val) {
if (val && typeof val === 'object') {
if (Array.isArray(val)) {
for (let i = 0, len = val.length; i < len; ++i) {
const v0 = val[i];
const v1 = applyReviver(reviver, val, String(i), v0);
// eslint-disable-next-line @typescript-eslint/no-array-delete
if (v1 === undefined)
delete val[i];
else if (v1 !== v0)
val[i] = v1;
}
}
else if (val instanceof Map) {
for (const k of Array.from(val.keys())) {
const v0 = val.get(k);
const v1 = applyReviver(reviver, val, k, v0);
if (v1 === undefined)
val.delete(k);
else if (v1 !== v0)
val.set(k, v1);
}
}
else if (val instanceof Set) {
for (const v0 of Array.from(val)) {
const v1 = applyReviver(reviver, val, v0, v0);
if (v1 === undefined)
val.delete(v0);
else if (v1 !== v0) {
val.delete(v0);
val.add(v1);
}
}
}
else {
for (const [k, v0] of Object.entries(val)) {
const v1 = applyReviver(reviver, val, k, v0);
if (v1 === undefined)
delete val[k];
else if (v1 !== v0)
val[k] = v1;
}
}
}
return reviver.call(obj, key, val);
}
exports.applyReviver = applyReviver;
@@ -0,0 +1,191 @@
var _typeof = require("./typeof.js")["default"];
var setFunctionName = require("./setFunctionName.js");
var toPropertyKey = require("./toPropertyKey.js");
function applyDecs2203RFactory() {
function createAddInitializerMethod(e, t) {
return function (r) {
!function (e) {
if (e.v) throw Error("attempted to call addInitializer after decoration was finished");
}(t), assertCallable(r, "An initializer"), e.push(r);
};
}
function memberDec(e, t, r, n, a, i, o, s) {
var c;
switch (a) {
case 1:
c = "accessor";
break;
case 2:
c = "method";
break;
case 3:
c = "getter";
break;
case 4:
c = "setter";
break;
default:
c = "field";
}
var l,
u,
f = {
kind: c,
name: o ? "#" + t : toPropertyKey(t),
"static": i,
"private": o
},
p = {
v: !1
};
0 !== a && (f.addInitializer = createAddInitializerMethod(n, p)), 0 === a ? o ? (l = r.get, u = r.set) : (l = function l() {
return this[t];
}, u = function u(e) {
this[t] = e;
}) : 2 === a ? l = function l() {
return r.value;
} : (1 !== a && 3 !== a || (l = function l() {
return r.get.call(this);
}), 1 !== a && 4 !== a || (u = function u(e) {
r.set.call(this, e);
})), f.access = l && u ? {
get: l,
set: u
} : l ? {
get: l
} : {
set: u
};
try {
return e(s, f);
} finally {
p.v = !0;
}
}
function assertCallable(e, t) {
if ("function" != typeof e) throw new TypeError(t + " must be a function");
}
function assertValidReturnValue(e, t) {
var r = _typeof(t);
if (1 === e) {
if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
void 0 !== t.get && assertCallable(t.get, "accessor.get"), void 0 !== t.set && assertCallable(t.set, "accessor.set"), void 0 !== t.init && assertCallable(t.init, "accessor.init");
} else if ("function" !== r) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0");
}
function applyMemberDec(e, t, r, n, a, i, o, s) {
var c,
l,
u,
f,
p,
d,
h,
v = r[0];
if (o ? (0 === a || 1 === a ? (c = {
get: r[3],
set: r[4]
}, u = "get") : 3 === a ? (c = {
get: r[3]
}, u = "get") : 4 === a ? (c = {
set: r[3]
}, u = "set") : c = {
value: r[3]
}, 0 !== a && (1 === a && setFunctionName(r[4], "#" + n, "set"), setFunctionName(r[3], "#" + n, u))) : 0 !== a && (c = Object.getOwnPropertyDescriptor(t, n)), 1 === a ? f = {
get: c.get,
set: c.set
} : 2 === a ? f = c.value : 3 === a ? f = c.get : 4 === a && (f = c.set), "function" == typeof v) void 0 !== (p = memberDec(v, n, c, s, a, i, o, f)) && (assertValidReturnValue(a, p), 0 === a ? l = p : 1 === a ? (l = p.init, d = p.get || f.get, h = p.set || f.set, f = {
get: d,
set: h
}) : f = p);else for (var g = v.length - 1; g >= 0; g--) {
var y;
void 0 !== (p = memberDec(v[g], n, c, s, a, i, o, f)) && (assertValidReturnValue(a, p), 0 === a ? y = p : 1 === a ? (y = p.init, d = p.get || f.get, h = p.set || f.set, f = {
get: d,
set: h
}) : f = p, void 0 !== y && (void 0 === l ? l = y : "function" == typeof l ? l = [l, y] : l.push(y)));
}
if (0 === a || 1 === a) {
if (void 0 === l) l = function l(e, t) {
return t;
};else if ("function" != typeof l) {
var m = l;
l = function l(e, t) {
for (var r = t, n = 0; n < m.length; n++) r = m[n].call(e, r);
return r;
};
} else {
var b = l;
l = function l(e, t) {
return b.call(e, t);
};
}
e.push(l);
}
0 !== a && (1 === a ? (c.get = f.get, c.set = f.set) : 2 === a ? c.value = f : 3 === a ? c.get = f : 4 === a && (c.set = f), o ? 1 === a ? (e.push(function (e, t) {
return f.get.call(e, t);
}), e.push(function (e, t) {
return f.set.call(e, t);
})) : 2 === a ? e.push(f) : e.push(function (e, t) {
return f.call(e, t);
}) : Object.defineProperty(t, n, c));
}
function applyMemberDecs(e, t) {
for (var r, n, a = [], i = new Map(), o = new Map(), s = 0; s < t.length; s++) {
var c = t[s];
if (Array.isArray(c)) {
var l,
u,
f = c[1],
p = c[2],
d = c.length > 3,
h = f >= 5;
if (h ? (l = e, 0 != (f -= 5) && (u = n = n || [])) : (l = e.prototype, 0 !== f && (u = r = r || [])), 0 !== f && !d) {
var v = h ? o : i,
g = v.get(p) || 0;
if (!0 === g || 3 === g && 4 !== f || 4 === g && 3 !== f) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + p);
!g && f > 2 ? v.set(p, f) : v.set(p, !0);
}
applyMemberDec(a, l, c, p, f, h, d, u);
}
}
return pushInitializers(a, r), pushInitializers(a, n), a;
}
function pushInitializers(e, t) {
t && e.push(function (e) {
for (var r = 0; r < t.length; r++) t[r].call(e);
return e;
});
}
return function (e, t, r) {
return {
e: applyMemberDecs(e, t),
get c() {
return function (e, t) {
if (t.length > 0) {
for (var r = [], n = e, a = e.name, i = t.length - 1; i >= 0; i--) {
var o = {
v: !1
};
try {
var s = t[i](n, {
kind: "class",
name: a,
addInitializer: createAddInitializerMethod(r, o)
});
} finally {
o.v = !0;
}
void 0 !== s && (assertValidReturnValue(10, s), n = s);
}
return [n, function () {
for (var e = 0; e < r.length; e++) r[e].call(n);
}];
}
}(e, r);
}
};
};
}
function applyDecs2203R(e, t, r) {
return (module.exports = applyDecs2203R = applyDecs2203RFactory(), module.exports.__esModule = true, module.exports["default"] = module.exports)(e, t, r);
}
module.exports = applyDecs2203R, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/v6/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,GAAG,CAAC;AACX,QAAA,MAAM,GAAG,CAAC,CAAC;AAExB;;;;GAIG;AACU,QAAA,MAAM,GAA0C;IAC3D,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,iBAAiB;IACpB,CAAC,EAAE,YAAY;IACf,CAAC,EAAE,aAAa;IAChB,CAAC,EAAE,YAAY;IACf,CAAC,EAAE,oBAAoB;IACvB,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,UAAU;CACN,CAAC;AAEX;;;;GAIG;AACU,QAAA,KAAK,GAA0C;IAC1D,aAAa,EAAE,yCAAyC;IACxD,aAAa,EAAE,2CAA2C;IAC1D,aAAa,EAAE,oCAAoC;IACnD,aAAa,EAAE,sCAAsC;IACrD,aAAa,EAAE,sCAAsC;IACrD,aAAa,EAAE,mCAAmC;IAClD,aAAa,EAAE,kCAAkC;IACjD,aAAa,EAAE,yBAAyB;IACxC,aAAa,EAAE,2BAA2B;IAC1C,aAAa,EAAE,yBAAyB;IACxC,cAAc,EAAE,2BAA2B;IAC3C,cAAc,EAAE,oBAAoB;IACpC,cAAc,EAAE,oBAAoB;IACpC,cAAc,EAAE,oBAAoB;IACpC,eAAe,EAAE,4DAA4D;IAC7E,eAAe,EAAE,4DAA4D;IAC7E,eAAe,EAAE,2CAA2C;IAC5D,eAAe,EAAE,2CAA2C;IAC5D,QAAQ,EAAE,aAAa;IACvB,SAAS,EAAE,UAAU;IACrB,UAAU,EAAE,WAAW;IACvB,WAAW,EAAE,oBAAoB;CACzB,CAAC;AAEX;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,kBAAkB,CAAC;AAEpD;;;;GAIG;AACU,QAAA,cAAc,GAAG,0CAA0C,CAAC;AAEzE;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AAEnD;;;;GAIG;AACU,QAAA,cAAc,GAAG,MAAM,CAAC;AAExB,QAAA,MAAM,GAAG,6BAA6B,CAAC;AACvC,QAAA,gBAAgB,GAAG,+BAA+B,CAAC"}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"2":"0 1 2 3 4 5 C L M G N O P Q 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","450":"H R S T U V W X"},C:{"2":"0 1 2 3 4 5 6 7 8 9 xC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC 0C 1C"},D:{"2":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q 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","450":"H R S T U V W X"},E:{"2":"J ZB K D E F A B C L M G 2C ZC 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B 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 FD GD HD ID NC uC JD OC","450":"AC BC CC DC EC FC GC HC IC"},G:{"2":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"2":"hD"},I:{"2":"TC J I iD jD kD lD vC mD nD"},J:{"2":"D A"},K:{"2":"A B C H NC uC OC"},L:{"257":"I"},M:{"2":"MC"},N:{"2":"A B"},O:{"2":"PC"},P:{"2":"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:{"2":"zD"},R:{"1":"0D"},S:{"2":"1D 2D"}},B:7,C:"Web NFC",D:true};
@@ -0,0 +1 @@
import"../../get-pipe-path-BHW2eJdv.mjs";import{r as j}from"../../register-CFH5oNdT.mjs";import{t as l}from"../../require-DQxpCAr4.mjs";import"module";import"node:path";import"../../temporary-directory-CwHp0_NW.mjs";import"node:os";import"node:module";import"node:url";import"get-tsconfig";import"node:fs";import"../../index-7AaEi15b.mjs";import"esbuild";import"node:crypto";import"../../client-BQVF1NaW.mjs";import"node:net";import"node:util";import"../../index-gbaejti9.mjs";export{j as register,l as require};
@@ -0,0 +1,356 @@
"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 });
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
function isEnumType(type) {
return (type.getFlags() & ts.TypeFlags.EnumLike) !== 0;
}
function isEnumMemberType(type) {
const symbol = type.getSymbol();
if (!symbol) {
return false;
}
return (symbol.flags & ts.SymbolFlags.EnumMember) !== 0;
}
exports.default = (0, util_1.createRule)({
name: 'no-unnecessary-type-conversion',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow conversion idioms when they do not change the type or value of the expression',
recommended: 'strict',
requiresTypeChecking: true,
},
hasSuggestions: true,
messages: {
suggestRemove: 'Remove the type conversion.',
suggestSatisfies: 'Instead, assert that the value satisfies the {{type}} type.',
unnecessaryTypeConversion: '{{violation}} does not change the type or value of the {{type}}.',
},
schema: [],
},
defaultOptions: [],
create(context) {
function doesUnderlyingTypeMatchFlag(type, typeFlag) {
return tsutils
.unionConstituents(type)
.every(t => (0, util_1.isTypeFlagSet)(t, typeFlag));
}
const services = (0, util_1.getParserServices)(context);
function handleUnaryOperator(node, typeFlag, typeString, violation, isDoubleOperator) {
const outerNode = isDoubleOperator ? node.parent : node;
const type = services.getTypeAtLocation(node.argument);
if (doesUnderlyingTypeMatchFlag(type, typeFlag)) {
const wrappingFixerParams = {
node: outerNode,
innerNode: [node.argument],
sourceCode: context.sourceCode,
};
context.report({
loc: {
start: outerNode.loc.start,
end: {
column: node.loc.start.column + 1,
line: node.loc.start.line,
},
},
messageId: 'unnecessaryTypeConversion',
data: { type: typeString, violation },
suggest: [
{
messageId: 'suggestRemove',
fix: (0, util_1.getWrappingFixer)(wrappingFixerParams),
},
{
messageId: 'suggestSatisfies',
data: { type: typeString },
fix: (0, util_1.getWrappingFixer)({
...wrappingFixerParams,
wrap: expr => `${expr} satisfies ${typeString}`,
}),
},
],
});
}
}
return {
'AssignmentExpression[operator = "+="]'(node) {
if (node.right.type === utils_1.AST_NODE_TYPES.Literal &&
node.right.value === '' &&
doesUnderlyingTypeMatchFlag(services.getTypeAtLocation(node.left), ts.TypeFlags.StringLike)) {
const wrappingFixerParams = {
node,
innerNode: [node.left],
sourceCode: context.sourceCode,
};
context.report({
node,
messageId: 'unnecessaryTypeConversion',
data: {
type: 'string',
violation: "Concatenating a string with ''",
},
suggest: [
{
messageId: 'suggestRemove',
fix: node.parent.type === utils_1.AST_NODE_TYPES.ExpressionStatement
? (fixer) => [
fixer.removeRange([
node.parent.range[0],
node.parent.range[1],
]),
]
: (0, util_1.getWrappingFixer)(wrappingFixerParams),
},
{
messageId: 'suggestSatisfies',
data: { type: 'string' },
fix: (0, util_1.getWrappingFixer)({
...wrappingFixerParams,
wrap: expr => `${expr} satisfies string`,
}),
},
],
});
}
},
'BinaryExpression[operator = "+"]'(node) {
if (node.right.type === utils_1.AST_NODE_TYPES.Literal &&
node.right.value === '' &&
doesUnderlyingTypeMatchFlag(services.getTypeAtLocation(node.left), ts.TypeFlags.StringLike)) {
const wrappingFixerParams = {
node,
innerNode: [node.left],
sourceCode: context.sourceCode,
};
context.report({
loc: {
start: node.left.loc.end,
end: node.loc.end,
},
messageId: 'unnecessaryTypeConversion',
data: {
type: 'string',
violation: "Concatenating a string with ''",
},
suggest: [
{
messageId: 'suggestRemove',
fix: (0, util_1.getWrappingFixer)(wrappingFixerParams),
},
{
messageId: 'suggestSatisfies',
data: { type: 'string' },
fix: (0, util_1.getWrappingFixer)({
...wrappingFixerParams,
wrap: expr => `${expr} satisfies string`,
}),
},
],
});
}
else if (node.left.type === utils_1.AST_NODE_TYPES.Literal &&
node.left.value === '' &&
doesUnderlyingTypeMatchFlag(services.getTypeAtLocation(node.right), ts.TypeFlags.StringLike)) {
const wrappingFixerParams = {
node,
innerNode: [node.right],
sourceCode: context.sourceCode,
};
context.report({
loc: {
start: node.loc.start,
end: node.right.loc.start,
},
messageId: 'unnecessaryTypeConversion',
data: {
type: 'string',
violation: "Concatenating '' with a string",
},
suggest: [
{
messageId: 'suggestRemove',
fix: (0, util_1.getWrappingFixer)(wrappingFixerParams),
},
{
messageId: 'suggestSatisfies',
data: { type: 'string' },
fix: (0, util_1.getWrappingFixer)({
...wrappingFixerParams,
wrap: expr => `${expr} satisfies string`,
}),
},
],
});
}
},
CallExpression(node) {
const nodeCallee = node.callee;
const builtInTypeFlags = {
BigInt: ts.TypeFlags.BigIntLike,
Boolean: ts.TypeFlags.BooleanLike,
Number: ts.TypeFlags.NumberLike,
String: ts.TypeFlags.StringLike,
};
if (nodeCallee.type !== utils_1.AST_NODE_TYPES.Identifier ||
!(nodeCallee.name in builtInTypeFlags)) {
return;
}
const typeFlag = builtInTypeFlags[nodeCallee.name];
const scope = context.sourceCode.getScope(node);
const variable = scope.set.get(nodeCallee.name);
if (!!variable?.defs.length ||
!doesUnderlyingTypeMatchFlag((0, util_1.getConstrainedTypeAtLocation)(services, node.arguments[0]), typeFlag)) {
return;
}
const wrappingFixerParams = {
node,
innerNode: [node.arguments[0]],
sourceCode: context.sourceCode,
};
const typeString = nodeCallee.name.toLowerCase();
context.report({
node: nodeCallee,
messageId: 'unnecessaryTypeConversion',
data: {
type: nodeCallee.name.toLowerCase(),
violation: `Passing a ${typeString} to ${nodeCallee.name}()`,
},
suggest: [
{
messageId: 'suggestRemove',
fix: (0, util_1.getWrappingFixer)(wrappingFixerParams),
},
{
messageId: 'suggestSatisfies',
data: { type: typeString },
fix: (0, util_1.getWrappingFixer)({
...wrappingFixerParams,
wrap: expr => `${expr} satisfies ${typeString}`,
}),
},
],
});
},
'CallExpression > MemberExpression.callee > Identifier[name = "toString"].property'(node) {
const memberExpr = node.parent;
const type = (0, util_1.getConstrainedTypeAtLocation)(services, memberExpr.object);
if (isEnumType(type) || isEnumMemberType(type)) {
return;
}
if (doesUnderlyingTypeMatchFlag(type, ts.TypeFlags.StringLike)) {
const wrappingFixerParams = {
node: memberExpr.parent,
innerNode: [memberExpr.object],
sourceCode: context.sourceCode,
};
context.report({
loc: {
start: memberExpr.property.loc.start,
end: memberExpr.parent.loc.end,
},
messageId: 'unnecessaryTypeConversion',
data: {
type: 'string',
violation: "Calling a string's .toString() method",
},
suggest: [
{
messageId: 'suggestRemove',
fix: (0, util_1.getWrappingFixer)(wrappingFixerParams),
},
{
messageId: 'suggestSatisfies',
data: { type: 'string' },
fix: (0, util_1.getWrappingFixer)({
...wrappingFixerParams,
wrap: expr => `${expr} satisfies string`,
}),
},
],
});
}
},
'UnaryExpression[operator = "!"] > UnaryExpression[operator = "!"]'(node) {
handleUnaryOperator(node, ts.TypeFlags.BooleanLike, 'boolean', 'Using !! on a boolean', true);
},
'UnaryExpression[operator = "+"]'(node) {
handleUnaryOperator(node, ts.TypeFlags.NumberLike, 'number', 'Using the unary + operator on a number', false);
},
'UnaryExpression[operator = "~"] > UnaryExpression[operator = "~"]'(node) {
const outerNode = node.parent;
const type = services.getTypeAtLocation(node.argument);
if (tsutils.unionConstituents(type).every(t => {
return ((0, util_1.isTypeFlagSet)(t, ts.TypeFlags.NumberLiteral) &&
Number.isInteger(t.value));
})) {
const wrappingFixerParams = {
node: outerNode,
innerNode: [node.argument],
sourceCode: context.sourceCode,
};
context.report({
loc: {
start: outerNode.loc.start,
end: {
column: node.loc.start.column + 1,
line: node.loc.start.line,
},
},
messageId: 'unnecessaryTypeConversion',
data: { type: 'number', violation: 'Using ~~ on an integer' },
suggest: [
{
messageId: 'suggestRemove',
fix: (0, util_1.getWrappingFixer)(wrappingFixerParams),
},
{
messageId: 'suggestSatisfies',
data: { type: 'number' },
fix: (0, util_1.getWrappingFixer)({
...wrappingFixerParams,
wrap: expr => `${expr} satisfies number`,
}),
},
],
});
}
},
};
},
});
@@ -0,0 +1,4 @@
/** Increments the given string value + 1 */
export function Increment(T) {
return (parseInt(T) + 1).toString();
}
@@ -0,0 +1,10 @@
import * as ts from 'typescript';
import type { TSESTree } from './ts-estree';
/**
* Convert all comments for the given AST.
* @param ast the AST object
* @param code the TypeScript code
* @returns the converted ESTreeComment
* @private
*/
export declare function convertComments(ast: ts.SourceFile, code: string): TSESTree.Comment[];
@@ -0,0 +1,142 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "aksara", verb: "mempunyai" },
file: { unit: "bait", verb: "mempunyai" },
array: { unit: "elemen", verb: "mempunyai" },
set: { unit: "elemen", verb: "mempunyai" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "nombor";
}
case "object": {
if (Array.isArray(data)) {
return "array";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "input",
email: "alamat e-mel",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "tarikh masa ISO",
date: "tarikh ISO",
time: "masa ISO",
duration: "tempoh ISO",
ipv4: "alamat IPv4",
ipv6: "alamat IPv6",
cidrv4: "julat IPv4",
cidrv6: "julat IPv6",
base64: "string dikodkan base64",
base64url: "string dikodkan base64url",
json_string: "string JSON",
e164: "nombor E.164",
jwt: "JWT",
template_literal: "input",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Input tidak sah: dijangka ${issue.expected}, diterima ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Input tidak sah: dijangka ${util.stringifyPrimitive(issue.values[0])}`;
return `Pilihan tidak sah: dijangka salah satu daripada ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Terlalu besar: dijangka ${issue.origin ?? "nilai"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemen"}`;
return `Terlalu besar: dijangka ${issue.origin ?? "nilai"} adalah ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Terlalu kecil: dijangka ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Terlalu kecil: dijangka ${issue.origin} adalah ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `String tidak sah: mesti bermula dengan "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `String tidak sah: mesti berakhir dengan "${_issue.suffix}"`;
if (_issue.format === "includes")
return `String tidak sah: mesti mengandungi "${_issue.includes}"`;
if (_issue.format === "regex")
return `String tidak sah: mesti sepadan dengan corak ${_issue.pattern}`;
return `${Nouns[_issue.format] ?? issue.format} tidak sah`;
}
case "not_multiple_of":
return `Nombor tidak sah: perlu gandaan ${issue.divisor}`;
case "unrecognized_keys":
return `Kunci tidak dikenali: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Kunci tidak sah dalam ${issue.origin}`;
case "invalid_union":
return "Input tidak sah";
case "invalid_element":
return `Nilai tidak sah dalam ${issue.origin}`;
default:
return `Input tidak sah`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
@@ -0,0 +1,14 @@
// Copyright 2017 Lovell Fuller and others.
// SPDX-License-Identifier: Apache-2.0
export const GLIBC: 'glibc';
export const MUSL: 'musl';
export function family(): Promise<string | null>;
export function familySync(): string | null;
export function isNonGlibcLinux(): Promise<boolean>;
export function isNonGlibcLinuxSync(): boolean;
export function version(): Promise<string | null>;
export function versionSync(): string | null;
@@ -0,0 +1,30 @@
/// <reference types="node" />
import net from 'net';
import { Agent, ClientRequest, RequestOptions } from 'agent-base';
import { HttpsProxyAgentOptions } from '.';
/**
* The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
* the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
*
* Outgoing HTTP requests are first tunneled through the proxy server using the
* `CONNECT` HTTP request method to establish a connection to the proxy server,
* and then the proxy server connects to the destination target and issues the
* HTTP request from the proxy server.
*
* `https:` requests have their socket connection upgraded to TLS once
* the connection to the proxy server has been established.
*
* @api public
*/
export default class HttpsProxyAgent extends Agent {
private secureProxy;
private proxy;
constructor(_opts: string | HttpsProxyAgentOptions);
/**
* Called when the node-core HTTP client library is creating a
* new HTTP request.
*
* @api protected
*/
callback(req: ClientRequest, opts: RequestOptions): Promise<net.Socket>;
}
@@ -0,0 +1,9 @@
export type MessageIds = 'omittingRestParameter' | 'omittingSingleParameter' | 'singleParameterDifference';
export type Options = [
{
ignoreDifferentlyNamedParameters?: boolean;
ignoreOverloadsWithDifferentJSDoc?: boolean;
}
];
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
export default _default;
@@ -0,0 +1,826 @@
flf2a$ 8 6 15 -1 9
nancyj-underlined.flf
named after the login of a woman who asked me to make her a
sig. this is the font that came out of it. this is my first
attempt at a figlet font, so leave me alone.
vampyr@acs.bu.edu
$$ @
$$ @
$$ @
$$ @
$$ @
$$ @
ooo@
$$ @@
dP @
88 @
88 @
dP @
@
oo @
ooo@
@@
dP dP @
dP dP @
@
@
@
@
oooooo@
@@
@
dP dP @
8888888 @
88 88 @
8888888 @
dP dP @
oooooooo@
@@
# # @
.d8888P' @
Y8#oo#o. @
# #88 @
`88888P' @
# # @
ooooooooo@
@@
d8P dP @
8 8 d8' @
Y8P d8' @
d8' d8P @
d8' 8 8 @
88 Y8P @
ooooooooooo@
@@
d88b @
8`'8 @
d8b @
d8P`8b @
d8' `8bP @
`888P'`YP @
ooooooooooo@
@@
d8 @
88 @
.P @
@
@
@
ooo@
@@
a88P @
d8' @
88 @
88 @
Y8. @
Y88b @
oooooo@
@@
Y88o @
`8b @
88 @
88 @
.8P @
d88Y @
oooooo@
@@
dP @
8b. 88 .d8 @
`8b88d8' @
.8P88Y8. @
8P' 88 `Y8 @
dP @
ooooooooooo@
@@
@
dP @
88 @
88888888 @
88 @
dP @
ooooooooo@
@@
@
@
@
@
dP @
88 @
~.P~@
@@
@
@
@
88888888 @
@
@
ooooooooo@
@@
@
@
@
@
dP @
88 @
ooo@
@@
d8' @
d8' @
d8' @
d8' @
d8' @
88 @
ooooooooo@
@@
a8888a @
d8' ..8b @
88 .P 88 @
88 d' 88 @
Y8'' .8P @
Y8888P @
ooooooooo@
@@
d88 @
88 @
88 @
88 @
88 @
d88P @
ooooo@
@@
d8888b. @
`88 @
.aaadP' @
88' @
88. @
Y88888P @
oooooooo@
@@
d8888b. @
`88 @
aaad8' @
`88 @
.88 @
d88888P @
oooooooo@
@@
dP dP @
88 88 @
88aaa88 @
88 @
88 @
dP @
oooooooo@
@@
888888P @
88' @
88baaa. @
`88 @
88 @
d88888P @
oooooooo@
@@
.d8888P @
88' @
88baaa. @
88` `88 @
8b. .d8 @
`Y888P' @
oooooooo@
@@
d88888P @
d8' @
d8' @
d8' @
d8' @
d8' @
oooooooo@
@@
.d888b. @
Y8' `8P @
d8bad8b @
88` `88 @
8b. .88 @
Y88888P @
oooooooo@
@@
.d888b. @
Y8' `88 @
`8bad88 @
`88 @
d. .88 @
`8888P @
oooooooo@
@@
dP @
88 @
@
@
dP @
88 @
ooo@
@@
dP @
88 @
@
@
dP @
88 @
~.P~@
@@
d8 @
d8' @
d8' @
Y8. @
Y8. @
Y8 @
oooooo@
@@
@
@
aaaaaaaa @
@
88888888 @
@
ooooooooo@
@@
8b @
`8b @
`8b @
.8P @
.8P @
8P @
ooooo@
@@
.d8888ba @
`8' `8b @
.d8' @
d8P' @
"" @
oo @
oooooooooo@
@@
a88888b. @
d8' `88 @
88 d8P 88 @
88 Yo8b88 @
Y8. @
Y88888P' @
oooooooooo@
@@
.d888888 @
d8' 88 @
88aaaaa88a @
88 88 @
88 88 @
88 88 @
ooooooooooo@
@@
888888ba @
88 `8b @
a88aaaa8P' @
88 `8b. @
88 .88 @
88888888P @
ooooooooooo@
@@
a88888b. @
d8' `88 @
88 @
88 @
Y8. .88 @
Y88888P' @
oooooooooo@
@@
888888ba @
88 `8b @
88 88 @
88 88 @
88 .8P @
8888888P @
oooooooooo@
@@
88888888b @
88 @
a88aaaa @
88 @
88 @
88888888P @
ooooooooooo@
@@
88888888b @
88 @
a88aaaa @
88 @
88 @
dP @
ooooooooooo@
@@
.88888. @
d8' `88 @
88 @
88 YP88 @
Y8. .88 @
`88888' @
oooooooooo@
@@
dP dP @
88 88 @
88aaaaa88a @
88 88 @
88 88 @
dP dP @
ooooooooooo@
@@
dP @
88 @
88 @
88 @
88 @
dP @
ooo@
@@
dP @
88 @
88 @
88 @
88. .d8P @
`Y8888' @
oooooooooo@
@@
dP dP @
88 .d8' @
88aaa8P' @
88 `8b. @
88 88 @
dP dP @
oooooooooo@
@@
dP @
88 @
88 @
88 @
88 @
88888888P @
oooooooooo@
@@
8888ba.88ba @
88 `8b `8b @
88 88 88 @
88 88 88 @
88 88 88 @
dP dP dP @
ooooooooooooo@
@@
888888ba @
88 `8b @
88 88 @
88 88 @
88 88 @
dP dP @
oooooooooo@
@@
.88888. @
d8' `8b @
88 88 @
88 88 @
Y8. .8P @
`8888P' @
oooooooooo@
@@
888888ba @
88 `8b @
a88aaaa8P' @
88 @
88 @
dP @
ooooooooooo@
@@
.88888. @
d8' `8b @
88 88 @
88 db 88 @
Y8. Y88P @
`8888PY8b @
ooooooooooo@
@@
888888ba @
88 `8b @
a88aaaa8P' @
88 `8b. @
88 88 @
dP dP @
ooooooooooo@
@@
.d88888b @
88. "' @
`Y88888b. @
`8b @
d8' .8P @
Y88888P @
oooooooooo@
@@
d888888P @
88 @
88 @
88 @
88 @
dP @
ooooooooo@
@@
dP dP @
88 88 @
88 88 @
88 88 @
Y8. .8P @
`Y88888P' @
oooooooooo@
@@
dP dP @
88 88 @
88 .8P @
88 d8' @
88 .d8P @
888888' @
oooooooooo@
@@
dP dP dP @
88 88 88 @
88 .8P .8P @
88 d8' d8' @
88.d8P8.d8P @
8888' Y88' @
ooooooooooooo@
@@
dP dP @
Y8. .8P @
Y8aa8P @
d8' `8b @
88 88 @
dP dP @
ooooooooo@
@@
dP dP @
Y8. .8P @
Y8aa8P @
88 @
88 @
dP @
ooooooooo@
@@
d8888888P @
.d8' @
.d8' @
.d8' @
d8' @
Y8888888P @
oooooooooo@
@@
8888P @
88 @
88 @
88 @
88 @
88888 @
oooooo@
@@
Yb @
`Yb @
`Yb @
`Yb @
`Yb @
88 @
oooooooo@
@@
d8888 @
88 @
88 @
88 @
88 @
88888 @
oooooo@
@@
db @
d8'`8b @
`" "' @
@
@
@
ooooooooo@
@@
@
@
@
@
@
@
vvvvvvvvvvv @
""""""""""" @@
dP @
88 @
Y. @
@
@
@
ooo@
@@
@
@
.d8888b. @
88' `88 @
88. .88 @
`88888P8 @
ooooooooo@
@@
dP @
88 @
88d888b. @
88' `88 @
88. .88 @
88Y8888' @
ooooooooo@
@@
@
@
.d8888b. @
88' `"" @
88. ... @
`88888P' @
ooooooooo@
@@
dP @
88 @
.d888b88 @
88' `88 @
88. .88 @
`88888P8 @
ooooooooo@
@@
@
@
.d8888b. @
88ooood8 @
88. ... @
`88888P' @
ooooooooo@
@@
.8888b @
88 " @
88aaa @
88 @
88 @
dP @
ooooooo@
@@
@
@
.d8888b. @
88' `88 @
88. .88 @
`8888P88 @
o~~~~.88~@
d8888P @@
dP @
88 @
88d888b. @
88' `88 @
88 88 @
dP dP @
ooooooooo@
@@
oo @
@
dP @
88 @
88 @
dP @
ooo@
@@
oo @
@
dP @
88 @
88 @
88 @
88~@
dP @@
dP @
88 @
88 .dP @
88888" @
88 `8b. @
dP `YP @
ooooooooo@
@@
dP @
88 @
88 @
88 @
88 @
dP @
ooo@
@@
@
@
88d8b.d8b. @
88'`88'`88 @
88 88 88 @
dP dP dP @
ooooooooooo@
@@
@
@
88d888b. @
88' `88 @
88 88 @
dP dP @
ooooooooo@
@@
@
@
.d8888b. @
88' `88 @
88. .88 @
`88888P' @
ooooooooo@
@@
@
@
88d888b. @
88' `88 @
88. .88 @
88Y888P' @
~88~oooooo@
dP @@
@
@
.d8888b. @
88' `88 @
88. .88 @
`8888P88 @
ooooo~88~@
dP @@
@
@
88d888b. @
88' `88 @
88 @
dP @
ooooooooo@
@@
@
@
.d8888b. @
Y8ooooo. @
88 @
`88888P' @
ooooooooo@
@@
dP @
88 @
d8888P @
88 @
88 @
dP @
ooooooo@
@@
@
@
dP dP @
88 88 @
88. .88 @
`88888P' @
ooooooooo@
@@
@
@
dP .dP @
88 d8' @
88 .88' @
8888P' @
ooooooooo@
@@
@
@
dP dP dP @
88 88 88 @
88.88b.88' @
8888P Y8P @
ooooooooooo@
@@
@
@
dP. .dP @
`8bd8' @
.d88b. @
dP' `dP @
ooooooooo@
@@
@
@
dP dP @
88 88 @
88. .88 @
`8888P88 @
o~~~~.88~@
d8888P @@
@
@
d888888b @
.d8P' @
.Y8P @
d888888P @
ooooooooo@
@@
.d88P @
8: @
.oY8. @
d8 @
8: @
`Y88b @
oooooooo@
@@
dP @
88 @
"' @
dP @
88 @
"' @
ooo@
@@
d88b. @
:8 @
.8Yo. @
8b @
:8 @
Y88P' @
oooooooo@
@@
.oo. .d @
dP" "d8P @
@
@
@
@
oooooooooo@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@@ -0,0 +1,8 @@
export = getTokenBeforeClosingBracket;
/**
* Find the token before the closing bracket.
* @param {ASTNode} node - The JSX element node.
* @returns {Token} The token before the closing bracket.
*/
declare function getTokenBeforeClosingBracket(node: ASTNode): Token;
//# sourceMappingURL=getTokenBeforeClosingBracket.d.ts.map
@@ -0,0 +1,171 @@
# htmlparser2
[![NPM version](https://img.shields.io/npm/v/htmlparser2.svg)](https://npmjs.org/package/htmlparser2)
[![Downloads](https://img.shields.io/npm/dm/htmlparser2.svg)](https://npmjs.org/package/htmlparser2)
[![Node.js CI](https://github.com/fb55/htmlparser2/actions/workflows/nodejs-test.yml/badge.svg)](https://github.com/fb55/htmlparser2/actions/workflows/nodejs-test.yml)
[![Coverage](https://img.shields.io/coveralls/fb55/htmlparser2.svg)](https://coveralls.io/r/fb55/htmlparser2)
The fast & forgiving HTML/XML parser.
_htmlparser2 is [the fastest HTML parser](#performance), and takes some shortcuts to get there. If you need strict HTML spec compliance, have a look at [parse5](https://github.com/inikulin/parse5)._
## Installation
npm install htmlparser2
A live demo of `htmlparser2` is available [on AST Explorer](https://astexplorer.net/#/2AmVrGuGVJ).
## Ecosystem
| Name | Description |
| ------------------------------------------------------------- | ------------------------------------------------------- |
| [htmlparser2](https://github.com/fb55/htmlparser2) | Fast & forgiving HTML/XML parser |
| [domhandler](https://github.com/fb55/domhandler) | Handler for htmlparser2 that turns documents into a DOM |
| [domutils](https://github.com/fb55/domutils) | Utilities for working with domhandler's DOM |
| [css-select](https://github.com/fb55/css-select) | CSS selector engine, compatible with domhandler's DOM |
| [cheerio](https://github.com/cheeriojs/cheerio) | The jQuery API for domhandler's DOM |
| [dom-serializer](https://github.com/cheeriojs/dom-serializer) | Serializer for domhandler's DOM |
## Usage
`htmlparser2` itself provides a callback interface that allows consumption of documents with minimal allocations.
For a more ergonomic experience, read [Getting a DOM](#getting-a-dom) below.
```js
import * as htmlparser2 from "htmlparser2";
const parser = new htmlparser2.Parser({
onopentag(name, attributes) {
/*
* This fires when a new tag is opened.
*
* If you don't need an aggregated `attributes` object,
* have a look at the `onopentagname` and `onattribute` events.
*/
if (name === "script" && attributes.type === "text/javascript") {
console.log("JS! Hooray!");
}
},
ontext(text) {
/*
* Fires whenever a section of text was processed.
*
* Note that this can fire at any point within text and you might
* have to stitch together multiple pieces.
*/
console.log("-->", text);
},
onclosetag(tagname) {
/*
* Fires when a tag is closed.
*
* You can rely on this event only firing when you have received an
* equivalent opening tag before. Closing tags without corresponding
* opening tags will be ignored.
*/
if (tagname === "script") {
console.log("That's it?!");
}
},
});
parser.write(
"Xyz <script type='text/javascript'>const foo = '<<bar>>';</script>",
);
parser.end();
```
Output (with multiple text events combined):
```
--> Xyz
JS! Hooray!
--> const foo = '<<bar>>';
That's it?!
```
This example only shows three of the possible events.
Read more about the parser, its events and options in the [wiki](https://github.com/fb55/htmlparser2/wiki/Parser-options).
### Usage with streams
While the `Parser` interface closely resembles Node.js streams, it's not a 100% match.
Use the `WritableStream` interface to process a streaming input:
```js
import { WritableStream } from "htmlparser2/lib/WritableStream";
const parserStream = new WritableStream({
ontext(text) {
console.log("Streaming:", text);
},
});
const htmlStream = fs.createReadStream("./my-file.html");
htmlStream.pipe(parserStream).on("finish", () => console.log("done"));
```
## Getting a DOM
The `DomHandler` produces a DOM (document object model) that can be manipulated using the [`DomUtils`](https://github.com/fb55/DomUtils) helper.
```js
import * as htmlparser2 from "htmlparser2";
const dom = htmlparser2.parseDocument(htmlString);
```
The `DomHandler`, while still bundled with this module, was moved to its [own module](https://github.com/fb55/domhandler).
Have a look at that for further information.
## Parsing Feeds
`htmlparser2` makes it easy to parse RSS, RDF and Atom feeds, by providing a `parseFeed` method:
```javascript
const feed = htmlparser2.parseFeed(content, options);
```
## Performance
After having some artificial benchmarks for some time, **@AndreasMadsen** published his [`htmlparser-benchmark`](https://github.com/AndreasMadsen/htmlparser-benchmark), which benchmarks HTML parses based on real-world websites.
At the time of writing, the latest versions of all supported parsers show the following performance characteristics on GitHub Actions (sourced from [here](https://github.com/AndreasMadsen/htmlparser-benchmark/blob/e78cd8fc6c2adac08deedd4f274c33537451186b/stats.txt)):
```
htmlparser2 : 2.17215 ms/file ± 3.81587
node-html-parser : 2.35983 ms/file ± 1.54487
html5parser : 2.43468 ms/file ± 2.81501
neutron-html5parser: 2.61356 ms/file ± 1.70324
htmlparser2-dom : 3.09034 ms/file ± 4.77033
html-dom-parser : 3.56804 ms/file ± 5.15621
libxmljs : 4.07490 ms/file ± 2.99869
htmljs-parser : 6.15812 ms/file ± 7.52497
parse5 : 9.70406 ms/file ± 6.74872
htmlparser : 15.0596 ms/file ± 89.0826
html-parser : 28.6282 ms/file ± 22.6652
saxes : 45.7921 ms/file ± 128.691
html5 : 120.844 ms/file ± 153.944
```
## How does this module differ from [node-htmlparser](https://github.com/tautologistics/node-htmlparser)?
In 2011, this module started as a fork of the `htmlparser` module.
`htmlparser2` was rewritten multiple times and, while it maintains an API that's mostly compatible with `htmlparser`, the projects don't share any code anymore.
The parser now provides a callback interface inspired by [sax.js](https://github.com/isaacs/sax-js) (originally targeted at [readabilitySAX](https://github.com/fb55/readabilitysax)).
As a result, old handlers won't work anymore.
The `DefaultHandler` was renamed to clarify its purpose (to `DomHandler`). The old name is still available when requiring `htmlparser2` and your code should work as expected.
The `RssHandler` was replaced with a `getFeed` function that takes a `DomHandler` DOM and returns a feed object. There is a `parseFeed` helper function that can be used to parse a feed from a string.
## Security contact information
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure.
## `htmlparser2` for enterprise
Available as part of the Tidelift Subscription.
The maintainers of `htmlparser2` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-htmlparser2?utm_source=npm-htmlparser2&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
@@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Output = void 0;
const util_1 = require("util");
class Output {
constructor(verb = false, debugMode = false) {
this.verb = verb;
this.debug = (message, obj) => { };
if (debugMode) {
this.debug = (message, obj) => {
console.debug(`tsc-alias debug: ${message} ${obj
? (0, util_1.inspect)(obj, {
showHidden: true,
depth: Infinity,
colors: true
})
: ''}`);
};
}
}
set verbose(value) {
if (value) {
this.verb = value;
}
}
info(message) {
if (!this.verb)
return;
console.log(`tsc-alias info: ${message}`);
}
error(message, exitProcess = false) {
console.error(`\x1b[41mtsc-alias error:\x1b[0m \x1b[31m${message}\x1b[0m`);
if (exitProcess)
process.exit(1);
}
clear() {
console.clear();
}
assert(claim, message) {
claim || this.error(message, true);
}
}
exports.Output = Output;
//# sourceMappingURL=output.js.map
@@ -0,0 +1,11 @@
/**
Merges "own" properties from a source to a destination object, including non-enumerable and accessor-defined properties. It retains original values and descriptors, ensuring the destination receives a complete and accurate copy of the source's properties.
@param destination - The object to receive properties.
@param source - The object providing properties.
@param overwrite - Optional boolean to control overwriting of existing properties. Defaults to true.
@returns The modified destination object.
*/
declare function mergeDescriptors<T, U>(destination: T, source: U, overwrite?: boolean): T & U;
export = mergeDescriptors;
@@ -0,0 +1,168 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _iterationDecorator = _interopRequireDefault(require("./util/iterationDecorator"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
var properties = [['aria-activedescendant', {
'type': 'id'
}], ['aria-atomic', {
'type': 'boolean'
}], ['aria-autocomplete', {
'type': 'token',
'values': ['inline', 'list', 'both', 'none']
}], ['aria-braillelabel', {
'type': 'string'
}], ['aria-brailleroledescription', {
'type': 'string'
}], ['aria-busy', {
'type': 'boolean'
}], ['aria-checked', {
'type': 'tristate'
}], ['aria-colcount', {
type: 'integer'
}], ['aria-colindex', {
type: 'integer'
}], ['aria-colspan', {
type: 'integer'
}], ['aria-controls', {
'type': 'idlist'
}], ['aria-current', {
type: 'token',
values: ['page', 'step', 'location', 'date', 'time', true, false]
}], ['aria-describedby', {
'type': 'idlist'
}], ['aria-description', {
'type': 'string'
}], ['aria-details', {
'type': 'id'
}], ['aria-disabled', {
'type': 'boolean'
}], ['aria-dropeffect', {
'type': 'tokenlist',
'values': ['copy', 'execute', 'link', 'move', 'none', 'popup']
}], ['aria-errormessage', {
'type': 'id'
}], ['aria-expanded', {
'type': 'boolean',
'allowundefined': true
}], ['aria-flowto', {
'type': 'idlist'
}], ['aria-grabbed', {
'type': 'boolean',
'allowundefined': true
}], ['aria-haspopup', {
'type': 'token',
'values': [false, true, 'menu', 'listbox', 'tree', 'grid', 'dialog']
}], ['aria-hidden', {
'type': 'boolean',
'allowundefined': true
}], ['aria-invalid', {
'type': 'token',
'values': ['grammar', false, 'spelling', true]
}], ['aria-keyshortcuts', {
type: 'string'
}], ['aria-label', {
'type': 'string'
}], ['aria-labelledby', {
'type': 'idlist'
}], ['aria-level', {
'type': 'integer'
}], ['aria-live', {
'type': 'token',
'values': ['assertive', 'off', 'polite']
}], ['aria-modal', {
type: 'boolean'
}], ['aria-multiline', {
'type': 'boolean'
}], ['aria-multiselectable', {
'type': 'boolean'
}], ['aria-orientation', {
'type': 'token',
'values': ['vertical', 'undefined', 'horizontal']
}], ['aria-owns', {
'type': 'idlist'
}], ['aria-placeholder', {
type: 'string'
}], ['aria-posinset', {
'type': 'integer'
}], ['aria-pressed', {
'type': 'tristate'
}], ['aria-readonly', {
'type': 'boolean'
}], ['aria-relevant', {
'type': 'tokenlist',
'values': ['additions', 'all', 'removals', 'text']
}], ['aria-required', {
'type': 'boolean'
}], ['aria-roledescription', {
type: 'string'
}], ['aria-rowcount', {
type: 'integer'
}], ['aria-rowindex', {
type: 'integer'
}], ['aria-rowspan', {
type: 'integer'
}], ['aria-selected', {
'type': 'boolean',
'allowundefined': true
}], ['aria-setsize', {
'type': 'integer'
}], ['aria-sort', {
'type': 'token',
'values': ['ascending', 'descending', 'none', 'other']
}], ['aria-valuemax', {
'type': 'number'
}], ['aria-valuemin', {
'type': 'number'
}], ['aria-valuenow', {
'type': 'number'
}], ['aria-valuetext', {
'type': 'string'
}]];
var ariaPropsMap = {
entries: function entries() {
return properties;
},
forEach: function forEach(fn) {
var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
for (var _i = 0, _properties = properties; _i < _properties.length; _i++) {
var _properties$_i = _slicedToArray(_properties[_i], 2),
key = _properties$_i[0],
values = _properties$_i[1];
fn.call(thisArg, values, key, properties);
}
},
get: function get(key) {
var item = properties.filter(function (tuple) {
return tuple[0] === key ? true : false;
})[0];
return item && item[1];
},
has: function has(key) {
return !!ariaPropsMap.get(key);
},
keys: function keys() {
return properties.map(function (_ref) {
var _ref2 = _slicedToArray(_ref, 1),
key = _ref2[0];
return key;
});
},
values: function values() {
return properties.map(function (_ref3) {
var _ref4 = _slicedToArray(_ref3, 2),
values = _ref4[1];
return values;
});
}
};
var _default = exports.default = (0, _iterationDecorator.default)(ariaPropsMap, ariaPropsMap.entries());
@@ -0,0 +1,145 @@
import { KeyOfPropertyKeys } from '../../type/keyof/index.mjs';
import { Check } from '../check/index.mjs';
import { Clone } from '../clone/index.mjs';
import { Deref, Pushref } from '../deref/index.mjs';
import { Kind } from '../../type/symbols/index.mjs';
// ------------------------------------------------------------------
// ValueGuard
// ------------------------------------------------------------------
// prettier-ignore
import { HasPropertyKey, IsString, IsObject, IsArray, IsUndefined } from '../guard/index.mjs';
// ------------------------------------------------------------------
// TypeGuard
// ------------------------------------------------------------------
// prettier-ignore
import { IsKind } from '../../type/guard/kind.mjs';
// ------------------------------------------------------------------
// IsCheckable
// ------------------------------------------------------------------
function IsCheckable(schema) {
return IsKind(schema) && schema[Kind] !== 'Unsafe';
}
// ------------------------------------------------------------------
// Types
// ------------------------------------------------------------------
function FromArray(schema, references, value) {
if (!IsArray(value))
return value;
return value.map((value) => Visit(schema.items, references, value));
}
function FromImport(schema, references, value) {
const definitions = globalThis.Object.values(schema.$defs);
const target = schema.$defs[schema.$ref];
return Visit(target, [...references, ...definitions], value);
}
function FromIntersect(schema, references, value) {
const unevaluatedProperties = schema.unevaluatedProperties;
const intersections = schema.allOf.map((schema) => Visit(schema, references, Clone(value)));
const composite = intersections.reduce((acc, value) => (IsObject(value) ? { ...acc, ...value } : value), {});
if (!IsObject(value) || !IsObject(composite) || !IsKind(unevaluatedProperties))
return composite;
const knownkeys = KeyOfPropertyKeys(schema);
for (const key of Object.getOwnPropertyNames(value)) {
if (knownkeys.includes(key))
continue;
if (Check(unevaluatedProperties, references, value[key])) {
composite[key] = Visit(unevaluatedProperties, references, value[key]);
}
}
return composite;
}
function FromObject(schema, references, value) {
if (!IsObject(value) || IsArray(value))
return value; // Check IsArray for AllowArrayObject configuration
const additionalProperties = schema.additionalProperties;
for (const key of Object.getOwnPropertyNames(value)) {
if (HasPropertyKey(schema.properties, key)) {
value[key] = Visit(schema.properties[key], references, value[key]);
continue;
}
if (IsKind(additionalProperties) && Check(additionalProperties, references, value[key])) {
value[key] = Visit(additionalProperties, references, value[key]);
continue;
}
delete value[key];
}
return value;
}
function FromRecord(schema, references, value) {
if (!IsObject(value))
return value;
const additionalProperties = schema.additionalProperties;
const propertyKeys = Object.getOwnPropertyNames(value);
const [propertyKey, propertySchema] = Object.entries(schema.patternProperties)[0];
const propertyKeyTest = new RegExp(propertyKey);
for (const key of propertyKeys) {
if (propertyKeyTest.test(key)) {
value[key] = Visit(propertySchema, references, value[key]);
continue;
}
if (IsKind(additionalProperties) && Check(additionalProperties, references, value[key])) {
value[key] = Visit(additionalProperties, references, value[key]);
continue;
}
delete value[key];
}
return value;
}
function FromRef(schema, references, value) {
return Visit(Deref(schema, references), references, value);
}
function FromThis(schema, references, value) {
return Visit(Deref(schema, references), references, value);
}
function FromTuple(schema, references, value) {
if (!IsArray(value))
return value;
if (IsUndefined(schema.items))
return [];
const length = Math.min(value.length, schema.items.length);
for (let i = 0; i < length; i++) {
value[i] = Visit(schema.items[i], references, value[i]);
}
// prettier-ignore
return value.length > length
? value.slice(0, length)
: value;
}
function FromUnion(schema, references, value) {
for (const inner of schema.anyOf) {
if (IsCheckable(inner) && Check(inner, references, value)) {
return Visit(inner, references, value);
}
}
return value;
}
function Visit(schema, references, value) {
const references_ = IsString(schema.$id) ? Pushref(schema, references) : references;
const schema_ = schema;
switch (schema_[Kind]) {
case 'Array':
return FromArray(schema_, references_, value);
case 'Import':
return FromImport(schema_, references_, value);
case 'Intersect':
return FromIntersect(schema_, references_, value);
case 'Object':
return FromObject(schema_, references_, value);
case 'Record':
return FromRecord(schema_, references_, value);
case 'Ref':
return FromRef(schema_, references_, value);
case 'This':
return FromThis(schema_, references_, value);
case 'Tuple':
return FromTuple(schema_, references_, value);
case 'Union':
return FromUnion(schema_, references_, value);
default:
return value;
}
}
/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */
export function Clean(...args) {
return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]);
}
@@ -0,0 +1,5 @@
import { ManagedClassElementMetadata } from '../models/ManagedClassElementMetadata';
import { MaybeManagedClassElementMetadata } from '../models/MaybeManagedClassElementMetadata';
import { UnmanagedClassElementMetadata } from '../models/UnmanagedClassElementMetadata';
export declare function buildUnmanagedMetadataFromMaybeManagedMetadata(metadata: MaybeManagedClassElementMetadata | ManagedClassElementMetadata): UnmanagedClassElementMetadata;
//# sourceMappingURL=buildUnmanagedMetadataFromMaybeManagedMetadata.d.ts.map
@@ -0,0 +1,128 @@
# ESLintRC Library
This repository contains the legacy ESLintRC configuration file format for ESLint. This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs.
**Note:** This package is frozen except for critical bug fixes as ESLint moves to a new config system.
## Installation
You can install the package as follows:
```shell
npm install @eslint/eslintrc -D
# or
yarn add @eslint/eslintrc -D
# or
pnpm install @eslint/eslintrc -D
# or
bun install @eslint/eslintrc -D
```
## Usage (ESM)
The primary class in this package is `FlatCompat`, which is a utility to translate ESLintRC-style configs into flat configs. Here's how you use it inside of your `eslint.config.js` file:
```js
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import path from "path";
import { fileURLToPath } from "url";
// mimic CommonJS variables -- not needed if using CommonJS
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname, // optional; default: process.cwd()
resolvePluginsRelativeTo: __dirname, // optional
recommendedConfig: js.configs.recommended, // optional unless you're using "eslint:recommended"
allConfig: js.configs.all, // optional unless you're using "eslint:all"
});
export default [
// mimic ESLintRC-style extends
...compat.extends("standard", "example", "plugin:react/recommended"),
// mimic environments
...compat.env({
es2020: true,
node: true
}),
// mimic plugins
...compat.plugins("jsx-a11y", "react"),
// translate an entire config
...compat.config({
plugins: ["jsx-a11y", "react"],
extends: "standard",
env: {
es2020: true,
node: true
},
rules: {
semi: "error"
}
})
];
```
## Usage (CommonJS)
Using `FlatCompat` in CommonJS files is similar to ESM, but you'll use `require()` and `module.exports` instead of `import` and `export`. Here's how you use it inside of your `eslint.config.js` CommonJS file:
```js
const { FlatCompat } = require("@eslint/eslintrc");
const js = require("@eslint/js");
const compat = new FlatCompat({
baseDirectory: __dirname, // optional; default: process.cwd()
resolvePluginsRelativeTo: __dirname, // optional
recommendedConfig: js.configs.recommended, // optional unless using "eslint:recommended"
allConfig: js.configs.all, // optional unless using "eslint:all"
});
module.exports = [
// mimic ESLintRC-style extends
...compat.extends("standard", "example", "plugin:react/recommended"),
// mimic environments
...compat.env({
es2020: true,
node: true
}),
// mimic plugins
...compat.plugins("jsx-a11y", "react"),
// translate an entire config
...compat.config({
plugins: ["jsx-a11y", "react"],
extends: "standard",
env: {
es2020: true,
node: true
},
rules: {
semi: "error"
}
})
];
```
## Troubleshooting
**TypeError: Missing parameter 'recommendedConfig' in FlatCompat constructor**
The `recommendedConfig` option is required when any config uses `eslint:recommended`, including any config in an `extends` clause. To fix this, follow the example above using `@eslint/js` to provide the `eslint:recommended` config.
**TypeError: Missing parameter 'allConfig' in FlatCompat constructor**
The `allConfig` option is required when any config uses `eslint:all`, including any config in an `extends` clause. To fix this, follow the example above using `@eslint/js` to provide the `eslint:all` config.
## License
MIT License
@@ -0,0 +1,34 @@
export {};
type _AbortController = typeof globalThis extends { onmessage: any } ? {} : AbortController;
interface AbortController {
readonly signal: AbortSignal;
abort(reason?: any): void;
}
type _AbortSignal = typeof globalThis extends { onmessage: any } ? {} : AbortSignal;
interface AbortSignal extends EventTarget {
readonly aborted: boolean;
onabort: ((this: AbortSignal, ev: Event) => any) | null;
readonly reason: any;
throwIfAborted(): void;
}
declare global {
interface AbortController extends _AbortController {}
var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
: {
prototype: AbortController;
new(): AbortController;
};
interface AbortSignal extends _AbortSignal {}
var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
: {
prototype: AbortSignal;
new(): AbortSignal;
abort(reason?: any): AbortSignal;
any(signals: AbortSignal[]): AbortSignal;
timeout(milliseconds: number): AbortSignal;
};
}
@@ -0,0 +1,77 @@
'use strict';
const mapObj = require('map-obj');
const camelCase = require('camelcase');
const QuickLru = require('quick-lru');
const has = (array, key) => array.some(x => {
if (typeof x === 'string') {
return x === key;
}
x.lastIndex = 0;
return x.test(key);
});
const cache = new QuickLru({maxSize: 100000});
// Reproduces behavior from `map-obj`
const isObject = value =>
typeof value === 'object' &&
value !== null &&
!(value instanceof RegExp) &&
!(value instanceof Error) &&
!(value instanceof Date);
const camelCaseConvert = (input, options) => {
if (!isObject(input)) {
return input;
}
options = {
deep: false,
pascalCase: false,
...options
};
const {exclude, pascalCase, stopPaths, deep} = options;
const stopPathsSet = new Set(stopPaths);
const makeMapper = parentPath => (key, value) => {
if (deep && isObject(value)) {
const path = parentPath === undefined ? key : `${parentPath}.${key}`;
if (!stopPathsSet.has(path)) {
value = mapObj(value, makeMapper(path));
}
}
if (!(exclude && has(exclude, key))) {
const cacheKey = pascalCase ? `${key}_` : key;
if (cache.has(cacheKey)) {
key = cache.get(cacheKey);
} else {
const returnValue = camelCase(key, {pascalCase, locale: false});
if (key.length < 100) { // Prevent abuse
cache.set(cacheKey, returnValue);
}
key = returnValue;
}
}
return [key, value];
};
return mapObj(input, makeMapper(undefined));
};
module.exports = (input, options) => {
if (Array.isArray(input)) {
return Object.keys(input).map(key => camelCaseConvert(input[key], options));
}
return camelCaseConvert(input, options);
};
@@ -0,0 +1,105 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/monitor-mobile.tsx
var monitor_mobile_exports = {};
__export(monitor_mobile_exports, {
MonitorMobileIcon: () => MonitorMobileIcon
});
module.exports = __toCommonJS(monitor_mobile_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var MonitorMobileIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
"svg",
{
"aria-hidden": "true",
fill: "none",
focusable: "false",
height: "1em",
role: "presentation",
viewBox: "0 0 24 24",
width: "1em",
...props,
children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"path",
{
d: "M10 16.95H6.21C2.84 16.95 2 16.11 2 12.74V6.74003C2 3.37003 2.84 2.53003 6.21 2.53003H16.74C20.11 2.53003 20.95 3.37003 20.95 6.74003",
stroke: "currentColor",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.5"
}
),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"path",
{
d: "M10 21.4699V16.95",
stroke: "currentColor",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.5"
}
),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"path",
{
d: "M2 12.95H10",
stroke: "currentColor",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.5"
}
),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"path",
{
d: "M6.73999 21.47H9.99999",
stroke: "currentColor",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.5"
}
),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"path",
{
d: "M22 12.8V18.51C22 20.88 21.41 21.47 19.04 21.47H15.49C13.12 21.47 12.53 20.88 12.53 18.51V12.8C12.53 10.43 13.12 9.83997 15.49 9.83997H19.04C21.41 9.83997 22 10.43 22 12.8Z",
stroke: "currentColor",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.5"
}
),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"path",
{
d: "M17.2445 18.25H17.2535",
stroke: "currentColor",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "2"
}
)
]
}
);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
MonitorMobileIcon
});
@@ -0,0 +1 @@
module.exports={C:{"44":0.00367,"48":0.00367,"65":0.00367,"66":0.00367,"88":0.00367,"113":0.00367,"115":0.04032,"127":0.00733,"128":0.00733,"141":0.00733,"142":0.00733,"143":0.28954,"144":0.33718,_:"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 45 46 47 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 114 116 117 118 119 120 121 122 123 124 125 126 129 130 131 132 133 134 135 136 137 138 139 140 145 146 147 3.5 3.6"},D:{"39":0.00367,"40":0.00367,"41":0.00367,"42":0.00367,"43":0.00367,"44":0.00367,"45":0.00367,"46":0.00367,"47":0.00367,"48":0.00367,"50":0.00367,"53":0.00367,"54":0.00367,"55":0.00367,"56":0.00733,"57":0.00367,"58":0.00367,"59":0.00367,"60":0.00367,"65":0.011,"66":0.00367,"69":0.00367,"71":0.00367,"74":0.00367,"77":0.00367,"78":0.00367,"80":0.00733,"81":0.00367,"83":0.00367,"86":0.01466,"88":0.05498,"92":0.00367,"95":0.00367,"96":0.00733,"98":0.00367,"103":0.00367,"104":0.00367,"106":0.00733,"109":0.41048,"110":0.00367,"111":0.08796,"112":0.00367,"114":0.02199,"115":0.00367,"116":0.00367,"119":0.011,"120":0.02566,"121":0.01466,"122":0.011,"123":0.02199,"124":0.00733,"125":1.29741,"126":0.01466,"127":0.02566,"128":0.01466,"129":0.00733,"130":0.02199,"131":0.011,"132":0.01833,"133":0.04032,"134":0.02566,"135":0.01833,"136":0.02199,"137":0.03665,"138":0.16493,"139":0.31519,"140":3.02729,"141":6.65198,"142":0.17592,"143":0.22723,_:"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 49 51 52 61 62 63 64 67 68 70 72 73 75 76 79 84 85 87 89 90 91 93 94 97 99 100 101 102 105 107 108 113 117 118 144 145"},F:{"40":0.00367,"79":0.00367,"91":0.03299,"92":0.28587,"95":0.18325,"100":0.01466,"113":0.00367,"120":0.09896,"121":0.011,"122":0.64504,_:"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 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 80 81 82 83 84 85 86 87 88 89 90 93 94 96 97 98 99 101 102 103 104 105 106 107 108 109 110 111 112 114 115 116 117 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.00733,"13":0.00367,"14":0.00367,"15":0.00367,"16":0.00367,"17":0.00733,"18":0.02932,"84":0.00733,"89":0.00367,"90":0.00367,"92":0.02932,"100":0.01833,"103":0.00367,"104":0.00367,"109":0.02932,"114":0.02566,"118":0.00733,"121":0.00367,"122":0.03299,"123":0.02932,"126":0.00367,"130":0.00733,"131":0.00733,"132":0.00367,"133":0.00367,"134":0.00733,"135":0.011,"136":0.00733,"137":0.02199,"138":0.10262,"139":0.05498,"140":0.85395,"141":2.99064,_:"79 80 81 83 85 86 87 88 91 93 94 95 96 97 98 99 101 102 105 106 107 108 110 111 112 113 115 116 117 119 120 124 125 127 128 129 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 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.1 17.2 17.3 17.4 17.5 18.0 18.1 18.3 18.4 26.2","13.1":0.01466,"15.6":0.01833,"16.6":0.04398,"17.6":0.04398,"18.2":0.00367,"18.5-18.6":0.011,"26.0":0.02199,"26.1":0.00367},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00029,"5.0-5.1":0,"6.0-6.1":0.00118,"7.0-7.1":0.00088,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00265,"10.0-10.2":0.00029,"10.3":0.005,"11.0-11.2":0.07406,"11.3-11.4":0.00176,"12.0-12.1":0.00059,"12.2-12.5":0.0144,"13.0-13.1":0,"13.2":0.00147,"13.3":0.00059,"13.4-13.7":0.00235,"14.0-14.4":0.005,"14.5-14.8":0.00529,"15.0-15.1":0.005,"15.2-15.3":0.00382,"15.4":0.00441,"15.5":0.005,"15.6-15.8":0.06525,"16.0":0.00882,"16.1":0.01646,"16.2":0.00852,"16.3":0.01528,"16.4":0.00382,"16.5":0.00676,"16.6-16.7":0.08729,"17.0":0.00617,"17.1":0.0094,"17.2":0.00676,"17.3":0.00999,"17.4":0.01763,"17.5":0.03027,"17.6-17.7":0.07641,"18.0":0.01734,"18.1":0.03586,"18.2":0.0194,"18.3":0.06231,"18.4":0.03203,"18.5-18.6":1.63348,"26.0":0.20191,"26.1":0.00735},P:{"4":0.1929,"22":0.04061,"23":0.01015,"24":0.1726,"25":0.16244,"26":0.12183,"27":0.16244,"28":1.94933,"29":0.16244,_:"20 21 5.0-5.4 8.2 10.1 14.0","6.2-6.4":0.01015,"7.2-7.4":0.3858,"9.2":0.01015,"11.1-11.2":0.02031,"12.0":0.01015,"13.0":0.01015,"15.0":0.01015,"16.0":0.01015,"17.0":0.01015,"18.0":0.01015,"19.0":0.04061},I:{"0":0.03163,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00002},K:{"0":3.40372,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.85028,_:"6 7 8 9 10 5.5"},S:{"2.5":0.00633,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.04434},Q:{"14.9":0.01267},O:{"0":0.34837},H:{"0":0.27},L:{"0":68.48356}};
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more