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,386 @@
import { __awaiter, __rest } from "tslib";
import { createHash } from 'node:crypto';
import fs from 'node:fs';
import module from 'node:module';
import path from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import { MessageChannel, Worker, parentPort, receiveMessageOnPort, workerData, } from 'node:worker_threads';
import { findUp, isPkgAvailable, tryExtensions } from '@pkgr/core';
const INT32_BYTES = 4;
export * from './types.js';
export const TsRunner = {
TsNode: 'ts-node',
EsbuildRegister: 'esbuild-register',
EsbuildRunner: 'esbuild-runner',
SWC: 'swc',
TSX: 'tsx',
};
const { NODE_OPTIONS, SYNCKIT_EXEC_ARGV, SYNCKIT_GLOBAL_SHIMS, SYNCKIT_TIMEOUT, SYNCKIT_TS_RUNNER, } = process.env;
const IS_NODE_20 = Number(process.versions.node.split('.')[0]) >= 20;
export const DEFAULT_TIMEOUT = SYNCKIT_TIMEOUT ? +SYNCKIT_TIMEOUT : undefined;
export const DEFAULT_EXEC_ARGV = (SYNCKIT_EXEC_ARGV === null || SYNCKIT_EXEC_ARGV === void 0 ? void 0 : SYNCKIT_EXEC_ARGV.split(',')) || [];
export const DEFAULT_TS_RUNNER = SYNCKIT_TS_RUNNER;
export const DEFAULT_GLOBAL_SHIMS = ['1', 'true'].includes(SYNCKIT_GLOBAL_SHIMS);
export const DEFAULT_GLOBAL_SHIMS_PRESET = [
{
moduleName: 'node-fetch',
globalName: 'fetch',
},
{
moduleName: 'node:perf_hooks',
globalName: 'performance',
named: 'performance',
},
];
export const MTS_SUPPORTED_NODE_VERSION = 16;
let syncFnCache;
export function extractProperties(object) {
if (object && typeof object === 'object') {
const properties = {};
for (const key in object) {
properties[key] = object[key];
}
return properties;
}
}
export function createSyncFn(workerPath, timeoutOrOptions) {
syncFnCache !== null && syncFnCache !== void 0 ? syncFnCache : (syncFnCache = new Map());
const cachedSyncFn = syncFnCache.get(workerPath);
if (cachedSyncFn) {
return cachedSyncFn;
}
if (!path.isAbsolute(workerPath)) {
throw new Error('`workerPath` must be absolute');
}
const syncFn = startWorkerThread(workerPath, typeof timeoutOrOptions === 'number'
? { timeout: timeoutOrOptions }
: timeoutOrOptions);
syncFnCache.set(workerPath, syncFn);
return syncFn;
}
const cjsRequire = typeof require === 'undefined'
? module.createRequire(import.meta.url)
: require;
const dataUrl = (code) => new URL(`data:text/javascript,${encodeURIComponent(code)}`);
export const isFile = (path) => {
var _a;
try {
return !!((_a = fs.statSync(path, { throwIfNoEntry: false })) === null || _a === void 0 ? void 0 : _a.isFile());
}
catch (_b) {
return false;
}
};
const setupTsRunner = (workerPath, { execArgv, tsRunner }) => {
let ext = path.extname(workerPath);
if (!/[/\\]node_modules[/\\]/.test(workerPath) &&
(!ext || /^\.[cm]?js$/.test(ext))) {
const workPathWithoutExt = ext
? workerPath.slice(0, -ext.length)
: workerPath;
let extensions;
switch (ext) {
case '.cjs': {
extensions = ['.cts', '.cjs'];
break;
}
case '.mjs': {
extensions = ['.mts', '.mjs'];
break;
}
default: {
extensions = ['.ts', '.js'];
break;
}
}
const found = tryExtensions(workPathWithoutExt, extensions);
let differentExt;
if (found && (!ext || (differentExt = found !== workPathWithoutExt))) {
workerPath = found;
if (differentExt) {
ext = path.extname(workerPath);
}
}
}
const isTs = /\.[cm]?ts$/.test(workerPath);
let jsUseEsm = workerPath.endsWith('.mjs');
let tsUseEsm = workerPath.endsWith('.mts');
if (isTs) {
if (!tsUseEsm) {
const pkg = findUp(workerPath);
if (pkg) {
tsUseEsm =
cjsRequire(pkg).type ===
'module';
}
}
if (tsRunner == null && isPkgAvailable(TsRunner.TsNode)) {
tsRunner = TsRunner.TsNode;
}
switch (tsRunner) {
case TsRunner.TsNode: {
if (tsUseEsm) {
if (!execArgv.includes('--loader')) {
execArgv = ['--loader', `${TsRunner.TsNode}/esm`, ...execArgv];
}
}
else if (!execArgv.includes('-r')) {
execArgv = ['-r', `${TsRunner.TsNode}/register`, ...execArgv];
}
break;
}
case TsRunner.EsbuildRegister: {
if (!execArgv.includes('-r')) {
execArgv = ['-r', TsRunner.EsbuildRegister, ...execArgv];
}
break;
}
case TsRunner.EsbuildRunner: {
if (!execArgv.includes('-r')) {
execArgv = ['-r', `${TsRunner.EsbuildRunner}/register`, ...execArgv];
}
break;
}
case TsRunner.SWC: {
if (!execArgv.includes('-r')) {
execArgv = ['-r', `@${TsRunner.SWC}-node/register`, ...execArgv];
}
break;
}
case TsRunner.TSX: {
if (!execArgv.includes('--loader')) {
execArgv = ['--loader', TsRunner.TSX, ...execArgv];
}
break;
}
default: {
throw new Error(`Unknown ts runner: ${String(tsRunner)}`);
}
}
}
else if (!jsUseEsm) {
const pkg = findUp(workerPath);
if (pkg) {
jsUseEsm =
cjsRequire(pkg).type === 'module';
}
}
let resolvedPnpLoaderPath;
if (process.versions.pnp) {
const nodeOptions = NODE_OPTIONS === null || NODE_OPTIONS === void 0 ? void 0 : NODE_OPTIONS.split(/\s+/);
let pnpApiPath;
try {
pnpApiPath = cjsRequire.resolve('pnpapi');
}
catch (_a) { }
if (pnpApiPath &&
!(nodeOptions === null || nodeOptions === void 0 ? void 0 : nodeOptions.some((option, index) => ['-r', '--require'].includes(option) &&
pnpApiPath === cjsRequire.resolve(nodeOptions[index + 1]))) &&
!execArgv.includes(pnpApiPath)) {
execArgv = ['-r', pnpApiPath, ...execArgv];
const pnpLoaderPath = path.resolve(pnpApiPath, '../.pnp.loader.mjs');
if (isFile(pnpLoaderPath)) {
resolvedPnpLoaderPath = pathToFileURL(pnpLoaderPath).toString();
if (!IS_NODE_20) {
execArgv = [
'--experimental-loader',
resolvedPnpLoaderPath,
...execArgv,
];
}
}
}
}
return {
ext,
isTs,
jsUseEsm,
tsRunner,
tsUseEsm,
workerPath,
pnpLoaderPath: resolvedPnpLoaderPath,
execArgv,
};
};
const md5Hash = (text) => createHash('md5').update(text).digest('hex');
export const encodeImportModule = (moduleNameOrGlobalShim, type = 'import') => {
const { moduleName, globalName, named, conditional } = typeof moduleNameOrGlobalShim === 'string'
? { moduleName: moduleNameOrGlobalShim }
: moduleNameOrGlobalShim;
const importStatement = type === 'import'
? `import${globalName
? ' ' +
(named === null
? '* as ' + globalName
: (named === null || named === void 0 ? void 0 : named.trim())
? `{${named}}`
: globalName) +
' from'
: ''} '${path.isAbsolute(moduleName)
? String(pathToFileURL(moduleName))
: moduleName}'`
: `${globalName
? 'const ' + ((named === null || named === void 0 ? void 0 : named.trim()) ? `{${named}}` : globalName) + '='
: ''}require('${moduleName
.replace(/\\/g, '\\\\')}')`;
if (!globalName) {
return importStatement;
}
const overrideStatement = `globalThis.${globalName}=${(named === null || named === void 0 ? void 0 : named.trim()) ? named : globalName}`;
return (importStatement +
(conditional === false
? `;${overrideStatement}`
: `;if(!globalThis.${globalName})${overrideStatement}`));
};
export const _generateGlobals = (globalShims, type) => globalShims.reduce((acc, shim) => `${acc}${acc ? ';' : ''}${encodeImportModule(shim, type)}`, '');
let globalsCache;
let tmpdir;
const _dirname = typeof __dirname === 'undefined'
? path.dirname(fileURLToPath(import.meta.url))
: __dirname;
let sharedBuffer;
let sharedBufferView;
export const generateGlobals = (workerPath, globalShims, type = 'import') => {
globalsCache !== null && globalsCache !== void 0 ? globalsCache : (globalsCache = new Map());
const cached = globalsCache.get(workerPath);
if (cached) {
const [content, filepath] = cached;
if ((type === 'require' && !filepath) ||
(type === 'import' && filepath && isFile(filepath))) {
return content;
}
}
const globals = _generateGlobals(globalShims, type);
let content = globals;
let filepath;
if (type === 'import') {
if (!tmpdir) {
tmpdir = path.resolve(findUp(_dirname), '../node_modules/.synckit');
}
fs.mkdirSync(tmpdir, { recursive: true });
filepath = path.resolve(tmpdir, md5Hash(workerPath) + '.mjs');
content = encodeImportModule(filepath);
fs.writeFileSync(filepath, globals);
}
globalsCache.set(workerPath, [content, filepath]);
return content;
};
function startWorkerThread(workerPath, { timeout = DEFAULT_TIMEOUT, execArgv = DEFAULT_EXEC_ARGV, tsRunner = DEFAULT_TS_RUNNER, transferList = [], globalShims = DEFAULT_GLOBAL_SHIMS, } = {}) {
const { port1: mainPort, port2: workerPort } = new MessageChannel();
const { isTs, ext, jsUseEsm, tsUseEsm, tsRunner: finalTsRunner, workerPath: finalWorkerPath, pnpLoaderPath, execArgv: finalExecArgv, } = setupTsRunner(workerPath, { execArgv, tsRunner });
const workerPathUrl = pathToFileURL(finalWorkerPath);
if (/\.[cm]ts$/.test(finalWorkerPath)) {
const isTsxSupported = !tsUseEsm ||
Number.parseFloat(process.versions.node) >= MTS_SUPPORTED_NODE_VERSION;
if (!finalTsRunner) {
throw new Error('No ts runner specified, ts worker path is not supported');
}
else if ([
TsRunner.EsbuildRegister,
TsRunner.EsbuildRunner,
TsRunner.SWC,
...(isTsxSupported ? [] : [TsRunner.TSX]),
].includes(finalTsRunner)) {
throw new Error(`${finalTsRunner} is not supported for ${ext} files yet` +
(isTsxSupported
? ', you can try [tsx](https://github.com/esbuild-kit/tsx) instead'
: ''));
}
}
const finalGlobalShims = (globalShims === true
? DEFAULT_GLOBAL_SHIMS_PRESET
: Array.isArray(globalShims)
? globalShims
: []).filter(({ moduleName }) => isPkgAvailable(moduleName));
sharedBufferView !== null && sharedBufferView !== void 0 ? sharedBufferView : (sharedBufferView = new Int32Array((sharedBuffer !== null && sharedBuffer !== void 0 ? sharedBuffer : (sharedBuffer = new SharedArrayBuffer(INT32_BYTES))), 0, 1));
const useGlobals = finalGlobalShims.length > 0;
const useEval = isTs ? !tsUseEsm : !jsUseEsm && useGlobals;
const worker = new Worker((jsUseEsm && useGlobals) || (tsUseEsm && finalTsRunner === TsRunner.TsNode)
? dataUrl(`${generateGlobals(finalWorkerPath, finalGlobalShims)};import '${String(workerPathUrl)}'`)
: useEval
? `${generateGlobals(finalWorkerPath, finalGlobalShims, 'require')};${encodeImportModule(finalWorkerPath, 'require')}`
: workerPathUrl, {
eval: useEval,
workerData: { sharedBuffer, workerPort, pnpLoaderPath },
transferList: [workerPort, ...transferList],
execArgv: finalExecArgv,
});
let nextID = 0;
const receiveMessageWithId = (port, expectedId, waitingTimeout) => {
const start = Date.now();
const status = Atomics.wait(sharedBufferView, 0, 0, waitingTimeout);
Atomics.store(sharedBufferView, 0, 0);
if (!['ok', 'not-equal'].includes(status)) {
const abortMsg = {
id: expectedId,
cmd: 'abort',
};
port.postMessage(abortMsg);
throw new Error('Internal error: Atomics.wait() failed: ' + status);
}
const result = receiveMessageOnPort(mainPort);
const msg = result === null || result === void 0 ? void 0 : result.message;
if ((msg === null || msg === void 0 ? void 0 : msg.id) == null || msg.id < expectedId) {
const waitingTime = Date.now() - start;
return receiveMessageWithId(port, expectedId, waitingTimeout ? waitingTimeout - waitingTime : undefined);
}
const { id } = msg, message = __rest(msg, ["id"]);
if (id < expectedId) {
const waitingTime = Date.now() - start;
return receiveMessageWithId(port, expectedId, waitingTimeout ? waitingTimeout - waitingTime : undefined);
}
if (expectedId !== id) {
throw new Error(`Internal error: Expected id ${expectedId} but got id ${id}`);
}
return Object.assign({ id }, message);
};
const syncFn = (...args) => {
const id = nextID++;
const msg = { id, args };
worker.postMessage(msg);
const { result, error, properties } = receiveMessageWithId(mainPort, id, timeout);
if (error) {
throw Object.assign(error, properties);
}
return result;
};
worker.unref();
return syncFn;
}
export function runAsWorker(fn) {
if (!workerData) {
return;
}
const { workerPort, sharedBuffer, pnpLoaderPath } = workerData;
if (pnpLoaderPath && IS_NODE_20) {
module.register(pnpLoaderPath);
}
const sharedBufferView = new Int32Array(sharedBuffer, 0, 1);
parentPort.on('message', ({ id, args }) => {
;
(() => __awaiter(this, void 0, void 0, function* () {
let isAborted = false;
const handleAbortMessage = (msg) => {
if (msg.id === id && msg.cmd === 'abort') {
isAborted = true;
}
};
workerPort.on('message', handleAbortMessage);
let msg;
try {
msg = { id, result: yield fn(...args) };
}
catch (error) {
msg = { id, error, properties: extractProperties(error) };
}
workerPort.off('message', handleAbortMessage);
if (isAborted) {
return;
}
workerPort.postMessage(msg);
Atomics.add(sharedBufferView, 0, 1);
Atomics.notify(sharedBufferView, 0);
}))();
});
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1,29 @@
var createCompounder = require('./_createCompounder'),
upperFirst = require('./upperFirst');
/**
* Converts `string` to
* [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
*
* @static
* @memberOf _
* @since 3.1.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the start cased string.
* @example
*
* _.startCase('--foo-bar--');
* // => 'Foo Bar'
*
* _.startCase('fooBar');
* // => 'Foo Bar'
*
* _.startCase('__FOO_BAR__');
* // => 'FOO BAR'
*/
var startCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + upperFirst(word);
});
module.exports = startCase;
@@ -0,0 +1,47 @@
'use strict';
var isRelative = require('is-relative');
var isWindows = require('is-windows');
/**
* Expose `isAbsolute`
*/
module.exports = isAbsolute;
/**
* Returns true if a file path is absolute.
*
* @param {String} `fp`
* @return {Boolean}
*/
function isAbsolute(fp) {
if (typeof fp !== 'string') {
throw new TypeError('isAbsolute expects a string.');
}
return isWindows() ? isAbsolute.win32(fp) : isAbsolute.posix(fp);
}
/**
* Test posix paths.
*/
isAbsolute.posix = function posixPath(fp) {
return fp.charAt(0) === '/';
};
/**
* Test windows paths.
*/
isAbsolute.win32 = function win32(fp) {
if (/[a-z]/i.test(fp.charAt(0)) && fp.charAt(1) === ':' && fp.charAt(2) === '\\') {
return true;
}
// Microsoft Azure absolute filepath
if (fp.slice(0, 2) === '\\\\') {
return true;
}
return !isRelative(fp);
};
@@ -0,0 +1,102 @@
var $7Z9ig$react = require("react");
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "Row", () => $9ec6912e32cc0d81$export$b59bdbef9ce70de2);
/*
* 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 $9ec6912e32cc0d81$var$Row(props) {
return null;
}
$9ec6912e32cc0d81$var$Row.getCollectionNode = function* getCollectionNode(props, context) {
let { children: children, textValue: textValue, UNSTABLE_childItems: UNSTABLE_childItems } = props;
yield {
type: 'item',
props: props,
textValue: textValue,
'aria-label': props['aria-label'],
hasChildNodes: true,
*childNodes () {
// Process cells first
if (context.showDragButtons) yield {
type: 'cell',
key: 'header-drag',
props: {
isDragButtonCell: true
}
};
if (context.showSelectionCheckboxes && context.selectionMode !== 'none') yield {
type: 'cell',
key: 'header',
props: {
isSelectionCell: true
}
};
if (typeof children === 'function') {
for (let column of context.columns)yield {
type: 'cell',
element: children(column.key),
key: column.key // this is combined with the row key by CollectionBuilder
};
if (UNSTABLE_childItems) for (let child of UNSTABLE_childItems)// Note: in order to reuse the render function of TableBody for our child rows, we just need to yield a type and a value here. CollectionBuilder will then look up
// the parent renderer and use that to build the full node of this child row, using the value provided here to generate the cells
yield {
type: 'item',
value: child
};
} else {
let cells = [];
let childRows = [];
let columnCount = 0;
(0, ($parcel$interopDefault($7Z9ig$react))).Children.forEach(children, (node)=>{
if (node.type === $9ec6912e32cc0d81$var$Row) {
if (cells.length < context.columns.length) throw new Error('All of a Row\'s child Cells must be positioned before any child Rows.');
childRows.push({
type: 'item',
element: node
});
} else {
cells.push({
type: 'cell',
element: node
});
var _node_props_colSpan;
columnCount += (_node_props_colSpan = node.props.colSpan) !== null && _node_props_colSpan !== void 0 ? _node_props_colSpan : 1;
}
});
if (columnCount !== context.columns.length) throw new Error(`Cell count must match column count. Found ${columnCount} cells and ${context.columns.length} columns.`);
yield* cells;
yield* childRows;
}
},
shouldInvalidate (newContext) {
// Invalidate all rows if the columns changed.
return newContext.columns.length !== context.columns.length || newContext.columns.some((c, i)=>c.key !== context.columns[i].key) || newContext.showSelectionCheckboxes !== context.showSelectionCheckboxes || newContext.showDragButtons !== context.showDragButtons || newContext.selectionMode !== context.selectionMode;
}
};
};
/**
* A Row represents a single item in a Table and contains Cell elements for each column.
* Cells can be statically defined as children, or generated dynamically using a function
* based on the columns defined in the TableHeader.
*/ // We don't want getCollectionNode to show up in the type definition
let $9ec6912e32cc0d81$export$b59bdbef9ce70de2 = $9ec6912e32cc0d81$var$Row;
//# sourceMappingURL=Row.main.js.map
@@ -0,0 +1 @@
{"name":"fastq","version":"1.19.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532095749,"integrity":"sha512-evchPJoEapp+9Kk5zZRA95xtvbXd0GFSaY4aac4rsnAZ0vneEh2tg31ybvorQDRRsid4MQBgM2kH5WpdchOY+w==","mode":420,"size":765},"bench.js":{"checkedAt":1794532095749,"integrity":"sha512-+iDoaM4ZD8Zhfp3FWKoRnGS3uinwAuRJ00JjByAe7ncmIQnU0mRnp0Gtv8Sc5sDiGAX2MNSyjjxCf8ZFGhSMtw==","mode":420,"size":1195},"example.js":{"checkedAt":1794532095749,"integrity":"sha512-mVyQ/Qr0vtPfvHYhmLmQE8jVm+w/kUGleDFk7AsB3+RZb+T+EqLa/6qt/b3naQVTQHtJmaJC+vv1pwDWkpAhPg==","mode":420,"size":238},"test/promise.js":{"checkedAt":1794532095749,"integrity":"sha512-xLQS5asLKgRKL1GooM3ayYGe2StxEqDaE5sDHSIXvhy/5QTm7NTHWHRxiLUu9g/E0FZrojRnqCUzIR9lOiJE+g==","mode":420,"size":6383},"queue.js":{"checkedAt":1794532095750,"integrity":"sha512-d+ufQFCnAAz6fUlSjxhxmoMwKGMhuIm9jsW1jhQ4oOltqb6EqOXSj5x9GHJjYz12hp98cT45UW93sD7dQ+8m7g==","mode":420,"size":6244},"test/test.js":{"checkedAt":1794532095750,"integrity":"sha512-5k/mFN5IMKNn2LjVeZIBFH639L1nVZRh4Un5rpspaGbuBR5kwLDJDRnKOw4sSIuWqvUVeVha7s5pxF8LT8t3qQ==","mode":420,"size":13983},"package.json":{"checkedAt":1794532095750,"integrity":"sha512-j3x4reeEgicCGYks4QrcD0IaunnTvXD/3Z+eMhaLe338b/khHZuOUgMk6+whScG07qGH6udIZXE3MfShzL1bfg==","mode":420,"size":1374},"test/tsconfig.json":{"checkedAt":1794532095750,"integrity":"sha512-IDz3YjBY1JHTNafNe7pvDTVHDTsJsJpTEF0auzU41Ie7/YvP7PbjpJL15NCx9kej0OpNNQWEVZGwFH7RUI182A==","mode":420,"size":154},"README.md":{"checkedAt":1794532095750,"integrity":"sha512-H8JU+0hivzrObHznhSlCoIxA6i5OIL1uqkvsjqy0S3inD/fF6UVzUddbtyXcQg0nGPIVbQkiBOduKRrkcC0/9g==","mode":420,"size":8343},"SECURITY.md":{"checkedAt":1794532095750,"integrity":"sha512-0nt0GWMXpexFLbBcpryZYosPIf4AmBYor0HrBH47topAb1/CuNNADj8eiMktKqZEM6VVua/EBX29nowMfRfu0A==","mode":420,"size":455},"example.mjs":{"checkedAt":1794532095750,"integrity":"sha512-AFtzXI7xjdmMtpI/gIogVu2gHJbHj1NGQtvK4cFOMO7/KcWSMg9LNGLmwSpBlIP0g/V7cxG2giJjNdklEIerpQ==","mode":420,"size":221},"test/example.ts":{"checkedAt":1794532095751,"integrity":"sha512-R6a5N1sMGaG91WDB0jAE32Eve9sxsAxifKz6uC6itCZnSL6Dm9pZzrhDej/qvMkcxO8i5dI8FNl6Fd+VR1SQWA==","mode":420,"size":1462},"index.d.ts":{"checkedAt":1794532095751,"integrity":"sha512-JltPaRCT0qGN6Mf//XFN5B9eX8EyfgLOxmc40bkcrxl8Qpd7EJcApfSeS7m1Fq+XfxLQB0AK3j6ahMU3ESFnZA==","mode":420,"size":3505},".github/workflows/ci.yml":{"checkedAt":1794532095751,"integrity":"sha512-LKX+ZzC6F9ywWiNn+1ixfmPhjSyj8XJi5C7fooAK4eZfcMRWOz4PhJ/A5fuTOXmzxmX4SHuhYOIi9HmDr87NVQ==","mode":420,"size":1408},".github/dependabot.yml":{"checkedAt":1794532095751,"integrity":"sha512-X99brF4xMYFpV19YG2rwc9Z8c3Dd1RSctfiao7387XVAGS8hlzICHKT1w0uKLggjbN2D2gdG9Zk+blajxLe/QQ==","mode":420,"size":192}}}
@@ -0,0 +1,36 @@
var baseAssignValue = require('./_baseAssignValue'),
baseForOwn = require('./_baseForOwn'),
baseIteratee = require('./_baseIteratee');
/**
* The opposite of `_.mapValues`; this method creates an object with the
* same values as `object` and keys generated by running each own enumerable
* string keyed property of `object` thru `iteratee`. The iteratee is invoked
* with three arguments: (value, key, object).
*
* @static
* @memberOf _
* @since 3.8.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns the new mapped object.
* @see _.mapValues
* @example
*
* _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
* return key + value;
* });
* // => { 'a1': 1, 'b2': 2 }
*/
function mapKeys(object, iteratee) {
var result = {};
iteratee = baseIteratee(iteratee, 3);
baseForOwn(object, function(value, key, object) {
baseAssignValue(result, iteratee(value, key, object), value);
});
return result;
}
module.exports = mapKeys;
@@ -0,0 +1,22 @@
import { Cloneable } from './Cloneable';
export type OneToManyMapStartSpec<TRelation extends object> = {
[TKey in keyof TRelation]: {
isOptional: undefined extends TRelation[TKey] ? true : false;
};
};
/**
* Data structure able to efficiently manage a set of models related to a set of properties in a one to many relation.
*/
export declare class OneToManyMapStar<TModel, TRelation extends object> implements Cloneable<OneToManyMapStar<TModel, TRelation>> {
#private;
constructor(spec: OneToManyMapStartSpec<TRelation>);
add(model: TModel, relation: TRelation): void;
clone(): this;
get<TKey extends keyof TRelation>(key: TKey, value: Required<TRelation>[TKey]): Iterable<TModel> | undefined;
getAllKeys<TKey extends keyof TRelation>(key: TKey): Iterable<TRelation[TKey]>;
removeByRelation<TKey extends keyof TRelation>(key: TKey, value: Required<TRelation>[TKey]): void;
protected _buildNewInstance(spec: OneToManyMapStartSpec<TRelation>): this;
protected _cloneModel(model: TModel): TModel;
protected _cloneRelation(relation: TRelation): TRelation;
}
//# sourceMappingURL=OneToManyMapStar.d.ts.map
@@ -0,0 +1,91 @@
/// <reference types="node" />
import * as http from "http";
/**
* Create a new connect server.
*/
declare function createServer(): createServer.Server;
declare namespace createServer {
export type ServerHandle = HandleFunction | http.Server;
export class IncomingMessage extends http.IncomingMessage {
originalUrl?: http.IncomingMessage["url"] | undefined;
}
type NextFunction = (err?: any) => void;
export type SimpleHandleFunction = (req: IncomingMessage, res: http.ServerResponse) => void;
export type NextHandleFunction = (req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
export type ErrorHandleFunction = (
err: any,
req: IncomingMessage,
res: http.ServerResponse,
next: NextFunction,
) => void;
export type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction;
export interface ServerStackItem {
route: string;
handle: ServerHandle;
}
export interface Server extends NodeJS.EventEmitter {
(req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void;
route: string;
stack: ServerStackItem[];
/**
* Utilize the given middleware `handle` to the given `route`,
* defaulting to _/_. This "route" is the mount-point for the
* middleware, when given a value other than _/_ the middleware
* is only effective when that segment is present in the request's
* pathname.
*
* For example if we were to mount a function at _/admin_, it would
* be invoked on _/admin_, and _/admin/settings_, however it would
* not be invoked for _/_, or _/posts_.
*/
use(fn: NextHandleFunction): Server;
use(fn: HandleFunction): Server;
use(route: string, fn: NextHandleFunction): Server;
use(route: string, fn: HandleFunction): Server;
/**
* Handle server requests, punting them down
* the middleware stack.
*/
handle(req: http.IncomingMessage, res: http.ServerResponse, next: Function): void;
/**
* Listen for connections.
*
* This method takes the same arguments
* as node's `http.Server#listen()`.
*
* HTTP and HTTPS:
*
* If you run your application both as HTTP
* and HTTPS you may wrap them individually,
* since your Connect "server" is really just
* a JavaScript `Function`.
*
* var connect = require('connect')
* , http = require('http')
* , https = require('https');
*
* var app = connect();
*
* http.createServer(app).listen(80);
* https.createServer(options, app).listen(443);
*/
listen(port: number, hostname?: string, backlog?: number, callback?: Function): http.Server;
listen(port: number, hostname?: string, callback?: Function): http.Server;
listen(path: string, callback?: Function): http.Server;
listen(handle: any, listeningListener?: Function): http.Server;
}
}
export = createServer;
@@ -0,0 +1,56 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TBSCertList = exports.RevokedCertificate = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const algorithm_identifier_1 = require("./algorithm_identifier");
const name_1 = require("./name");
const time_1 = require("./time");
const extension_1 = require("./extension");
class RevokedCertificate {
constructor(params = {}) {
this.userCertificate = new ArrayBuffer(0);
this.revocationDate = new time_1.Time();
Object.assign(this, params);
}
}
exports.RevokedCertificate = RevokedCertificate;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer, converter: asn1_schema_1.AsnIntegerArrayBufferConverter })
], RevokedCertificate.prototype, "userCertificate", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: time_1.Time })
], RevokedCertificate.prototype, "revocationDate", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: extension_1.Extension, optional: true, repeated: "sequence" })
], RevokedCertificate.prototype, "crlEntryExtensions", void 0);
class TBSCertList {
constructor(params = {}) {
this.signature = new algorithm_identifier_1.AlgorithmIdentifier();
this.issuer = new name_1.Name();
this.thisUpdate = new time_1.Time();
Object.assign(this, params);
}
}
exports.TBSCertList = TBSCertList;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer, optional: true })
], TBSCertList.prototype, "version", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: algorithm_identifier_1.AlgorithmIdentifier })
], TBSCertList.prototype, "signature", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: name_1.Name })
], TBSCertList.prototype, "issuer", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: time_1.Time })
], TBSCertList.prototype, "thisUpdate", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: time_1.Time, optional: true })
], TBSCertList.prototype, "nextUpdate", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: RevokedCertificate, repeated: "sequence", optional: true })
], TBSCertList.prototype, "revokedCertificates", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: extension_1.Extension, optional: true, context: 0, repeated: "sequence" })
], TBSCertList.prototype, "crlExtensions", void 0);
@@ -0,0 +1 @@
"use strict";var _chunkVEJPISHXjs = require('./chunk-VEJPISHX.js');var _chunkM3H36CX2js = require('./chunk-M3H36CX2.js');var _worker_threads = require('worker_threads');_worker_threads.parentPort.once("message",async({method:e,path:s,data:i})=>{try{if(e===0&&_worker_threads.parentPort.postMessage(await _chunkM3H36CX2js.e.load(s)),e===1&&await _chunkM3H36CX2js.e.save(s,i),e===2&&_worker_threads.parentPort.postMessage(await _chunkM3H36CX2js.f.load(s)),e===3&&_worker_threads.parentPort.postMessage(await _chunkM3H36CX2js.f.load(s,void 0,!0)),e===4&&await _chunkM3H36CX2js.f.save(s,i),e===6&&await _chunkVEJPISHXjs.a.save(s,Buffer.from(i)),e===5){let o=await _chunkVEJPISHXjs.a.load(s),n=new Uint8Array(new SharedArrayBuffer(o.byteLength));n.set(o),_worker_threads.parentPort.postMessage(n)}process.exit(0)}catch (e2){process.exit(1)}});
@@ -0,0 +1,9 @@
import { M as ModuleMockerInterceptor, a as ModuleMockerCompilerHints, b as ModuleMocker } from './mocker.d-TnKRhz7N.js';
import '@vitest/spy';
import './types.d-B8CCKmHt.js';
import './index.d-C-sLYZi-.js';
declare function registerModuleMocker(interceptor: (accessor: string) => ModuleMockerInterceptor): ModuleMockerCompilerHints;
declare function registerNativeFactoryResolver(mocker: ModuleMocker): void;
export { registerModuleMocker, registerNativeFactoryResolver };
@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Never = Never;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[Json]` Creates a Never type */
function Never(options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Never', not: {} }, options);
}
@@ -0,0 +1,10 @@
"use client";
import {
listbox_section_default
} from "./chunk-L637PYVS.mjs";
import "./chunk-V45NB7OG.mjs";
import "./chunk-65JTUBIW.mjs";
import "./chunk-IXUWKP6S.mjs";
export {
listbox_section_default as default
};
@@ -0,0 +1 @@
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_en=n()}(this,(function(){"use strict";return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var n=["th","st","nd","rd"],t=e%100;return"["+e+(n[(t-20)%10]||n[t]||n[0])+"]"}}}));
@@ -0,0 +1,33 @@
"use client";
import {
areRectsIntersecting,
canUseDOM,
createDOMRef,
createFocusableRef,
detectBrowser,
detectDeviceType,
detectOS,
detectTouch,
getUserAgentBrowser,
getUserAgentOS,
isBrowser,
useDOMRef,
useFocusableRef,
useSyncRef
} from "./chunk-BDGLNRCW.mjs";
export {
areRectsIntersecting,
canUseDOM,
createDOMRef,
createFocusableRef,
detectBrowser,
detectDeviceType,
detectOS,
detectTouch,
getUserAgentBrowser,
getUserAgentOS,
isBrowser,
useDOMRef,
useFocusableRef,
useSyncRef
};
@@ -0,0 +1,19 @@
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
module.exports = setCacheAdd;
@@ -0,0 +1,113 @@
var $9e5f6a0caf75716e$exports = require("./TableUtils.main.js");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "TableColumnLayout", () => $2240a72410c17d51$export$7ff77a162970b30e);
/*
* 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.
*/
class $2240a72410c17d51$export$7ff77a162970b30e {
/** Takes an array of columns and splits it into 2 maps of columns with controlled and columns with uncontrolled widths. */ splitColumnsIntoControlledAndUncontrolled(columns) {
return columns.reduce((acc, col)=>{
if (col.props.width != null) acc[0].set(col.key, col);
else acc[1].set(col.key, col);
return acc;
}, [
new Map(),
new Map()
]);
}
/** Takes uncontrolled and controlled widths and joins them into a single Map. */ recombineColumns(columns, uncontrolledWidths, uncontrolledColumns, controlledColumns) {
return new Map(columns.map((col)=>{
if (uncontrolledColumns.has(col.key)) return [
col.key,
uncontrolledWidths.get(col.key)
];
else return [
col.key,
controlledColumns.get(col.key).props.width
];
}));
}
/** Used to make an initial Map of the uncontrolled widths based on default widths. */ getInitialUncontrolledWidths(uncontrolledColumns) {
return new Map(Array.from(uncontrolledColumns).map(([key, col])=>{
var _this_getDefaultWidth, _this;
var _col_props_defaultWidth, _ref;
return [
key,
(_ref = (_col_props_defaultWidth = col.props.defaultWidth) !== null && _col_props_defaultWidth !== void 0 ? _col_props_defaultWidth : (_this_getDefaultWidth = (_this = this).getDefaultWidth) === null || _this_getDefaultWidth === void 0 ? void 0 : _this_getDefaultWidth.call(_this, col)) !== null && _ref !== void 0 ? _ref : '1fr'
];
}));
}
getColumnWidth(key) {
var _this_columnWidths_get;
return (_this_columnWidths_get = this.columnWidths.get(key)) !== null && _this_columnWidths_get !== void 0 ? _this_columnWidths_get : 0;
}
getColumnMinWidth(key) {
var _this_columnMinWidths_get;
return (_this_columnMinWidths_get = this.columnMinWidths.get(key)) !== null && _this_columnMinWidths_get !== void 0 ? _this_columnMinWidths_get : 0;
}
getColumnMaxWidth(key) {
var _this_columnMaxWidths_get;
return (_this_columnMaxWidths_get = this.columnMaxWidths.get(key)) !== null && _this_columnMaxWidths_get !== void 0 ? _this_columnMaxWidths_get : 0;
}
resizeColumnWidth(collection, uncontrolledWidths, col, width) {
let prevColumnWidths = this.columnWidths;
let freeze = true;
let newWidths = new Map();
width = Math.max(this.getColumnMinWidth(col), Math.min(this.getColumnMaxWidth(col), Math.floor(width)));
collection.columns.forEach((column)=>{
var _prevColumnWidths_get, _column_props_width;
if (column.key === col) {
newWidths.set(column.key, width);
freeze = false;
} else if (freeze) // freeze columns to the left to their previous pixel value
newWidths.set(column.key, (_prevColumnWidths_get = prevColumnWidths.get(column.key)) !== null && _prevColumnWidths_get !== void 0 ? _prevColumnWidths_get : 0);
else newWidths.set(column.key, (_column_props_width = column.props.width) !== null && _column_props_width !== void 0 ? _column_props_width : uncontrolledWidths.get(column.key));
});
return newWidths;
}
buildColumnWidths(tableWidth, collection, widths) {
this.columnWidths = new Map();
this.columnMinWidths = new Map();
this.columnMaxWidths = new Map();
// initial layout or table/window resizing
let columnWidths = (0, $9e5f6a0caf75716e$exports.calculateColumnSizes)(tableWidth, collection.columns.map((col)=>({
...col.props,
key: col.key
})), widths, (i)=>this.getDefaultWidth(collection.columns[i]), (i)=>this.getDefaultMinWidth(collection.columns[i]));
// columns going in will be the same order as the columns coming out
columnWidths.forEach((width, index)=>{
let key = collection.columns[index].key;
let column = collection.columns[index];
this.columnWidths.set(key, width);
var _column_props_minWidth;
this.columnMinWidths.set(key, (0, $9e5f6a0caf75716e$exports.getMinWidth)((_column_props_minWidth = column.props.minWidth) !== null && _column_props_minWidth !== void 0 ? _column_props_minWidth : this.getDefaultMinWidth(column), tableWidth));
this.columnMaxWidths.set(key, (0, $9e5f6a0caf75716e$exports.getMaxWidth)(column.props.maxWidth, tableWidth));
});
return this.columnWidths;
}
constructor(options){
this.columnWidths = new Map();
this.columnMinWidths = new Map();
this.columnMaxWidths = new Map();
var _options_getDefaultWidth;
this.getDefaultWidth = (_options_getDefaultWidth = options === null || options === void 0 ? void 0 : options.getDefaultWidth) !== null && _options_getDefaultWidth !== void 0 ? _options_getDefaultWidth : ()=>'1fr';
var _options_getDefaultMinWidth;
this.getDefaultMinWidth = (_options_getDefaultMinWidth = options === null || options === void 0 ? void 0 : options.getDefaultMinWidth) !== null && _options_getDefaultMinWidth !== void 0 ? _options_getDefaultMinWidth : ()=>75;
}
}
//# sourceMappingURL=TableColumnLayout.main.js.map
@@ -0,0 +1,75 @@
var async = require('./async.js')
, abort = require('./abort.js')
;
// API
module.exports = iterate;
/**
* Iterates over each job object
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {object} state - current job status
* @param {function} callback - invoked when all elements processed
*/
function iterate(list, iterator, state, callback)
{
// store current index
var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;
state.jobs[key] = runJob(iterator, key, list[key], function(error, output)
{
// don't repeat yourself
// skip secondary callbacks
if (!(key in state.jobs))
{
return;
}
// clean up jobs
delete state.jobs[key];
if (error)
{
// don't process rest of the results
// stop still active jobs
// and reset the list
abort(state);
}
else
{
state.results[key] = output;
}
// return salvaged results
callback(error, state.results);
});
}
/**
* Runs iterator over provided job element
*
* @param {function} iterator - iterator to invoke
* @param {string|number} key - key/index of the element in the list of jobs
* @param {mixed} item - job description
* @param {function} callback - invoked after iterator is done with the job
* @returns {function|mixed} - job abort function or something else
*/
function runJob(iterator, key, item, callback)
{
var aborter;
// allow shortcut if iterator expects only two arguments
if (iterator.length == 2)
{
aborter = iterator(item, async(callback));
}
// otherwise go with full three arguments
else
{
aborter = iterator(item, key, async(callback));
}
return aborter;
}
@@ -0,0 +1,57 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GenIcon = GenIcon;
exports.IconBase = IconBase;
var _react = _interopRequireDefault(require("react"));
var _iconContext = require("./iconContext");
var _excluded = ["attr", "size", "title"];
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
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) >= 0) continue; target[key] = source[key]; } } return target; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function Tree2Element(tree) {
return tree && tree.map((node, i) => /*#__PURE__*/_react.default.createElement(node.tag, _objectSpread({
key: i
}, node.attr), Tree2Element(node.child)));
}
function GenIcon(data) {
return props => /*#__PURE__*/_react.default.createElement(IconBase, _extends({
attr: _objectSpread({}, data.attr)
}, props), Tree2Element(data.child));
}
function IconBase(props) {
var elem = conf => {
var {
attr,
size,
title
} = props,
svgProps = _objectWithoutProperties(props, _excluded);
var computedSize = size || conf.size || "1em";
var className;
if (conf.className) className = conf.className;
if (props.className) className = (className ? className + " " : "") + props.className;
return /*#__PURE__*/_react.default.createElement("svg", _extends({
stroke: "currentColor",
fill: "currentColor",
strokeWidth: "0"
}, conf.attr, attr, svgProps, {
className: className,
style: _objectSpread(_objectSpread({
color: props.color || conf.color
}, conf.style), props.style),
height: computedSize,
width: computedSize,
xmlns: "http://www.w3.org/2000/svg"
}), title && /*#__PURE__*/_react.default.createElement("title", null, title), props.children);
};
return _iconContext.IconContext !== undefined ? /*#__PURE__*/_react.default.createElement(_iconContext.IconContext.Consumer, null, conf => elem(conf)) : elem(_iconContext.DefaultContext);
}
@@ -0,0 +1 @@
{"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../../src/utils/sleep.ts"],"names":[],"mappings":"yBAAgB,IAAI,MAAM;AAA1B,wBACoD"}
@@ -0,0 +1,23 @@
import units from "./units.mjs";
const { DATE, DAY, HOUR, MILLISECOND, MINUTE, MONTH, SECOND, TIME, YEAR } = units;
const compatUnits = {};
function mapUnit(key, ...args) {
for (let i = 0; i < arguments.length; i++) {
compatUnits[arguments[i]] = key;
}
}
mapUnit(YEAR, "Y", "y", "years");
mapUnit(MONTH, "M", "months");
mapUnit(DATE, "D", "dates");
mapUnit(DAY, "d", "days");
mapUnit(HOUR, "h", "hours");
mapUnit(MINUTE, "m", "minutes");
mapUnit(SECOND, "s", "seconds");
mapUnit(MILLISECOND, "ms", "milliseconds");
mapUnit(TIME, "t");
function normalizeUnit(u) {
return compatUnits[u];
}
export {
normalizeUnit as n
};
@@ -0,0 +1,114 @@
import { createRule, getValue } from '../utils/index.js';
export default createRule({
name: 'prefer-default-export',
meta: {
type: 'suggestion',
docs: {
category: 'Style guide',
description: 'Prefer a default export if module exports a single name or multiple names.',
},
schema: [
{
type: 'object',
properties: {
target: {
type: 'string',
enum: ['single', 'any'],
default: 'single',
},
},
additionalProperties: false,
},
],
messages: {
single: 'Prefer default export on a file with single export.',
any: 'Prefer default export to be present on every file that has export.',
},
},
defaultOptions: [],
create(context) {
let specifierExportCount = 0;
let hasDefaultExport = false;
let hasStarExport = false;
let hasTypeExport = false;
let namedExportNode;
const { target = 'single' } = context.options[0] || {};
function captureDeclaration(identifierOrPattern) {
if (identifierOrPattern?.type === 'ObjectPattern') {
for (const property of identifierOrPattern.properties) {
captureDeclaration(property.value);
}
}
else if (identifierOrPattern?.type === 'ArrayPattern') {
for (const el of identifierOrPattern.elements) {
captureDeclaration(el);
}
}
else {
specifierExportCount++;
}
}
return {
ExportDefaultSpecifier() {
hasDefaultExport = true;
},
ExportSpecifier(node) {
if (getValue(node.exported) === 'default') {
hasDefaultExport = true;
}
else {
specifierExportCount++;
namedExportNode = node;
}
},
ExportNamedDeclaration(node) {
if (!node.declaration) {
return;
}
const { type } = node.declaration;
if (type === 'TSTypeAliasDeclaration' ||
type === 'TSInterfaceDeclaration' ||
type === 'TypeAlias' ||
type === 'InterfaceDeclaration') {
specifierExportCount++;
hasTypeExport = true;
return;
}
if ('declarations' in node.declaration &&
node.declaration.declarations) {
for (const declaration of node.declaration.declarations) {
captureDeclaration(declaration.id);
}
}
else {
specifierExportCount++;
}
namedExportNode = node;
},
ExportDefaultDeclaration() {
hasDefaultExport = true;
},
ExportAllDeclaration() {
hasStarExport = true;
},
'Program:exit'() {
if (hasDefaultExport || hasStarExport || hasTypeExport) {
return;
}
if (target === 'single' && specifierExportCount === 1) {
context.report({
node: namedExportNode,
messageId: 'single',
});
}
else if (target === 'any' && specifierExportCount > 0) {
context.report({
node: namedExportNode,
messageId: 'any',
});
}
},
};
},
});
//# sourceMappingURL=prefer-default-export.js.map
@@ -0,0 +1,397 @@
'use strict';
var fs = require('node:fs');
var module$1 = require('node:module');
var path = require('node:path');
var isNodeCoreModule = require('@nolyfill/is-core-module');
var debug = require('debug');
var getTsconfig = require('get-tsconfig');
var isBunModule = require('is-bun-module');
var stableHash = require('stable-hash');
var tinyglobby = require('tinyglobby');
var unrsResolver = require('unrs-resolver');
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
const IMPORTER_NAME = "eslint-import-resolver-typescript";
const log = debug(IMPORTER_NAME);
const defaultConditionNames = [
"types",
"import",
// APF: https://angular.io/guide/angular-package-format
"esm2020",
"es2020",
"es2015",
"require",
"node",
"node-addons",
"browser",
"default"
];
const defaultExtensions = [
".ts",
".tsx",
".d.ts",
".js",
".jsx",
".json",
".node"
];
const defaultExtensionAlias = {
".js": [
".ts",
// `.tsx` can also be compiled as `.js`
".tsx",
".d.ts",
".js"
],
".jsx": [".tsx", ".d.ts", ".jsx"],
".cjs": [".cts", ".d.cts", ".cjs"],
".mjs": [".mts", ".d.mts", ".mjs"]
};
const defaultMainFields = [
"types",
"typings",
// APF: https://angular.io/guide/angular-package-format
"fesm2020",
"fesm2015",
"esm2020",
"es2020",
"module",
"jsnext:main",
"main"
];
const interfaceVersion = 2;
const JS_EXT_PATTERN = /\.(?:[cm]js|jsx?)$/;
const RELATIVE_PATH_PATTERN = /^\.{1,2}(?:\/.*)?$/;
let previousOptionsHash;
let optionsHash;
let cachedOptions;
let cachedCwd;
let mappersCachedOptions;
let mappers = [];
let resolverCachedOptions;
let cachedResolver;
function resolve(source, file, options, resolver) {
var _a, _b, _c, _d;
if (!cachedOptions || previousOptionsHash !== (optionsHash = stableHash.stableHash(options))) {
previousOptionsHash = optionsHash;
cachedOptions = __spreadProps(__spreadValues({}, options), {
conditionNames: (_a = options == null ? void 0 : options.conditionNames) != null ? _a : defaultConditionNames,
extensions: (_b = options == null ? void 0 : options.extensions) != null ? _b : defaultExtensions,
extensionAlias: (_c = options == null ? void 0 : options.extensionAlias) != null ? _c : defaultExtensionAlias,
mainFields: (_d = options == null ? void 0 : options.mainFields) != null ? _d : defaultMainFields
});
}
if (!resolver) {
if (!cachedResolver || resolverCachedOptions !== cachedOptions) {
cachedResolver = new unrsResolver.ResolverFactory(cachedOptions);
resolverCachedOptions = cachedOptions;
}
resolver = cachedResolver;
}
log("looking for", source, "in", file);
source = removeQuerystring(source);
if (isNodeCoreModule(source) || isBunModule.isBunModule(source)) {
log("matched core:", source);
return {
found: true,
path: null
};
}
if (process.versions.pnp && source === "pnpapi") {
return {
found: true,
path: module$1.findPnpApi(file).resolveToUnqualified(source, file, {
considerBuiltins: false
})
};
}
initMappers(cachedOptions);
let mappedPaths = getMappedPaths(source, file, cachedOptions.extensions, true);
if (mappedPaths.length > 0) {
log("matched ts path:", ...mappedPaths);
} else {
mappedPaths = [source];
}
let foundNodePath;
for (const mappedPath of mappedPaths) {
try {
const resolved = resolver.sync(
path.dirname(path.resolve(file)),
mappedPath
);
if (resolved.path) {
foundNodePath = resolved.path;
break;
}
} catch (e) {
log("failed to resolve with", mappedPath);
}
}
if ((JS_EXT_PATTERN.test(foundNodePath) || cachedOptions.alwaysTryTypes && !foundNodePath) && !/^@types[/\\]/.test(source) && !path.isAbsolute(source) && !source.startsWith(".")) {
const definitelyTyped = resolve(
"@types" + path.sep + mangleScopedPackage(source),
file,
options
);
if (definitelyTyped.found) {
return definitelyTyped;
}
}
if (foundNodePath) {
log("matched node path:", foundNodePath);
return {
found: true,
path: foundNodePath
};
}
log("didn't find ", source);
return {
found: false
};
}
function createTypeScriptImportResolver(options) {
var _a, _b, _c, _d;
const resolver = new unrsResolver.ResolverFactory(__spreadProps(__spreadValues({}, options), {
conditionNames: (_a = options == null ? void 0 : options.conditionNames) != null ? _a : defaultConditionNames,
extensions: (_b = options == null ? void 0 : options.extensions) != null ? _b : defaultExtensions,
extensionAlias: (_c = options == null ? void 0 : options.extensionAlias) != null ? _c : defaultExtensionAlias,
mainFields: (_d = options == null ? void 0 : options.mainFields) != null ? _d : defaultMainFields
}));
return {
interfaceVersion: 3,
name: IMPORTER_NAME,
resolve(source, file) {
return resolve(source, file, options, resolver);
}
};
}
function removeQuerystring(id) {
const querystringIndex = id.lastIndexOf("?");
if (querystringIndex !== -1) {
return id.slice(0, querystringIndex);
}
return id;
}
const isFile = (path2) => {
var _a;
try {
return !!(path2 && ((_a = fs.statSync(path2, { throwIfNoEntry: false })) == null ? void 0 : _a.isFile()));
} catch (e) {
return false;
}
};
const isModule = (modulePath) => !!modulePath && isFile(path.resolve(modulePath, "package.json"));
function getMappedPaths(source, file, extensions = defaultExtensions, retry) {
const originalExtensions = extensions;
extensions = ["", ...extensions];
let paths = [];
if (RELATIVE_PATH_PATTERN.test(source)) {
const resolved = path.resolve(path.dirname(file), source);
if (isFile(resolved)) {
paths = [resolved];
}
} else {
let mapperFns = mappers.filter(({ files }) => files.has(file)).map(({ mapperFn }) => mapperFn);
if (mapperFns.length === 0) {
mapperFns = mappers.map((mapper) => ({
mapperFn: mapper.mapperFn,
counter: equalChars(path.dirname(file), path.dirname(mapper.path))
})).sort(
(a, b) => (
// Sort in descending order where the nearest one has the longest counter
b.counter - a.counter
)
).map(({ mapperFn }) => mapperFn);
}
paths = mapperFns.map(
(mapperFn) => mapperFn(source).map((item) => [
...extensions.map((ext) => `${item}${ext}`),
...originalExtensions.map((ext) => `${item}/index${ext}`)
])
).flat(
/* The depth is always 2 */
2
).map(toNativePathSeparator).filter((mappedPath) => {
try {
const stat = fs.statSync(mappedPath, { throwIfNoEntry: false });
if (stat === void 0) {
return false;
}
if (stat.isFile()) {
return true;
}
if (stat.isDirectory()) {
return isModule(mappedPath);
}
} catch (e) {
return false;
}
return false;
});
}
if (retry && paths.length === 0) {
const isJs = JS_EXT_PATTERN.test(source);
if (isJs) {
const jsExt = path.extname(source);
const tsExt = jsExt.replace("js", "ts");
const basename = source.replace(JS_EXT_PATTERN, "");
let resolved = getMappedPaths(basename + tsExt, file);
if (resolved.length === 0 && jsExt === ".js") {
const tsxExt = jsExt.replace("js", "tsx");
resolved = getMappedPaths(basename + tsxExt, file);
}
if (resolved.length === 0) {
resolved = getMappedPaths(
basename + ".d" + (tsExt === ".tsx" ? ".ts" : tsExt),
file
);
}
if (resolved.length > 0) {
return resolved;
}
}
for (const ext of extensions) {
const mappedPaths = isJs ? [] : getMappedPaths(source + ext, file);
const resolved = mappedPaths.length > 0 ? mappedPaths : getMappedPaths(source + `/index${ext}`, file);
if (resolved.length > 0) {
return resolved;
}
}
}
return paths;
}
function initMappers(options) {
if (mappers.length > 0 && mappersCachedOptions === options && cachedCwd === process.cwd()) {
return;
}
cachedCwd = process.cwd();
const configPaths = (typeof options.project === "string" ? [options.project] : (
// eslint-disable-next-line sonarjs/no-nested-conditional
Array.isArray(options.project) ? options.project : [cachedCwd]
)).map((config) => replacePathSeparator(config, path.sep, path.posix.sep));
const defaultInclude = ["**/*"];
const defaultIgnore = ["**/node_modules/**"];
const projectPaths = [
.../* @__PURE__ */ new Set([
...configPaths.filter((p) => !tinyglobby.isDynamicPattern(p)).map((p) => path.resolve(process.cwd(), p)),
...tinyglobby.globSync(
configPaths.filter((path2) => tinyglobby.isDynamicPattern(path2)),
{
absolute: true,
dot: true,
expandDirectories: false,
ignore: defaultIgnore
}
)
])
];
mappers = projectPaths.map((projectPath) => {
var _a, _b;
let tsconfigResult;
if (isFile(projectPath)) {
const { dir, base } = path.parse(projectPath);
tsconfigResult = getTsconfig.getTsconfig(dir, base);
} else {
tsconfigResult = getTsconfig.getTsconfig(projectPath);
}
if (!tsconfigResult) {
return;
}
const mapperFn = getTsconfig.createPathsMatcher(tsconfigResult);
if (!mapperFn) {
return;
}
const files = tsconfigResult.config.files == null && tsconfigResult.config.include == null ? (
// Include everything if no files or include options
tinyglobby.globSync(defaultInclude, {
absolute: true,
cwd: path.dirname(tsconfigResult.path),
dot: true,
ignore: [
...(_a = tsconfigResult.config.exclude) != null ? _a : [],
...defaultIgnore
]
})
) : [
// https://www.typescriptlang.org/tsconfig/#files
...tsconfigResult.config.files != null && tsconfigResult.config.files.length > 0 ? tsconfigResult.config.files.map(
(file) => path.normalize(
path.resolve(path.dirname(tsconfigResult.path), file)
)
) : [],
// https://www.typescriptlang.org/tsconfig/#include
...tsconfigResult.config.include != null && tsconfigResult.config.include.length > 0 ? tinyglobby.globSync(tsconfigResult.config.include, {
absolute: true,
cwd: path.dirname(tsconfigResult.path),
dot: true,
ignore: [
...(_b = tsconfigResult.config.exclude) != null ? _b : [],
...defaultIgnore
]
}) : []
];
return {
path: toNativePathSeparator(tsconfigResult.path),
files: new Set(files.map(toNativePathSeparator)),
mapperFn
};
}).filter(Boolean);
mappersCachedOptions = options;
}
function mangleScopedPackage(moduleName) {
if (moduleName.startsWith("@")) {
const replaceSlash = moduleName.replace(path.sep, "__");
if (replaceSlash !== moduleName) {
return replaceSlash.slice(1);
}
}
return moduleName;
}
function replacePathSeparator(p, from, to) {
return from === to ? p : p.replaceAll(from, to);
}
function toNativePathSeparator(p) {
return replacePathSeparator(
p,
path[process.platform === "win32" ? "posix" : "win32"].sep,
path[process.platform === "win32" ? "win32" : "posix"].sep
);
}
function equalChars(a, b) {
if (a.length === 0 || b.length === 0) {
return 0;
}
let i = 0;
const length = Math.min(a.length, b.length);
while (i < length && a.charAt(i) === b.charAt(i)) {
i += 1;
}
return i;
}
exports.createTypeScriptImportResolver = createTypeScriptImportResolver;
exports.defaultConditionNames = defaultConditionNames;
exports.defaultExtensionAlias = defaultExtensionAlias;
exports.defaultExtensions = defaultExtensions;
exports.defaultMainFields = defaultMainFields;
exports.interfaceVersion = interfaceVersion;
exports.resolve = resolve;
@@ -0,0 +1,87 @@
// Copyright 2013 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Class to model the static dictionary.
#ifndef BROTLI_ENC_STATIC_DICT_H_
#define BROTLI_ENC_STATIC_DICT_H_
#include <algorithm>
#include <unordered_map>
#include <string>
#include "./dictionary.h"
#include "./transform.h"
namespace brotli {
class StaticDictionary {
public:
StaticDictionary() {}
void Fill(bool enable_transforms) {
const int num_transforms = enable_transforms ? kNumTransforms : 1;
for (int t = num_transforms - 1; t >= 0; --t) {
for (int i = kMaxDictionaryWordLength;
i >= kMinDictionaryWordLength; --i) {
const int num_words = 1 << kBrotliDictionarySizeBitsByLength[i];
for (int j = num_words - 1; j >= 0; --j) {
int word_id = t * num_words + j;
std::string word = GetTransformedDictionaryWord(i, word_id);
if (word.size() >= 4) {
Insert(word, i, word_id);
}
}
}
}
}
void Insert(const std::string &str, int len, int dist) {
int ix = (dist << 6) + len;
std::unordered_map<std::string, int>::const_iterator it = map_.find(str);
if (it != map_.end() && ix >= it->second) {
return;
}
map_[str] = ix;
uint32_t v = 0;
for (int i = 0; i < 4 && i < str.size(); ++i) {
v += static_cast<uint32_t>(str[i]) << (8 * i);
}
if (prefix_map_[v] < str.size()) {
prefix_map_[v] = str.size();
}
}
int GetLength(uint32_t v) const {
std::unordered_map<uint32_t, int>::const_iterator it = prefix_map_.find(v);
if (it == prefix_map_.end()) {
return 0;
}
return it->second;
}
bool Get(const std::string &str, int *len, int *dist) const {
std::unordered_map<std::string, int>::const_iterator it = map_.find(str);
if (it == map_.end()) {
return false;
}
int v = it->second;
*len = v & 63;
*dist = v >> 6;
return true;
}
private:
std::unordered_map<std::string, int> map_;
std::unordered_map<uint32_t, int> prefix_map_;
};
} // namespace brotli
#endif // BROTLI_ENC_STATIC_DICT_H_
@@ -0,0 +1,16 @@
var cc =require('../lib/utils')
var INI = require('ini')
var assert = require('assert')
function test(obj) {
var _json, _ini
var json = cc.parse (_json = JSON.stringify(obj))
var ini = cc.parse (_ini = INI.stringify(obj))
console.log(_ini, _json)
assert.deepEqual(json, ini)
}
test({hello: true})
@@ -0,0 +1,49 @@
declare const _default: {
align: {
'': string;
center: string;
right: string;
justify: string;
};
background: string;
blockquote: string;
bold: string;
clean: string;
code: string;
'code-block': string;
color: string;
direction: {
'': string;
rtl: string;
};
formula: string;
header: {
'1': string;
'2': string;
'3': string;
'4': string;
'5': string;
'6': string;
};
italic: string;
image: string;
indent: {
'+1': string;
'-1': string;
};
link: string;
list: {
bullet: string;
check: string;
ordered: string;
};
script: {
sub: string;
super: string;
};
strike: string;
table: string;
underline: string;
video: string;
};
export default _default;
@@ -0,0 +1,154 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const ts_api_utils_1 = require("ts-api-utils");
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'prefer-return-this-type',
meta: {
type: 'suggestion',
docs: {
description: 'Enforce that `this` is used when only `this` type is returned',
recommended: 'strict',
requiresTypeChecking: true,
},
fixable: 'code',
messages: {
useThisType: 'Use `this` type instead.',
},
schema: [],
},
defaultOptions: [],
create(context) {
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
function tryGetNameInType(name, typeNode) {
if (typeNode.type === utils_1.AST_NODE_TYPES.TSTypeReference &&
typeNode.typeName.type === utils_1.AST_NODE_TYPES.Identifier &&
typeNode.typeName.name === name) {
return typeNode;
}
if (typeNode.type === utils_1.AST_NODE_TYPES.TSUnionType) {
for (const type of typeNode.types) {
const found = tryGetNameInType(name, type);
if (found) {
return found;
}
}
}
return undefined;
}
function isThisSpecifiedInParameters(originalFunc) {
const firstArg = originalFunc.params.at(0);
return (firstArg?.type === utils_1.AST_NODE_TYPES.Identifier && firstArg.name === 'this');
}
function isFunctionReturningThis(originalFunc, originalClass) {
if (isThisSpecifiedInParameters(originalFunc)) {
return false;
}
const func = services.esTreeNodeToTSNodeMap.get(originalFunc);
if (!func.body) {
return false;
}
const classType = services.getTypeAtLocation(originalClass);
if (func.body.kind !== ts.SyntaxKind.Block) {
const type = checker.getTypeAtLocation(func.body);
return classType.thisType === type;
}
let hasReturnThis = false;
let hasReturnClassType = false;
(0, util_1.forEachReturnStatement)(func.body, stmt => {
const expr = stmt.expression;
if (!expr) {
return;
}
// fast check
if (expr.kind === ts.SyntaxKind.ThisKeyword) {
hasReturnThis = true;
return;
}
const type = checker.getTypeAtLocation(expr);
if (classType === type) {
hasReturnClassType = true;
return true;
}
if (classType.thisType === type) {
hasReturnThis = true;
return;
}
if ((0, ts_api_utils_1.isUnionType)(type) &&
type.types.some(typePart => typePart === classType)) {
hasReturnClassType = true;
return true;
}
return;
});
return !hasReturnClassType && hasReturnThis;
}
function checkFunction(originalFunc, originalClass) {
const className = originalClass.id?.name;
if (!className || !originalFunc.returnType) {
return;
}
const node = tryGetNameInType(className, originalFunc.returnType.typeAnnotation);
if (!node) {
return;
}
if (isFunctionReturningThis(originalFunc, originalClass)) {
context.report({
node,
messageId: 'useThisType',
fix: fixer => fixer.replaceText(node, 'this'),
});
}
}
function checkProperty(node) {
if (!(node.value?.type === utils_1.AST_NODE_TYPES.FunctionExpression ||
node.value?.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression)) {
return;
}
checkFunction(node.value, node.parent.parent);
}
return {
'ClassBody > AccessorProperty': checkProperty,
'ClassBody > MethodDefinition'(node) {
checkFunction(node.value, node.parent.parent);
},
'ClassBody > PropertyDefinition': checkProperty,
};
},
});
@@ -0,0 +1,77 @@
{
"name": "@humanwhocodes/retry",
"version": "0.4.3",
"description": "A utility to retry failed async methods.",
"type": "module",
"main": "dist/retrier.cjs",
"module": "dist/retrier.js",
"types": "dist/retrier.d.ts",
"exports": {
"require": {
"types": "./dist/retrier.d.cts",
"default": "./dist/retrier.cjs"
},
"import": {
"types": "./dist/retrier.d.ts",
"default": "./dist/retrier.js"
}
},
"files": [
"dist"
],
"engines": {
"node": ">=18.18"
},
"publishConfig": {
"access": "public"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.js": [
"eslint --fix"
]
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/nzakas"
},
"scripts": {
"build:cts-types": "node -e \"fs.copyFileSync('dist/retrier.d.ts', 'dist/retrier.d.cts')\"",
"build": "rollup -c && tsc && npm run build:cts-types",
"prepare": "npm run build",
"lint": "eslint src/ tests/",
"pretest": "npm run build",
"test:unit": "mocha tests/retrier.test.js",
"test:build": "node tests/pkg.test.cjs && node tests/pkg.test.mjs",
"test:jsr": "npx jsr@latest publish --dry-run",
"test:emfile": "node tools/check-emfile-handling.js",
"test": "npm run test:unit && npm run test:build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/humanwhocodes/retry.git"
},
"keywords": [
"nodejs",
"retry",
"async",
"promises"
],
"author": "Nicholas C. Zaks",
"license": "Apache-2.0",
"devDependencies": {
"@eslint/js": "^8.49.0",
"@rollup/plugin-terser": "0.4.4",
"@tsconfig/node16": "^16.1.1",
"@types/mocha": "^10.0.3",
"@types/node": "20.12.6",
"eslint": "^8.21.0",
"lint-staged": "15.2.1",
"mocha": "^10.3.0",
"rollup": "3.29.4",
"typescript": "5.4.4",
"yorkie": "2.0.0"
}
}
@@ -0,0 +1,185 @@
export { A as AutomockedModule, b as AutospiedModule, a as ManualMockedModule, M as MockerRegistry, R as RedirectedModule } from './chunk-registry.js';
function mockObject(options, object, mockExports = {}) {
const finalizers = new Array();
const refs = new RefTracker();
const define = (container, key, value) => {
try {
container[key] = value;
return true;
} catch {
return false;
}
};
const createMock = (currentValue) => {
if (!options.createMockInstance) {
throw new Error("[@vitest/mocker] `createMockInstance` is not defined. This is a Vitest error. Please open a new issue with reproduction.");
}
const createMockInstance = options.createMockInstance;
const prototypeMembers = currentValue.prototype ? collectFunctionProperties(currentValue.prototype) : [];
return createMockInstance({
name: currentValue.name,
prototypeMembers,
originalImplementation: options.type === "autospy" ? currentValue : undefined,
keepMembersImplementation: options.type === "autospy"
});
};
const mockPropertiesOf = (container, newContainer) => {
const containerType = getType(container);
const isModule = containerType === "Module" || !!container.__esModule;
for (const { key: property, descriptor } of getAllMockableProperties(container, isModule, options.globalConstructors)) {
// Modules define their exports as getters. We want to process those.
if (!isModule && descriptor.get) {
try {
if (options.type === "autospy") {
Object.defineProperty(newContainer, property, descriptor);
} else {
Object.defineProperty(newContainer, property, {
configurable: descriptor.configurable,
enumerable: descriptor.enumerable,
get: () => {},
set: descriptor.set ? () => {} : undefined
});
}
} catch {}
continue;
}
// Skip special read-only props, we don't want to mess with those.
if (isReadonlyProp(container[property], property)) {
continue;
}
const value = container[property];
// Special handling of references we've seen before to prevent infinite
// recursion in circular objects.
const refId = refs.getId(value);
if (refId !== undefined) {
finalizers.push(() => define(newContainer, property, refs.getMockedValue(refId)));
continue;
}
const type = getType(value);
if (Array.isArray(value)) {
if (options.type === "automock") {
define(newContainer, property, []);
} else {
const array = value.map((value) => {
if (value && typeof value === "object") {
const newObject = {};
mockPropertiesOf(value, newObject);
return newObject;
}
if (typeof value === "function") {
return createMock(value);
}
return value;
});
define(newContainer, property, array);
}
continue;
}
const isFunction = type.includes("Function") && typeof value === "function";
if ((!isFunction || value._isMockFunction) && type !== "Object" && type !== "Module") {
define(newContainer, property, value);
continue;
}
// Sometimes this assignment fails for some unknown reason. If it does,
// just move along.
if (!define(newContainer, property, isFunction || options.type === "autospy" ? value : {})) {
continue;
}
if (isFunction) {
const mock = createMock(newContainer[property]);
newContainer[property] = mock;
}
refs.track(value, newContainer[property]);
mockPropertiesOf(value, newContainer[property]);
}
};
const mockedObject = mockExports;
mockPropertiesOf(object, mockedObject);
// Plug together refs
for (const finalizer of finalizers) {
finalizer();
}
return mockedObject;
}
class RefTracker {
idMap = new Map();
mockedValueMap = new Map();
getId(value) {
return this.idMap.get(value);
}
getMockedValue(id) {
return this.mockedValueMap.get(id);
}
track(originalValue, mockedValue) {
const newId = this.idMap.size;
this.idMap.set(originalValue, newId);
this.mockedValueMap.set(newId, mockedValue);
return newId;
}
}
function getType(value) {
return Object.prototype.toString.apply(value).slice(8, -1);
}
function isReadonlyProp(object, prop) {
if (prop === "arguments" || prop === "caller" || prop === "callee" || prop === "name" || prop === "length") {
const typeName = getType(object);
return typeName === "Function" || typeName === "AsyncFunction" || typeName === "GeneratorFunction" || typeName === "AsyncGeneratorFunction";
}
if (prop === "source" || prop === "global" || prop === "ignoreCase" || prop === "multiline") {
return getType(object) === "RegExp";
}
return false;
}
function getAllMockableProperties(obj, isModule, constructors) {
const { Map, Object, Function, RegExp, Array } = constructors;
const allProps = new Map();
let curr = obj;
do {
// we don't need properties from these
if (curr === Object.prototype || curr === Function.prototype || curr === RegExp.prototype) {
break;
}
collectOwnProperties(curr, (key) => {
const descriptor = Object.getOwnPropertyDescriptor(curr, key);
if (descriptor) {
allProps.set(key, {
key,
descriptor
});
}
});
} while (curr = Object.getPrototypeOf(curr));
// default is not specified in ownKeys, if module is interoped
if (isModule && !allProps.has("default") && "default" in obj) {
const descriptor = Object.getOwnPropertyDescriptor(obj, "default");
if (descriptor) {
allProps.set("default", {
key: "default",
descriptor
});
}
}
return Array.from(allProps.values());
}
function collectOwnProperties(obj, collector) {
const collect = typeof collector === "function" ? collector : (key) => collector.add(key);
Object.getOwnPropertyNames(obj).forEach(collect);
Object.getOwnPropertySymbols(obj).forEach(collect);
}
function collectFunctionProperties(prototype) {
const properties = new Set();
collectOwnProperties(prototype, (prop) => {
const descriptor = Object.getOwnPropertyDescriptor(prototype, prop);
if (!descriptor || descriptor.get) {
return;
}
const type = getType(descriptor.value);
if (type.includes("Function") && !isReadonlyProp(descriptor.value, prop)) {
properties.add(prop);
}
});
return Array.from(properties);
}
export { mockObject };
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getParsedConfigFileFromTSServer = getParsedConfigFileFromTSServer;
const tsconfig_utils_1 = require("@typescript-eslint/tsconfig-utils");
function getParsedConfigFileFromTSServer(tsserver, defaultProject, throwOnFailure, tsconfigRootDir) {
try {
return (0, tsconfig_utils_1.getParsedConfigFile)(tsserver, defaultProject, tsconfigRootDir);
}
catch (error) {
if (throwOnFailure) {
throw new Error(`Could not read Project Service default project '${defaultProject}': ${error.message}`);
}
}
return undefined;
}
@@ -0,0 +1,16 @@
ISC License
Copyright (c) npm, Inc.
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS
ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,80 @@
"use strict";
exports.__esModule = true;
exports["default"] = void 0;
var _cssesc = _interopRequireDefault(require("cssesc"));
var _util = require("../util");
var _node = _interopRequireDefault(require("./node"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
var Namespace = /*#__PURE__*/function (_Node) {
_inheritsLoose(Namespace, _Node);
function Namespace() {
return _Node.apply(this, arguments) || this;
}
var _proto = Namespace.prototype;
_proto.qualifiedName = function qualifiedName(value) {
if (this.namespace) {
return this.namespaceString + "|" + value;
} else {
return value;
}
};
_proto.valueToString = function valueToString() {
return this.qualifiedName(_Node.prototype.valueToString.call(this));
};
_createClass(Namespace, [{
key: "namespace",
get: function get() {
return this._namespace;
},
set: function set(namespace) {
if (namespace === true || namespace === "*" || namespace === "&") {
this._namespace = namespace;
if (this.raws) {
delete this.raws.namespace;
}
return;
}
var escaped = (0, _cssesc["default"])(namespace, {
isIdentifier: true
});
this._namespace = namespace;
if (escaped !== namespace) {
(0, _util.ensureObject)(this, "raws");
this.raws.namespace = escaped;
} else if (this.raws) {
delete this.raws.namespace;
}
}
}, {
key: "ns",
get: function get() {
return this._namespace;
},
set: function set(namespace) {
this.namespace = namespace;
}
}, {
key: "namespaceString",
get: function get() {
if (this.namespace) {
var ns = this.stringifyProperty("namespace");
if (ns === true) {
return '';
} else {
return ns;
}
} else {
return '';
}
}
}]);
return Namespace;
}(_node["default"]);
exports["default"] = Namespace;
;
module.exports = exports.default;
@@ -0,0 +1,24 @@
/**
* Encode special characters in `value`.
*
* @param {string} value
* Value to encode.
* @param {Options} [options]
* Configuration.
* @returns {string}
* Encoded value.
*/
export function stringifyEntities(value: string, options?: Options | undefined): string;
/**
* Encode special characters in `value` as hexadecimals.
*
* @param {string} value
* Value to encode.
* @param {LightOptions} [options]
* Configuration.
* @returns {string}
* Encoded value.
*/
export function stringifyEntitiesLight(value: string, options?: import("./core.js").CoreOptions | undefined): string;
export type Options = import('./core.js').CoreOptions & import('./util/format-smart.js').FormatSmartOptions;
export type LightOptions = import('./core.js').CoreOptions;
@@ -0,0 +1,72 @@
/* eslint-disable node/no-deprecated-api */
var toString = Object.prototype.toString
var isModern = (
typeof Buffer !== 'undefined' &&
typeof Buffer.alloc === 'function' &&
typeof Buffer.allocUnsafe === 'function' &&
typeof Buffer.from === 'function'
)
function isArrayBuffer (input) {
return toString.call(input).slice(8, -1) === 'ArrayBuffer'
}
function fromArrayBuffer (obj, byteOffset, length) {
byteOffset >>>= 0
var maxLength = obj.byteLength - byteOffset
if (maxLength < 0) {
throw new RangeError("'offset' is out of bounds")
}
if (length === undefined) {
length = maxLength
} else {
length >>>= 0
if (length > maxLength) {
throw new RangeError("'length' is out of bounds")
}
}
return isModern
? Buffer.from(obj.slice(byteOffset, byteOffset + length))
: new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)))
}
function fromString (string, encoding) {
if (typeof encoding !== 'string' || encoding === '') {
encoding = 'utf8'
}
if (!Buffer.isEncoding(encoding)) {
throw new TypeError('"encoding" must be a valid string encoding')
}
return isModern
? Buffer.from(string, encoding)
: new Buffer(string, encoding)
}
function bufferFrom (value, encodingOrOffset, length) {
if (typeof value === 'number') {
throw new TypeError('"value" argument must not be a number')
}
if (isArrayBuffer(value)) {
return fromArrayBuffer(value, encodingOrOffset, length)
}
if (typeof value === 'string') {
return fromString(value, encodingOrOffset)
}
return isModern
? Buffer.from(value)
: new Buffer(value)
}
module.exports = bufferFrom
@@ -0,0 +1,276 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.defaults }}
{{# def.coerce }}
{{ /**
* schema compilation (render) time:
* it = { schema, RULES, _validate, opts }
* it.validate - this template function,
* it is used recursively to generate code for subschemas
*
* runtime:
* "validate" is a variable name to which this function will be assigned
* validateRef etc. are defined in the parent scope in index.js
*/ }}
{{
var $async = it.schema.$async === true
, $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref')
, $id = it.self._getId(it.schema);
}}
{{
if (it.opts.strictKeywords) {
var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords);
if ($unknownKwd) {
var $keywordsMsg = 'unknown keyword: ' + $unknownKwd;
if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg);
else throw new Error($keywordsMsg);
}
}
}}
{{? it.isTop }}
var validate = {{?$async}}{{it.async = true;}}async {{?}}function(data, dataPath, parentData, parentDataProperty, rootData) {
'use strict';
{{? $id && (it.opts.sourceCode || it.opts.processCode) }}
{{= '/\*# sourceURL=' + $id + ' */' }}
{{?}}
{{?}}
{{? typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref) }}
{{ var $keyword = 'false schema'; }}
{{# def.setupKeyword }}
{{? it.schema === false}}
{{? it.isTop}}
{{ $breakOnError = true; }}
{{??}}
var {{=$valid}} = false;
{{?}}
{{# def.error:'false schema' }}
{{??}}
{{? it.isTop}}
{{? $async }}
return data;
{{??}}
validate.errors = null;
return true;
{{?}}
{{??}}
var {{=$valid}} = true;
{{?}}
{{?}}
{{? it.isTop}}
};
return validate;
{{?}}
{{ return out; }}
{{?}}
{{? it.isTop }}
{{
var $top = it.isTop
, $lvl = it.level = 0
, $dataLvl = it.dataLevel = 0
, $data = 'data';
it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema));
it.baseId = it.baseId || it.rootId;
delete it.isTop;
it.dataPathArr = [""];
if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) {
var $defaultMsg = 'default is ignored in the schema root';
if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);
else throw new Error($defaultMsg);
}
}}
var vErrors = null; {{ /* don't edit, used in replace */ }}
var errors = 0; {{ /* don't edit, used in replace */ }}
if (rootData === undefined) rootData = data; {{ /* don't edit, used in replace */ }}
{{??}}
{{
var $lvl = it.level
, $dataLvl = it.dataLevel
, $data = 'data' + ($dataLvl || '');
if ($id) it.baseId = it.resolve.url(it.baseId, $id);
if ($async && !it.async) throw new Error('async schema in sync schema');
}}
var errs_{{=$lvl}} = errors;
{{?}}
{{
var $valid = 'valid' + $lvl
, $breakOnError = !it.opts.allErrors
, $closingBraces1 = ''
, $closingBraces2 = '';
var $errorKeyword;
var $typeSchema = it.schema.type
, $typeIsArray = Array.isArray($typeSchema);
if ($typeSchema && it.opts.nullable && it.schema.nullable === true) {
if ($typeIsArray) {
if ($typeSchema.indexOf('null') == -1)
$typeSchema = $typeSchema.concat('null');
} else if ($typeSchema != 'null') {
$typeSchema = [$typeSchema, 'null'];
$typeIsArray = true;
}
}
if ($typeIsArray && $typeSchema.length == 1) {
$typeSchema = $typeSchema[0];
$typeIsArray = false;
}
}}
{{## def.checkType:
{{
var $schemaPath = it.schemaPath + '.type'
, $errSchemaPath = it.errSchemaPath + '/type'
, $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType';
}}
if ({{= it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true) }}) {
#}}
{{? it.schema.$ref && $refKeywords }}
{{? it.opts.extendRefs == 'fail' }}
{{ throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); }}
{{?? it.opts.extendRefs !== true }}
{{
$refKeywords = false;
it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"');
}}
{{?}}
{{?}}
{{? it.schema.$comment && it.opts.$comment }}
{{= it.RULES.all.$comment.code(it, '$comment') }}
{{?}}
{{? $typeSchema }}
{{? it.opts.coerceTypes }}
{{ var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); }}
{{?}}
{{ var $rulesGroup = it.RULES.types[$typeSchema]; }}
{{? $coerceToTypes || $typeIsArray || $rulesGroup === true ||
($rulesGroup && !$shouldUseGroup($rulesGroup)) }}
{{
var $schemaPath = it.schemaPath + '.type'
, $errSchemaPath = it.errSchemaPath + '/type';
}}
{{# def.checkType }}
{{? $coerceToTypes }}
{{# def.coerceType }}
{{??}}
{{# def.error:'type' }}
{{?}}
}
{{?}}
{{?}}
{{? it.schema.$ref && !$refKeywords }}
{{= it.RULES.all.$ref.code(it, '$ref') }}
{{? $breakOnError }}
}
if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) {
{{ $closingBraces2 += '}'; }}
{{?}}
{{??}}
{{~ it.RULES:$rulesGroup }}
{{? $shouldUseGroup($rulesGroup) }}
{{? $rulesGroup.type }}
if ({{= it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers) }}) {
{{?}}
{{? it.opts.useDefaults }}
{{? $rulesGroup.type == 'object' && it.schema.properties }}
{{# def.defaultProperties }}
{{?? $rulesGroup.type == 'array' && Array.isArray(it.schema.items) }}
{{# def.defaultItems }}
{{?}}
{{?}}
{{~ $rulesGroup.rules:$rule }}
{{? $shouldUseRule($rule) }}
{{ var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); }}
{{? $code }}
{{= $code }}
{{? $breakOnError }}
{{ $closingBraces1 += '}'; }}
{{?}}
{{?}}
{{?}}
{{~}}
{{? $breakOnError }}
{{= $closingBraces1 }}
{{ $closingBraces1 = ''; }}
{{?}}
{{? $rulesGroup.type }}
}
{{? $typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes }}
else {
{{
var $schemaPath = it.schemaPath + '.type'
, $errSchemaPath = it.errSchemaPath + '/type';
}}
{{# def.error:'type' }}
}
{{?}}
{{?}}
{{? $breakOnError }}
if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) {
{{ $closingBraces2 += '}'; }}
{{?}}
{{?}}
{{~}}
{{?}}
{{? $breakOnError }} {{= $closingBraces2 }} {{?}}
{{? $top }}
{{? $async }}
if (errors === 0) return data; {{ /* don't edit, used in replace */ }}
else throw new ValidationError(vErrors); {{ /* don't edit, used in replace */ }}
{{??}}
validate.errors = vErrors; {{ /* don't edit, used in replace */ }}
return errors === 0; {{ /* don't edit, used in replace */ }}
{{?}}
};
return validate;
{{??}}
var {{=$valid}} = errors === errs_{{=$lvl}};
{{?}}
{{
function $shouldUseGroup($rulesGroup) {
var rules = $rulesGroup.rules;
for (var i=0; i < rules.length; i++)
if ($shouldUseRule(rules[i]))
return true;
}
function $shouldUseRule($rule) {
return it.schema[$rule.keyword] !== undefined ||
($rule.implements && $ruleImplementsSomeKeyword($rule));
}
function $ruleImplementsSomeKeyword($rule) {
var impl = $rule.implements;
for (var i=0; i < impl.length; i++)
if (it.schema[impl[i]] !== undefined)
return true;
}
}}
@@ -0,0 +1,8 @@
"use client";
import {
usePopover
} from "./chunk-L4NZQNWQ.mjs";
import "./chunk-C6TMY7KY.mjs";
export {
usePopover
};
@@ -0,0 +1,24 @@
export {};
// These interfaces are absent from lib.webworker, so the conditionals use `onabort` rather than `onmessage`
type _Storage = typeof globalThis extends { onabort: any } ? {} : Storage;
interface Storage {
readonly length: number;
clear(): void;
getItem(key: string): string | null;
key(index: number): string | null;
removeItem(key: string): void;
setItem(key: string, value: string): void;
[key: string]: any;
}
declare global {
interface Storage extends _Storage {}
var Storage: typeof globalThis extends { onabort: any; Storage: infer T } ? T : {
prototype: Storage;
new(): Storage;
};
var localStorage: Storage;
var sessionStorage: Storage;
}
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,oBAAoB,CAAC,4DAAsD,CAAC;AAChG","sources":["packages/@react-aria/menu/intl/nb-NO.json"],"sourcesContent":["{\n \"longPressMessage\": \"Langt trykk eller trykk Alt + PilNed for å åpne menyen\"\n}\n"],"names":[],"version":3,"file":"nb-NO.module.js.map"}
@@ -0,0 +1 @@
!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(a="undefined"!=typeof globalThis?globalThis:a||self).dayjs_locale_az=e(a.dayjs)}(this,(function(a){"use strict";function e(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var _=e(a),t={name:"az",weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},ordinal:function(a){return a}};return _.default.locale(t,null,!0),t}));
@@ -0,0 +1,23 @@
'use strict';
var CodePointAt = require('./CodePointAt');
var $TypeError = require('es-errors/type');
// https://262.ecma-international.org/14.0/#sec-isstringwellformedunicode
module.exports = function IsStringWellFormedUnicode(string) {
if (typeof string !== 'string') {
throw new $TypeError('Assertion failed: `string` must be a String');
}
var len = string.length; // step 1
var k = 0; // step 2
while (k < len) { // step 3
var cp = CodePointAt(string, k); // step 3.a
if (cp['[[IsUnpairedSurrogate]]']) {
return false; // step 3.b
}
k += cp['[[CodeUnitCount]]']; // step 3.c
}
return true; // step 4
};
@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decorate = decorate;
function decorate(decorators, target, parameterIndexOrProperty, parameterIndex) {
const parsedDecorators = Array.isArray(decorators)
? decorators
: [decorators];
if (parameterIndexOrProperty === undefined) {
// Asume ClassDecorator[]
Reflect.decorate(parsedDecorators, target);
return;
}
if (typeof parameterIndexOrProperty === 'number') {
// Asume ParameterDecorator[]
for (const decorator of parsedDecorators) {
decorator(target, undefined, parameterIndexOrProperty);
}
return;
}
if (parameterIndex === undefined) {
Reflect.decorate(parsedDecorators, target.prototype, parameterIndexOrProperty);
return;
}
for (const decorator of parsedDecorators) {
decorator(target, parameterIndexOrProperty, parameterIndex);
}
}
//# sourceMappingURL=decorate.js.map
@@ -0,0 +1,37 @@
import {
callAll,
callAllHandlers,
capitalize,
debounce,
extractProperty,
get,
getInertValue,
getUniqueID,
intersectionBy,
isReact19,
kebabCase,
mapKeys,
objectToDeps,
omit,
removeEvents,
uniqBy
} from "./chunk-RFEIBVIG.mjs";
import "./chunk-UYSIEMEK.mjs";
export {
callAll,
callAllHandlers,
capitalize,
debounce,
extractProperty,
get,
getInertValue,
getUniqueID,
intersectionBy,
isReact19,
kebabCase,
mapKeys,
objectToDeps,
omit,
removeEvents,
uniqBy
};
@@ -0,0 +1,2 @@
export declare function getReflectMetadata<TMetadata>(target: object, metadataKey: unknown, propertyKey?: string | symbol): TMetadata | undefined;
//# sourceMappingURL=getReflectMetadata.d.ts.map
@@ -0,0 +1,87 @@
/**
* @fileoverview This file contains the types for the use-at-your-own-risk
* entrypoint. It was initially extracted from the `@types/eslint` package.
*/
/*
* MIT License
* Copyright (c) Microsoft Corporation.
*
* 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
*/
import { ESLint, Rule } from "./index.js";
/** @deprecated */
export const builtinRules: Map<string, Rule.RuleModule>;
/** @deprecated */
export class FileEnumerator {
constructor(params?: {
cwd?: string;
configArrayFactory?: any;
extensions?: any;
globInputPaths?: boolean;
errorOnUnmatchedPattern?: boolean;
ignore?: boolean;
});
isTargetPath(filePath: string, providedConfig?: any): boolean;
iterateFiles(
patternOrPatterns: string | string[],
): IterableIterator<{ config: any; filePath: string; ignored: boolean }>;
}
export { /** @deprecated */ ESLint as FlatESLint };
/** @deprecated */
export class LegacyESLint {
static configType: "eslintrc";
static readonly version: string;
static outputFixes(results: ESLint.LintResult[]): Promise<void>;
static getErrorResults(results: ESLint.LintResult[]): ESLint.LintResult[];
constructor(options?: ESLint.LegacyOptions);
lintFiles(patterns: string | string[]): Promise<ESLint.LintResult[]>;
lintText(
code: string,
options?: {
filePath?: string | undefined;
warnIgnored?: boolean | undefined;
},
): Promise<ESLint.LintResult[]>;
getRulesMetaForResults(
results: ESLint.LintResult[],
): ESLint.LintResultData["rulesMeta"];
hasFlag(flag: string): false;
calculateConfigForFile(filePath: string): Promise<any>;
isPathIgnored(filePath: string): Promise<boolean>;
loadFormatter(nameOrPath?: string): Promise<ESLint.Formatter>;
}
/** @deprecated */
export function shouldUseFlatConfig(): Promise<boolean>;
@@ -0,0 +1 @@
{"version":3,"file":"sourcemap-codec.d.ts","sourceRoot":"","sources":["../src/sourcemap-codec.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEhG,MAAM,MAAM,gBAAgB,GACxB,CAAC,MAAM,CAAC,GACR,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAChC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAC/C,MAAM,MAAM,iBAAiB,GAAG,aAAa,EAAE,CAAC;AAEhD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAiD1D;AAUD,wBAAgB,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC;AAC3D,wBAAgB,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC"}
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 Colin McDonnell
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 @@
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_buddhistEra=e()}(this,(function(){"use strict";return function(t,e){var n=e.prototype,i=n.format;n.format=function(t){var e=this,n=(t||"YYYY-MM-DDTHH:mm:ssZ").replace(/(\[[^\]]+])|BBBB|BB/g,(function(t,n){var i,o=String(e.$y+543),f="BB"===t?[o.slice(-2),2]:[o,4];return n||(i=e.$utils()).s.apply(i,f.concat(["0"]))}));return i.bind(this)(n)}}}));
@@ -0,0 +1 @@
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ar_ma=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"ar-ma",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekStart:6,weekdaysShort:"احد_إثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(e){return e>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return t.default.locale(d,null,!0),d}));
@@ -0,0 +1,155 @@
# to-absolute-glob [![NPM version](https://img.shields.io/npm/v/to-absolute-glob.svg?style=flat)](https://www.npmjs.com/package/to-absolute-glob) [![NPM downloads](https://img.shields.io/npm/dm/to-absolute-glob.svg?style=flat)](https://npmjs.org/package/to-absolute-glob) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/to-absolute-glob.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/to-absolute-glob) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/to-absolute-glob.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/to-absolute-glob)
> Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save to-absolute-glob
```
## Usage
```js
var toAbsGlob = require('to-absolute-glob');
toAbsGlob('a/*.js');
//=> '/dev/foo/a/*.js'
```
## Examples
Given the current project folder (cwd) is `/dev/foo/`:
**makes a path absolute**
```js
toAbsGlob('a');
//=> '/dev/foo/a'
```
**makes a glob absolute**
```js
toAbsGlob('a/*.js');
//=> '/dev/foo/a/*.js'
```
**retains trailing slashes**
```js
toAbsGlob('a/*/');
//=> '/dev/foo/a/*/'
```
**retains trailing slashes with cwd**
```js
toAbsGlob('./fixtures/whatsgoingon/*/', {cwd: __dirname});
//=> '/dev/foo/'
```
**makes a negative glob absolute**
```js
toAbsGlob('!a/*.js');
//=> '!/dev/foo/a/*.js'
```
**from a cwd**
```js
toAbsGlob('a/*.js', {cwd: 'foo'});
//=> '/dev/foo/foo/a/*.js'
```
**makes a negative glob absolute from a cwd**
```js
toAbsGlob('!a/*.js', {cwd: 'foo'});
//=> '!/dev/foo/foo/a/*.js'
```
**from a root path**
```js
toAbsGlob('/a/*.js', {root: 'baz'});
//=> '/dev/foo/baz/a/*.js'
```
**from a root slash**
```js
toAbsGlob('/a/*.js', {root: '/'});
//=> '/dev/foo/a/*.js'
```
**from a negative root path**
```js
toAbsGlob('!/a/*.js', {root: 'baz'});
//=> '!/dev/foo/baz/a/*.js'
```
**from a negative root slash**
```js
toAbsGlob('!/a/*.js', {root: '/'});
//=> '!/dev/foo/a/*.js'
```
## About
### Related projects
* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.")
* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet")
* [is-valid-glob](https://www.npmjs.com/package/is-valid-glob): Return true if a value is a valid glob pattern or patterns. | [homepage](https://github.com/jonschlinkert/is-valid-glob "Return true if a value is a valid glob pattern or patterns.")
### Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
### Contributors
| **Commits** | **Contributor**<br/> |
| --- | --- |
| 16 | [doowb](https://github.com/doowb) |
| 15 | [jonschlinkert](https://github.com/jonschlinkert) |
| 1 | [phated](https://github.com/phated) |
| 1 | [erikkemperman](https://github.com/erikkemperman) |
### Building docs
_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
To generate the readme and API documentation with [verb](https://github.com/verbose/verb):
```sh
$ npm install -g verb verb-generate-readme && verb
```
### Running tests
Install dev dependencies:
```sh
$ npm install -d && npm test
```
### Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
### License
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT license](https://github.com/jonschlinkert/to-absolute-glob/blob/master/LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 17, 2016._
@@ -0,0 +1 @@
{"version":3,"file":"WritableStream.js","sourceRoot":"","sources":["../../src/WritableStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoC,MAAM,aAAa,CAAC;AACvE;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,2GAA2G;AAC3G,SAAS,QAAQ,CAAC,MAAuB,EAAE,QAAgB;IACvD,OAAO,QAAQ,KAAK,QAAQ,CAAC;AACjC,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,QAAQ;IAIxC,YAAY,GAAqB,EAAE,OAAuB;QACtD,KAAK,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;QAHnB,aAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QAI5C,IAAI,CAAC,OAAO,GAAG,IAAI,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAEQ,MAAM,CACX,KAAsB,EACtB,QAAgB,EAChB,QAAoB;QAEpB,IAAI,CAAC,OAAO,CAAC,KAAK,CACd,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CACjE,CAAC;QACF,QAAQ,EAAE,CAAC;IACf,CAAC;IAEQ,MAAM,CAAC,QAAoB;QAChC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;QACtC,QAAQ,EAAE,CAAC;IACf,CAAC;CACJ"}
@@ -0,0 +1,236 @@
## 0.7.0
### 🐞 Bug fixes
* Handle split surrogate pairs when encoding utf8 - by [@yosion-p](https://github.com/yosion-p) and [@ashtuchkin](https://github.com/ashtuchkin) in [#282](https://github.com/ashtuchkin/iconv-lite/pull/282):
Handle a case where streaming utf8 encoder (converting js strings -> buffers) encounters
surrogate pairs split between chunks (last character of one chunk is high surrogate and first
character of the next chunk is a low surrogate).
* Avoid false positives in encodingExists by using objects without a prototype - by [@bjohansebas](https://github.com/bjohansebas) in [#328](https://github.com/ashtuchkin/iconv-lite/pull/328)
The encodingExists method could return incorrect results if the lookup matched properties inherited
from the prototype of the object that stores the encodings, such as constructor and others. This change
replaces that object with one that has no prototype, ensuring that only explicitly defined valid encodings
in the library are considered. In addition, the fix is applied to the internal cache system to avoid the same
kind of false positives
### 🚀 Improvements
* Make explicit that decode() method supports Uint8Array input - by [@jardicc](https://github.com/jardicc) in [#271](https://github.com/ashtuchkin/iconv-lite/pull/271)
* Remove compatibility check for StringDecoder.end method - by [@bjohansebas](https://github.com/bjohansebas) in [#331](https://github.com/ashtuchkin/iconv-lite/pull/331)
## 0.6.3 / 2021-05-23
* Fix HKSCS encoding to prefer Big5 codes if both Big5 and HKSCS codes are possible (#264)
## 0.6.2 / 2020-07-08
* Support Uint8Array-s decoding without conversion to Buffers, plus fix an edge case.
## 0.6.1 / 2020-06-28
* Support Uint8Array-s directly when decoding (#246, by @gyzerok)
* Unify package.json version ranges to be strictly semver-compatible (#241)
* Fix minor issue in UTF-32 decoder's endianness detection code.
## 0.6.0 / 2020-06-08
* Updated 'gb18030' encoding to :2005 edition (see https://github.com/whatwg/encoding/issues/22).
* Removed `iconv.extendNodeEncodings()` mechanism. It was deprecated 5 years ago and didn't work
in recent Node versions.
* Reworked Streaming API behavior in browser environments to fix #204. Streaming API will be
excluded by default in browser packs, saving ~100Kb bundle size, unless enabled explicitly using
`iconv.enableStreamingAPI(require('stream'))`.
* Updates to development environment & tests:
* Added ./test/webpack private package to test complex new use cases that need custom environment.
It's tested as a separate job in Travis CI.
* Updated generation code for the new EUC-KR index file format from Encoding Standard.
* Removed Buffer() constructor in tests (#197 by @gabrielschulhof).
## 0.5.2 / 2020-06-08
* Added `iconv.getEncoder()` and `iconv.getDecoder()` methods to typescript definitions (#229).
* Fixed semver version to 6.1.2 to support Node 8.x (by @tanandara).
* Capped iconv version to 2.x as 3.x has dropped support for older Node versions.
* Switched from instanbul to c8 for code coverage.
## 0.5.1 / 2020-01-18
* Added cp720 encoding (#221, by @kr-deps)
* (minor) Changed Changelog.md formatting to use h2.
## 0.5.0 / 2019-06-26
* Added UTF-32 encoding, both little-endian and big-endian variants (UTF-32LE, UTF32-BE). If endianness
is not provided for decoding, it's deduced automatically from the stream using a heuristic similar to
what we use in UTF-16. (great work in #216 by @kshetline)
* Several minor updates to README (#217 by @oldj, plus some more)
* Added Node versions 10 and 12 to Travis test harness.
## 0.4.24 / 2018-08-22
* Added MIK encoding (#196, by @Ivan-Kalatchev)
## 0.4.23 / 2018-05-07
* Fix deprecation warning in Node v10 due to the last usage of `new Buffer` (#185, by @felixbuenemann)
* Switched from NodeBuffer to Buffer in typings (#155 by @felixfbecker, #186 by @larssn)
## 0.4.22 / 2018-05-05
* Use older semver style for dependencies to be compatible with Node version 0.10 (#182, by @dougwilson)
* Fix tests to accomodate fixes in Node v10 (#182, by @dougwilson)
## 0.4.21 / 2018-04-06
* Fix encoding canonicalization (#156)
* Fix the paths in the "browser" field in package.json (#174 by @LMLB)
* Removed "contributors" section in package.json - see Git history instead.
## 0.4.20 / 2018-04-06
* Updated `new Buffer()` usages with recommended replacements as it's being deprecated in Node v10 (#176, #178 by @ChALkeR)
## 0.4.19 / 2017-09-09
* Fixed iso8859-1 codec regression in handling untranslatable characters (#162, caused by #147)
* Re-generated windows1255 codec, because it was updated in iconv project
* Fixed grammar in error message when iconv-lite is loaded with encoding other than utf8
## 0.4.18 / 2017-06-13
* Fixed CESU-8 regression in Node v8.
## 0.4.17 / 2017-04-22
* Updated typescript definition file to support Angular 2 AoT mode (#153 by @larssn)
## 0.4.16 / 2017-04-22
* Added support for React Native (#150)
* Changed iso8859-1 encoding to usine internal 'binary' encoding, as it's the same thing (#147 by @mscdex)
* Fixed typo in Readme (#138 by @jiangzhuo)
* Fixed build for Node v6.10+ by making correct version comparison
* Added a warning if iconv-lite is loaded not as utf-8 (see #142)
## 0.4.15 / 2016-11-21
* Fixed typescript type definition (#137)
## 0.4.14 / 2016-11-20
* Preparation for v1.0
* Added Node v6 and latest Node versions to Travis CI test rig
* Deprecated Node v0.8 support
* Typescript typings (@larssn)
* Fix encoding of Euro character in GB 18030 (inspired by @lygstate)
* Add ms prefix to dbcs windows encodings (@rokoroku)
## 0.4.13 / 2015-10-01
* Fix silly mistake in deprecation notice.
## 0.4.12 / 2015-09-26
* Node v4 support:
* Added CESU-8 decoding (#106)
* Added deprecation notice for `extendNodeEncodings`
* Added Travis tests for Node v4 and io.js latest (#105 by @Mithgol)
## 0.4.11 / 2015-07-03
* Added CESU-8 encoding.
## 0.4.10 / 2015-05-26
* Changed UTF-16 endianness heuristic to take into account any ASCII chars, not
just spaces. This should minimize the importance of "default" endianness.
## 0.4.9 / 2015-05-24
* Streamlined BOM handling: strip BOM by default, add BOM when encoding if
addBOM: true. Added docs to Readme.
* UTF16 now uses UTF16-LE by default.
* Fixed minor issue with big5 encoding.
* Added io.js testing on Travis; updated node-iconv version to test against.
Now we just skip testing SBCS encodings that node-iconv doesn't support.
* (internal refactoring) Updated codec interface to use classes.
* Use strict mode in all files.
## 0.4.8 / 2015-04-14
* added alias UNICODE-1-1-UTF-7 for UTF-7 encoding (#94)
## 0.4.7 / 2015-02-05
* stop official support of Node.js v0.8. Should still work, but no guarantees.
reason: Packages needed for testing are hard to get on Travis CI.
* work in environment where Object.prototype is monkey patched with enumerable
props (#89).
## 0.4.6 / 2015-01-12
* fix rare aliases of single-byte encodings (thanks @mscdex)
* double the timeout for dbcs tests to make them less flaky on travis
## 0.4.5 / 2014-11-20
* fix windows-31j and x-sjis encoding support (@nleush)
* minor fix: undefined variable reference when internal error happens
## 0.4.4 / 2014-07-16
* added encodings UTF-7 (RFC2152) and UTF-7-IMAP (RFC3501 Section 5.1.3)
* fixed streaming base64 encoding
## 0.4.3 / 2014-06-14
* added encodings UTF-16BE and UTF-16 with BOM
## 0.4.2 / 2014-06-12
* don't throw exception if `extendNodeEncodings()` is called more than once
## 0.4.1 / 2014-06-11
* codepage 808 added
## 0.4.0 / 2014-06-10
* code is rewritten from scratch
* all widespread encodings are supported
* streaming interface added
* browserify compatibility added
* (optional) extend core primitive encodings to make usage even simpler
* moved from vows to mocha as the testing framework
@@ -0,0 +1,62 @@
# import/no-deprecated
<!-- end auto-generated rule header -->
Reports use of a deprecated name, as indicated by a JSDoc block with a `@deprecated`
tag or TomDoc `Deprecated:` comment.
using a JSDoc `@deprecated` tag:
```js
// @file: ./answer.js
/**
* this is what you get when you trust a mouse talk show
* @deprecated need to restart the experiment
* @returns {Number} nonsense
*/
export function multiply(six, nine) {
return 42
}
```
will report as such:
```js
import { multiply } from './answer' // Deprecated: need to restart the experiment
function whatever(y, z) {
return multiply(y, z) // Deprecated: need to restart the experiment
}
```
or using the TomDoc equivalent:
```js
// Deprecated: This is what you get when you trust a mouse talk show, need to
// restart the experiment.
//
// Returns a Number nonsense
export function multiply(six, nine) {
return 42
}
```
Only JSDoc is enabled by default. Other documentation styles can be enabled with
the `import/docstyle` setting.
```yaml
# .eslintrc.yml
settings:
import/docstyle: ['jsdoc', 'tomdoc']
```
## Worklist
- [x] report explicit imports on the import node
- [x] support namespaces
- [x] should bubble up through deep namespaces (#157)
- [x] report explicit imports at reference time (at the identifier) similar to namespace
- [x] mark module deprecated if file JSDoc has a @deprecated tag?
- [ ] don't flag redeclaration of imported, deprecated names
- [ ] flag destructuring
@@ -0,0 +1,64 @@
'use strict';
const path = require('path');
const win32 = process.platform === 'win32';
const {
REGEX_BACKSLASH,
REGEX_REMOVE_BACKSLASH,
REGEX_SPECIAL_CHARS,
REGEX_SPECIAL_CHARS_GLOBAL
} = require('./constants');
exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
exports.removeBackslashes = str => {
return str.replace(REGEX_REMOVE_BACKSLASH, match => {
return match === '\\' ? '' : match;
});
};
exports.supportsLookbehinds = () => {
const segs = process.version.slice(1).split('.').map(Number);
if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) {
return true;
}
return false;
};
exports.isWindows = options => {
if (options && typeof options.windows === 'boolean') {
return options.windows;
}
return win32 === true || path.sep === '\\';
};
exports.escapeLast = (input, char, lastIdx) => {
const idx = input.lastIndexOf(char, lastIdx);
if (idx === -1) return input;
if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
};
exports.removePrefix = (input, state = {}) => {
let output = input;
if (output.startsWith('./')) {
output = output.slice(2);
state.prefix = './';
}
return output;
};
exports.wrapOutput = (input, state = {}, options = {}) => {
const prepend = options.contains ? '' : '^';
const append = options.contains ? '' : '$';
let output = `${prepend}(?:${input})${append}`;
if (state.negated === true) {
output = `(?:^(?!${output}).*$)`;
}
return output;
};
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const isLength = require("./isLength.js");
function isArrayLike(value) {
return value != null && isLength.isLength(value.length) && typeof value !== "function";
}
exports.isArrayLike = isArrayLike;
@@ -0,0 +1,290 @@
import { ModuleNamespace, ViteHotContext } from '../../types/hot.js';
import { Update, HotPayload } from '../../types/hmrPayload.js';
import { InferCustomEventPayload } from '../../types/customEvent.js';
import { N as NormalizedModuleRunnerTransport, E as ExternalFetchResult, V as ViteFetchResult, M as ModuleRunnerTransport, F as FetchFunctionOptions, a as FetchResult } from './moduleRunnerTransport.d-DJ_mE5sf.js';
export { b as ModuleRunnerTransportHandlers, c as createWebSocketModuleRunnerTransport } from './moduleRunnerTransport.d-DJ_mE5sf.js';
interface SourceMapLike {
version: number;
mappings?: string;
names?: string[];
sources?: string[];
sourcesContent?: string[];
}
declare class DecodedMap {
map: SourceMapLike;
_encoded: string;
_decoded: undefined | number[][][];
_decodedMemo: Stats;
url: string;
version: number;
names: string[];
resolvedSources: string[];
constructor(map: SourceMapLike, from: string);
}
interface Stats {
lastKey: number;
lastNeedle: number;
lastIndex: number;
}
type CustomListenersMap = Map<string, ((data: any) => void)[]>;
interface HotModule {
id: string;
callbacks: HotCallback[];
}
interface HotCallback {
deps: string[];
fn: (modules: Array<ModuleNamespace | undefined>) => void;
}
interface HMRLogger {
error(msg: string | Error): void;
debug(...msg: unknown[]): void;
}
declare class HMRClient {
logger: HMRLogger;
private transport;
private importUpdatedModule;
hotModulesMap: Map<string, HotModule>;
disposeMap: Map<string, (data: any) => void | Promise<void>>;
pruneMap: Map<string, (data: any) => void | Promise<void>>;
dataMap: Map<string, any>;
customListenersMap: CustomListenersMap;
ctxToListenersMap: Map<string, CustomListenersMap>;
currentFirstInvalidatedBy: string | undefined;
constructor(logger: HMRLogger, transport: NormalizedModuleRunnerTransport, importUpdatedModule: (update: Update) => Promise<ModuleNamespace>);
notifyListeners<T extends string>(event: T, data: InferCustomEventPayload<T>): Promise<void>;
send(payload: HotPayload): void;
clear(): void;
prunePaths(paths: string[]): Promise<void>;
protected warnFailedUpdate(err: Error, path: string | string[]): void;
private updateQueue;
private pendingUpdateQueue;
/**
* buffer multiple hot updates triggered by the same src change
* so that they are invoked in the same order they were sent.
* (otherwise the order may be inconsistent because of the http request round trip)
*/
queueUpdate(payload: Update): Promise<void>;
private fetchUpdate;
}
interface DefineImportMetadata {
/**
* Imported names before being transformed to `ssrImportKey`
*
* import foo, { bar as baz, qux } from 'hello'
* => ['default', 'bar', 'qux']
*
* import * as namespace from 'world
* => undefined
*/
importedNames?: string[];
}
interface SSRImportMetadata extends DefineImportMetadata {
isDynamicImport?: boolean;
}
declare const ssrModuleExportsKey = "__vite_ssr_exports__";
declare const ssrImportKey = "__vite_ssr_import__";
declare const ssrDynamicImportKey = "__vite_ssr_dynamic_import__";
declare const ssrExportAllKey = "__vite_ssr_exportAll__";
declare const ssrImportMetaKey = "__vite_ssr_import_meta__";
interface ModuleRunnerDebugger {
(formatter: unknown, ...args: unknown[]): void;
}
declare class ModuleRunner {
options: ModuleRunnerOptions;
evaluator: ModuleEvaluator;
private debug?;
evaluatedModules: EvaluatedModules;
hmrClient?: HMRClient;
private readonly envProxy;
private readonly transport;
private readonly resetSourceMapSupport?;
private readonly concurrentModuleNodePromises;
private closed;
constructor(options: ModuleRunnerOptions, evaluator?: ModuleEvaluator, debug?: ModuleRunnerDebugger | undefined);
/**
* URL to execute. Accepts file path, server path or id relative to the root.
*/
import<T = any>(url: string): Promise<T>;
/**
* Clear all caches including HMR listeners.
*/
clearCache(): void;
/**
* Clears all caches, removes all HMR listeners, and resets source map support.
* This method doesn't stop the HMR connection.
*/
close(): Promise<void>;
/**
* Returns `true` if the runtime has been closed by calling `close()` method.
*/
isClosed(): boolean;
private processImport;
private isCircularModule;
private isCircularImport;
private cachedRequest;
private cachedModule;
private getModuleInformation;
protected directRequest(url: string, mod: EvaluatedModuleNode, _callstack: string[]): Promise<any>;
}
interface RetrieveFileHandler {
(path: string): string | null | undefined | false;
}
interface RetrieveSourceMapHandler {
(path: string): null | {
url: string;
map: any;
};
}
interface InterceptorOptions {
retrieveFile?: RetrieveFileHandler;
retrieveSourceMap?: RetrieveSourceMapHandler;
}
interface ModuleRunnerImportMeta extends ImportMeta {
url: string;
env: ImportMetaEnv;
hot?: ViteHotContext;
[key: string]: any;
}
interface ModuleRunnerContext {
[ssrModuleExportsKey]: Record<string, any>;
[ssrImportKey]: (id: string, metadata?: DefineImportMetadata) => Promise<any>;
[ssrDynamicImportKey]: (id: string, options?: ImportCallOptions) => Promise<any>;
[ssrExportAllKey]: (obj: any) => void;
[ssrImportMetaKey]: ModuleRunnerImportMeta;
}
interface ModuleEvaluator {
/**
* Number of prefixed lines in the transformed code.
*/
startOffset?: number;
/**
* Run code that was transformed by Vite.
* @param context Function context
* @param code Transformed code
* @param module The module node
*/
runInlinedModule(context: ModuleRunnerContext, code: string, module: Readonly<EvaluatedModuleNode>): Promise<any>;
/**
* Run externalized module.
* @param file File URL to the external module
*/
runExternalModule(file: string): Promise<any>;
}
type ResolvedResult = (ExternalFetchResult | ViteFetchResult) & {
url: string;
id: string;
};
type FetchFunction = (id: string, importer?: string, options?: FetchFunctionOptions) => Promise<FetchResult>;
interface ModuleRunnerHmr {
/**
* Configure HMR logger.
*/
logger?: false | HMRLogger;
}
interface ModuleRunnerOptions {
/**
* Root of the project
* @deprecated not used and to be removed
*/
root?: string;
/**
* A set of methods to communicate with the server.
*/
transport: ModuleRunnerTransport;
/**
* Configure how source maps are resolved. Prefers `node` if `process.setSourceMapsEnabled` is available.
* Otherwise it will use `prepareStackTrace` by default which overrides `Error.prepareStackTrace` method.
* You can provide an object to configure how file contents and source maps are resolved for files that were not processed by Vite.
*/
sourcemapInterceptor?: false | 'node' | 'prepareStackTrace' | InterceptorOptions;
/**
* Disable HMR or configure HMR options.
*
* @default true
*/
hmr?: boolean | ModuleRunnerHmr;
/**
* Custom module cache. If not provided, creates a separate module cache for each ModuleRunner instance.
*/
evaluatedModules?: EvaluatedModules;
}
interface ImportMetaEnv {
[key: string]: any;
BASE_URL: string;
MODE: string;
DEV: boolean;
PROD: boolean;
SSR: boolean;
}
declare class EvaluatedModuleNode {
id: string;
url: string;
importers: Set<string>;
imports: Set<string>;
evaluated: boolean;
meta: ResolvedResult | undefined;
promise: Promise<any> | undefined;
exports: any | undefined;
file: string;
map: DecodedMap | undefined;
constructor(id: string, url: string);
}
declare class EvaluatedModules {
readonly idToModuleMap: Map<string, EvaluatedModuleNode>;
readonly fileToModulesMap: Map<string, Set<EvaluatedModuleNode>>;
readonly urlToIdModuleMap: Map<string, EvaluatedModuleNode>;
/**
* Returns the module node by the resolved module ID. Usually, module ID is
* the file system path with query and/or hash. It can also be a virtual module.
*
* Module runner graph will have 1 to 1 mapping with the server module graph.
* @param id Resolved module ID
*/
getModuleById(id: string): EvaluatedModuleNode | undefined;
/**
* Returns all modules related to the file system path. Different modules
* might have different query parameters or hash, so it's possible to have
* multiple modules for the same file.
* @param file The file system path of the module
*/
getModulesByFile(file: string): Set<EvaluatedModuleNode> | undefined;
/**
* Returns the module node by the URL that was used in the import statement.
* Unlike module graph on the server, the URL is not resolved and is used as is.
* @param url Server URL that was used in the import statement
*/
getModuleByUrl(url: string): EvaluatedModuleNode | undefined;
/**
* Ensure that module is in the graph. If the module is already in the graph,
* it will return the existing module node. Otherwise, it will create a new
* module node and add it to the graph.
* @param id Resolved module ID
* @param url URL that was used in the import statement
*/
ensureModule(id: string, url: string): EvaluatedModuleNode;
invalidateModule(node: EvaluatedModuleNode): void;
/**
* Extracts the inlined source map from the module code and returns the decoded
* source map. If the source map is not inlined, it will return null.
* @param id Resolved module ID
*/
getModuleSourceMapById(id: string): DecodedMap | null;
clear(): void;
}
declare class ESModulesEvaluator implements ModuleEvaluator {
readonly startOffset: number;
runInlinedModule(context: ModuleRunnerContext, code: string): Promise<any>;
runExternalModule(filepath: string): Promise<any>;
}
export { ESModulesEvaluator, EvaluatedModuleNode, EvaluatedModules, FetchFunctionOptions, FetchResult, ModuleRunner, ModuleRunnerTransport, ssrDynamicImportKey, ssrExportAllKey, ssrImportKey, ssrImportMetaKey, ssrModuleExportsKey };
export type { FetchFunction, HMRLogger, InterceptorOptions, ModuleEvaluator, ModuleRunnerContext, ModuleRunnerHmr, ModuleRunnerImportMeta, ModuleRunnerOptions, ResolvedResult, SSRImportMetadata };
@@ -0,0 +1,90 @@
'use strict';
var MissingRefError = require('./error_classes').MissingRef;
module.exports = compileAsync;
/**
* Creates validating function for passed schema with asynchronous loading of missing schemas.
* `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema.
* @this Ajv
* @param {Object} schema schema object
* @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped
* @param {Function} callback an optional node-style callback, it is called with 2 parameters: error (or null) and validating function.
* @return {Promise} promise that resolves with a validating function.
*/
function compileAsync(schema, meta, callback) {
/* eslint no-shadow: 0 */
/* global Promise */
/* jshint validthis: true */
var self = this;
if (typeof this._opts.loadSchema != 'function')
throw new Error('options.loadSchema should be a function');
if (typeof meta == 'function') {
callback = meta;
meta = undefined;
}
var p = loadMetaSchemaOf(schema).then(function () {
var schemaObj = self._addSchema(schema, undefined, meta);
return schemaObj.validate || _compileAsync(schemaObj);
});
if (callback) {
p.then(
function(v) { callback(null, v); },
callback
);
}
return p;
function loadMetaSchemaOf(sch) {
var $schema = sch.$schema;
return $schema && !self.getSchema($schema)
? compileAsync.call(self, { $ref: $schema }, true)
: Promise.resolve();
}
function _compileAsync(schemaObj) {
try { return self._compile(schemaObj); }
catch(e) {
if (e instanceof MissingRefError) return loadMissingSchema(e);
throw e;
}
function loadMissingSchema(e) {
var ref = e.missingSchema;
if (added(ref)) throw new Error('Schema ' + ref + ' is loaded but ' + e.missingRef + ' cannot be resolved');
var schemaPromise = self._loadingSchemas[ref];
if (!schemaPromise) {
schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref);
schemaPromise.then(removePromise, removePromise);
}
return schemaPromise.then(function (sch) {
if (!added(ref)) {
return loadMetaSchemaOf(sch).then(function () {
if (!added(ref)) self.addSchema(sch, ref, undefined, meta);
});
}
}).then(function() {
return _compileAsync(schemaObj);
});
function removePromise() {
delete self._loadingSchemas[ref];
}
function added(ref) {
return self._refs[ref] || self._schemas[ref];
}
}
}
}
@@ -0,0 +1,270 @@
# style-to-js
[![NPM](https://nodei.co/npm/style-to-js.png)](https://nodei.co/npm/style-to-js/)
[![NPM version](https://badgen.net/npm/v/style-to-js)](https://www.npmjs.com/package/style-to-js)
[![Bundlephobia minified + gzip](https://badgen.net/bundlephobia/minzip/style-to-js)](https://bundlephobia.com/package/style-to-js)
[![build](https://github.com/remarkablemark/style-to-js/actions/workflows/build.yml/badge.svg)](https://github.com/remarkablemark/style-to-js/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/remarkablemark/style-to-js/branch/master/graph/badge.svg?token=JWKUKTFT3E)](https://codecov.io/gh/remarkablemark/style-to-js)
[![NPM downloads](https://badgen.net/npm/dm/style-to-js)](https://www.npmjs.com/package/style-to-js)
Parses CSS inline style to JavaScript object (camelCased):
```
StyleToJS(string)
```
## Example
```js
import parse from 'style-to-js';
parse('background-color: #BADA55;');
```
Output:
```json
{ "backgroundColor": "#BADA55" }
```
[Replit](https://replit.com/@remarkablemark/style-to-js) | [JSFiddle](https://jsfiddle.net/remarkablemark/04nob1y7/) | [Examples](https://github.com/remarkablemark/style-to-js/tree/master/examples)
## Install
[NPM](https://www.npmjs.com/package/style-to-js):
```sh
npm install style-to-js --save
```
[Yarn](https://yarnpkg.com/package/style-to-js):
```sh
yarn add style-to-js
```
[CDN](https://unpkg.com/style-to-js/):
```html
<script src="https://unpkg.com/style-to-js@latest/umd/style-to-js.min.js"></script>
<script>
window.StyleToJS(/* string */);
</script>
```
## Usage
### Import
Import with ES Modules:
```js
import parse from 'style-to-js';
```
Require with CommonJS:
```js
const parse = require('style-to-js');
```
### Parse style
Parse single declaration:
```js
parse('line-height: 42');
```
Output:
```json
{ "lineHeight": "42" }
```
> Notice that the CSS property is camelCased.
Parse multiple declarations:
```js
parse(`
border-color: #ACE;
z-index: 1337;
`);
```
Output:
```json
{
"borderColor": "#ACE",
"zIndex": "1337"
}
```
### Vendor prefix
Parse [vendor prefix](https://developer.mozilla.org/en-US/docs/Glossary/Vendor_Prefix):
```js
parse(`
-webkit-transition: all 4s ease;
-moz-transition: all 4s ease;
-ms-transition: all 4s ease;
-o-transition: all 4s ease;
-khtml-transition: all 4s ease;
`);
```
Output:
```json
{
"webkitTransition": "all 4s ease",
"mozTransition": "all 4s ease",
"msTransition": "all 4s ease",
"oTransition": "all 4s ease",
"khtmlTransition": "all 4s ease"
}
```
### Custom property
Parse [custom property](https://developer.mozilla.org/en-US/docs/Web/CSS/--*):
```js
parse('--custom-property: #f00');
```
Output:
```json
{ "--custom-property": "#f00" }
```
### Unknown declaration
This library does not validate declarations, so unknown declarations can be parsed:
```js
parse('the-answer: 42;');
```
Output:
```json
{ "theAnswer": "42" }
```
### Invalid declaration
Declarations with missing value are removed:
```js
parse(`
margin-top: ;
margin-right: 1em;
`);
```
Output:
```json
{ "marginRight": "1em" }
```
Other invalid declarations or arguments:
```js
parse(); // {}
parse(null); // {}
parse(1); // {}
parse(true); // {}
parse('top:'); // {}
parse(':12px'); // {}
parse(':'); // {}
parse(';'); // {}
```
The following values will throw an error:
```js
parse('top'); // Uncaught Error: property missing ':'
parse('/*'); // Uncaught Error: End of comment missing
```
### Options
#### reactCompat
When option `reactCompat` is true, the [vendor prefix](https://developer.mozilla.org/en-US/docs/Glossary/Vendor_Prefix) will be capitalized:
```js
parse(
`
-webkit-transition: all 4s ease;
-moz-transition: all 4s ease;
-ms-transition: all 4s ease;
-o-transition: all 4s ease;
-khtml-transition: all 4s ease;
`,
{ reactCompat: true },
);
```
Output:
```json
{
"WebkitTransition": "all 4s ease",
"MozTransition": "all 4s ease",
"msTransition": "all 4s ease",
"OTransition": "all 4s ease",
"KhtmlTransition": "all 4s ease"
}
```
This removes the React warning:
```
Warning: Unsupported vendor-prefixed style property %s. Did you mean %s?%s", "oTransition", "OTransition"
```
## Testing
Run tests with coverage:
```sh
npm test
```
Run tests in watch mode:
```sh
npm run test:watch
```
Lint files:
```sh
npm run lint
```
Fix lint errors:
```sh
npm run lint:fix
```
## Release
Release and publish are automated by [Release Please](https://github.com/googleapis/release-please).
## Special Thanks
- [style-to-object](https://github.com/remarkablemark/style-to-object)
## License
[MIT](https://github.com/remarkablemark/style-to-js/blob/master/LICENSE)
@@ -0,0 +1,14 @@
var Pt=Object.defineProperty;var f=(s,e)=>Pt(s,"name",{value:e,configurable:!0});import{fileURLToPath as Jt,pathToFileURL as Gt}from"node:url";import{version as Ae,transformSync as qt,transform as zt}from"esbuild";import Ht from"node:crypto";import U from"node:fs";import X from"node:path";import Xt from"node:os";import{t as Kt}from"./temporary-directory-CwHp0_NW.mjs";const Ne=f(s=>Ht.createHash("sha1").update(s).digest("hex"),"sha1"),Ie=44,Yt=59,Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$e=new Uint8Array(64),Ue=new Uint8Array(128);for(let s=0;s<Me.length;s++){const e=Me.charCodeAt(s);$e[s]=e,Ue[e]=s}const me=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(s){return Buffer.from(s.buffer,s.byteOffset,s.byteLength).toString()}}:{decode(s){let e="";for(let n=0;n<s.length;n++)e+=String.fromCharCode(s[n]);return e}};function Qt(s){const e=new Int32Array(5),n=[];let i=0;do{const o=Zt(s,i),c=[];let u=!0,p=0;e[0]=0;for(let g=i;g<o;g++){let b;g=K(s,g,e,0);const d=e[0];d<p&&(u=!1),p=d,je(s,g,o)?(g=K(s,g,e,1),g=K(s,g,e,2),g=K(s,g,e,3),je(s,g,o)?(g=K(s,g,e,4),b=[d,e[1],e[2],e[3],e[4]]):b=[d,e[1],e[2],e[3]]):b=[d],c.push(b)}u||Vt(c),n.push(c),i=o+1}while(i<=s.length);return n}f(Qt,"decode");function Zt(s,e){const n=s.indexOf(";",e);return n===-1?s.length:n}f(Zt,"indexOf");function K(s,e,n,i){let o=0,c=0,u=0;do{const g=s.charCodeAt(e++);u=Ue[g],o|=(u&31)<<c,c+=5}while(u&32);const p=o&1;return o>>>=1,p&&(o=-2147483648|-o),n[i]+=o,e}f(K,"decodeInteger");function je(s,e,n){return e>=n?!1:s.charCodeAt(e)!==Ie}f(je,"hasMoreVlq");function Vt(s){s.sort(en)}f(Vt,"sort");function en(s,e){return s[0]-e[0]}f(en,"sortComparator$1");function De(s){const e=new Int32Array(5),n=1024*16,i=n-36,o=new Uint8Array(n),c=o.subarray(0,i);let u=0,p="";for(let g=0;g<s.length;g++){const b=s[g];if(g>0&&(u===n&&(p+=me.decode(o),u=0),o[u++]=Yt),b.length!==0){e[0]=0;for(let d=0;d<b.length;d++){const r=b[d];u>i&&(p+=me.decode(c),o.copyWithin(0,i,u),u-=i),d>0&&(o[u++]=Ie),u=Y(o,u,e,r,0),r.length!==1&&(u=Y(o,u,e,r,1),u=Y(o,u,e,r,2),u=Y(o,u,e,r,3),r.length!==4&&(u=Y(o,u,e,r,4)))}}}return p+me.decode(o.subarray(0,u))}f(De,"encode");function Y(s,e,n,i,o){const c=i[o];let u=c-n[o];n[o]=c,u=u<0?-u<<1|1:u<<1;do{let p=u&31;u>>>=5,u>0&&(p|=32),s[e++]=$e[p]}while(u>0);return e}f(Y,"encodeInteger");class ae{static{f(this,"BitSet")}constructor(e){this.bits=e instanceof ae?e.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(e&31)}has(e){return!!(this.bits[e>>5]&1<<(e&31))}}class ee{static{f(this,"Chunk")}constructor(e,n,i){this.start=e,this.end=n,this.original=i,this.intro="",this.outro="",this.content=i,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(e){this.outro+=e}appendRight(e){this.intro=this.intro+e}clone(){const e=new ee(this.start,this.end,this.original);return e.intro=this.intro,e.outro=this.outro,e.content=this.content,e.storeName=this.storeName,e.edited=this.edited,e}contains(e){return this.start<e&&e<this.end}eachNext(e){let n=this;for(;n;)e(n),n=n.next}eachPrevious(e){let n=this;for(;n;)e(n),n=n.previous}edit(e,n,i){return this.content=e,i||(this.intro="",this.outro=""),this.storeName=n,this.edited=!0,this}prependLeft(e){this.outro=e+this.outro}prependRight(e){this.intro=e+this.intro}reset(){this.intro="",this.outro="",this.edited&&(this.content=this.original,this.storeName=!1,this.edited=!1)}split(e){const n=e-this.start,i=this.original.slice(0,n),o=this.original.slice(n);this.original=i;const c=new ee(e,this.end,o);return c.outro=this.outro,this.outro="",this.end=e,this.edited?(c.edit("",!1),this.content=""):this.content=i,c.next=this.next,c.next&&(c.next.previous=c),c.previous=this,this.next=c,c}toString(){return this.intro+this.content+this.outro}trimEnd(e){if(this.outro=this.outro.replace(e,""),this.outro.length)return!0;const n=this.content.replace(e,"");if(n.length)return n!==this.content&&(this.split(this.start+n.length).edit("",void 0,!0),this.edited&&this.edit(n,this.storeName,!0)),!0;if(this.edit("",void 0,!0),this.intro=this.intro.replace(e,""),this.intro.length)return!0}trimStart(e){if(this.intro=this.intro.replace(e,""),this.intro.length)return!0;const n=this.content.replace(e,"");if(n.length){if(n!==this.content){const i=this.split(this.end-n.length);this.edited&&i.edit(n,this.storeName,!0),this.edit("",void 0,!0)}return!0}else if(this.edit("",void 0,!0),this.outro=this.outro.replace(e,""),this.outro.length)return!0}}function tn(){return typeof globalThis<"u"&&typeof globalThis.btoa=="function"?s=>globalThis.btoa(unescape(encodeURIComponent(s))):typeof Buffer=="function"?s=>Buffer.from(s,"utf-8").toString("base64"):()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}f(tn,"getBtoa");const nn=tn();let rn=class{static{f(this,"SourceMap")}constructor(e){this.version=3,this.file=e.file,this.sources=e.sources,this.sourcesContent=e.sourcesContent,this.names=e.names,this.mappings=De(e.mappings),typeof e.x_google_ignoreList<"u"&&(thisLine truncated
`),n=e.filter(c=>/^\t+/.test(c)),i=e.filter(c=>/^ {2,}/.test(c));if(n.length===0&&i.length===0)return null;if(n.length>=i.length)return" ";const o=i.reduce((c,u)=>{const p=/^ +/.exec(u)[0].length;return Math.min(p,c)},1/0);return new Array(o+1).join(" ")}f(sn,"guessIndent");function on(s,e){const n=s.split(/[/\\]/),i=e.split(/[/\\]/);for(n.pop();n[0]===i[0];)n.shift(),i.shift();if(n.length){let o=n.length;for(;o--;)n[o]=".."}return n.concat(i).join("/")}f(on,"getRelativePath");const an=Object.prototype.toString;function cn(s){return an.call(s)==="[object Object]"}f(cn,"isObject");function Te(s){const e=s.split(`
`),n=[];for(let i=0,o=0;i<e.length;i++)n.push(o),o+=e[i].length+1;return f(function(o){let c=0,u=n.length;for(;c<u;){const b=c+u>>1;o<n[b]?u=b:c=b+1}const p=c-1,g=o-n[p];return{line:p,column:g}},"locate")}f(Te,"getLocator");const un=/\w/;class ln{static{f(this,"Mappings")}constructor(e){this.hires=e,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null}addEdit(e,n,i,o){if(n.length){const c=n.length-1;let u=n.indexOf(`
`,0),p=-1;for(;u>=0&&c>u;){const b=[this.generatedCodeColumn,e,i.line,i.column];o>=0&&b.push(o),this.rawSegments.push(b),this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,p=u,u=n.indexOf(`
`,u+1)}const g=[this.generatedCodeColumn,e,i.line,i.column];o>=0&&g.push(o),this.rawSegments.push(g),this.advance(n.slice(p+1))}else this.pending&&(this.rawSegments.push(this.pending),this.advance(n));this.pending=null}addUneditedChunk(e,n,i,o,c){let u=n.start,p=!0,g=!1;for(;u<n.end;){if(this.hires||p||c.has(u)){const b=[this.generatedCodeColumn,e,o.line,o.column];this.hires==="boundary"?un.test(i[u])?g||(this.rawSegments.push(b),g=!0):(this.rawSegments.push(b),g=!1):this.rawSegments.push(b)}i[u]===`
`?(o.line+=1,o.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,p=!0):(o.column+=1,this.generatedCodeColumn+=1,p=!1),u+=1}this.pending=null}advance(e){if(!e)return;const n=e.split(`
`);if(n.length>1){for(let i=0;i<n.length-1;i++)this.generatedCodeLine++,this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0}this.generatedCodeColumn+=n[n.length-1].length}}const Q=`
`,J={insertLeft:!1,insertRight:!1,storeName:!1};class _e{static{f(this,"MagicString")}constructor(e,n={}){const i=new ee(0,e.length,e);Object.defineProperties(this,{original:{writable:!0,value:e},outro:{writable:!0,value:""},intro:{writable:!0,value:""},firstChunk:{writable:!0,value:i},lastChunk:{writable:!0,value:i},lastSearchedChunk:{writable:!0,value:i},byStart:{writable:!0,value:{}},byEnd:{writable:!0,value:{}},filename:{writable:!0,value:n.filename},indentExclusionRanges:{writable:!0,value:n.indentExclusionRanges},sourcemapLocations:{writable:!0,value:new ae},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:void 0},ignoreList:{writable:!0,value:n.ignoreList}}),this.byStart[0]=i,this.byEnd[e.length]=i}addSourcemapLocation(e){this.sourcemapLocations.add(e)}append(e){if(typeof e!="string")throw new TypeError("outro content must be a string");return this.outro+=e,this}appendLeft(e,n){if(typeof n!="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byEnd[e];return i?i.appendLeft(n):this.intro+=n,this}appendRight(e,n){if(typeof n!="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byStart[e];return i?i.appendRight(n):this.outro+=n,this}clone(){const e=new _e(this.original,{filename:this.filename});let n=this.firstChunk,i=e.firstChunk=e.lastSearchedChunk=n.clone();for(;n;){e.byStart[i.start]=i,e.byEnd[i.end]=i;const o=n.next,c=o&&o.clone();c&&(i.next=c,c.previous=i,i=c),n=o}return e.lastChunk=i,this.indentExclusionRanges&&(e.indentExclusionRanges=this.indentExclusionRanges.slice()),e.sourcemapLocations=new ae(this.sourcemapLocations),e.intro=this.intro,e.outro=this.outro,e}generateDecodedMap(e){e=e||{};const n=0,i=Object.keys(this.storedNames),o=new ln(e.hires),c=Te(this.original);return this.intro&&o.advance(this.intro),this.firstChunk.eachNext(u=>{const p=c(u.start);u.intro.length&&o.advance(u.intro),u.edited?o.addEdit(n,u.content,p,u.storeName?i.indexOf(u.original):-1):o.addUneditedChunk(n,u,this.original,p,this.sourcemapLocations),u.outro.length&&o.advance(u.outro)}),{file:e.file?e.file.split(/[/\\]/).pop():void 0,sources:[e.source?on(e.file||"",e.source):e.file||""],sourcesContent:e.includeContent?[this.original]:void 0,names:i,mappings:o.raw,x_google_ignoreList:this.ignoreList?[n]:void 0}}generateMap(e){return new rn(this.generateDecodedMap(e))}_ensureindentStr(){this.indentStr===void 0&&(this.indentStr=sn(this.original))}_getRawIndentString(){return this._ensureindentStr(),this.indentStr}getIndentString(){return this._ensureindentStr(),this.indentStr===null?" ":this.indentStr}indent(e,n){const i=/^[^\r\n]/gm;if(cn(e)&&(n=e,e=void 0),e===void 0&&(this._ensureindentStr(),e=this.indentStr||" "),e==="")return this;n=n||{};const o={};n.exclude&&(typeof n.exclude[0]=="number"?[n.exclude]:n.exclude).forEach(d=>{for(let r=d[0];r<d[1];r+=1)o[r]=!0});let c=n.indentStart!==!1;const u=f(b=>c?`${e}${b}`:(c=!0,b),"replacer");this.intro=this.intro.replace(i,u);let p=0,g=this.firstChunk;for(;g;){const b=g.end;if(g.edited)o[p]||(g.content=g.content.replace(i,u),g.content.length&&(c=g.content[g.content.length-1]===`
`));else for(p=g.start;p<b;){if(!o[p]){const d=this.original[p];d===`
`?c=!0:d!=="\r"&&c&&(c=!1,p===g.start||(this._splitChunk(g,p),g=g.next),g.prependRight(e))}p+=1}p=g.end,g=g.next}return this.outro=this.outro.replace(i,u),this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(e,n){return J.insertLeft||(console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"),J.insertLeft=!0),this.appendLeft(e,n)}insertRight(e,n){return J.insertRight||(console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"),J.insertRight=!0),this.prependRight(e,n)}move(e,n,i){if(i>=e&&i<=n)throw new Error("Cannot move a selection inside itself");this._split(e),this._split(n),this._split(i);const o=this.byStart[e],c=this.byEnd[n],u=o.previous,p=c.next,g=this.byStart[i];if(!g&&c===this.lastChunk)return this;const b=g?g.previous:this.lastChunk;return u&&(u.next=p),p&&(p.previous=u),b&&(b.next=o),g&&(g.previous=c),o.previous||(this.firstChunk=c.next),c.next||(this.lastChunk=o.previous,this.lastChunk.next=null),o.previous=b,c.next=g||null,b||(this.firstChunk=o),g||(this.lastChunk=c),this}overwrite(e,n,i,o){return o=o||{},this.update(e,n,i,{...o,overwrite:!o.contentOnly})}update(e,n,i,o){if(typeof i!="string")throw new TypeError("replacement content must be a string");for(;e<0;)e+=this.original.length;for(;n<0;)n+=this.original.length;if(n>this.original.length)throw new Error("end is out of bounds");if(e===n)throw new Error("Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead");this._split(e),this._split(n),o===!0&&(J.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),J.storeName=!0),o={storeName:!0});const c=o!==void 0?o.storeName:!1,u=o!==void 0?o.overwrite:!1;if(c){const b=this.original.slice(e,n);Object.defineProperty(this.storedNames,b,{writable:!0,value:!0,enumerable:!0})}const p=this.byStart[e],g=this.byEnd[n];if(p){let b=p;for(;b!==g;){if(b.next!==this.byStart[b.end])throw new Error("Cannot overwrite across a split point");b=b.next,b.edit("",!1)}p.edit(i,c,!u)}else{const b=new ee(e,n,"").edit(i,c);g.next=b,b.previous=g}return this}prepend(e){if(typeof e!="string")throw new TypeError("outro content must be a string");return this.intro=e+this.intro,this}prependLeft(e,n){if(typeof n!="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byEnd[e];return i?i.prependLeft(n):this.intro=n+this.intro,this}prependRight(e,n){if(typeof n!="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byStart[e];return i?i.prependRight(n):this.outro=n+this.outro,this}remove(e,n){for(;e<0;)e+=this.original.length;for(;n<0;)n+=this.original.length;if(e===n)return this;if(e<0||n>this.original.length)throw new Error("Character is out of bounds");if(e>n)throw new Error("end must be greater than start");this._split(e),this._split(n);let i=this.byStart[e];for(;i;)i.intro="",i.outro="",i.edit(""),i=n>i.end?this.byStart[i.end]:null;return this}reset(e,n){for(;e<0;)e+=this.original.length;for(;n<0;)n+=this.original.length;if(e===n)return this;if(e<0||n>this.original.length)throw new Error("Character is out of bounds");if(e>n)throw new Error("end must be greater than start");this._split(e),this._split(n);let i=this.byStart[e];for(;i;)i.reset(),i=n>i.end?this.byStart[i.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);return this.intro.length?this.intro[this.intro.length-1]:""}lastLine(){let e=this.outro.lastIndexOf(Q);if(e!==-1)return this.outro.substr(e+1);let n=this.outro,i=this.lastChunk;do{if(i.outro.length>0){if(e=i.outro.lastIndexOf(Q),e!==-1)return i.outro.substr(e+1)+n;n=i.outro+n}if(i.content.length>0){if(e=i.content.lastIndexOf(Q),e!==-1)return i.content.substr(e+1)+n;n=i.content+n}if(i.intro.length>0){if(e=i.intro.lastIndexOf(Q),e!==-1)return i.intro.substr(e+1)+n;n=i.intro+n}}while(i=i.previous);return e=this.intro.lastIndexOf(Q),e!==-1?this.intro.substr(e+1)+n:this.intro+n}slice(e=0,n=this.original.length){for(;e<0;)e+=this.original.length;for(;n<0;)n+=this.original.length;let i="",o=this.firstChunk;for(;o&&(o.start>e||o.end<=e);){if(o.start<n&&o.end>=n)return i;o=o.next}if(o&&o.edited&&o.start!==e)throw new Error(`Cannot use replaced character ${e} as slice start anchor.`);const c=o;for(;o;){o.intro&&(c!==o||o.start===e)&&(i+=o.intro);const u=o.start<n&&o.end>=n;if(u&&o.edited&&o.end!==n)throw new Error(`Cannot use replaced character ${n} as slice end anchor.`);const p=c===o?e-o.start:0,g=u?o.content.length+n-o.end:o.content.length;if(i+=o.content.slice(p,g),o.outro&&(!u||o.end===n)&&(i+=o.outro),u)break;o=o.next}retuLine truncated
`;case 114:return"\r";case 120:return String.fromCharCode(Ce(2));case 117:return function(){const e=_.charCodeAt(y);let n;return e===123?(++y,n=Ce(_.indexOf("}",y)-y),++y,n>1114111&&D()):n=Ce(4),n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode(55296+(n>>10),56320+(1023&n)))}();case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:_.charCodeAt(y)===10&&++y;case 10:return"";case 56:case 57:D();default:if(s>=48&&s<=55){let e=_.substr(y-1,3).match(/^[0-7]+/)[0],n=parseInt(e,8);return n>255&&(e=e.slice(0,-1),n=parseInt(e,8)),y+=e.length-1,s=_.charCodeAt(y),e==="0"&&s!==56&&s!==57||D(),String.fromCharCode(n)}return Be(s)?"":String.fromCharCode(s)}}f(dn,"k");function Ce(s){const e=y;let n=0,i=0;for(let o=0;o<s;++o,++y){let c,u=_.charCodeAt(y);if(u!==95){if(u>=97)c=u-97+10;else if(u>=65)c=u-65+10;else{if(!(u>=48&&u<=57))break;c=u-48}if(c>=16)break;i=u,n=16*n+c}else i!==95&&o!==0||D(),i=u}return i!==95&&y-e===s||D(),n}f(Ce,"l");function Be(s){return s===13||s===10}f(Be,"u");function D(){throw Object.assign(Error(`Parse error ${We}:${_.slice(0,y).split(`
`).length}:${y-_.lastIndexOf(`
`,y-1)}`),{idx:y})}f(D,"o");let Se;typeof WebAssembly<"u"&&(async()=>{const{parse:s,init:e}=await import("./lexer-DQCqS3nf.mjs");await e,Se=s})();const Pe=f((s,e)=>Se?Se(s,e):fn(s,e),"parseEsm"),gn=f(s=>{if(!s.includes("import")&&!s.includes("export"))return!1;try{return Pe(s)[3]}catch{return!0}},"isESM"),Je="2",bn=(s=>{const e="default";return s[e]&&typeof s[e]=="object"&&"__esModule"in s[e]?s[e]:s}).toString(),pn=`.then(${bn})`,xe=f((s,e,n)=>{if(n){if(!e.includes("import("))return}else if(!e.includes("import"))return;const o=Pe(e,s)[0].filter(g=>g.d>-1);if(o.length===0)return;const c=new _e(e);for(const g of o)c.appendRight(g.se,pn);const u=c.toString(),p=c.generateMap({source:s,includeContent:!1,hires:"boundary"});return{code:u,map:p}},"transformDynamicImport"),Ge=f(s=>{try{const e=U.readFileSync(s,"utf8");return JSON.parse(e)}catch{}},"readJsonFile"),qe=f(()=>{},"noop"),ze=f(()=>Math.floor(Date.now()/1e8),"getTime");class wn extends Map{static{f(this,"FileCache")}cacheDirectory=Kt;oldCacheDirectory=X.join(Xt.tmpdir(),"tsx");cacheFiles;constructor(){super(),U.mkdirSync(this.cacheDirectory,{recursive:!0}),this.cacheFiles=U.readdirSync(this.cacheDirectory).map(e=>{const[n,i]=e.split("-");return{time:Number(n),key:i,fileName:e}}),setImmediate(()=>{this.expireDiskCache(),this.removeOldCacheDirectory()})}get(e){const n=super.get(e);if(n)return n;const i=this.cacheFiles.find(u=>u.key===e);if(!i)return;const o=X.join(this.cacheDirectory,i.fileName),c=Ge(o);if(!c){U.promises.unlink(o).then(()=>{const u=this.cacheFiles.indexOf(i);this.cacheFiles.splice(u,1)},()=>{});return}return super.set(e,c),c}set(e,n){if(super.set(e,n),n){const i=ze();U.promises.writeFile(X.join(this.cacheDirectory,`${i}-${e}`),JSON.stringify(n)).catch(qe)}return this}expireDiskCache(){const e=ze();for(const n of this.cacheFiles)e-n.time>7&&U.promises.unlink(X.join(this.cacheDirectory,n.fileName)).catch(qe)}async removeOldCacheDirectory(){try{await U.promises.access(this.oldCacheDirectory).then(()=>!0)&&("rm"in U.promises?await U.promises.rm(this.oldCacheDirectory,{recursive:!0,force:!0}):await U.promises.rmdir(this.oldCacheDirectory,{recursive:!0}))}catch{}}}var ie=process.env.TSX_DISABLE_CACHE?new Map:new wn;const mn=/^[\w+.-]+:\/\//,kn=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,yn=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function Cn(s){return mn.test(s)}f(Cn,"isAbsoluteUrl");function Sn(s){return s.startsWith("//")}f(Sn,"isSchemeRelativeUrl");function He(s){return s.startsWith("/")}f(He,"isAbsolutePath");function xn(s){return s.startsWith("file:")}f(xn,"isFileUrl");function Xe(s){return/^[.?#]/.test(s)}f(Xe,"isRelative");function se(s){const e=kn.exec(s);return Ke(e[1],e[2]||"",e[3],e[4]||"",e[5]||"/",e[6]||"",e[7]||"")}f(se,"parseAbsoluteUrl");function vn(s){const e=yn.exec(s),n=e[2];return Ke("file:","",e[1]||"","",He(n)?n:"/"+n,e[3]||"",e[4]||"")}f(vn,"parseFileUrl");function Ke(s,e,n,i,o,c,u){return{scheme:s,user:e,host:n,port:i,path:o,query:c,hash:u,type:7}}f(Ke,"makeUrl");function Ye(s){if(Sn(s)){const n=se("http:"+s);return n.scheme="",n.type=6,n}if(He(s)){const n=se("http://foo.com"+s);return n.scheme="",n.host="",n.type=5,n}if(xn(s))return vn(s);if(Cn(s))return se(s);const e=se("http://foo.com/"+s);return e.scheme="",e.host="",e.type=s?s.startsWith("?")?3:s.startsWith("#")?2:4:1,e}f(Ye,"parseUrl");function _n(s){if(s.endsWith("/.."))return s;const e=s.lastIndexOf("/");return s.slice(0,e+1)}f(_n,"stripPathFilename");function En(s,e){Qe(e,e.type),s.path==="/"?s.path=e.path:s.path=_n(e.path)+s.path}f(En,"mergePaths");function Qe(s,e){const n=e<=4,i=s.path.split("/");let o=1,c=0,u=!1;for(let g=1;g<i.length;g++){const b=i[g];if(!b){u=!0;continue}if(u=!1,b!=="."){if(b===".."){c?(u=!0,c--,o--):n&&(i[o++]=b);continue}i[o++]=b,c++}}let p="";for(let g=1;g<o;g++)p+="/"+i[g];(!p||u&&!p.endsWith("/.."))&&(p+="/"),s.path=p}f(Qe,"normalizePath");function Ln(s,e){if(!s&&!e)return"";const n=Ye(s);let i=n.type;if(e&&i!==7){const c=Ye(e),u=c.type;switch(i){case 1:n.hash=c.hash;case 2:n.query=c.query;case 3:case 4:En(n,c);case 5:n.user=c.user,n.host=c.host,n.port=c.port;case 6:n.scheme=c.scheme}u>i&&(i=u)}Qe(n,i);const o=n.query+n.hash;switch(i){case 2:case 3:return o;case 4:{const c=n.path.slice(1);return c?Xe(e||s)&&!Xe(c)?"./"+c+o:c+o:o||"."}case 5:return n.path+o;default:return n.scheme+"//"+n.user+n.host+n.port+n.path+o}}f(Ln,"resolve$1");function Ze(s,e){return e&&!e.endsWith("/")&&(e+="/"),Ln(s,e)}f(Ze,"resolve");function On(s){if(!s)return"";const e=s.lastIndexOf("/");return s.slice(0,e+1)}f(On,"stripFilename");const F=0;function Rn(s,e){const n=Ve(s,0);if(n===s.length)return s;e||(s=s.slice());for(let i=n;i<s.length;i=Ve(s,i+1))s[i]=Nn(s[i],e);return s}f(Rn,"maybeSort");function Ve(s,e){for(let n=e;n<s.length;n++)if(!An(s[n]))return n;return s.length}f(Ve,"nextUnsortedSegmentLine");function An(s){for(let e=1;e<s.length;e++)if(s[e][F]<s[e-1][F])return!1;return!0}f(An,"isSorted");functiLine truncated
Did you specify these with the most recent transformation maps first?`);let o=ht(i,e,"",0);for(let c=n.length-1;c>=0;c--)o=ut(n[c],[o]);return o}f(or,"buildSourceMapTree");function ht(s,e,n,i){const{resolvedSources:o,sourcesContent:c,ignoreList:u}=s,p=i+1,g=o.map((b,d)=>{const r={importer:n,depth:p,source:b||"",content:void 0,ignore:void 0},R=e(r.source,r),{source:L,content:E,ignore:N}=r;if(R)return ht(new et(R,L),e,L,p);const $=E!==void 0?E:c?c[d]:null,W=N!==void 0?N:u?u.includes(d):!1;return rr(L,$,W)});return ut(s,g)}f(ht,"build");class ar{static{f(this,"SourceMap")}constructor(e,n){const i=n.decodedMappings?it(e):Kn(e);this.version=i.version,this.file=i.file,this.mappings=i.mappings,this.names=i.names,this.ignoreList=i.ignoreList,this.sourceRoot=i.sourceRoot,this.sources=i.sources,n.excludeContent||(this.sourcesContent=i.sourcesContent)}toString(){return JSON.stringify(this)}}function ft(s,e,n){const i={excludeContent:!!n,decodedMappings:!1},o=or(s,e);return new ar(ir(o),i)}f(ft,"remapping");const cr=f((s,e,n)=>{const i=[],o={code:e};for(const c of n){const u=c(s,o.code);u&&(Object.assign(o,u),i.unshift(u.map))}return{...o,map:ft(i,()=>null)}},"applyTransformersSync"),ur=f(async(s,e,n)=>{const i=[],o={code:e};for(const c of n){const u=await c(s,o.code);u&&(Object.assign(o,u),i.unshift(u.map))}return{...o,map:ft(i,()=>null)}},"applyTransformers"),lr=Object.freeze({target:`node${process.versions.node}`,loader:"default"}),hr=/^--inspect(?:-brk|-port|-publish-uid|-wait)?(?:=|$)/,fr=process.execArgv.some(s=>hr.test(s)),dt={...lr,sourcemap:!0,sourcesContent:!!process.env.NODE_V8_COVERAGE||fr,minifyWhitespace:!0,keepNames:!0},gt=f(s=>{const e=s.sourcefile;if(e){const n=X.extname(e.split("?")[0]);n?n===".cts"||n===".mts"?s.sourcefile=`${e.slice(0,-3)}ts`:n===".mjs"&&(s.sourcefile=`${e.slice(0,-3)}js`):s.sourcefile+=".js"}return n=>(n.map&&(s.sourcefile!==e&&(n.map=n.map.replace(JSON.stringify(s.sourcefile),JSON.stringify(e))),n.map=JSON.parse(n.map)),n)},"patchOptions"),bt=f(s=>{throw s.name="TransformError",delete s.errors,delete s.warnings,s},"formatEsbuildError"),dr=f((s,e,n)=>{const i={};let o,c,u;if(e.startsWith("file://")){o=e;const d=new URL(e);c=Jt(d)}else[c,u]=e.split("?"),o=Gt(c)+(u?`?${u}`:"");c.endsWith(".cjs")||c.endsWith(".cts")||(i["import.meta.url"]=JSON.stringify(o));const p={...dt,format:"cjs",sourcefile:c,define:i,banner:`__filename=${JSON.stringify(c)};(()=>{`,footer:"})()",platform:"node",...n},g=Ne([s,JSON.stringify(p),Ae,Je].join("-"));let b=ie.get(g);return b||(b=cr(e,s,[(d,r)=>{const R=gt(p);let L;try{L=qt(r,p)}catch(E){throw bt(E)}return R(L)},(d,r)=>xe(d,r,!0)]),ie.set(g,b)),b},"transformSync"),gr=f(async(s,e,n)=>{const i={...dt,format:"esm",sourcefile:e,...n},o=Ne([s,JSON.stringify(i),Ae,Je].join("-"));let c=ie.get(o);return c||(c=await ur(e,s,[async(u,p)=>{const g=gt(i);let b;try{b=await zt(p,i)}catch(d){throw bt(d)}return g(b)},(u,p)=>xe(u,p,!0)]),ie.set(o,c)),c},"transform");export{dr as a,xe as b,gn as i,Ge as r,gr as t};
@@ -0,0 +1,54 @@
var wrappy = require('wrappy')
var reqs = Object.create(null)
var once = require('once')
module.exports = wrappy(inflight)
function inflight (key, cb) {
if (reqs[key]) {
reqs[key].push(cb)
return null
} else {
reqs[key] = [cb]
return makeres(key)
}
}
function makeres (key) {
return once(function RES () {
var cbs = reqs[key]
var len = cbs.length
var args = slice(arguments)
// XXX It's somewhat ambiguous whether a new callback added in this
// pass should be queued for later execution if something in the
// list of callbacks throws, or if it should just be discarded.
// However, it's such an edge case that it hardly matters, and either
// choice is likely as surprising as the other.
// As it happens, we do go ahead and schedule it for later execution.
try {
for (var i = 0; i < len; i++) {
cbs[i].apply(null, args)
}
} finally {
if (cbs.length > len) {
// added more in the interim.
// de-zalgo, just in case, but don't call again.
cbs.splice(0, len)
process.nextTick(function () {
RES.apply(null, args)
})
} else {
delete reqs[key]
}
}
})
}
function slice (args) {
var length = args.length
var array = []
for (var i = 0; i < length; i++) array[i] = args[i]
return array
}
@@ -0,0 +1,23 @@
"use strict";
var _get_prototype_of = require("./_get_prototype_of.cjs");
var _is_native_reflect_construct = require("./_is_native_reflect_construct.cjs");
var _possible_constructor_return = require("./_possible_constructor_return.cjs");
function _create_super(Derived) {
var hasNativeReflectConstruct = _is_native_reflect_construct._();
return function _createSuperInternal() {
var Super = _get_prototype_of._(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _get_prototype_of._(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possible_constructor_return._(this, result);
};
}
exports._ = _create_super;
@@ -0,0 +1,38 @@
/*!
Copyright 2013 Lovell Fuller and others.
SPDX-License-Identifier: Apache-2.0
*/
const {
useGlobalLibvips,
globalLibvipsVersion,
log,
spawnRebuild,
} = require('../lib/libvips');
log('Attempting to build from source via node-gyp');
log('See https://sharp.pixelplumbing.com/install#building-from-source');
try {
const addonApi = require('node-addon-api');
log(`Found node-addon-api ${addonApi.version || ''}`);
} catch (_err) {
log('Please add node-addon-api to your dependencies');
process.exit(1);
}
try {
const gyp = require('node-gyp');
log(`Found node-gyp ${gyp().version}`);
} catch (_err) {
log('Please add node-gyp to your dependencies');
process.exit(1);
}
if (useGlobalLibvips(log)) {
log(`Detected globally-installed libvips v${globalLibvipsVersion()}`);
}
const status = spawnRebuild();
if (status !== 0) {
process.exit(status);
}
@@ -0,0 +1,38 @@
{
"name": "@types/on-finished",
"version": "2.3.5",
"description": "TypeScript definitions for on-finished",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/on-finished",
"license": "MIT",
"contributors": [
{
"name": "Honza Dvorsky",
"githubUsername": "czechboy0",
"url": "https://github.com/czechboy0"
},
{
"name": "BendingBender",
"githubUsername": "BendingBender",
"url": "https://github.com/BendingBender"
},
{
"name": "Sebastian Beltran",
"githubUsername": "bjohansebas",
"url": "https://github.com/bjohansebas"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/on-finished"
},
"scripts": {},
"dependencies": {
"@types/node": "*"
},
"peerDependencies": {},
"typesPublisherContentHash": "b78697de4121c4a884417d2dccf9051b830f8418ffc24e3b0a38a76b5dd4a1ed",
"typeScriptVersion": "5.1"
}
@@ -0,0 +1,3 @@
declare function isDataView(value: unknown): value is DataView;
export = isDataView;
@@ -0,0 +1,25 @@
// src/copy.tsx
import { jsx } from "react/jsx-runtime";
var CopyIcon = (props) => /* @__PURE__ */ jsx(
"svg",
{
"aria-hidden": "true",
focusable: "false",
height: "1em",
role: "presentation",
viewBox: "0 0 24 24",
width: "1em",
...props,
children: /* @__PURE__ */ jsx(
"path",
{
d: "M20 2H10c-1.103 0-2 .897-2 2v4H4c-1.103 0-2 .897-2 2v10c0 1.103.897 2 2 2h10c1.103 0 2-.897 2-2v-4h4c1.103 0 2-.897 2-2V4c0-1.103-.897-2-2-2zM4 20V10h10l.002 10H4zm16-6h-4v-4c0-1.103-.897-2-2-2h-4V4h10v10z",
fill: "currentColor"
}
)
}
);
export {
CopyIcon
};
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAOM,MAAM,kDAAiC,CAAA,GAAA,yCAAmB;IAErD,OAAO,IAAa,EAAW;QACvC,OAAO,KAAK,IAAI,KAAK,UAAU,KAAK,IAAI,KAAK,eAAe,KAAK,IAAI,KAAK;IAC5E;IAEA,YAAY,GAAQ,EAAc;QAChC,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACxC,IAAI,CAAC,WACH,OAAO;QAGT,sEAAsE;QACtE,mDAAmD;QACnD,IAAI,UAAU,IAAI,KAAK,UAAU;YAC/B,IAAI,QAAQ,CAAA,GAAA,2CAAW,EAAE,CAAA,GAAA,4CAAY,EAAE,WAAW,IAAI,CAAC,UAAU;YACjE,IAAI,OACF,OAAO,MAAM,GAAG;YAGlB,IAAI,WAAW,IAAI,CAAC,WAAW;YAC/B,IAAI,YAAY,MACd,OAAO;YAGT,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YACxC,IAAI,CAAC,WACH,OAAO;YAGT,OAAO,KAAK,CAAC,0BAA0B,UAAU,UAAU,KAAK;QAClE;QAEA,OAAO,KAAK,CAAC,YAAY;IAC3B;IAEA,YAAY,GAAQ,EAAc;QAChC,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACxC,IAAI,CAAC,WACH,OAAO;QAGT,2DAA2D;QAC3D,IAAI,UAAU,IAAI,KAAK,UAAU;YAC/B,IAAI,SAAS,UAAU,SAAS,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,SAAS,IAAI;YAC1F,IAAI,UAAU,OAAO,IAAI,KAAK,UAC5B,OAAO,OAAO,GAAG;YAGnB,OAAO;QACT;QAEA,8CAA8C;QAC9C,IAAI,WAAW,KAAK,CAAC,YAAY;QACjC,IAAI,YAAY,YAAY,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,YAAY;QACvE,IAAI,aAAa,UAAU,IAAI,KAAK,aAClC,OAAO;QAGT,gEAAgE;QAChE,+BAA+B;QAC/B,IAAI,IAAI,CAAC,MAAM,CAAC,YACd,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,KAAK,CAAC,CAAC,GAAG;QAGrD,6DAA6D;QAC7D,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG;IACvC;IAEQ,kBAAkB,MAAe,EAAc;QACrD,2BAA2B;QAC3B,IAAI,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,GAAG,EAAE,CAAA,OAAQ,KAAK,IAAI,KAAK;QAC7D,IAAI,OAAO,MACT,OAAO;QAGT,kCAAkC;QAClC,IAAI,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,KAAK,CAAC;QAClD,KAAK,IAAI,QAAQ,CAAA,GAAA,4CAAY,EAAE,KAAK,IAAI,CAAC,UAAU,EAAG;YACpD,IAAI,KAAK,IAAI,KAAK,UAChB,OAAO,KAAK,GAAG;QAEnB;QAEA,OAAO;IACT;IAEQ,sBAAsB,MAAe,EAAc;QACzD,0BAA0B;QAC1B,IAAI,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,GAAG,EAAE,CAAA,OAAQ,KAAK,IAAI,KAAK;QACjE,IAAI,OAAO,MACT,OAAO;QAGT,iCAAiC;QACjC,IAAI,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,KAAK,CAAC;QAClD,IAAI,aAAa;eAAI,CAAA,GAAA,4CAAY,EAAE,KAAK,IAAI,CAAC,UAAU;SAAE;QACzD,IAAK,IAAI,IAAI,WAAW,MAAM,GAAG,GAAG,KAAK,GAAG,IAAK;YAC/C,IAAI,OAAO,UAAU,CAAC,EAAE;YACxB,IAAI,KAAK,IAAI,KAAK,UAChB,OAAO,KAAK,GAAG;QAEnB;QAEA,OAAO;IACT;IAEA,cAAc,GAAQ,EAAc;QAClC,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACnC,IAAI,CAAC,MACH,OAAO;QAGT,uDAAuD;QACvD,IAAI,KAAK,IAAI,KAAK,UAChB,OAAO,IAAI,CAAC,SAAS,KAAK,QACtB,IAAI,CAAC,qBAAqB,CAAC,QAC3B,IAAI,CAAC,iBAAiB,CAAC;QAG7B,OAAO,KAAK,CAAC,cAAc;IAC7B;IAEA,aAAa,GAAQ,EAAc;QACjC,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACnC,IAAI,CAAC,MACH,OAAO;QAGT,2DAA2D;QAC3D,IAAI,KAAK,IAAI,KAAK,UAChB,OAAO,IAAI,CAAC,SAAS,KAAK,QACtB,IAAI,CAAC,iBAAiB,CAAC,QACvB,IAAI,CAAC,qBAAqB,CAAC;QAGjC,OAAO,KAAK,CAAC,aAAa;IAC5B;IAEA,gBAAgB,MAAc,EAAE,OAAa,EAAc;QACzD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAChB,OAAO;QAGT,IAAI,aAAa,IAAI,CAAC,UAAU;QAChC,IAAI,MAAM,oBAAA,qBAAA,UAAW,IAAI,CAAC,WAAW;QACrC,IAAI,OAAO,MACT,OAAO;QAGT,6DAA6D;QAC7D,IAAI,YAAY,WAAW,OAAO,CAAC;YAE3B;QADR,IAAI,CAAA,sBAAA,gCAAA,UAAW,IAAI,MAAK,QACtB,MAAM,CAAA,uBAAA,UAAU,SAAS,cAAnB,kCAAA,uBAAuB;QAG/B,IAAI,aAAa;QACjB,MAAO,OAAO,KAAM;YAClB,IAAI,OAAO,WAAW,OAAO,CAAC;YAC9B,IAAI,CAAC,MACH,OAAO;YAGT,IAAI,KAAK,SAAS,EAAE;gBAClB,IAAI,YAAY,KAAK,SAAS,CAAC,KAAK,CAAC,GAAG,OAAO,MAAM;gBACrD,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,YAAY,GAC/C,OAAO,KAAK,GAAG;YAEnB;YAEA,6DAA6D;YAC7D,KAAK,IAAI,QAAQ,CAAA,GAAA,4CAAY,EAAE,MAAM,IAAI,CAAC,UAAU,EAAG;gBACrD,IAAI,SAAS,WAAW,OAAO,CAAC,KAAK,KAAK,CAAC;gBAC3C,IAAI,WAAW,mBAAmB,CAAC,GAAG,CAAC,OAAO,GAAG,KAAK,KAAK,SAAS,EAAE;oBACpE,IAAI,YAAY,KAAK,SAAS,CAAC,KAAK,CAAC,GAAG,OAAO,MAAM;oBACrD,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,YAAY,GAAG;wBAClD,gFAAgF;wBAChF,IAAI,WAAW,WAAW,OAAO,WAAW,OAAO,CAAC,WAAW;wBAC/D,OAAO,CAAA,qBAAA,+BAAA,SAAU,IAAI,MAAK,SACtB,KAAK,GAAG,GACR,KAAK,GAAG;oBACd;gBACF;YACF;YAEA,MAAM,IAAI,CAAC,WAAW,CAAC;YAEvB,sDAAsD;YACtD,IAAI,OAAO,QAAQ,CAAC,YAAY;gBAC9B,MAAM,IAAI,CAAC,WAAW;gBACtB,aAAa;YACf;QACF;QAEA,OAAO;IACT;AACF","sources":["packages/@react-aria/table/src/TableKeyboardDelegate.ts"],"sourcesContent":["/*\n * Copyright 2022 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 {getChildNodes, getFirstItem} from '@react-stately/collections';\nimport {GridKeyboardDelegate} from '@react-aria/grid';\nimport {Key, Node} from '@react-types/shared';\nimport {TableCollection} from '@react-types/table';\n\nexport class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableCollection<T>> {\n\n protected isCell(node: Node<T>): boolean {\n return node.type === 'cell' || node.type === 'rowheader' || node.type === 'column';\n }\n\n getKeyBelow(key: Key): Key | null {\n let startItem = this.collection.getItem(key);\Line truncated
@@ -0,0 +1,9 @@
{
"extends": "@ljharb/tsconfig",
"compilerOptions": {
"target": "ES2021",
},
"exclude": [
"coverage"
]
}
@@ -0,0 +1,24 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2019 = void 0;
const es2018_1 = require("./es2018");
const es2019_array_1 = require("./es2019.array");
const es2019_intl_1 = require("./es2019.intl");
const es2019_object_1 = require("./es2019.object");
const es2019_string_1 = require("./es2019.string");
const es2019_symbol_1 = require("./es2019.symbol");
exports.es2019 = {
libs: [
es2018_1.es2018,
es2019_array_1.es2019_array,
es2019_object_1.es2019_object,
es2019_string_1.es2019_string,
es2019_symbol_1.es2019_symbol,
es2019_intl_1.es2019_intl,
],
variables: [],
};
@@ -0,0 +1,7 @@
var classApplyDescriptorDestructureSet = require("./classApplyDescriptorDestructureSet.js");
var classPrivateFieldGet2 = require("./classPrivateFieldGet2.js");
function _classPrivateFieldDestructureSet(e, t) {
var r = classPrivateFieldGet2(t, e);
return classApplyDescriptorDestructureSet(e, r);
}
module.exports = _classPrivateFieldDestructureSet, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,19 @@
import * as React from 'react';
type RenderFunction<P> = (props: P) => React.ReactNode;
type RenderFnProps<P extends {}> = {
Component: React.FunctionComponent<P> | React.ComponentClass<P> | string;
props: P;
renderCustom?: RenderFunction<P>;
};
/**
* Render a component with custom render function
*
* @param Component The component to be rendered
* @param renderCustom The custom render function
* @param props The props to be passed to the component
* @returns React.ReactElement
*/
declare function renderFn<P extends {}>({ Component, props, renderCustom }: RenderFnProps<P>): React.ReactNode;
export { renderFn };
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2017_string: LibDefinition;
@@ -0,0 +1,9 @@
import type { TSchema, SchemaOptions } from '../schema/index';
import { Kind } from '../symbols/index';
export interface TBoolean extends TSchema {
[Kind]: 'Boolean';
static: boolean;
type: 'boolean';
}
/** `[Json]` Creates a Boolean type */
export declare function Boolean(options?: SchemaOptions): TBoolean;
@@ -0,0 +1,63 @@
{
"name": "ssri",
"version": "9.0.1",
"description": "Standard Subresource Integrity library -- parses, serializes, generates, and verifies integrity metadata according to the SRI spec.",
"main": "lib/index.js",
"files": [
"bin/",
"lib/"
],
"scripts": {
"prerelease": "npm t",
"postrelease": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"posttest": "npm run lint",
"test": "tap",
"coverage": "tap",
"lint": "eslint \"**/*.js\"",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"preversion": "npm test",
"postversion": "npm publish",
"snap": "tap"
},
"tap": {
"check-coverage": true
},
"repository": {
"type": "git",
"url": "https://github.com/npm/ssri.git"
},
"keywords": [
"w3c",
"web",
"security",
"integrity",
"checksum",
"hashing",
"subresource integrity",
"sri",
"sri hash",
"sri string",
"sri generator",
"html"
],
"author": "GitHub Inc.",
"license": "ISC",
"dependencies": {
"minipass": "^3.1.1"
},
"devDependencies": {
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/template-oss": "3.5.0",
"tap": "^16.0.1"
},
"engines": {
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "3.5.0"
}
}
@@ -0,0 +1,474 @@
'use strict';
const util = require('util');
const braces = require('braces');
const picomatch = require('picomatch');
const utils = require('picomatch/lib/utils');
const isEmptyString = v => v === '' || v === './';
const hasBraces = v => {
const index = v.indexOf('{');
return index > -1 && v.indexOf('}', index) > -1;
};
/**
* Returns an array of strings that match one or more glob patterns.
*
* ```js
* const mm = require('micromatch');
* // mm(list, patterns[, options]);
*
* console.log(mm(['a.js', 'a.txt'], ['*.js']));
* //=> [ 'a.js' ]
* ```
* @param {String|Array<string>} `list` List of strings to match.
* @param {String|Array<string>} `patterns` One or more glob patterns to use for matching.
* @param {Object} `options` See available [options](#options)
* @return {Array} Returns an array of matches
* @summary false
* @api public
*/
const micromatch = (list, patterns, options) => {
patterns = [].concat(patterns);
list = [].concat(list);
let omit = new Set();
let keep = new Set();
let items = new Set();
let negatives = 0;
let onResult = state => {
items.add(state.output);
if (options && options.onResult) {
options.onResult(state);
}
};
for (let i = 0; i < patterns.length; i++) {
let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
if (negated) negatives++;
for (let item of list) {
let matched = isMatch(item, true);
let match = negated ? !matched.isMatch : matched.isMatch;
if (!match) continue;
if (negated) {
omit.add(matched.output);
} else {
omit.delete(matched.output);
keep.add(matched.output);
}
}
}
let result = negatives === patterns.length ? [...items] : [...keep];
let matches = result.filter(item => !omit.has(item));
if (options && matches.length === 0) {
if (options.failglob === true) {
throw new Error(`No matches found for "${patterns.join(', ')}"`);
}
if (options.nonull === true || options.nullglob === true) {
return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns;
}
}
return matches;
};
/**
* Backwards compatibility
*/
micromatch.match = micromatch;
/**
* Returns a matcher function from the given glob `pattern` and `options`.
* The returned function takes a string to match as its only argument and returns
* true if the string is a match.
*
* ```js
* const mm = require('micromatch');
* // mm.matcher(pattern[, options]);
*
* const isMatch = mm.matcher('*.!(*a)');
* console.log(isMatch('a.a')); //=> false
* console.log(isMatch('a.b')); //=> true
* ```
* @param {String} `pattern` Glob pattern
* @param {Object} `options`
* @return {Function} Returns a matcher function.
* @api public
*/
micromatch.matcher = (pattern, options) => picomatch(pattern, options);
/**
* Returns true if **any** of the given glob `patterns` match the specified `string`.
*
* ```js
* const mm = require('micromatch');
* // mm.isMatch(string, patterns[, options]);
*
* console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
* console.log(mm.isMatch('a.a', 'b.*')); //=> false
* ```
* @param {String} `str` The string to test.
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
* @param {Object} `[options]` See available [options](#options).
* @return {Boolean} Returns true if any patterns match `str`
* @api public
*/
micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
/**
* Backwards compatibility
*/
micromatch.any = micromatch.isMatch;
/**
* Returns a list of strings that _**do not match any**_ of the given `patterns`.
*
* ```js
* const mm = require('micromatch');
* // mm.not(list, patterns[, options]);
*
* console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
* //=> ['b.b', 'c.c']
* ```
* @param {Array} `list` Array of strings to match.
* @param {String|Array} `patterns` One or more glob pattern to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Array} Returns an array of strings that **do not match** the given patterns.
* @api public
*/
micromatch.not = (list, patterns, options = {}) => {
patterns = [].concat(patterns).map(String);
let result = new Set();
let items = [];
let onResult = state => {
if (options.onResult) options.onResult(state);
items.push(state.output);
};
let matches = new Set(micromatch(list, patterns, { ...options, onResult }));
for (let item of items) {
if (!matches.has(item)) {
result.add(item);
}
}
return [...result];
};
/**
* Returns true if the given `string` contains the given pattern. Similar
* to [.isMatch](#isMatch) but the pattern can match any part of the string.
*
* ```js
* var mm = require('micromatch');
* // mm.contains(string, pattern[, options]);
*
* console.log(mm.contains('aa/bb/cc', '*b'));
* //=> true
* console.log(mm.contains('aa/bb/cc', '*d'));
* //=> false
* ```
* @param {String} `str` The string to match.
* @param {String|Array} `patterns` Glob pattern to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Boolean} Returns true if any of the patterns matches any part of `str`.
* @api public
*/
micromatch.contains = (str, pattern, options) => {
if (typeof str !== 'string') {
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
}
if (Array.isArray(pattern)) {
return pattern.some(p => micromatch.contains(str, p, options));
}
if (typeof pattern === 'string') {
if (isEmptyString(str) || isEmptyString(pattern)) {
return false;
}
if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) {
return true;
}
}
return micromatch.isMatch(str, pattern, { ...options, contains: true });
};
/**
* Filter the keys of the given object with the given `glob` pattern
* and `options`. Does not attempt to match nested keys. If you need this feature,
* use [glob-object][] instead.
*
* ```js
* const mm = require('micromatch');
* // mm.matchKeys(object, patterns[, options]);
*
* const obj = { aa: 'a', ab: 'b', ac: 'c' };
* console.log(mm.matchKeys(obj, '*b'));
* //=> { ab: 'b' }
* ```
* @param {Object} `object` The object with keys to filter.
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Object} Returns an object with only keys that match the given patterns.
* @api public
*/
micromatch.matchKeys = (obj, patterns, options) => {
if (!utils.isObject(obj)) {
throw new TypeError('Expected the first argument to be an object');
}
let keys = micromatch(Object.keys(obj), patterns, options);
let res = {};
for (let key of keys) res[key] = obj[key];
return res;
};
/**
* Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
*
* ```js
* const mm = require('micromatch');
* // mm.some(list, patterns[, options]);
*
* console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
* // true
* console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
* // false
* ```
* @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Boolean} Returns true if any `patterns` matches any of the strings in `list`
* @api public
*/
micromatch.some = (list, patterns, options) => {
let items = [].concat(list);
for (let pattern of [].concat(patterns)) {
let isMatch = picomatch(String(pattern), options);
if (items.some(item => isMatch(item))) {
return true;
}
}
return false;
};
/**
* Returns true if every string in the given `list` matches
* any of the given glob `patterns`.
*
* ```js
* const mm = require('micromatch');
* // mm.every(list, patterns[, options]);
*
* console.log(mm.every('foo.js', ['foo.js']));
* // true
* console.log(mm.every(['foo.js', 'bar.js'], ['*.js']));
* // true
* console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
* // false
* console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
* // false
* ```
* @param {String|Array} `list` The string or array of strings to test.
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Boolean} Returns true if all `patterns` matches all of the strings in `list`
* @api public
*/
micromatch.every = (list, patterns, options) => {
let items = [].concat(list);
for (let pattern of [].concat(patterns)) {
let isMatch = picomatch(String(pattern), options);
if (!items.every(item => isMatch(item))) {
return false;
}
}
return true;
};
/**
* Returns true if **all** of the given `patterns` match
* the specified string.
*
* ```js
* const mm = require('micromatch');
* // mm.all(string, patterns[, options]);
*
* console.log(mm.all('foo.js', ['foo.js']));
* // true
*
* console.log(mm.all('foo.js', ['*.js', '!foo.js']));
* // false
*
* console.log(mm.all('foo.js', ['*.js', 'foo.js']));
* // true
*
* console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
* // true
* ```
* @param {String|Array} `str` The string to test.
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Boolean} Returns true if any patterns match `str`
* @api public
*/
micromatch.all = (str, patterns, options) => {
if (typeof str !== 'string') {
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
}
return [].concat(patterns).every(p => picomatch(p, options)(str));
};
/**
* Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match.
*
* ```js
* const mm = require('micromatch');
* // mm.capture(pattern, string[, options]);
*
* console.log(mm.capture('test/*.js', 'test/foo.js'));
* //=> ['foo']
* console.log(mm.capture('test/*.js', 'foo/bar.css'));
* //=> null
* ```
* @param {String} `glob` Glob pattern to use for matching.
* @param {String} `input` String to match
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`.
* @api public
*/
micromatch.capture = (glob, input, options) => {
let posix = utils.isWindows(options);
let regex = picomatch.makeRe(String(glob), { ...options, capture: true });
let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
if (match) {
return match.slice(1).map(v => v === void 0 ? '' : v);
}
};
/**
* Create a regular expression from the given glob `pattern`.
*
* ```js
* const mm = require('micromatch');
* // mm.makeRe(pattern[, options]);
*
* console.log(mm.makeRe('*.js'));
* //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
* ```
* @param {String} `pattern` A glob pattern to convert to regex.
* @param {Object} `options`
* @return {RegExp} Returns a regex created from the given pattern.
* @api public
*/
micromatch.makeRe = (...args) => picomatch.makeRe(...args);
/**
* Scan a glob pattern to separate the pattern into segments. Used
* by the [split](#split) method.
*
* ```js
* const mm = require('micromatch');
* const state = mm.scan(pattern[, options]);
* ```
* @param {String} `pattern`
* @param {Object} `options`
* @return {Object} Returns an object with
* @api public
*/
micromatch.scan = (...args) => picomatch.scan(...args);
/**
* Parse a glob pattern to create the source string for a regular
* expression.
*
* ```js
* const mm = require('micromatch');
* const state = mm.parse(pattern[, options]);
* ```
* @param {String} `glob`
* @param {Object} `options`
* @return {Object} Returns an object with useful properties and output to be used as regex source string.
* @api public
*/
micromatch.parse = (patterns, options) => {
let res = [];
for (let pattern of [].concat(patterns || [])) {
for (let str of braces(String(pattern), options)) {
res.push(picomatch.parse(str, options));
}
}
return res;
};
/**
* Process the given brace `pattern`.
*
* ```js
* const { braces } = require('micromatch');
* console.log(braces('foo/{a,b,c}/bar'));
* //=> [ 'foo/(a|b|c)/bar' ]
*
* console.log(braces('foo/{a,b,c}/bar', { expand: true }));
* //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ]
* ```
* @param {String} `pattern` String with brace pattern to process.
* @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options.
* @return {Array}
* @api public
*/
micromatch.braces = (pattern, options) => {
if (typeof pattern !== 'string') throw new TypeError('Expected a string');
if ((options && options.nobrace === true) || !hasBraces(pattern)) {
return [pattern];
}
return braces(pattern, options);
};
/**
* Expand braces
*/
micromatch.braceExpand = (pattern, options) => {
if (typeof pattern !== 'string') throw new TypeError('Expected a string');
return micromatch.braces(pattern, { ...options, expand: true });
};
/**
* Expose micromatch
*/
// exposed for tests
micromatch.hasBraces = hasBraces;
module.exports = micromatch;
@@ -0,0 +1,103 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.uppercase = exports.lowercase = exports.undefined = exports.null = exports.boolean = exports.number = exports.integer = exports.bigint = exports.string = exports.date = exports.e164 = exports.domain = exports.hostname = exports.base64url = exports.base64 = exports.cidrv6 = exports.cidrv4 = exports.ipv6 = exports.ipv4 = exports._emoji = exports.browserEmail = exports.unicodeEmail = exports.rfc5322Email = exports.html5Email = exports.email = exports.uuid7 = exports.uuid6 = exports.uuid4 = exports.uuid = exports.guid = exports.extendedDuration = exports.duration = exports.nanoid = exports.ksuid = exports.xid = exports.ulid = exports.cuid2 = exports.cuid = void 0;
exports.emoji = emoji;
exports.time = time;
exports.datetime = datetime;
exports.cuid = /^[cC][^\s-]{8,}$/;
exports.cuid2 = /^[0-9a-z]+$/;
exports.ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
exports.xid = /^[0-9a-vA-V]{20}$/;
exports.ksuid = /^[A-Za-z0-9]{27}$/;
exports.nanoid = /^[a-zA-Z0-9_-]{21}$/;
/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
exports.duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */
exports.extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
exports.guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
/** Returns a regex for validating an RFC 4122 UUID.
*
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
const uuid = (version) => {
if (!version)
return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
};
exports.uuid = uuid;
exports.uuid4 = (0, exports.uuid)(4);
exports.uuid6 = (0, exports.uuid)(6);
exports.uuid7 = (0, exports.uuid)(7);
/** Practical email validation */
exports.email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */
exports.html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
/** The classic emailregex.com regex for RFC 5322-compliant emails */
exports.rfc5322Email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */
exports.unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
exports.browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression
exports._emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
function emoji() {
return new RegExp(exports._emoji, "u");
}
exports.ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
exports.ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/;
exports.cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
exports.cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
exports.base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
exports.base64url = /^[A-Za-z0-9_-]*$/;
// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address
// export const hostname: RegExp =
// /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/;
exports.hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
exports.domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)
exports.e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
// const dateSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
exports.date = new RegExp(`^${dateSource}$`);
function timeSource(args) {
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
const regex = typeof args.precision === "number"
? args.precision === -1
? `${hhmm}`
: args.precision === 0
? `${hhmm}:[0-5]\\d`
: `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}`
: `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
return regex;
}
function time(args) {
return new RegExp(`^${timeSource(args)}$`);
}
// Adapted from https://stackoverflow.com/a/3143231
function datetime(args) {
const time = timeSource({ precision: args.precision });
const opts = ["Z"];
if (args.local)
opts.push("");
if (args.offset)
opts.push(`([+-]\\d{2}:\\d{2})`);
const timeRegex = `${time}(?:${opts.join("|")})`;
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
}
const string = (params) => {
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
return new RegExp(`^${regex}$`);
};
exports.string = string;
exports.bigint = /^\d+n?$/;
exports.integer = /^\d+$/;
exports.number = /^-?\d+(?:\.\d+)?/i;
exports.boolean = /true|false/i;
const _null = /null/i;
exports.null = _null;
const _undefined = /undefined/i;
exports.undefined = _undefined;
// regex for string with no uppercase letters
exports.lowercase = /^[^A-Z]*$/;
// regex for string with no lowercase letters
exports.uppercase = /^[^a-z]*$/;
@@ -0,0 +1,74 @@
var test = require('tape');
var stringify = require('../');
test('replace root', function (t) {
t.plan(1);
var obj = { a: 1, b: 2, c: false };
var replacer = function(key, value) { return 'one'; };
t.equal(stringify(obj, { replacer: replacer }), '"one"');
});
test('replace numbers', function (t) {
t.plan(1);
var obj = { a: 1, b: 2, c: false };
var replacer = function(key, value) {
if(value === 1) return 'one';
if(value === 2) return 'two';
return value;
};
t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":"two","c":false}');
});
test('replace with object', function (t) {
t.plan(1);
var obj = { a: 1, b: 2, c: false };
var replacer = function(key, value) {
if(key === 'b') return { d: 1 };
if(value === 1) return 'one';
return value;
};
t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":{"d":"one"},"c":false}');
});
test('replace with undefined', function (t) {
t.plan(1);
var obj = { a: 1, b: 2, c: false };
var replacer = function(key, value) {
if(value === false) return;
return value;
};
t.equal(stringify(obj, { replacer: replacer }), '{"a":1,"b":2}');
});
test('replace with array', function (t) {
t.plan(1);
var obj = { a: 1, b: 2, c: false };
var replacer = function(key, value) {
if(key === 'b') return ['one', 'two'];
return value;
};
t.equal(stringify(obj, { replacer: replacer }), '{"a":1,"b":["one","two"],"c":false}');
});
test('replace array item', function (t) {
t.plan(1);
var obj = { a: 1, b: 2, c: [1,2] };
var replacer = function(key, value) {
if(value === 1) return 'one';
if(value === 2) return 'two';
return value;
};
t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":"two","c":["one","two"]}');
});
@@ -0,0 +1,68 @@
'use strict';
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
module.exports = {
/* Allowed flush values; see deflate() and inflate() below for details */
Z_NO_FLUSH: 0,
Z_PARTIAL_FLUSH: 1,
Z_SYNC_FLUSH: 2,
Z_FULL_FLUSH: 3,
Z_FINISH: 4,
Z_BLOCK: 5,
Z_TREES: 6,
/* Return codes for the compression/decompression functions. Negative values
* are errors, positive values are used for special but normal events.
*/
Z_OK: 0,
Z_STREAM_END: 1,
Z_NEED_DICT: 2,
Z_ERRNO: -1,
Z_STREAM_ERROR: -2,
Z_DATA_ERROR: -3,
Z_MEM_ERROR: -4,
Z_BUF_ERROR: -5,
//Z_VERSION_ERROR: -6,
/* compression levels */
Z_NO_COMPRESSION: 0,
Z_BEST_SPEED: 1,
Z_BEST_COMPRESSION: 9,
Z_DEFAULT_COMPRESSION: -1,
Z_FILTERED: 1,
Z_HUFFMAN_ONLY: 2,
Z_RLE: 3,
Z_FIXED: 4,
Z_DEFAULT_STRATEGY: 0,
/* Possible values of the data_type field (though see inflate()) */
Z_BINARY: 0,
Z_TEXT: 1,
//Z_ASCII: 1, // = Z_TEXT (deprecated)
Z_UNKNOWN: 2,
/* The deflate compression method */
Z_DEFLATED: 8
//Z_NULL: null // Use -1 or null inline, depending on var type
};
@@ -0,0 +1,24 @@
// src/common/text.ts
var safeText = (text) => {
if ((text == null ? void 0 : text.length) <= 4) return text;
return text == null ? void 0 : text.slice(0, 3);
};
var safeInitials = (text) => {
const initials = (text == null ? void 0 : text.trim().split(/[\s\-_.]+/).filter(Boolean).map((word) => word.charAt(0).toUpperCase()).join("")) || "";
return safeText(initials);
};
var safeAriaLabel = (...texts) => {
let ariaLabel = " ";
for (const text of texts) {
if (typeof text === "string" && text.length > 0) {
ariaLabel = text;
break;
}
}
return ariaLabel;
};
export {
safeAriaLabel,
safeInitials,
safeText
};
@@ -0,0 +1 @@
{"name":"minimatch","version":"9.0.5","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532096494,"integrity":"sha512-wTfnc8s4Ray5d2LQ5WOrwpjTCiFgbWQCejR55GCiahxw1tnmV7UJMUH+GfoXlvcmjn+hdzfOaV/0kbit9GNBJA==","mode":420,"size":775},"dist/commonjs/assert-valid-pattern.js":{"checkedAt":1794532096494,"integrity":"sha512-a8Rc1kYBB6pmfOwXDlMY5DuRwuDYXJoWJQ+xy4XsQUIKhD9Vo8q99GDx57gZNIgoex6YBkGniWFooc7MAGufSg==","mode":420,"size":492},"dist/esm/assert-valid-pattern.js":{"checkedAt":1794532096494,"integrity":"sha512-jNueGz4Tz93IzbNSKtEvGde/72E+wspDmrHy5nbqEuLFEDLdESNuaVp+bDVwxH1vKzovoUttHkiwF7gWNog0ig==","mode":420,"size":336},"dist/commonjs/ast.js":{"checkedAt":1794532096494,"integrity":"sha512-FRgIpeuLA6M0vu+C/5dZE9/JtXlYoKk70+gMWtgSI6rGgtIZUJmRb0cK52oz5vkQ3w/Mr9m+44H2veXznzPHug==","mode":420,"size":22822},"dist/esm/ast.js":{"checkedAt":1794532096494,"integrity":"sha512-jFhrx9ryLCuWiDudI+qnYI+UM3vtAmrbHpgsnXA3iPlQcJPEY+AW2H6Os3DJcU9t/+aWK+j2BygS9iAHjQPTVQ==","mode":420,"size":22588},"dist/commonjs/brace-expressions.js":{"checkedAt":1794532096494,"integrity":"sha512-Bru5VbrTcS3i0H2TiPw4kW8n1TTjtvzK3zlvRFxG0XQvWFwJh9JfNo/tOao+d5TyGvJOtssNubPHDem5ozH7cQ==","mode":420,"size":5763},"dist/esm/brace-expressions.js":{"checkedAt":1794532096495,"integrity":"sha512-7foQzaG2CQihRczW0qAu6U70+vPmCepgjk7ZeCkFE20Anky37mZoSEuIAGLN2b9Sviqa03GExTn2EwhwnRrh+g==","mode":420,"size":5631},"dist/commonjs/escape.js":{"checkedAt":1794532096495,"integrity":"sha512-M0YjKsGLZRG+gJV+/q9zhcB6OswDbiqlSrOLV/AjyOd2mTeqo1lsE8MwqJTU8OdCfuHtDafB5Ot1NLN7jxtAog==","mode":420,"size":968},"dist/esm/escape.js":{"checkedAt":1794532096495,"integrity":"sha512-tHYvgdwzprrbGYMq4UWk8XaMlhUpLy2x7P66m3iDmHjW0DI+ubPuOuiwjkXmuHHgT0OpZNH+mZ9uBcIJ/FPaEQ==","mode":420,"size":848},"dist/commonjs/index.js":{"checkedAt":1794532096495,"integrity":"sha512-EJg5cuVt610taWhwvRHhGZcAT+ap1q+0glXadeblpRbjUQ0Hr3YJns6WG8fdRLLWs/koY0m62knZR323EkOTWw==","mode":420,"size":40557},"dist/esm/index.js":{"checkedAt":1794532096495,"integrity":"sha512-yy0aOmH+P96YcVhnUWKAU/N2l7IJMovltr8P9DPqvXUvH99bz22f8ftd2/QA1LgS9tbtLxsNL6BJPMzeKGDGzg==","mode":420,"size":39098},"dist/commonjs/unescape.js":{"checkedAt":1794532096495,"integrity":"sha512-kjJulObJld65HIWzPMdLElqKTvb1vNUDx4u6QUMz1nTnmTE6+L7qNIq+xqc1d3ye0BCsHPuOIQTPlGGmPvbDsA==","mode":420,"size":973},"dist/esm/unescape.js":{"checkedAt":1794532096495,"integrity":"sha512-BCV8M4A0gZDdrcs23RlVwIW5HE+bujic7CwRJFD+ODBQauhX+DhUO3Mc7w/R3fdJ4iTJ8dAIKh0N0A7lR45yrw==","mode":420,"size":847},"dist/commonjs/package.json":{"checkedAt":1794532096496,"integrity":"sha512-bFiTnaWPm3Fik6gyj3o2SbbiQr8jX64ABVoMx5+yeI5Kmd+qQi4M+tvoTg1eM7g29oYn5qQJZUh37cRDuU0ExA==","mode":420,"size":25},"dist/esm/package.json":{"checkedAt":1794532096496,"integrity":"sha512-nTI0IMxjxr7nncxdtfDxj2uOBz2q+P+lRZ4R8t5ZqfXowXjXf6kq/J3dNSYj3sNixi//hZxxovq5Px4hcsSYfw==","mode":420,"size":23},"package.json":{"checkedAt":1794532096496,"integrity":"sha512-5X1d3/4GN4QkCabvWQaz89SialTKzswMLbNkEVMrZ5shp+73w6Hv5nOzl7n99Mvn30h1THmyf9JqkHD7rtD0Fg==","mode":420,"size":2003},"dist/commonjs/assert-valid-pattern.d.ts.map":{"checkedAt":1794532096496,"integrity":"sha512-Fy5KNfXg7XjXzkULBfz9O2OhNtca0pkoMPZQJ3Eq6RHPwW4RdBgSu15wMCJJF6kO8MQgvHdeLbSL+85j+V26Og==","mode":420,"size":199},"dist/esm/assert-valid-pattern.d.ts.map":{"checkedAt":1794532096496,"integrity":"sha512-Fy5KNfXg7XjXzkULBfz9O2OhNtca0pkoMPZQJ3Eq6RHPwW4RdBgSu15wMCJJF6kO8MQgvHdeLbSL+85j+V26Og==","mode":420,"size":199},"dist/commonjs/assert-valid-pattern.js.map":{"checkedAt":1794532096496,"integrity":"sha512-N76agnGonZYLLEGi5ILcYNcpWOxf92+Ty9EW+gWaPL21a76BJtJg9zwvg9qyAT+BG7juj+PZLgrHDJopXrig2g==","mode":420,"size":802},"dist/esm/assert-valid-pattern.js.map":{"checkedAt":1794532096496,"integrity":"sha512-8B6+obMpuLoRPy3F/39Q7m5vFoif2Qv9WbH1bWaD3gTu2XN0Z1dxh2WEj0CaT1VWijImiFvdZ+seG0gKedAIqQ==","mode":420,"size":785},"dist/commonjs/ast.d.ts.map":{"checkedAt":1794532096496,"integrity":"sha512-Xm2pmtjb1+fyAlmo7xHBLa/BWzKWBXSsecrO6+pGqOtmU2GyvK7wEmOAPuzSqzc+pv8byWoioBbta4B8tkOhOA==","mode":420,"size":868},"dist/esm/ast.d.ts.map":{"checkedAt":1794532096496,"integrity":"sha512-Xm2pmtjb1+fyAlmo7xHBLa/BWzKWBXSsecrO6+pGqOtmU2GyvK7wEmOAPuzSqzc+pv8byWoioBbta4B8tkOhOA==","mode":420,"size":868},"dist/commonjs/ast.js.map":{"checkedAt":1794532096496,"integrity":"sha512-jU9Y3RUv+xe0pGoBfq3+YbBZyaB093X9FBfJWEfmz6pI88XpzDf+cLPzB62klx/llD6WFjBdzUStoga9Mb4ILQ==","mode":420,"size":40021},"dist/esm/ast.js.map":{"checkedAt":1794532096497,"integrity":"sha512-V3Tk8VLEbVi5JejIDaKM+Z5h/XfLRx8zs2hgwoUrb84LifeQ71GNftCjd0h1dzkmUFxTnGmwDnvzLdgkLA39Ew==","mode":420,"size":40036},"dist/commonjs/brace-expressions.d.ts.map":{"checkedAt":1794532096497,"integrity":"sha512-EgM0uhlY9QPpotfj1xoxeWyAsghr1Kc7XLOKAXZVrFNSHQ2WcYJbbxMMxQ3O0wvt0XNvARQ0ry8t9FBCz6O/6A==","mode":420,"size":304},"dist/esm/brace-expressions.d.ts.map":{"checkedAt":1794532096497,"integrity":"sha512-EgM0uhlY9QPpotfj1xoxeWyAsghr1Kc7XLOKAXZVrFNSHQ2WcYJbbxMMxQ3O0wvt0XNvARQ0ry8t9FBCz6O/6A==","mode":420,"size":304Line truncated
@@ -0,0 +1,24 @@
# @heroui/divider
Divider is a component that separates content in a page.
Please refer to the [documentation](https://heroui.com/docs/components/divider) for more information.
## Installation
```sh
yarn add @heroui/divider
# or
npm i @heroui/divider
```
## Contribution
Yes please! See the
[contributing guidelines](https://github.com/frontio-ai/heroui/blob/master/CONTRIBUTING.md)
for details.
## License
This project is licensed under the terms of the
[MIT license](https://github.com/frontio-ai/heroui/blob/master/LICENSE).
@@ -0,0 +1,101 @@
/* eslint-env mocha */
import assert from 'assert';
import includes from 'array-includes';
import eventHandlers, { eventHandlersByType } from '../../src/eventHandlers';
describe('eventHandlers', () => {
it('should contain a list of common JSX event handlers', () => {
assert([
'onCopy',
'onCut',
'onPaste',
'onCompositionEnd',
'onCompositionStart',
'onCompositionUpdate',
'onKeyDown',
'onKeyPress',
'onKeyUp',
'onFocus',
'onBlur',
'onChange',
'onInput',
'onSubmit',
'onClick',
'onContextMenu',
'onDblClick',
'onDoubleClick',
'onDrag',
'onDragEnd',
'onDragEnter',
'onDragExit',
'onDragLeave',
'onDragOver',
'onDragStart',
'onDrop',
'onMouseDown',
'onMouseEnter',
'onMouseLeave',
'onMouseMove',
'onMouseOut',
'onMouseOver',
'onMouseUp',
'onSelect',
'onTouchCancel',
'onTouchEnd',
'onTouchMove',
'onTouchStart',
'onScroll',
'onWheel',
'onAbort',
'onCanPlay',
'onCanPlayThrough',
'onDurationChange',
'onEmptied',
'onEncrypted',
'onEnded',
'onError',
'onLoadedData',
'onLoadedMetadata',
'onLoadStart',
'onPause',
'onPlay',
'onPlaying',
'onProgress',
'onRateChange',
'onSeeked',
'onSeeking',
'onStalled',
'onSuspend',
'onTimeUpdate',
'onVolumeChange',
'onWaiting',
'onLoad',
'onError',
'onAnimationStart',
'onAnimationEnd',
'onAnimationIteration',
'onTransitionEnd',
].every((handlerName) => includes(eventHandlers, handlerName)));
});
});
describe('eventHandlersByType', () => {
it('should be keyed by type', () => {
assert([
'clipboard',
'composition',
'keyboard',
'focus',
'form',
'mouse',
'selection',
'touch',
'ui',
'wheel',
'media',
'image',
'animation',
'transition',
].every((type) => !!eventHandlersByType[type]));
});
});
@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _objectWithoutProperties;
var _objectWithoutPropertiesLoose = require("./objectWithoutPropertiesLoose.js");
function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = (0, _objectWithoutPropertiesLoose.default)(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) !== -1) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
//# sourceMappingURL=objectWithoutProperties.js.map
@@ -0,0 +1,12 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"id-length": 0,
"max-lines-per-function": 0,
"multiline-comment-style": 1,
"new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }],
},
}
@@ -0,0 +1 @@
{"version":3,"file":"preDestroy.spec.d.ts","sourceRoot":"","sources":["../../../../src/metadata/decorators/preDestroy.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,58 @@
'use strict';
import toFormData from './toFormData.js';
/**
* It encodes a string by replacing all characters that are not in the unreserved set with
* their percent-encoded equivalents
*
* @param {string} str - The string to encode.
*
* @returns {string} The encoded string.
*/
function encode(str) {
const charMap = {
'!': '%21',
"'": '%27',
'(': '%28',
')': '%29',
'~': '%7E',
'%20': '+',
'%00': '\x00'
};
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
return charMap[match];
});
}
/**
* It takes a params object and converts it to a FormData object
*
* @param {Object<string, any>} params - The parameters to be converted to a FormData object.
* @param {Object<string, any>} options - The options object passed to the Axios constructor.
*
* @returns {void}
*/
function AxiosURLSearchParams(params, options) {
this._pairs = [];
params && toFormData(params, this, options);
}
const prototype = AxiosURLSearchParams.prototype;
prototype.append = function append(name, value) {
this._pairs.push([name, value]);
};
prototype.toString = function toString(encoder) {
const _encode = encoder ? function(value) {
return encoder.call(this, value, encode);
} : encode;
return this._pairs.map(function each(pair) {
return _encode(pair[0]) + '=' + _encode(pair[1]);
}, '').join('&');
};
export default AxiosURLSearchParams;
@@ -0,0 +1 @@
{"name":"string.prototype.trimend","version":"1.0.9","requiresBuild":false,"files":{".editorconfig":{"checkedAt":1794532097382,"integrity":"sha512-gD3iQtgC7ZgFS97pyZqR0FPjMNyRAfat8dipbSL28iiJ6B1MP5dDeDYeEnP5sYMTz8whQIk3E5vltk2kcyJJEQ==","mode":420,"size":286},".eslintrc":{"checkedAt":1794532097382,"integrity":"sha512-VX5h4KYPUk/60YDe88/JOL/KEIq3w4/KRWV2lMhhR0B8fNgZMrnW0qfK9AbGfUQ5qHTKhWrpsoRB2AgBpiy9ZA==","mode":420,"size":295},".nycrc":{"checkedAt":1794532097382,"integrity":"sha512-2vm1RFz8Ajl/OYrfoCWPJIm3Bpnf7Gyn5bha/lZx/cq+We3uMy9xj15XeP6x4wF3jf/pO7KMHAkU9mllm605xg==","mode":420,"size":139},"LICENSE":{"checkedAt":1794532097382,"integrity":"sha512-H02Tjxpuy9eBjZl1pN0vTzFJc8We+8STkC4VFz+NcFbtCW4a+nVLOy4kYuRlQFAvO46EYcbDB9C3dJ9PD3s0zg==","mode":420,"size":1073},"auto.js":{"checkedAt":1794532096427,"integrity":"sha512-8Q3Im5cACiIFrMmxvLnJnA8SXOjAd1kh/R0UIDVnErDD1WUlJIDrNfaOcIB6rtjAXNhq/OdL1374JM/QcAJ1VQ==","mode":420,"size":36},"implementation.js":{"checkedAt":1794532097382,"integrity":"sha512-7WekCPD3+Bbp0QtdnWQwx/QCUPwIiZqdLVZFRtNecEcZdUCQgIU15EU1aavZhkvdQxgBsBJjeECyFQRPd0sxDg==","mode":420,"size":635},"test/implementation.js":{"checkedAt":1794532096428,"integrity":"sha512-JVgZ475qHrp+7T5MQ8DPUnl1KEDRSb6XNvWVNHBfUl1zDcoltosZk+r5LZfXwAYgu6V002a4EwqLca+bH3g29A==","mode":420,"size":637},"index.js":{"checkedAt":1794532097382,"integrity":"sha512-uwyPmwcvAoDWvvufOyUJSWhh3sTYQmtOTnogTiIDeSkOt5v+pa81MWvHMfQlCCn2YFARHvX3kHAzJXQe0mwn6Q==","mode":420,"size":572},"test/index.js":{"checkedAt":1794532097382,"integrity":"sha512-RPtEGNip5+6CGXIqTdATElQRhrWMQ0hmVk2AVf1kuE6jtv8MS05kbuFqyYVF82rjLVs1JpFOaD9v0F4l6yJHWA==","mode":420,"size":438},"polyfill.js":{"checkedAt":1794532097382,"integrity":"sha512-GL/skutbgGRtUrsxUGlzA8RmD+gdH9aCxUDyFsCVspt+7tgVr5vUdI5IH976pUSS9fRuSKdHjvBxYHLe86JtgQ==","mode":420,"size":458},"shim.js":{"checkedAt":1794532097383,"integrity":"sha512-Cb18i55YWHlgUIpNUcl7UUE0q0BgWcifT88z8NqD6Ffu54t/8iZk0iey8tg8ORxHYONikQxPWlDBU+A4NFtaeQ==","mode":420,"size":329},"test/shimmed.js":{"checkedAt":1794532097383,"integrity":"sha512-AB/FnNAid5WZNjva9MaN2/mVNy2X4YS3aWotgPnj/wRGzDQ6HDRRDR0VVAz+cmzLKWOzyctS16E1LU5JbFxVsw==","mode":420,"size":1351},"test/tests.js":{"checkedAt":1794532097383,"integrity":"sha512-erBc1UaCh5B3TOv9y+jDjDdwRBLLUms9eJjTmEWXQMLUWgjvBQozX9/xCViK4PZDg4/zNVOObextFC7kNi6G+Q==","mode":420,"size":1293},"package.json":{"checkedAt":1794532097383,"integrity":"sha512-raNDpRZ+x2lch9EFnBfpoTiTQ2QwPkFvEeHcRwmNQxZDdNjn2gmX1Zr4hgOv16lDn980prdEdl7HIG9cHRhM5g==","mode":420,"size":2098},"CHANGELOG.md":{"checkedAt":1794532097383,"integrity":"sha512-qJDEdLgrI/hFVWKo7Wk2q3UbosBQxs23KOziiPFuXJud00aTZIfgq0qEL71PINf3yoDDVgEpsBm16u91tEvqww==","mode":420,"size":11584},"README.md":{"checkedAt":1794532097383,"integrity":"sha512-qIGJaeqgtdq06UhB8Xhwm1GmchgqrjUXZKw5kVRpjkcSconmOnDWRjrwlO6YTSozzZFh2cRCgtR+x/yIb/zvPw==","mode":420,"size":2358}}}
@@ -0,0 +1,271 @@
# Parchment [![Build Status](https://github.com/quilljs/parchment/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/quilljs/parchment/actions?query=branch%3Amain)
Parchment is [Quill](https://quilljs.com)'s document model. It is a parallel tree structure to the DOM tree, and provides functionality useful for content editors, like Quill. A Parchment tree is made up of [Blots](#blots), which mirror a DOM node counterpart. Blots can provide structure, formatting, and/or content. [Attributors](#attributors) can also provide lightweight formatting information.
**Note:** You should never instantiate a Blot yourself with `new`. This may prevent necessary lifecycle functionality of a Blot. Use the [Registry](#registry)'s `create()` method instead.
`npm install parchment`
See [Cloning Medium with Parchment](https://quilljs.com/guides/cloning-medium-with-parchment/) for a guide on how Quill uses Parchment its document model.
## Blots
Blots are the basic building blocks of a Parchment document. Several basic implementations such as [Block](#block-blot), [Inline](#inline-blot), and [Embed](#embed-blot) are provided. In general you will want to extend one of these, instead of building from scratch. After implementation, blots need to be [registered](#registry) before usage.
At the very minimum a Blot must be named with a static `blotName` and associated with either a `tagName` or `className`. If a Blot is defined with both a tag and class, the class takes precedence, but the tag may be used as a fallback. Blots must also have a [scope](#registry), which determine if it is inline or block.
```typescript
class Blot {
static blotName: string;
static className: string;
static tagName: string | string[];
static scope: Scope;
domNode: Node;
prev: Blot | null;
next: Blot | null;
parent: Blot;
// Creates corresponding DOM node
static create(value?: any): Node;
constructor(domNode: Node, value?: any);
// For leaves, length of blot's value()
// For parents, sum of children's values
length(): Number;
// Manipulate at given index and length, if applicable.
// Will often pass call onto appropriate child.
deleteAt(index: number, length: number);
formatAt(index: number, length: number, format: string, value: any);
insertAt(index: number, text: string);
insertAt(index: number, embed: string, value: any);
// Returns offset between this blot and an ancestor's
offset(ancestor: Blot = this.parent): number;
// Called after update cycle completes. Cannot change the value or length
// of the document, and any DOM operation must reduce complexity of the DOM
// tree. A shared context object is passed through all blots.
optimize(context: { [key: string]: any }): void;
// Called when blot changes, with the mutation records of its change.
// Internal records of the blot values can be updated, and modifications of
// the blot itself is permitted. Can be trigger from user change or API call.
// A shared context object is passed through all blots.
update(mutations: MutationRecord[], context: { [key: string]: any });
/** Leaf Blots only **/
// Returns the value represented by domNode if it is this Blot's type
// No checking that domNode can represent this Blot type is required so
// applications needing it should check externally before calling.
static value(domNode): any;
// Given location represented by node and offset from DOM Selection Range,
// return index to that location.
index(node: Node, offset: number): number;
// Given index to location within blot, return node and offset representing
// that location, consumable by DOM Selection Range
position(index: number, inclusive: boolean): [Node, number];
// Return value represented by this blot
// Should not change without interaction from API or
// user change detectable by update()
value(): any;
/** Parent blots only **/
// Whitelist array of Blots that can be direct children.
static allowedChildren: Registry.BlotConstructor[];
// Default child blot to be inserted if this blot becomes empty.
static defaultChild: Registry.BlotConstructor;
children: LinkedList<Blot>;
// Called during construction, should fill its own children LinkedList.
build();
// Useful search functions for descendant(s), should not modify
descendant(type: BlotClass, index: number, inclusive): Blot;
descendants(type: BlotClass, index: number, length: number): Blot[];
/** Formattable blots only **/
// Returns format values represented by domNode if it is this Blot's type
// No checking that domNode is this Blot's type is required.
static formats(domNode: Node);
// Apply format to blot. Should not pass onto child or other blot.
format(format: name, value: any);
// Return formats represented by blot, including from Attributors.
formats(): Object;
}
```
### Example
Implementation for a Blot representing a link, which is a parent, inline scoped, and formattable.
```typescript
import { InlineBlot, register } from 'parchment';
class LinkBlot extends InlineBlot {
static blotName = 'link';
static tagName = 'A';
static create(url) {
let node = super.create();
node.setAttribute('href', url);
node.setAttribute('target', '_blank');
node.setAttribute('title', node.textContent);
return node;
}
static formats(domNode) {
return domNode.getAttribute('href') || true;
}
format(name, value) {
if (name === 'link' && value) {
this.domNode.setAttribute('href', value);
} else {
super.format(name, value);
}
}
formats() {
let formats = super.formats();
formats['link'] = LinkBlot.formats(this.domNode);
return formats;
}
}
register(LinkBlot);
```
Quill also provides many great example implementations in its [source code](https://github.com/quilljs/quill/tree/develop/packages/quill/src/formats).
### Block Blot
Basic implementation of a block scoped formattable parent Blot. Formatting a block blot by default will replace the appropriate subsection of the blot.
### Inline Blot
Basic implementation of an inline scoped formattable parent Blot. Formatting an inline blot by default either wraps itself with another blot or passes the call to the appropriate child.
### Embed Blot
Basic implementation of a non-text leaf blot, that is formattable. Its corresponding DOM node will often be a [Void Element](https://www.w3.org/TR/html5/syntax.html#void-elements), but can be a [Normal Element](https://www.w3.org/TR/html5/syntax.html#normal-elements). In these cases Parchment will not manipulate or generally be aware of the element's children, and it will be important to correctly implement the blot's `index()` and `position()` functions to correctly work with cursors/selections.
### Scroll
The root parent blot of a Parchment document. It is not formattable.
## Attributors
Attributors are the alternative, more lightweight, way to represent formats. Their DOM counterpart is an [Attribute](https://www.w3.org/TR/html5/syntax.html#attributes-0). Like a DOM attribute's relationship to a node, Attributors are meant to belong to Blots. Calling `formats()` on an [Inline](#inline-blot) or [Block](#block-blot) blot will return both the format of the corresponding DOM node represents (if any) and the formats the DOM node's attributes represent (if any).
Attributors have the following interface:
```typescript
class Attributor {
attrName: string;
keyName: string;
scope: Scope;
whitelist: string[];
constructor(attrName: string, keyName: string, options: Object = {});
add(node: HTMLElement, value: string): boolean;
canAdd(node: HTMLElement, value: string): boolean;
remove(node: HTMLElement);
value(node: HTMLElement);
}
```
Note custom attributors are instances, rather than class definitions like Blots. Similar to Blots, instead of creating from scratch, you will probably want to use existing Attributor implementations, such as the base [Attributor](#attributor), [Class Attributor](#class-attributor) or [Style Attributor](#style-attributor).
The implementation for Attributors is surprisingly simple, and its [source code](https://github.com/quilljs/parchment/tree/main/src/attributor) may be another source of understanding.
### Attributor
Uses a plain attribute to represent formats.
```js
import { Attributor, register } from 'parchment';
let Width = new Attributor('width', 'width');
register(Width);
let imageNode = document.createElement('img');
Width.add(imageNode, '10px');
console.log(imageNode.outerHTML); // Will print <img width="10px">
Width.value(imageNode); // Will return 10px
Width.remove(imageNode);
console.log(imageNode.outerHTML); // Will print <img>
```
### Class Attributor
Uses a class name pattern to represent formats.
```js
import { ClassAttributor, register } from 'parchment';
let Align = new ClassAttributor('align', 'blot-align');
register(Align);
let node = document.createElement('div');
Align.add(node, 'right');
console.log(node.outerHTML); // Will print <div class="blot-align-right"></div>
```
### Style Attributor
Uses inline styles to represent formats.
```js
import { StyleAttributor, register } from 'parchment';
let Align = new StyleAttributor('align', 'text-align', {
whitelist: ['right', 'center', 'justify'], // Having no value implies left align
});
register(Align);
let node = document.createElement('div');
Align.add(node, 'right');
console.log(node.outerHTML); // Will print <div style="text-align: right;"></div>
```
## Registry
All methods are accessible from Parchment ex. `Parchment.create('bold')`.
```typescript
// Creates a blot given a name or DOM node.
// When given just a scope, creates blot the same name as scope
create(domNode: Node, value?: any): Blot;
create(blotName: string, value?: any): Blot;
create(scope: Scope): Blot;
// Given DOM node, find corresponding Blot.
// Bubbling is useful when searching for a Embed Blot with its corresponding
// DOM node's descendant nodes.
find(domNode: Node, bubble: boolean = false): Blot;
// Search for a Blot or Attributor
// When given just a scope, finds blot with same name as scope
query(tagName: string, scope: Scope = Scope.ANY): BlotClass;
query(blotName: string, scope: Scope = Scope.ANY): BlotClass;
query(domNode: Node, scope: Scope = Scope.ANY): BlotClass;
query(scope: Scope): BlotClass;
query(attributorName: string, scope: Scope = Scope.ANY): Attributor;
// Register Blot class definition or Attributor instance
register(BlotClass | Attributor);
```
@@ -0,0 +1,72 @@
"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/skeleton.tsx
var skeleton_exports = {};
__export(skeleton_exports, {
default: () => skeleton_default
});
module.exports = __toCommonJS(skeleton_exports);
var import_system3 = require("@heroui/system");
// src/use-skeleton.ts
var import_system = require("@heroui/system");
var import_theme = require("@heroui/theme");
var import_shared_utils = require("@heroui/shared-utils");
var import_react = require("react");
var import_system2 = require("@heroui/system");
function useSkeleton(originalProps) {
var _a, _b;
const globalContext = (0, import_system2.useProviderContext)();
const [props, variantProps] = (0, import_system.mapPropsVariants)(originalProps, import_theme.skeleton.variantKeys);
const { as, children, isLoaded = false, className, classNames, ...otherProps } = props;
const Component = as || "div";
const disableAnimation = (_b = (_a = originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;
const slots = (0, import_react.useMemo)(
() => (0, import_theme.skeleton)({
...variantProps,
disableAnimation
}),
[(0, import_shared_utils.objectToDeps)(variantProps), disableAnimation, children]
);
const baseStyles = (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.base, className);
const getSkeletonProps = (props2 = {}) => {
return {
"data-loaded": (0, import_shared_utils.dataAttr)(isLoaded),
className: slots.base({ class: (0, import_shared_utils.clsx)(baseStyles, props2 == null ? void 0 : props2.className) }),
...otherProps
};
};
const getContentProps = (props2 = {}) => {
return {
className: slots.content({ class: (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.content, props2 == null ? void 0 : props2.className) })
};
};
return { Component, children, slots, classNames, getSkeletonProps, getContentProps };
}
// src/skeleton.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var Skeleton = (0, import_system3.forwardRef)((props, ref) => {
const { Component, children, getSkeletonProps, getContentProps } = useSkeleton({ ...props });
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ref, ...getSkeletonProps(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...getContentProps(), children }) });
});
Skeleton.displayName = "HeroUI.Skeleton";
var skeleton_default = Skeleton;
@@ -0,0 +1 @@
{"version":3,"file":"isDestructuredFromPragmaImport.d.ts","sourceRoot":"","sources":["isDestructuredFromPragmaImport.js"],"names":[],"mappings":"AAciB,mCALN,OAAO,QACP,OAAO,YACP,MAAM,mBACJ,OAAO,CAmEnB"}
@@ -0,0 +1,46 @@
import { Scalar } from '../../nodes/Scalar.js';
import { stringifyNumber } from '../../stringify/stringifyNumber.js';
const floatNaN = {
identify: value => typeof value === 'number',
default: true,
tag: 'tag:yaml.org,2002:float',
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
resolve: (str) => str.slice(-3).toLowerCase() === 'nan'
? NaN
: str[0] === '-'
? Number.NEGATIVE_INFINITY
: Number.POSITIVE_INFINITY,
stringify: stringifyNumber
};
const floatExp = {
identify: value => typeof value === 'number',
default: true,
tag: 'tag:yaml.org,2002:float',
format: 'EXP',
test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
resolve: (str) => parseFloat(str.replace(/_/g, '')),
stringify(node) {
const num = Number(node.value);
return isFinite(num) ? num.toExponential() : stringifyNumber(node);
}
};
const float = {
identify: value => typeof value === 'number',
default: true,
tag: 'tag:yaml.org,2002:float',
test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
resolve(str) {
const node = new Scalar(parseFloat(str.replace(/_/g, '')));
const dot = str.indexOf('.');
if (dot !== -1) {
const f = str.substring(dot + 1).replace(/_/g, '');
if (f[f.length - 1] === '0')
node.minFractionDigits = f.length;
}
return node;
},
stringify: stringifyNumber
};
export { float, floatExp, floatNaN };
@@ -0,0 +1,176 @@
"use strict";
// Description of supported double byte encodings and aliases.
// Tables are not require()-d until they are needed to speed up library load.
// require()-s are direct to support Browserify.
module.exports = {
// == Japanese/ShiftJIS ====================================================
// All japanese encodings are based on JIS X set of standards:
// JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.
// JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes.
// Has several variations in 1978, 1983, 1990 and 1997.
// JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead.
// JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233.
// 2 planes, first is superset of 0208, second - revised 0212.
// Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx)
// Byte encodings are:
// * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte
// encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC.
// Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI.
// * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes.
// 0x00-0x7F - lower part of 0201
// 0x8E, 0xA1-0xDF - upper part of 0201
// (0xA1-0xFE)x2 - 0208 plane (94x94).
// 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94).
// * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon.
// Used as-is in ISO2022 family.
// * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII,
// 0201-1976 Roman, 0208-1978, 0208-1983.
// * ISO2022-JP-1: Adds esc seq for 0212-1990.
// * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7.
// * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2.
// * ISO2022-JP-2004: Adds 0213-2004 Plane 1.
//
// After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes.
//
// Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html
'shiftjis': {
type: '_dbcs',
table: function() { return require('./tables/shiftjis.json') },
encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
encodeSkipVals: [{from: 0xED40, to: 0xF940}],
},
'csshiftjis': 'shiftjis',
'mskanji': 'shiftjis',
'sjis': 'shiftjis',
'windows31j': 'shiftjis',
'ms31j': 'shiftjis',
'xsjis': 'shiftjis',
'windows932': 'shiftjis',
'ms932': 'shiftjis',
'932': 'shiftjis',
'cp932': 'shiftjis',
'eucjp': {
type: '_dbcs',
table: function() { return require('./tables/eucjp.json') },
encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
},
// TODO: KDDI extension to Shift_JIS
// TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes.
// TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars.
// == Chinese/GBK ==========================================================
// http://en.wikipedia.org/wiki/GBK
// We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder
// Oldest GB2312 (1981, ~7600 chars) is a subset of CP936
'gb2312': 'cp936',
'gb231280': 'cp936',
'gb23121980': 'cp936',
'csgb2312': 'cp936',
'csiso58gb231280': 'cp936',
'euccn': 'cp936',
// Microsoft's CP936 is a subset and approximation of GBK.
'windows936': 'cp936',
'ms936': 'cp936',
'936': 'cp936',
'cp936': {
type: '_dbcs',
table: function() { return require('./tables/cp936.json') },
},
// GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.
'gbk': {
type: '_dbcs',
table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },
},
'xgbk': 'gbk',
'isoir58': 'gbk',
// GB18030 is an algorithmic extension of GBK.
// Main source: https://www.w3.org/TR/encoding/#gbk-encoder
// http://icu-project.org/docs/papers/gb18030.html
// http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml
// http://www.khngai.com/chinese/charmap/tblgbk.php?page=0
'gb18030': {
type: '_dbcs',
table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },
gb18030: function() { return require('./tables/gb18030-ranges.json') },
encodeSkipVals: [0x80],
encodeAdd: {'€': 0xA2E3},
},
'chinese': 'gb18030',
// == Korean ===============================================================
// EUC-KR, KS_C_5601 and KS X 1001 are exactly the same.
'windows949': 'cp949',
'ms949': 'cp949',
'949': 'cp949',
'cp949': {
type: '_dbcs',
table: function() { return require('./tables/cp949.json') },
},
'cseuckr': 'cp949',
'csksc56011987': 'cp949',
'euckr': 'cp949',
'isoir149': 'cp949',
'korean': 'cp949',
'ksc56011987': 'cp949',
'ksc56011989': 'cp949',
'ksc5601': 'cp949',
// == Big5/Taiwan/Hong Kong ================================================
// There are lots of tables for Big5 and cp950. Please see the following links for history:
// http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html
// Variations, in roughly number of defined chars:
// * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
// * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/
// * Big5-2003 (Taiwan standard) almost superset of cp950.
// * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers.
// * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard.
// many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years.
// Plus, it has 4 combining sequences.
// Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299
// because big5-hkscs is the only encoding to include astral characters in non-algorithmic way.
// Implementations are not consistent within browsers; sometimes labeled as just big5.
// MS Internet Explorer switches from big5 to big5-hkscs when a patch applied.
// Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31
// In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s.
// Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt
// http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt
//
// Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder
// Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong.
'windows950': 'cp950',
'ms950': 'cp950',
'950': 'cp950',
'cp950': {
type: '_dbcs',
table: function() { return require('./tables/cp950.json') },
},
// Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus.
'big5': 'big5hkscs',
'big5hkscs': {
type: '_dbcs',
table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) },
encodeSkipVals: [0xa2cc],
},
'cnbig5': 'big5hkscs',
'csbig5': 'big5hkscs',
'xxbig5': 'big5hkscs',
};
@@ -0,0 +1,29 @@
import capitalize from './capitalize.js';
import createCompounder from './_createCompounder.js';
/**
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the camel cased string.
* @example
*
* _.camelCase('Foo Bar');
* // => 'fooBar'
*
* _.camelCase('--foo-bar--');
* // => 'fooBar'
*
* _.camelCase('__FOO_BAR__');
* // => 'fooBar'
*/
var camelCase = createCompounder(function(result, word, index) {
word = word.toLowerCase();
return result + (index ? capitalize(word) : word);
});
export default camelCase;
@@ -0,0 +1,2 @@
// Note: types exported from `index.d.ts`
export {CONTINUE, EXIT, SKIP, visitParents} from './lib/index.js'
@@ -0,0 +1,480 @@
/**
* URI.js
*
* @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.
* @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
* @see http://github.com/garycourt/uri-js
*/
/**
* Copyright 2011 Gary Court. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of Gary Court.
*/
import URI_PROTOCOL from "./regexps-uri";
import IRI_PROTOCOL from "./regexps-iri";
import punycode from "punycode";
import { toUpperCase, typeOf, assign } from "./util";
export const SCHEMES = {};
export function pctEncChar(chr) {
const c = chr.charCodeAt(0);
let e;
if (c < 16)
e = "%0" + c.toString(16).toUpperCase();
else if (c < 128)
e = "%" + c.toString(16).toUpperCase();
else if (c < 2048)
e = "%" + ((c >> 6) | 192).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase();
else
e = "%" + ((c >> 12) | 224).toString(16).toUpperCase() + "%" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase();
return e;
}
export function pctDecChars(str) {
let newStr = "";
let i = 0;
const il = str.length;
while (i < il) {
const c = parseInt(str.substr(i + 1, 2), 16);
if (c < 128) {
newStr += String.fromCharCode(c);
i += 3;
}
else if (c >= 194 && c < 224) {
if ((il - i) >= 6) {
const c2 = parseInt(str.substr(i + 4, 2), 16);
newStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
}
else {
newStr += str.substr(i, 6);
}
i += 6;
}
else if (c >= 224) {
if ((il - i) >= 9) {
const c2 = parseInt(str.substr(i + 4, 2), 16);
const c3 = parseInt(str.substr(i + 7, 2), 16);
newStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
}
else {
newStr += str.substr(i, 9);
}
i += 9;
}
else {
newStr += str.substr(i, 3);
i += 3;
}
}
return newStr;
}
function _normalizeComponentEncoding(components, protocol) {
function decodeUnreserved(str) {
const decStr = pctDecChars(str);
return (!decStr.match(protocol.UNRESERVED) ? str : decStr);
}
if (components.scheme)
components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, "");
if (components.userinfo !== undefined)
components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
if (components.host !== undefined)
components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
if (components.path !== undefined)
components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
if (components.query !== undefined)
components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
if (components.fragment !== undefined)
components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
return components;
}
;
function _stripLeadingZeros(str) {
return str.replace(/^0*(.*)/, "$1") || "0";
}
function _normalizeIPv4(host, protocol) {
const matches = host.match(protocol.IPV4ADDRESS) || [];
const [, address] = matches;
if (address) {
return address.split(".").map(_stripLeadingZeros).join(".");
}
else {
return host;
}
}
function _normalizeIPv6(host, protocol) {
const matches = host.match(protocol.IPV6ADDRESS) || [];
const [, address, zone] = matches;
if (address) {
const [last, first] = address.toLowerCase().split('::').reverse();
const firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
const lastFields = last.split(":").map(_stripLeadingZeros);
const isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
const fieldCount = isLastFieldIPv4Address ? 7 : 8;
const lastFieldsStart = lastFields.length - fieldCount;
const fields = Array(fieldCount);
for (let x = 0; x < fieldCount; ++x) {
fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';
}
if (isLastFieldIPv4Address) {
fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
}
const allZeroFields = fields.reduce((acc, field, index) => {
if (!field || field === "0") {
const lastLongest = acc[acc.length - 1];
if (lastLongest && lastLongest.index + lastLongest.length === index) {
lastLongest.length++;
}
else {
acc.push({ index, length: 1 });
}
}
return acc;
}, []);
const longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];
let newHost;
if (longestZeroFields && longestZeroFields.length > 1) {
const newFirst = fields.slice(0, longestZeroFields.index);
const newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
newHost = newFirst.join(":") + "::" + newLast.join(":");
}
else {
newHost = fields.join(":");
}
if (zone) {
newHost += "%" + zone;
}
return newHost;
}
else {
return host;
}
}
const URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
const NO_MATCH_IS_UNDEFINED = ("").match(/(){0}/)[1] === undefined;
export function parse(uriString, options = {}) {
const components = {};
const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);
if (options.reference === "suffix")
uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString;
const matches = uriString.match(URI_PARSE);
if (matches) {
if (NO_MATCH_IS_UNDEFINED) {
//store each component
components.scheme = matches[1];
components.userinfo = matches[3];
components.host = matches[4];
components.port = parseInt(matches[5], 10);
components.path = matches[6] || "";
components.query = matches[7];
components.fragment = matches[8];
//fix port number
if (isNaN(components.port)) {
components.port = matches[5];
}
}
else { //IE FIX for improper RegExp matching
//store each component
components.scheme = matches[1] || undefined;
components.userinfo = (uriString.indexOf("@") !== -1 ? matches[3] : undefined);
components.host = (uriString.indexOf("//") !== -1 ? matches[4] : undefined);
components.port = parseInt(matches[5], 10);
components.path = matches[6] || "";
components.query = (uriString.indexOf("?") !== -1 ? matches[7] : undefined);
components.fragment = (uriString.indexOf("#") !== -1 ? matches[8] : undefined);
//fix port number
if (isNaN(components.port)) {
components.port = (uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined);
}
}
if (components.host) {
//normalize IP hosts
components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);
}
//determine reference type
if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {
components.reference = "same-document";
}
else if (components.scheme === undefined) {
components.reference = "relative";
}
else if (components.fragment === undefined) {
components.reference = "absolute";
}
else {
components.reference = "uri";
}
//check for reference errors
if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) {
components.error = components.error || "URI is not a " + options.reference + " reference.";
}
//find scheme handler
const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
//check if scheme can't handle IRIs
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
//if host component is a domain name
if (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {
//convert Unicode IDN -> ASCII IDN
try {
components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
}
catch (e) {
components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e;
}
}
//convert IRI -> URI
_normalizeComponentEncoding(components, URI_PROTOCOL);
}
else {
//normalize encodings
_normalizeComponentEncoding(components, protocol);
}
//perform scheme specific parsing
if (schemeHandler && schemeHandler.parse) {
schemeHandler.parse(components, options);
}
}
else {
components.error = components.error || "URI can not be parsed.";
}
return components;
}
;
function _recomposeAuthority(components, options) {
const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);
const uriTokens = [];
if (components.userinfo !== undefined) {
uriTokens.push(components.userinfo);
uriTokens.push("@");
}
if (components.host !== undefined) {
//normalize IP hosts, add brackets and escape zone separator for IPv6
uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => "[" + $1 + ($2 ? "%25" + $2 : "") + "]"));
}
if (typeof components.port === "number" || typeof components.port === "string") {
uriTokens.push(":");
uriTokens.push(String(components.port));
}
return uriTokens.length ? uriTokens.join("") : undefined;
}
;
const RDS1 = /^\.\.?\//;
const RDS2 = /^\/\.(\/|$)/;
const RDS3 = /^\/\.\.(\/|$)/;
const RDS4 = /^\.\.?$/;
const RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
export function removeDotSegments(input) {
const output = [];
while (input.length) {
if (input.match(RDS1)) {
input = input.replace(RDS1, "");
}
else if (input.match(RDS2)) {
input = input.replace(RDS2, "/");
}
else if (input.match(RDS3)) {
input = input.replace(RDS3, "/");
output.pop();
}
else if (input === "." || input === "..") {
input = "";
}
else {
const im = input.match(RDS5);
if (im) {
const s = im[0];
input = input.slice(s.length);
output.push(s);
}
else {
throw new Error("Unexpected dot segment condition");
}
}
}
return output.join("");
}
;
export function serialize(components, options = {}) {
const protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);
const uriTokens = [];
//find scheme handler
const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
//perform scheme specific serialization
if (schemeHandler && schemeHandler.serialize)
schemeHandler.serialize(components, options);
if (components.host) {
//if host component is an IPv6 address
if (protocol.IPV6ADDRESS.test(components.host)) {
//TODO: normalize IPv6 address as per RFC 5952
}
//if host component is a domain name
else if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {
//convert IDN via punycode
try {
components.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));
}
catch (e) {
components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
}
}
}
//normalize encoding
_normalizeComponentEncoding(components, protocol);
if (options.reference !== "suffix" && components.scheme) {
uriTokens.push(components.scheme);
uriTokens.push(":");
}
const authority = _recomposeAuthority(components, options);
if (authority !== undefined) {
if (options.reference !== "suffix") {
uriTokens.push("//");
}
uriTokens.push(authority);
if (components.path && components.path.charAt(0) !== "/") {
uriTokens.push("/");
}
}
if (components.path !== undefined) {
let s = components.path;
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
s = removeDotSegments(s);
}
if (authority === undefined) {
s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//"
}
uriTokens.push(s);
}
if (components.query !== undefined) {
uriTokens.push("?");
uriTokens.push(components.query);
}
if (components.fragment !== undefined) {
uriTokens.push("#");
uriTokens.push(components.fragment);
}
return uriTokens.join(""); //merge tokens into a string
}
;
export function resolveComponents(base, relative, options = {}, skipNormalization) {
const target = {};
if (!skipNormalization) {
base = parse(serialize(base, options), options); //normalize base components
relative = parse(serialize(relative, options), options); //normalize relative components
}
options = options || {};
if (!options.tolerant && relative.scheme) {
target.scheme = relative.scheme;
//target.authority = relative.authority;
target.userinfo = relative.userinfo;
target.host = relative.host;
target.port = relative.port;
target.path = removeDotSegments(relative.path || "");
target.query = relative.query;
}
else {
if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
//target.authority = relative.authority;
target.userinfo = relative.userinfo;
target.host = relative.host;
target.port = relative.port;
target.path = removeDotSegments(relative.path || "");
target.query = relative.query;
}
else {
if (!relative.path) {
target.path = base.path;
if (relative.query !== undefined) {
target.query = relative.query;
}
else {
target.query = base.query;
}
}
else {
if (relative.path.charAt(0) === "/") {
target.path = removeDotSegments(relative.path);
}
else {
if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
target.path = "/" + relative.path;
}
else if (!base.path) {
target.path = relative.path;
}
else {
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
}
target.path = removeDotSegments(target.path);
}
target.query = relative.query;
}
//target.authority = base.authority;
target.userinfo = base.userinfo;
target.host = base.host;
target.port = base.port;
}
target.scheme = base.scheme;
}
target.fragment = relative.fragment;
return target;
}
;
export function resolve(baseURI, relativeURI, options) {
const schemelessOptions = assign({ scheme: 'null' }, options);
return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
}
;
export function normalize(uri, options) {
if (typeof uri === "string") {
uri = serialize(parse(uri, options), options);
}
else if (typeOf(uri) === "object") {
uri = parse(serialize(uri, options), options);
}
return uri;
}
;
export function equal(uriA, uriB, options) {
if (typeof uriA === "string") {
uriA = serialize(parse(uriA, options), options);
}
else if (typeOf(uriA) === "object") {
uriA = serialize(uriA, options);
}
if (typeof uriB === "string") {
uriB = serialize(parse(uriB, options), options);
}
else if (typeOf(uriB) === "object") {
uriB = serialize(uriB, options);
}
return uriA === uriB;
}
;
export function escapeComponent(str, options) {
return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);
}
;
export function unescapeComponent(str, options) {
return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);
}
;
//# sourceMappingURL=uri.js.map
@@ -0,0 +1,39 @@
import baseMerge from './_baseMerge.js';
import createAssigner from './_createAssigner.js';
/**
* This method is like `_.assign` except that it recursively merges own and
* inherited enumerable string keyed properties of source objects into the
* destination object. Source properties that resolve to `undefined` are
* skipped if a destination value exists. Array and plain object properties
* are merged recursively. Other objects and value types are overridden by
* assignment. Source objects are applied from left to right. Subsequent
* sources overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 0.5.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @example
*
* var object = {
* 'a': [{ 'b': 2 }, { 'd': 4 }]
* };
*
* var other = {
* 'a': [{ 'c': 3 }, { 'e': 5 }]
* };
*
* _.merge(object, other);
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
*/
var merge = createAssigner(function(object, source, srcIndex) {
baseMerge(object, source, srcIndex);
});
export default merge;
@@ -0,0 +1,6 @@
function isObject(value) {
return value !== null && typeof value === "object";
}
export {
isObject
};
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = once;
function once(fn) {
function wrapper(...args) {
if (fn === null) return;
var callFn = fn;
fn = null;
callFn.apply(this, args);
}
Object.assign(wrapper, fn);
return wrapper;
}
module.exports = exports.default;
@@ -0,0 +1,35 @@
var create = require('../diagnostics');
/**
* Create a new diagnostics logger.
*
* @param {String} namespace The namespace it should enable.
* @param {Object} options Additional options.
* @returns {Function} The logger.
* @public
*/
var diagnostics = create(function dev(namespace, options) {
options = options || {};
options.namespace = namespace;
options.prod = false;
options.dev = true;
if (!dev.enabled(namespace) && !(options.force || dev.force)) {
return dev.nope(options);
}
return dev.yep(options);
});
//
// Configure the logger for the given environment.
//
diagnostics.modify(require('../modifiers/namespace'));
diagnostics.use(require('../adapters/localstorage'));
diagnostics.use(require('../adapters/hash'));
diagnostics.set(require('../logger/console'));
//
// Expose the diagnostics logger.
//
module.exports = diagnostics;
@@ -0,0 +1 @@
{"name":"@heroui/use-data-scroll-overflow","version":"2.2.3","requiresBuild":false,"files":{"dist/index.js":{"checkedAt":1794532108956,"integrity":"sha512-7ehOr2HRTCjejbveiYwbgtejpZNfZVBWR2DwgPT8WAlRW4uijS3cjXLaZe59p2R4mSRNDaKG0C6soErzKNUa1w==","mode":420,"size":4134},"package.json":{"checkedAt":1794532108956,"integrity":"sha512-VWzlcOzf3oIKjl+dyIVi0vk5xEflN2/vYvpmUrrCZhA+RVwpVWr2Ita0dEy1P7CbDB5lQJlebTKjwxFpkD6Wjg==","mode":420,"size":1408},"README.md":{"checkedAt":1794532108956,"integrity":"sha512-/Se4FreO1IWHLQRHenBkwHnFEb40qV3vTPx75bVcSkh11ivUxM1mdsavZWIOyfDwLDRUreXt5AMGFgX8oAZTOQ==","mode":420,"size":527},"dist/index.mjs":{"checkedAt":1794532108956,"integrity":"sha512-cl1Hl/f4B7Vuu3po72kpQ/8+0Gu3wGVWeBDsT8cjD8IJpTN4SBA6zGJw6GYQCLTP6tr0LnWYiVuy4KZr+dUWNQ==","mode":420,"size":3045},"dist/index.d.ts":{"checkedAt":1794532108957,"integrity":"sha512-ano5C9PXQju6BS6MCQ6u5sw0mlB2rwtm4bukbeE6AjNpUxstBxWnamZK2JrvVHRNJnrRXHin1WOGYv9prIVhFg==","mode":420,"size":2070},"LICENSE":{"checkedAt":1794532104252,"integrity":"sha512-eaopHP+N4EYXlGoX9hmoxDPoVft4BqrXKmbsFTcsoBHSrJp/GWF4qVtLBzrw9h9ZrbFfPY69z+3RuDX9FdPG+Q==","mode":420,"size":1064}}}
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more