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

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

No files matched your search

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Union = Union;
const index_1 = require("../never/index");
const type_1 = require("../create/type");
const union_create_1 = require("./union-create");
/** `[Json]` Creates a Union type */
function Union(types, options) {
// prettier-ignore
return (types.length === 0 ? (0, index_1.Never)(options) :
types.length === 1 ? (0, type_1.CreateType)(types[0], options) :
(0, union_create_1.UnionCreate)(types, options));
}
@@ -0,0 +1,206 @@
import { StringType, UINT32_LE } from 'token-types';
import { decompressSync } from 'fflate';
import initDebug from 'debug';
import { DataDescriptor, EndOfCentralDirectoryRecordToken, FileHeader, LocalFileHeaderToken, Signature } from "./ZipToken.js";
function signatureToArray(signature) {
const signatureBytes = new Uint8Array(UINT32_LE.len);
UINT32_LE.put(signatureBytes, 0, signature);
return signatureBytes;
}
const debug = initDebug('tokenizer:inflate');
const syncBufferSize = 256 * 1024;
const ddSignatureArray = signatureToArray(Signature.DataDescriptor);
const eocdSignatureBytes = signatureToArray(Signature.EndOfCentralDirectory);
export class ZipHandler {
constructor(tokenizer) {
this.tokenizer = tokenizer;
this.syncBuffer = new Uint8Array(syncBufferSize);
}
async isZip() {
return await this.peekSignature() === Signature.LocalFileHeader;
}
peekSignature() {
return this.tokenizer.peekToken(UINT32_LE);
}
async findEndOfCentralDirectoryLocator() {
const randomReadTokenizer = this.tokenizer;
const chunkLength = Math.min(16 * 1024, randomReadTokenizer.fileInfo.size);
const buffer = this.syncBuffer.subarray(0, chunkLength);
await this.tokenizer.readBuffer(buffer, { position: randomReadTokenizer.fileInfo.size - chunkLength });
// Search the buffer from end to beginning for EOCD signature
// const signature = 0x06054b50;
for (let i = buffer.length - 4; i >= 0; i--) {
// Compare 4 bytes directly without calling readUInt32LE
if (buffer[i] === eocdSignatureBytes[0] &&
buffer[i + 1] === eocdSignatureBytes[1] &&
buffer[i + 2] === eocdSignatureBytes[2] &&
buffer[i + 3] === eocdSignatureBytes[3]) {
return randomReadTokenizer.fileInfo.size - chunkLength + i;
}
}
return -1;
}
async readCentralDirectory() {
if (!this.tokenizer.supportsRandomAccess()) {
debug('Cannot reading central-directory without random-read support');
return;
}
debug('Reading central-directory...');
const pos = this.tokenizer.position;
const offset = await this.findEndOfCentralDirectoryLocator();
if (offset > 0) {
debug('Central-directory 32-bit signature found');
const eocdHeader = await this.tokenizer.readToken(EndOfCentralDirectoryRecordToken, offset);
const files = [];
this.tokenizer.setPosition(eocdHeader.offsetOfStartOfCd);
for (let n = 0; n < eocdHeader.nrOfEntriesOfSize; ++n) {
const entry = await this.tokenizer.readToken(FileHeader);
if (entry.signature !== Signature.CentralFileHeader) {
throw new Error('Expected Central-File-Header signature');
}
entry.filename = await this.tokenizer.readToken(new StringType(entry.filenameLength, 'utf-8'));
await this.tokenizer.ignore(entry.extraFieldLength);
await this.tokenizer.ignore(entry.fileCommentLength);
files.push(entry);
debug(`Add central-directory file-entry: n=${n + 1}/${files.length}: filename=${files[n].filename}`);
}
this.tokenizer.setPosition(pos);
return files;
}
this.tokenizer.setPosition(pos);
}
async unzip(fileCb) {
const entries = await this.readCentralDirectory();
if (entries) {
// Use Central Directory to iterate over files
return this.iterateOverCentralDirectory(entries, fileCb);
}
// Scan Zip files for local-file-header
let stop = false;
do {
const zipHeader = await this.readLocalFileHeader();
if (!zipHeader)
break;
const next = fileCb(zipHeader);
stop = !!next.stop;
let fileData = undefined;
await this.tokenizer.ignore(zipHeader.extraFieldLength);
if (zipHeader.dataDescriptor && zipHeader.compressedSize === 0) {
const chunks = [];
let len = syncBufferSize;
debug('Compressed-file-size unknown, scanning for next data-descriptor-signature....');
let nextHeaderIndex = -1;
while (nextHeaderIndex < 0 && len === syncBufferSize) {
len = await this.tokenizer.peekBuffer(this.syncBuffer, { mayBeLess: true });
nextHeaderIndex = indexOf(this.syncBuffer.subarray(0, len), ddSignatureArray);
const size = nextHeaderIndex >= 0 ? nextHeaderIndex : len;
if (next.handler) {
const data = new Uint8Array(size);
await this.tokenizer.readBuffer(data);
chunks.push(data);
}
else {
// Move position to the next header if found, skip the whole buffer otherwise
await this.tokenizer.ignore(size);
}
}
debug(`Found data-descriptor-signature at pos=${this.tokenizer.position}`);
if (next.handler) {
await this.inflate(zipHeader, mergeArrays(chunks), next.handler);
}
}
else {
if (next.handler) {
debug(`Reading compressed-file-data: ${zipHeader.compressedSize} bytes`);
fileData = new Uint8Array(zipHeader.compressedSize);
await this.tokenizer.readBuffer(fileData);
await this.inflate(zipHeader, fileData, next.handler);
}
else {
debug(`Ignoring compressed-file-data: ${zipHeader.compressedSize} bytes`);
await this.tokenizer.ignore(zipHeader.compressedSize);
}
}
debug(`Reading data-descriptor at pos=${this.tokenizer.position}`);
if (zipHeader.dataDescriptor) {
// await this.tokenizer.ignore(DataDescriptor.len);
const dataDescriptor = await this.tokenizer.readToken(DataDescriptor);
if (dataDescriptor.signature !== 0x08074b50) {
throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position - DataDescriptor.len}`);
}
}
} while (!stop);
}
async iterateOverCentralDirectory(entries, fileCb) {
for (const fileHeader of entries) {
const next = fileCb(fileHeader);
if (next.handler) {
this.tokenizer.setPosition(fileHeader.relativeOffsetOfLocalHeader);
const zipHeader = await this.readLocalFileHeader();
if (zipHeader) {
await this.tokenizer.ignore(zipHeader.extraFieldLength);
const fileData = new Uint8Array(fileHeader.compressedSize);
await this.tokenizer.readBuffer(fileData);
await this.inflate(zipHeader, fileData, next.handler);
}
}
if (next.stop)
break;
}
}
inflate(zipHeader, fileData, cb) {
if (zipHeader.compressedMethod === 0) {
return cb(fileData);
}
debug(`Decompress filename=${zipHeader.filename}, compressed-size=${fileData.length}`);
const uncompressedData = decompressSync(fileData);
return cb(uncompressedData);
}
async readLocalFileHeader() {
const signature = await this.tokenizer.peekToken(UINT32_LE);
if (signature === Signature.LocalFileHeader) {
const header = await this.tokenizer.readToken(LocalFileHeaderToken);
header.filename = await this.tokenizer.readToken(new StringType(header.filenameLength, 'utf-8'));
return header;
}
if (signature === Signature.CentralFileHeader) {
return false;
}
if (signature === 0xE011CFD0) {
throw new Error('Encrypted ZIP');
}
throw new Error('Unexpected signature');
}
}
function indexOf(buffer, portion) {
const bufferLength = buffer.length;
const portionLength = portion.length;
// Return -1 if the portion is longer than the buffer
if (portionLength > bufferLength)
return -1;
// Search for the portion in the buffer
for (let i = 0; i <= bufferLength - portionLength; i++) {
let found = true;
for (let j = 0; j < portionLength; j++) {
if (buffer[i + j] !== portion[j]) {
found = false;
break;
}
}
if (found) {
return i; // Return the starting offset
}
}
return -1; // Not found
}
function mergeArrays(chunks) {
// Concatenate chunks into a single Uint8Array
const totalLength = chunks.reduce((acc, curr) => acc + curr.length, 0);
const mergedArray = new Uint8Array(totalLength);
let offset = 0;
for (const chunk of chunks) {
mergedArray.set(chunk, offset);
offset += chunk.length;
}
return mergedArray;
}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=BaseResolvedValueElementMetadata.js.map
@@ -0,0 +1,74 @@
{
"name": "winston",
"description": "A logger for just about everything.",
"version": "3.18.3",
"author": "Charlie Robbins <charlie.robbins@gmail.com>",
"maintainers": [
"David Hyde <dabh@alumni.stanford.edu>"
],
"repository": {
"type": "git",
"url": "https://github.com/winstonjs/winston.git"
},
"keywords": [
"winston",
"logger",
"logging",
"logs",
"sysadmin",
"bunyan",
"pino",
"loglevel",
"tools",
"json",
"stream"
],
"dependencies": {
"@dabh/diagnostics": "^2.0.8",
"@colors/colors": "^1.6.0",
"async": "^3.2.3",
"is-stream": "^2.0.0",
"logform": "^2.7.0",
"one-time": "^1.0.0",
"readable-stream": "^3.4.0",
"safe-stable-stringify": "^2.3.1",
"stack-trace": "0.0.x",
"triple-beam": "^1.3.0",
"winston-transport": "^4.9.0"
},
"devDependencies": {
"@babel/cli": "^7.23.9",
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@dabh/eslint-config-populist": "^4.4.0",
"@types/node": "^20.11.24",
"abstract-winston-transport": "^0.5.1",
"assume": "^2.2.0",
"cross-spawn-async": "^2.2.5",
"eslint": "^8.57.0",
"hock": "^1.4.1",
"mocha": "^10.3.0",
"nyc": "^17.1.0",
"rimraf": "5.0.1",
"split2": "^4.1.0",
"std-mocks": "^2.0.0",
"through2": "^4.0.2",
"winston-compat": "^0.1.5"
},
"main": "./lib/winston.js",
"browser": "./dist/winston",
"types": "./index.d.ts",
"scripts": {
"lint": "eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist",
"test": "rimraf test/fixtures/logs/* && mocha",
"test:coverage": "nyc npm run test:unit",
"test:unit": "mocha test/unit",
"test:integration": "mocha test/integration",
"build": "rimraf dist && babel lib -d dist",
"prepublishOnly": "npm run build"
},
"engines": {
"node": ">= 12.0.0"
},
"license": "MIT"
}
@@ -0,0 +1,77 @@
/*! *****************************************************************************
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"/>
/// <reference lib="es2018.asynciterable" />
interface AsyncGenerator<T = unknown, TReturn = any, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
next(...[value]: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
return(value: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;
throw(e: any): Promise<IteratorResult<T, TReturn>>;
[Symbol.asyncIterator](): AsyncGenerator<T, TReturn, TNext>;
}
interface AsyncGeneratorFunction {
/**
* Creates a new AsyncGenerator object.
* @param args A list of arguments the function accepts.
*/
new (...args: any[]): AsyncGenerator;
/**
* Creates a new AsyncGenerator object.
* @param args A list of arguments the function accepts.
*/
(...args: any[]): AsyncGenerator;
/**
* The length of the arguments.
*/
readonly length: number;
/**
* Returns the name of the function.
*/
readonly name: string;
/**
* A reference to the prototype.
*/
readonly prototype: AsyncGenerator;
}
interface AsyncGeneratorFunctionConstructor {
/**
* Creates a new AsyncGenerator function.
* @param args A list of arguments the function accepts.
*/
new (...args: string[]): AsyncGeneratorFunction;
/**
* Creates a new AsyncGenerator function.
* @param args A list of arguments the function accepts.
*/
(...args: string[]): AsyncGeneratorFunction;
/**
* The length of the arguments.
*/
readonly length: number;
/**
* Returns the name of the function.
*/
readonly name: string;
/**
* A reference to the prototype.
*/
readonly prototype: AsyncGeneratorFunction;
}
@@ -0,0 +1,117 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "harf", verb: "olmalıdır" },
file: { unit: "bayt", verb: "olmalıdır" },
array: { unit: "unsur", verb: "olmalıdır" },
set: { unit: "unsur", verb: "olmalıdır" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "numara";
}
case "object": {
if (Array.isArray(data)) {
return "saf";
}
if (data === null) {
return "gayb";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "giren",
email: "epostagâh",
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: "ISO hengâmı",
date: "ISO tarihi",
time: "ISO zamanı",
duration: "ISO müddeti",
ipv4: "IPv4 nişânı",
ipv6: "IPv6 nişânı",
cidrv4: "IPv4 menzili",
cidrv6: "IPv6 menzili",
base64: "base64-şifreli metin",
base64url: "base64url-şifreli metin",
json_string: "JSON metin",
e164: "E.164 sayısı",
jwt: "JWT",
template_literal: "giren",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Fâsit giren: umulan ${issue.expected}, alınan ${parsedType(issue.input)}`;
// return `Fâsit giren: umulan ${issue.expected}, alınan ${util.getParsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Fâsit giren: umulan ${util.stringifyPrimitive(issue.values[0])}`;
return `Fâsit tercih: mûteberler ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Fazla büyük: ${issue.origin ?? "value"}, ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"} sahip olmalıydı.`;
return `Fazla büyük: ${issue.origin ?? "value"}, ${adj}${issue.maximum.toString()} olmalıydı.`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Fazla küçük: ${issue.origin}, ${adj}${issue.minimum.toString()} ${sizing.unit} sahip olmalıydı.`;
}
return `Fazla küçük: ${issue.origin}, ${adj}${issue.minimum.toString()} olmalıydı.`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Fâsit metin: "${_issue.prefix}" ile başlamalı.`;
if (_issue.format === "ends_with")
return `Fâsit metin: "${_issue.suffix}" ile bitmeli.`;
if (_issue.format === "includes")
return `Fâsit metin: "${_issue.includes}" ihtivâ etmeli.`;
if (_issue.format === "regex")
return `Fâsit metin: ${_issue.pattern} nakşına uymalı.`;
return `Fâsit ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Fâsit sayı: ${issue.divisor} katı olmalıydı.`;
case "unrecognized_keys":
return `Tanınmayan anahtar ${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `${issue.origin} için tanınmayan anahtar var.`;
case "invalid_union":
return "Giren tanınamadı.";
case "invalid_element":
return `${issue.origin} için tanınmayan kıymet var.`;
default:
return `Kıymet tanınamadı.`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1,52 @@
'use strict';
exports.__esModule = true;
const log = require('debug')('eslint-module-utils:ModuleCache');
/** @type {import('./ModuleCache').ModuleCache} */
class ModuleCache {
/** @param {typeof import('./ModuleCache').ModuleCache.prototype.map} map */
constructor(map) {
this.map = map || /** @type {{typeof import('./ModuleCache').ModuleCache.prototype.map} */ new Map();
}
/** @type {typeof import('./ModuleCache').ModuleCache.prototype.set} */
set(cacheKey, result) {
this.map.set(cacheKey, { result, lastSeen: process.hrtime() });
log('setting entry for', cacheKey);
return result;
}
/** @type {typeof import('./ModuleCache').ModuleCache.prototype.get} */
get(cacheKey, settings) {
if (this.map.has(cacheKey)) {
const f = this.map.get(cacheKey);
// check freshness
// @ts-expect-error TS can't narrow properly from `has` and `get`
if (process.hrtime(f.lastSeen)[0] < settings.lifetime) { return f.result; }
} else {
log('cache miss for', cacheKey);
}
// cache miss
return undefined;
}
/** @type {typeof import('./ModuleCache').ModuleCache.getSettings} */
static getSettings(settings) {
/** @type {ReturnType<typeof ModuleCache.getSettings>} */
const cacheSettings = Object.assign({
lifetime: 30, // seconds
}, settings['import/cache']);
// parse infinity
// @ts-expect-error the lack of type overlap is because we're abusing `cacheSettings` as a temporary object
if (cacheSettings.lifetime === '∞' || cacheSettings.lifetime === 'Infinity') {
cacheSettings.lifetime = Infinity;
}
return cacheSettings;
}
}
exports.default = ModuleCache;
@@ -0,0 +1,33 @@
{
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
"name": "minimatch",
"description": "a glob matcher in javascript",
"version": "3.1.2",
"publishConfig": {
"tag": "v3-legacy"
},
"repository": {
"type": "git",
"url": "git://github.com/isaacs/minimatch.git"
},
"main": "minimatch.js",
"scripts": {
"test": "tap",
"preversion": "npm test",
"postversion": "npm publish",
"postpublish": "git push origin --all; git push origin --tags"
},
"engines": {
"node": "*"
},
"dependencies": {
"brace-expansion": "^1.1.7"
},
"devDependencies": {
"tap": "^15.1.6"
},
"license": "ISC",
"files": [
"minimatch.js"
]
}
@@ -0,0 +1,45 @@
'use strict';
var tape = require('tape');
var path = require('../');
var windowsTests =
// arguments result
[[['c:/blah\\blah', 'd:/games', 'c:../a'], 'c:\\blah\\a'],
[['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'], 'd:\\e.exe'],
[['c:/ignore', 'c:/some/file'], 'c:\\some\\file'],
[['d:/ignore', 'd:some/dir//'], 'd:\\ignore\\some\\dir'],
[['.'], process.cwd()],
[['//server/share', '..', 'relative\\'], '\\\\server\\share\\relative'],
[['c:/', '//'], 'c:\\'],
[['c:/', '//dir'], 'c:\\dir'],
[['c:/', '//server/share'], '\\\\server\\share\\'],
[['c:/', '//server//share'], '\\\\server\\share\\'],
[['c:/', '///some//dir'], 'c:\\some\\dir'],
[['C:\\foo\\tmp.3\\', '..\\tmp.3\\cycles\\root.js'],
'C:\\foo\\tmp.3\\cycles\\root.js']
];
var posixTests =
// arguments result
[[['/var/lib', '../', 'file/'], '/var/file'],
[['/var/lib', '/../', 'file/'], '/file'],
[['a/b/c/', '../../..'], process.cwd()],
[['.'], process.cwd()],
[['/some/dir', '.', '/absolute/'], '/absolute'],
[['/foo/tmp.3/', '../tmp.3/cycles/root.js'], '/foo/tmp.3/cycles/root.js']
];
tape('path.posix.resolve', function (t) {
posixTests.forEach(function (p) {
var actual = path.posix.resolve.apply(null, p[0]);
t.strictEqual(actual, p[1]);
});
t.end();
});
tape('path.win32.resolve', { skip: true }, function (t) {
windowsTests.forEach(function (p) {
var actual = path.win32.resolve.apply(null, p[0]);
t.strictEqual(actual, p[1]);
});
t.end();
});
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2014 Artem Medeusheyev
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,6 @@
"use strict";
const daysOfYear = require("./daysOfYear-Bif7I3Cq.js");
function daysInMonth(date) {
return daysOfYear.daysOfYear(date.getFullYear())[date.getMonth()];
}
module.exports = daysInMonth;
@@ -0,0 +1 @@
{"mappings":";;;;;;AAgBA;;GAEG;AACH,sBAAsB,YAAY,EAAE,MAAM,GAAG,OAAO,CAuBnD;ACzBD;IACE,wFAAwF;IACxF,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,SAAS,EAAE,SAAS,CAAA;CACrB;ACND;IACE,oDAAoD;IACpD,QAAQ,EAAE,SAAS,CAAC;IACpB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AA2CD;;GAEG;AACH,6BAA6B,KAAK,EAAE,iBAAiB,GAAG,IAAI,OAAO,CAUlE;AAED;;GAEG;AACH,6BAA6B,MAAM,CAIlC;ACtED,4BAA4B,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAC,KAAK,MAAM,CAAC;AAatF;;;;;GAKG;AACH,oCAAoC,OAAO,EAAE,gBAAgB,GAAG,aAAa,CAK5E;ACbD;;GAEG;AACH,6CAA6C,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,eAAe,GAAG,MAAM,EAAE,OAAO,EAAE,mBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,0BAA0B,CAAC,EAAE,CAAC,CAAC,CAElM;AAED;;;;GAIG;AACH,4CAA4C,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,eAAe,GAAG,MAAM,EAAE,OAAO,EAAE,mBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,yBAAyB,CAAC,EAAE,CAAC,CAAC,CAIhM;AC5BD;;;;GAIG;AACH,iCAAiC,OAAO,GAAE,KAAK,iBAAsB,GAAG,KAAK,UAAU,CAGtF;ACND,qCAAsC,SAAQ,IAAI,CAAC,qBAAqB;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;GAIG;AACH,iCAAiC,OAAO,CAAC,EAAE,oBAAoB,GAAG,aAAa,CAK9E;ACfD;;;;GAIG;AACH,mCAAmC,OAAO,GAAE,mBAAwB,GAAG,KAAK,YAAY,CAGvF;ACRD;;;;GAIG;AACH,4BAA4B,OAAO,CAAC,EAAE,KAAK,eAAe,GAAG,KAAK,QAAQ,CAWzE;ACjBD;IACE,8DAA8D;IAC9D,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACvD,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACrD,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAA;CACrD;AAED;;;GAGG;AACH,0BAA0B,OAAO,CAAC,EAAE,KAAK,eAAe,GAAG,MAAM,CAsDhE;AC3DD,YAAY,EAAC,wBAAwB,EAAC,MAAM,2BAA2B,CAAC;AAGxE,YAAY,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AAEjE,YAAY,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC","sources":["packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/utils.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useDefaultLocale.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/context.tsx","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useMessageFormatter.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useLocalizedStringFormatter.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useListFormatter.tsx","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useDateFormatter.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useNumberFormatter.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useCollator.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useFilter.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/index.ts","packages/@react-aria/i18n/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {I18nProvider, useLocale} from './context';\nexport {useMessageFormatter} from './useMessageFormatter';\nexport {useLocalizedStringFormatter, useLocalizedStringDictionary} from './useLocalizedStringFormatter';\nexport {useListFormatter} from './useListFormatter';\nexport {useDateFormatter} from './useDateFormatter';\nexport {useNumberFormatter} from './useNumberFormatter';\nexport {useCollator} from './useCollator';\nexport {useFilter} from './useFilter';\nexport {isRTL} from './utils';\n\nexport type {FormatMessage} from './useMessageFormatter';\nexport type {LocalizedStringFormatter} from '@internationalized/string';\nexport type {I18nProviderProps} from './context';\nexport type {Locale} from './useDefaultLocale';\nexport type {LocalizedStrings} from '@internationalized/message';\nexport type {DateFormatterOptions} from './useDateFormatter';\nexport type {DateFormatter} from '@internationalized/date';\nexport type {Filter} from './useFilter';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -0,0 +1,258 @@
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {createContext, useContext, useEffect, useMemo, useRef, useState} from 'react';
import {Validation, ValidationErrors, ValidationFunction, ValidationResult} from '@react-types/shared';
export const VALID_VALIDITY_STATE: ValidityState = {
badInput: false,
customError: false,
patternMismatch: false,
rangeOverflow: false,
rangeUnderflow: false,
stepMismatch: false,
tooLong: false,
tooShort: false,
typeMismatch: false,
valueMissing: false,
valid: true
};
const CUSTOM_VALIDITY_STATE: ValidityState = {
...VALID_VALIDITY_STATE,
customError: true,
valid: false
};
export const DEFAULT_VALIDATION_RESULT: ValidationResult = {
isInvalid: false,
validationDetails: VALID_VALIDITY_STATE,
validationErrors: []
};
export const FormValidationContext = createContext<ValidationErrors>({});
export const privateValidationStateProp = '__formValidationState' + Date.now();
interface FormValidationProps<T> extends Validation<T> {
builtinValidation?: ValidationResult,
name?: string | string[],
value: T | null
}
export interface FormValidationState {
/** Realtime validation results, updated as the user edits the value. */
realtimeValidation: ValidationResult,
/** Currently displayed validation results, updated when the user commits their changes. */
displayValidation: ValidationResult,
/** Updates the current validation result. Not displayed to the user until `commitValidation` is called. */
updateValidation(result: ValidationResult): void,
/** Resets the displayed validation state to valid when the user resets the form. */
resetValidation(): void,
/** Commits the realtime validation so it is displayed to the user. */
commitValidation(): void
}
export function useFormValidationState<T>(props: FormValidationProps<T>): FormValidationState {
// Private prop for parent components to pass state to children.
if (props[privateValidationStateProp]) {
let {realtimeValidation, displayValidation, updateValidation, resetValidation, commitValidation} = props[privateValidationStateProp] as FormValidationState;
return {realtimeValidation, displayValidation, updateValidation, resetValidation, commitValidation};
}
// eslint-disable-next-line react-hooks/rules-of-hooks
return useFormValidationStateImpl(props);
}
function useFormValidationStateImpl<T>(props: FormValidationProps<T>): FormValidationState {
let {isInvalid, validationState, name, value, builtinValidation, validate, validationBehavior = 'aria'} = props;
// backward compatibility.
if (validationState) {
isInvalid ||= validationState === 'invalid';
}
// If the isInvalid prop is controlled, update validation result in realtime.
let controlledError: ValidationResult | null = isInvalid !== undefined ? {
isInvalid,
validationErrors: [],
validationDetails: CUSTOM_VALIDITY_STATE
} : null;
// Perform custom client side validation.
let clientError: ValidationResult | null = useMemo(() => {
if (!validate || value == null) {
return null;
}
let validateErrors = runValidate(validate, value);
return getValidationResult(validateErrors);
}, [validate, value]);
if (builtinValidation?.validationDetails.valid) {
builtinValidation = undefined;
}
// Get relevant server errors from the form.
let serverErrors = useContext(FormValidationContext);
let serverErrorMessages = useMemo(() => {
if (name) {
return Array.isArray(name) ? name.flatMap(name => asArray(serverErrors[name])) : asArray(serverErrors[name]);
}
return [];
}, [serverErrors, name]);
// Show server errors when the form gets a new value, and clear when the user changes the value.
let [lastServerErrors, setLastServerErrors] = useState(serverErrors);
let [isServerErrorCleared, setServerErrorCleared] = useState(false);
if (serverErrors !== lastServerErrors) {
setLastServerErrors(serverErrors);
setServerErrorCleared(false);
}
let serverError: ValidationResult | null = useMemo(() =>
getValidationResult(isServerErrorCleared ? [] : serverErrorMessages),
[isServerErrorCleared, serverErrorMessages]
);
// Track the next validation state in a ref until commitValidation is called.
let nextValidation = useRef(DEFAULT_VALIDATION_RESULT);
let [currentValidity, setCurrentValidity] = useState(DEFAULT_VALIDATION_RESULT);
let lastError = useRef(DEFAULT_VALIDATION_RESULT);
let commitValidation = () => {
if (!commitQueued) {
return;
}
setCommitQueued(false);
let error = clientError || builtinValidation || nextValidation.current;
if (!isEqualValidation(error, lastError.current)) {
lastError.current = error;
setCurrentValidity(error);
}
};
let [commitQueued, setCommitQueued] = useState(false);
useEffect(commitValidation);
// realtimeValidation is used to update the native input element's state based on custom validation logic.
// displayValidation is the currently displayed validation state that the user sees (e.g. on input change/form submit).
// With validationBehavior="aria", all errors are displayed in realtime rather than on submit.
let realtimeValidation = controlledError || serverError || clientError || builtinValidation || DEFAULT_VALIDATION_RESULT;
let displayValidation = validationBehavior === 'native'
? controlledError || serverError || currentValidity
: controlledError || serverError || clientError || builtinValidation || currentValidity;
return {
realtimeValidation,
displayValidation,
updateValidation(value) {
// If validationBehavior is 'aria', update in realtime. Otherwise, store in a ref until commit.
if (validationBehavior === 'aria' && !isEqualValidation(currentValidity, value)) {
setCurrentValidity(value);
} else {
nextValidation.current = value;
}
},
resetValidation() {
// Update the currently displayed validation state to valid on form reset,
// even if the native validity says it isn't. It'll show again on the next form submit.
let error = DEFAULT_VALIDATION_RESULT;
if (!isEqualValidation(error, lastError.current)) {
lastError.current = error;
setCurrentValidity(error);
}
// Do not commit validation after the next render. This avoids a condition where
// useSelect calls commitValidation inside an onReset handler.
if (validationBehavior === 'native') {
setCommitQueued(false);
}
setServerErrorCleared(true);
},
commitValidation() {
// Commit validation state so the user sees it on blur/change/submit. Also clear any server errors.
// Wait until after the next render to commit so that the latest value has been validated.
if (validationBehavior === 'native') {
setCommitQueued(true);
}
setServerErrorCleared(true);
}
};
}
function asArray<T>(v: T | T[]): T[] {
if (!v) {
return [];
}
return Array.isArray(v) ? v : [v];
}
function runValidate<T>(validate: ValidationFunction<T>, value: T): string[] {
if (typeof validate === 'function') {
let e = validate(value);
if (e && typeof e !== 'boolean') {
return asArray(e);
}
}
return [];
}
function getValidationResult(errors: string[]): ValidationResult | null {
return errors.length ? {
isInvalid: true,
validationErrors: errors,
validationDetails: CUSTOM_VALIDITY_STATE
} : null;
}
function isEqualValidation(a: ValidationResult | null, b: ValidationResult | null): boolean {
if (a === b) {
return true;
}
return !!a && !!b
&& a.isInvalid === b.isInvalid
&& a.validationErrors.length === b.validationErrors.length
&& a.validationErrors.every((a, i) => a === b.validationErrors[i])
&& Object.entries(a.validationDetails).every(([k, v]) => b.validationDetails[k] === v);
}
export function mergeValidation(...results: ValidationResult[]): ValidationResult {
let errors = new Set<string>();
let isInvalid = false;
let validationDetails = {
...VALID_VALIDITY_STATE
};
for (let v of results) {
for (let e of v.validationErrors) {
errors.add(e);
}
// Only these properties apply for checkboxes.
isInvalid ||= v.isInvalid;
for (let key in validationDetails) {
validationDetails[key] ||= v.validationDetails[key];
}
}
validationDetails.valid = !isInvalid;
return {
isInvalid,
validationErrors: [...errors],
validationDetails
};
}
@@ -0,0 +1,58 @@
const { buildOptions} = require("./OptionsBuilder");
const OrderedObjParser = require("./OrderedObjParser");
const { prettify} = require("./node2json");
const validator = require('../validator');
class XMLParser{
constructor(options){
this.externalEntities = {};
this.options = buildOptions(options);
}
/**
* Parse XML dats to JS object
* @param {string|Buffer} xmlData
* @param {boolean|Object} validationOption
*/
parse(xmlData,validationOption){
if(typeof xmlData === "string"){
}else if( xmlData.toString){
xmlData = xmlData.toString();
}else{
throw new Error("XML data is accepted in String or Bytes[] form.")
}
if( validationOption){
if(validationOption === true) validationOption = {}; //validate with default options
const result = validator.validate(xmlData, validationOption);
if (result !== true) {
throw Error( `${result.err.msg}:${result.err.line}:${result.err.col}` )
}
}
const orderedObjParser = new OrderedObjParser(this.options);
orderedObjParser.addExternalEntities(this.externalEntities);
const orderedResult = orderedObjParser.parseXml(xmlData);
if(this.options.preserveOrder || orderedResult === undefined) return orderedResult;
else return prettify(orderedResult, this.options);
}
/**
* Add Entity which is not by default supported by this library
* @param {string} key
* @param {string} value
*/
addEntity(key, value){
if(value.indexOf("&") !== -1){
throw new Error("Entity value can't have '&'")
}else if(key.indexOf("&") !== -1 || key.indexOf(";") !== -1){
throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'")
}else if(value === "&"){
throw new Error("An entity with value '&' is not permitted");
}else{
this.externalEntities[key] = value;
}
}
}
module.exports = XMLParser;
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,CAAC,4BAAmB,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IAChF,qBAAqB,CAAC,sEAA2C,CAAC;IAClE,UAAU,CAAC,YAAM,CAAC;IAClB,eAAe,CAAC,sCAAuB,CAAC;IACxC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,qCAAsB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,yBAAgB,CAAC;YAAE,OAAO,IAAM,CAAC,wCAAyB,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,GAAG;QAAA,GAAG,CAAC,CAAC;IACjP,gBAAgB,CAAC,OAAS,CAAC,0BAAiB,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;AAC5D","sources":["packages/@react-aria/grid/intl/sk-SK.json"],"sourcesContent":["{\n \"deselectedItem\": \"Nevybraté položky: {item}.\",\n \"longPressToSelect\": \"Dlhším stlačením prejdite do režimu výberu.\",\n \"select\": \"Vybrať\",\n \"selectedAll\": \"Všetky vybraté položky.\",\n \"selectedCount\": \"{count, plural, =0 {Žiadne vybraté položky} one {# vybratá položka} other {Počet vybratých položiek:#}}.\",\n \"selectedItem\": \"Vybraté položky: {item}.\"\n}\n"],"names":[],"version":3,"file":"sk-SK.main.js.map"}
@@ -0,0 +1,46 @@
import { retry, type RetryOptions } from '@internal/query/retry'
import {
fetchBaseQuery,
type FetchBaseQueryError,
type FetchBaseQueryMeta,
} from '@internal/query/fetchBaseQuery'
describe('type tests', () => {
test('RetryOptions only accepts one of maxRetries or retryCondition', () => {
// Should not complain if only `maxRetries` exists
expectTypeOf({ maxRetries: 5 }).toMatchTypeOf<RetryOptions>()
// Should not complain if only `retryCondition` exists
expectTypeOf({ retryCondition: () => false }).toMatchTypeOf<RetryOptions>()
// Should complain if both `maxRetries` and `retryCondition` exist at once
expectTypeOf({
maxRetries: 5,
retryCondition: () => false,
}).not.toMatchTypeOf<RetryOptions>()
})
test('fail can be pretyped to only accept correct error and meta', () => {
expectTypeOf(retry.fail).parameter(0).toEqualTypeOf<unknown>()
expectTypeOf(retry.fail).parameter(1).toEqualTypeOf<{} | undefined>()
expectTypeOf(retry.fail).toBeCallableWith('Literally anything', {})
const myBaseQuery = fetchBaseQuery()
const typedFail = retry.fail<typeof myBaseQuery>
expectTypeOf(typedFail).parameter(0).toMatchTypeOf<FetchBaseQueryError>()
expectTypeOf(typedFail)
.parameter(1)
.toMatchTypeOf<FetchBaseQueryMeta | undefined>()
expectTypeOf(typedFail).toBeCallableWith(
{
status: 401,
data: 'Unauthorized',
},
{ request: new Request('http://localhost') },
)
expectTypeOf(typedFail).parameter(0).not.toMatchTypeOf<string>()
expectTypeOf(typedFail).parameter(1).not.toMatchTypeOf<{}>()
})
})
@@ -0,0 +1,58 @@
import { __read, __spreadArray } from "tslib";
import debounce from 'lodash/debounce';
import { useEffect, useMemo, useRef } from 'react';
var useDebouncePlugin = function (fetchInstance, _a) {
var debounceWait = _a.debounceWait, debounceLeading = _a.debounceLeading, debounceTrailing = _a.debounceTrailing, debounceMaxWait = _a.debounceMaxWait;
var debouncedRef = useRef(undefined);
var options = useMemo(function () {
var ret = {};
if (debounceLeading !== undefined) {
ret.leading = debounceLeading;
}
if (debounceTrailing !== undefined) {
ret.trailing = debounceTrailing;
}
if (debounceMaxWait !== undefined) {
ret.maxWait = debounceMaxWait;
}
return ret;
}, [debounceLeading, debounceTrailing, debounceMaxWait]);
useEffect(function () {
if (debounceWait) {
var _originRunAsync_1 = fetchInstance.runAsync.bind(fetchInstance);
debouncedRef.current = debounce(function (callback) {
callback();
}, debounceWait, options);
// debounce runAsync should be promise
// https://github.com/lodash/lodash/issues/4400#issuecomment-834800398
fetchInstance.runAsync = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return new Promise(function (resolve, reject) {
var _a;
(_a = debouncedRef.current) === null || _a === void 0 ? void 0 : _a.call(debouncedRef, function () {
_originRunAsync_1.apply(void 0, __spreadArray([], __read(args), false)).then(resolve)
.catch(reject);
});
});
};
return function () {
var _a;
(_a = debouncedRef.current) === null || _a === void 0 ? void 0 : _a.cancel();
fetchInstance.runAsync = _originRunAsync_1;
};
}
}, [debounceWait, options]);
if (!debounceWait) {
return {};
}
return {
onCancel: function () {
var _a;
(_a = debouncedRef.current) === null || _a === void 0 ? void 0 : _a.cancel();
},
};
};
export default useDebouncePlugin;
@@ -0,0 +1,27 @@
'use strict';
const tar = require('../tar');
const gzip = require('../gzip');
const BaseStream = require('../base_stream');
class TgzStream extends BaseStream {
constructor(opts) {
super(opts);
const tarStream = this._tarStream = new tar.Stream();
tarStream.on('error', err => this.emit('error', err));
const gzipStream = new gzip.FileStream();
gzipStream.on('end', () => this.push(null));
gzipStream.on('data', chunk => this.push(chunk));
gzipStream.on('error', err => this.emit('error', err));
tarStream.pipe(gzipStream);
}
addEntry(entry, opts) {
this._tarStream.addEntry(entry, opts);
}
}
module.exports = TgzStream;
@@ -0,0 +1,4 @@
'use strict';
// TODO, semver-major: delete
module.exports = require('math-intrinsics/isFinite');
@@ -0,0 +1,33 @@
{
"name": "buffer-to-vinyl",
"version": "1.1.0",
"description": "Create a vinyl file or stream from a buffer",
"license": "MIT",
"repository": "kevva/buffer-to-vinyl",
"author": {
"name": "Kevin Mårtensson",
"email": "kevinmartensson@gmail.com",
"url": "https://github.com/kevva"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "xo && node test.js"
},
"files": [
"index.js"
],
"keywords": [],
"dependencies": {
"file-type": "^3.1.0",
"readable-stream": "^2.0.2",
"uuid": "^2.0.1",
"vinyl": "^1.0.0"
},
"devDependencies": {
"ava": "^0.0.4",
"concat-stream": "^1.4.7",
"xo": "*"
}
}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=isBindingConstraintsWithName.spec.d.ts.map
@@ -0,0 +1 @@
{"version":3,"names":["_readOnlyError","name","TypeError"],"sources":["../../src/helpers/readOnlyError.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _readOnlyError(name: string) {\n throw new TypeError('\"' + name + '\" is read-only');\n}\n"],"mappings":";;;;;;AAEe,SAASA,cAAcA,CAACC,IAAY,EAAE;EACnD,MAAM,IAAIC,SAAS,CAAC,GAAG,GAAGD,IAAI,GAAG,gBAAgB,CAAC;AACpD","ignoreList":[]}
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _objectWithoutPropertiesLoose;
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
if (excluded.indexOf(key) !== -1) continue;
target[key] = source[key];
}
}
return target;
}
//# sourceMappingURL=objectWithoutPropertiesLoose.js.map
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,4BAAiB;IACf,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;AACX","sources":["packages/@react-aria/menu/src/*.js"],"sourcesContent":["const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}"],"names":[],"version":3,"file":"intlStrings.module.js.map"}
@@ -0,0 +1 @@
{"version":3,"file":"index.unpkg.umd.js","sources":["../src/guard.ts","../src/ColorError.ts","../src/parseToRgba.ts","../src/parseToHsla.ts","../src/hsla.ts","../src/adjustHue.ts","../src/darken.ts","../src/desaturate.ts","../src/getLuminance.ts","../src/getContrast.ts","../src/rgba.ts","../src/mix.ts","../src/getScale.ts","../src/hasBadContrast.ts","../src/lighten.ts","../src/transparentize.ts","../src/opacify.ts","../src/readableColorIsBlack.ts","../src/readableColor.ts","../src/saturate.ts","../src/toHex.ts","../src/toRgba.ts","../src/toHsla.ts"],"sourcesContent":["/**\n * A simple guard function:\n *\n * ```js\n * Math.min(Math.max(low, value), high)\n * ```\n */\nfunction guard(low: number, high: number, value: number): number {\n return Math.min(Math.max(low, value), high);\n}\n\nexport default guard;\n","class ColorError extends Error {\n constructor(color: string) {\n super(`Failed to parse color: \"${color}\"`);\n }\n}\n\nexport default ColorError;\n","import guard from './guard';\nimport ColorError from './ColorError';\n\n/**\n * Parses a color into red, gree, blue, alpha parts\n *\n * @param color the input color. Can be a RGB, RBGA, HSL, HSLA, or named color\n */\nfunction parseToRgba(color: string): [number, number, number, number] {\n if (typeof color !== 'string') throw new ColorError(color);\n if (color.trim().toLowerCase() === 'transparent') return [0, 0, 0, 0];\n\n let normalizedColor = color.trim();\n normalizedColor = namedColorRegex.test(color) ? nameToHex(color) : color;\n\n const reducedHexMatch = reducedHexRegex.exec(normalizedColor);\n if (reducedHexMatch) {\n const arr = Array.from(reducedHexMatch).slice(1);\n return [\n ...arr.slice(0, 3).map((x) => parseInt(r(x, 2), 16)),\n parseInt(r(arr[3] || 'f', 2), 16) / 255,\n ] as [number, number, number, number];\n }\n\n const hexMatch = hexRegex.exec(normalizedColor);\n if (hexMatch) {\n const arr = Array.from(hexMatch).slice(1);\n return [\n ...arr.slice(0, 3).map((x) => parseInt(x, 16)),\n parseInt(arr[3] || 'ff', 16) / 255,\n ] as [number, number, number, number];\n }\n\n const rgbaMatch = rgbaRegex.exec(normalizedColor);\n if (rgbaMatch) {\n const arr = Array.from(rgbaMatch).slice(1);\n return [\n ...arr.slice(0, 3).map((x) => parseInt(x, 10)),\n parseFloat(arr[3] || '1'),\n ] as [number, number, number, number];\n }\n\n const hslaMatch = hslaRegex.exec(normalizedColor);\n if (hslaMatch) {\n const [h, s, l, a] = Array.from(hslaMatch).slice(1).map(parseFloat);\n if (guard(0, 100, s) !== s) throw new ColorError(color);\n if (guard(0, 100, l) !== l) throw new ColorError(color);\n return [...hslToRgb(h, s, l), Number.isNaN(a) ? 1 : a] as [\n number,\n number,\n number,\n number\n ];\n }\n\n throw new ColorError(color);\n}\n\nfunction hash(str: string) {\n let hash = 5381;\n let i = str.length;\n\n while (i) {\n hash = (hash * 33) ^ str.charCodeAt(--i);\n }\n\n /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed\n * integers. Since we want the results to be always positive, convert the\n * signed int to an unsigned by doing an unsigned bitshift. */\n return (hash >>> 0) % 2341;\n}\n\nconst colorToInt = (x: string) => parseInt(x.replace(/_/g, ''), 36);\n\nconst compressedColorMap =\n '1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm'\n .split(' ')\n .reduce((acc, next) => {\n const key = colorToInt(next.substring(0, 3));\n const hex = colorToInt(next.substring(3)).toString(16);\n\n // NOTE: padStart could be used here but it breaks Node 6 compat\n // https://github.com/ricokahler/color2k/issues/351\n leLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"Tokenizer.d.ts","sourceRoot":"","sources":["../../src/Tokenizer.ts"],"names":[],"mappings":"AAmGA,oBAAY,SAAS;IACjB,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,MAAM,IAAI;IACV,MAAM,IAAI;CACb;AAED,MAAM,WAAW,SAAS;IACtB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACpD,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACtD,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACpD,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClE,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAClD,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACpE,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACrD,KAAK,IAAI,IAAI,CAAC;IACd,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACrD,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/D,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9C,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3D;AAqBD,MAAM,CAAC,OAAO,OAAO,SAAS;IA6BtB,OAAO,CAAC,QAAQ,CAAC,GAAG;IA5BxB,6CAA6C;IAC7C,OAAO,CAAC,KAAK,CAAc;IAC3B,uBAAuB;IACvB,OAAO,CAAC,MAAM,CAAM;IACpB,iEAAiE;IACjE,OAAO,CAAC,YAAY,CAAK;IACzB,oEAAoE;IACpE,OAAO,CAAC,KAAK,CAAK;IAClB,oCAAoC;IACpC,OAAO,CAAC,WAAW,CAAK;IACxB,kIAAkI;IAClI,OAAO,CAAC,SAAS,CAAc;IAC/B,oEAAoE;IACpE,OAAO,CAAC,SAAS,CAAS;IAC1B,uDAAuD;IAChD,OAAO,UAAQ;IACtB,wCAAwC;IACxC,OAAO,CAAC,MAAM,CAAK;IAEnB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAU;IACzC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;gBAG1C,EACI,OAAe,EACf,cAAqB,GACxB,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,EACjC,GAAG,EAAE,SAAS;IAU5B,KAAK,IAAI,IAAI;IAWb,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM1B,GAAG,IAAI,IAAI;IAIX,KAAK,IAAI,IAAI;IAIb,MAAM,IAAI,IAAI;IAOrB,OAAO,CAAC,SAAS;IAejB,OAAO,CAAC,eAAe,CAA0B;IACjD,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,yBAAyB;IAoBjC,mEAAmE;IACnE,OAAO,CAAC,iBAAiB;IAwCzB,OAAO,CAAC,kBAAkB;IAe1B;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAkBrB;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB;IAwB1B;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,kBAAkB;IA6B1B,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,yBAAyB;IAYjC,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,wBAAwB;IAOhC,OAAO,CAAC,wBAAwB;IAiBhC,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,uBAAuB;IAc/B,OAAO,CAAC,yBAAyB;IAajC,OAAO,CAAC,sBAAsB;IAkB9B,OAAO,CAAC,iCAAiC;IAGzC,OAAO,CAAC,iCAAiC;IAGzC,OAAO,CAAC,6BAA6B;IAWrC,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,4BAA4B;IAOpC,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,mBAAmB;IAyB3B,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,aAAa;IAmBrB;;OAEG;IACH,OAAO,CAAC,OAAO;IAoBf,OAAO,CAAC,cAAc;IAItB;;;;OAIG;IACH,OAAO,CAAC,KAAK;IAkHb,OAAO,CAAC,MAAM;IAWd,gCAAgC;IAChC,OAAO,CAAC,kBAAkB;IAkC1B,OAAO,CAAC,aAAa;CAsBxB"}
@@ -0,0 +1,6 @@
module.exports = {
"longPressMessage": `\u{5DC}\u{5D7}\u{5E5} \u{5DC}\u{5D7}\u{5D9}\u{5E6}\u{5D4} \u{5D0}\u{5E8}\u{5D5}\u{5DB}\u{5D4} \u{5D0}\u{5D5} \u{5D4}\u{5E7}\u{5E9} Alt + ArrowDown \u{5DB}\u{5D3}\u{5D9} \u{5DC}\u{5E4}\u{5EA}\u{5D5}\u{5D7} \u{5D0}\u{5EA} \u{5D4}\u{5EA}\u{5E4}\u{5E8}\u{5D9}\u{5D8}`
};
//# sourceMappingURL=he-IL.main.js.map
@@ -0,0 +1,55 @@
import { Literal } from '../literal/index.mjs';
import { Boolean } from '../boolean/index.mjs';
import { BigInt } from '../bigint/index.mjs';
import { Number } from '../number/index.mjs';
import { String } from '../string/index.mjs';
import { UnionEvaluated } from '../union/index.mjs';
import { Never } from '../never/index.mjs';
// ------------------------------------------------------------------
// SyntaxParsers
// ------------------------------------------------------------------
// prettier-ignore
function* FromUnion(syntax) {
const trim = syntax.trim().replace(/"|'/g, '');
return (trim === 'boolean' ? yield Boolean() :
trim === 'number' ? yield Number() :
trim === 'bigint' ? yield BigInt() :
trim === 'string' ? yield String() :
yield (() => {
const literals = trim.split('|').map((literal) => Literal(literal.trim()));
return (literals.length === 0 ? Never() :
literals.length === 1 ? literals[0] :
UnionEvaluated(literals));
})());
}
// prettier-ignore
function* FromTerminal(syntax) {
if (syntax[1] !== '{') {
const L = Literal('$');
const R = FromSyntax(syntax.slice(1));
return yield* [L, ...R];
}
for (let i = 2; i < syntax.length; i++) {
if (syntax[i] === '}') {
const L = FromUnion(syntax.slice(2, i));
const R = FromSyntax(syntax.slice(i + 1));
return yield* [...L, ...R];
}
}
yield Literal(syntax);
}
// prettier-ignore
function* FromSyntax(syntax) {
for (let i = 0; i < syntax.length; i++) {
if (syntax[i] === '$') {
const L = Literal(syntax.slice(0, i));
const R = FromTerminal(syntax.slice(i));
return yield* [L, ...R];
}
}
yield Literal(syntax);
}
/** Parses TemplateLiteralSyntax and returns a tuple of TemplateLiteralKinds */
export function TemplateLiteralSyntax(syntax) {
return [...FromSyntax(syntax)];
}
@@ -0,0 +1,219 @@
import test from 'tape';
import mayContainChildComponent from '../../../src/util/mayContainChildComponent';
import JSXAttributeMock from '../../../__mocks__/JSXAttributeMock';
import JSXElementMock from '../../../__mocks__/JSXElementMock';
import JSXExpressionContainerMock from '../../../__mocks__/JSXExpressionContainerMock';
test('mayContainChildComponent', (t) => {
t.equal(
mayContainChildComponent(
JSXElementMock('div', [], [
JSXElementMock('div', [], [
JSXElementMock('span', [], []),
JSXElementMock('span', [], [
JSXElementMock('span', [], []),
JSXElementMock('span', [], [
JSXElementMock('span', [], []),
]),
]),
]),
JSXElementMock('span', [], []),
JSXElementMock('img', [
JSXAttributeMock('src', 'some/path'),
]),
]),
'FancyComponent',
5,
),
false,
'no FancyComponent returns false',
);
t.test('contains an indicated component', (st) => {
st.equal(
mayContainChildComponent(
JSXElementMock('div', [], [
JSXElementMock('input'),
]),
'input',
),
true,
'returns true',
);
st.equal(
mayContainChildComponent(
JSXElementMock('div', [], [
JSXElementMock('FancyComponent'),
]),
'FancyComponent',
),
true,
'returns true',
);
st.equal(
mayContainChildComponent(
JSXElementMock('div', [], [
JSXElementMock('div', [], [
JSXElementMock('FancyComponent'),
]),
]),
'FancyComponent',
),
false,
'FancyComponent is outside of default depth, should return false',
);
st.equal(
mayContainChildComponent(
JSXElementMock('div', [], [
JSXElementMock('div', [], [
JSXElementMock('FancyComponent'),
]),
]),
'FancyComponent',
2,
),
true,
'FancyComponent is inside of custom depth, should return true',
);
st.equal(
mayContainChildComponent(
JSXElementMock('div', [], [
JSXElementMock('div', [], [
JSXElementMock('span', [], []),
JSXElementMock('span', [], [
JSXElementMock('span', [], []),
JSXElementMock('span', [], [
JSXElementMock('span', [], [
JSXElementMock('span', [], [
JSXElementMock('FancyComponent'),
]),
]),
]),
]),
]),
JSXElementMock('span', [], []),
JSXElementMock('img', [
JSXAttributeMock('src', 'some/path'),
]),
]),
'FancyComponent',
6,
),
true,
'deep nesting, returns true',
);
st.end();
});
t.equal(
mayContainChildComponent(
JSXElementMock('div', [], [
JSXExpressionContainerMock('mysteryBox'),
]),
'FancyComponent',
),
true,
'Intederminate situations + expression container children - returns true',
);
t.test('Glob name matching - component name contains question mark ? - match any single character', (st) => {
st.equal(
mayContainChildComponent(
JSXElementMock('div', [], [
JSXElementMock('FancyComponent'),
]),
'Fanc?Co??onent',
),
true,
'returns true',
);
st.equal(
mayContainChildComponent(
JSXElementMock('div', [], [
JSXElementMock('FancyComponent'),
]),
'FancyComponent?',
),
false,
'returns false',
);
st.test('component name contains asterisk * - match zero or more characters', (s2t) => {
s2t.equal(
mayContainChildComponent(
JSXElementMock('div', [], [
JSXElementMock('FancyComponent'),
]),
'Fancy*',
),
true,
'returns true',
);
s2t.equal(
mayContainChildComponent(
JSXElementMock('div', [], [
JSXElementMock('FancyComponent'),
]),
'*Component',
),
true,
'returns true',
);
s2t.equal(
mayContainChildComponent(
JSXElementMock('div', [], [
JSXElementMock('FancyComponent'),
]),
'Fancy*C*t',
),
true,
'returns true',
);
s2t.end();
});
st.end();
});
t.test('using a custom elementType function', (st) => {
st.equal(
mayContainChildComponent(
JSXElementMock('div', [], [
JSXElementMock('CustomInput'),
]),
'input',
2,
() => 'input',
),
true,
'returns true when the custom elementType returns the proper name',
);
st.equal(
mayContainChildComponent(
JSXElementMock('div', [], [
JSXElementMock('CustomInput'),
]),
'input',
2,
() => 'button',
),
false,
'returns false when the custom elementType returns a wrong name',
);
st.end();
});
t.end();
});
@@ -0,0 +1,47 @@
import {Point as $3041db3296945e6e$export$baf26146a414f24a} from "./Point.mjs";
import {Rect as $60423f92c7f9ad87$export$c79fc6492f3af13d} from "./Rect.mjs";
/*
* 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.
*/
class $364191b3decf3697$export$4455ee6afb38dcbb {
setVisibleRect(rect) {
let time = performance.now() - this.startTime;
if (time < 500) {
if (rect.x !== this.visibleRect.x && time > 0) this.velocity.x = (rect.x - this.visibleRect.x) / time;
if (rect.y !== this.visibleRect.y && time > 0) this.velocity.y = (rect.y - this.visibleRect.y) / time;
}
this.startTime = performance.now();
this.visibleRect = rect;
}
getOverscannedRect() {
let overscanned = this.visibleRect.copy();
let overscanY = this.visibleRect.height / 3;
overscanned.height += overscanY;
if (this.velocity.y < 0) overscanned.y -= overscanY;
if (this.velocity.x !== 0) {
let overscanX = this.visibleRect.width / 3;
overscanned.width += overscanX;
if (this.velocity.x < 0) overscanned.x -= overscanX;
}
return overscanned;
}
constructor(){
this.startTime = 0;
this.velocity = new (0, $3041db3296945e6e$export$baf26146a414f24a)(0, 0);
this.visibleRect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)();
}
}
export {$364191b3decf3697$export$4455ee6afb38dcbb as OverscanManager};
//# sourceMappingURL=OverscanManager.module.js.map
@@ -0,0 +1,9 @@
import Decimal from 'decimal.js';
import { NumberFormatDigitInternalSlots } from '../types/number';
/**
* https://tc39.es/ecma402/#sec-formatnumberstring
*/
export declare function FormatNumericToString(intlObject: Pick<NumberFormatDigitInternalSlots, 'roundingType' | 'minimumSignificantDigits' | 'maximumSignificantDigits' | 'minimumIntegerDigits' | 'minimumFractionDigits' | 'maximumFractionDigits' | 'roundingIncrement' | 'roundingMode' | 'trailingZeroDisplay'>, _x: Decimal): {
roundedNumber: Decimal;
formattedString: string;
};
@@ -0,0 +1 @@
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAQM,SAAS,0CAA6C,OAAmC;IAC9F,IAAI,CAAC,SACH,OAAO;IAGT,IAAI,wBAAwB;IAC5B,OAAO,CAAC;QACN,IAAI,QAAsB;YACxB,GAAG,CAAC;YACJ;gBACE,EAAE,cAAc;YAClB;YACA;gBACE,OAAO,EAAE,kBAAkB;YAC7B;YACA;gBACE,IAAI,yBAAyB,QAAQ,GAAG,CAAC,QAAQ,KAAK,cACpD,QAAQ,KAAK,CAAC;qBAEd,wBAAwB;YAE5B;YACA;gBACE,wBAAwB;YAC1B;YACA;gBACE,OAAO;YACT;QACF;QAEA,QAAQ;QAER,IAAI,uBACF,EAAE,eAAe;IAErB;AACF","sources":["packages/@react-aria/interactions/src/createEventHandler.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 {BaseEvent} from '@react-types/shared';\nimport {SyntheticEvent} from 'react';\n\n/**\n * This function wraps a React event handler to make stopPropagation the default, and support continuePropagation instead.\n */\nexport function createEventHandler<T extends SyntheticEvent>(handler?: (e: BaseEvent<T>) => void): ((e: T) => void) | undefined {\n if (!handler) {\n return undefined;\n }\n\n let shouldStopPropagation = true;\n return (e: T) => {\n let event: BaseEvent<T> = {\n ...e,\n preventDefault() {\n e.preventDefault();\n },\n isDefaultPrevented() {\n return e.isDefaultPrevented();\n },\n stopPropagation() {\n if (shouldStopPropagation && process.env.NODE_ENV !== 'production') {\n console.error('stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.');\n } else {\n shouldStopPropagation = true;\n }\n },\n continuePropagation() {\n shouldStopPropagation = false;\n },\n isPropagationStopped() {\n return shouldStopPropagation;\n }\n };\n\n handler(event);\n\n if (shouldStopPropagation) {\n e.stopPropagation();\n }\n };\n}\n"],"names":[],"version":3,"file":"createEventHandler.main.js.map"}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=BindingConstraintUtils.spec.d.ts.map
@@ -0,0 +1,326 @@
export default `tlf2a 3 3 8 -1 18 0 0 0
===============================================================================
This is emboss.tlf, or “Emboss”, by Sam Hocevar <sam@hocevar.net>. It was
created on September 30th, 2006.
This font is free software. It comes without any warranty, to the extent
permitted by applicable law. You can redistribute it and/or modify it under
the terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more
details.
Missing characters: # $ % , ; < >
To create emboss2.tlf, use the following command:
$ sed '/@@/,$y/━┃┏┓┗┛/═║╔╗╚╝/' < emboss.tlf > emboss2.tlf
This font is part of TOIlet’s official distribution. More information
on the TOIlet website at http://caca.zoy.org/wiki/toilet
===============================================================================
@
@
@@
┃!
┛!
┛!!
┛┛"
"
""
@
@
#@@
@
@
$@@
@
@
%@@
┏┛┃ &
┃━┏┛&
━━┛ &&
┛'
'
''
┛(
┃ (
┛((
━ )
┃)
━ ))
┛ ┛*
━┏┛*
┛ ┛**
┃ +
━┏┛+
┛ ++
@
@
,@@
-
━┛-
--
.
.
┛..
┛/
┛ /
┛ //
┏━┃0
┃┛┃0
━━┛00
━┃ 1
┃ 1
━━┛11
━━┃2
┏━┛2
━━┛22
━━┃3
━━┃3
━━┛33
┃ ┃4
━━┃4
┛44
┏━┛5
━━┃5
━━┛55
┏━┛6
┏━┃6
━━┛66
┏━┃7
┃7
┛77
┏━┃8
┏━┃8
━━┛88
┏━┃9
━━┃9
━━┛99
:
┛:
┛::
@
@
;@@
@
@
<@@
=
━━┛=
━━┛==
@
@
>@@
┏━┃?
┛?
┛ ??
┏━┃@
┃┛┛@
━━┛@@
┏━┃A
┏━┃A
┛ ┛AA
┏━ B
┏━┃B
━━ BB
┏━┛C
┃ C
━━┛CC
┏━ D
┃ ┃D
━━ DD
┏━┛E
┏━┛E
━━┛EE
┏━┛F
┏━┛F
┛ FF
┏━┛G
┃ ┃G
━━┛GG
┃ ┃H
┏━┃H
┛ ┛HH
┛I
┃I
┛II
┛J
┃J
━┛JJ
┃ ┃K
┏┛ K
┛ ┛KK
┃ L
┃ L
━━┛LL
┏┏ M
┃┃┃M
┛┛┛MM
┏━ N
┃ ┃N
┛ ┛NN
┏━┃O
┃ ┃O
━━┛OO
┏━┃p
┏━┛P
┛ PP
┏━┃ Q
┃ ┃ Q
━━━┛QQ
┏━┃R
┏┏┛R
┛ ┛RR
┏━┛S
━━┃S
━━┛SS
━┏┛T
┃ T
┛ TT
┃ ┃U
┃ ┃U
━━┛UU
┃ ┃V
┃ ┃V
┛ VV
┃┃┃W
┃┃┃W
━━┛WW
┃ ┃X
┛ X
┛ ┛XX
┃ ┃Y
━┏┛Y
┛ YY
━━┃Z
┏┛ Z
━━┛ZZ
┏┛[
┃ [
━┛[[
┛ \\
┛ \\
┛\\\\
━┃]
┃]
━┛]]
┛ ^
┛ ┛^
^^
_
_
━━┛__
┛ \`
┛\`
\`\`
┏━┃a
┏━┃a
┛ ┛aa
┏━ b
┏━┃b
━━ bb
┏━┛c
┃ c
━━┛cc
┏━ d
┃ ┃d
━━ dd
┏━┛e
┏━┛e
━━┛ee
┏━┛f
┏━┛f
┛ ff
┏━┛g
┃ ┃g
━━┛gg
┃ ┃h
┏━┃h
┛ ┛hh
┛i
┃i
┛ii
┛j
┃j
━┛jj
┃ ┃k
┏┛ k
┛ ┛kk
┃ l
┃ l
━━┛ll
┏┏ m
┃┃┃m
┛┛┛mm
┏━ n
┃ ┃n
┛ ┛nn
┏━┃o
┃ ┃o
━━┛oo
┏━┃p
┏━┛p
┛ pp
┏━┃ q
┃ ┃ q
━━━┛qq
┏━┃r
┏┏┛r
┛ ┛rr
┏━┛s
━━┃s
━━┛ss
━┏┛t
┃ t
┛ tt
┃ ┃u
┃ ┃u
━━┛uu
┃ ┃v
┃ ┃v
┛ vv
┃┃┃w
┃┃┃w
━━┛ww
┃ ┃x
┛ x
┛ ┛xx
┃ ┃y
━┏┛y
┛ yy
━━┃z
┏┛ z
━━┛zz
┏┛{
━┃ {
━┛{{
┃|
┃|
┛||
━┃ }
┏┛}
━┛ }}
┛ ┛~
┛ ┛ ~
~~
┏━┃┏━┛Ä
┏━┃┏━┛Ä
┛ ┛━━┛ÄÄ
┏━┃┏━┛Ö
┃ ┃┏━┛Ö
━━┛━━┛ÖÖ
┃ ┃┏━┛Ü
┃ ┃┏━┛Ü
━━┛━━┛ÜÜ
┏━┃┏━┛ä
┏━┃┏━┛ä
┛ ┛━━┛ää
┏━┃┏━┛ö
┃ ┃┏━┛ö
━━┛━━┛öö
┃ ┃┏━┛ü
┃ ┃┏━┛ü
━━┛━━┛üü
┏━┛┏━┛ß
━━┃━━┃ß
━━┛━━┛ßß
`
@@ -0,0 +1 @@
{"version":3,"file":"issue_1190.test.d.ts","sourceRoot":"","sources":["../../../../src/test/bugs/issue_1190.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,53 @@
# github-from-package
return the github url from a package.json file
[![build status](https://secure.travis-ci.org/substack/github-from-package.png)](http://travis-ci.org/substack/github-from-package)
# example
For the `./package.json` file:
``` json
{
"name": "beep-boop",
"version": "1.2.3",
"repository" : {
"type" : "git",
"url": "git@github.com:substack/beep-boop.git"
}
}
```
``` js
var github = require('github-from-package');
var url = github(require('./package.json'));
console.log(url);
```
```
https://github.com/substack/beep-boop
```
# methods
``` js
var github = require('github-from-package')
```
## var url = github(pkg)
Return the most likely github url from the package.json contents `pkg`. If no
github url can be determined, return `undefined`.
# install
With [npm](https://npmjs.org) do:
```
npm install github-from-package
```
# license
MIT
@@ -0,0 +1,20 @@
'use strict'
const util = require('util')
const contentPath = require('./path')
const { hasContent } = require('./read')
const rimraf = util.promisify(require('rimraf'))
module.exports = rm
async function rm (cache, integrity) {
const content = await hasContent(cache, integrity)
// ~pretty~ sure we can't end up with a content lacking sri, but be safe
if (content && content.sri) {
await rimraf(contentPath(cache, content.sri))
return true
} else {
return false
}
}
@@ -0,0 +1,562 @@
"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/index.ts
var src_exports = {};
__export(src_exports, {
Checkbox: () => checkbox_default,
CheckboxGroup: () => checkbox_group_default,
CheckboxGroupProvider: () => CheckboxGroupProvider,
CheckboxIcon: () => CheckboxIcon,
useCheckbox: () => useCheckbox,
useCheckboxGroup: () => useCheckboxGroup,
useCheckboxGroupContext: () => useCheckboxGroupContext
});
module.exports = __toCommonJS(src_exports);
// src/checkbox.tsx
var import_system2 = require("@heroui/system");
var import_react3 = require("react");
// src/use-checkbox.ts
var import_system = require("@heroui/system");
var import_react = require("react");
var import_react2 = require("react");
var import_toggle = require("@react-stately/toggle");
var import_theme = require("@heroui/theme");
var import_use_callback_ref = require("@heroui/use-callback-ref");
var import_interactions = require("@react-aria/interactions");
var import_focus = require("@react-aria/focus");
var import_utils = require("@react-aria/utils");
var import_shared_utils = require("@heroui/shared-utils");
var import_checkbox = require("@react-aria/checkbox");
var import_use_safe_layout_effect = require("@heroui/use-safe-layout-effect");
var import_react_utils2 = require("@heroui/react-utils");
var import_form = require("@heroui/form");
// src/checkbox-group-context.ts
var import_react_utils = require("@heroui/react-utils");
var [CheckboxGroupProvider, useCheckboxGroupContext] = (0, import_react_utils.createContext)({
name: "CheckboxGroupContext",
strict: false
});
// src/use-checkbox.ts
function useCheckbox(props = {}) {
var _a, _b, _c, _d, _e, _f, _g, _h;
const globalContext = (0, import_system.useProviderContext)();
const groupContext = useCheckboxGroupContext();
const { validationBehavior: formValidationBehavior } = (0, import_form.useSlottedContext)(import_form.FormContext) || {};
const isInGroup = !!groupContext;
const {
as,
ref,
value = "",
children,
icon,
name,
isRequired,
isReadOnly: isReadOnlyProp = false,
autoFocus = false,
isSelected: isSelectedProp,
size = (_a = groupContext == null ? void 0 : groupContext.size) != null ? _a : "md",
color = (_b = groupContext == null ? void 0 : groupContext.color) != null ? _b : "primary",
radius = groupContext == null ? void 0 : groupContext.radius,
lineThrough = (_c = groupContext == null ? void 0 : groupContext.lineThrough) != null ? _c : false,
isDisabled: isDisabledProp = (_d = groupContext == null ? void 0 : groupContext.isDisabled) != null ? _d : false,
disableAnimation = (_f = (_e = groupContext == null ? void 0 : groupContext.disableAnimation) != null ? _e : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _f : false,
validationState,
isInvalid: isInvalidProp = validationState ? validationState === "invalid" : (_g = groupContext == null ? void 0 : groupContext.isInvalid) != null ? _g : false,
isIndeterminate = false,
validationBehavior = isInGroup ? groupContext.validationBehavior : (_h = formValidationBehavior != null ? formValidationBehavior : globalContext == null ? void 0 : globalContext.validationBehavior) != null ? _h : "native",
defaultSelected,
classNames,
className,
onValueChange,
validate,
...otherProps
} = props;
if (groupContext && import_shared_utils.__DEV__) {
if (isSelectedProp) {
(0, import_shared_utils.warn)(
"The Checkbox.Group is being used, `isSelected` will be ignored. Use the `value` of the Checkbox.Group instead.",
"Checkbox"
);
}
if (defaultSelected) {
(0, import_shared_utils.warn)(
"The Checkbox.Group is being used, `defaultSelected` will be ignored. Use the `defaultValue` of the Checkbox.Group instead.",
"Checkbox"
);
}
}
const Component = as || "label";
const domRef = (0, import_react2.useRef)(null);
const inputRef = (0, import_react2.useRef)(null);
let onChange = props.onChange;
if (isInGroup) {
const dispatch = () => {
groupContext.groupState.resetValidation();
};
onChange = (0, import_utils.chain)(dispatch, onChange);
}
const labelId = (0, import_react.useId)();
const ariaCheckboxProps = (0, import_react2.useMemo)(
() => ({
name,
value,
children,
autoFocus,
defaultSelected,
isIndeterminate,
isRequired,
isInvalid: isInvalidProp,
isSelected: isSelectedProp,
isDisabled: isDisabledProp,
isReadOnly: isReadOnlyProp,
"aria-label": (0, import_shared_utils.safeAriaLabel)(otherProps["aria-label"], children),
"aria-labelledby": otherProps["aria-labelledby"] || labelId,
onChange: onValueChange
}),
[
name,
value,
children,
autoFocus,
defaultSelected,
isIndeterminate,
isRequired,
isInvalidProp,
isSelectedProp,
isDisabledProp,
isReadOnlyProp,
otherProps["aria-label"],
otherProps["aria-labelledby"],
labelId,
onValueChange
]
);
const toggleState = (0, import_toggle.useToggleState)(ariaCheckboxProps);
const validationProps = {
isInvalid: isInvalidProp,
isRequired,
validate,
validationState,
validationBehavior
};
const {
inputProps,
isSelected,
isDisabled,
isReadOnly,
isPressed,
isInvalid: isAriaInvalid
} = isInGroup ? (0, import_checkbox.useCheckboxGroupItem)(
{ ...ariaCheckboxProps, ...validationProps },
groupContext.groupState,
inputRef
) : (0, import_checkbox.useCheckbox)({ ...ariaCheckboxProps, ...validationProps }, toggleState, inputRef);
const isInteractionDisabled = isDisabled || isReadOnly;
const isInvalid = validationState === "invalid" || isInvalidProp || isAriaInvalid;
const pressed = isInteractionDisabled ? false : isPressed;
const { hoverProps, isHovered } = (0, import_interactions.useHover)({
isDisabled: inputProps.disabled
});
const { focusProps, isFocused, isFocusVisible } = (0, import_focus.useFocusRing)({
autoFocus: inputProps.autoFocus
});
const slots = (0, import_react2.useMemo)(
() => (0, import_theme.checkbox)({
color,
size,
radius,
isInvalid,
lineThrough,
isDisabled,
disableAnimation
}),
[color, size, radius, isInvalid, lineThrough, isDisabled, disableAnimation]
);
(0, import_use_safe_layout_effect.useSafeLayoutEffect)(() => {
if (!inputRef.current)
return;
const isInputRefChecked = !!inputRef.current.checked;
toggleState.setSelected(isInputRefChecked);
}, [inputRef.current]);
const onChangeProp = (0, import_use_callback_ref.useCallbackRef)(onChange);
const handleCheckboxChange = (0, import_react.useCallback)(
(event) => {
if (isReadOnly || isDisabled) {
event.preventDefault();
return;
}
onChangeProp == null ? void 0 : onChangeProp(event);
},
[isReadOnly, isDisabled, onChangeProp]
);
const baseStyles = (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.base, className);
const getBaseProps = (0, import_react.useCallback)(() => {
return {
ref: domRef,
className: slots.base({ class: baseStyles }),
"data-disabled": (0, import_shared_utils.dataAttr)(isDisabled),
"data-selected": (0, import_shared_utils.dataAttr)(isSelected || isIndeterminate),
"data-invalid": (0, import_shared_utils.dataAttr)(isInvalid),
"data-hover": (0, import_shared_utils.dataAttr)(isHovered),
"data-focus": (0, import_shared_utils.dataAttr)(isFocused),
"data-pressed": (0, import_shared_utils.dataAttr)(pressed),
"data-readonly": (0, import_shared_utils.dataAttr)(inputProps.readOnly),
"data-focus-visible": (0, import_shared_utils.dataAttr)(isFocusVisible),
"data-indeterminate": (0, import_shared_utils.dataAttr)(isIndeterminate),
...(0, import_utils.mergeProps)(hoverProps, otherProps)
};
}, [
slots,
baseStyles,
isDisabled,
isSelected,
isIndeterminate,
isInvalid,
isHovered,
isFocused,
pressed,
inputProps.readOnly,
isFocusVisible,
hoverProps,
otherProps
]);
const getWrapperProps = (0, import_react.useCallback)(
(props2 = {}) => {
return {
...props2,
"aria-hidden": true,
className: (0, import_shared_utils.clsx)(slots.wrapper({ class: (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.wrapper, props2 == null ? void 0 : props2.className) }))
};
},
[slots, classNames == null ? void 0 : classNames.wrapper]
);
const getInputProps = (0, import_react.useCallback)(() => {
return {
ref: (0, import_react_utils2.mergeRefs)(inputRef, ref),
...(0, import_utils.mergeProps)(inputProps, focusProps),
className: slots.hiddenInput({ class: classNames == null ? void 0 : classNames.hiddenInput }),
onChange: (0, import_utils.chain)(inputProps.onChange, handleCheckboxChange)
};
}, [inputProps, focusProps, handleCheckboxChange, classNames == null ? void 0 : classNames.hiddenInput]);
const getLabelProps = (0, import_react.useCallback)(
() => ({
id: labelId,
className: slots.label({ class: classNames == null ? void 0 : classNames.label })
}),
[slots, classNames == null ? void 0 : classNames.label, isDisabled, isSelected, isInvalid]
);
const getIconProps = (0, import_react.useCallback)(
() => ({
isSelected,
isIndeterminate,
disableAnimation,
className: slots.icon({ class: classNames == null ? void 0 : classNames.icon })
}),
[slots, classNames == null ? void 0 : classNames.icon, isSelected, isIndeterminate, disableAnimation]
);
return {
Component,
icon,
children,
isSelected,
isDisabled,
isInvalid,
isFocused,
isHovered,
isFocusVisible,
getBaseProps,
getWrapperProps,
getInputProps,
getLabelProps,
getIconProps
};
}
// src/checkbox-icon.tsx
var import_jsx_runtime = require("react/jsx-runtime");
function CheckIcon(props) {
const { isSelected, disableAnimation, ...otherProps } = props;
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { "aria-hidden": "true", role: "presentation", viewBox: "0 0 17 18", ...otherProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"polyline",
{
fill: "none",
points: "1 9 7 14 15 4",
stroke: "currentColor",
strokeDasharray: 22,
strokeDashoffset: isSelected ? 44 : 66,
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: 2,
style: !disableAnimation && isSelected ? {
transition: "stroke-dashoffset 250ms linear 0.2s"
} : {}
}
) });
}
function IndeterminateIcon(props) {
const { isSelected, disableAnimation, ...otherProps } = props;
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { stroke: "currentColor", strokeWidth: 3, viewBox: "0 0 24 24", ...otherProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "21", x2: "3", y1: "12", y2: "12" }) });
}
function CheckboxIcon(props) {
const { isIndeterminate, ...otherProps } = props;
const BaseIcon = isIndeterminate ? IndeterminateIcon : CheckIcon;
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseIcon, { ...otherProps });
}
// src/checkbox.tsx
var import_jsx_runtime2 = require("react/jsx-runtime");
var Checkbox = (0, import_system2.forwardRef)((props, ref) => {
const {
Component,
children,
icon = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CheckboxIcon, {}),
getBaseProps,
getWrapperProps,
getInputProps,
getIconProps,
getLabelProps
} = useCheckbox({ ...props, ref });
const clonedIcon = typeof icon === "function" ? icon(getIconProps()) : (0, import_react3.cloneElement)(icon, getIconProps());
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Component, { ...getBaseProps(), children: [
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("input", { ...getInputProps() }),
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { ...getWrapperProps(), children: clonedIcon }),
children && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { ...getLabelProps(), children })
] });
});
Checkbox.displayName = "HeroUI.Checkbox";
var checkbox_default = Checkbox;
// src/checkbox-group.tsx
var import_system4 = require("@heroui/system");
// src/use-checkbox-group.ts
var import_system3 = require("@heroui/system");
var import_react4 = require("react");
var import_utils2 = require("@react-aria/utils");
var import_theme2 = require("@heroui/theme");
var import_checkbox2 = require("@react-aria/checkbox");
var import_checkbox3 = require("@react-stately/checkbox");
var import_react_utils3 = require("@heroui/react-utils");
var import_shared_utils2 = require("@heroui/shared-utils");
var import_form2 = require("@heroui/form");
function useCheckboxGroup(props) {
var _a, _b;
const globalContext = (0, import_system3.useProviderContext)();
const { validationBehavior: formValidationBehavior } = (0, import_form2.useSlottedContext)(import_form2.FormContext) || {};
const {
as,
ref,
classNames,
children,
label,
radius,
value,
name,
defaultValue,
isInvalid: isInvalidProp,
validationState,
size = "md",
color = "primary",
orientation = "vertical",
lineThrough = false,
isDisabled = false,
validationBehavior = (_a = formValidationBehavior != null ? formValidationBehavior : globalContext == null ? void 0 : globalContext.validationBehavior) != null ? _a : "native",
disableAnimation = (_b = globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false,
isReadOnly,
isRequired,
onValueChange,
description,
errorMessage,
className,
...otherProps
} = props;
const Component = as || "div";
const shouldFilterDOMProps = typeof Component === "string";
const domRef = (0, import_react_utils3.useDOMRef)(ref);
const checkboxGroupProps = (0, import_react4.useMemo)(() => {
return {
...otherProps,
value,
name,
"aria-label": (0, import_shared_utils2.safeAriaLabel)(otherProps["aria-label"], label),
defaultValue,
isRequired,
isReadOnly,
orientation,
validationBehavior,
isInvalid: validationState === "invalid" || isInvalidProp,
onChange: (0, import_utils2.chain)(props.onChange, onValueChange)
};
}, [
value,
name,
label,
defaultValue,
isRequired,
isReadOnly,
orientation,
onValueChange,
isInvalidProp,
validationState,
validationBehavior,
otherProps["aria-label"],
otherProps
]);
const groupState = (0, import_checkbox3.useCheckboxGroupState)(checkboxGroupProps);
const {
labelProps,
groupProps,
descriptionProps,
errorMessageProps,
validationErrors,
validationDetails
} = (0, import_checkbox2.useCheckboxGroup)(checkboxGroupProps, groupState);
const context = (0, import_react4.useMemo)(
() => ({
size,
color,
radius,
lineThrough,
isInvalid: groupState.isInvalid,
isDisabled,
disableAnimation,
validationBehavior,
groupState
}),
[
size,
color,
radius,
lineThrough,
isDisabled,
disableAnimation,
validationBehavior,
groupState.value,
groupState.isDisabled,
groupState.isReadOnly,
groupState.isInvalid,
groupState.isSelected
]
);
const slots = (0, import_react4.useMemo)(
() => (0, import_theme2.checkboxGroup)({ isRequired, isInvalid: groupState.isInvalid, disableAnimation }),
[isRequired, groupState.isInvalid, , disableAnimation]
);
const baseStyles = (0, import_shared_utils2.clsx)(classNames == null ? void 0 : classNames.base, className);
const getGroupProps = (0, import_react4.useCallback)(() => {
return {
ref: domRef,
className: slots.base({ class: baseStyles }),
...(0, import_utils2.mergeProps)(
groupProps,
(0, import_react_utils3.filterDOMProps)(otherProps, {
enabled: shouldFilterDOMProps
})
)
};
}, [slots, domRef, baseStyles, groupProps, otherProps]);
const getLabelProps = (0, import_react4.useCallback)(() => {
return {
className: slots.label({ class: classNames == null ? void 0 : classNames.label }),
...labelProps
};
}, [slots, labelProps, classNames == null ? void 0 : classNames.label]);
const getWrapperProps = (0, import_react4.useCallback)(() => {
return {
className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }),
role: "presentation",
"data-orientation": orientation
};
}, [slots, orientation, classNames == null ? void 0 : classNames.wrapper]);
const getDescriptionProps = (0, import_react4.useCallback)(
(props2 = {}) => {
return {
...props2,
...descriptionProps,
className: slots.description({ class: (0, import_shared_utils2.clsx)(classNames == null ? void 0 : classNames.description, props2 == null ? void 0 : props2.className) })
};
},
[slots, descriptionProps, classNames == null ? void 0 : classNames.description]
);
const getErrorMessageProps = (0, import_react4.useCallback)(
(props2 = {}) => {
return {
...props2,
...errorMessageProps,
className: slots.errorMessage({ class: (0, import_shared_utils2.clsx)(classNames == null ? void 0 : classNames.errorMessage, props2 == null ? void 0 : props2.className) })
};
},
[slots, errorMessageProps, classNames == null ? void 0 : classNames.errorMessage]
);
return {
Component,
children,
label,
context,
description,
isInvalid: groupState.isInvalid,
errorMessage: typeof errorMessage === "function" ? errorMessage({ isInvalid: groupState.isInvalid, validationErrors, validationDetails }) : errorMessage || (validationErrors == null ? void 0 : validationErrors.join(" ")),
getGroupProps,
getLabelProps,
getWrapperProps,
getDescriptionProps,
getErrorMessageProps
};
}
// src/checkbox-group.tsx
var import_jsx_runtime3 = require("react/jsx-runtime");
var CheckboxGroup = (0, import_system4.forwardRef)((props, ref) => {
const {
children,
context,
label,
description,
isInvalid,
errorMessage,
getGroupProps,
getLabelProps,
getWrapperProps,
getDescriptionProps,
getErrorMessageProps
} = useCheckboxGroup({ ...props, ref });
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { ...getGroupProps(), children: [
label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { ...getLabelProps(), children: label }),
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { ...getWrapperProps(), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CheckboxGroupProvider, { value: context, children }) }),
isInvalid && errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { ...getErrorMessageProps(), children: errorMessage }) : description ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { ...getDescriptionProps(), children: description }) : null
] });
});
CheckboxGroup.displayName = "HeroUI.CheckboxGroup";
var checkbox_group_default = CheckboxGroup;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Checkbox,
CheckboxGroup,
CheckboxGroupProvider,
CheckboxIcon,
useCheckbox,
useCheckboxGroup,
useCheckboxGroupContext
});
@@ -0,0 +1,71 @@
var test = require('tape')
var through = require('../')
// must emit end before close.
test('buffering', function(assert) {
var ts = through(function (data) {
this.queue(data)
}, function () {
this.queue(null)
})
var ended = false, actual = []
ts.on('data', actual.push.bind(actual))
ts.on('end', function () {
ended = true
})
ts.write(1)
ts.write(2)
ts.write(3)
assert.deepEqual(actual, [1, 2, 3])
ts.pause()
ts.write(4)
ts.write(5)
ts.write(6)
assert.deepEqual(actual, [1, 2, 3])
ts.resume()
assert.deepEqual(actual, [1, 2, 3, 4, 5, 6])
ts.pause()
ts.end()
assert.ok(!ended)
ts.resume()
assert.ok(ended)
assert.end()
})
test('buffering has data in queue, when ends', function (assert) {
/*
* If stream ends while paused with data in the queue,
* stream should still emit end after all data is written
* on resume.
*/
var ts = through(function (data) {
this.queue(data)
}, function () {
this.queue(null)
})
var ended = false, actual = []
ts.on('data', actual.push.bind(actual))
ts.on('end', function () {
ended = true
})
ts.pause()
ts.write(1)
ts.write(2)
ts.write(3)
ts.end()
assert.deepEqual(actual, [], 'no data written yet, still paused')
assert.ok(!ended, 'end not emitted yet, still paused')
ts.resume()
assert.deepEqual(actual, [1, 2, 3], 'resumed, all data should be delivered')
assert.ok(ended, 'end should be emitted once all data was delivered')
assert.end();
})
@@ -0,0 +1,742 @@
flf2a$ 7 7 15 0 19 0 24447 0
Author : myflix
Date : 2004/6/9 7:40:40
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.
---
Font modified June 17, 2007 by patorjk
- Widened the space character.
Font modified May 26, 2012 by patorjk
- Added the 0xCA0 character.
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $##
,---. #
| | #
| .' #
| | #
`--' #
.--. #
'--' ##
#
,--. ,--. #
| | | | #
`-' `-' #
#
#
##
,--. ,--. #
,-| |-| |-.#
'-| |-| |-'#
,-| |-| |-.#
'-| |-| |-'#
`--' `--' #
##
,--. #
,-| |-. #
| | |-' #
'-| |`\ #
.--| | / #
`--| |' #
`--' ##
,--. #
.-. / / #
'-'/ / #
/ / #
/ /.-. #
/ / '-' #
`--' ##
#
,---. #
| o ,-. #
.' /_ #
| o .__) #
`---' #
##
#
,--. #
| | #
`-' #
#
#
##
#
,-. #
/ .' #
| | #
| | #
\ '. #
`-' ##
#
,-. #
'. \ #
| | #
| | #
.' / #
`-' ##
,--. #
.-,| |,-. #
_\ ' ' /_ #
(__ __) #
/ . . \ #
`-'| |`-' #
`--' ##
,--. #
| | #
,---| |---. #
'---| |---' #
| | #
`--' #
##
#
#
#
#
,--. #
'-,/ #
##
#
#
,-----. #
'-----' #
#
#
##
#
#
#
#
.--. #
'--' #
##
,--. #
/ / #
/ / #
/ / #
/ / #
/ / #
`--' ##
#
,--. #
/ \ #
| () | #
\ / #
`--' #
##
#
,--. #
/ | #
`| | #
| | #
`--' #
##
#
,---. #
'.-. \ #
.-' .' #
/ '-. #
'-----' #
##
#
,----. #
'.-. | #
.' < #
/'-' | #
`----' #
##
#
,---. #
/ | #
/ ' | #
'--| | #
`--' #
##
#
,-----. #
| .--' #
'--. `\ #
.--' / #
`----' #
##
#
,--. #
/ .' #
| .-. #
\ o | #
`---' #
##
#
,-----. #
'--, / #
.' / #
/ / #
`--' #
##
#
,---. #
| o | #
.' '. #
| o | #
`---' #
##
#
,---. #
| o \ #
`..' | #
.' / #
`--' #
##
#
#
.--. #
'--' #
.--. #
'--' #
##
#
#
.--. #
'--' #
.--. #
'-,/ #
##
#
,-. #
/ / #
/ / #
\ \ #
\ \ #
`-' ##
#
#
,---. #
'---' #
,---. #
'---' #
##
#
,-. #
\ \ #
\ \ #
/ / #
/ / #
`-' ##
,------. #
' .--. ' #
'--' _| | #
.--' __' #
`---' #
.---. #
'---' ##
#
,----. #
' , | #
| | / #
' '--'| #
`----' #
##
#
,---. #
/ O \ #
| .-. | #
| | | | #
`--' `--' #
##
#
,-----. #
| |) /_ #
| .-. \ #
| '--' / #
`------' #
##
#
,-----. #
' .--./ #
| | #
' '--'\ #
`-----' #
##
#
,------. #
| .-. \ #
| | \ : #
| '--' / #
`-------' #
##
#
,------. #
| .---' #
| `--, #
| `---. #
`------' #
##
#
,------. #
| .---' #
| `--, #
| |` #
`--' #
##
#
,----. #
' .-./ #
| | .---. #
' '--' | #
`------' #
##
#
,--. ,--. #
| '--' | #
| .--. | #
| | | | #
`--' `--' #
##
#
,--. #
| | #
| | #
| | #
`--' #
##
#
,--. #
| | #
,--. | | #
| '-' / #
`-----' #
##
#
,--. ,--. #
| .' / #
| . ' #
| |\ \ #
`--' '--' #
##
#
,--. #
| | #
| | #
| '--. #
`-----' #
##
#
,--. ,--. #
| `.' | #
| |'.'| | #
| | | | #
`--' `--' #
##
#
,--. ,--. #
| ,'.| | #
| |' ' | #
| | ` | #
`--' `--' #
##
#
,-----. #
' .-. ' #
| | | | #
' '-' ' #
`-----' #
##
#
,------. #
| .--. ' #
| '--' | #
| | --' #
`--' #
##
#
,-----. #
' .-. ' #
| | | | #
' '-' '-. #
`-----'--' #
##
#
,------. #
| .--. ' #
| '--'.' #
| |\ \ #
`--' '--' #
##
#
,---. #
' .-' #
`. `-. #
.-' | #
`-----' #
##
#
,--------. #
'--. .--' #
| | #
| | #
`--' #
##
#
,--. ,--. #
| | | | #
| | | | #
' '-' ' #
`-----' #
##
#
,--. ,--. #
\ `.' / #
\ / #
\ / #
`-' #
##
#
,--. ,--. #
| | | | #
| |.'.| | #
| ,'. | #
'--' '--' #
##
#
,--. ,--. #
\ `.' / #
.' \ #
/ .'. \ #
'--' '--' #
##
#
,--. ,--. #
\ `.' / #
'. / #
| | #
`--' #
##
#
,-------. #
`--. / #
/ / #
/ `--. #
`-------' #
##
#
,----. #
| .-' #
| | #
| | #
| '-. #
`----' ##
,--. #
\ \ #
\ \ #
\ \ #
\ \ #
\ \ #
`--' ##
#
,----. #
`-. | #
| | #
| | #
.-' | #
`----' ##
#
,---. #
/ \ \ #
`--' `--' #
#
#
##
#
#
#
#
,----. #
'----' #
##
#
,--. #
'. \ #
`--' #
#
#
##
#
#
,--,--. #
' ,-. | #
\ '-' | #
`--`--' #
##
#
,--. #
| |-. #
| .-. ' #
| `-' | #
`---' #
##
#
#
,---. #
| .--' #
\ `--. #
`---' #
##
#
,--. #
,-| | #
' .-. | #
\ `-' | #
`---' #
##
#
#
,---. #
| .-. : #
\ --. #
`----' #
##
#
,---. #
/ .-' #
| `-, #
| .-' #
`--' #
##
#
#
,---. #
| .-. | #
' '-' ' #
.`- / #
`---' ##
#
,--. #
| ,---. #
| .-. | #
| | | | #
`--' `--' #
##
#
,--. #
`--' #
,--. #
| | #
`--' #
##
#
,--. #
`--' #
,--. #
| | #
.-' / #
'---' ##
#
,--. #
| |,-. #
| / #
| \ \ #
`--'`--' #
##
#
,--. #
| | #
| | #
| | #
`--' #
##
#
#
,--,--,--. #
| | #
| | | | #
`--`--`--' #
##
#
#
,--,--, #
| \ #
| || | #
`--''--' #
##
#
#
,---. #
| .-. | #
' '-' ' #
`---' #
##
#
#
,---. #
| .-. | #
| '-' ' #
| |-' #
`--' ##
#
#
,---. #
| .-. | #
' '-' | #
`-| | #
`--' ##
#
#
,--.--. #
| .--' #
| | #
`--' #
##
#
#
,---. #
( .-' #
.-' `) #
`----' #
##
#
,--. #
,-' '-. #
'-. .-' #
| | #
`--' #
##
#
#
,--.,--. #
| || | #
' '' ' #
`----' #
##
#
#
,--. ,--. #
\ `' / #
\ / #
`--' #
##
#
#
,--. ,--. #
| |.'.| | #
| .'. | #
'--' '--' #
##
#
#
,--. ,--. #
\ `' / #
/ /. \ #
'--' '--' #
##
#
#
,--. ,--. #
\ ' / #
\ ' #
.-' / #
`---' ##
#
#
,-----. #
`-. / #
/ `-. #
`-----' #
##
#
,--. #
| .' #
.' / #
'. \ #
| '. #
`--' ##
,--. #
| | #
| | #
| | #
| | #
| | #
`--' ##
#
,--. #
'. | #
\ `. #
/ .' #
.' | #
'--' ##
#
.--, #
.--' / #
/ ---` #
`--' #
#
##
#
,---. #
/ O \ #
| .-. | #
| | | | #
`--' `--' #
##
#
,-----. #
' .-. ' #
| | | | #
' '-' ' #
`-----' #
##
#
,--. ,--. #
| | | | #
| | | | #
' '-' ' #
`-----' #
##
#
#
,--,--. #
' ,-. | #
\ '-' | #
`--`--' #
##
#
#
,---. #
| .-. | #
' '-' ' #
`---' #
##
#
#
,--.,--. #
| || | #
' '' ' #
`----' #
##
ß#
#
#
#
#
#
##
0xCA0 KANNADA LETTER TTHA
_____)#
|____/ #
,---. #
' .-. ' #
' '-' ' #
`---' #
##
@@ -0,0 +1,93 @@
import * as _heroui_aria_utils from '@heroui/aria-utils';
import { OverlayOptions } from '@heroui/aria-utils';
import * as react from 'react';
import { ReactNode } from 'react';
import * as _heroui_system from '@heroui/system';
import { PropGetter, HTMLHeroUIProps } from '@heroui/system';
import { PopoverVariantProps, SlotsToClasses } from '@heroui/theme';
import { AriaTooltipProps } from '@react-types/tooltip';
import { OverlayTriggerProps } from '@react-types/overlays';
import { HTMLMotionProps } from 'framer-motion';
import { AriaOverlayProps } from '@react-aria/overlays';
import { ReactRef } from '@heroui/react-utils';
interface Props extends Omit<HTMLHeroUIProps, "content"> {
/**
* Ref to the DOM node.
*/
ref?: ReactRef<HTMLElement | null>;
/**
* The children to render. Usually a trigger element.
*/
children?: ReactNode;
/**
* The content of the tooltip.
*/
content?: string | React.ReactNode;
/**
* Whether the tooltip should be disabled, independent from the trigger.
*/
isDisabled?: boolean;
/**
* The delay time in ms for the tooltip to show up.
* @default 0
*/
delay?: number;
/**
* The delay time in ms for the tooltip to hide.
* @default 500
*/
closeDelay?: number;
/**
* By default, opens for both focus and hover. Can be made to open only for focus.
*/
trigger?: "focus";
/**
* The props to modify the framer motion animation. Use the `variants` API to create your own animation.
*/
motionProps?: HTMLMotionProps<"div">;
/**
* The container element in which the overlay portal will be placed.
* @default document.body
*/
portalContainer?: Element;
/**
* List of dependencies to update the position of the tooltip.
* @default []
*/
updatePositionDeps?: any[];
/**
* Classname or List of classes to change the classNames of the element.
* if `className` is passed, it will be added to the base slot.
*
* @example
* ```ts
* <Tooltip classNames={{
* base:"base-classes",
* content: "content-classes",
* arrow: "arrow-classes",
* }} />
* ```
*/
classNames?: SlotsToClasses<"base" | "arrow" | "content">;
}
type UseTooltipProps = Props & AriaTooltipProps & AriaOverlayProps & OverlayTriggerProps & OverlayOptions & PopoverVariantProps;
declare function useTooltip(originalProps: UseTooltipProps): {
Component: _heroui_system.As<any>;
content: ReactNode;
children: ReactNode;
isOpen: boolean;
triggerRef: react.RefObject<HTMLElement>;
showArrow: boolean;
portalContainer: Element | undefined;
placement: _heroui_aria_utils.OverlayPlacement;
disableAnimation: boolean;
isDisabled: boolean | undefined;
motionProps: HTMLMotionProps<"div"> | undefined;
getTooltipContentProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getTriggerProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getTooltipProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
};
type UseTooltipReturn = ReturnType<typeof useTooltip>;
export { UseTooltipProps, UseTooltipReturn, useTooltip };
@@ -0,0 +1,76 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.unwrapEC2Signature = unwrapEC2Signature;
const asn1_schema_1 = require("@peculiar/asn1-schema");
const asn1_ecc_1 = require("@peculiar/asn1-ecc");
const cose_js_1 = require("../../cose.js");
const index_js_1 = require("../index.js");
/**
* In WebAuthn, EC2 signatures are wrapped in ASN.1 structure so we need to peel r and s apart.
*
* See https://www.w3.org/TR/webauthn-2/#sctn-signature-attestation-types
*/
function unwrapEC2Signature(signature, crv) {
const parsedSignature = asn1_schema_1.AsnParser.parse(signature, asn1_ecc_1.ECDSASigValue);
const rBytes = new Uint8Array(parsedSignature.r);
const sBytes = new Uint8Array(parsedSignature.s);
const componentLength = getSignatureComponentLength(crv);
const rNormalizedBytes = toNormalizedBytes(rBytes, componentLength);
const sNormalizedBytes = toNormalizedBytes(sBytes, componentLength);
const finalSignature = index_js_1.isoUint8Array.concat([
rNormalizedBytes,
sNormalizedBytes,
]);
return finalSignature;
}
/**
* The SubtleCrypto Web Crypto API expects ECDSA signatures with `r` and `s` values to be encoded
* to a specific length depending on the order of the curve. This function returns the expected
* byte-length for each of the `r` and `s` signature components.
*
* See <https://www.w3.org/TR/WebCryptoAPI/#ecdsa-operations>
*/
function getSignatureComponentLength(crv) {
switch (crv) {
case cose_js_1.COSECRV.P256:
return 32;
case cose_js_1.COSECRV.P384:
return 48;
case cose_js_1.COSECRV.P521:
return 66;
default:
throw new Error(`Unexpected COSE crv value of ${crv} (EC2)`);
}
}
/**
* Converts the ASN.1 integer representation to bytes of a specific length `n`.
*
* DER encodes integers as big-endian byte arrays, with as small as possible representation and
* requires a leading `0` byte to disambiguate between negative and positive numbers. This means
* that `r` and `s` can potentially not be the expected byte-length that is needed by the
* SubtleCrypto Web Crypto API: if there are leading `0`s it can be shorter than expected, and if
* it has a leading `1` bit, it can be one byte longer.
*
* See <https://www.itu.int/rec/T-REC-X.690-202102-I/en>
* See <https://www.w3.org/TR/WebCryptoAPI/#ecdsa-operations>
*/
function toNormalizedBytes(bytes, componentLength) {
let normalizedBytes;
if (bytes.length < componentLength) {
// In case the bytes are shorter than expected, we need to pad it with leading `0`s.
normalizedBytes = new Uint8Array(componentLength);
normalizedBytes.set(bytes, componentLength - bytes.length);
}
else if (bytes.length === componentLength) {
normalizedBytes = bytes;
}
else if (bytes.length === componentLength + 1 && bytes[0] === 0 && (bytes[1] & 0x80) === 0x80) {
// The bytes contain a leading `0` to encode that the integer is positive. This leading `0`
// needs to be removed for compatibility with the SubtleCrypto Web Crypto API.
normalizedBytes = bytes.subarray(1);
}
else {
throw new Error(`Invalid signature component length ${bytes.length}, expected ${componentLength}`);
}
return normalizedBytes;
}
@@ -0,0 +1,74 @@
import LinesAndColumns from "lines-and-columns";
import {formatTokenType} from "../parser/tokenizer/types";
export default function formatTokens(code, tokens) {
if (tokens.length === 0) {
return "";
}
const tokenKeys = Object.keys(tokens[0]).filter(
(k) => k !== "type" && k !== "value" && k !== "start" && k !== "end" && k !== "loc",
);
const typeKeys = Object.keys(tokens[0].type).filter((k) => k !== "label" && k !== "keyword");
const headings = ["Location", "Label", "Raw", ...tokenKeys, ...typeKeys];
const lines = new LinesAndColumns(code);
const rows = [headings, ...tokens.map(getTokenComponents)];
const padding = headings.map(() => 0);
for (const components of rows) {
for (let i = 0; i < components.length; i++) {
padding[i] = Math.max(padding[i], components[i].length);
}
}
return rows
.map((components) => components.map((component, i) => component.padEnd(padding[i])).join(" "))
.join("\n");
function getTokenComponents(token) {
const raw = code.slice(token.start, token.end);
return [
formatRange(token.start, token.end),
formatTokenType(token.type),
truncate(String(raw), 14),
// @ts-ignore: Intentional dynamic access by key.
...tokenKeys.map((key) => formatValue(token[key], key)),
// @ts-ignore: Intentional dynamic access by key.
...typeKeys.map((key) => formatValue(token.type[key], key)),
];
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function formatValue(value, key) {
if (value === true) {
return key;
} else if (value === false || value === null) {
return "";
} else {
return String(value);
}
}
function formatRange(start, end) {
return `${formatPos(start)}-${formatPos(end)}`;
}
function formatPos(pos) {
const location = lines.locationForIndex(pos);
if (!location) {
return "Unknown";
} else {
return `${location.line + 1}:${location.column + 1}`;
}
}
}
function truncate(s, length) {
if (s.length > length) {
return `${s.slice(0, length - 3)}...`;
} else {
return s;
}
}
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Tailwid Variants
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,718 @@
flf2a$ 7 7 20 -1 3
banner3 by Merlin Greywolf merlin@brahms.udel.edu
August 9, 1994
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@@
####$@
####$@
####$@
## $@
$@
####$@
####$@@
#### ####$@
#### ####$@
## ## $@
$ $@
$ $@
$@
$@@
## ## $@
## ## $@
#########$@
## ## $@
#########$@
## ## $@
## ## $@@
######## $@
## ## ##$@
## ## $@
######## $@
## ##$@
## ## ##$@
######## $@@
##### ## $@
## ## ## $@
##### ## $@
## $@
## #####$@
## ## ##$@
## #####$@@
#### $@
## ## $@
#### $@
#### $@
## ## ##$@
## ## $@
#### ##$@@
####$@
####$@
## $@
## $@
$@
$@
$@@
###$@
## $@
## $@
## $@
## $@
## $@
###$@@
### $@
## $@
##$@
##$@
##$@
## $@
### $@@
$@
## ## $@
## ## $@
#########$@
## ## $@
## ## $@
$@@
$@
## $@
## $@
######$@
## $@
## $@
$@@
$@
$@
$@
####$@
####$@
## $@
## $@@
$@
$@
$@
#######$@
$@
$@
$@@
$@
$@
$@
$@
$@
###$@
###$@@
##$@
## $@
## $@
## $@
## $@
## $@
## $@@
##### $@
## ## $@
## ##$@
## ##$@
## ##$@
## ## $@
##### $@@
## $@
#### $@
## $@
## $@
## $@
## $@
######$@@
####### $@
## ##$@
##$@
####### $@
## $@
## $@
#########$@@
####### $@
## ##$@
##$@
####### $@
##$@
## ##$@
####### $@@
## $@
## ## $@
## ## $@
## ## $@
#########$@
## $@
## $@@
########$@
## $@
## $@
####### $@
##$@
## ##$@
###### $@@
####### $@
## ##$@
## $@
######## $@
## ##$@
## ##$@
####### $@@
########$@
## ##$@
## $@
## $@
## $@
## $@
## $@@
####### $@
## ##$@
## ##$@
####### $@
## ##$@
## ##$@
####### $@@
####### $@
## ##$@
## ##$@
########$@
##$@
## ##$@
####### $@@
## $@
####$@
## $@
$@
## $@
####$@
## $@@
####$@
####$@
$@
####$@
####$@
## $@
## $@@
##$@
## $@
## $@
## $@
## $@
## $@
##$@@
$@
$@
#####$@
$@
#####$@
$@
$@@
## $@
## $@
## $@
##$@
## $@
## $@
## $@@
####### $@
## ##$@
## $@
### $@
## $@
$@
## $@@
####### $@
## ##$@
## ### ##$@
## ### ##$@
## ##### $@
## $@
####### $@@
### $@
## ## $@
## ## $@
## ##$@
#########$@
## ##$@
## ##$@@
######## $@
## ##$@
## ##$@
######## $@
## ##$@
## ##$@
######## $@@
###### $@
## ##$@
## $@
## $@
## $@
## ##$@
###### $@@
######## $@
## ##$@
## ##$@
## ##$@
## ##$@
## ##$@
######## $@@
########$@
## $@
## $@
###### $@
## $@
## $@
########$@@
########$@
## $@
## $@
###### $@
## $@
## $@
## $@@
###### $@
## ## $@
## $@
## ####$@
## ## $@
## ## $@
###### $@@
## ##$@
## ##$@
## ##$@
#########$@
## ##$@
## ##$@
## ##$@@
####$@
## $@
## $@
## $@
## $@
## $@
####$@@
##$@
##$@
##$@
##$@
## ##$@
## ##$@
###### $@@
## ##$@
## ## $@
## ## $@
##### $@
## ## $@
## ## $@
## ##$@@
## $@
## $@
## $@
## $@
## $@
## $@
########$@@
## ##$@
### ###$@
#### ####$@
## ### ##$@
## ##$@
## ##$@
## ##$@@
## ##$@
### ##$@
#### ##$@
## ## ##$@
## ####$@
## ###$@
## ##$@@
####### $@
## ##$@
## ##$@
## ##$@
## ##$@
## ##$@
####### $@@
######## $@
## ##$@
## ##$@
######## $@
## $@
## $@
## $@@
####### $@
## ##$@
## ##$@
## ##$@
## ## ##$@
## ## $@
##### ##$@@
######## $@
## ##$@
## ##$@
######## $@
## ## $@
## ## $@
## ##$@@
###### $@
## ##$@
## $@
###### $@
##$@
## ##$@
###### $@@
########$@
## $@
## $@
## $@
## $@
## $@
## $@@
## ##$@
## ##$@
## ##$@
## ##$@
## ##$@
## ##$@
####### $@@
## ##$@
## ##$@
## ##$@
## ##$@
## ## $@
## ## $@
### $@@
## ##$@
## ## ##$@
## ## ##$@
## ## ##$@
## ## ##$@
## ## ##$@
### ### $@@
## ##$@
## ## $@
## ## $@
### $@
## ## $@
## ## $@
## ##$@@
## ##$@
## ## $@
#### $@
## $@
## $@
## $@
## $@@
########$@
## $@
## $@
## $@
## $@
## $@
########$@@
######$@
## $@
## $@
## $@
## $@
## $@
######$@@
## $@
## $@
## $@
## $@
## $@
## $@
##$@@
######$@
##$@
##$@
##$@
##$@
##$@
######$@@
### $@
## ## $@
## ##$@
$@
$@
$@
$@@
$@
$@
$@
$@
$@
$@
#######$@@
####$@
####$@
## $@
##$@
$@
$@
$@@
### $@
## ## $@
## ## $@
## ##$@
#########$@
## ##$@
## ##$@@
######## $@
## ##$@
## ##$@
######## $@
## ##$@
## ##$@
######## $@@
###### $@
## ##$@
## $@
## $@
## $@
## ##$@
###### $@@
######## $@
## ##$@
## ##$@
## ##$@
## ##$@
## ##$@
######## $@@
########$@
## $@
## $@
###### $@
## $@
## $@
########$@@
########$@
## $@
## $@
###### $@
## $@
## $@
## $@@
###### $@
## ## $@
## $@
## ####$@
## ## $@
## ## $@
###### $@@
## ##$@
## ##$@
## ##$@
#########$@
## ##$@
## ##$@
## ##$@@
####$@
## $@
## $@
## $@
## $@
## $@
####$@@
##$@
##$@
##$@
##$@
## ##$@
## ##$@
###### $@@
## ##$@
## ## $@
## ## $@
##### $@
## ## $@
## ## $@
## ##$@@
## $@
## $@
## $@
## $@
## $@
## $@
########$@@
## ##$@
### ###$@
#### ####$@
## ### ##$@
## ##$@
## ##$@
## ##$@@
## ##$@
### ##$@
#### ##$@
## ## ##$@
## ####$@
## ###$@
## ##$@@
####### $@
## ##$@
## ##$@
## ##$@
## ##$@
## ##$@
####### $@@
######## $@
## ##$@
## ##$@
######## $@
## $@
## $@
## $@@
####### $@
## ##$@
## ##$@
## ##$@
## ## ##$@
## ## $@
##### ##$@@
######## $@
## ##$@
## ##$@
######## $@
## ## $@
## ## $@
## ##$@@
###### $@
## ##$@
## $@
###### $@
##$@
## ##$@
###### $@@
########$@
## $@
## $@
## $@
## $@
## $@
## $@@
## ##$@
## ##$@
## ##$@
## ##$@
## ##$@
## ##$@
####### $@@
## ##$@
## ##$@
## ##$@
## ##$@
## ## $@
## ## $@
### $@@
## ##$@
## ## ##$@
## ## ##$@
## ## ##$@
## ## ##$@
## ## ##$@
### ### $@@
## ##$@
## ## $@
## ## $@
### $@
## ## $@
## ## $@
## ##$@@
## ##$@
## ## $@
#### $@
## $@
## $@
## $@
## $@@
########$@
## $@
## $@
## $@
## $@
## $@
########$@@
####$@
## $@
## $@
### $@
## $@
## $@
####$@@
##$@
##$@
##$@
$@
##$@
##$@
##$@@
#### $@
## $@
## $@
###$@
## $@
## $@
#### $@@
#### $@
## ## ##$@
#### $@
$@
$@
$@
$@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@@ -0,0 +1,35 @@
import baseHas from './_baseHas.js';
import hasPath from './_hasPath.js';
/**
* Checks if `path` is a direct property of `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = { 'a': { 'b': 2 } };
* var other = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.has(object, 'a');
* // => true
*
* _.has(object, 'a.b');
* // => true
*
* _.has(object, ['a', 'b']);
* // => true
*
* _.has(other, 'a');
* // => false
*/
function has(object, path) {
return object != null && hasPath(object, path, baseHas);
}
export default has;
@@ -0,0 +1,38 @@
// Sinhalese [si]
import dayjs from '../index';
var locale = {
name: 'si',
weekdays: 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split('_'),
months: 'දුරුතු_නවම්_මැදින්_බක්_වෙසක්_පොසොන්_ඇසළ_නිකිණි_බිනර_වප්_ඉල්_උඳුවප්'.split('_'),
weekdaysShort: 'ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන'.split('_'),
monthsShort: 'දුරු_නව_මැදි_බක්_වෙස_පොසො_ඇස_නිකි_බින_වප්_ඉල්_උඳු'.split('_'),
weekdaysMin: 'ඉ_ස_අ_බ_බ්‍ර_සි_සෙ'.split('_'),
ordinal: function ordinal(n) {
return n;
},
formats: {
LT: 'a h:mm',
LTS: 'a h:mm:ss',
L: 'YYYY/MM/DD',
LL: 'YYYY MMMM D',
LLL: 'YYYY MMMM D, a h:mm',
LLLL: 'YYYY MMMM D [වැනි] dddd, a h:mm:ss'
},
relativeTime: {
future: '%sකින්',
past: '%sකට පෙර',
s: 'තත්පර කිහිපය',
m: 'විනාඩිය',
mm: 'විනාඩි %d',
h: 'පැය',
hh: 'පැය %d',
d: 'දිනය',
dd: 'දින %d',
M: 'මාසය',
MM: 'මාස %d',
y: 'වසර',
yy: 'වසර %d'
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,253 @@
import { DOMAttributes, Key, KeyboardDelegate, FocusStrategy, RefObject, FocusableElement, LayoutDelegate, Rect, Size, Collection, Direction, DisabledBehavior, Node, Orientation } from "@react-types/shared";
import { MultipleSelectionManager } from "@react-stately/selection";
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;
export interface AriaSelectableCollectionOptions {
/**
* An interface for reading and updating multiple selection state.
*/
selectionManager: MultipleSelectionManager;
/**
* A delegate object that implements behavior for keyboard focus movement.
*/
keyboardDelegate: KeyboardDelegate;
/**
* The ref attached to the element representing the collection.
*/
ref: RefObject<HTMLElement | null>;
/**
* Whether the collection or one of its items should be automatically focused upon render.
* @default false
*/
autoFocus?: boolean | FocusStrategy;
/**
* Whether focus should wrap around when the end/start is reached.
* @default false
*/
shouldFocusWrap?: boolean;
/**
* Whether the collection allows empty selection.
* @default false
*/
disallowEmptySelection?: boolean;
/**
* Whether the collection allows the user to select all items via keyboard shortcut.
* @default false
*/
disallowSelectAll?: boolean;
/**
* Whether selection should occur automatically on focus.
* @default false
*/
selectOnFocus?: boolean;
/**
* Whether typeahead is disabled.
* @default false
*/
disallowTypeAhead?: boolean;
/**
* Whether the collection items should use virtual focus instead of being focused directly.
*/
shouldUseVirtualFocus?: boolean;
/**
* Whether navigation through tab key is enabled.
*/
allowsTabNavigation?: boolean;
/**
* Whether the collection items are contained in a virtual scroller.
*/
isVirtualized?: boolean;
/**
* The ref attached to the scrollable body. Used to provide automatic scrolling on item focus for non-virtualized collections.
* If not provided, defaults to the collection ref.
*/
scrollRef?: RefObject<HTMLElement | null>;
/**
* The behavior of links in the collection.
* - 'action': link behaves like onAction.
* - 'selection': link follows selection interactions (e.g. if URL drives selection).
* - 'override': links override all other interactions (link items are not selectable).
* @default 'action'
*/
linkBehavior?: 'action' | 'selection' | 'override';
}
export interface SelectableCollectionAria {
/** Props for the collection element. */
collectionProps: DOMAttributes;
}
/**
* Handles interactions with selectable collections.
*/
export function useSelectableCollection(options: AriaSelectableCollectionOptions): SelectableCollectionAria;
export interface SelectableItemOptions {
/**
* An interface for reading and updating multiple selection state.
*/
selectionManager: MultipleSelectionManager;
/**
* A unique key for the item.
*/
key: Key;
/**
* Ref to the item.
*/
ref: RefObject<FocusableElement | null>;
/**
* By default, selection occurs on pointer down. This can be strange if selecting an
* item causes the UI to disappear immediately (e.g. menus).
*/
shouldSelectOnPressUp?: boolean;
/**
* Whether selection requires the pointer/mouse down and up events to occur on the same target or triggers selection on
* the target of the pointer/mouse up event.
*/
allowsDifferentPressOrigin?: boolean;
/**
* Whether the option is contained in a virtual scroller.
*/
isVirtualized?: boolean;
/**
* Function to focus the item.
*/
focus?: () => void;
/**
* Whether the option should use virtual focus instead of being focused directly.
*/
shouldUseVirtualFocus?: boolean;
/** Whether the item is disabled. */
isDisabled?: boolean;
/**
* Handler that is called when a user performs an action on the item. The exact user event depends on
* the collection's `selectionBehavior` prop and the interaction modality.
*/
onAction?: () => void;
/**
* The behavior of links in the collection.
* - 'action': link behaves like onAction.
* - 'selection': link follows selection interactions (e.g. if URL drives selection).
* - 'override': links override all other interactions (link items are not selectable).
* - 'none': links are disabled for both selection and actions (e.g. handled elsewhere).
* @default 'action'
*/
linkBehavior?: 'action' | 'selection' | 'override' | 'none';
}
export interface SelectableItemStates {
/** Whether the item is currently in a pressed state. */
isPressed: boolean;
/** Whether the item is currently selected. */
isSelected: boolean;
/** Whether the item is currently focused. */
isFocused: boolean;
/**
* Whether the item is non-interactive, i.e. both selection and actions are disabled and the item may
* not be focused. Dependent on `disabledKeys` and `disabledBehavior`.
*/
isDisabled: boolean;
/**
* Whether the item may be selected, dependent on `selectionMode`, `disabledKeys`, and `disabledBehavior`.
*/
allowsSelection: boolean;
/**
* Whether the item has an action, dependent on `onAction`, `disabledKeys`,
* and `disabledBehavior`. It may also change depending on the current selection state
* of the list (e.g. when selection is primary). This can be used to enable or disable hover
* styles or other visual indications of interactivity.
*/
hasAction: boolean;
}
export interface SelectableItemAria extends SelectableItemStates {
/**
* Props to be spread on the item root node.
*/
itemProps: DOMAttributes;
}
/**
* Handles interactions with an item in a selectable collection.
*/
export function useSelectableItem(options: SelectableItemOptions): SelectableItemAria;
export class DOMLayoutDelegate implements LayoutDelegate {
constructor(ref: RefObject<HTMLElement | null>);
getItemRect(key: Key): Rect | null;
getContentSize(): Size;
getVisibleRect(): Rect;
}
interface ListKeyboardDelegateOptions<T> {
collection: Collection<Node<T>>;
ref: RefObject<HTMLElement | null>;
collator?: Intl.Collator;
layout?: 'stack' | 'grid';
orientation?: Orientation;
direction?: Direction;
disabledKeys?: Set<Key>;
disabledBehavior?: DisabledBehavior;
layoutDelegate?: LayoutDelegate;
}
export class ListKeyboardDelegate<T> implements KeyboardDelegate {
constructor(collection: Collection<Node<T>>, disabledKeys: Set<Key>, ref: RefObject<HTMLElement | null>, collator?: Intl.Collator);
constructor(options: ListKeyboardDelegateOptions<T>);
getNextKey(key: Key): Key | null;
getPreviousKey(key: Key): Key | null;
getKeyBelow(key: Key): Key | null;
getKeyAbove(key: Key): Key | null;
getKeyRightOf?(key: Key): Key | null;
getKeyLeftOf?(key: Key): Key | null;
getFirstKey(): Key | null;
getLastKey(): Key | null;
getKeyPageAbove(key: Key): Key | null;
getKeyPageBelow(key: Key): Key | null;
getKeyForSearch(search: string, fromKey?: Key): Key | null;
}
export interface AriaSelectableListOptions extends Omit<AriaSelectableCollectionOptions, 'keyboardDelegate'> {
/**
* State of the collection.
*/
collection: Collection<Node<unknown>>;
/**
* A delegate object that implements behavior for keyboard focus movement.
*/
keyboardDelegate?: KeyboardDelegate;
/**
* A delegate object that provides layout information for items in the collection.
* By default this uses the DOM, but this can be overridden to implement things like
* virtualized scrolling.
*/
layoutDelegate?: LayoutDelegate;
/**
* The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.
*/
disabledKeys: Set<Key>;
}
export interface SelectableListAria {
/**
* Props for the option element.
*/
listProps: DOMAttributes;
}
/**
* Handles interactions with a selectable list.
*/
export function useSelectableList(props: AriaSelectableListOptions): SelectableListAria;
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClassNameDefinition = void 0;
const DefinitionBase_1 = require("./DefinitionBase");
const DefinitionType_1 = require("./DefinitionType");
class ClassNameDefinition extends DefinitionBase_1.DefinitionBase {
isTypeDefinition = true;
isVariableDefinition = true;
constructor(name, node) {
super(DefinitionType_1.DefinitionType.ClassName, name, node, null);
}
}
exports.ClassNameDefinition = ClassNameDefinition;
@@ -0,0 +1 @@
{"version":3,"file":"default.replacer.js","sourceRoot":"","sources":["../../src/replacers/default.replacer.ts"],"names":[],"mappings":";;AAQA,gDAAiD;AACjD,+BAAyC;AAEzC,oCAA0C;AAE1C,SAAS,kBAAkB,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAY;IACxC,OAAO,IAAI,MAAM,CACf,OAAO,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,wBAAwB,EAC/D,GAAG,CACJ,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,cAAsB,EAAE,KAAY;IAC7D,OAAO,cAAc,CAAC,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;AACjE,CAAC;AAED,SAAwB,sBAAsB,CAAC,EAC7C,IAAI,EACJ,IAAI,EACJ,MAAM,EACiB;;IACvB,MAAM,cAAc,GAAG,MAAA,MAAA,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAc,GAAE,CAAC,0CAAE,MAAM,0CAAE,IAAI,CAAC;IAClE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,qCAAqC,EAAE,cAAc,CAAC,CAAC;IAC3E,MAAM,CAAC,MAAM,CAAC,MAAM,CAClB,OAAO,cAAc,IAAI,QAAQ,EACjC,uCAAuC,IAAI,EAAE,CAC9C,CAAC;IAEF,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACtD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;IAEzD,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,MAAM,OAAO,GAAG,KAAK,CAAC,uBAAuB;QAC3C,CAAC;YAEC,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,cAAc,KAAK,KAAK,CAAC,MAAM;QAC5E,CAAC;YAIC,cAAc,KAAK,KAAK,CAAC,MAAM;gBAC/B,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;IAElD,IAAI,OAAO,EAAE;QACX,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC3C,IAAI,iBAAiB,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAC3D,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EACvB,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CACpB,CAAC;YACF,MAAM,CAAC,MAAM,CAAC,KAAK,CACjB,wCAAwC,EACxC,iBAAiB,CAClB,CAAC;YAEF,IAAI,iBAAiB,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;gBACvC,IAAI,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;oBAChC,iBAAiB,GAAG,iBAAiB,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;iBAC1D;qBAAM;oBACL,SAAS;iBACV;aACF;YAGD,IACE,CAAC,MAAM,CAAC,SAAS,CAAC,mBAAmB,CACnC,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,cAAc,CAAC,MAAM;gBAC1C,CAAC,CAAC,aAAa,CAAC,iBAAiB,CAAC;gBAClC,CAAC,CAAC,aAAa,CACX,GAAG,iBAAiB,IAAI,iBAAiB,CACvC,cAAc,EACd,KAAK,CACN,EAAE,CACJ,CACN,EACD;gBACA,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;gBACvD,SAAS;aACV;YAED,IAAI,iBAAiB,GAAW,aAAa,CAC3C,IAAA,eAAQ,EAAC,IAAA,cAAO,EAAC,IAAI,CAAC,EAAE,iBAAiB,CAAC,CAC3C,CAAC;YAEF,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;gBACtC,iBAAiB,GAAG,IAAI,GAAG,iBAAiB,CAAC;aAC9C;YACD,MAAM,CAAC,MAAM,CAAC,KAAK,CACjB,wCAAwC,EACxC,iBAAiB,CAClB,CAAC;YAEF,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACzC,MAAM,eAAe,GACnB,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC;gBACxB,iBAAiB;gBACjB,GAAG;gBACH,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC9C,MAAM,CAAC,MAAM,CAAC,KAAK,CACjB,sCAAsC,EACtC,eAAe,CAChB,CAAC;YAEF,MAAM,UAAU,GAAG,eAAe,CAAC,KAAK,CAAC,IAAA,sBAAc,GAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;YACvE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,EAAE,UAAU,CAAC,CAAC;YAEnE,OAAO,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;SACvE;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AA9FD,yCA8FC","sourcesContent":["/**\n * @file\n *\n * The default replacer replaces the alias in an import statement\n * with the proper aliased location.\n */\n\n/** */\nimport normalizePath = require('normalize-path');\nimport { dirname, relative } from 'path';\nimport { Alias, AliasReplacerArguments } from '../interfaces';\nimport { newStringRegex } from '../utils';\n\nfunction escapeSpecialChars(str: string) {\n return str.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n}\n\nfunction getAliasPrefixRegExp(alias: Alias) {\n return new RegExp(\n `(?:^${escapeSpecialChars(alias.prefix)})|(?:\\\\.(js|ts|json)$)`,\n 'g'\n );\n}\n\nfunction removeAliasPrefix(requiredModule: string, alias: Alias) {\n return requiredModule.replace(getAliasPrefixRegExp(alias), '');\n}\n\nexport default function replaceImportStatement({\n orig,\n file,\n config\n}: AliasReplacerArguments) {\n const requiredModule = orig.match(newStringRegex())?.groups?.path;\n config.output.debug('default replacer - requiredModule: ', requiredModule);\n config.output.assert(\n typeof requiredModule == 'string',\n `Unexpected import statement pattern ${orig}`\n );\n // Lookup which alias should be used for this given requiredModule.\n const alias = config.aliasTrie.search(requiredModule);\n config.output.debug('default replacer - alias: ', alias);\n // If an alias isn't found the original.\n if (!alias) return orig;\n\n const isAlias = alias.shouldPrefixMatchWildly\n ? // if the alias is like alias*\n // beware that typescript expects requiredModule be more than just alias\n requiredModule.startsWith(alias.prefix) && requiredModule !== alias.prefix\n : // need to be a bit more careful if the alias doesn't ended with a *\n // in this case the statement must be like either\n // require('alias') or require('alias/path');\n // but not require('aliaspath');\n requiredModule === alias.prefix ||\n requiredModule.startsWith(alias.prefix + '/');\n\n if (isAlias) {\n for (let i = 0; i < alias.paths.length; i++) {\n let absoluteAliasPath = coLine truncated
@@ -0,0 +1,49 @@
// TODO: this is all copy pasted from Vite - can they expose a module that exports only constants?
const KNOWN_ASSET_TYPES = [
"apng",
"bmp",
"png",
"jpe?g",
"jfif",
"pjpeg",
"pjp",
"gif",
"svg",
"ico",
"webp",
"avif",
"mp4",
"webm",
"ogg",
"mp3",
"wav",
"flac",
"aac",
"woff2?",
"eot",
"ttf",
"otf",
"webmanifest",
"pdf",
"txt"
];
const KNOWN_ASSET_RE = new RegExp(`\\.(${KNOWN_ASSET_TYPES.join("|")})$`);
const CSS_LANGS_RE = /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/;
/**
* Prefix for resolved Ids that are not valid browser import specifiers
*/
const VALID_ID_PREFIX = `/@id/`;
/**
* Plugins that use 'virtual modules' (e.g. for helper functions), prefix the
* module ID with `\0`, a convention from the rollup ecosystem.
* This prevents other plugins from trying to process the id (like node resolution),
* and core features like sourcemaps can use this info to differentiate between
* virtual modules and regular files.
* `\0` is not a permitted char in import URLs so we have to replace them during
* import analysis. The id will be decoded back before entering the plugins pipeline.
* These encoded virtual ids are also prefixed by the VALID_ID_PREFIX, so virtual
* modules in the browser end up encoded as `/@id/__x00__{id}`
*/
const NULL_BYTE_PLACEHOLDER = `__x00__`;
export { CSS_LANGS_RE, KNOWN_ASSET_RE, KNOWN_ASSET_TYPES, NULL_BYTE_PLACEHOLDER, VALID_ID_PREFIX };
@@ -0,0 +1,18 @@
'use strict';
var define = require('define-properties');
var getPolyfill = require('./polyfill');
var $IteratorPrototype = require('../Iterator.prototype/implementation');
module.exports = function shimIteratorPrototypeForEach() {
var polyfill = getPolyfill();
define(
$IteratorPrototype,
{ forEach: polyfill },
{ forEach: function () { return $IteratorPrototype.forEach !== polyfill; } }
);
return polyfill;
};
@@ -0,0 +1,34 @@
import type NameManager from "../NameManager";
import type TokenProcessor from "../TokenProcessor";
import type RootTransformer from "../transformers/RootTransformer";
export interface ClassHeaderInfo {
isExpression: boolean;
className: string | null;
hasSuperclass: boolean;
}
export interface TokenRange {
start: number;
end: number;
}
export interface FieldInfo extends TokenRange {
equalsIndex: number;
initializerName: string;
}
/**
* Information about a class returned to inform the implementation of class fields and constructor
* initializers.
*/
export interface ClassInfo {
headerInfo: ClassHeaderInfo;
constructorInitializerStatements: Array<string>;
instanceInitializerNames: Array<string>;
staticInitializerNames: Array<string>;
constructorInsertPos: number | null;
fields: Array<FieldInfo>;
rangesToRemove: Array<TokenRange>;
}
/**
* Get information about the class fields for this class, given a token processor pointing to the
* open-brace at the start of the class.
*/
export default function getClassInfo(rootTransformer: RootTransformer, tokens: TokenProcessor, nameManager: NameManager, disableESTransforms: boolean): ClassInfo;
@@ -0,0 +1,47 @@
/**
* Module dependencies.
*/
var crypto = require('crypto');
/**
* Sign the given `val` with `secret`.
*
* @param {String} val
* @param {String|NodeJS.ArrayBufferView|crypto.KeyObject} secret
* @return {String}
* @api private
*/
exports.sign = function(val, secret){
if ('string' != typeof val) throw new TypeError("Cookie value must be provided as a string.");
if (null == secret) throw new TypeError("Secret key must be provided.");
return val + '.' + crypto
.createHmac('sha256', secret)
.update(val)
.digest('base64')
.replace(/\=+$/, '');
};
/**
* Unsign and decode the given `input` with `secret`,
* returning `false` if the signature is invalid.
*
* @param {String} input
* @param {String|NodeJS.ArrayBufferView|crypto.KeyObject} secret
* @return {String|Boolean}
* @api private
*/
exports.unsign = function(input, secret){
if ('string' != typeof input) throw new TypeError("Signed cookie string must be provided.");
if (null == secret) throw new TypeError("Secret key must be provided.");
var tentativeValue = input.slice(0, input.lastIndexOf('.')),
expectedInput = exports.sign(tentativeValue, secret),
expectedBuffer = Buffer.from(expectedInput),
inputBuffer = Buffer.from(input);
return (
expectedBuffer.length === inputBuffer.length &&
crypto.timingSafeEqual(expectedBuffer, inputBuffer)
) ? tentativeValue : false;
};
@@ -0,0 +1,37 @@
"use client";
// src/menu-selected-icon.tsx
import { jsx } from "react/jsx-runtime";
function MenuSelectedIcon(props) {
const { isSelected, disableAnimation, ...otherProps } = props;
return /* @__PURE__ */ jsx(
"svg",
{
"aria-hidden": "true",
"data-selected": isSelected,
role: "presentation",
viewBox: "0 0 17 18",
...otherProps,
children: /* @__PURE__ */ jsx(
"polyline",
{
fill: "none",
points: "1 9 7 14 15 4",
stroke: "currentColor",
strokeDasharray: 22,
strokeDashoffset: isSelected ? 44 : 66,
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: 1.5,
style: !disableAnimation ? {
transition: "stroke-dashoffset 200ms ease"
} : {}
}
)
}
);
}
export {
MenuSelectedIcon
};
@@ -0,0 +1,4 @@
import { ServiceBase } from '../packet/handler/serviceRegister';
export declare class OlPushService extends ServiceBase {
handler(_seq: number, hex_data: string): Promise<void>;
}
@@ -0,0 +1,608 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'consistent-type-imports',
meta: {
type: 'suggestion',
docs: {
description: 'Enforce consistent usage of type imports',
},
fixable: 'code',
messages: {
avoidImportType: 'Use an `import` instead of an `import type`.',
noImportTypeAnnotations: '`import()` type annotations are forbidden.',
someImportsAreOnlyTypes: 'Imports {{typeImports}} are only used as type.',
typeOverValue: 'All imports in the declaration are only used as types. Use `import type`.',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
disallowTypeAnnotations: {
type: 'boolean',
description: 'Whether to disallow type imports in type annotations (`import()`).',
},
fixStyle: {
type: 'string',
description: 'The expected type modifier to be added when an import is detected as used only in the type position.',
enum: ['separate-type-imports', 'inline-type-imports'],
},
prefer: {
type: 'string',
description: 'The expected import kind for type-only imports.',
enum: ['type-imports', 'no-type-imports'],
},
},
},
],
},
defaultOptions: [
{
disallowTypeAnnotations: true,
fixStyle: 'separate-type-imports',
prefer: 'type-imports',
},
],
create(context, [option]) {
const prefer = option.prefer ?? 'type-imports';
const disallowTypeAnnotations = option.disallowTypeAnnotations !== false;
const selectors = {};
if (disallowTypeAnnotations) {
selectors.TSImportType = (node) => {
context.report({
node,
messageId: 'noImportTypeAnnotations',
});
};
}
if (prefer === 'no-type-imports') {
return {
...selectors,
'ImportDeclaration[importKind = "type"]'(node) {
context.report({
node,
messageId: 'avoidImportType',
fix(fixer) {
return fixRemoveTypeSpecifierFromImportDeclaration(fixer, node);
},
});
},
'ImportSpecifier[importKind = "type"]'(node) {
context.report({
node,
messageId: 'avoidImportType',
fix(fixer) {
return fixRemoveTypeSpecifierFromImportSpecifier(fixer, node);
},
});
},
};
}
// prefer type imports
const fixStyle = option.fixStyle ?? 'separate-type-imports';
let hasDecoratorMetadata = false;
const sourceImportsMap = {};
const emitDecoratorMetadata = (0, util_1.getParserServices)(context, true).emitDecoratorMetadata ?? false;
const experimentalDecorators = (0, util_1.getParserServices)(context, true).experimentalDecorators ?? false;
if (experimentalDecorators && emitDecoratorMetadata) {
selectors.Decorator = () => {
hasDecoratorMetadata = true;
};
}
return {
...selectors,
ImportDeclaration(node) {
const source = node.source.value;
// sourceImports is the object containing all the specifics for a particular import source, type or value
sourceImportsMap[source] ??= {
reportValueImports: [], // if there is a mismatch where type importKind but value specifiers
source,
typeOnlyNamedImport: null, // if only type imports
valueImport: null, // if only value imports
valueOnlyNamedImport: null, // if only value imports with named specifiers
};
const sourceImports = sourceImportsMap[source];
if (node.importKind === 'type') {
if (!sourceImports.typeOnlyNamedImport &&
node.specifiers.every(specifier => specifier.type === utils_1.AST_NODE_TYPES.ImportSpecifier)) {
// definitely import type { TypeX }
sourceImports.typeOnlyNamedImport = node;
}
}
else if (!sourceImports.valueOnlyNamedImport &&
node.specifiers.length &&
node.specifiers.every(specifier => specifier.type === utils_1.AST_NODE_TYPES.ImportSpecifier)) {
sourceImports.valueOnlyNamedImport = node;
sourceImports.valueImport = node;
}
else if (!sourceImports.valueImport &&
node.specifiers.some(specifier => specifier.type === utils_1.AST_NODE_TYPES.ImportDefaultSpecifier)) {
sourceImports.valueImport = node;
}
const typeSpecifiers = [];
const inlineTypeSpecifiers = [];
const valueSpecifiers = [];
const unusedSpecifiers = [];
for (const specifier of node.specifiers) {
if (specifier.type === utils_1.AST_NODE_TYPES.ImportSpecifier &&
specifier.importKind === 'type') {
inlineTypeSpecifiers.push(specifier);
continue;
}
const [variable] = context.sourceCode.getDeclaredVariables(specifier);
if (variable.references.length === 0) {
unusedSpecifiers.push(specifier);
}
else {
const onlyHasTypeReferences = variable.references.every(ref => {
/**
* keep origin import kind when export
* export { Type }
* export default Type;
* export = Type;
*/
if ((ref.identifier.parent.type ===
utils_1.AST_NODE_TYPES.ExportSpecifier ||
ref.identifier.parent.type ===
utils_1.AST_NODE_TYPES.ExportDefaultDeclaration ||
ref.identifier.parent.type ===
utils_1.AST_NODE_TYPES.TSExportAssignment) &&
ref.isValueReference &&
ref.isTypeReference) {
return node.importKind === 'type';
}
if (ref.isValueReference) {
let parent = ref.identifier.parent;
let child = ref.identifier;
while (parent) {
switch (parent.type) {
// CASE 1:
// `type T = typeof foo` will create a value reference because "foo" must be a value type
// however this value reference is safe to use with type-only imports
case utils_1.AST_NODE_TYPES.TSTypeQuery:
return true;
case utils_1.AST_NODE_TYPES.TSQualifiedName:
// TSTypeQuery must have a TSESTree.EntityName as its child, so we can filter here and break early
if (parent.left !== child) {
return false;
}
child = parent;
parent = parent.parent;
continue;
// END CASE 1
//////////////
// CASE 2:
// `type T = { [foo]: string }` will create a value reference because "foo" must be a value type
// however this value reference is safe to use with type-only imports.
// Also this is represented as a non-type AST - hence it uses MemberExpression
case utils_1.AST_NODE_TYPES.TSPropertySignature:
return parent.key === child;
case utils_1.AST_NODE_TYPES.MemberExpression:
if (parent.object !== child) {
return false;
}
child = parent;
parent = parent.parent;
continue;
// END CASE 2
default:
return false;
}
}
}
return ref.isTypeReference;
});
if (onlyHasTypeReferences) {
typeSpecifiers.push(specifier);
}
else {
valueSpecifiers.push(specifier);
}
}
}
if (node.importKind === 'value' && typeSpecifiers.length) {
sourceImports.reportValueImports.push({
node,
inlineTypeSpecifiers,
typeSpecifiers,
unusedSpecifiers,
valueSpecifiers,
});
}
},
'Program:exit'() {
if (hasDecoratorMetadata) {
// Experimental decorator metadata is bowl of poop that cannot be
// supported based on pure syntactic analysis.
//
// So we can do one of two things:
// 1) add type-information to the rule in a breaking change and
// prevent users from using it so that we can fully support this
// case.
// 2) make the rule ignore all imports that are used in a file that
// might have decorator metadata.
//
// (1) is has huge impact and prevents the rule from being used by 99%
// of users Frankly - it's a straight-up bad option. So instead we
// choose with option (2) and just avoid reporting on any imports in a
// file with both emitDecoratorMetadata AND decorators
//
// For more context see the discussion in this issue and its linked
// issues:
// https://github.com/typescript-eslint/typescript-eslint/issues/5468
//
//
// NOTE - in TS 5.0 `experimentalDecorators` became the legacy option,
// replaced with un-flagged, stable decorators and thus the type-aware
// emitDecoratorMetadata implementation also became legacy. in TS 5.2
// support for the new, stable decorator metadata proposal was added -
// however this proposal does not include type information
//
//
// PHEW. So TL;DR what does all this mean?
// - if you use experimentalDecorators:true,
// emitDecoratorMetadata:true, and have a decorator in the file -
// the rule will do nothing in the file out of an abundance of
// caution.
// - else the rule will work as normal.
return;
}
for (const sourceImports of Object.values(sourceImportsMap)) {
if (sourceImports.reportValueImports.length === 0) {
// nothing to fix. value specifiers and type specifiers are correctly written
continue;
}
for (const report of sourceImports.reportValueImports) {
if (report.valueSpecifiers.length === 0 &&
report.unusedSpecifiers.length === 0 &&
report.node.importKind !== 'type') {
/**
* checks if import has type assertions
* @example
* ```ts
* import * as type from 'mod' assert \{ type: 'json' \};
* ```
* https://github.com/typescript-eslint/typescript-eslint/issues/7527
*/
if (report.node.attributes.length === 0) {
context.report({
node: report.node,
messageId: 'typeOverValue',
*fix(fixer) {
yield* fixToTypeImportDeclaration(fixer, report, sourceImports);
},
});
}
}
else {
// we have a mixed type/value import or just value imports, so we need to split them out into multiple imports if separate-type-imports is configured
const importNames = report.typeSpecifiers.map(specifier => `"${specifier.local.name}"`);
const message = (() => {
const typeImports = (0, util_1.formatWordList)(importNames);
if (importNames.length === 1) {
return {
messageId: 'someImportsAreOnlyTypes',
data: {
typeImports,
},
};
}
return {
messageId: 'someImportsAreOnlyTypes',
data: {
typeImports,
},
};
})();
context.report({
node: report.node,
...message,
*fix(fixer) {
// take all the typeSpecifiers and put them on a new line
yield* fixToTypeImportDeclaration(fixer, report, sourceImports);
},
});
}
}
}
},
};
function classifySpecifier(node) {
const defaultSpecifier = node.specifiers[0].type === utils_1.AST_NODE_TYPES.ImportDefaultSpecifier
? node.specifiers[0]
: null;
const namespaceSpecifier = node.specifiers.find((specifier) => specifier.type === utils_1.AST_NODE_TYPES.ImportNamespaceSpecifier) ?? null;
const namedSpecifiers = node.specifiers.filter((specifier) => specifier.type === utils_1.AST_NODE_TYPES.ImportSpecifier);
return {
defaultSpecifier,
namedSpecifiers,
namespaceSpecifier,
};
}
/**
* Returns information for fixing named specifiers, type or value
*/
function getFixesNamedSpecifiers(fixer, node, subsetNamedSpecifiers, allNamedSpecifiers) {
if (allNamedSpecifiers.length === 0) {
return {
removeTypeNamedSpecifiers: [],
typeNamedSpecifiersText: '',
};
}
const typeNamedSpecifiersTexts = [];
const removeTypeNamedSpecifiers = [];
if (subsetNamedSpecifiers.length === allNamedSpecifiers.length) {
// import Foo, {Type1, Type2} from 'foo'
// import DefType, {Type1, Type2} from 'foo'
const openingBraceToken = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(subsetNamedSpecifiers[0], util_1.isOpeningBraceToken), util_1.NullThrowsReasons.MissingToken('{', node.type));
const commaToken = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(openingBraceToken, util_1.isCommaToken), util_1.NullThrowsReasons.MissingToken(',', node.type));
const closingBraceToken = (0, util_1.nullThrows)(context.sourceCode.getFirstTokenBetween(openingBraceToken, node.source, util_1.isClosingBraceToken), util_1.NullThrowsReasons.MissingToken('}', node.type));
// import DefType, {...} from 'foo'
// ^^^^^^^ remove
removeTypeNamedSpecifiers.push(fixer.removeRange([commaToken.range[0], closingBraceToken.range[1]]));
typeNamedSpecifiersTexts.push(context.sourceCode.text.slice(openingBraceToken.range[1], closingBraceToken.range[0]));
}
else {
const namedSpecifierGroups = [];
let group = [];
for (const namedSpecifier of allNamedSpecifiers) {
if (subsetNamedSpecifiers.includes(namedSpecifier)) {
group.push(namedSpecifier);
}
else if (group.length) {
namedSpecifierGroups.push(group);
group = [];
}
}
if (group.length) {
namedSpecifierGroups.push(group);
}
for (const namedSpecifiers of namedSpecifierGroups) {
const { removeRange, textRange } = getNamedSpecifierRanges(namedSpecifiers, allNamedSpecifiers);
removeTypeNamedSpecifiers.push(fixer.removeRange(removeRange));
typeNamedSpecifiersTexts.push(context.sourceCode.text.slice(...textRange));
}
}
return {
removeTypeNamedSpecifiers,
typeNamedSpecifiersText: typeNamedSpecifiersTexts.join(','),
};
}
/**
* Returns ranges for fixing named specifier.
*/
function getNamedSpecifierRanges(namedSpecifierGroup, allNamedSpecifiers) {
const first = namedSpecifierGroup[0];
const last = namedSpecifierGroup[namedSpecifierGroup.length - 1];
const removeRange = [first.range[0], last.range[1]];
const textRange = [...removeRange];
const before = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(first), util_1.NullThrowsReasons.MissingToken('token', 'first specifier'));
textRange[0] = before.range[1];
if ((0, util_1.isCommaToken)(before)) {
removeRange[0] = before.range[0];
}
else {
removeRange[0] = before.range[1];
}
const isFirst = allNamedSpecifiers[0] === first;
const isLast = allNamedSpecifiers[allNamedSpecifiers.length - 1] === last;
const after = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(last), util_1.NullThrowsReasons.MissingToken('token', 'last specifier'));
textRange[1] = after.range[0];
if ((isFirst || isLast) && (0, util_1.isCommaToken)(after)) {
removeRange[1] = after.range[1];
}
return {
removeRange,
textRange,
};
}
/**
* insert specifiers to named import node.
* e.g.
* import type { Already, Type1, Type2 } from 'foo'
* ^^^^^^^^^^^^^ insert
*/
function fixInsertNamedSpecifiersInNamedSpecifierList(fixer, target, insertText) {
const closingBraceToken = (0, util_1.nullThrows)(context.sourceCode.getFirstTokenBetween((0, util_1.nullThrows)(context.sourceCode.getFirstToken(target), util_1.NullThrowsReasons.MissingToken('token before', 'import')), target.source, util_1.isClosingBraceToken), util_1.NullThrowsReasons.MissingToken('}', target.type));
const before = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(closingBraceToken), util_1.NullThrowsReasons.MissingToken('token before', 'closing brace'));
if (!(0, util_1.isCommaToken)(before) && !(0, util_1.isOpeningBraceToken)(before)) {
insertText = `,${insertText}`;
}
return fixer.insertTextBefore(closingBraceToken, insertText);
}
/**
* insert type keyword to named import node.
* e.g.
* import ADefault, { Already, type Type1, type Type2 } from 'foo'
* ^^^^ insert
*/
function* fixInsertTypeKeywordInNamedSpecifierList(fixer, typeSpecifiers) {
for (const spec of typeSpecifiers) {
const insertText = context.sourceCode.text.slice(...spec.range);
yield fixer.replaceTextRange(spec.range, `type ${insertText}`);
}
}
function* fixInlineTypeImportDeclaration(fixer, report, sourceImports) {
const { node } = report;
// For a value import, will only add an inline type to named specifiers
const { namedSpecifiers } = classifySpecifier(node);
const typeNamedSpecifiers = namedSpecifiers.filter(specifier => report.typeSpecifiers.includes(specifier));
if (sourceImports.valueImport) {
// add import named type specifiers to its value import
// import ValueA, { type A }
// ^^^^ insert
const { namedSpecifiers: valueImportNamedSpecifiers } = classifySpecifier(sourceImports.valueImport);
if (sourceImports.valueOnlyNamedImport ||
valueImportNamedSpecifiers.length) {
yield* fixInsertTypeKeywordInNamedSpecifierList(fixer, typeNamedSpecifiers);
}
}
}
function* fixToTypeImportDeclaration(fixer, report, sourceImports) {
const { node } = report;
const { defaultSpecifier, namedSpecifiers, namespaceSpecifier } = classifySpecifier(node);
if (namespaceSpecifier && !defaultSpecifier) {
// import * as types from 'foo'
// checks for presence of import assertions
if (node.attributes.length === 0) {
yield* fixInsertTypeSpecifierForImportDeclaration(fixer, node, false);
}
return;
}
if (defaultSpecifier) {
if (report.typeSpecifiers.includes(defaultSpecifier) &&
namedSpecifiers.length === 0 &&
!namespaceSpecifier) {
// import Type from 'foo'
yield* fixInsertTypeSpecifierForImportDeclaration(fixer, node, true);
return;
}
if (fixStyle === 'inline-type-imports' &&
!report.typeSpecifiers.includes(defaultSpecifier) &&
namedSpecifiers.length > 0 &&
!namespaceSpecifier) {
// if there is a default specifier but it isn't a type specifier, then just add the inline type modifier to the named specifiers
// import AValue, {BValue, Type1, Type2} from 'foo'
yield* fixInlineTypeImportDeclaration(fixer, report, sourceImports);
return;
}
}
else if (!namespaceSpecifier) {
if (fixStyle === 'inline-type-imports' &&
namedSpecifiers.some(specifier => report.typeSpecifiers.includes(specifier))) {
// import {AValue, Type1, Type2} from 'foo'
yield* fixInlineTypeImportDeclaration(fixer, report, sourceImports);
return;
}
if (namedSpecifiers.every(specifier => report.typeSpecifiers.includes(specifier))) {
// import {Type1, Type2} from 'foo'
yield* fixInsertTypeSpecifierForImportDeclaration(fixer, node, false);
return;
}
}
const typeNamedSpecifiers = namedSpecifiers.filter(specifier => report.typeSpecifiers.includes(specifier));
const fixesNamedSpecifiers = getFixesNamedSpecifiers(fixer, node, typeNamedSpecifiers, namedSpecifiers);
const afterFixes = [];
if (typeNamedSpecifiers.length) {
if (sourceImports.typeOnlyNamedImport) {
const insertTypeNamedSpecifiers = fixInsertNamedSpecifiersInNamedSpecifierList(fixer, sourceImports.typeOnlyNamedImport, fixesNamedSpecifiers.typeNamedSpecifiersText);
if (sourceImports.typeOnlyNamedImport.range[1] <= node.range[0]) {
yield insertTypeNamedSpecifiers;
}
else {
afterFixes.push(insertTypeNamedSpecifiers);
}
}
else {
// The import is both default and named. Insert named on new line because can't mix default type import and named type imports
// eslint-disable-next-line no-lonely-if
if (fixStyle === 'inline-type-imports') {
yield fixer.insertTextBefore(node, `import {${typeNamedSpecifiers
.map(spec => {
const insertText = context.sourceCode.text.slice(...spec.range);
return `type ${insertText}`;
})
.join(', ')}} from ${context.sourceCode.getText(node.source)};\n`);
}
else {
yield fixer.insertTextBefore(node, `import type {${fixesNamedSpecifiers.typeNamedSpecifiersText}} from ${context.sourceCode.getText(node.source)};\n`);
}
}
}
const fixesRemoveTypeNamespaceSpecifier = [];
if (namespaceSpecifier &&
report.typeSpecifiers.includes(namespaceSpecifier)) {
// import Foo, * as Type from 'foo'
// import DefType, * as Type from 'foo'
// import DefType, * as Type from 'foo'
const commaToken = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(namespaceSpecifier, util_1.isCommaToken), util_1.NullThrowsReasons.MissingToken(',', node.type));
// import Def, * as Ns from 'foo'
// ^^^^^^^^^ remove
fixesRemoveTypeNamespaceSpecifier.push(fixer.removeRange([commaToken.range[0], namespaceSpecifier.range[1]]));
// import type * as Ns from 'foo'
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ insert
yield fixer.insertTextBefore(node, `import type ${context.sourceCode.getText(namespaceSpecifier)} from ${context.sourceCode.getText(node.source)};\n`);
}
if (defaultSpecifier &&
report.typeSpecifiers.includes(defaultSpecifier)) {
if (report.typeSpecifiers.length === node.specifiers.length) {
const importToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isImportKeyword), util_1.NullThrowsReasons.MissingToken('import', node.type));
// import type Type from 'foo'
// ^^^^ insert
yield fixer.insertTextAfter(importToken, ' type');
}
else {
const commaToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(defaultSpecifier, util_1.isCommaToken), util_1.NullThrowsReasons.MissingToken(',', defaultSpecifier.type));
// import Type , {...} from 'foo'
// ^^^^^ pick
const defaultText = context.sourceCode.text
.slice(defaultSpecifier.range[0], commaToken.range[0])
.trim();
yield fixer.insertTextBefore(node, `import type ${defaultText} from ${context.sourceCode.getText(node.source)};\n`);
const afterToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(commaToken, {
includeComments: true,
}), util_1.NullThrowsReasons.MissingToken('any token', node.type));
// import Type , {...} from 'foo'
// ^^^^^^^ remove
yield fixer.removeRange([
defaultSpecifier.range[0],
afterToken.range[0],
]);
}
}
yield* fixesNamedSpecifiers.removeTypeNamedSpecifiers;
yield* fixesRemoveTypeNamespaceSpecifier;
yield* afterFixes;
}
function* fixInsertTypeSpecifierForImportDeclaration(fixer, node, isDefaultImport) {
// import type Foo from 'foo'
// ^^^^^ insert
const importToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isImportKeyword), util_1.NullThrowsReasons.MissingToken('import', node.type));
yield fixer.insertTextAfter(importToken, ' type');
if (isDefaultImport) {
// Has default import
const openingBraceToken = context.sourceCode.getFirstTokenBetween(importToken, node.source, util_1.isOpeningBraceToken);
if (openingBraceToken) {
// Only braces. e.g. import Foo, {} from 'foo'
const commaToken = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(openingBraceToken, util_1.isCommaToken), util_1.NullThrowsReasons.MissingToken(',', node.type));
const closingBraceToken = (0, util_1.nullThrows)(context.sourceCode.getFirstTokenBetween(openingBraceToken, node.source, util_1.isClosingBraceToken), util_1.NullThrowsReasons.MissingToken('}', node.type));
// import type Foo, {} from 'foo'
// ^^ remove
yield fixer.removeRange([
commaToken.range[0],
closingBraceToken.range[1],
]);
const specifiersText = context.sourceCode.text.slice(commaToken.range[1], closingBraceToken.range[1]);
if (node.specifiers.length > 1) {
yield fixer.insertTextAfter(node, `\nimport type${specifiersText} from ${context.sourceCode.getText(node.source)};`);
}
}
}
// make sure we don't do anything like `import type {type T} from 'foo';`
for (const specifier of node.specifiers) {
if (specifier.type === utils_1.AST_NODE_TYPES.ImportSpecifier &&
specifier.importKind === 'type') {
yield* fixRemoveTypeSpecifierFromImportSpecifier(fixer, specifier);
}
}
}
function* fixRemoveTypeSpecifierFromImportDeclaration(fixer, node) {
// import type Foo from 'foo'
// ^^^^ remove
const importToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isImportKeyword), util_1.NullThrowsReasons.MissingToken('import', node.type));
const typeToken = (0, util_1.nullThrows)(context.sourceCode.getFirstTokenBetween(importToken, node.specifiers[0]?.local ?? node.source, util_1.isTypeKeyword), util_1.NullThrowsReasons.MissingToken('type', node.type));
const afterToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(typeToken, { includeComments: true }), util_1.NullThrowsReasons.MissingToken('any token', node.type));
yield fixer.removeRange([typeToken.range[0], afterToken.range[0]]);
}
function* fixRemoveTypeSpecifierFromImportSpecifier(fixer, node) {
// import { type Foo } from 'foo'
// ^^^^ remove
const typeToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isTypeKeyword), util_1.NullThrowsReasons.MissingToken('type', node.type));
const afterToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(typeToken, { includeComments: true }), util_1.NullThrowsReasons.MissingToken('any token', node.type));
yield fixer.removeRange([typeToken.range[0], afterToken.range[0]]);
}
},
});
@@ -0,0 +1,32 @@
import baseSet from './_baseSet.js';
/**
* This method is like `_.set` except that it accepts `customizer` which is
* invoked to produce the objects of `path`. If `customizer` returns `undefined`
* path creation is handled by the method instead. The `customizer` is invoked
* with three arguments: (nsValue, key, nsObject).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* var object = {};
*
* _.setWith(object, '[0][1]', 'a', Object);
* // => { '0': { '1': 'a' } }
*/
function setWith(object, path, value, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return object == null ? object : baseSet(object, path, value, customizer);
}
export default setWith;
@@ -0,0 +1 @@
{"mappings":"AAAA;;;;;;;;;;CAUC,GAEM,MAAM;IAYX;;GAEC,GACD,OAAc;QACZ,OAAO,IAAI,0CAAM,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACjC;IAEA;;GAEC,GACD,OAAO,KAAY,EAAW;QAC5B,OAAO,IAAI,CAAC,CAAC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,MAAM,CAAC;IACjD;IAEA;;GAEC,GACD,WAAoB;QAClB,OAAO,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,KAAK;IACpC;IAxBA,YAAY,IAAI,CAAC,EAAE,IAAI,CAAC,CAAE;QACxB,IAAI,CAAC,CAAC,GAAG;QACT,IAAI,CAAC,CAAC,GAAG;IACX;AAsBF","sources":["packages/@react-stately/virtualizer/src/Point.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\nexport class Point {\n /** The x-coordinate of the point. */\n x: number;\n\n /** The y-coordinate of the point. */\n y: number;\n\n constructor(x = 0, y = 0) {\n this.x = x;\n this.y = y;\n }\n\n /**\n * Returns a copy of this point.\n */\n copy(): Point {\n return new Point(this.x, this.y);\n }\n\n /**\n * Checks if two points are equal.\n */\n equals(point: Point): boolean {\n return this.x === point.x && this.y === point.y;\n }\n\n /**\n * Returns true if this point is the origin.\n */\n isOrigin(): boolean {\n return this.x === 0 && this.y === 0;\n }\n}\n"],"names":[],"version":3,"file":"Point.module.js.map"}
@@ -0,0 +1,7 @@
import isAfter from "./isAfter.mjs";
function isSameOrBefore(date, input, unit) {
return !isAfter(date, input, unit);
}
export {
isSameOrBefore as default
};
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,aAAO,CAAC;IACxC,iBAAiB,CAAC,OAAS,CAAC,sBAAsB,EAAE,KAAK,UAAU,CAAC,0BAAoB,CAAC;IACzF,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,QAAQ,CAAC;IAC/C,cAAc,CAAC,cAAQ,CAAC;IACxB,kBAAkB,CAAC,OAAS,CAAC,sBAAsB,EAAE,KAAK,UAAU,CAAC,2BAAqB,CAAC;IAC3F,sBAAsB,CAAC,+DAAmD,CAAC;IAC3E,UAAU,CAAC,SAAS,CAAC;IACrB,aAAa,CAAC,aAAa,CAAC;IAC5B,YAAY,CAAC,mCAA6B,CAAC;AAC7C","sources":["packages/@react-aria/table/intl/sr-SP.json"],"sourcesContent":["{\n \"ascending\": \"rastući\",\n \"ascendingSort\": \"sortirano po kolonama {columnName} rastućim redosledom\",\n \"columnSize\": \"{value} piksela\",\n \"descending\": \"padajući\",\n \"descendingSort\": \"sortirano po kolonama {columnName} padajućim redosledom\",\n \"resizerDescription\": \"Pritisnite Enter da biste započeli promenu veličine\",\n \"select\": \"Izaberite\",\n \"selectAll\": \"Izaberite sve\",\n \"sortable\": \"kolona koja se može sortirati\"\n}\n"],"names":[],"version":3,"file":"sr-SP.main.js.map"}
@@ -0,0 +1,49 @@
var safeIsNaN = Number.isNaN ||
function ponyfill(value) {
return typeof value === 'number' && value !== value;
};
function isEqual(first, second) {
if (first === second) {
return true;
}
if (safeIsNaN(first) && safeIsNaN(second)) {
return true;
}
return false;
}
function areInputsEqual(newInputs, lastInputs) {
if (newInputs.length !== lastInputs.length) {
return false;
}
for (var i = 0; i < newInputs.length; i++) {
if (!isEqual(newInputs[i], lastInputs[i])) {
return false;
}
}
return true;
}
function memoizeOne(resultFn, isEqual) {
if (isEqual === void 0) { isEqual = areInputsEqual; }
var lastThis;
var lastArgs = [];
var lastResult;
var calledOnce = false;
function memoized() {
var newArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
newArgs[_i] = arguments[_i];
}
if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
return lastResult;
}
lastResult = resultFn.apply(this, newArgs);
calledOnce = true;
lastThis = this;
lastArgs = newArgs;
return lastResult;
}
return memoized;
}
export default memoizeOne;
@@ -0,0 +1,131 @@
'use strict';
// https://github.com/thejoshwolfe/yauzl#no-streaming-unzip-api
const yauzl = require('@eggjs/yauzl');
const stream = require('stream');
const UncompressBaseStream = require('../base_write_stream');
const utils = require('../utils');
// lazy load iconv-lite
let iconv;
const YAUZL_CALLBACK = Symbol('ZipUncompressStream#yauzlCallback');
const STRIP_NAME = Symbol('ZipUncompressStream#stripName');
// don't decodeStrings on yauzl, we should handle fileName by ourself
// see validateFileName on https://github.com/thejoshwolfe/yauzl/blob/51010ce4e8c7e6345efe195e1b4150518f37b393/index.js#L607
// - support "absolute path"
const DEFAULTS = { lazyEntries: true, decodeStrings: false };
// from: https://github.com/microsoft/vscode/blob/c0769274fa136b45799edeccc0d0a2f645b75caf/src/vs/base/node/zip.ts#L51
function modeFromEntry(entry) {
const attr = entry.externalFileAttributes >> 16 || 33188;
return [ 448 /* S_IRWXU */, 56 /* S_IRWXG */, 7 /* S_IRWXO */ ]
.map(mask => attr & mask)
.reduce((a, b) => a + b, attr & 61440 /* S_IFMT */);
}
class ZipUncompressStream extends UncompressBaseStream {
constructor(opts) {
opts = opts || {};
super(opts);
this._chunks = [];
this._strip = Number(opts.strip) || 0;
this._zipFileNameEncoding = opts.zipFileNameEncoding || 'utf8';
if (this._zipFileNameEncoding === 'utf-8') {
this._zipFileNameEncoding = 'utf8';
}
this[YAUZL_CALLBACK] = this[YAUZL_CALLBACK].bind(this);
const sourceType = utils.sourceType(opts.source);
const yauzlOpts = this._yauzlOpts = Object.assign({}, DEFAULTS, opts.yauzl);
if (sourceType === 'file') {
yauzl.open(opts.source, yauzlOpts, this[YAUZL_CALLBACK]);
return;
}
if (sourceType === 'buffer') {
yauzl.fromBuffer(opts.source, yauzlOpts, this[YAUZL_CALLBACK]);
return;
}
if (sourceType === 'stream') {
utils.streamToBuffer(opts.source)
.then(buf => yauzl.fromBuffer(buf, yauzlOpts, this[YAUZL_CALLBACK]))
.catch(e => this.emit('error', e));
return;
}
this.on('pipe', srcStream => {
srcStream.unpipe(srcStream);
utils.streamToBuffer(srcStream)
.then(buf => {
this._chunks.push(buf);
buf = Buffer.concat(this._chunks);
yauzl.fromBuffer(buf, yauzlOpts, this[YAUZL_CALLBACK]);
})
.catch(e => this.emit('error', e));
});
}
_write(chunk) {
// push to _chunks array, this will only happen once, for stream will be unpiped.
this._chunks.push(chunk);
}
[YAUZL_CALLBACK](err, zipFile) {
if (err) return this.emit('error', err);
zipFile.readEntry();
zipFile
.on('entry', entry => {
const mode = modeFromEntry(entry);
// fileName is buffer by default because decodeStrings = false
if (Buffer.isBuffer(entry.fileName)) {
if (this._zipFileNameEncoding === 'utf8') {
entry.fileName = entry.fileName.toString();
} else {
if (!iconv) {
iconv = require('iconv-lite');
}
entry.fileName = iconv.decode(entry.fileName, this._zipFileNameEncoding);
}
}
// directory file names end with '/' (for Linux and macOS) or '\' (for Windows)
const type = /[\\\/]$/.test(entry.fileName) ? 'directory' : 'file';
const name = entry.fileName = this[STRIP_NAME](entry.fileName, type);
const header = { name, type, yauzl: entry, mode };
if (type === 'file') {
zipFile.openReadStream(entry, (err, readStream) => {
if (err) return this.emit('error', err);
this.emit('entry', header, readStream, next);
});
} else { // directory
const placeholder = new stream.Readable({ read() {} });
this.emit('entry', header, placeholder, next);
setImmediate(() => placeholder.emit('end'));
}
})
.on('end', () => this.emit('finish'))
.on('error', err => this.emit('error', err));
function next() {
zipFile.readEntry();
}
}
[STRIP_NAME](fileName, type) {
return utils.stripFileName(this._strip, fileName, type);
}
}
module.exports = ZipUncompressStream;
@@ -0,0 +1,19 @@
Copyright Brian White. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
@@ -0,0 +1,41 @@
{
"name": "eslint-import-resolver-node",
"version": "0.3.9",
"description": "Node default behavior import resolution plugin for eslint-plugin-import.",
"main": "index.js",
"files": [
"index.js"
],
"scripts": {
"prepublishOnly": "cp ../../{LICENSE,.npmrc} ./",
"tests-only": "nyc mocha",
"test": "npm run tests-only"
},
"repository": {
"type": "git",
"url": "https://github.com/import-js/eslint-plugin-import"
},
"keywords": [
"eslint",
"eslintplugin",
"esnext",
"modules",
"eslint-plugin-import"
],
"author": "Ben Mosher (me@benmosher.com)",
"license": "MIT",
"bugs": {
"url": "https://github.com/import-js/eslint-plugin-import/issues"
},
"homepage": "https://github.com/import-js/eslint-plugin-import",
"dependencies": {
"debug": "^3.2.7",
"is-core-module": "^2.13.0",
"resolve": "^1.22.4"
},
"devDependencies": {
"chai": "^3.5.0",
"mocha": "^3.5.3",
"nyc": "^11.9.0"
}
}
@@ -0,0 +1,34 @@
import type { InternalHandlerBuilder } from './types'
export const buildDevCheckHandler: InternalHandlerBuilder = ({
api,
context: { apiUid },
reducerPath,
}) => {
return (action, mwApi) => {
if (api.util.resetApiState.match(action)) {
// dispatch after api reset
mwApi.dispatch(api.internalActions.middlewareRegistered(apiUid))
}
if (
typeof process !== 'undefined' &&
process.env.NODE_ENV === 'development'
) {
if (
api.internalActions.middlewareRegistered.match(action) &&
action.payload === apiUid &&
mwApi.getState()[reducerPath]?.config?.middlewareRegistered ===
'conflict'
) {
console.warn(`There is a mismatch between slice and middleware for the reducerPath "${reducerPath}".
You can only have one api per reducer path, this will lead to crashes in various situations!${
reducerPath === 'api'
? `
If you have multiple apis, you *have* to specify the reducerPath option when using createApi!`
: ''
}`)
}
}
}
}
@@ -0,0 +1 @@
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAID,MAAM,gDAA0B,OAAO,YAAY,eAAe,qBAAqB,QAAQ,SAAS;AAExG,SAAS,qCAAe,OAAgB;IACtC,MAAM,eAAe,CAAA,GAAA,yCAAa,EAAE;IACpC,IAAI,CAAE,CAAA,mBAAmB,aAAa,WAAW,AAAD,KAAM,CAAE,CAAA,mBAAmB,aAAa,UAAU,AAAD,GAC/F,OAAO;IAGT,IAAI,WAAC,OAAO,cAAE,UAAU,EAAC,GAAG,QAAQ,KAAK;IAEzC,IAAI,YACF,YAAY,UACZ,eAAe,YACf,eAAe;IAGjB,IAAI,WAAW;QACb,MAAM,oBAAC,gBAAgB,EAAC,GAAG,QAAQ,aAAa,CAAC,WAAW;QAC5D,IAAI,EAAC,SAAS,eAAe,EAAE,YAAY,kBAAkB,EAAC,GAAG,iBAAiB;QAElF,YACE,oBAAoB,UACpB,uBAAuB,YACvB,uBAAuB;IAE3B;IAEA,OAAO;AACT;AAEA,SAAS,yCAAmB,OAAgB,EAAE,YAAsB;IAClE,OACE,CAAC,QAAQ,YAAY,CAAC,aACtB,yCAAyC;IACzC,CAAC,QAAQ,YAAY,CAAC,oCACrB,CAAA,QAAQ,QAAQ,KAAK,aACpB,gBACA,aAAa,QAAQ,KAAK,YACxB,QAAQ,YAAY,CAAC,UACrB,IAAG;AAEX;AAQO,SAAS,0CAAiB,OAAgB,EAAE,YAAsB;IACvE,IAAI,+CACF,OAAO,QAAQ,eAAe,CAAC;QAAC,oBAAoB;IAAI,MAAM,CAAC,QAAQ,OAAO,CAAC;IAGjF,OACE,QAAQ,QAAQ,KAAK,cACrB,qCAAe,YACf,yCAAmB,SAAS,iBAC3B,CAAA,CAAC,QAAQ,aAAa,IAAI,0CAAiB,QAAQ,aAAa,EAAE,QAAO;AAE9E","sources":["packages/@react-aria/utils/src/isElementVisible.ts"],"sourcesContent":["/*\n * Copyright 2021 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 {getOwnerWindow} from './domHelpers';\n\nconst supportsCheckVisibility = typeof Element !== 'undefined' && 'checkVisibility' in Element.prototype;\n\nfunction isStyleVisible(element: Element) {\n const windowObject = getOwnerWindow(element);\n if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) {\n return false;\n }\n\n let {display, visibility} = element.style;\n\n let isVisible = (\n display !== 'none' &&\n visibility !== 'hidden' &&\n visibility !== 'collapse'\n );\n\n if (isVisible) {\n const {getComputedStyle} = element.ownerDocument.defaultView as unknown as Window;\n let {display: computedDisplay, visibility: computedVisibility} = getComputedStyle(element);\n\n isVisible = (\n computedDisplay !== 'none' &&\n computedVisibility !== 'hidden' &&\n computedVisibility !== 'collapse'\n );\n }\n\n return isVisible;\n}\n\nfunction isAttributeVisible(element: Element, childElement?: Element) {\n return (\n !element.hasAttribute('hidden') &&\n // Ignore HiddenSelect when tree walking.\n !element.hasAttribute('data-react-aria-prevent-focus') &&\n (element.nodeName === 'DETAILS' &&\n childElement &&\n childElement.nodeName !== 'SUMMARY'\n ? element.hasAttribute('open')\n : true)\n );\n}\n\n/**\n * Adapted from https://github.com/testing-library/jest-dom and\n * https://github.com/vuejs/vue-test-utils-next/.\n * Licensed under the MIT License.\n * @param element - Element to evaluate for display or visibility.\n */\nexport function isElementVisible(element: Element, childElement?: Element): boolean {\n if (supportsCheckVisibility) {\n return element.checkVisibility({visibilityProperty: true}) && !element.closest('[data-react-aria-prevent-focus]');\n }\n\n return (\n element.nodeName !== '#comment' &&\n isStyleVisible(element) &&\n isAttributeVisible(element, childElement) &&\n (!element.parentElement || isElementVisible(element.parentElement, element))\n );\n}\n"],"names":[],"version":3,"file":"isElementVisible.module.js.map"}
@@ -0,0 +1 @@
{"name":"synckit","version":"0.9.3","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532118466,"integrity":"sha512-zgeTo06HQ2T5I7C5cnr+454gpUhtxdIXsNiwSwrZG2jr0SE4YY/JsrryauzWOGr6xpBP8khsZg8G7NwTPTOo3g==","mode":420,"size":1061},"lib/index.cjs":{"checkedAt":1794532118466,"integrity":"sha512-d2R1ePcTLJr9YqNA42IwDcq9i87mkjMJw+ifLvKw9mnOMrh0mxlkXF8fOQrrb3C5xr9ZZj1lW8qQeT1KlVl89w==","mode":420,"size":16428},"lib/index.js":{"checkedAt":1794532118466,"integrity":"sha512-GwGTdgH0bb96gxhsEXBWt7MbBk/092jFcNiSBJ2XnzM8UD/bbe8zMYAk+ysAUDSMnOtpr/YKyJSiSX6mDbaq3A==","mode":420,"size":15475},"lib/types.js":{"checkedAt":1794532118466,"integrity":"sha512-SsbEBINp4lV0o5FfrXWIrReugcGKwHr3WmLAnUF60Atcrlv+DLvt25f8cEkvPg1SwkuoEp+vpkWJSNKcPtvFUQ==","mode":420,"size":44},"package.json":{"checkedAt":1794532118467,"integrity":"sha512-7XQDQ+B/vvhG/1Pa3m3RzbUHKwMISpdQUl6mk1uNDACjoxHd3agbGT6YHbyZb3xqDxZtR9GmJ/YnbxCzinKlPQ==","mode":420,"size":952},"lib/index.js.map":{"checkedAt":1794532118467,"integrity":"sha512-r0nlJrqt18Wz9ojBRqqnlQHmkBImE8Ka0g4Ilhr83uju0fNOjyw4zeg3QlfIuT+ibau/s6c0I5UQHp33D+OdaQ==","mode":420,"size":15018},"lib/types.js.map":{"checkedAt":1794532096256,"integrity":"sha512-TF/b/T3nwqhwzvSQCv/dboeSHvr/1GLVyXJFcy8q00n5bdXOxGy8TtkQmE0+xkLfpv5k1PO4MlQwUgwQr0MEhQ==","mode":420,"size":102},"README.md":{"checkedAt":1794532118467,"integrity":"sha512-1EC50p4z4JJxXpW3dG5NQWhiCOu4jNWxo3Qe87rsEdpfJaJ5o4NPEQvJKVCLZbxvhzt5NAI5T9yy2JWHcyh8OA==","mode":420,"size":8995},"lib/index.d.ts":{"checkedAt":1794532118467,"integrity":"sha512-7CSVI9FMo/6PP3EEWd0TcSsi2IBUjGI/oljw5rgWvC2f0caY5+F4QHi1FHqSt/pWV3+TtY6INoBWroIbJl++TQ==","mode":420,"size":1701},"lib/types.d.ts":{"checkedAt":1794532118467,"integrity":"sha512-ND17Y13IpCd+Kfk1u8KLhdoI54TIXp+q7MTvlDOfeTMOJOab9Kn2nlrsUpZIw7btRHDDU3P33n9Wfbpu9VLpXA==","mode":420,"size":1143}}}
@@ -0,0 +1,7 @@
import { HTMLHeroUIProps } from '@heroui/system';
import { SpectrumColumnProps } from '@react-types/table';
type TableColumnProps<T> = Omit<SpectrumColumnProps<T>, "showDivider"> & Omit<HTMLHeroUIProps<"th">, keyof SpectrumColumnProps<T>>;
declare const TableColumn: <T>(props: TableColumnProps<T>) => JSX.Element;
export { type TableColumnProps, TableColumn as default };
@@ -0,0 +1,47 @@
{
"name": "color",
"version": "4.2.3",
"description": "Color conversion and manipulation with CSS string support",
"sideEffects": false,
"keywords": [
"color",
"colour",
"css"
],
"authors": [
"Josh Junon <josh@junon.me>",
"Heather Arthur <fayearthur@gmail.com>",
"Maxime Thirouin"
],
"license": "MIT",
"repository": "Qix-/color",
"xo": {
"rules": {
"no-cond-assign": 0,
"new-cap": 0,
"unicorn/prefer-module": 0,
"no-mixed-operators": 0,
"complexity": 0,
"unicorn/numeric-separators-style": 0
}
},
"files": [
"LICENSE",
"index.js"
],
"scripts": {
"pretest": "xo",
"test": "mocha"
},
"engines": {
"node": ">=12.5.0"
},
"dependencies": {
"color-convert": "^2.0.1",
"color-string": "^1.9.0"
},
"devDependencies": {
"mocha": "9.0.2",
"xo": "0.42.0"
}
}
@@ -0,0 +1,227 @@
/**
* @fileoverview Rule to flag updates of imported bindings.
* @author Toru Nagashima <https://github.com/mysticatea>
*/
"use strict";
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const { findVariable } = require("@eslint-community/eslint-utils");
const astUtils = require("./utils/ast-utils");
const WellKnownMutationFunctions = {
Object: /^(?:assign|definePropert(?:y|ies)|freeze|setPrototypeOf)$/u,
Reflect: /^(?:(?:define|delete)Property|set(?:PrototypeOf)?)$/u,
};
/**
* Check if a given node is LHS of an assignment node.
* @param {ASTNode} node The node to check.
* @returns {boolean} `true` if the node is LHS.
*/
function isAssignmentLeft(node) {
const { parent } = node;
return (
(parent.type === "AssignmentExpression" && parent.left === node) ||
// Destructuring assignments
parent.type === "ArrayPattern" ||
(parent.type === "Property" &&
parent.value === node &&
parent.parent.type === "ObjectPattern") ||
parent.type === "RestElement" ||
(parent.type === "AssignmentPattern" && parent.left === node)
);
}
/**
* Check if a given node is the operand of mutation unary operator.
* @param {ASTNode} node The node to check.
* @returns {boolean} `true` if the node is the operand of mutation unary operator.
*/
function isOperandOfMutationUnaryOperator(node) {
const argumentNode =
node.parent.type === "ChainExpression" ? node.parent : node;
const { parent } = argumentNode;
return (
(parent.type === "UpdateExpression" &&
parent.argument === argumentNode) ||
(parent.type === "UnaryExpression" &&
parent.operator === "delete" &&
parent.argument === argumentNode)
);
}
/**
* Check if a given node is the iteration variable of `for-in`/`for-of` syntax.
* @param {ASTNode} node The node to check.
* @returns {boolean} `true` if the node is the iteration variable.
*/
function isIterationVariable(node) {
const { parent } = node;
return (
(parent.type === "ForInStatement" && parent.left === node) ||
(parent.type === "ForOfStatement" && parent.left === node)
);
}
/**
* Check if a given node is at the first argument of a well-known mutation function.
* - `Object.assign`
* - `Object.defineProperty`
* - `Object.defineProperties`
* - `Object.freeze`
* - `Object.setPrototypeOf`
* - `Reflect.defineProperty`
* - `Reflect.deleteProperty`
* - `Reflect.set`
* - `Reflect.setPrototypeOf`
* @param {ASTNode} node The node to check.
* @param {Scope} scope A `escope.Scope` object to find variable (whichever).
* @returns {boolean} `true` if the node is at the first argument of a well-known mutation function.
*/
function isArgumentOfWellKnownMutationFunction(node, scope) {
const { parent } = node;
if (parent.type !== "CallExpression" || parent.arguments[0] !== node) {
return false;
}
const callee = astUtils.skipChainExpression(parent.callee);
if (
!astUtils.isSpecificMemberAccess(
callee,
"Object",
WellKnownMutationFunctions.Object,
) &&
!astUtils.isSpecificMemberAccess(
callee,
"Reflect",
WellKnownMutationFunctions.Reflect,
)
) {
return false;
}
const variable = findVariable(scope, callee.object);
return variable !== null && variable.scope.type === "global";
}
/**
* Check if the identifier node is placed at to update members.
* @param {ASTNode} id The Identifier node to check.
* @param {Scope} scope A `escope.Scope` object to find variable (whichever).
* @returns {boolean} `true` if the member of `id` was updated.
*/
function isMemberWrite(id, scope) {
const { parent } = id;
return (
(parent.type === "MemberExpression" &&
parent.object === id &&
(isAssignmentLeft(parent) ||
isOperandOfMutationUnaryOperator(parent) ||
isIterationVariable(parent))) ||
isArgumentOfWellKnownMutationFunction(id, scope)
);
}
/**
* Get the mutation node.
* @param {ASTNode} id The Identifier node to get.
* @returns {ASTNode} The mutation node.
*/
function getWriteNode(id) {
let node = id.parent;
while (
node &&
node.type !== "AssignmentExpression" &&
node.type !== "UpdateExpression" &&
node.type !== "UnaryExpression" &&
node.type !== "CallExpression" &&
node.type !== "ForInStatement" &&
node.type !== "ForOfStatement"
) {
node = node.parent;
}
return node || id;
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
docs: {
description: "Disallow assigning to imported bindings",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-import-assign",
},
schema: [],
messages: {
readonly: "'{{name}}' is read-only.",
readonlyMember: "The members of '{{name}}' are read-only.",
},
},
create(context) {
const sourceCode = context.sourceCode;
return {
ImportDeclaration(node) {
const scope = sourceCode.getScope(node);
for (const variable of sourceCode.getDeclaredVariables(node)) {
const shouldCheckMembers = variable.defs.some(
d => d.node.type === "ImportNamespaceSpecifier",
);
let prevIdNode = null;
for (const reference of variable.references) {
const idNode = reference.identifier;
/*
* AssignmentPattern (e.g. `[a = 0] = b`) makes two write
* references for the same identifier. This should skip
* the one of the two in order to prevent redundant reports.
*/
if (idNode === prevIdNode) {
continue;
}
prevIdNode = idNode;
if (reference.isWrite()) {
context.report({
node: getWriteNode(idNode),
messageId: "readonly",
data: { name: idNode.name },
});
} else if (
shouldCheckMembers &&
isMemberWrite(idNode, scope)
) {
context.report({
node: getWriteNode(idNode),
messageId: "readonlyMember",
data: { name: idNode.name },
});
}
}
}
},
};
},
};
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,QAAQ,CAAC;IACzC,iBAAiB,CAAC,OAAS,CAAC,0CAA0C,EAAE,KAAK,UAAU,EAAE;IACzF,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,OAAO,CAAC;IAC9C,cAAc,CAAC,QAAQ,CAAC;IACxB,kBAAkB,CAAC,OAAS,CAAC,0CAA0C,EAAE,KAAK,UAAU,EAAE;IAC1F,sBAAsB,CAAC,wCAAwC,CAAC;IAChE,UAAU,CAAC,UAAU,CAAC;IACtB,aAAa,CAAC,gBAAgB,CAAC;IAC/B,YAAY,CAAC,iBAAiB,CAAC;AACjC","sources":["packages/@react-aria/table/intl/nl-NL.json"],"sourcesContent":["{\n \"ascending\": \"oplopend\",\n \"ascendingSort\": \"gesorteerd in oplopende volgorde in kolom {columnName}\",\n \"columnSize\": \"{value} pixels\",\n \"descending\": \"aflopend\",\n \"descendingSort\": \"gesorteerd in aflopende volgorde in kolom {columnName}\",\n \"resizerDescription\": \"Druk op Enter om het formaat te wijzigen\",\n \"select\": \"Selecteren\",\n \"selectAll\": \"Alles selecteren\",\n \"sortable\": \"sorteerbare kolom\"\n}\n"],"names":[],"version":3,"file":"nl-NL.module.js.map"}
@@ -0,0 +1,57 @@
import {generateId as $99b62ae3ff97ec45$export$567fc7097e064344} from "./utils.module.js";
import {filterDOMProps as $dObGJ$filterDOMProps, useLinkProps as $dObGJ$useLinkProps, mergeProps as $dObGJ$mergeProps} from "@react-aria/utils";
import {useSelectableItem as $dObGJ$useSelectableItem} from "@react-aria/selection";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $0175d55c2a017ebc$export$fdf4756d5b8ef90a(props, state, ref) {
let { key: key, isDisabled: propsDisabled, shouldSelectOnPressUp: shouldSelectOnPressUp } = props;
let { selectionManager: manager, selectedKey: selectedKey } = state;
let isSelected = key === selectedKey;
let isDisabled = propsDisabled || state.isDisabled || state.selectionManager.isDisabled(key);
let { itemProps: itemProps, isPressed: isPressed } = (0, $dObGJ$useSelectableItem)({
selectionManager: manager,
key: key,
ref: ref,
isDisabled: isDisabled,
shouldSelectOnPressUp: shouldSelectOnPressUp,
linkBehavior: 'selection'
});
let tabId = (0, $99b62ae3ff97ec45$export$567fc7097e064344)(state, key, 'tab');
let tabPanelId = (0, $99b62ae3ff97ec45$export$567fc7097e064344)(state, key, 'tabpanel');
let { tabIndex: tabIndex } = itemProps;
let item = state.collection.getItem(key);
let domProps = (0, $dObGJ$filterDOMProps)(item === null || item === void 0 ? void 0 : item.props, {
labelable: true
});
delete domProps.id;
let linkProps = (0, $dObGJ$useLinkProps)(item === null || item === void 0 ? void 0 : item.props);
return {
tabProps: (0, $dObGJ$mergeProps)(domProps, linkProps, itemProps, {
id: tabId,
'aria-selected': isSelected,
'aria-disabled': isDisabled || undefined,
'aria-controls': isSelected ? tabPanelId : undefined,
tabIndex: isDisabled ? undefined : tabIndex,
role: 'tab'
}),
isSelected: isSelected,
isDisabled: isDisabled,
isPressed: isPressed
};
}
export {$0175d55c2a017ebc$export$fdf4756d5b8ef90a as useTab};
//# sourceMappingURL=useTab.module.js.map
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/javascript-natural-sort.iml" filepath="$PROJECT_DIR$/.idea/javascript-natural-sort.iml" />
</modules>
</component>
</project>
@@ -0,0 +1,66 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _ariaQuery = require("aria-query");
var _jsxAstUtils = require("jsx-ast-utils");
var _schemas = require("../util/schemas");
var _getElementType = _interopRequireDefault(require("../util/getElementType"));
var _getTabIndex = _interopRequireDefault(require("../util/getTabIndex"));
var _isInteractiveElement = _interopRequireDefault(require("../util/isInteractiveElement"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**
* @fileoverview Enforce elements with aria-activedescendant are tabbable.
* @author Jesse Beach <@jessebeach>
*/
// ----------------------------------------------------------------------------
// Rule Definition
// ----------------------------------------------------------------------------
var errorMessage = 'An element that manages focus with `aria-activedescendant` must have a tabindex';
var schema = (0, _schemas.generateObjSchema)();
var _default = exports["default"] = {
meta: {
docs: {
url: 'https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/HEAD/docs/rules/aria-activedescendant-has-tabindex.md',
description: 'Enforce elements with aria-activedescendant are tabbable.'
},
schema: [schema]
},
create: function create(context) {
var elementType = (0, _getElementType["default"])(context);
return {
JSXOpeningElement: function JSXOpeningElement(node) {
var attributes = node.attributes;
if ((0, _jsxAstUtils.getProp)(attributes, 'aria-activedescendant') === undefined) {
return;
}
var type = elementType(node);
// Do not test higher level JSX components, as we do not know what
// low-level DOM element this maps to.
if (!_ariaQuery.dom.has(type)) {
return;
}
var tabIndex = (0, _getTabIndex["default"])((0, _jsxAstUtils.getProp)(attributes, 'tabIndex'));
// If this is an interactive element and the tabindex attribute is not specified,
// or the tabIndex property was not mutated, then the tabIndex
// property will be undefined.
if ((0, _isInteractiveElement["default"])(type, attributes) && tabIndex === undefined) {
return;
}
if (tabIndex >= -1) {
return;
}
context.report({
node,
message: errorMessage
});
}
};
}
};
module.exports = exports.default;
@@ -0,0 +1,12 @@
var test = require('tape');
var inspect = require('../');
var obj = { a: 1, b: [3, 4, undefined, null], c: undefined, d: null };
test('undef and null', function (t) {
t.plan(1);
t.equal(
inspect(obj),
'{ a: 1, b: [ 3, 4, undefined, null ], c: undefined, d: null }'
);
});
@@ -0,0 +1,47 @@
var $47fa5ec5ff482271$exports = require("./context.main.js");
var $fbyBw$internationalizedstring = require("@internationalized/string");
var $fbyBw$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useLocalizedStringDictionary", () => $fc53663969a3d00a$export$87b761675e8eaa10);
$parcel$export(module.exports, "useLocalizedStringFormatter", () => $fc53663969a3d00a$export$f12b703ca79dfbb1);
/*
* Copyright 2022 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.
*/
const $fc53663969a3d00a$var$cache = new WeakMap();
function $fc53663969a3d00a$var$getCachedDictionary(strings) {
let dictionary = $fc53663969a3d00a$var$cache.get(strings);
if (!dictionary) {
dictionary = new (0, $fbyBw$internationalizedstring.LocalizedStringDictionary)(strings);
$fc53663969a3d00a$var$cache.set(strings, dictionary);
}
return dictionary;
}
function $fc53663969a3d00a$export$87b761675e8eaa10(strings, packageName) {
return packageName && (0, $fbyBw$internationalizedstring.LocalizedStringDictionary).getGlobalDictionaryForPackage(packageName) || $fc53663969a3d00a$var$getCachedDictionary(strings);
}
function $fc53663969a3d00a$export$f12b703ca79dfbb1(strings, packageName) {
let { locale: locale } = (0, $47fa5ec5ff482271$exports.useLocale)();
let dictionary = $fc53663969a3d00a$export$87b761675e8eaa10(strings, packageName);
return (0, $fbyBw$react.useMemo)(()=>new (0, $fbyBw$internationalizedstring.LocalizedStringFormatter)(locale, dictionary), [
locale,
dictionary
]);
}
//# sourceMappingURL=useLocalizedStringFormatter.main.js.map
@@ -0,0 +1,189 @@
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*/
"use strict"
const Minimatch = require("minimatch").Minimatch
/**
* @param {any} x - An any value.
* @returns {any} Always `x`.
*/
function identity(x) {
return x
}
/**
* Converts old-style value to new-style value.
*
* @param {any} x - The value to convert.
* @returns {({include: string[], exclude: string[], replace: string[]})[]} Normalized value.
*/
function normalizeValue(x) {
if (Array.isArray(x)) {
return x
}
return Object.keys(x).map(pattern => ({
include: [pattern],
exclude: [],
replace: x[pattern],
}))
}
/**
* Ensures the given value is a string array.
*
* @param {any} x - The value to ensure.
* @returns {string[]} The string array.
*/
function toStringArray(x) {
if (Array.isArray(x)) {
return x.map(String)
}
return []
}
/**
* Creates the function which checks whether a file path is matched with the given pattern or not.
*
* @param {string[]} includePatterns - The glob patterns to include files.
* @param {string[]} excludePatterns - The glob patterns to exclude files.
* @returns {function} Created predicate function.
*/
function createMatch(includePatterns, excludePatterns) {
const include = includePatterns.map(pattern => new Minimatch(pattern))
const exclude = excludePatterns.map(pattern => new Minimatch(pattern))
return filePath =>
include.some(m => m.match(filePath)) &&
!exclude.some(m => m.match(filePath))
}
/**
* Creates a function which replaces a given path.
*
* @param {RegExp} fromRegexp - A `RegExp` object to replace.
* @param {string} toStr - A new string to replace.
* @returns {function} A function which replaces a given path.
*/
function defineConvert(fromRegexp, toStr) {
return filePath => filePath.replace(fromRegexp, toStr)
}
/**
* Combines given converters.
* The result function converts a given path with the first matched converter.
*
* @param {{match: function, convert: function}} converters - A list of converters to combine.
* @returns {function} A function which replaces a given path.
*/
function combine(converters) {
return filePath => {
for (const converter of converters) {
if (converter.match(filePath)) {
return converter.convert(filePath)
}
}
return filePath
}
}
/**
* Parses `convertPath` property from a given option object.
*
* @param {object|undefined} option - An option object to get.
* @returns {function|null} A function which converts a path., or `null`.
*/
function parse(option) {
if (
!option ||
!option.convertPath ||
typeof option.convertPath !== "object"
) {
return null
}
const converters = []
for (const pattern of normalizeValue(option.convertPath)) {
const include = toStringArray(pattern.include)
const exclude = toStringArray(pattern.exclude)
const fromRegexp = new RegExp(String(pattern.replace[0])) //eslint-disable-line require-unicode-regexp
const toStr = String(pattern.replace[1])
converters.push({
match: createMatch(include, exclude),
convert: defineConvert(fromRegexp, toStr),
})
}
return combine(converters)
}
/**
* Gets "convertPath" setting.
*
* 1. This checks `options` property, then returns it if exists.
* 2. This checks `settings.node` property, then returns it if exists.
* 3. This returns a function of identity.
*
* @param {RuleContext} context - The rule context.
* @returns {function} A function which converts a path.
*/
module.exports = function getConvertPath(context) {
return (
parse(context.options && context.options[0]) ||
parse(context.settings && context.settings.node) ||
identity
)
}
/**
* JSON Schema for `convertPath` option.
*/
module.exports.schema = {
anyOf: [
{
type: "object",
properties: {},
patternProperties: {
"^.+$": {
type: "array",
items: { type: "string" },
minItems: 2,
maxItems: 2,
},
},
additionalProperties: false,
},
{
type: "array",
items: {
type: "object",
properties: {
include: {
type: "array",
items: { type: "string" },
minItems: 1,
uniqueItems: true,
},
exclude: {
type: "array",
items: { type: "string" },
uniqueItems: true,
},
replace: {
type: "array",
items: { type: "string" },
minItems: 2,
maxItems: 2,
},
},
additionalProperties: false,
required: ["include", "replace"],
},
minItems: 1,
},
],
}
@@ -0,0 +1,48 @@
# minipass-collect
A Minipass stream that collects all the data into a single chunk
Note that this buffers ALL data written to it, so it's only good for
situations where you are sure the entire stream fits in memory.
Note: this is primarily useful for the `Collect.PassThrough` class, since
Minipass streams already have a `.collect()` method which returns a promise
that resolves to the array of chunks, and a `.concat()` method that returns
the data concatenated into a single Buffer or String.
## USAGE
```js
const Collect = require('minipass-collect')
const collector = new Collect()
collector.on('data', allTheData => {
console.log('all the data!', allTheData)
})
someSourceOfData.pipe(collector)
// note that you can also simply do:
someSourceOfData.pipe(new Minipass()).concat().then(data => ...)
// or even, if someSourceOfData is a Minipass:
someSourceOfData.concat().then(data => ...)
// but you might prefer to have it stream-shaped rather than
// Promise-shaped in some scenarios.
```
If you want to collect the data, but _also_ act as a passthrough stream,
then use `Collect.PassThrough` instead (for example to memoize streaming
responses), and listen on the `collect` event.
```js
const Collect = require('minipass-collect')
const collector = new Collect.PassThrough()
collector.on('collect', allTheData => {
console.log('all the data!', allTheData)
})
someSourceOfData.pipe(collector).pipe(someOtherStream)
```
All [minipass options](http://npm.im/minipass) are supported.
@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = stringTemplate;
var _options = require("./options.js");
var _parse = require("./parse.js");
var _populate = require("./populate.js");
function stringTemplate(formatter, code, opts) {
code = formatter.code(code);
let metadata;
return arg => {
const replacements = (0, _options.normalizeReplacements)(arg);
if (!metadata) metadata = (0, _parse.default)(formatter, code, opts);
return formatter.unwrap((0, _populate.default)(metadata, replacements));
};
}
//# sourceMappingURL=string.js.map
@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Settings = exports.scandirSync = exports.scandir = void 0;
const async = require("./providers/async");
const sync = require("./providers/sync");
const settings_1 = require("./settings");
exports.Settings = settings_1.default;
function scandir(path, optionsOrSettingsOrCallback, callback) {
if (typeof optionsOrSettingsOrCallback === 'function') {
async.read(path, getSettings(), optionsOrSettingsOrCallback);
return;
}
async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
}
exports.scandir = scandir;
function scandirSync(path, optionsOrSettings) {
const settings = getSettings(optionsOrSettings);
return sync.read(path, settings);
}
exports.scandirSync = scandirSync;
function getSettings(settingsOrOptions = {}) {
if (settingsOrOptions instanceof settings_1.default) {
return settingsOrOptions;
}
return new settings_1.default(settingsOrOptions);
}
@@ -0,0 +1,35 @@
import type { TSESLint } from '@typescript-eslint/utils';
import type { MinimatchOptions } from 'minimatch';
declare const modifierValues: readonly ["always", "ignorePackages", "never"];
export type Modifier = (typeof modifierValues)[number];
export type ModifierByFileExtension = Partial<Record<string, Modifier>>;
export interface OptionsItemWithPatternProperty {
ignorePackages?: boolean;
checkTypeImports?: boolean;
pattern: ModifierByFileExtension;
pathGroupOverrides?: PathGroupOverride[];
fix?: boolean;
}
export interface PathGroupOverride {
pattern: string;
patternOptions?: Record<string, MinimatchOptions>;
action: 'enforce' | 'ignore';
}
export interface OptionsItemWithoutPatternProperty {
ignorePackages?: boolean;
checkTypeImports?: boolean;
pathGroupOverrides?: PathGroupOverride[];
fix?: boolean;
}
export type Options = [] | [OptionsItemWithoutPatternProperty] | [OptionsItemWithPatternProperty] | [Modifier] | [Modifier, OptionsItemWithoutPatternProperty] | [Modifier, OptionsItemWithPatternProperty] | [Modifier, ModifierByFileExtension] | [ModifierByFileExtension];
export interface NormalizedOptions {
defaultConfig?: Modifier;
pattern?: Record<string, Modifier>;
ignorePackages?: boolean;
checkTypeImports?: boolean;
pathGroupOverrides?: PathGroupOverride[];
fix?: boolean;
}
export type MessageId = 'missing' | 'missingKnown' | 'unexpected' | 'addMissing' | 'removeUnexpected';
declare const _default: TSESLint.RuleModule<MessageId, Options, import("../utils/create-rule.ts").ImportXPluginDocs, TSESLint.RuleListener>;
export default _default;
@@ -0,0 +1,205 @@
'use strict';
var utils = require('../utils.js');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
var spaceUnaryOps = utils.createRule({
name: "space-unary-ops",
package: "js",
meta: {
type: "layout",
docs: {
description: "Enforce consistent spacing before or after unary operators"
},
fixable: "whitespace",
schema: [
{
type: "object",
properties: {
words: {
type: "boolean",
default: true
},
nonwords: {
type: "boolean",
default: false
},
overrides: {
type: "object",
additionalProperties: {
type: "boolean"
}
}
},
additionalProperties: false
}
],
messages: {
unexpectedBefore: "Unexpected space before unary operator '{{operator}}'.",
unexpectedAfter: "Unexpected space after unary operator '{{operator}}'.",
unexpectedAfterWord: "Unexpected space after unary word operator '{{word}}'.",
wordOperator: "Unary word operator '{{word}}' must be followed by whitespace.",
operator: "Unary operator '{{operator}}' must be followed by whitespace.",
beforeUnaryExpressions: "Space is required before unary expressions '{{token}}'."
}
},
create(context) {
const options = context.options[0] || { words: true, nonwords: false };
const sourceCode = context.sourceCode;
function isFirstBangInBangBangExpression(node) {
return node && node.type === "UnaryExpression" && node.argument && node.argument.type === "UnaryExpression" && node.argument.operator === "!";
}
function overrideExistsForOperator(operator) {
return options.overrides && Object.prototype.hasOwnProperty.call(options.overrides, operator);
}
function overrideEnforcesSpaces(operator) {
return options.overrides?.[operator];
}
function verifyWordHasSpaces(node, firstToken, secondToken, word) {
if (secondToken.range[0] === firstToken.range[1]) {
context.report({
node,
messageId: "wordOperator",
data: {
word
},
fix(fixer) {
return fixer.insertTextAfter(firstToken, " ");
}
});
}
}
function verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word) {
if (utils.canTokensBeAdjacent(firstToken, secondToken)) {
if (secondToken.range[0] > firstToken.range[1]) {
context.report({
node,
messageId: "unexpectedAfterWord",
data: {
word
},
fix(fixer) {
return fixer.removeRange([firstToken.range[1], secondToken.range[0]]);
}
});
}
}
}
function checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, word) {
if (overrideExistsForOperator(word)) {
if (overrideEnforcesSpaces(word))
verifyWordHasSpaces(node, firstToken, secondToken, word);
else
verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word);
} else if (options.words) {
verifyWordHasSpaces(node, firstToken, secondToken, word);
} else {
verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word);
}
}
function checkForSpacesAfterYield(node) {
const tokens = sourceCode.getFirstTokens(node, 3);
const word = "yield";
if (!node.argument || node.delegate)
return;
checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], word);
}
function checkForSpacesAfterAwait(node) {
const tokens = sourceCode.getFirstTokens(node, 3);
checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], "await");
}
function verifyNonWordsHaveSpaces(node, firstToken, secondToken) {
if ("prefix" in node && node.prefix) {
if (isFirstBangInBangBangExpression(node))
return;
if (firstToken.range[1] === secondToken.range[0]) {
context.report({
node,
messageId: "operator",
data: {
operator: firstToken.value
},
fix(fixer) {
return fixer.insertTextAfter(firstToken, " ");
}
});
}
} else {
if (firstToken.range[1] === secondToken.range[0]) {
context.report({
node,
messageId: "beforeUnaryExpressions",
data: {
token: secondToken.value
},
fix(fixer) {
return fixer.insertTextBefore(secondToken, " ");
}
});
}
}
}
function verifyNonWordsDontHaveSpaces(node, firstToken, secondToken) {
if ("prefix" in node && node.prefix) {
if (secondToken.range[0] > firstToken.range[1]) {
context.report({
node,
messageId: "unexpectedAfter",
data: {
operator: firstToken.value
},
fix(fixer) {
if (utils.canTokensBeAdjacent(firstToken, secondToken))
return fixer.removeRange([firstToken.range[1], secondToken.range[0]]);
return null;
}
});
}
} else {
if (secondToken.range[0] > firstToken.range[1]) {
context.report({
node,
messageId: "unexpectedBefore",
data: {
operator: secondToken.value
},
fix(fixer) {
return fixer.removeRange([firstToken.range[1], secondToken.range[0]]);
}
});
}
}
}
function checkForSpaces(node) {
const tokens = node.type === "UpdateExpression" && !node.prefix ? sourceCode.getLastTokens(node, 2) : sourceCode.getFirstTokens(node, 2);
const firstToken = tokens[0];
const secondToken = tokens[1];
if ((node.type === "NewExpression" || node.prefix) && firstToken.type === "Keyword") {
checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, firstToken.value);
return;
}
const operator = "prefix" in node && node.prefix ? tokens[0].value : tokens[1].value;
if (overrideExistsForOperator(operator)) {
if (overrideEnforcesSpaces(operator))
verifyNonWordsHaveSpaces(node, firstToken, secondToken);
else
verifyNonWordsDontHaveSpaces(node, firstToken, secondToken);
} else if (options.nonwords) {
verifyNonWordsHaveSpaces(node, firstToken, secondToken);
} else {
verifyNonWordsDontHaveSpaces(node, firstToken, secondToken);
}
}
return {
UnaryExpression: checkForSpaces,
UpdateExpression: checkForSpaces,
NewExpression: checkForSpaces,
YieldExpression: checkForSpacesAfterYield,
AwaitExpression: checkForSpacesAfterAwait
};
}
});
module.exports = spaceUnaryOps;
@@ -0,0 +1,7 @@
"use strict";
const { CLIEngine } = require("./cli-engine");
module.exports = {
CLIEngine,
};
@@ -0,0 +1,12 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../../../../../napi-postinstall@0.3.4/node_modules/napi-postinstall/lib/cli.js" "$@"
else
exec node "$basedir/../../../../../napi-postinstall@0.3.4/node_modules/napi-postinstall/lib/cli.js" "$@"
fi
@@ -0,0 +1 @@
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AA6BM,SAAS,0CAA2C,KAA+B;QACd;IAA1E,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,yBAAiB,EAAE,MAAM,WAAW,EAAE,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,MAAM,MAAM,iBAAiB;IACnI,IAAI,eAAe,CAAA,GAAA,cAAM,EAAE,IAAM,eAAe,OAAO;YAAC;SAAY,GAAG,EAAE,EAAE;QAAC;KAAY;IACxF,IAAI,cAAC,UAAU,gBAAE,YAAY,oBAAE,gBAAgB,EAAC,GAAG,CAAA,GAAA,yCAAW,EAAE;QAC9D,GAAG,KAAK;QACR,eAAe;QACf,wBAAwB;QACxB,+BAA+B;sBAC/B;QACA,mBAAmB,CAAC;YAClB,uCAAuC;YACvC,IAAI,SAAS,OACX;gBAEQ;YAAV,IAAI,MAAM,CAAA,0BAAA,KAAK,MAAM,GAAG,IAAI,GAAG,KAAK,cAA1B,qCAAA,0BAA8B;YAExC,6DAA6D;YAC7D,oDAAoD;YACpD,IAAI,QAAQ,eAAe,MAAM,iBAAiB,EAChD,MAAM,iBAAiB,CAAC;YAG1B,eAAe;QACjB;IACF;IAEA,IAAI,eAAe,eAAe,OAC9B,WAAW,OAAO,CAAC,eACnB;IAEJ,OAAO;oBACL;sBACA;0BACA;qBACA;wBACA;sBACA;IACF;AACF","sources":["packages/@react-stately/list/src/useSingleSelectListState.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 {CollectionStateBase, Key, Node, Selection, SingleSelection} from '@react-types/shared';\nimport {ListState, useListState} from './useListState';\nimport {useControlledState} from '@react-stately/utils';\nimport {useMemo} from 'react';\n\nexport interface SingleSelectListProps<T> extends CollectionStateBase<T>, Omit<SingleSelection, 'disallowEmptySelection'> {\n /** Filter function to generate a filtered list of nodes. */\n filter?: (nodes: Iterable<Node<T>>) => Iterable<Node<T>>,\n /** @private */\n suppressTextValueWarning?: boolean\n}\n\nexport interface SingleSelectListState<T> extends ListState<T> {\n /** The key for the currently selected item. */\n readonly selectedKey: Key | null,\n\n /** Sets the selected key. */\n setSelectedKey(key: Key | null): void,\n\n /** The value of the currently selected item. */\n readonly selectedItem: Node<T> | null\n}\n\n/**\n * Provides state management for list-like components with single selection.\n * Handles building a collection of items from props, and manages selection state.\n */\nexport function useSingleSelectListState<T extends object>(props: SingleSelectListProps<T>): SingleSelectListState<T> {\n let [selectedKey, setSelectedKey] = useControlledState(props.selectedKey, props.defaultSelectedKey ?? null, props.onSelectionChange);\n let selectedKeys = useMemo(() => selectedKey != null ? [selectedKey] : [], [selectedKey]);\n let {collection, disabledKeys, selectionManager} = useListState({\n ...props,\n selectionMode: 'single',\n disallowEmptySelection: true,\n allowDuplicateSelectionEvents: true,\n selectedKeys,\n onSelectionChange: (keys: Selection) => {\n // impossible, but TS doesn't know that\n if (keys === 'all') {\n return;\n }\n let key = keys.values().next().value ?? null;\n\n // Always fire onSelectionChange, even if the key is the same\n // as the current key (useControlledState does not).\n if (key === selectedKey && props.onSelectionChange) {\n props.onSelectionChange(key);\n }\n\n setSelectedKey(key);\n }\n });\n\n let selectedItem = selectedKey != null\n ? collection.getItem(selectedKey)\n : null;\n\n return {\n collection,\n disabledKeys,\n selectionManager,\n selectedKey,\n setSelectedKey,\n selectedItem\n };\n}\n"],"names":[],"version":3,"file":"useSingleSelectListState.module.js.map"}
@@ -0,0 +1,29 @@
'use strict';
var inspect = require('../');
var test = require('tape');
var hasToStringTag = require('has-tostringtag/shams')();
var forEach = require('for-each');
test('fakes', { skip: !hasToStringTag }, function (t) {
forEach([
'Array',
'Boolean',
'Date',
'Error',
'Number',
'RegExp',
'String'
], function (expected) {
var faker = {};
faker[Symbol.toStringTag] = expected;
t.equal(
inspect(faker),
'{ [Symbol(Symbol.toStringTag)]: \'' + expected + '\' }',
'faker masquerading as ' + expected + ' is not shown as one'
);
});
t.end();
});
@@ -0,0 +1,31 @@
var baseSortedIndex = require('./_baseSortedIndex'),
eq = require('./eq');
/**
* This method is like `_.indexOf` except that it performs a binary
* search on a sorted `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.sortedIndexOf([4, 5, 5, 5, 6], 5);
* // => 1
*/
function sortedIndexOf(array, value) {
var length = array == null ? 0 : array.length;
if (length) {
var index = baseSortedIndex(array, value);
if (index < length && eq(array[index], value)) {
return index;
}
}
return -1;
}
module.exports = sortedIndexOf;
@@ -0,0 +1,48 @@
import { resolve } from 'path'
export type PathMapping = {
pattern: RegExp
paths: string[]
}
export function resolvePathMappings(
paths: Record<string, string[]>,
base: string
) {
// If a module name can be matched with multiple patterns then pattern
// with the longest prefix will be picked.
const sortedPatterns = Object.keys(paths).sort(
(a: string, b: string) => getPrefixLength(b) - getPrefixLength(a)
)
const resolved: PathMapping[] = []
for (let pattern of sortedPatterns) {
const relativePaths = paths[pattern]
pattern = escapeStringRegexp(pattern).replace(/\*/g, '(.+)')
resolved.push({
pattern: new RegExp('^' + pattern + '$'),
paths: relativePaths.map((relativePath) => resolve(base, relativePath)),
})
}
return resolved
}
function getPrefixLength(pattern: string): number {
const prefixLength = pattern.indexOf('*')
return pattern.substr(0, prefixLength).length
}
// Adapted from:
// https://github.com/sindresorhus/escape-string-regexp/blob/ba9a4473850cb367936417e97f1f2191b7cc67dd/index.js
//
// MIT License
//
// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://
// sindresorhus.com)
//
function escapeStringRegexp(string: string) {
// Escape characters with special meaning either inside or outside
// character sets. Use a simple backslash escape when it’s always
// valid, and a `\xnn` escape when the simpler form would be
// disallowed by Unicode patterns’ stricter grammar.
return string.replace(/[|\\{}()[\]^$+?.]/g, '\\$&').replace(/-/g, '\\x2d')
}
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,oBAAoB,CAAC,uHAAqB,CAAC;AAC/D","sources":["packages/@react-aria/menu/intl/zh-CN.json"],"sourcesContent":["{\n \"longPressMessage\": \"长按或按 Alt + 向下方向键以打开菜单\"\n}\n"],"names":[],"version":3,"file":"zh-CN.module.js.map"}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"F A B","132":"K D E wC"},B:{"1":"0 1 2 3 4 5 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 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 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","2":"xC TC"},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 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 GD HD ID NC uC JD OC","2":"F FD"},G:{"1":"E 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","260":"ZC KD"},H:{"2":"hD"},I:{"1":"J I lD vC mD nD","2":"iD","4":"TC jD kD"},J:{"1":"A","4":"D"},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:"@font-face Web fonts",D:true};
@@ -0,0 +1,39 @@
/**
* @author Yosuke Ota <https://github.com/ota-meshi>
* See LICENSE file in root directory for full license.
*/
"use strict"
const {
definePrototypeMethodHandler,
} = require("../util/define-prototype-method-handler")
module.exports = {
meta: {
docs: {
description: "disallow the `Function.prototype.bind` method.",
category: "ES5",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-function-prototype-bind.html",
},
fixable: null,
messages: {
forbidden: "ES5 '{{name}}' method is forbidden.",
},
schema: [
{
type: "object",
properties: {
aggressive: { type: "boolean" },
},
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
return definePrototypeMethodHandler(context, {
Function: ["bind"],
})
},
}
@@ -0,0 +1 @@
{"version":3,"file":"character-reference.d.ts","sourceRoot":"","sources":["character-reference.js"],"names":[],"mappings":"AAmBA,wBAAwB;AACxB,iCADW,SAAS,CAInB;+BAhBS,sBAAsB"}
@@ -0,0 +1,288 @@
/*!
* to-regex-range <https://github.com/micromatch/to-regex-range>
*
* Copyright (c) 2015-present, Jon Schlinkert.
* Released under the MIT License.
*/
'use strict';
const isNumber = require('is-number');
const toRegexRange = (min, max, options) => {
if (isNumber(min) === false) {
throw new TypeError('toRegexRange: expected the first argument to be a number');
}
if (max === void 0 || min === max) {
return String(min);
}
if (isNumber(max) === false) {
throw new TypeError('toRegexRange: expected the second argument to be a number.');
}
let opts = { relaxZeros: true, ...options };
if (typeof opts.strictZeros === 'boolean') {
opts.relaxZeros = opts.strictZeros === false;
}
let relax = String(opts.relaxZeros);
let shorthand = String(opts.shorthand);
let capture = String(opts.capture);
let wrap = String(opts.wrap);
let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap;
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
return toRegexRange.cache[cacheKey].result;
}
let a = Math.min(min, max);
let b = Math.max(min, max);
if (Math.abs(a - b) === 1) {
let result = min + '|' + max;
if (opts.capture) {
return `(${result})`;
}
if (opts.wrap === false) {
return result;
}
return `(?:${result})`;
}
let isPadded = hasPadding(min) || hasPadding(max);
let state = { min, max, a, b };
let positives = [];
let negatives = [];
if (isPadded) {
state.isPadded = isPadded;
state.maxLen = String(state.max).length;
}
if (a < 0) {
let newMin = b < 0 ? Math.abs(b) : 1;
negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
a = state.a = 0;
}
if (b >= 0) {
positives = splitToPatterns(a, b, state, opts);
}
state.negatives = negatives;
state.positives = positives;
state.result = collatePatterns(negatives, positives, opts);
if (opts.capture === true) {
state.result = `(${state.result})`;
} else if (opts.wrap !== false && (positives.length + negatives.length) > 1) {
state.result = `(?:${state.result})`;
}
toRegexRange.cache[cacheKey] = state;
return state.result;
};
function collatePatterns(neg, pos, options) {
let onlyNegative = filterPatterns(neg, pos, '-', false, options) || [];
let onlyPositive = filterPatterns(pos, neg, '', false, options) || [];
let intersected = filterPatterns(neg, pos, '-?', true, options) || [];
let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
return subpatterns.join('|');
}
function splitToRanges(min, max) {
let nines = 1;
let zeros = 1;
let stop = countNines(min, nines);
let stops = new Set([max]);
while (min <= stop && stop <= max) {
stops.add(stop);
nines += 1;
stop = countNines(min, nines);
}
stop = countZeros(max + 1, zeros) - 1;
while (min < stop && stop <= max) {
stops.add(stop);
zeros += 1;
stop = countZeros(max + 1, zeros) - 1;
}
stops = [...stops];
stops.sort(compare);
return stops;
}
/**
* Convert a range to a regex pattern
* @param {Number} `start`
* @param {Number} `stop`
* @return {String}
*/
function rangeToPattern(start, stop, options) {
if (start === stop) {
return { pattern: start, count: [], digits: 0 };
}
let zipped = zip(start, stop);
let digits = zipped.length;
let pattern = '';
let count = 0;
for (let i = 0; i < digits; i++) {
let [startDigit, stopDigit] = zipped[i];
if (startDigit === stopDigit) {
pattern += startDigit;
} else if (startDigit !== '0' || stopDigit !== '9') {
pattern += toCharacterClass(startDigit, stopDigit, options);
} else {
count++;
}
}
if (count) {
pattern += options.shorthand === true ? '\\d' : '[0-9]';
}
return { pattern, count: [count], digits };
}
function splitToPatterns(min, max, tok, options) {
let ranges = splitToRanges(min, max);
let tokens = [];
let start = min;
let prev;
for (let i = 0; i < ranges.length; i++) {
let max = ranges[i];
let obj = rangeToPattern(String(start), String(max), options);
let zeros = '';
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
if (prev.count.length > 1) {
prev.count.pop();
}
prev.count.push(obj.count[0]);
prev.string = prev.pattern + toQuantifier(prev.count);
start = max + 1;
continue;
}
if (tok.isPadded) {
zeros = padZeros(max, tok, options);
}
obj.string = zeros + obj.pattern + toQuantifier(obj.count);
tokens.push(obj);
start = max + 1;
prev = obj;
}
return tokens;
}
function filterPatterns(arr, comparison, prefix, intersection, options) {
let result = [];
for (let ele of arr) {
let { string } = ele;
// only push if _both_ are negative...
if (!intersection && !contains(comparison, 'string', string)) {
result.push(prefix + string);
}
// or _both_ are positive
if (intersection && contains(comparison, 'string', string)) {
result.push(prefix + string);
}
}
return result;
}
/**
* Zip strings
*/
function zip(a, b) {
let arr = [];
for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
return arr;
}
function compare(a, b) {
return a > b ? 1 : b > a ? -1 : 0;
}
function contains(arr, key, val) {
return arr.some(ele => ele[key] === val);
}
function countNines(min, len) {
return Number(String(min).slice(0, -len) + '9'.repeat(len));
}
function countZeros(integer, zeros) {
return integer - (integer % Math.pow(10, zeros));
}
function toQuantifier(digits) {
let [start = 0, stop = ''] = digits;
if (stop || start > 1) {
return `{${start + (stop ? ',' + stop : '')}}`;
}
return '';
}
function toCharacterClass(a, b, options) {
return `[${a}${(b - a === 1) ? '' : '-'}${b}]`;
}
function hasPadding(str) {
return /^-?(0+)\d/.test(str);
}
function padZeros(value, tok, options) {
if (!tok.isPadded) {
return value;
}
let diff = Math.abs(tok.maxLen - String(value).length);
let relax = options.relaxZeros !== false;
switch (diff) {
case 0:
return '';
case 1:
return relax ? '0?' : '0';
case 2:
return relax ? '0{0,2}' : '00';
default: {
return relax ? `0{0,${diff}}` : `0{${diff}}`;
}
}
}
/**
* Cache
*/
toRegexRange.cache = {};
toRegexRange.clearCache = () => (toRegexRange.cache = {});
/**
* Expose `toRegexRange`
*/
module.exports = toRegexRange;
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more