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,22 @@
import { AlgorithmIdentifier } from "@peculiar/asn1-x509";
export declare const md2: AlgorithmIdentifier;
export declare const md4: AlgorithmIdentifier;
export declare const sha1: AlgorithmIdentifier;
export declare const sha224: AlgorithmIdentifier;
export declare const sha256: AlgorithmIdentifier;
export declare const sha384: AlgorithmIdentifier;
export declare const sha512: AlgorithmIdentifier;
export declare const sha512_224: AlgorithmIdentifier;
export declare const sha512_256: AlgorithmIdentifier;
export declare const mgf1SHA1: AlgorithmIdentifier;
export declare const pSpecifiedEmpty: AlgorithmIdentifier;
export declare const rsaEncryption: AlgorithmIdentifier;
export declare const md2WithRSAEncryption: AlgorithmIdentifier;
export declare const md5WithRSAEncryption: AlgorithmIdentifier;
export declare const sha1WithRSAEncryption: AlgorithmIdentifier;
export declare const sha224WithRSAEncryption: AlgorithmIdentifier;
export declare const sha256WithRSAEncryption: AlgorithmIdentifier;
export declare const sha384WithRSAEncryption: AlgorithmIdentifier;
export declare const sha512WithRSAEncryption: AlgorithmIdentifier;
export declare const sha512_224WithRSAEncryption: AlgorithmIdentifier;
export declare const sha512_256WithRSAEncryption: AlgorithmIdentifier;
@@ -0,0 +1,59 @@
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*/
"use strict"
const path = require("path")
const { CALL, ReferenceTracker, getStringIfConstant } = require("eslint-utils")
const resolve = require("resolve")
const getResolvePaths = require("./get-resolve-paths")
const getTryExtensions = require("./get-try-extensions")
const ImportTarget = require("./import-target")
const stripImportPathParams = require("./strip-import-path-params")
/**
* Gets a list of `require()` targets.
*
* Core modules of Node.js (e.g. `fs`, `http`) are excluded.
*
* @param {RuleContext} context - The rule context.
* @param {Object} [options] - The flag to include core modules.
* @param {boolean} [options.includeCore] - The flag to include core modules.
* @param {function(ImportTarget[]):void} callback The callback function to get result.
* @returns {Object} The visitor.
*/
module.exports = function visitRequire(
context,
{ includeCore = false } = {},
callback
) {
const targets = []
const basedir = path.dirname(path.resolve(context.getFilename()))
const paths = getResolvePaths(context)
const extensions = getTryExtensions(context)
const options = { basedir, paths, extensions }
return {
"Program:exit"() {
const tracker = new ReferenceTracker(context.getScope())
const references = tracker.iterateGlobalReferences({
require: {
[CALL]: true,
resolve: { [CALL]: true },
},
})
for (const { node } of references) {
const targetNode = node.arguments[0]
const rawName = getStringIfConstant(targetNode)
const name = rawName && stripImportPathParams(rawName)
if (name && (includeCore || !resolve.isCore(name))) {
targets.push(new ImportTarget(targetNode, name, options))
}
}
callback(targets)
},
}
}
@@ -0,0 +1,55 @@
var $08ef1685902b6011$exports = require("./ariaHideOutside.main.js");
var $82711f9cb668ecdb$exports = require("./useOverlay.main.js");
var $745edbb83ab4296f$exports = require("./Overlay.main.js");
var $5c2f5cd01815d369$exports = require("./usePreventScroll.main.js");
var $9ziDi$reactariautils = require("@react-aria/utils");
var $9ziDi$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useModalOverlay", () => $11b7e0b04b421e95$export$dbc0f175b25fb0fb);
/*
* 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.
*/
function $11b7e0b04b421e95$export$dbc0f175b25fb0fb(props, state, ref) {
let { overlayProps: overlayProps, underlayProps: underlayProps } = (0, $82711f9cb668ecdb$exports.useOverlay)({
...props,
isOpen: state.isOpen,
onClose: state.close
}, ref);
(0, $5c2f5cd01815d369$exports.usePreventScroll)({
isDisabled: !state.isOpen
});
(0, $745edbb83ab4296f$exports.useOverlayFocusContain)();
(0, $9ziDi$react.useEffect)(()=>{
if (state.isOpen && ref.current) return (0, $08ef1685902b6011$exports.ariaHideOutside)([
ref.current
]);
}, [
state.isOpen,
ref
]);
return {
modalProps: (0, $9ziDi$reactariautils.mergeProps)(overlayProps),
underlayProps: underlayProps
};
}
//# sourceMappingURL=useModalOverlay.main.js.map
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('iteratee', require('../iteratee'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,213 @@
/**
* @fileoverview Enforce shorthand or standard form for React fragments.
* @author Alex Zherdev
*/
'use strict';
const elementType = require('jsx-ast-utils/elementType');
const pragmaUtil = require('../util/pragma');
const variableUtil = require('../util/variable');
const testReactVersion = require('../util/version').testReactVersion;
const docsUrl = require('../util/docsUrl');
const report = require('../util/report');
const getText = require('../util/eslint').getText;
// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------
function replaceNode(source, node, text) {
return `${source.slice(0, node.range[0])}${text}${source.slice(node.range[1])}`;
}
const messages = {
fragmentsNotSupported: 'Fragments are only supported starting from React v16.2. Please disable the `react/jsx-fragments` rule in `eslint` settings or upgrade your version of React.',
preferPragma: 'Prefer {{react}}.{{fragment}} over fragment shorthand',
preferFragment: 'Prefer fragment shorthand over {{react}}.{{fragment}}',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Enforce shorthand or standard form for React fragments',
category: 'Stylistic Issues',
recommended: false,
url: docsUrl('jsx-fragments'),
},
fixable: 'code',
messages,
schema: [{
enum: ['syntax', 'element'],
}],
},
create(context) {
const configuration = context.options[0] || 'syntax';
const reactPragma = pragmaUtil.getFromContext(context);
const fragmentPragma = pragmaUtil.getFragmentFromContext(context);
const openFragShort = '<>';
const closeFragShort = '</>';
const openFragLong = `<${reactPragma}.${fragmentPragma}>`;
const closeFragLong = `</${reactPragma}.${fragmentPragma}>`;
function reportOnReactVersion(node) {
if (!testReactVersion(context, '>= 16.2.0')) {
report(context, messages.fragmentsNotSupported, 'fragmentsNotSupported', {
node,
});
return true;
}
return false;
}
function getFixerToLong(jsxFragment) {
if (!jsxFragment.closingFragment || !jsxFragment.openingFragment) {
// the old TS parser crashes here
// TODO: FIXME: can we fake these two descriptors?
return null;
}
return function fix(fixer) {
let source = getText(context);
source = replaceNode(source, jsxFragment.closingFragment, closeFragLong);
source = replaceNode(source, jsxFragment.openingFragment, openFragLong);
const lengthDiff = openFragLong.length - getText(context, jsxFragment.openingFragment).length
+ closeFragLong.length - getText(context, jsxFragment.closingFragment).length;
const range = jsxFragment.range;
return fixer.replaceTextRange(range, source.slice(range[0], range[1] + lengthDiff));
};
}
function getFixerToShort(jsxElement) {
return function fix(fixer) {
let source = getText(context);
let lengthDiff;
if (jsxElement.closingElement) {
source = replaceNode(source, jsxElement.closingElement, closeFragShort);
source = replaceNode(source, jsxElement.openingElement, openFragShort);
lengthDiff = getText(context, jsxElement.openingElement).length - openFragShort.length
+ getText(context, jsxElement.closingElement).length - closeFragShort.length;
} else {
source = replaceNode(source, jsxElement.openingElement, `${openFragShort}${closeFragShort}`);
lengthDiff = getText(context, jsxElement.openingElement).length - openFragShort.length
- closeFragShort.length;
}
const range = jsxElement.range;
return fixer.replaceTextRange(range, source.slice(range[0], range[1] - lengthDiff));
};
}
function refersToReactFragment(node, name) {
const variableInit = variableUtil.findVariableByName(context, node, name);
if (!variableInit) {
return false;
}
// const { Fragment } = React;
if (variableInit.type === 'Identifier' && variableInit.name === reactPragma) {
return true;
}
// const Fragment = React.Fragment;
if (
variableInit.type === 'MemberExpression'
&& variableInit.object.type === 'Identifier'
&& variableInit.object.name === reactPragma
&& variableInit.property.type === 'Identifier'
&& variableInit.property.name === fragmentPragma
) {
return true;
}
// const { Fragment } = require('react');
if (
variableInit.callee
&& variableInit.callee.name === 'require'
&& variableInit.arguments
&& variableInit.arguments[0]
&& variableInit.arguments[0].value === 'react'
) {
return true;
}
return false;
}
const jsxElements = [];
const fragmentNames = new Set([`${reactPragma}.${fragmentPragma}`]);
// --------------------------------------------------------------------------
// Public
// --------------------------------------------------------------------------
return {
JSXElement(node) {
jsxElements.push(node);
},
JSXFragment(node) {
if (reportOnReactVersion(node)) {
return;
}
if (configuration === 'element') {
report(context, messages.preferPragma, 'preferPragma', {
node,
data: {
react: reactPragma,
fragment: fragmentPragma,
},
fix: getFixerToLong(node),
});
}
},
ImportDeclaration(node) {
if (node.source && node.source.value === 'react') {
node.specifiers.forEach((spec) => {
if (
'imported' in spec
&& spec.imported
&& 'name' in spec.imported
&& spec.imported.name === fragmentPragma
) {
if (spec.local) {
fragmentNames.add(spec.local.name);
}
}
});
}
},
'Program:exit'() {
jsxElements.forEach((node) => {
const openingEl = node.openingElement;
const elName = elementType(openingEl);
if (fragmentNames.has(elName) || refersToReactFragment(node, elName)) {
if (reportOnReactVersion(node)) {
return;
}
const attrs = openingEl.attributes;
if (configuration === 'syntax' && !(attrs && attrs.length > 0)) {
report(context, messages.preferFragment, 'preferFragment', {
node,
data: {
react: reactPragma,
fragment: fragmentPragma,
},
fix: getFixerToShort(node),
});
}
}
});
},
};
},
};
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAYM,SAAS,0CAAiC,CAAQ;IACvD,qFAAqF;IACrF,gEAAgE;IAChE,OAAO,CAAA,GAAA,mCAAY,MAAM,EAAE,MAAM,GAAG,EAAE,OAAO;AAC/C;AAEO,SAAS,0CAAe,aAA4C,EAAE,GAAQ;QAElE,wBAIV;IALP,IAAI,WAAW,CAAC,WAAW,EAAE,IAAI,MAAM,CAAC,OAAO,MAAM,EAAE,CAAC;IACxD,IAAI,cAAa,yBAAA,cAAc,OAAO,cAArB,6CAAA,uBAAuB,OAAO,CAAC,UAAU;IAC1D,IAAI,YACF,WAAW,CAAC,kBAAkB,EAAE,IAAI,MAAM,CAAC,YAAY,EAAE,EAAE,UAAU;IAEvE,QAAO,0BAAA,cAAc,OAAO,cAArB,8CAAA,wBAAuB,aAAa,CAAC;AAC9C;AAEA,MAAM,sCAAgB,IAAI;AACnB,SAAS,0CAAgB,UAA2B;IACzD,IAAI,KAAK,CAAA,GAAA,2BAAI;IACb,oCAAc,GAAG,CAAC,YAAY;IAC9B,OAAO;AACT;AAEO,SAAS,0CAAgB,UAA2B;IACzD,OAAO,oCAAc,GAAG,CAAC;AAC3B","sources":["packages/@react-aria/selection/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, Key} from '@react-types/shared';\nimport {isAppleDevice, useId} from '@react-aria/utils';\nimport {RefObject} from 'react';\n\ninterface Event {\n altKey: boolean,\n ctrlKey: boolean,\n metaKey: boolean\n}\n\nexport function isNonContiguousSelectionModifier(e: Event): boolean {\n // Ctrl + Arrow Up/Arrow Down has a system wide meaning on macOS, so use Alt instead.\n // On Windows and Ubuntu, Alt + Space has a system wide meaning.\n return isAppleDevice() ? e.altKey : e.ctrlKey;\n}\n\nexport function getItemElement(collectionRef: RefObject<HTMLElement | null>, key: Key): Element | null | undefined {\n let selector = `[data-key=\"${CSS.escape(String(key))}\"]`;\n let collection = collectionRef.current?.dataset.collection;\n if (collection) {\n selector = `[data-collection=\"${CSS.escape(collection)}\"]${selector}`;\n }\n return collectionRef.current?.querySelector(selector);\n}\n\nconst collectionMap = new WeakMap<Collection<any>, string>();\nexport function useCollectionId(collection: Collection<any>): string {\n let id = useId();\n collectionMap.set(collection, id);\n return id;\n}\n\nexport function getCollectionId(collection: Collection<any>): string {\n return collectionMap.get(collection)!;\n}\n"],"names":[],"version":3,"file":"utils.main.js.map"}
@@ -0,0 +1,14 @@
import type { TSESLint } from '@typescript-eslint/utils';
export type MessageIds = 'noShadow' | 'noShadowGlobal';
export type Options = [
{
allow?: string[];
builtinGlobals?: boolean;
hoist?: 'all' | 'functions' | 'functions-and-types' | 'never' | 'types';
ignoreFunctionTypeParameterNameValueShadow?: boolean;
ignoreOnInitialization?: boolean;
ignoreTypeValueShadow?: boolean;
}
];
declare const _default: TSESLint.RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, TSESLint.RuleListener>;
export default _default;
@@ -0,0 +1 @@
export { useInputLabelPlacement, useLabelPlacement } from './use-label-placement.mjs';
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,iBAAiB;IACf,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;AACX","sources":["packages/@react-aria/overlays/src/*.js"],"sourcesContent":["const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}"],"names":[],"version":3,"file":"intlStrings.main.js.map"}
@@ -0,0 +1,37 @@
import {useTableColumnResizeState as $292bc4e09cd0eb62$export$cb895dcf85db1319} from "./useTableColumnResizeState.mjs";
import {UNSTABLE_useFilteredTableState as $4a0dd036d492cee4$export$31447e17397b15c2, useTableState as $4a0dd036d492cee4$export$907bcc6c48325fd6} from "./useTableState.mjs";
import {TableHeader as $312ae3b56a94a86e$export$f850895b287ef28e} from "./TableHeader.mjs";
import {TableBody as $4ae5314bf50db1a3$export$76ccd210b9029917} from "./TableBody.mjs";
import {Column as $1cd244557c2f97d5$export$816b5d811295e6bc} from "./Column.mjs";
import {Row as $70d70eb16ea48428$export$b59bdbef9ce70de2} from "./Row.mjs";
import {Cell as $941d1d9a6a28982a$export$f6f0c3fe4ec306ea} from "./Cell.mjs";
import {buildHeaderRows as $788781baa30117fa$export$7c127db850d4e81e, TableCollection as $788781baa30117fa$export$596e1b2e2cf93690} from "./TableCollection.mjs";
import {TableColumnLayout as $a9e7ae544a4e41dd$export$7ff77a162970b30e} from "./TableColumnLayout.mjs";
import {UNSTABLE_useTreeGridState as $ee65a0057fd99531$export$34dfa8a1622185a4} from "./useTreeGridState.mjs";
import {Section as $6555104ff085bef4$re_export$Section} from "@react-stately/collections";
/*
* 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.
*/
export {$292bc4e09cd0eb62$export$cb895dcf85db1319 as useTableColumnResizeState, $4a0dd036d492cee4$export$907bcc6c48325fd6 as useTableState, $4a0dd036d492cee4$export$31447e17397b15c2 as UNSTABLE_useFilteredTableState, $312ae3b56a94a86e$export$f850895b287ef28e as TableHeader, $4ae5314bf50db1a3$export$76ccd210b9029917 as TableBody, $1cd244557c2f97d5$export$816b5d811295e6bc as Column, $70d70eb16ea48428$export$b59bdbef9ce70de2 as Row, $941d1d9a6a28982a$export$f6f0c3fe4ec306ea as Cell, $6555104ff085bef4$re_export$Section as Section, $788781baa30117fa$export$596e1b2e2cf93690 as TableCollection, $788781baa30117fa$export$7c127db850d4e81e as buildHeaderRows, $a9e7ae544a4e41dd$export$7ff77a162970b30e as TableColumnLayout, $ee65a0057fd99531$export$34dfa8a1622185a4 as UNSTABLE_useTreeGridState};
//# sourceMappingURL=module.js.map
@@ -0,0 +1,42 @@
// Arabic (Tunisia) [ar-tn]
import dayjs from '../index';
var locale = {
name: 'ar-tn',
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekStart: 1,
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
ordinal: function ordinal(n) {
return n;
},
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 meridiem(hour) {
return hour > 12 ? 'م' : 'ص';
},
relativeTime: {
future: 'في %s',
past: 'منذ %s',
s: 'ثوان',
m: 'دقيقة',
mm: '%d دقائق',
h: 'ساعة',
hh: '%d ساعات',
d: 'يوم',
dd: '%d أيام',
M: 'شهر',
MM: '%d أشهر',
y: 'سنة',
yy: '%d سنوات'
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,114 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
/** @typedef {import("./Resolver").ResolveContextYield} ResolveContextYield */
/** @typedef {{ [k: string]: undefined | ResolveRequest | ResolveRequest[] }} Cache */
/**
* @param {string} type type of cache
* @param {ResolveRequest} request request
* @param {boolean} withContext cache with context?
* @returns {string} cache id
*/
function getCacheId(type, request, withContext) {
return JSON.stringify({
type,
context: withContext ? request.context : "",
path: request.path,
query: request.query,
fragment: request.fragment,
request: request.request,
});
}
module.exports = class UnsafeCachePlugin {
/**
* @param {string | ResolveStepHook} source source
* @param {(request: ResolveRequest) => boolean} filterPredicate filterPredicate
* @param {Cache} cache cache
* @param {boolean} withContext withContext
* @param {string | ResolveStepHook} target target
*/
constructor(source, filterPredicate, cache, withContext, target) {
this.source = source;
this.filterPredicate = filterPredicate;
this.withContext = withContext;
this.cache = cache;
this.target = target;
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
const target = resolver.ensureHook(this.target);
resolver
.getHook(this.source)
.tapAsync("UnsafeCachePlugin", (request, resolveContext, callback) => {
if (!this.filterPredicate(request)) return callback();
const isYield = typeof resolveContext.yield === "function";
const cacheId = getCacheId(
isYield ? "yield" : "default",
request,
this.withContext,
);
const cacheEntry = this.cache[cacheId];
if (cacheEntry) {
if (isYield) {
const yield_ =
/** @type {ResolveContextYield} */
(resolveContext.yield);
if (Array.isArray(cacheEntry)) {
for (const result of cacheEntry) yield_(result);
} else {
yield_(cacheEntry);
}
return callback(null, null);
}
return callback(null, /** @type {ResolveRequest} */ (cacheEntry));
}
/** @type {ResolveContextYield | undefined} */
let yieldFn;
/** @type {ResolveContextYield | undefined} */
let yield_;
/** @type {ResolveRequest[]} */
const yieldResult = [];
if (isYield) {
yieldFn = resolveContext.yield;
yield_ = (result) => {
yieldResult.push(result);
};
}
resolver.doResolve(
target,
request,
null,
yield_ ? { ...resolveContext, yield: yield_ } : resolveContext,
(err, result) => {
if (err) return callback(err);
if (isYield) {
if (result) yieldResult.push(result);
for (const result of yieldResult) {
/** @type {ResolveContextYield} */
(yieldFn)(result);
}
this.cache[cacheId] = yieldResult;
return callback(null, null);
}
if (result) return callback(null, (this.cache[cacheId] = result));
callback();
},
);
});
}
};
@@ -0,0 +1,106 @@
/**
* @typedef {import('mdast').Delete} Delete
*
* @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
* @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
* @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
*
* @typedef {import('mdast-util-to-markdown').ConstructName} ConstructName
* @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
* @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
*/
/**
* List of constructs that occur in phrasing (paragraphs, headings), but cannot
* contain strikethrough.
* So they sort of cancel each other out.
* Note: could use a better name.
*
* Note: keep in sync with: <https://github.com/syntax-tree/mdast-util-to-markdown/blob/8ce8dbf/lib/unsafe.js#L14>
*
* @type {Array<ConstructName>}
*/
const constructsWithoutStrikethrough = [
'autolink',
'destinationLiteral',
'destinationRaw',
'reference',
'titleQuote',
'titleApostrophe'
]
handleDelete.peek = peekDelete
/**
* Create an extension for `mdast-util-from-markdown` to enable GFM
* strikethrough in markdown.
*
* @returns {FromMarkdownExtension}
* Extension for `mdast-util-from-markdown` to enable GFM strikethrough.
*/
export function gfmStrikethroughFromMarkdown() {
return {
canContainEols: ['delete'],
enter: {strikethrough: enterStrikethrough},
exit: {strikethrough: exitStrikethrough}
}
}
/**
* Create an extension for `mdast-util-to-markdown` to enable GFM
* strikethrough in markdown.
*
* @returns {ToMarkdownExtension}
* Extension for `mdast-util-to-markdown` to enable GFM strikethrough.
*/
export function gfmStrikethroughToMarkdown() {
return {
unsafe: [
{
character: '~',
inConstruct: 'phrasing',
notInConstruct: constructsWithoutStrikethrough
}
],
handlers: {delete: handleDelete}
}
}
/**
* @this {CompileContext}
* @type {FromMarkdownHandle}
*/
function enterStrikethrough(token) {
this.enter({type: 'delete', children: []}, token)
}
/**
* @this {CompileContext}
* @type {FromMarkdownHandle}
*/
function exitStrikethrough(token) {
this.exit(token)
}
/**
* @type {ToMarkdownHandle}
* @param {Delete} node
*/
function handleDelete(node, _, state, info) {
const tracker = state.createTracker(info)
const exit = state.enter('strikethrough')
let value = tracker.move('~~')
value += state.containerPhrasing(node, {
...tracker.current(),
before: value,
after: '~'
})
value += tracker.move('~~')
exit()
return value
}
/** @type {ToMarkdownHandle} */
function peekDelete() {
return '~'
}
@@ -0,0 +1,58 @@
# readable-stream
***Node-core v8.17.0 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)
[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)
[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)
[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)
```bash
npm install --save readable-stream
```
***Node-core streams for userland***
This package is a mirror of the Streams2 and Streams3 implementations in
Node-core.
Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.17.0/docs/api/stream.html).
If you want to guarantee a stable streams base, regardless of what version of
Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).
As of version 2.0.0 **readable-stream** uses semantic versioning.
# Streams Working Group
`readable-stream` is maintained by the Streams Working Group, which
oversees the development and maintenance of the Streams API within
Node.js. The responsibilities of the Streams Working Group include:
* Addressing stream issues on the Node.js issue tracker.
* Authoring and editing stream documentation within the Node.js project.
* Reviewing changes to stream subclasses within the Node.js project.
* Redirecting changes to streams from the Node.js project to this
project.
* Assisting in the implementation of stream providers within Node.js.
* Recommending versions of `readable-stream` to be included in Node.js.
* Messaging about the future of streams to give the community advance
notice of changes.
<a name="members"></a>
## Team Members
* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) &lt;christopher.s.dickinson@gmail.com&gt;
- Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B
* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) &lt;calvin.metcalf@gmail.com&gt;
- Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242
* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) &lt;rod@vagg.org&gt;
- Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D
* **Sam Newman** ([@sonewman](https://github.com/sonewman)) &lt;newmansam@outlook.com&gt;
* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) &lt;mathiasbuus@gmail.com&gt;
* **Domenic Denicola** ([@domenic](https://github.com/domenic)) &lt;d@domenic.me&gt;
* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) &lt;matteo.collina@gmail.com&gt;
- Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E
* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) &lt;shestak.irina@gmail.com&gt;
@@ -0,0 +1 @@
{"version":3,"names":["_path","data","require","sep","path","endSep","substitution","starPat","starPatLast","starStarPat","starStarPatLast","escapeRegExp","string","replace","pathToPattern","pattern","dirname","parts","resolve","split","RegExp","map","part","i","last","length","indexOf","slice","join"],"sources":["../../src/config/pattern-to-regex.ts"],"sourcesContent":["import path from \"node:path\";\n\nconst sep = `\\\\${path.sep}`;\nconst endSep = `(?:${sep}|$)`;\n\nconst substitution = `[^${sep}]+`;\n\nconst starPat = `(?:${substitution}${sep})`;\nconst starPatLast = `(?:${substitution}${endSep})`;\n\nconst starStarPat = `${starPat}*?`;\nconst starStarPatLast = `${starPat}*?${starPatLast}?`;\n\nfunction escapeRegExp(string: string) {\n return string.replace(/[|\\\\{}()[\\]^$+*?.]/g, \"\\\\$&\");\n}\n\n/**\n * Implement basic pattern matching that will allow users to do the simple\n * tests with * and **. If users want full complex pattern matching, then can\n * always use regex matching, or function validation.\n */\nexport default function pathToPattern(\n pattern: string,\n dirname: string,\n): RegExp {\n const parts = path.resolve(dirname, pattern).split(path.sep);\n\n return new RegExp(\n [\n \"^\",\n ...parts.map((part, i) => {\n const last = i === parts.length - 1;\n\n // ** matches 0 or more path parts.\n if (part === \"**\") return last ? starStarPatLast : starStarPat;\n\n // * matches 1 path part.\n if (part === \"*\") return last ? starPatLast : starPat;\n\n // *.ext matches a wildcard with an extension.\n if (part.indexOf(\"*.\") === 0) {\n return (\n substitution + escapeRegExp(part.slice(1)) + (last ? endSep : sep)\n );\n }\n\n // Otherwise match the pattern text.\n return escapeRegExp(part) + (last ? endSep : sep);\n }),\n ].join(\"\"),\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAME,GAAG,GAAG,KAAKC,MAAGA,CAAC,CAACD,GAAG,EAAE;AAC3B,MAAME,MAAM,GAAG,MAAMF,GAAG,KAAK;AAE7B,MAAMG,YAAY,GAAG,KAAKH,GAAG,IAAI;AAEjC,MAAMI,OAAO,GAAG,MAAMD,YAAY,GAAGH,GAAG,GAAG;AAC3C,MAAMK,WAAW,GAAG,MAAMF,YAAY,GAAGD,MAAM,GAAG;AAElD,MAAMI,WAAW,GAAG,GAAGF,OAAO,IAAI;AAClC,MAAMG,eAAe,GAAG,GAAGH,OAAO,KAAKC,WAAW,GAAG;AAErD,SAASG,YAAYA,CAACC,MAAc,EAAE;EACpC,OAAOA,MAAM,CAACC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC;AACtD;AAOe,SAASC,aAAaA,CACnCC,OAAe,EACfC,OAAe,EACP;EACR,MAAMC,KAAK,GAAGb,MAAGA,CAAC,CAACc,OAAO,CAACF,OAAO,EAAED,OAAO,CAAC,CAACI,KAAK,CAACf,MAAGA,CAAC,CAACD,GAAG,CAAC;EAE5D,OAAO,IAAIiB,MAAM,CACf,CACE,GAAG,EACH,GAAGH,KAAK,CAACI,GAAG,CAAC,CAACC,IAAI,EAAEC,CAAC,KAAK;IACxB,MAAMC,IAAI,GAAGD,CAAC,KAAKN,KAAK,CAACQ,MAAM,GAAG,CAAC;IAGnC,IAAIH,IAAI,KAAK,IAAI,EAAE,OAAOE,IAAI,GAAGd,eAAe,GAAGD,WAAW;IAG9D,IAAIa,IAAI,KAAK,GAAG,EAAE,OAAOE,IAAI,GAAGhB,WAAW,GAAGD,OAAO;IAGrD,IAAIe,IAAI,CAACI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;MAC5B,OACEpB,YAAY,GAAGK,YAAY,CAACW,IAAI,CAACK,KAAK,CAAC,CAAC,CAAC,CAAC,IAAIH,IAAI,GAAGnB,MAAM,GAAGF,GAAG,CAAC;IAEtE;IAGA,OAAOQ,YAAY,CAACW,IAAI,CAAC,IAAIE,IAAI,GAAGnB,MAAM,GAAGF,GAAG,CAAC;EACnD,CAAC,CAAC,CACH,CAACyB,IAAI,CAAC,EAAE,CACX,CAAC;AACH;AAAC","ignoreList":[]}
@@ -0,0 +1,30 @@
var test = require('tape')
var through = require('../')
// must emit end before close.
test('end before close', function (assert) {
var ts = through()
ts.autoDestroy = false
var ended = false, closed = false
ts.on('end', function () {
assert.ok(!closed)
ended = true
})
ts.on('close', function () {
assert.ok(ended)
closed = true
})
ts.write(1)
ts.write(2)
ts.write(3)
ts.end()
assert.ok(ended)
assert.notOk(closed)
ts.destroy()
assert.ok(closed)
assert.end()
})
@@ -0,0 +1,7 @@
"use client";
import {
tab_panel_default
} from "./chunk-7ARJTFQR.mjs";
export {
tab_panel_default as default
};
@@ -0,0 +1,17 @@
{
"name": "lodash.clonedeep",
"version": "4.5.0",
"description": "The lodash method `_.cloneDeep` exported as a module.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",
"license": "MIT",
"keywords": "lodash-modularized, clonedeep",
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
"contributors": [
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
"Blaine Bublitz <blaine.bublitz@gmail.com> (https://github.com/phated)",
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
],
"repository": "lodash/lodash",
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
}
@@ -0,0 +1,47 @@
var $a217ebca77471970$exports = require("./utils.main.js");
var $8Zd8I$reactariautils = require("@react-aria/utils");
var $8Zd8I$reactariafocus = require("@react-aria/focus");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useTabPanel", () => $8db1928b18472a1f$export$fae0121b5afe572d);
/*
* 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 $8db1928b18472a1f$export$fae0121b5afe572d(props, state, ref) {
// The tabpanel should have tabIndex=0 when there are no tabbable elements within it.
// Otherwise, tabbing from the focused tab should go directly to the first tabbable element
// within the tabpanel.
let tabIndex = (0, $8Zd8I$reactariafocus.useHasTabbableChild)(ref) ? undefined : 0;
var _props_id;
const id = (0, $a217ebca77471970$exports.generateId)(state, (_props_id = props.id) !== null && _props_id !== void 0 ? _props_id : state === null || state === void 0 ? void 0 : state.selectedKey, 'tabpanel');
const tabPanelProps = (0, $8Zd8I$reactariautils.useLabels)({
...props,
id: id,
'aria-labelledby': (0, $a217ebca77471970$exports.generateId)(state, state === null || state === void 0 ? void 0 : state.selectedKey, 'tab')
});
return {
tabPanelProps: (0, $8Zd8I$reactariautils.mergeProps)(tabPanelProps, {
tabIndex: tabIndex,
role: 'tabpanel',
'aria-describedby': props['aria-describedby'],
'aria-details': props['aria-details']
})
};
}
//# sourceMappingURL=useTabPanel.main.js.map
@@ -0,0 +1,208 @@
/*!
* MIT License
*
* Copyright (c) 2017-2024 Peculiar Ventures, LLC
*
* 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.
*
*/
type BufferSource = ArrayBuffer | ArrayBufferView;
interface ArrayBufferViewConstructor<T extends ArrayBufferView> {
readonly prototype: T;
new (length: number): T;
new (array: ArrayLike<number> | ArrayBufferLike): T;
new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): T;
}
declare class BufferSourceConverter {
/**
* Checks if incoming data is ArrayBuffer
* @param data Data to be checked
* @returns Returns `true` if incoming data is ArrayBuffer, otherwise `false`
*/
static isArrayBuffer(data: any): data is ArrayBuffer;
/**
* Converts incoming buffer source into ArrayBuffer
* @param data Buffer source
* @returns ArrayBuffer representation of data
* @remarks If incoming data is ArrayBuffer then it returns it without copying,
* otherwise it copies data into new ArrayBuffer because incoming data can be
* ArrayBufferView with offset and length which is not equal to buffer length
*/
static toArrayBuffer(data: BufferSource): ArrayBuffer;
/**
* Converts incoming buffer source into Uint8Array
* @param data Buffer source
* @returns Uint8Array representation of data
*/
static toUint8Array(data: BufferSource): Uint8Array;
/**
* Converts a given `BufferSource` to the specified `ArrayBufferView` type.
* @param data The `BufferSource` to convert.
* @param type The `ArrayBufferView` constructor to use for the conversion.
* @returns The converted `ArrayBufferView`.
* @throws {TypeError} If the provided value is not of type `(ArrayBuffer or ArrayBufferView)`.
* @remarks If incoming data is ArrayBufferView and it's type is equal to specified type
* then it returns it without copying, otherwise it copies data into new ArrayBufferView
* because incoming data can be ArrayBufferView with offset and length which is not equal
* to buffer length
*/
static toView<T extends ArrayBufferView>(data: BufferSource, type: ArrayBufferViewConstructor<T>): T;
/**
* Checks if incoming data is BufferSource
* @param data Data to be checked
* @returns Returns `true` if incoming data is BufferSource, otherwise `false`
*/
static isBufferSource(data: any): data is BufferSource;
/**
* Checks if incoming data is ArraybufferView
* @param data Data to be checked
* @returns Returns `true` if incoming data is ArraybufferView, otherwise `false`
*/
static isArrayBufferView(data: any): data is ArrayBufferView;
/**
* Checks if buffers are equal
* @param a Buffer source
* @param b Buffer source
* @returns Returns `true` if buffers are equal, otherwise `false`
*/
static isEqual(a: BufferSource, b: BufferSource): boolean;
/**
* Concatenates buffers
* @param buffers List of buffers
* @returns Concatenated buffer
*/
static concat(...buffers: BufferSource[]): ArrayBuffer;
/**
* Concatenates buffers
* @param buffers List of buffers
* @returns Concatenated buffer
*/
static concat(buffers: BufferSource[]): ArrayBuffer;
/**
* Concatenates buffers and converts it into specified ArrayBufferView
* @param buffers List of buffers
* @param type ArrayBufferView constructor
* @returns Concatenated buffer of specified type
*/
static concat<T extends ArrayBufferView>(buffers: BufferSource[], type: ArrayBufferViewConstructor<T>): T;
}
type BufferEncoding = "utf8" | "binary" | "base64" | "base64url" | "hex" | string;
type TextEncoding = "ascii" | "utf8" | "utf16" | "utf16be" | "utf16le" | "usc2";
declare class Convert {
static isHex(data: any): data is string;
static isBase64(data: any): data is string;
static isBase64Url(data: any): data is string;
static ToString(buffer: BufferSource, enc?: BufferEncoding): string;
static FromString(str: string, enc?: BufferEncoding): ArrayBuffer;
/**
* Converts byte array to Base64 encoded string.
* @param buffer - Byte array to encode.
* @returns Base64 string.
*/
static ToBase64(buffer: BufferSource): string;
/**
* Converts byte array to Base64 encoded string.
* @param base64 - Base64 encoded string.
* @returns Byte array.
*/
static FromBase64(base64: string): ArrayBuffer;
/**
* Converts Base64Url encoded string to byte array.
* @param base64url - Base64Url encoded string.
* @returns Byte array.
*/
static FromBase64Url(base64url: string): ArrayBuffer;
/**
* Converts byte array to Base64Url encoded string.
* @param data - Byte array to encode.
* @returns Base64Url encoded string.
*/
static ToBase64Url(data: BufferSource): string;
protected static DEFAULT_UTF8_ENCODING: TextEncoding;
/**
* Converts JavaScript string to ArrayBuffer using specified encoding.
* @param text - JavaScript string to convert.
* @param encoding - Encoding to use. Default is 'utf8'.
* @returns ArrayBuffer representing input string.
*/
static FromUtf8String(text: string, encoding?: TextEncoding): ArrayBuffer;
/**
* Converts ArrayBuffer to JavaScript string using specified encoding.
* @param buffer - Buffer to convert.
* @param encoding - Encoding to use. Default is 'utf8'.
* @returns JavaScript string derived from input buffer.
*/
static ToUtf8String(buffer: BufferSource, encoding?: TextEncoding): string;
/**
* Converts binary string to ArrayBuffer.
* @param text - Binary string.
* @returns Byte array.
*/
static FromBinary(text: string): ArrayBuffer;
/**
* Converts buffer to binary string.
* @param buffer - Input buffer.
* @returns Binary string.
*/
static ToBinary(buffer: BufferSource): string;
/**
* Converts buffer to HEX string
* @param {BufferSource} buffer Incoming buffer
* @returns string
*/
static ToHex(buffer: BufferSource): string;
/**
* Converts HEX string to buffer
*
* @static
* @param {string} formatted
* @returns {Uint8Array}
*
* @memberOf Convert
*/
static FromHex(hexString: string): ArrayBuffer;
/**
* Converts UTF-16 encoded buffer to UTF-8 string
* @param buffer UTF-16 encoded buffer
* @param littleEndian Indicates whether the char code is stored in little- or big-endian format
* @returns UTF-8 string
*/
static ToUtf16String(buffer: BufferSource, littleEndian?: boolean): string;
/**
* Converts UTF-8 string to UTF-16 encoded buffer
* @param text UTF-8 string
* @param littleEndian Indicates whether the char code is stored in little- or big-endian format
* @returns UTF-16 encoded buffer
*/
static FromUtf16String(text: string, littleEndian?: boolean): ArrayBuffer;
protected static Base64Padding(base64: string): string;
/**
* Removes odd chars from string data
* @param data String data
*/
static formatString(data: string): string;
}
declare function assign(target: any, ...sources: any[]): any;
declare function combine(...buf: ArrayBuffer[]): ArrayBufferLike;
declare function isEqual(bytes1: ArrayBuffer, bytes2: ArrayBuffer): boolean;
export { type ArrayBufferViewConstructor, type BufferEncoding, type BufferSource, BufferSourceConverter, Convert, type TextEncoding, assign, combine, isEqual };
@@ -0,0 +1,8 @@
"use client";
import {
HeroUIProvider
} from "./chunk-6SNXZVD5.mjs";
import "./chunk-Q3W45BN5.mjs";
export {
HeroUIProvider
};
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('rearg', require('../rearg'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_interop_require_default.cjs",
"module": "../../esm/_interop_require_default.js"
}
@@ -0,0 +1,69 @@
const tab = 9 /* `\t` */
const space = 32 /* ` ` */
/**
* Remove initial and final spaces and tabs at the line breaks in `value`.
* Does not trim initial and final spaces and tabs of the value itself.
*
* @param {string} value
* Value to trim.
* @returns {string}
* Trimmed value.
*/
export function trimLines(value) {
const source = String(value)
const search = /\r?\n|\r/g
let match = search.exec(source)
let last = 0
/** @type {Array<string>} */
const lines = []
while (match) {
lines.push(
trimLine(source.slice(last, match.index), last > 0, true),
match[0]
)
last = match.index + match[0].length
match = search.exec(source)
}
lines.push(trimLine(source.slice(last), last > 0, false))
return lines.join('')
}
/**
* @param {string} value
* Line to trim.
* @param {boolean} start
* Whether to trim the start of the line.
* @param {boolean} end
* Whether to trim the end of the line.
* @returns {string}
* Trimmed line.
*/
function trimLine(value, start, end) {
let startIndex = 0
let endIndex = value.length
if (start) {
let code = value.codePointAt(startIndex)
while (code === tab || code === space) {
startIndex++
code = value.codePointAt(startIndex)
}
}
if (end) {
let code = value.codePointAt(endIndex - 1)
while (code === tab || code === space) {
endIndex--
code = value.codePointAt(endIndex - 1)
}
}
return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''
}
@@ -0,0 +1,32 @@
import type { DependencyList } from 'react';
import type { BasicTarget } from '../utils/domTarget';
export type Data = {
list: any[];
[key: string]: any;
};
export type Service<TData extends Data> = (currentData?: TData) => Promise<TData>;
export interface InfiniteScrollResult<TData extends Data> {
data: TData;
loading: boolean;
loadingMore: boolean;
error?: Error;
noMore: boolean;
loadMore: () => void;
loadMoreAsync: () => Promise<TData>;
reload: () => void;
reloadAsync: () => Promise<TData>;
cancel: () => void;
mutate: (data?: TData) => void;
}
export interface InfiniteScrollOptions<TData extends Data> {
target?: BasicTarget<Element | Document>;
isNoMore?: (data?: TData) => boolean;
threshold?: number;
direction?: 'bottom' | 'top';
manual?: boolean;
reloadDeps?: DependencyList;
onBefore?: () => void;
onSuccess?: (data: TData) => void;
onError?: (e: Error) => void;
onFinally?: (data?: TData, e?: Error) => void;
}
@@ -0,0 +1,67 @@
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*/
"use strict"
const { checkPublish, messages } = require("../util/check-publish")
const getAllowModules = require("../util/get-allow-modules")
const getConvertPath = require("../util/get-convert-path")
const getResolvePaths = require("../util/get-resolve-paths")
const getResolverConfig = require("../util/get-resolver-config")
const getTryExtensions = require("../util/get-try-extensions")
const visitRequire = require("../util/visit-require")
/**
* @typedef {[
* {
* allowModules?: import('../util/get-allow-modules').AllowModules;
* convertPath?: import('../util/get-convert-path').ConvertPath;
* resolvePaths?: import('../util/get-resolve-paths').ResolvePaths;
* resolverConfig?: import('../util/get-resolver-config').ResolverConfig;
* tryExtensions?: import('../util/get-try-extensions').TryExtensions;
* ignorePrivate?: boolean;
* }?
* ]} RuleOptions
*/
/** @type {import('./rule-module').RuleModule<{RuleOptions: RuleOptions}>} */
module.exports = {
meta: {
docs: {
description:
"disallow `require()` expressions which import private modules",
recommended: true,
url: "https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-unpublished-require.md",
},
type: "problem",
fixable: null,
schema: [
{
type: "object",
properties: {
allowModules: getAllowModules.schema,
convertPath: getConvertPath.schema,
resolvePaths: getResolvePaths.schema,
resolverConfig: getResolverConfig.schema,
tryExtensions: getTryExtensions.schema,
ignorePrivate: { type: "boolean", default: true },
},
additionalProperties: false,
},
],
messages,
},
create(context) {
const filePath = context.filename ?? context.getFilename()
const options = context.options[0] || {}
const ignorePrivate = options.ignorePrivate ?? true
if (filePath === "<input>") {
return {}
}
return visitRequire(context, {}, targets => {
checkPublish(context, filePath, targets, { ignorePrivate })
})
},
}
@@ -0,0 +1,2 @@
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"useLiteral", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
export default _default;
@@ -0,0 +1,10 @@
function _toSetter(t, e, n) {
e || (e = []);
var r = e.length++;
return Object.defineProperty({}, "_", {
set: function set(o) {
e[r] = o, t.apply(n, e);
}
});
}
export { _toSetter as default };
@@ -0,0 +1 @@
{"name":"space-separated-tokens","version":"2.0.2","requiresBuild":false,"files":{"license":{"checkedAt":1794532114367,"integrity":"sha512-cQvy4TvDNGTww5W7wo7SHRjv/0G8g3u/v8V2BhwwrAM+M5M2Z7W8hy+cQrU+e4exnULY2LrZ0EQqBk6Fj/Sdrw==","mode":420,"size":1099},"index.js":{"checkedAt":1794532114367,"integrity":"sha512-fUCbHKEqhwS5Fy0K0X9LO+bettPptwuxz7Dg5yjCjyulFAE1u9sW/4dJGcvW5nssfzYSO+dUk02dYE4yP2OeXw==","mode":420,"size":551},"package.json":{"checkedAt":1794532114367,"integrity":"sha512-iilq0gppGyoosA5X8iW5QPx6YqlYCvJy8VBSY2tjxBgMruTWQBwgpU4cKirTO1DTa7tC2mqjftJdb/G/9BUoyA==","mode":420,"size":1717},"readme.md":{"checkedAt":1794532114367,"integrity":"sha512-RAnKNLQ9E1AWN/xUBvbVAuviazlkn0i+bXxC9sneaeV0H8gO7T+lYSEzOD6Gssz7MV7zvgvaCWb6vs0cN0naRA==","mode":420,"size":3916},"index.d.ts":{"checkedAt":1794532114368,"integrity":"sha512-IGzIAA2FC2eqFt5IsQmbURdDQGOMSON7wPjQ4oDHVnZcDZrcK2ZiT6bRSKtey5oZqLO4citbwhGRaHphHCrveg==","mode":420,"size":470}}}
@@ -0,0 +1 @@
{"name":"ws","version":"8.18.3","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532089959,"integrity":"sha512-k5Nt9L7abYL4ZdjN2A+0y3Swi/5eTlU7jl5QDgQVQaNryZwPw6Rv72taxloEUcGT6VSgrYn5g8Ui3CgLjkjjdg==","mode":420,"size":1183},"browser.js":{"checkedAt":1794532089959,"integrity":"sha512-98uEc4/THUpHCA7AQwBKLHHmxV6leyGmPkDAYZsoBiigxjKL8//TIb/oUKDUJLc+s/pwdGA9LR0F9e7nZHfXUQ==","mode":420,"size":176},"lib/buffer-util.js":{"checkedAt":1794532089959,"integrity":"sha512-vC5tAgadeEEVDkPL+vxZkuMAOQY2P/ONuyrZyNOa+Z+kfhNDq6utH3LSfj4J4CK5yvqXildTmrPaJ+2kFoWW3g==","mode":420,"size":3056},"lib/constants.js":{"checkedAt":1794532089960,"integrity":"sha512-2adz5+m0vqfrNGmNIGC/UVxc0BDlWWDPjfcZJ5pbj3yjZPFBA758kGiTDOuD8F9Ph4GyApyRnOhgH4gJJwjizQ==","mode":420,"size":479},"lib/event-target.js":{"checkedAt":1794532089960,"integrity":"sha512-R9jHiLe1eFHmln+e5aDRg4AAQOd/VAcgmC6RzZkqA1Q/kBTL7VkM2/HGxqF/g+iKo9eXEC21qmrnVua/TgzcUw==","mode":420,"size":7321},"lib/extension.js":{"checkedAt":1794532089960,"integrity":"sha512-bJkScmJ8CkUr1TbJ42BKlgHULw8Xrs4L1xLfXA/VovOrwr1w8CX6CZCSt885RuKt5MIeU3cguKwmYZb4yBPL6A==","mode":420,"size":6183},"index.js":{"checkedAt":1794532089960,"integrity":"sha512-utXvailOTtYYCzsWUGoafuQ9fDg4QMTztI1vikRDVOImwyleHzATNg8lY5bwf+FmH0qiQj8yKFfmffKQChIb7A==","mode":420,"size":376},"lib/limiter.js":{"checkedAt":1794532089960,"integrity":"sha512-HBcxNzqTw9fyfd5LbgZWXQE+x/32cU7D4fWER1IFmgeQ5LxXHyAwH0XcY6VekSnjBOzzVReRNwxAFSlCyuzVdA==","mode":420,"size":1034},"lib/permessage-deflate.js":{"checkedAt":1794532089961,"integrity":"sha512-hmwI8SHFJZHOOpCuPC2z1kXkie2/q0JJLWySzKIJGYFXMB4QUf7z3u0dofGPjvIco0T186Sad/veYA5rzZoR2Q==","mode":420,"size":14510},"lib/receiver.js":{"checkedAt":1794532089961,"integrity":"sha512-DkMjy9UEPBs84LGFKjBm89JrA1s/8fvte18c7dnX2LH8GM03YN727XvbdmJrLqYT1+Ru2p+jJgTuAo0uy+Aw4w==","mode":420,"size":16460},"lib/sender.js":{"checkedAt":1794532089961,"integrity":"sha512-5zhvtTbdQ+wsuSbwrb55//IIfJgPQ2FBMwHATkmg0H67ZRUmdpHWKsQOdXTDbruIS6BXZJrIDzvcaQS9berokg==","mode":420,"size":16711},"lib/stream.js":{"checkedAt":1794532089961,"integrity":"sha512-idnvTqDMP/gNdpcinC75psV9Iwjz4Eac2UodvS2i4N4ZaIOXc/I8mG76b5HsGsOpYCJvBCfZwOCEazHqbwsu4g==","mode":420,"size":4204},"lib/subprotocol.js":{"checkedAt":1794532089961,"integrity":"sha512-u/oElSB+AiLXJrRb7/AYn4qmNR/mBoQjITy7buZmHyyGkBmiUM6Bv9EzcqLV7NWZt48W55UN6sq3jFzseCkQgw==","mode":420,"size":1498},"lib/validation.js":{"checkedAt":1794532089962,"integrity":"sha512-wLluGXJN8tRUvRsh6ENrEXQpwDY192b8qlYeC3avv2gbtA5+kxypVN+gz/kQj1LIRmy3Ar6I0dQk5zQSGRIeiA==","mode":420,"size":3903},"lib/websocket-server.js":{"checkedAt":1794532089962,"integrity":"sha512-jyNHuOsdA9yYTM1fBKCEWLKVRdny/7A3BuJyIw3NwUhk+shtqCHd+J/gbJ2V6Ol/4DGZgWj4cCyeskBA2SC0tw==","mode":420,"size":16393},"lib/websocket.js":{"checkedAt":1794532089962,"integrity":"sha512-n4kWe+RO2TbvrHBxOW2Dds93m/AaHpJt4DV6p6XIuUFfzX1KFS3jPg0S3+5qYfRdeCXdhTr9K8zw/a+kenNJ2Q==","mode":420,"size":36463},"package.json":{"checkedAt":1794532089962,"integrity":"sha512-ts1R11PQbZCtb9+b6WnVskllMaBRdO0pERS7qzv+Orse+hWQ2g46W4uhKzrdLd1RoaOX3qlX7dIvlbis+OXHaQ==","mode":420,"size":1723},"README.md":{"checkedAt":1794532089962,"integrity":"sha512-bdQv8TsNWvR6iW70TGo4PXDqhNiWLDgGMhyZzMdXqkx/WfBXTzcSKeSfmQa8Whvbqiaej9zTY5guNS0Ij8++8A==","mode":420,"size":15306},"wrapper.mjs":{"checkedAt":1794532089963,"integrity":"sha512-hfeCvtbNnXgxosChHURY6KCOBpwlBSkWnsiTH76kMUn1uGChJvQjEDnoZYdmm+U0NVKNBhqSRDSF/sX2WLY1LQ==","mode":420,"size":341}}}
@@ -0,0 +1,2 @@
export declare function updateClassMetadataWithTypescriptParameterTypes(target: object): void;
//# sourceMappingURL=updateClassMetadataWithTypescriptParameterTypes.d.ts.map
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/overlays/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useOverlayPosition} from './useOverlayPosition';\nexport {useOverlay} from './useOverlay';\nexport {useOverlayTrigger} from './useOverlayTrigger';\nexport {usePreventScroll} from './usePreventScroll';\nexport {ModalProvider, useModalProvider, OverlayProvider, OverlayContainer, useModal} from './useModal';\nexport {DismissButton} from './DismissButton';\nexport {ariaHideOutside} from './ariaHideOutside';\nexport {usePopover} from './usePopover';\nexport {useModalOverlay} from './useModalOverlay';\nexport {Overlay, useOverlayFocusContain} from './Overlay';\nexport {UNSTABLE_PortalProvider, useUNSTABLE_PortalContext} from './PortalProvider';\n\nexport type {AriaPositionProps, PositionAria} from './useOverlayPosition';\nexport type {AriaOverlayProps, OverlayAria} from './useOverlay';\nexport type {OverlayTriggerAria, OverlayTriggerProps} from './useOverlayTrigger';\nexport type {AriaModalOptions, ModalAria, ModalProviderAria, ModalProviderProps, OverlayContainerProps} from './useModal';\nexport type {DismissButtonProps} from './DismissButton';\nexport type {AriaPopoverProps, PopoverAria} from './usePopover';\nexport type {AriaModalOverlayProps, ModalOverlayAria} from './useModalOverlay';\nexport type {OverlayProps} from './Overlay';\nexport type {Placement, PlacementAxis, PositionProps} from '@react-types/overlays';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,8 @@
'use strict';
const semver = require('semver');
const eslintPkg = require('eslint/package.json');
module.exports = function getMessageData(messageId, message) {
return messageId && semver.satisfies(eslintPkg.version, '>= 4.15') ? { messageId } : { message };
};
@@ -0,0 +1,101 @@
{
"name": "@xterm/xterm",
"description": "Full xterm terminal, in your browser",
"version": "5.5.0",
"main": "lib/xterm.js",
"style": "css/xterm.css",
"types": "typings/xterm.d.ts",
"repository": "https://github.com/xtermjs/xterm.js",
"license": "MIT",
"keywords": [
"cli",
"command-line",
"console",
"pty",
"shell",
"ssh",
"styles",
"terminal-emulator",
"terminal",
"tty",
"vt100",
"webgl",
"xterm"
],
"scripts": {
"prepackage": "npm run build",
"package": "webpack",
"package-headless": "webpack --config ./webpack.config.headless.js",
"postpackage-headless": "node ./bin/package_headless.js",
"start": "node demo/start",
"start-server-only": "node demo/start-server-only",
"build-demo": "webpack --config ./demo/webpack.config.js",
"lint": "eslint -c .eslintrc.json --max-warnings 0 --ext .ts src/ addons/",
"lint-api": "eslint --no-eslintrc -c .eslintrc.json.typings --max-warnings 0 --no-ignore --ext .d.ts typings/",
"test": "npm run test-unit",
"posttest": "npm run lint",
"test-api": "npm run test-api-chromium",
"test-api-chromium": "node ./bin/test_api.js --browser=chromium --timeout=20000",
"test-api-firefox": "node ./bin/test_api.js --browser=firefox --timeout=20000",
"test-api-webkit": "node ./bin/test_api.js --browser=webkit --timeout=20000",
"test-playwright": "node ./bin/test_playwright.js --workers=75%",
"test-playwright-chromium": "node ./bin/test_playwright.js --workers=75% \"--project=Chrome Stable\"",
"test-playwright-firefox": "node ./bin/test_playwright.js --workers=75% \"--project=Firefox Stable\"",
"test-playwright-webkit": "node ./bin/test_playwright.js --workers=75% \"--project=WebKit\"",
"test-playwright-debug": "node ./bin/test_playwright.js --workers=1 --headed --timeout=30000",
"test-unit": "node ./bin/test.js",
"test-unit-coverage": "node ./bin/test.js --coverage",
"test-unit-dev": "cross-env NODE_PATH='./out' mocha",
"build": "tsc -b ./tsconfig.all.json",
"install-addons": "node ./bin/install-addons.js",
"presetup": "npm run install-addons",
"setup": "npm run build",
"prepublishOnly": "npm run package",
"watch": "tsc -b -w ./tsconfig.all.json --preserveWatchOutput",
"benchmark": "NODE_PATH=./out xterm-benchmark -r 5 -c test/benchmark/benchmark.json",
"benchmark-baseline": "NODE_PATH=./out xterm-benchmark -r 5 -c test/benchmark/benchmark.json --baseline out-test/benchmark/test/benchmark/*benchmark.js",
"benchmark-eval": "NODE_PATH=./out xterm-benchmark -r 5 -c test/benchmark/benchmark.json --eval out-test/benchmark/test/benchmark/*benchmark.js",
"clean": "rm -rf lib out addons/*/lib addons/*/out",
"vtfeatures": "node bin/extract_vtfeatures.js src/**/*.ts src/*.ts"
},
"devDependencies": {
"@lunapaint/png-codec": "^0.2.0",
"@playwright/test": "^1.37.1",
"@types/chai": "^4.2.22",
"@types/debug": "^4.1.7",
"@types/deep-equal": "^1.0.1",
"@types/express": "4",
"@types/express-ws": "^3.0.1",
"@types/glob": "^7.2.0",
"@types/jsdom": "^16.2.13",
"@types/mocha": "^9.0.0",
"@types/node": "^18.16.0",
"@types/utf8": "^3.0.0",
"@types/webpack": "^5.28.0",
"@types/ws": "^8.2.0",
"@typescript-eslint/eslint-plugin": "^6.2.00",
"@typescript-eslint/parser": "^6.2.00",
"chai": "^4.3.4",
"cross-env": "^7.0.3",
"deep-equal": "^2.0.5",
"eslint": "^8.56.0",
"eslint-plugin-jsdoc": "^46.9.1",
"express": "^4.17.1",
"express-ws": "^5.0.2",
"glob": "^7.2.0",
"jsdom": "^18.0.1",
"mocha": "^10.1.0",
"mustache": "^4.2.0",
"node-pty": "1.1.0-beta5",
"nyc": "^15.1.0",
"source-map-loader": "^3.0.0",
"source-map-support": "^0.5.20",
"ts-loader": "^9.3.1",
"typescript": "^5.1.6",
"utf8": "^3.0.0",
"webpack": "^5.61.0",
"webpack-cli": "^4.9.1",
"ws": "^8.2.3",
"xterm-benchmark": "^0.3.1"
}
}
@@ -0,0 +1 @@
{"version":3,"file":"curryBuildPlanServiceNodeFromClassElementMetadata.spec.d.ts","sourceRoot":"","sources":["../../../../src/planning/actions/curryBuildPlanServiceNodeFromClassElementMetadata.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
// Not meant to be used directly
// Omitting all exports so that they don't appear in IDE autocomplete.
export {};
@@ -0,0 +1,30 @@
{
"name": "fast-diff",
"version": "1.3.0",
"description": "Fast Javascript text diff",
"author": "Jason Chen <jhchen7@gmail.com>",
"main": "diff.js",
"types": "diff.d.ts",
"files": [
"diff.d.ts"
],
"devDependencies": {
"lodash": "~4.17.21",
"nyc": "~15.1.0",
"seedrandom": "~3.0.5"
},
"repository": {
"type": "git",
"url": "https://github.com/jhchen/fast-diff"
},
"bugs": {
"url": "https://github.com/jhchen/fast-diff/issues"
},
"scripts": {
"test": "nyc node test.js"
},
"license": "Apache-2.0",
"keywords": [
"diff"
]
}
@@ -0,0 +1,3 @@
declare const _default: <T>(value: T) => (T & any[]) | T[];
export default _default;
//# sourceMappingURL=convertToArrayPayload.d.ts.map
@@ -0,0 +1,131 @@
'use strict';
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
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); }
var colors = require('@colors/colors/safe');
var _require = require('triple-beam'),
LEVEL = _require.LEVEL,
MESSAGE = _require.MESSAGE;
//
// Fix colors not appearing in non-tty environments
//
colors.enabled = true;
/**
* @property {RegExp} hasSpace
* Simple regex to check for presence of spaces.
*/
var hasSpace = /\s+/;
/*
* Colorizer format. Wraps the `level` and/or `message` properties
* of the `info` objects with ANSI color codes based on a few options.
*/
var Colorizer = /*#__PURE__*/function () {
function Colorizer() {
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
_classCallCheck(this, Colorizer);
if (opts.colors) {
this.addColors(opts.colors);
}
this.options = opts;
}
/*
* Adds the colors Object to the set of allColors
* known by the Colorizer
*
* @param {Object} colors Set of color mappings to add.
*/
return _createClass(Colorizer, [{
key: "addColors",
value:
/*
* Adds the colors Object to the set of allColors
* known by the Colorizer
*
* @param {Object} colors Set of color mappings to add.
*/
function addColors(clrs) {
return Colorizer.addColors(clrs);
}
/*
* function colorize (lookup, level, message)
* Performs multi-step colorization using @colors/colors/safe
*/
}, {
key: "colorize",
value: function colorize(lookup, level, message) {
if (typeof message === 'undefined') {
message = level;
}
//
// If the color for the level is just a string
// then attempt to colorize the message with it.
//
if (!Array.isArray(Colorizer.allColors[lookup])) {
return colors[Colorizer.allColors[lookup]](message);
}
//
// If it is an Array then iterate over that Array, applying
// the colors function for each item.
//
for (var i = 0, len = Colorizer.allColors[lookup].length; i < len; i++) {
message = colors[Colorizer.allColors[lookup][i]](message);
}
return message;
}
/*
* function transform (info, opts)
* Attempts to colorize the { level, message } of the given
* `logform` info object.
*/
}, {
key: "transform",
value: function transform(info, opts) {
if (opts.all && typeof info[MESSAGE] === 'string') {
info[MESSAGE] = this.colorize(info[LEVEL], info.level, info[MESSAGE]);
}
if (opts.level || opts.all || !opts.message) {
info.level = this.colorize(info[LEVEL], info.level);
}
if (opts.all || opts.message) {
info.message = this.colorize(info[LEVEL], info.level, info.message);
}
return info;
}
}], [{
key: "addColors",
value: function addColors(clrs) {
var nextColors = Object.keys(clrs).reduce(function (acc, level) {
acc[level] = hasSpace.test(clrs[level]) ? clrs[level].split(hasSpace) : clrs[level];
return acc;
}, {});
Colorizer.allColors = Object.assign({}, Colorizer.allColors || {}, nextColors);
return Colorizer.allColors;
}
}]);
}();
/*
* function colorize (info)
* Returns a new instance of the colorize Format that applies
* level colors to `info` objects. This was previously exposed
* as { colorize: true } to transports in `winston < 3.0.0`.
*/
module.exports = function (opts) {
return new Colorizer(opts);
};
//
// Attach the Colorizer for registration purposes
//
module.exports.Colorizer = module.exports.Format = Colorizer;
@@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var sliderRole = {
abstract: false,
accessibleNameRequired: true,
baseConcepts: [],
childrenPresentational: true,
nameFrom: ['author'],
prohibitedProps: [],
props: {
'aria-errormessage': null,
'aria-haspopup': null,
'aria-invalid': null,
'aria-readonly': null,
'aria-valuetext': null,
'aria-orientation': 'horizontal',
'aria-valuemax': '100',
'aria-valuemin': '0'
},
relatedConcepts: [{
concept: {
attributes: [{
name: 'type',
value: 'range'
}],
name: 'input'
},
module: 'HTML'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {
'aria-valuenow': null
},
superClass: [['roletype', 'widget', 'input'], ['roletype', 'structure', 'range']]
};
var _default = exports.default = sliderRole;
@@ -0,0 +1,15 @@
import { EditorState } from '@codemirror/state';
import { EditorView } from '@codemirror/view';
import { type ReactCodeMirrorProps } from '.';
export declare const ExternalChange: import("@codemirror/state").AnnotationType<boolean>;
export interface UseCodeMirror extends ReactCodeMirrorProps {
container?: HTMLDivElement | null;
}
export declare function useCodeMirror(props: UseCodeMirror): {
state: EditorState | undefined;
setState: import("react").Dispatch<import("react").SetStateAction<EditorState | undefined>>;
view: EditorView | undefined;
setView: import("react").Dispatch<import("react").SetStateAction<EditorView | undefined>>;
container: HTMLDivElement | null | undefined;
setContainer: import("react").Dispatch<import("react").SetStateAction<HTMLDivElement | null | undefined>>;
};
@@ -0,0 +1 @@
{"version":3,"names":["_index","require","getNameFromLiteralId","id","isNullLiteral","isRegExpLiteral","pattern","flags","isTemplateLiteral","quasis","map","quasi","value","raw","join","undefined","String","getObjectMemberKey","node","computed","isLiteral","key","getFunctionName","parent","name","originalNode","prefix","isObjectProperty","isObjectMethod","isClassMethod","kind","isVariableDeclarator","init","isAssignmentExpression","operator","right","left","isIdentifier","isPrivateName"],"sources":["../../src/retrievers/getFunctionName.ts"],"sourcesContent":["import type * as t from \"../index.ts\";\n\nimport {\n isAssignmentExpression,\n isClassMethod,\n isIdentifier,\n isLiteral,\n isNullLiteral,\n isObjectMethod,\n isObjectProperty,\n isPrivateName,\n isRegExpLiteral,\n isTemplateLiteral,\n isVariableDeclarator,\n} from \"../validators/generated/index.ts\";\n\nfunction getNameFromLiteralId(id: t.Literal): string {\n if (isNullLiteral(id)) {\n return \"null\";\n }\n\n if (isRegExpLiteral(id)) {\n return `/${id.pattern}/${id.flags}`;\n }\n\n if (isTemplateLiteral(id)) {\n return id.quasis.map(quasi => quasi.value.raw).join(\"\");\n }\n\n if (id.value !== undefined) {\n return String(id.value);\n }\n\n return null;\n}\n\nfunction getObjectMemberKey(\n node: t.ObjectProperty | t.ObjectMethod | t.ClassProperty | t.ClassMethod,\n): t.Expression | t.PrivateName {\n if (!node.computed || isLiteral(node.key)) {\n return node.key;\n }\n}\n\ntype GetFunctionNameResult = {\n name: string;\n originalNode: t.Node;\n} | null;\n\nexport default function getFunctionName(\n node: t.ObjectMethod | t.ClassMethod,\n): GetFunctionNameResult;\nexport default function getFunctionName(\n node: t.Function | t.Class,\n parent: t.Node,\n): GetFunctionNameResult;\nexport default function getFunctionName(\n node: t.Function | t.Class,\n parent?: t.Node,\n): GetFunctionNameResult {\n if (\"id\" in node && node.id) {\n return {\n name: node.id.name,\n originalNode: node.id,\n };\n }\n\n let prefix = \"\";\n\n let id;\n if (isObjectProperty(parent, { value: node })) {\n // { foo: () => {} };\n id = getObjectMemberKey(parent);\n } else if (isObjectMethod(node) || isClassMethod(node)) {\n // { foo() {} };\n id = getObjectMemberKey(node);\n if (node.kind === \"get\") prefix = \"get \";\n else if (node.kind === \"set\") prefix = \"set \";\n } else if (isVariableDeclarator(parent, { init: node })) {\n // let foo = function () {};\n id = parent.id;\n } else if (isAssignmentExpression(parent, { operator: \"=\", right: node })) {\n // foo = function () {};\n id = parent.left;\n }\n\n if (!id) return null;\n\n const name = isLiteral(id)\n ? getNameFromLiteralId(id)\n : isIdentifier(id)\n ? id.name\n : isPrivateName(id)\n ? id.id.name\n : null;\n if (name == null) return null;\n\n return { name: prefix + name, originalNode: id };\n}\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AAcA,SAASC,oBAAoBA,CAACC,EAAa,EAAU;EACnD,IAAI,IAAAC,oBAAa,EAACD,EAAE,CAAC,EAAE;IACrB,OAAO,MAAM;EACf;EAEA,IAAI,IAAAE,sBAAe,EAACF,EAAE,CAAC,EAAE;IACvB,OAAO,IAAIA,EAAE,CAACG,OAAO,IAAIH,EAAE,CAACI,KAAK,EAAE;EACrC;EAEA,IAAI,IAAAC,wBAAiB,EAACL,EAAE,CAAC,EAAE;IACzB,OAAOA,EAAE,CAACM,MAAM,CAACC,GAAG,CAACC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,GAAG,CAAC,CAACC,IAAI,CAAC,EAAE,CAAC;EACzD;EAEA,IAAIX,EAAE,CAACS,KAAK,KAAKG,SAAS,EAAE;IAC1B,OAAOC,MAAM,CAACb,EAAE,CAACS,KAAK,CAAC;EACzB;EAEA,OAAO,IAAI;AACb;AAEA,SAASK,kBAAkBA,CACzBC,IAAyE,EAC3C;EAC9B,IAAI,CAACA,IAAI,CAACC,QAAQ,IAAI,IAAAC,gBAAS,EAACF,IAAI,CAACG,GAAG,CAAC,EAAE;IACzC,OAAOH,IAAI,CAACG,GAAG;EACjB;AACF;AAce,SAASC,eAAeA,CACrCJ,IAA0B,EAC1BK,MAAe,EACQ;EACvB,IAAI,IAAI,IAAIL,IAAI,IAAIA,IAAI,CAACf,EAAE,EAAE;IAC3B,OAAO;MACLqB,IAAI,EAAEN,IAAI,CAACf,EAAE,CAACqB,IAAI;MAClBC,YAAY,EAAEP,IAAI,CAACf;IACrB,CAAC;EACH;EAEA,IAAIuB,MAAM,GAAG,EAAE;EAEf,IAAIvB,EAAE;EACN,IAAI,IAAAwB,uBAAgB,EAACJ,MAAM,EAAE;IAAEX,KAAK,EAAEM;EAAK,CAAC,CAAC,EAAE;IAE7Cf,EAAE,GAAGc,kBAAkB,CAACM,MAAM,CAAC;EACjC,CAAC,MAAM,IAAI,IAAAK,qBAAc,EAACV,IAAI,CAAC,IAAI,IAAAW,oBAAa,EAACX,IAAI,CAAC,EAAE;IAEtDf,EAAE,GAAGc,kBAAkB,CAACC,IAAI,CAAC;IAC7B,IAAIA,IAAI,CAACY,IAAI,KAAK,KAAK,EAAEJ,MAAM,GAAG,MAAM,CAAC,KACpC,IAAIR,IAAI,CAACY,IAAI,KAAK,KAAK,EAAEJ,MAAM,GAAG,MAAM;EAC/C,CAAC,MAAM,IAAI,IAAAK,2BAAoB,EAACR,MAAM,EAAE;IAAES,IAAI,EAAEd;EAAK,CAAC,CAAC,EAAE;IAEvDf,EAAE,GAAGoB,MAAM,CAACpB,EAAE;EAChB,CAAC,MAAM,IAAI,IAAA8B,6BAAsB,EAACV,MAAM,EAAE;IAAEW,QAAQ,EAAE,GAAG;IAAEC,KAAK,EAAEjB;EAAK,CAAC,CAAC,EAAE;IAEzEf,EAAE,GAAGoB,MAAM,CAACa,IAAI;EAClB;EAEA,IAAI,CAACjC,EAAE,EAAE,OAAO,IAAI;EAEpB,MAAMqB,IAAI,GAAG,IAAAJ,gBAAS,EAACjB,EAAE,CAAC,GACtBD,oBAAoB,CAACC,EAAE,CAAC,GACxB,IAAAkC,mBAAY,EAAClC,EAAE,CAAC,GACdA,EAAE,CAACqB,IAAI,GACP,IAAAc,oBAAa,EAACnC,EAAE,CAAC,GACfA,EAAE,CAACA,EAAE,CAACqB,IAAI,GACV,IAAI;EACZ,IAAIA,IAAI,IAAI,IAAI,EAAE,OAAO,IAAI;EAE7B,OAAO;IAAEA,IAAI,EAAEE,MAAM,GAAGF,IAAI;IAAEC,YAAY,EAAEtB;EAAG,CAAC;AAClD","ignoreList":[]}
@@ -0,0 +1,51 @@
var arrayReduce = require('./_arrayReduce'),
baseEach = require('./_baseEach'),
baseIteratee = require('./_baseIteratee'),
baseReduce = require('./_baseReduce'),
isArray = require('./isArray');
/**
* Reduces `collection` to a value which is the accumulated result of running
* each element in `collection` thru `iteratee`, where each successive
* invocation is supplied the return value of the previous. If `accumulator`
* is not given, the first element of `collection` is used as the initial
* value. The iteratee is invoked with four arguments:
* (accumulator, value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.reduce`, `_.reduceRight`, and `_.transform`.
*
* The guarded methods are:
* `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
* and `sortBy`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @returns {*} Returns the accumulated value.
* @see _.reduceRight
* @example
*
* _.reduce([1, 2], function(sum, n) {
* return sum + n;
* }, 0);
* // => 3
*
* _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
* return result;
* }, {});
* // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
*/
function reduce(collection, iteratee, accumulator) {
var func = isArray(collection) ? arrayReduce : baseReduce,
initAccum = arguments.length < 3;
return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);
}
module.exports = reduce;
@@ -0,0 +1,102 @@
"use strict";
var RelativeDistinguishedName_1, RDNSequence_1, Name_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Name = exports.RDNSequence = exports.RelativeDistinguishedName = exports.AttributeTypeAndValue = exports.AttributeValue = exports.DirectoryString = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const pvtsutils_1 = require("pvtsutils");
let DirectoryString = class DirectoryString {
constructor(params = {}) {
Object.assign(this, params);
}
toString() {
return (this.bmpString ||
this.printableString ||
this.teletexString ||
this.universalString ||
this.utf8String ||
"");
}
};
exports.DirectoryString = DirectoryString;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.TeletexString })
], DirectoryString.prototype, "teletexString", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.PrintableString })
], DirectoryString.prototype, "printableString", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.UniversalString })
], DirectoryString.prototype, "universalString", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Utf8String })
], DirectoryString.prototype, "utf8String", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.BmpString })
], DirectoryString.prototype, "bmpString", void 0);
exports.DirectoryString = DirectoryString = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })
], DirectoryString);
let AttributeValue = class AttributeValue extends DirectoryString {
constructor(params = {}) {
super(params);
Object.assign(this, params);
}
toString() {
return this.ia5String || (this.anyValue ? pvtsutils_1.Convert.ToHex(this.anyValue) : super.toString());
}
};
exports.AttributeValue = AttributeValue;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.IA5String })
], AttributeValue.prototype, "ia5String", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any })
], AttributeValue.prototype, "anyValue", void 0);
exports.AttributeValue = AttributeValue = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })
], AttributeValue);
class AttributeTypeAndValue {
constructor(params = {}) {
this.type = "";
this.value = new AttributeValue();
Object.assign(this, params);
}
}
exports.AttributeTypeAndValue = AttributeTypeAndValue;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })
], AttributeTypeAndValue.prototype, "type", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: AttributeValue })
], AttributeTypeAndValue.prototype, "value", void 0);
let RelativeDistinguishedName = RelativeDistinguishedName_1 = class RelativeDistinguishedName extends asn1_schema_1.AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, RelativeDistinguishedName_1.prototype);
}
};
exports.RelativeDistinguishedName = RelativeDistinguishedName;
exports.RelativeDistinguishedName = RelativeDistinguishedName = RelativeDistinguishedName_1 = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Set, itemType: AttributeTypeAndValue })
], RelativeDistinguishedName);
let RDNSequence = RDNSequence_1 = class RDNSequence extends asn1_schema_1.AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, RDNSequence_1.prototype);
}
};
exports.RDNSequence = RDNSequence;
exports.RDNSequence = RDNSequence = RDNSequence_1 = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence, itemType: RelativeDistinguishedName })
], RDNSequence);
let Name = Name_1 = class Name extends RDNSequence {
constructor(items) {
super(items);
Object.setPrototypeOf(this, Name_1.prototype);
}
};
exports.Name = Name;
exports.Name = Name = Name_1 = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })
], Name);
@@ -0,0 +1,48 @@
var baseFlatten = require('./_baseFlatten'),
baseOrderBy = require('./_baseOrderBy'),
baseRest = require('./_baseRest'),
isIterateeCall = require('./_isIterateeCall');
/**
* Creates an array of elements, sorted in ascending order by the results of
* running each element in a collection thru each iteratee. This method
* performs a stable sort, that is, it preserves the original sort order of
* equal elements. The iteratees are invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {...(Function|Function[])} [iteratees=[_.identity]]
* The iteratees to sort by.
* @returns {Array} Returns the new sorted array.
* @example
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 30 },
* { 'user': 'barney', 'age': 34 }
* ];
*
* _.sortBy(users, [function(o) { return o.user; }]);
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
*
* _.sortBy(users, ['user', 'age']);
* // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
*/
var sortBy = baseRest(function(collection, iteratees) {
if (collection == null) {
return [];
}
var length = iteratees.length;
if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
iteratees = [];
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
iteratees = [iteratees[0]];
}
return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
});
module.exports = sortBy;
@@ -0,0 +1,163 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.algSignToCOSEInfoMap = void 0;
exports.verifyAttestationWithMetadata = verifyAttestationWithMetadata;
const convertCertBufferToPEM_js_1 = require("../helpers/convertCertBufferToPEM.js");
const validateCertificatePath_js_1 = require("../helpers/validateCertificatePath.js");
const decodeCredentialPublicKey_js_1 = require("../helpers/decodeCredentialPublicKey.js");
const cose_js_1 = require("../helpers/cose.js");
/**
* Match properties of the authenticator's attestation statement against expected values as
* registered with the FIDO Alliance Metadata Service
*/
async function verifyAttestationWithMetadata({ statement, credentialPublicKey, x5c, attestationStatementAlg, }) {
const { authenticationAlgorithms, authenticatorGetInfo, attestationRootCertificates, } = statement;
// Make sure the alg in the attestation statement matches one of the ones specified in metadata
const keypairCOSEAlgs = new Set();
authenticationAlgorithms.forEach((algSign) => {
// Map algSign string to { kty, alg, crv }
const algSignCOSEINFO = exports.algSignToCOSEInfoMap[algSign];
// Keeping this statement here just in case MDS returns something unexpected
if (algSignCOSEINFO) {
keypairCOSEAlgs.add(algSignCOSEINFO);
}
});
// Extract the public key's COSE info for comparison
const decodedPublicKey = (0, decodeCredentialPublicKey_js_1.decodeCredentialPublicKey)(credentialPublicKey);
const kty = decodedPublicKey.get(cose_js_1.COSEKEYS.kty);
const alg = decodedPublicKey.get(cose_js_1.COSEKEYS.alg);
if (!kty) {
throw new Error('Credential public key was missing kty');
}
if (!alg) {
throw new Error('Credential public key was missing alg');
}
if (!kty) {
throw new Error('Credential public key was missing kty');
}
// Assume everything is a number because these values should be
const publicKeyCOSEInfo = { kty, alg };
if ((0, cose_js_1.isCOSEPublicKeyEC2)(decodedPublicKey)) {
const crv = decodedPublicKey.get(cose_js_1.COSEKEYS.crv);
publicKeyCOSEInfo.crv = crv;
}
/**
* Attempt to match the credential public key's algorithm to one specified in the device's
* metadata
*/
let foundMatch = false;
for (const keypairAlg of keypairCOSEAlgs) {
// Make sure algorithm and key type match
if (keypairAlg.alg === publicKeyCOSEInfo.alg &&
keypairAlg.kty === publicKeyCOSEInfo.kty) {
// If not an RSA keypair then make sure curve numbers match too
if ((keypairAlg.kty === cose_js_1.COSEKTY.EC2 || keypairAlg.kty === cose_js_1.COSEKTY.OKP) &&
keypairAlg.crv === publicKeyCOSEInfo.crv) {
foundMatch = true;
}
else {
// We've matched an RSA public key's properties
foundMatch = true;
}
}
if (foundMatch) {
break;
}
}
// Make sure the public key is one of the allowed algorithms
if (!foundMatch) {
/**
* Craft some useful error output from the MDS algorithms
*
* Example:
*
* ```
* [
* 'rsassa_pss_sha256_raw' (COSE info: { kty: 3, alg: -37 }),
* 'secp256k1_ecdsa_sha256_raw' (COSE info: { kty: 2, alg: -47, crv: 8 })
* ]
* ```
*/
const debugMDSAlgs = authenticationAlgorithms.map((algSign) => `'${algSign}' (COSE info: ${stringifyCOSEInfo(exports.algSignToCOSEInfoMap[algSign])})`);
const strMDSAlgs = JSON.stringify(debugMDSAlgs, null, 2).replace(/"/g, '');
/**
* Construct useful error output about the public key
*/
const strPubKeyAlg = stringifyCOSEInfo(publicKeyCOSEInfo);
throw new Error(`Public key parameters ${strPubKeyAlg} did not match any of the following metadata algorithms:\n${strMDSAlgs}`);
}
/**
* Confirm the attestation statement's algorithm is one supported according to metadata
*/
if (attestationStatementAlg !== undefined &&
authenticatorGetInfo?.algorithms !== undefined) {
const getInfoAlgs = authenticatorGetInfo.algorithms.map((_alg) => _alg.alg);
if (getInfoAlgs.indexOf(attestationStatementAlg) < 0) {
throw new Error(`Attestation statement alg ${attestationStatementAlg} did not match one of ${getInfoAlgs}`);
}
}
// Prepare to check the certificate chain
const authenticatorCerts = x5c.map(convertCertBufferToPEM_js_1.convertCertBufferToPEM);
const statementRootCerts = attestationRootCertificates.map(convertCertBufferToPEM_js_1.convertCertBufferToPEM);
/**
* If an authenticator returns exactly one certificate in its x5c, and that cert is found in the
* metadata statement then the authenticator is "self-referencing". In this case we forego
* certificate chain validation.
*/
let authenticatorIsSelfReferencing = false;
if (authenticatorCerts.length === 1 &&
statementRootCerts.indexOf(authenticatorCerts[0]) >= 0) {
authenticatorIsSelfReferencing = true;
}
if (!authenticatorIsSelfReferencing) {
try {
await (0, validateCertificatePath_js_1.validateCertificatePath)(authenticatorCerts, statementRootCerts);
}
catch (err) {
const _err = err;
throw new Error(`Could not validate certificate path with any metadata root certificates: ${_err.message}`);
}
}
return true;
}
/**
* Convert ALG_SIGN values to COSE info
*
* Values pulled from `ALG_KEY_COSE` definitions in the FIDO Registry of Predefined Values
*
* https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#authentication-algorithms
*/
exports.algSignToCOSEInfoMap = {
secp256r1_ecdsa_sha256_raw: { kty: 2, alg: -7, crv: 1 },
secp256r1_ecdsa_sha256_der: { kty: 2, alg: -7, crv: 1 },
rsassa_pss_sha256_raw: { kty: 3, alg: -37 },
rsassa_pss_sha256_der: { kty: 3, alg: -37 },
secp256k1_ecdsa_sha256_raw: { kty: 2, alg: -47, crv: 8 },
secp256k1_ecdsa_sha256_der: { kty: 2, alg: -47, crv: 8 },
rsassa_pss_sha384_raw: { kty: 3, alg: -38 },
rsassa_pkcsv15_sha256_raw: { kty: 3, alg: -257 },
rsassa_pkcsv15_sha384_raw: { kty: 3, alg: -258 },
rsassa_pkcsv15_sha512_raw: { kty: 3, alg: -259 },
rsassa_pkcsv15_sha1_raw: { kty: 3, alg: -65535 },
secp384r1_ecdsa_sha384_raw: { kty: 2, alg: -35, crv: 2 },
secp512r1_ecdsa_sha256_raw: { kty: 2, alg: -36, crv: 3 },
ed25519_eddsa_sha512_raw: { kty: 1, alg: -8, crv: 6 },
};
/**
* A helper to format COSEInfo a little nicer than we can achieve with JSON.stringify()
*
* Input: `{ "kty": 3, "alg": -257 }`
*
* Output: `"{ kty: 3, alg: -257 }"`
*/
function stringifyCOSEInfo(info) {
const { kty, alg, crv } = info;
let toReturn = '';
if (kty !== cose_js_1.COSEKTY.RSA) {
toReturn = `{ kty: ${kty}, alg: ${alg}, crv: ${crv} }`;
}
else {
toReturn = `{ kty: ${kty}, alg: ${alg} }`;
}
return toReturn;
}
@@ -0,0 +1,10 @@
// Generated using scripts/write-encode-map.ts
function restoreDiff(arr) {
for (let i = 1; i < arr.length; i++) {
arr[i][0] += arr[i - 1][0] + 1;
}
return arr;
}
// prettier-ignore
export default new Map(/* #__PURE__ */ restoreDiff([[9, "&Tab;"], [0, "&NewLine;"], [22, "&excl;"], [0, "&quot;"], [0, "&num;"], [0, "&dollar;"], [0, "&percnt;"], [0, "&amp;"], [0, "&apos;"], [0, "&lpar;"], [0, "&rpar;"], [0, "&ast;"], [0, "&plus;"], [0, "&comma;"], [1, "&period;"], [0, "&sol;"], [10, "&colon;"], [0, "&semi;"], [0, { v: "&lt;", n: 8402, o: "&nvlt;" }], [0, { v: "&equals;", n: 8421, o: "&bne;" }], [0, { v: "&gt;", n: 8402, o: "&nvgt;" }], [0, "&quest;"], [0, "&commat;"], [26, "&lbrack;"], [0, "&bsol;"], [0, "&rbrack;"], [0, "&Hat;"], [0, "&lowbar;"], [0, "&DiacriticalGrave;"], [5, { n: 106, o: "&fjlig;" }], [20, "&lbrace;"], [0, "&verbar;"], [0, "&rbrace;"], [34, "&nbsp;"], [0, "&iexcl;"], [0, "&cent;"], [0, "&pound;"], [0, "&curren;"], [0, "&yen;"], [0, "&brvbar;"], [0, "&sect;"], [0, "&die;"], [0, "&copy;"], [0, "&ordf;"], [0, "&laquo;"], [0, "&not;"], [0, "&shy;"], [0, "&circledR;"], [0, "&macr;"], [0, "&deg;"], [0, "&PlusMinus;"], [0, "&sup2;"], [0, "&sup3;"], [0, "&acute;"], [0, "&micro;"], [0, "&para;"], [0, "&centerdot;"], [0, "&cedil;"], [0, "&sup1;"], [0, "&ordm;"], [0, "&raquo;"], [0, "&frac14;"], [0, "&frac12;"], [0, "&frac34;"], [0, "&iquest;"], [0, "&Agrave;"], [0, "&Aacute;"], [0, "&Acirc;"], [0, "&Atilde;"], [0, "&Auml;"], [0, "&angst;"], [0, "&AElig;"], [0, "&Ccedil;"], [0, "&Egrave;"], [0, "&Eacute;"], [0, "&Ecirc;"], [0, "&Euml;"], [0, "&Igrave;"], [0, "&Iacute;"], [0, "&Icirc;"], [0, "&Iuml;"], [0, "&ETH;"], [0, "&Ntilde;"], [0, "&Ograve;"], [0, "&Oacute;"], [0, "&Ocirc;"], [0, "&Otilde;"], [0, "&Ouml;"], [0, "&times;"], [0, "&Oslash;"], [0, "&Ugrave;"], [0, "&Uacute;"], [0, "&Ucirc;"], [0, "&Uuml;"], [0, "&Yacute;"], [0, "&THORN;"], [0, "&szlig;"], [0, "&agrave;"], [0, "&aacute;"], [0, "&acirc;"], [0, "&atilde;"], [0, "&auml;"], [0, "&aring;"], [0, "&aelig;"], [0, "&ccedil;"], [0, "&egrave;"], [0, "&eacute;"], [0, "&ecirc;"], [0, "&euml;"], [0, "&igrave;"], [0, "&iacute;"], [0, "&icirc;"], [0, "&iuml;"], [0, "&eth;"], [0, "&ntilde;"], [0, "&ograve;"], [0, "&oacute;"], [0, "&ocirc;"], [0, "&otilde;"], [0, "&ouml;"], [0, "&div;"], [0, "&oslash;"], [0, "&ugrave;"], [0, "&uacute;"], [0, "&ucirc;"], [0, "&uuml;"], [0, "&yacute;"], [0, "&thorn;"], [0, "&yuml;"], [0, "&Amacr;"], [0, "&amacr;"], [0, "&Abreve;"], [0, "&abreve;"], [0, "&Aogon;"], [0, "&aogon;"], [0, "&Cacute;"], [0, "&cacute;"], [0, "&Ccirc;"], [0, "&ccirc;"], [0, "&Cdot;"], [0, "&cdot;"], [0, "&Ccaron;"], [0, "&ccaron;"], [0, "&Dcaron;"], [0, "&dcaron;"], [0, "&Dstrok;"], [0, "&dstrok;"], [0, "&Emacr;"], [0, "&emacr;"], [2, "&Edot;"], [0, "&edot;"], [0, "&Eogon;"], [0, "&eogon;"], [0, "&Ecaron;"], [0, "&ecaron;"], [0, "&Gcirc;"], [0, "&gcirc;"], [0, "&Gbreve;"], [0, "&gbreve;"], [0, "&Gdot;"], [0, "&gdot;"], [0, "&Gcedil;"], [1, "&Hcirc;"], [0, "&hcirc;"], [0, "&Hstrok;"], [0, "&hstrok;"], [0, "&Itilde;"], [0, "&itilde;"], [0, "&Imacr;"], [0, "&imacr;"], [2, "&Iogon;"], [0, "&iogon;"], [0, "&Idot;"], [0, "&imath;"], [0, "&IJlig;"], [0, "&ijlig;"], [0, "&Jcirc;"], [0, "&jcirc;"], [0, "&Kcedil;"], [0, "&kcedil;"], [0, "&kgreen;"], [0, "&Lacute;"], [0, "&lacute;"], [0, "&Lcedil;"], [0, "&lcedil;"], [0, "&Lcaron;"], [0, "&lcaron;"], [0, "&Lmidot;"], [0, "&lmidot;"], [0, "&Lstrok;"], [0, "&lstrok;"], [0, "&Nacute;"], [0, "&nacute;"], [0, "&Ncedil;"], [0, "&ncedil;"], [0, "&Ncaron;"], [0, "&ncaron;"], [0, "&napos;"], [0, "&ENG;"], [0, "&eng;"], [0, "&Omacr;"], [0, "&omacr;"], [2, "&Odblac;"], [0, "&odblac;"], [0, "&OElig;"], [0, "&oelig;"], [0, "&Racute;"], [0, "&racute;"], [0, "&Rcedil;"], [0, "&rcedil;"], [0, "&Rcaron;"], [0, "&rcaron;"], [0, "&Sacute;"], [0, "&sacute;"], [0, "&Scirc;"], [0, "&scirc;"], [0, "&Scedil;"], [0, "&scedil;"], [0, "&Scaron;"], [0, "&scaron;"], [0, "&Tcedil;"], [0, "&tcedil;"], [0, "&Tcaron;"], [0, "&tcaron;"], [0, "&Tstrok;"], [0, "&tstrok;"], [0, "&Utilde;"], [0, "&utilde;"], [0, "&Umacr;"], [0, "&umacr;"], [0, "&Ubreve;"], [0, "&ubreve;"], [0, "&Uring;"], [0, "&uring;"], [0, "&Udblac;"], [0, "&udblac;"], [0, "&Uogon;"], [0, "&uogon;"], [0, "&Wcirc;"], [0, "&wcirc;"], [0, "&Ycirc;"], [0, "&ycirc;"], [0, "&Yuml;"], [0, "&Zacute;"], [0, "&zacute;"], [0, "&Zdot;"], [0, "&zdot;"], [0, "&Zcaron;"], [0, "&zcaron;"], [19, "&fnof;"], [34, "&imped;"], [63, "&gacute;"], [65, "&jmath;"], [142, "&circ;"], [0, "&caron;"], [16, "&breve;"], [0, "&DiacriticalDot;"], [0, "&ring;"], [0, "&ogon;"], [0, "&DiacriticalTilde;"], [0, "&dblac;"], [51, "&DownBreve;"], [127, "&Alpha;"], [0, "&Beta;"], [0, "&Gamma;"], [0, "&Delta;"], [0, "&Epsilon;"], [0, "&Zeta;"], [0, "&Eta;"], [0, "&Theta;"], [0, "&Iota;"], [0, "&Kappa;"], [0, "&Lambda;"], [0, "&Mu;"], [0, "&Nu;"], [0, "&Xi;"], [0, "&Omicron;"], [0, "&Pi;"], [0, "&Rho;"], [1, "&Sigma;"], [0, "&Tau;"], [0, "&Upsilon;"], [0, "&Phi;"], [0, "&Chi;"], [0, "&Psi;"], [0, "&ohm;"], [7, "&alpha;"], [0, "&beta;"], [0, "&gamma;"], [0, "&delta;"], [0, "&epsi;"], [0, "&zeta;"], [0, "&eta;"], [0, "&theta;"], [0, "&iota;"], [0, "&kappa;"], [0, "&lambda;"], [0, "&mu;"], [0, "&nu;Line truncated
//# sourceMappingURL=encode-html.js.map
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveSingletonScopedBinding = resolveSingletonScopedBinding;
const cacheResolvedValue_1 = require("./cacheResolvedValue");
const resolveBindingActivations_1 = require("./resolveBindingActivations");
function resolveSingletonScopedBinding(resolve) {
return (params, binding) => {
if (binding.cache.isRight) {
return binding.cache.value;
}
const resolvedValue = (0, resolveBindingActivations_1.resolveBindingActivations)(params, binding, resolve(params, binding));
return (0, cacheResolvedValue_1.cacheResolvedValue)(binding, resolvedValue);
};
}
//# sourceMappingURL=resolveSingletonScopedBinding.js.map
@@ -0,0 +1,121 @@
"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;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
const parserBase = __importStar(require("@typescript-eslint/parser"));
const all_1 = __importDefault(require("./configs/eslintrc/all"));
const base_1 = __importDefault(require("./configs/eslintrc/base"));
const disable_type_checked_1 = __importDefault(require("./configs/eslintrc/disable-type-checked"));
const eslint_recommended_1 = __importDefault(require("./configs/eslintrc/eslint-recommended"));
const recommended_1 = __importDefault(require("./configs/eslintrc/recommended"));
const recommended_type_checked_1 = __importDefault(require("./configs/eslintrc/recommended-type-checked"));
const recommended_type_checked_only_1 = __importDefault(require("./configs/eslintrc/recommended-type-checked-only"));
const strict_1 = __importDefault(require("./configs/eslintrc/strict"));
const strict_type_checked_1 = __importDefault(require("./configs/eslintrc/strict-type-checked"));
const strict_type_checked_only_1 = __importDefault(require("./configs/eslintrc/strict-type-checked-only"));
const stylistic_1 = __importDefault(require("./configs/eslintrc/stylistic"));
const stylistic_type_checked_1 = __importDefault(require("./configs/eslintrc/stylistic-type-checked"));
const stylistic_type_checked_only_1 = __importDefault(require("./configs/eslintrc/stylistic-type-checked-only"));
const all_2 = __importDefault(require("./configs/flat/all"));
const base_2 = __importDefault(require("./configs/flat/base"));
const disable_type_checked_2 = __importDefault(require("./configs/flat/disable-type-checked"));
const eslint_recommended_2 = __importDefault(require("./configs/flat/eslint-recommended"));
const recommended_2 = __importDefault(require("./configs/flat/recommended"));
const recommended_type_checked_2 = __importDefault(require("./configs/flat/recommended-type-checked"));
const recommended_type_checked_only_2 = __importDefault(require("./configs/flat/recommended-type-checked-only"));
const strict_2 = __importDefault(require("./configs/flat/strict"));
const strict_type_checked_2 = __importDefault(require("./configs/flat/strict-type-checked"));
const strict_type_checked_only_2 = __importDefault(require("./configs/flat/strict-type-checked-only"));
const stylistic_2 = __importDefault(require("./configs/flat/stylistic"));
const stylistic_type_checked_2 = __importDefault(require("./configs/flat/stylistic-type-checked"));
const stylistic_type_checked_only_2 = __importDefault(require("./configs/flat/stylistic-type-checked-only"));
const rules_1 = __importDefault(require("./rules"));
const parser = {
meta: parserBase.meta,
parseForESLint: parserBase.parseForESLint,
};
// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
const { name, version } = require('../package.json');
const plugin = {
// not fully initialized yet.
// See https://eslint.org/docs/latest/extend/plugins#configs-in-plugins
configs: {
all: all_1.default,
base: base_1.default,
'disable-type-checked': disable_type_checked_1.default,
'eslint-recommended': eslint_recommended_1.default,
recommended: recommended_1.default,
/** @deprecated - please use "recommended-type-checked" instead. */
'recommended-requiring-type-checking': recommended_type_checked_1.default,
'recommended-type-checked': recommended_type_checked_1.default,
'recommended-type-checked-only': recommended_type_checked_only_1.default,
strict: strict_1.default,
'strict-type-checked': strict_type_checked_1.default,
'strict-type-checked-only': strict_type_checked_only_1.default,
stylistic: stylistic_1.default,
'stylistic-type-checked': stylistic_type_checked_1.default,
'stylistic-type-checked-only': stylistic_type_checked_only_1.default,
},
meta: {
name,
version,
},
rules: rules_1.default,
};
// @ts-expect-error -- upstream type incompatibility stuff
const flatPlugin = plugin;
// included due to https://github.com/eslint/eslint/issues/19513
const flatConfigs = {
'flat/all': (0, all_2.default)(flatPlugin, parser),
'flat/base': (0, base_2.default)(flatPlugin, parser),
'flat/disable-type-checked': (0, disable_type_checked_2.default)(flatPlugin, parser),
'flat/eslint-recommended': (0, eslint_recommended_2.default)(flatPlugin, parser),
'flat/recommended': (0, recommended_2.default)(flatPlugin, parser),
'flat/recommended-type-checked': (0, recommended_type_checked_2.default)(flatPlugin, parser),
'flat/recommended-type-checked-only': (0, recommended_type_checked_only_2.default)(flatPlugin, parser),
'flat/strict': (0, strict_2.default)(flatPlugin, parser),
'flat/strict-type-checked': (0, strict_type_checked_2.default)(flatPlugin, parser),
'flat/strict-type-checked-only': (0, strict_type_checked_only_2.default)(flatPlugin, parser),
'flat/stylistic': (0, stylistic_2.default)(flatPlugin, parser),
'flat/stylistic-type-checked': (0, stylistic_type_checked_2.default)(flatPlugin, parser),
'flat/stylistic-type-checked-only': (0, stylistic_type_checked_only_2.default)(flatPlugin, parser),
};
Object.assign(plugin.configs, flatConfigs);
module.exports = {
flatConfigs,
parser,
plugin,
};
@@ -0,0 +1,37 @@
import { AlgorithmIdentifier } from "./algorithm_identifier";
import { Name } from "./name";
import { SubjectPublicKeyInfo } from "./subject_public_key_info";
import { Validity } from "./validity";
import { Extensions } from "./extension";
import { Version, CertificateSerialNumber, UniqueIdentifier } from "./types";
/**
* ```asn1
* TBSCertificate ::= SEQUENCE {
* version [0] Version DEFAULT v1,
* serialNumber CertificateSerialNumber,
* signature AlgorithmIdentifier,
* issuer Name,
* validity Validity,
* subject Name,
* subjectPublicKeyInfo SubjectPublicKeyInfo,
* issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
* -- If present, version MUST be v2 or v3
* subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
* -- If present, version MUST be v2 or v3
* extensions [3] Extensions OPTIONAL
* -- If present, version MUST be v3 -- }
* ```
*/
export declare class TBSCertificate {
version: Version;
serialNumber: CertificateSerialNumber;
signature: AlgorithmIdentifier;
issuer: Name;
validity: Validity;
subject: Name;
subjectPublicKeyInfo: SubjectPublicKeyInfo;
issuerUniqueID?: UniqueIdentifier;
subjectUniqueID?: UniqueIdentifier;
extensions?: Extensions;
constructor(params?: Partial<TBSCertificate>);
}
@@ -0,0 +1 @@
{"name":"napi-postinstall","version":"0.3.4","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532096254,"integrity":"sha512-NEVUQ6hGZ7AWpyoRMaAjWEHWiys29p67d+l/QwHyffEtVCtZudqoYGWo+HYCi41YFp13mvAiZzXH6Icuhgqiyg==","mode":420,"size":1069},"lib/cli.js":{"checkedAt":1794532096254,"integrity":"sha512-Or8WbTwP68DqyO+JHGNJCW3sI0bjITIILMh5sVrMrXYRQO928tMtOuNdD2/RZ2XtAEQHaPGbgLCosHtvBx1Tng==","mode":420,"size":985},"lib/constants.js":{"checkedAt":1794532096255,"integrity":"sha512-cXM1JmdsAGVe75XD+HOW5fbIZ7IXWA7cgY/ZHztk0vVThP6ve2czuW9yMRcsLh1ewvqmbyGnWNqEPkOHdDWIMw==","mode":420,"size":703},"lib/fallback.js":{"checkedAt":1794532096255,"integrity":"sha512-E4M5VnvoIC8RWyjmFpBI7lWFN9yZoEtRR2EQPcf4oQBK0AKcPWGNLTjrDSEKo6HqFlYBCz0NSMzDmtVzpX8LJQ==","mode":420,"size":3188},"lib/helpers.js":{"checkedAt":1794532096255,"integrity":"sha512-SlrgGv11pGSkZW/C6B9/cAgCrdF8WDZWJfKFMRYSDSf0tIhs9hdFzmrgM3rbYuhcmsBaefjAMtsKH7LTLqr1Sw==","mode":420,"size":8228},"lib/index.js":{"checkedAt":1794532096255,"integrity":"sha512-Hc3+xyL8TmaKycc4yfQI2lZnfRWYaQsBrT4cPaLL07VUTzD8asmRMsD9rQh1bk0aWAQEVYLSObyYb8EsRpmWNA==","mode":420,"size":10533},"lib/target.js":{"checkedAt":1794532096255,"integrity":"sha512-T6y/UsZ/6OU2tkmT1cEn/azmNlvDROTaHV3P94IcSsd73PCrPAjXlWItdrtF0GOPf4oYGt00MH2CCy0iyh5Seg==","mode":420,"size":1796},"lib/types.js":{"checkedAt":1794532096255,"integrity":"sha512-nhU68BdqPrnDQLwwwBa2/FQQRm6PTNXOCac/25gmXJN8MGd/us9Sb/dVXJPn2oVcihcP12eYp0aT4/28wYI4Cg==","mode":420,"size":110},"package.json":{"checkedAt":1794532096255,"integrity":"sha512-DZ/8X/R5bQ/yaQUIJkyWPrekpsJK01+Kx5/2/JQjSp+DqBy3p3T1dqP7F3sqWUinMhK09EYX8FA+/zdLUlEDkQ==","mode":420,"size":844},"lib/cli.js.map":{"checkedAt":1794532096256,"integrity":"sha512-9IiNHCCGyM/u32x9dypsgtOr4c1H7WP/L/m6xDOsHk6KXP1+GiXRfB0ulNuMEc8y9kXewPoY73WYDdCNUgiyJA==","mode":420,"size":902},"lib/constants.js.map":{"checkedAt":1794532096256,"integrity":"sha512-4eoTpOY5VkVHwAMMfzn+srbXnmcBMXobXTrYaJ/JGDZAAaIg5qxpkt6qhc+NOJpbFlv3gcAcc0uCfNX9oaiRJQ==","mode":420,"size":519},"lib/fallback.js.map":{"checkedAt":1794532096256,"integrity":"sha512-MxG8+Pha2/Jp7Wq9awRIKgpf+rNxYSU0l6t6X0BKXnBZAuN024ZdqXkyYK+l62o5fiFRr+MaTerTMPHNUsCFew==","mode":420,"size":3094},"lib/helpers.js.map":{"checkedAt":1794532096256,"integrity":"sha512-gOnOtZDhRcyOcSmhLX7NpAP84djfj/7LdXtmD/O6obEzNHQCLhFNUoxidWxy3UMz/5bAGDZvsyPtYy7K98MMng==","mode":420,"size":7248},"lib/index.js.map":{"checkedAt":1794532096256,"integrity":"sha512-F4gwOohhTOzMb/4W9dWeppVMuvnxLsdu/CxhfMz/e3H/BgNndIDS5bK9Ifhrw93LJCMoqr8s8IR/dzzT4CnHfQ==","mode":420,"size":9099},"lib/target.js.map":{"checkedAt":1794532096256,"integrity":"sha512-uOQJu6Whw8A+ywUZMxQPf1IoNBN9P0Kdi7+gZHl9ouSA/n7pGPV4ASWO/Z6zlSaYPYWTWDi5YGpwzI7HYg6reA==","mode":420,"size":1744},"lib/types.js.map":{"checkedAt":1794532096256,"integrity":"sha512-TF/b/T3nwqhwzvSQCv/dboeSHvr/1GLVyXJFcy8q00n5bdXOxGy8TtkQmE0+xkLfpv5k1PO4MlQwUgwQr0MEhQ==","mode":420,"size":102},"README.md":{"checkedAt":1794532096256,"integrity":"sha512-Ckr/139QoPs0BvKl+nVZZlSDYl0Uye3Z+6j7D4wCsu4Wu9tIHHS/3pYTecd2LKDxb4QZ60pGOe/Ok09T/rEVQg==","mode":420,"size":6721},"lib/cli.d.ts":{"checkedAt":1794532096257,"integrity":"sha512-fbtv3s/QbOT0YeVT7wpdIPG8xfBj2us9WSjE8okIzaA+BTOn6YF5Rg4kPgjdyCmapwzK4axzZOuUAqsQVLjSrA==","mode":420,"size":31},"lib/constants.d.ts":{"checkedAt":1794532096257,"integrity":"sha512-3blKsRicr56hGSRRI1+BDYZVHHw14GDtG/ltTlDIt/3G4ZTuIZUeoCImzExriQrNOBNvY7mx0Ls0BTW86L+KfA==","mode":420,"size":417},"lib/fallback.d.ts":{"checkedAt":1794532096257,"integrity":"sha512-hl5fLuZTCHE/Tb6Ikce9Z4cinShtelLeoLkG3bcWR96bXif7AGtN0PKFh+bAGYLPCxFfqiAJIV4xQxVRYFueHQ==","mode":420,"size":111},"lib/helpers.d.ts":{"checkedAt":1794532096257,"integrity":"sha512-ubudlRZEtw7+uAH+IROYCevHWGnIFxxhqC1OEeFVhK5Eyv2QnKny6+RmycIj7+XZR2OViz2hfYrHF/YjUMTZUA==","mode":420,"size":846},"lib/index.d.ts":{"checkedAt":1794532096257,"integrity":"sha512-i0oheWD6E2zahurefzNehoihYptyD2jlzCMe2owOYwflPPmbmWmvWljHYNyqkJSiW990j7eLgMsAQLW55hh8/w==","mode":420,"size":415},"lib/target.d.ts":{"checkedAt":1794532096257,"integrity":"sha512-sp9Al+fyQ5jRwSsC/wd7ctfqPrgPPEMQFqmVJFH3IIPUleS9n5U+9vc3h7jZnZ13W2VAiyID54iyOKtE0Wk9DA==","mode":420,"size":106},"lib/types.d.ts":{"checkedAt":1794532096257,"integrity":"sha512-rEn27ge6TJYStWPnsOn8TYr1VgAwfgZ6hZrDre1/y+Rp1oyXMzeE8cUedRzpvE4pXhLhqm/vvsdh+9GynU4TgA==","mode":420,"size":841}}}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=BindingConstraintsImplementation.spec.d.ts.map
@@ -0,0 +1,422 @@
_I'm transitioning to a full-time open source career. Your support would be greatly appreciated 🙌_
<a href="https://polar.sh/tinylibs/subscriptions"><picture><source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/embed/tiers.svg?org=tinylibs&darkmode"><img alt="Subscription Tiers on Polar" src="https://polar.sh/embed/tiers.svg?org=tinylibs"></picture></a>
# Tinybench 🔎
[![CI](https://github.com/tinylibs/tinybench/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/tinylibs/tinybench/actions/workflows/test.yml)
[![NPM version](https://img.shields.io/npm/v/tinybench.svg?style=flat)](https://www.npmjs.com/package/tinybench)
Benchmark your code easily with Tinybench, a simple, tiny and light-weight `7KB` (`2KB` minified and gzipped)
benchmarking library!
You can run your benchmarks in multiple JavaScript runtimes, Tinybench is
completely based on the Web APIs with proper timing using `process.hrtime` or
`performance.now`.
- Accurate and precise timing based on the environment
- `Event` and `EventTarget` compatible events
- Statistically analyzed values
- Calculated Percentiles
- Fully detailed results
- No dependencies
_In case you need more tiny libraries like tinypool or tinyspy, please consider submitting an [RFC](https://github.com/tinylibs/rfcs)_
## Installing
```bash
$ npm install -D tinybench
```
## Usage
You can start benchmarking by instantiating the `Bench` class and adding
benchmark tasks to it.
```js
import { Bench } from 'tinybench';
const bench = new Bench({ time: 100 });
bench
.add('faster task', () => {
console.log('I am faster')
})
.add('slower task', async () => {
await new Promise(r => setTimeout(r, 1)) // we wait 1ms :)
console.log('I am slower')
})
.todo('unimplemented bench')
await bench.warmup(); // make results more reliable, ref: https://github.com/tinylibs/tinybench/pull/50
await bench.run();
console.table(bench.table());
// Output:
// ┌─────────┬───────────────┬──────────┬────────────────────┬───────────┬─────────┐
// │ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │
// ├─────────┼───────────────┼──────────┼────────────────────┼───────────┼─────────┤
// │ 0 │ 'faster task' │ '41,621' │ 24025.791819761525 │ '±20.50%' │ 4257 │
// │ 1 │ 'slower task' │ '828' │ 1207382.7838323202 │ '±7.07%' │ 83 │
// └─────────┴───────────────┴──────────┴────────────────────┴───────────┴─────────┘
console.table(
bench.table((task) => ({'Task name': task.name}))
);
// Output:
// ┌─────────┬───────────────────────┐
// │ (index) │ Task name │
// ├─────────┼───────────────────────┤
// │ 0 │ 'unimplemented bench' │
// └─────────┴───────────────────────┘
```
The `add` method accepts a task name and a task function, so it can benchmark
it! This method returns a reference to the Bench instance, so it's possible to
use it to create an another task for that instance.
Note that the task name should always be unique in an instance, because Tinybench stores the tasks based
on their names in a `Map`.
Also note that `tinybench` does not log any result by default. You can extract the relevant stats
from `bench.tasks` or any other API after running the benchmark, and process them however you want.
## Docs
### `Bench`
The Benchmark instance for keeping track of the benchmark tasks and controlling
them.
Options:
```ts
export type Options = {
/**
* time needed for running a benchmark task (milliseconds) @default 500
*/
time?: number;
/**
* number of times that a task should run if even the time option is finished @default 10
*/
iterations?: number;
/**
* function to get the current timestamp in milliseconds
*/
now?: () => number;
/**
* An AbortSignal for aborting the benchmark
*/
signal?: AbortSignal;
/**
* Throw if a task fails (events will not work if true)
*/
throws?: boolean;
/**
* warmup time (milliseconds) @default 100ms
*/
warmupTime?: number;
/**
* warmup iterations @default 5
*/
warmupIterations?: number;
/**
* setup function to run before each benchmark task (cycle)
*/
setup?: Hook;
/**
* teardown function to run after each benchmark task (cycle)
*/
teardown?: Hook;
};
export type Hook = (task: Task, mode: "warmup" | "run") => void | Promise<void>;
```
- `async run()`: run the added tasks that were registered using the `add` method
- `async runConcurrently(threshold: number = Infinity, mode: "bench" | "task" = "bench")`: similar to the `run` method but runs concurrently rather than sequentially. See the [Concurrency](#Concurrency) section.
- `async warmup()`: warm up the benchmark tasks
- `async warmupConcurrently(threshold: number = Infinity, mode: "bench" | "task" = "bench")`: warm up the benchmark tasks concurrently
- `reset()`: reset each task and remove its result
- `add(name: string, fn: Fn, opts?: FnOpts)`: add a benchmark task to the task map
- `Fn`: `() => any | Promise<any>`
- `FnOpts`: `{}`: a set of optional functions run during the benchmark lifecycle that can be used to set up or tear down test data or fixtures without affecting the timing of each task
- `beforeAll?: () => any | Promise<any>`: invoked once before iterations of `fn` begin
- `beforeEach?: () => any | Promise<any>`: invoked before each time `fn` is executed
- `afterEach?: () => any | Promise<any>`: invoked after each time `fn` is executed
- `afterAll?: () => any | Promise<any>`: invoked once after all iterations of `fn` have finished
- `remove(name: string)`: remove a benchmark task from the task map
- `table()`: table of the tasks results
- `get results(): (TaskResult | undefined)[]`: (getter) tasks results as an array
- `get tasks(): Task[]`: (getter) tasks as an array
- `getTask(name: string): Task | undefined`: get a task based on the name
- `todo(name: string, fn?: Fn, opts: FnOptions)`: add a benchmark todo to the todo map
- `get todos(): Task[]`: (getter) tasks todos as an array
### `Task`
A class that represents each benchmark task in Tinybench. It keeps track of the
results, name, Bench instance, the task function and the number of times the task
function has been executed.
- `constructor(bench: Bench, name: string, fn: Fn, opts: FnOptions = {})`
- `bench: Bench`
- `name: string`: task name
- `fn: Fn`: the task function
- `opts: FnOptions`: Task options
- `runs: number`: the number of times the task function has been executed
- `result?: TaskResult`: the result object
- `async run()`: run the current task and write the results in `Task.result` object
- `async warmup()`: warm up the current task
- `setResult(result: Partial<TaskResult>)`: change the result object values
- `reset()`: reset the task to make the `Task.runs` a zero-value and remove the `Task.result` object
```ts
export interface FnOptions {
/**
* An optional function that is run before iterations of this task begin
*/
beforeAll?: (this: Task) => void | Promise<void>;
/**
* An optional function that is run before each iteration of this task
*/
beforeEach?: (this: Task) => void | Promise<void>;
/**
* An optional function that is run after each iteration of this task
*/
afterEach?: (this: Task) => void | Promise<void>;
/**
* An optional function that is run after all iterations of this task end
*/
afterAll?: (this: Task) => void | Promise<void>;
}
```
## `TaskResult`
the benchmark task result object.
```ts
export type TaskResult = {
/*
* the last error that was thrown while running the task
*/
error?: unknown;
/**
* The amount of time in milliseconds to run the benchmark task (cycle).
*/
totalTime: number;
/**
* the minimum value in the samples
*/
min: number;
/**
* the maximum value in the samples
*/
max: number;
/**
* the number of operations per second
*/
hz: number;
/**
* how long each operation takes (ms)
*/
period: number;
/**
* task samples of each task iteration time (ms)
*/
samples: number[];
/**
* samples mean/average (estimate of the population mean)
*/
mean: number;
/**
* samples variance (estimate of the population variance)
*/
variance: number;
/**
* samples standard deviation (estimate of the population standard deviation)
*/
sd: number;
/**
* standard error of the mean (a.k.a. the standard deviation of the sampling distribution of the sample mean)
*/
sem: number;
/**
* degrees of freedom
*/
df: number;
/**
* critical value of the samples
*/
critical: number;
/**
* margin of error
*/
moe: number;
/**
* relative margin of error
*/
rme: number;
/**
* p75 percentile
*/
p75: number;
/**
* p99 percentile
*/
p99: number;
/**
* p995 percentile
*/
p995: number;
/**
* p999 percentile
*/
p999: number;
};
```
### `Events`
Both the `Task` and `Bench` objects extend the `EventTarget` object, so you can attach listeners to different types of events
in each class instance using the universal `addEventListener` and
`removeEventListener`.
```ts
/**
* Bench events
*/
export type BenchEvents =
| "abort" // when a signal aborts
| "complete" // when running a benchmark finishes
| "error" // when the benchmark task throws
| "reset" // when the reset function gets called
| "start" // when running the benchmarks gets started
| "warmup" // when the benchmarks start getting warmed up (before start)
| "cycle" // when running each benchmark task gets done (cycle)
| "add" // when a Task gets added to the Bench
| "remove" // when a Task gets removed of the Bench
| "todo"; // when a todo Task gets added to the Bench
/**
* task events
*/
export type TaskEvents =
| "abort"
| "complete"
| "error"
| "reset"
| "start"
| "warmup"
| "cycle";
```
For instance:
```js
// runs on each benchmark task's cycle
bench.addEventListener("cycle", (e) => {
const task = e.task!;
});
// runs only on this benchmark task's cycle
task.addEventListener("cycle", (e) => {
const task = e.task!;
});
```
### `BenchEvent`
```ts
export type BenchEvent = Event & {
task: Task | null;
};
```
### `process.hrtime`
if you want more accurate results for nodejs with `process.hrtime`, then import
the `hrtimeNow` function from the library and pass it to the `Bench` options.
```ts
import { hrtimeNow } from 'tinybench';
```
It may make your benchmarks slower, check #42.
## Concurrency
- When `mode` is set to `null` (default), concurrency is disabled.
- When `mode` is set to 'task', each task's iterations (calls of a task function) run concurrently.
- When `mode` is set to 'bench', different tasks within the bench run concurrently. Concurrent cycles.
```ts
// options way (recommended)
bench.threshold = 10 // The maximum number of concurrent tasks to run. Defaults to Infinity.
bench.concurrency = "task" // The concurrency mode to determine how tasks are run.
// await bench.warmup()
await bench.run()
// standalone method way
// await bench.warmupConcurrently(10, "task")
await bench.runConcurrently(10, "task") // with runConcurrently, mode is set to 'bench' by default
```
## Prior art
- [Benchmark.js](https://github.com/bestiejs/benchmark.js)
- [Mitata](https://github.com/evanwashere/mitata/)
- [Bema](https://github.com/prisma-labs/bema)
## Authors
| <a href="https://github.com/Aslemammad"> <img width='150' src="https://avatars.githubusercontent.com/u/37929992?v=4" /><br> Mohammad Bagher </a> |
| ------------------------------------------------------------------------------------------------------------------------------------------------ |
## Credits
| <a href="https://github.com/uzlopak"> <img width='150' src="https://avatars.githubusercontent.com/u/5059100?v=4" /><br> Uzlopak </a> | <a href="https://github.com/poyoho"> <img width='150' src="https://avatars.githubusercontent.com/u/36070057?v=4" /><br> poyoho </a> |
| ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
## Contributing
Feel free to create issues/discussions and then PRs for the project!
## Sponsors
Your sponsorship can make a huge difference in continuing our work in open source!
<p align="center">
<a href="https://cdn.jsdelivr.net/gh/aslemammad/static/sponsors.svg">
<img src='https://cdn.jsdelivr.net/gh/aslemammad/static/sponsors.svg'/>
</a>
</p>
@@ -0,0 +1,139 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.find = find;
exports.findParent = findParent;
exports.getAncestry = getAncestry;
exports.getDeepestCommonAncestorFrom = getDeepestCommonAncestorFrom;
exports.getEarliestCommonAncestorFrom = getEarliestCommonAncestorFrom;
exports.getFunctionParent = getFunctionParent;
exports.getStatementParent = getStatementParent;
exports.inType = inType;
exports.isAncestor = isAncestor;
exports.isDescendant = isDescendant;
var _t = require("@babel/types");
const {
VISITOR_KEYS
} = _t;
function findParent(callback) {
let path = this;
while (path = path.parentPath) {
if (callback(path)) return path;
}
return null;
}
function find(callback) {
let path = this;
do {
if (callback(path)) return path;
} while (path = path.parentPath);
return null;
}
function getFunctionParent() {
return this.findParent(p => p.isFunction());
}
function getStatementParent() {
let path = this;
do {
if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) {
break;
} else {
path = path.parentPath;
}
} while (path);
if (path && (path.isProgram() || path.isFile())) {
throw new Error("File/Program node, we can't possibly find a statement parent to this");
}
return path;
}
function getEarliestCommonAncestorFrom(paths) {
return this.getDeepestCommonAncestorFrom(paths, function (deepest, i, ancestries) {
let earliest;
const keys = VISITOR_KEYS[deepest.type];
for (const ancestry of ancestries) {
const path = ancestry[i + 1];
if (!earliest) {
earliest = path;
continue;
}
if (path.listKey && earliest.listKey === path.listKey) {
if (path.key < earliest.key) {
earliest = path;
continue;
}
}
const earliestKeyIndex = keys.indexOf(earliest.parentKey);
const currentKeyIndex = keys.indexOf(path.parentKey);
if (earliestKeyIndex > currentKeyIndex) {
earliest = path;
}
}
return earliest;
});
}
function getDeepestCommonAncestorFrom(paths, filter) {
if (!paths.length) {
return this;
}
if (paths.length === 1) {
return paths[0];
}
let minDepth = Infinity;
let lastCommonIndex, lastCommon;
const ancestries = paths.map(path => {
const ancestry = [];
do {
ancestry.unshift(path);
} while ((path = path.parentPath) && path !== this);
if (ancestry.length < minDepth) {
minDepth = ancestry.length;
}
return ancestry;
});
const first = ancestries[0];
depthLoop: for (let i = 0; i < minDepth; i++) {
const shouldMatch = first[i];
for (const ancestry of ancestries) {
if (ancestry[i] !== shouldMatch) {
break depthLoop;
}
}
lastCommonIndex = i;
lastCommon = shouldMatch;
}
if (lastCommon) {
if (filter) {
return filter(lastCommon, lastCommonIndex, ancestries);
} else {
return lastCommon;
}
} else {
throw new Error("Couldn't find intersection");
}
}
function getAncestry() {
let path = this;
const paths = [];
do {
paths.push(path);
} while (path = path.parentPath);
return paths;
}
function isAncestor(maybeDescendant) {
return maybeDescendant.isDescendant(this);
}
function isDescendant(maybeAncestor) {
return !!this.findParent(parent => parent === maybeAncestor);
}
function inType(...candidateTypes) {
let path = this;
while (path) {
if (candidateTypes.includes(path.node.type)) return true;
path = path.parentPath;
}
return false;
}
//# sourceMappingURL=ancestry.js.map
@@ -0,0 +1,15 @@
import { __read } from "tslib";
import { useEffect, useState } from 'react';
import useDebounceFn from '../useDebounceFn';
import useUpdateEffect from '../useUpdateEffect';
function useDebounceEffect(effect, deps, options) {
var _a = __read(useState({}), 2), flag = _a[0], setFlag = _a[1];
var run = useDebounceFn(function () {
setFlag({});
}, options).run;
useEffect(function () {
return run();
}, deps);
useUpdateEffect(effect, [flag]);
}
export default useDebounceEffect;
@@ -0,0 +1 @@
export declare function getEventListenerTarget(target: EventTarget | null): EventTarget | Document;
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/array.prototype.findlastindex
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,37 @@
# axios // adapters
The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received.
## Example
```js
var settle = require('./../core/settle');
module.exports = function myAdapter(config) {
// At this point:
// - config has been merged with defaults
// - request transformers have already run
// - request interceptors have already run
// Make the request using config provided
// Upon response settle the Promise
return new Promise(function(resolve, reject) {
var response = {
data: responseData,
status: request.status,
statusText: request.statusText,
headers: responseHeaders,
config: config,
request: request
};
settle(resolve, reject, response);
// From here:
// - response transformers will run
// - response interceptors will run
});
}
```
@@ -0,0 +1,19 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./errors"), exports);
__exportStar(require("./function"), exports);
@@ -0,0 +1,101 @@
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
import {useValueEffect as $1dbecbe27a04f9af$export$14d238f342723f25} from "./useValueEffect.module.js";
import {useState as $eKkEp$useState, useRef as $eKkEp$useRef, useEffect as $eKkEp$useEffect, useCallback as $eKkEp$useCallback} from "react";
import {useSSRSafeId as $eKkEp$useSSRSafeId} from "@react-aria/ssr";
/*
* 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.
*/
// copied from SSRProvider.tsx to reduce exports, if needed again, consider sharing
let $bdb11010cef70236$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
let $bdb11010cef70236$export$d41a04c74483c6ef = new Map();
// This allows us to clean up the idsUpdaterMap when the id is no longer used.
// Map is a strong reference, so unused ids wouldn't be cleaned up otherwise.
// This can happen in suspended components where mount/unmount is not called.
let $bdb11010cef70236$var$registry;
if (typeof FinalizationRegistry !== 'undefined') $bdb11010cef70236$var$registry = new FinalizationRegistry((heldValue)=>{
$bdb11010cef70236$export$d41a04c74483c6ef.delete(heldValue);
});
function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
let [value, setValue] = (0, $eKkEp$useState)(defaultId);
let nextId = (0, $eKkEp$useRef)(null);
let res = (0, $eKkEp$useSSRSafeId)(value);
let cleanupRef = (0, $eKkEp$useRef)(null);
if ($bdb11010cef70236$var$registry) $bdb11010cef70236$var$registry.register(cleanupRef, res);
if ($bdb11010cef70236$var$canUseDOM) {
const cacheIdRef = $bdb11010cef70236$export$d41a04c74483c6ef.get(res);
if (cacheIdRef && !cacheIdRef.includes(nextId)) cacheIdRef.push(nextId);
else $bdb11010cef70236$export$d41a04c74483c6ef.set(res, [
nextId
]);
}
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
let r = res;
return ()=>{
// In Suspense, the cleanup function may be not called
// when it is though, also remove it from the finalization registry.
if ($bdb11010cef70236$var$registry) $bdb11010cef70236$var$registry.unregister(cleanupRef);
$bdb11010cef70236$export$d41a04c74483c6ef.delete(r);
};
}, [
res
]);
// This cannot cause an infinite loop because the ref is always cleaned up.
// eslint-disable-next-line
(0, $eKkEp$useEffect)(()=>{
let newId = nextId.current;
if (newId) setValue(newId);
return ()=>{
if (newId) nextId.current = null;
};
});
return res;
}
function $bdb11010cef70236$export$cd8c9cb68f842629(idA, idB) {
if (idA === idB) return idA;
let setIdsA = $bdb11010cef70236$export$d41a04c74483c6ef.get(idA);
if (setIdsA) {
setIdsA.forEach((ref)=>ref.current = idB);
return idB;
}
let setIdsB = $bdb11010cef70236$export$d41a04c74483c6ef.get(idB);
if (setIdsB) {
setIdsB.forEach((ref)=>ref.current = idA);
return idA;
}
return idB;
}
function $bdb11010cef70236$export$b4cc09c592e8fdb8(depArray = []) {
let id = $bdb11010cef70236$export$f680877a34711e37();
let [resolvedId, setResolvedId] = (0, $1dbecbe27a04f9af$export$14d238f342723f25)(id);
let updateId = (0, $eKkEp$useCallback)(()=>{
setResolvedId(function*() {
yield id;
yield document.getElementById(id) ? id : undefined;
});
}, [
id,
setResolvedId
]);
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(updateId, [
id,
updateId,
...depArray
]);
return resolvedId;
}
export {$bdb11010cef70236$export$d41a04c74483c6ef as idsUpdaterMap, $bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId};
//# sourceMappingURL=useId.module.js.map
@@ -0,0 +1 @@
{"version":3,"file":"tableEmbed.js","names":["Delta","OpIterator","Module","parseCellIdentity","identity","parts","split","Number","stringifyCellIdentity","row","column","composePosition","delta","index","newIndex","thisIter","ops","offset","hasNext","length","peekLength","nextType","peekType","next","compactCellData","_ref","content","attributes","data","Object","keys","compactTableData","_ref2","rows","columns","cells","reindexCellIdentities","_ref3","reindexedCells","forEach","newPosition","tableHandler","compose","a","b","keepNull","aCell","bCell","AttributeMap","cell","transform","priority","aDeltas","bDeltas","newIdentity","invert","change","base","changeCell","baseCell","TableEmbed","register","registerEmbed"],"sources":["../../src/modules/tableEmbed.ts"],"sourcesContent":["import Delta, { OpIterator } from 'quill-delta';\nimport type { Op, AttributeMap } from 'quill-delta';\nimport Module from '../core/module.js';\n\nexport type CellData = {\n content?: Delta['ops'];\n attributes?: Record<string, unknown>;\n};\n\nexport type TableRowColumnOp = Omit<Op, 'insert'> & {\n insert?: { id: string };\n};\n\nexport interface TableData {\n rows?: Delta['ops'];\n columns?: Delta['ops'];\n cells?: Record<string, CellData>;\n}\n\nconst parseCellIdentity = (identity: string) => {\n const parts = identity.split(':');\n return [Number(parts[0]) - 1, Number(parts[1]) - 1];\n};\n\nconst stringifyCellIdentity = (row: number, column: number) =>\n `${row + 1}:${column + 1}`;\n\nexport const composePosition = (delta: Delta, index: number) => {\n let newIndex = index;\n const thisIter = new OpIterator(delta.ops);\n let offset = 0;\n while (thisIter.hasNext() && offset <= newIndex) {\n const length = thisIter.peekLength();\n const nextType = thisIter.peekType();\n thisIter.next();\n switch (nextType) {\n case 'delete':\n if (length > newIndex - offset) {\n return null;\n }\n newIndex -= length;\n break;\n case 'insert':\n newIndex += length;\n offset += length;\n break;\n default:\n offset += length;\n break;\n }\n }\n return newIndex;\n};\n\nconst compactCellData = ({\n content,\n attributes,\n}: {\n content: Delta;\n attributes: AttributeMap | undefined;\n}) => {\n const data: CellData = {};\n if (content.length() > 0) {\n data.content = content.ops;\n }\n if (attributes && Object.keys(attributes).length > 0) {\n data.attributes = attributes;\n }\n return Object.keys(data).length > 0 ? data : null;\n};\n\nconst compactTableData = ({\n rows,\n columns,\n cells,\n}: {\n rows: Delta;\n columns: Delta;\n cells: Record<string, CellData>;\n}) => {\n const data: TableData = {};\n if (rows.length() > 0) {\n data.rows = rows.ops;\n }\n\n if (columns.length() > 0) {\n data.columns = columns.ops;\n }\n\n if (Object.keys(cells).length) {\n data.cells = cells;\n }\n\n return data;\n};\n\nconst reindexCellIdentities = (\n cells: Record<string, CellData>,\n { rows, columns }: { rows: Delta; columns: Delta },\n) => {\n const reindexedCells: Record<string, CellData> = {};\n Object.keys(cells).forEach((identity) => {\n let [row, column] = parseCellIdentity(identity);\n\n // @ts-expect-error Fix me later\n row = composePosition(rows, row);\n // @ts-expect-error Fix me later\n column = composePosition(columns, column);\n\n if (row !== null && column !== null) {\n const newPosition = stringifyCellIdentity(row, column);\n reindexedCells[newPosition] = cells[identity];\n }\n }, false);\n return reindexedCells;\n};\n\nexport const tableHandler = {\n compose(a: TableData, b: TableData, keepNull?: boolean) {\n const rows = new Delta(a.rows || []).compose(new Delta(b.rows || []));\n const columns = new Delta(a.columns || []).compose(\n new Delta(b.columns || []),\n );\n\n const cells = reindexCellIdentities(a.cells || {}, {\n rows: new Delta(b.rows || []),\n columns: new Delta(b.columns || []),\n });\n\n Object.keys(b.cells || {}).forEach((identity) => {\n const aCell = cells[identity] || {};\n // @ts-expect-error Fix me later\n const bCell = b.cells[identity];\n\n const content = new Delta(aCell.content || []).compose(\n new Delta(bCell.content || []),\n );\n\n const attributes = Delta.AttributeMap.compose(\n aCell.attributes,\n bCell.attributes,\n keepNull,\n );\n\n const cell = compactCellData({ content, attributes });\n if (cell) {\n cells[identity] = cell;\n } else {\n delete cells[identity];\n }\n });\n\n return compactTableData({ rows, columns, cells });\n },\n transform(a: TableData, b: TableData, priority: boolean) {\n const aDeltas = {\n rows: new Delta(a.rows || []),\n columns: new Delta(a.columns || []),\n };\n\n const bDeltas = {\n rows: new Delta(b.rows || []),\n columns: new DeLine truncated
@@ -0,0 +1,3 @@
declare var implementation: string;
export = implementation;
@@ -0,0 +1,144 @@
import { T as Test, S as Suite, a as SuiteHooks, F as File, b as TaskUpdateEvent, c as Task, d as TestAPI, e as SuiteAPI, f as SuiteCollector } from './hooks.d-C0RE9A6t.js';
export { A as AfterAllListener, l as AfterEachListener, B as BeforeAllListener, m as BeforeEachListener, n as Fixture, p as FixtureFn, q as FixtureOptions, r as Fixtures, I as ImportDuration, s as InferFixturesTypes, O as OnTestFailedHandler, t as OnTestFinishedHandler, R as RunMode, u as RuntimeContext, v as SequenceHooks, w as SequenceSetupFiles, x as SuiteFactory, y as TaskBase, z as TaskCustomOptions, C as TaskEventPack, D as TaskHook, E as TaskMeta, G as TaskPopulated, H as TaskResult, J as TaskResultPack, K as TaskState, L as TestAnnotation, M as TestAnnotationLocation, N as TestAttachment, P as TestContext, Q as TestFunction, U as TestOptions, V as Use, g as afterAll, h as afterEach, i as beforeAll, j as beforeEach, o as onTestFailed, k as onTestFinished } from './hooks.d-C0RE9A6t.js';
import { Awaitable } from '@vitest/utils';
import { FileSpecification, VitestRunner } from './types.js';
export { CancelReason, VitestRunnerConfig, VitestRunnerConstructor, VitestRunnerImportSource } from './types.js';
import '@vitest/utils/diff';
declare function setFn(key: Test, fn: () => Awaitable<void>): void;
declare function getFn<Task = Test>(key: Task): () => Awaitable<void>;
declare function setHooks(key: Suite, hooks: SuiteHooks): void;
declare function getHooks(key: Suite): SuiteHooks;
declare function updateTask(event: TaskUpdateEvent, task: Task, runner: VitestRunner): void;
declare function startTests(specs: string[] | FileSpecification[], runner: VitestRunner): Promise<File[]>;
declare function publicCollect(specs: string[] | FileSpecification[], runner: VitestRunner): Promise<File[]>;
/**
* Creates a suite of tests, allowing for grouping and hierarchical organization of tests.
* Suites can contain both tests and other suites, enabling complex test structures.
*
* @param {string} name - The name of the suite, used for identification and reporting.
* @param {Function} fn - A function that defines the tests and suites within this suite.
* @example
* ```ts
* // Define a suite with two tests
* suite('Math operations', () => {
* test('should add two numbers', () => {
* expect(add(1, 2)).toBe(3);
* });
*
* test('should subtract two numbers', () => {
* expect(subtract(5, 2)).toBe(3);
* });
* });
* ```
* @example
* ```ts
* // Define nested suites
* suite('String operations', () => {
* suite('Trimming', () => {
* test('should trim whitespace from start and end', () => {
* expect(' hello '.trim()).toBe('hello');
* });
* });
*
* suite('Concatenation', () => {
* test('should concatenate two strings', () => {
* expect('hello' + ' ' + 'world').toBe('hello world');
* });
* });
* });
* ```
*/
declare const suite: SuiteAPI;
/**
* Defines a test case with a given name and test function. The test function can optionally be configured with test options.
*
* @param {string | Function} name - The name of the test or a function that will be used as a test name.
* @param {TestOptions | TestFunction} [optionsOrFn] - Optional. The test options or the test function if no explicit name is provided.
* @param {number | TestOptions | TestFunction} [optionsOrTest] - Optional. The test function or options, depending on the previous parameters.
* @throws {Error} If called inside another test function.
* @example
* ```ts
* // Define a simple test
* test('should add two numbers', () => {
* expect(add(1, 2)).toBe(3);
* });
* ```
* @example
* ```ts
* // Define a test with options
* test('should subtract two numbers', { retry: 3 }, () => {
* expect(subtract(5, 2)).toBe(3);
* });
* ```
*/
declare const test: TestAPI;
/**
* Creates a suite of tests, allowing for grouping and hierarchical organization of tests.
* Suites can contain both tests and other suites, enabling complex test structures.
*
* @param {string} name - The name of the suite, used for identification and reporting.
* @param {Function} fn - A function that defines the tests and suites within this suite.
* @example
* ```ts
* // Define a suite with two tests
* describe('Math operations', () => {
* test('should add two numbers', () => {
* expect(add(1, 2)).toBe(3);
* });
*
* test('should subtract two numbers', () => {
* expect(subtract(5, 2)).toBe(3);
* });
* });
* ```
* @example
* ```ts
* // Define nested suites
* describe('String operations', () => {
* describe('Trimming', () => {
* test('should trim whitespace from start and end', () => {
* expect(' hello '.trim()).toBe('hello');
* });
* });
*
* describe('Concatenation', () => {
* test('should concatenate two strings', () => {
* expect('hello' + ' ' + 'world').toBe('hello world');
* });
* });
* });
* ```
*/
declare const describe: SuiteAPI;
/**
* Defines a test case with a given name and test function. The test function can optionally be configured with test options.
*
* @param {string | Function} name - The name of the test or a function that will be used as a test name.
* @param {TestOptions | TestFunction} [optionsOrFn] - Optional. The test options or the test function if no explicit name is provided.
* @param {number | TestOptions | TestFunction} [optionsOrTest] - Optional. The test function or options, depending on the previous parameters.
* @throws {Error} If called inside another test function.
* @example
* ```ts
* // Define a simple test
* it('adds two numbers', () => {
* expect(add(1, 2)).toBe(3);
* });
* ```
* @example
* ```ts
* // Define a test with options
* it('subtracts two numbers', { retry: 3 }, () => {
* expect(subtract(5, 2)).toBe(3);
* });
* ```
*/
declare const it: TestAPI;
declare function getCurrentSuite<ExtraContext = object>(): SuiteCollector<ExtraContext>;
declare function createTaskCollector(fn: (...args: any[]) => any, context?: Record<string, unknown>): TestAPI;
declare function getCurrentTest<T extends Test | undefined>(): T;
export { File, FileSpecification, Suite, SuiteAPI, SuiteCollector, SuiteHooks, Task, TaskUpdateEvent, Test, TestAPI, VitestRunner, publicCollect as collectTests, createTaskCollector, describe, getCurrentSuite, getCurrentTest, getFn, getHooks, it, setFn, setHooks, startTests, suite, test, updateTask };
@@ -0,0 +1 @@
{"version":3,"file":"BaseBindingNode.js","sourceRoot":"","sources":["../../../../src/planning/models/BaseBindingNode.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import * as React from 'react'\nimport { flushSync } from 'react-dom'\nimport {\n Virtualizer,\n elementScroll,\n observeElementOffset,\n observeElementRect,\n observeWindowOffset,\n observeWindowRect,\n windowScroll,\n} from '@tanstack/virtual-core'\nimport type { PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core'\n\nexport * from '@tanstack/virtual-core'\n\nconst useIsomorphicLayoutEffect =\n typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect\n\nfunction useVirtualizerBase<\n TScrollElement extends Element | Window,\n TItemElement extends Element,\n>(\n options: VirtualizerOptions<TScrollElement, TItemElement>,\n): Virtualizer<TScrollElement, TItemElement> {\n const rerender = React.useReducer(() => ({}), {})[1]\n\n const resolvedOptions: VirtualizerOptions<TScrollElement, TItemElement> = {\n ...options,\n onChange: (instance, sync) => {\n if (sync) {\n flushSync(rerender)\n } else {\n rerender()\n }\n options.onChange?.(instance, sync)\n },\n }\n\n const [instance] = React.useState(\n () => new Virtualizer<TScrollElement, TItemElement>(resolvedOptions),\n )\n\n instance.setOptions(resolvedOptions)\n\n useIsomorphicLayoutEffect(() => {\n return instance._didMount()\n }, [])\n\n useIsomorphicLayoutEffect(() => {\n return instance._willUpdate()\n })\n\n return instance\n}\n\nexport function useVirtualizer<\n TScrollElement extends Element,\n TItemElement extends Element,\n>(\n options: PartialKeys<\n VirtualizerOptions<TScrollElement, TItemElement>,\n 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'\n >,\n): Virtualizer<TScrollElement, TItemElement> {\n return useVirtualizerBase<TScrollElement, TItemElement>({\n observeElementRect: observeElementRect,\n observeElementOffset: observeElementOffset,\n scrollToFn: elementScroll,\n ...options,\n })\n}\n\nexport function useWindowVirtualizer<TItemElement extends Element>(\n options: PartialKeys<\n VirtualizerOptions<Window, TItemElement>,\n | 'getScrollElement'\n | 'observeElementRect'\n | 'observeElementOffset'\n | 'scrollToFn'\n >,\n): Virtualizer<Window, TItemElement> {\n return useVirtualizerBase<Window, TItemElement>({\n getScrollElement: () => (typeof document !== 'undefined' ? window : null),\n observeElementRect: observeWindowRect,\n observeElementOffset: observeWindowOffset,\n scrollToFn: windowScroll,\n initialOffset: () => (typeof document !== 'undefined' ? window.scrollY : 0),\n ...options,\n })\n}\n"],"names":["instance"],"mappings":";;;;AAeA,MAAM,4BACJ,OAAO,aAAa,cAAc,MAAM,kBAAkB,MAAM;AAElE,SAAS,mBAIP,SAC2C;AACrC,QAAA,WAAW,MAAM,WAAW,OAAO,CAAA,IAAK,CAAA,CAAE,EAAE,CAAC;AAEnD,QAAM,kBAAoE;AAAA,IACxE,GAAG;AAAA,IACH,UAAU,CAACA,WAAU,SAAS;;AAC5B,UAAI,MAAM;AACR,kBAAU,QAAQ;AAAA,MAAA,OACb;AACI,iBAAA;AAAA,MAAA;AAEH,oBAAA,aAAA,iCAAWA,WAAU;AAAA,IAAI;AAAA,EAErC;AAEM,QAAA,CAAC,QAAQ,IAAI,MAAM;AAAA,IACvB,MAAM,IAAI,YAA0C,eAAe;AAAA,EACrE;AAEA,WAAS,WAAW,eAAe;AAEnC,4BAA0B,MAAM;AAC9B,WAAO,SAAS,UAAU;AAAA,EAC5B,GAAG,EAAE;AAEL,4BAA0B,MAAM;AAC9B,WAAO,SAAS,YAAY;AAAA,EAAA,CAC7B;AAEM,SAAA;AACT;AAEO,SAAS,eAId,SAI2C;AAC3C,SAAO,mBAAiD;AAAA,IACtD;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,CACJ;AACH;AAEO,SAAS,qBACd,SAOmC;AACnC,SAAO,mBAAyC;AAAA,IAC9C,kBAAkB,MAAO,OAAO,aAAa,cAAc,SAAS;AAAA,IACpE,oBAAoB;AAAA,IACpB,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,eAAe,MAAO,OAAO,aAAa,cAAc,OAAO,UAAU;AAAA,IACzE,GAAG;AAAA,EAAA,CACJ;AACH;"}
@@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"></line>
<line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"></line>
<line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"></line>
</svg>

After

Width:  |  Height:  |  Size: 223 B

@@ -0,0 +1,133 @@
var _typeof = require("./typeof.js")["default"];
var checkInRHS = require("./checkInRHS.js");
var setFunctionName = require("./setFunctionName.js");
var toPropertyKey = require("./toPropertyKey.js");
function applyDecs2305(e, t, r, n, o, a) {
function i(e, t, r) {
return function (n, o) {
return r && r(n), e[t].call(n, o);
};
}
function c(e, t) {
for (var r = 0; r < e.length; r++) e[r].call(t);
return t;
}
function s(e, t, r, n) {
if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined"));
return e;
}
function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) {
function m(e) {
if (!h(e)) throw new TypeError("Attempted to access private element on non-instance");
}
var y,
v = t[0],
g = t[3],
b = !u;
if (!b) {
r || Array.isArray(v) || (v = [v]);
var w = {},
S = [],
A = 3 === o ? "get" : 4 === o || d ? "set" : "value";
f ? (p || d ? w = {
get: setFunctionName(function () {
return g(this);
}, n, "get"),
set: function set(e) {
t[4](this, e);
}
} : w[A] = g, p || setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n));
}
for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) {
var D = v[j],
E = r ? v[j - 1] : void 0,
I = {},
O = {
kind: ["field", "accessor", "method", "getter", "setter", "class"][o],
name: n,
metadata: a,
addInitializer: function (e, t) {
if (e.v) throw Error("attempted to call addInitializer after decoration was finished");
s(t, "An initializer", "be", !0), c.push(t);
}.bind(null, I)
};
try {
if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else {
var k, F;
O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) {
return m(e), w.value;
} : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) {
return e[n];
}, (o < 2 || 4 === o) && (F = function F(e, t) {
e[n] = t;
}));
var N = O.access = {
has: f ? h.bind() : function (e) {
return n in e;
}
};
if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? {
get: w.get,
set: w.set
} : w[A], O), d) {
if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
} else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P);
}
} finally {
I.v = !0;
}
}
return (p || d) && u.push(function (e, t) {
for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t);
return t;
}), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P;
}
function u(e, t) {
return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), {
configurable: !0,
enumerable: !0,
value: t
});
}
if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")];
var f = Object.create(null == l ? null : l),
p = function (e, t, r, n) {
var o,
a,
i = [],
s = function s(t) {
return checkInRHS(t) === e;
},
u = new Map();
function l(e) {
e && i.push(c.bind(null, e));
}
for (var f = 0; f < t.length; f++) {
var p = t[f];
if (Array.isArray(p)) {
var d = p[1],
h = p[2],
m = p.length > 3,
y = 16 & d,
v = !!(8 & d),
g = 0 == (d &= 7),
b = h + "/" + v;
if (!g && !m) {
var w = u.get(b);
if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h);
u.set(b, !(d > 2) || d);
}
applyDec(v ? e : e.prototype, p, y, m ? "#" + h : toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r);
}
}
return l(o), l(a), i;
}(e, t, o, f);
return r.length || u(e, f), {
e: p,
get c() {
var t = [];
return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)];
}
};
}
module.exports = applyDecs2305, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,37 @@
'use strict'
class Warning {
constructor(text, opts = {}) {
this.type = 'warning'
this.text = text
if (opts.node && opts.node.source) {
let range = opts.node.rangeBy(opts)
this.line = range.start.line
this.column = range.start.column
this.endLine = range.end.line
this.endColumn = range.end.column
}
for (let opt in opts) this[opt] = opts[opt]
}
toString() {
if (this.node) {
return this.node.error(this.text, {
index: this.index,
plugin: this.plugin,
word: this.word
}).message
}
if (this.plugin) {
return this.plugin + ': ' + this.text
}
return this.text
}
}
module.exports = Warning
Warning.default = Warning
@@ -0,0 +1,10 @@
"use client";
import { useContext } from 'react';
import { PresenceContext } from '../../context/PresenceContext.mjs';
function usePresenceData() {
const context = useContext(PresenceContext);
return context ? context.custom : undefined;
}
export { usePresenceData };
@@ -0,0 +1,302 @@
# prop-types [![Build Status](https://travis-ci.com/facebook/prop-types.svg?branch=main)](https://travis-ci.org/facebook/prop-types)
Runtime type checking for React props and similar objects.
You can use prop-types to document the intended types of properties passed to
components. React (and potentially other libraries—see the `checkPropTypes()`
reference below) will check props passed to your components against those
definitions, and warn in development if they don’t match.
## Installation
```shell
npm install --save prop-types
```
## Importing
```js
import PropTypes from 'prop-types'; // ES6
var PropTypes = require('prop-types'); // ES5 with npm
```
### CDN
If you prefer to exclude `prop-types` from your application and use it
globally via `window.PropTypes`, the `prop-types` package provides
single-file distributions, which are hosted on the following CDNs:
* [**unpkg**](https://unpkg.com/prop-types/)
```html
<!-- development version -->
<script src="https://unpkg.com/prop-types@15.6/prop-types.js"></script>
<!-- production version -->
<script src="https://unpkg.com/prop-types@15.6/prop-types.min.js"></script>
```
* [**cdnjs**](https://cdnjs.com/libraries/prop-types)
```html
<!-- development version -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/prop-types/15.6.0/prop-types.js"></script>
<!-- production version -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/prop-types/15.6.0/prop-types.min.js"></script>
```
To load a specific version of `prop-types` replace `15.6.0` with the version number.
## Usage
PropTypes was originally exposed as part of the React core module, and is
commonly used with React components.
Here is an example of using PropTypes with a React component, which also
documents the different validators provided:
```js
import React from 'react';
import PropTypes from 'prop-types';
class MyComponent extends React.Component {
render() {
// ... do things with the props
}
}
MyComponent.propTypes = {
// You can declare that a prop is a specific JS primitive. By default, these
// are all optional.
optionalArray: PropTypes.array,
optionalBigInt: PropTypes.bigint,
optionalBool: PropTypes.bool,
optionalFunc: PropTypes.func,
optionalNumber: PropTypes.number,
optionalObject: PropTypes.object,
optionalString: PropTypes.string,
optionalSymbol: PropTypes.symbol,
// Anything that can be rendered: numbers, strings, elements or an array
// (or fragment) containing these types.
// see https://reactjs.org/docs/rendering-elements.html for more info
optionalNode: PropTypes.node,
// A React element (ie. <MyComponent />).
optionalElement: PropTypes.element,
// A React element type (eg. MyComponent).
// a function, string, or "element-like" object (eg. React.Fragment, Suspense, etc.)
// see https://github.com/facebook/react/blob/HEAD/packages/shared/isValidElementType.js
optionalElementType: PropTypes.elementType,
// You can also declare that a prop is an instance of a class. This uses
// JS's instanceof operator.
optionalMessage: PropTypes.instanceOf(Message),
// You can ensure that your prop is limited to specific values by treating
// it as an enum.
optionalEnum: PropTypes.oneOf(['News', 'Photos']),
// An object that could be one of many types
optionalUnion: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.instanceOf(Message)
]),
// An array of a certain type
optionalArrayOf: PropTypes.arrayOf(PropTypes.number),
// An object with property values of a certain type
optionalObjectOf: PropTypes.objectOf(PropTypes.number),
// You can chain any of the above with `isRequired` to make sure a warning
// is shown if the prop isn't provided.
// An object taking on a particular shape
optionalObjectWithShape: PropTypes.shape({
optionalProperty: PropTypes.string,
requiredProperty: PropTypes.number.isRequired
}),
// An object with warnings on extra properties
optionalObjectWithStrictShape: PropTypes.exact({
optionalProperty: PropTypes.string,
requiredProperty: PropTypes.number.isRequired
}),
requiredFunc: PropTypes.func.isRequired,
// A value of any data type
requiredAny: PropTypes.any.isRequired,
// You can also specify a custom validator. It should return an Error
// object if the validation fails. Don't `console.warn` or throw, as this
// won't work inside `oneOfType`.
customProp: function(props, propName, componentName) {
if (!/matchme/.test(props[propName])) {
return new Error(
'Invalid prop `' + propName + '` supplied to' +
' `' + componentName + '`. Validation failed.'
);
}
},
// You can also supply a custom validator to `arrayOf` and `objectOf`.
// It should return an Error object if the validation fails. The validator
// will be called for each key in the array or object. The first two
// arguments of the validator are the array or object itself, and the
// current item's key.
customArrayProp: PropTypes.arrayOf(function(propValue, key, componentName, location, propFullName) {
if (!/matchme/.test(propValue[key])) {
return new Error(
'Invalid prop `' + propFullName + '` supplied to' +
' `' + componentName + '`. Validation failed.'
);
}
})
};
```
Refer to the [React documentation](https://facebook.github.io/react/docs/typechecking-with-proptypes.html) for more information.
## Migrating from React.PropTypes
Check out [Migrating from React.PropTypes](https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) for details on how to migrate to `prop-types` from `React.PropTypes`.
Note that this blog posts **mentions a codemod script that performs the conversion automatically**.
There are also important notes below.
## How to Depend on This Package?
For apps, we recommend putting it in `dependencies` with a caret range.
For example:
```js
"dependencies": {
"prop-types": "^15.5.7"
}
```
For libraries, we *also* recommend leaving it in `dependencies`:
```js
"dependencies": {
"prop-types": "^15.5.7"
},
"peerDependencies": {
"react": "^15.5.0"
}
```
**Note:** there are known issues in versions before 15.5.7 so we recommend using it as the minimal version.
Make sure that the version range uses a caret (`^`) and thus is broad enough for npm to efficiently deduplicate packages.
For UMD bundles of your components, make sure you **don’t** include `PropTypes` in the build. Usually this is done by marking it as an external (the specifics depend on your bundler), just like you do with React.
## Compatibility
### React 0.14
This package is compatible with **React 0.14.9**. Compared to 0.14.8 (which was released in March of 2016), there are no other changes in 0.14.9, so it should be a painless upgrade.
```shell
# ATTENTION: Only run this if you still use React 0.14!
npm install --save react@^0.14.9 react-dom@^0.14.9
```
### React 15+
This package is compatible with **React 15.3.0** and higher.
```
npm install --save react@^15.3.0 react-dom@^15.3.0
```
### What happens on other React versions?
It outputs warnings with the message below even though the developer doesn’t do anything wrong. Unfortunately there is no solution for this other than updating React to either 15.3.0 or higher, or 0.14.9 if you’re using React 0.14.
## Difference from `React.PropTypes`: Don’t Call Validator Functions
First of all, **which version of React are you using**? You might be seeing this message because a component library has updated to use `prop-types` package, but your version of React is incompatible with it. See the [above section](#compatibility) for more details.
Are you using either React 0.14.9 or a version higher than React 15.3.0? Read on.
When you migrate components to use the standalone `prop-types`, **all validator functions will start throwing an error if you call them directly**. This makes sure that nobody relies on them in production code, and it is safe to strip their implementations to optimize the bundle size.
Code like this is still fine:
```js
MyComponent.propTypes = {
myProp: PropTypes.bool
};
```
However, code like this will not work with the `prop-types` package:
```js
// Will not work with `prop-types` package!
var errorOrNull = PropTypes.bool(42, 'myProp', 'MyComponent', 'prop');
```
It will throw an error:
```
Calling PropTypes validators directly is not supported by the `prop-types` package.
Use PropTypes.checkPropTypes() to call them.
```
(If you see **a warning** rather than an error with this message, please check the [above section about compatibility](#compatibility).)
This is new behavior, and you will only encounter it when you migrate from `React.PropTypes` to the `prop-types` package. For the vast majority of components, this doesn’t matter, and if you didn’t see [this warning](https://facebook.github.io/react/warnings/dont-call-proptypes.html) in your components, your code is safe to migrate. This is not a breaking change in React because you are only opting into this change for a component by explicitly changing your imports to use `prop-types`. If you temporarily need the old behavior, you can keep using `React.PropTypes` until React 16.
**If you absolutely need to trigger the validation manually**, call `PropTypes.checkPropTypes()`. Unlike the validators themselves, this function is safe to call in production, as it will be replaced by an empty function:
```js
// Works with standalone PropTypes
PropTypes.checkPropTypes(MyComponent.propTypes, props, 'prop', 'MyComponent');
```
See below for more info.
**If you DO want to use validation in production**, you can choose to use the **development version** by importing/requiring `prop-types/prop-types` instead of `prop-types`.
**You might also see this error** if you’re calling a `PropTypes` validator from your own custom `PropTypes` validator. In this case, the fix is to make sure that you are passing *all* of the arguments to the inner function. There is a more in-depth explanation of how to fix it [on this page](https://facebook.github.io/react/warnings/dont-call-proptypes.html#fixing-the-false-positive-in-third-party-proptypes). Alternatively, you can temporarily keep using `React.PropTypes` until React 16, as it would still only warn in this case.
If you use a bundler like Browserify or Webpack, don’t forget to [follow these instructions](https://reactjs.org/docs/optimizing-performance.html#use-the-production-build) to correctly bundle your application in development or production mode. Otherwise you’ll ship unnecessary code to your users.
## PropTypes.checkPropTypes
React will automatically check the propTypes you set on the component, but if
you are using PropTypes without React then you may want to manually call
`PropTypes.checkPropTypes`, like so:
```js
const myPropTypes = {
name: PropTypes.string,
age: PropTypes.number,
// ... define your prop validations
};
const props = {
name: 'hello', // is valid
age: 'world', // not valid
};
// Let's say your component is called 'MyComponent'
// Works with standalone PropTypes
PropTypes.checkPropTypes(myPropTypes, props, 'prop', 'MyComponent');
// This will warn as follows:
// Warning: Failed prop type: Invalid prop `age` of type `string` supplied to
// `MyComponent`, expected `number`.
```
## PropTypes.resetWarningCache()
`PropTypes.checkPropTypes(...)` only `console.error`s a given message once. To reset the error warning cache in tests, call `PropTypes.resetWarningCache()`
### License
prop-types is [MIT licensed](./LICENSE).
@@ -0,0 +1,2 @@
import { ConfigUtils } from './config-utils';
export declare function mergeClassList(classList: string, configUtils: ConfigUtils): string;
@@ -0,0 +1 @@
{"version":3,"file":"resolveInstanceBindingConstructorParams.d.ts","sourceRoot":"","sources":["../../../../src/resolution/actions/resolveInstanceBindingConstructorParams.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,wBAAgB,uCAAuC,CACrD,UAAU,EACV,QAAQ,SAAS,eAAe,CAAC,UAAU,CAAC,GAAG,eAAe,CAAC,UAAU,CAAC,EAE1E,kBAAkB,EAAE,CAClB,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,eAAe,KACzB,OAAO,GACX,CACD,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,KAChC,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAqBlC"}
@@ -0,0 +1,2 @@
import { loadConfig } from '../lib/load-config'
export default loadConfig
@@ -0,0 +1,648 @@
import * as _codemirror_state from '@codemirror/state';
import { EditorState, ChangeDesc, TransactionSpec, Transaction, StateCommand, Facet, Extension, StateEffect } from '@codemirror/state';
import { EditorView, Rect, KeyBinding, Command } from '@codemirror/view';
import * as _lezer_common from '@lezer/common';
/**
Objects type used to represent individual completions.
*/
interface Completion {
/**
The label to show in the completion picker. This is what input
is matched against to determine whether a completion matches (and
how well it matches).
*/
label: string;
/**
An optional override for the completion's visible label. When
using this, matched characters will only be highlighted if you
provide a [`getMatch`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.getMatch)
function.
*/
displayLabel?: string;
/**
Overrides the text that is used to sort completions. Will
default to `label` if not given.
*/
sortText?: string;
/**
An optional short piece of information to show (with a different
style) after the label.
*/
detail?: string;
/**
Additional info to show when the completion is selected. Can be
a plain string or a function that'll render the DOM structure to
show when invoked.
*/
info?: string | ((completion: Completion) => CompletionInfo | Promise<CompletionInfo>);
/**
How to apply the completion. The default is to replace it with
its [label](https://codemirror.net/6/docs/ref/#autocomplete.Completion.label). When this holds a
string, the completion range is replaced by that string. When it
is a function, that function is called to perform the
completion. If it fires a transaction, it is responsible for
adding the [`pickedCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.pickedCompletion)
annotation to it.
*/
apply?: string | ((view: EditorView, completion: Completion, from: number, to: number) => void);
/**
The type of the completion. This is used to pick an icon to show
for the completion. Icons are styled with a CSS class created by
appending the type name to `"cm-completionIcon-"`. You can
define or restyle icons by defining these selectors. The base
library defines simple icons for `class`, `constant`, `enum`,
`function`, `interface`, `keyword`, `method`, `namespace`,
`property`, `text`, `type`, and `variable`.
Multiple types can be provided by separating them with spaces.
*/
type?: string;
/**
When this option is selected, and one of these characters is
typed, insert the completion before typing the character.
*/
commitCharacters?: readonly string[];
/**
When given, should be a number from -99 to 99 that adjusts how
this completion is ranked compared to other completions that
match the input as well as this one. A negative number moves it
down the list, a positive number moves it up.
*/
boost?: number;
/**
Can be used to divide the completion list into sections.
Completions in a given section (matched by name) will be grouped
together, with a heading above them. Options without section
will appear above all sections. A string value is equivalent to
a `{name}` object.
*/
section?: string | CompletionSection;
}
/**
The type returned from
[`Completion.info`](https://codemirror.net/6/docs/ref/#autocomplete.Completion.info). May be a DOM
node, null to indicate there is no info, or an object with an
optional `destroy` method that cleans up the node.
*/
type CompletionInfo = Node | null | {
dom: Node;
destroy?(): void;
};
/**
Object used to describe a completion
[section](https://codemirror.net/6/docs/ref/#autocomplete.Completion.section). It is recommended to
create a shared object used by all the completions in a given
section.
*/
interface CompletionSection {
/**
The name of the section. If no `render` method is present, this
will be displayed above the options.
*/
name: string;
/**
An optional function that renders the section header. Since the
headers are shown inside a list, you should make sure the
resulting element has a `display: list-item` style.
*/
header?: (section: CompletionSection) => HTMLElement;
/**
By default, sections are ordered alphabetically by name. To
specify an explicit order, `rank` can be used. Sections with a
lower rank will be shown above sections with a higher rank.
When set to `"dynamic"`, the section's position compared to
other dynamic sections depends on the matching score of the
best-matching option in the sections.
*/
rank?: number | "dynamic";
}
/**
An instance of this is passed to completion source functions.
*/
declare class CompletionContext {
/**
The editor state that the completion happens in.
*/
readonly state: EditorState;
/**
The position at which the completion is happening.
*/
readonly pos: number;
/**
Indicates whether completion was activated explicitly, or
implicitly by typing. The usual way to respond to this is to
only return completions when either there is part of a
completable entity before the cursor, or `explicit` is true.
*/
readonly explicit: boolean;
/**
The editor view. May be undefined if the context was created
in a situation where there is no such view available, such as
in synchronous updates via
[`CompletionResult.update`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.update)
or when called by test code.
*/
readonly view?: EditorView | undefined;
/**
Create a new completion context. (Mostly useful for testing
completion sources—in the editor, the extension will create
these for you.)
*/
constructor(
/**
The editor state that the completion happens in.
*/
state: EditorState,
/**
The position at which the completion is happening.
*/
pos: number,
/**
Indicates whether completion was activated explicitly, or
implicitly by typing. The usual way to respond to this is to
only return completions when either there is part of a
completable entity before the cursor, or `explicit` is true.
*/
explicit: boolean,
/**
The editor view. May be undefined if the context was created
in a situation where there is no such view available, such as
in synchronous updates via
[`CompletionResult.update`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.update)
or when called by test code.
*/
view?: EditorView | undefined);
/**
Get the extent, content, and (if there is a token) type of the
token before `this.pos`.
*/
tokenBefore(types: readonly string[]): {
from: number;
to: number;
text: string;
type: _lezer_common.NodeType;
} | null;
/**
Get the match of the given expression directly before the
cursor.
*/
matchBefore(expr: RegExp): {
from: number;
to: number;
text: string;
} | null;
/**
Yields true when the query has been aborted. Can be useful in
asynchronous queries to avoid doing work that will be ignored.
*/
get aborted(): boolean;
/**
Allows you to register abort handlers, which will be called when
the query is
[aborted](https://codemirror.net/6/docs/ref/#autocomplete.CompletionContext.aborted).
By default, running queries will not be aborted for regular
typing or backspacing, on the assumption that they are likely to
return a result with a
[`validFor`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.validFor) field that
allows the result to be used after all. Passing `onDocChange:
true` will cause this query to be aborted for any document
change.
*/
addEventListener(type: "abort", listener: () => void, options?: {
onDocChange: boolean;
}): void;
}
/**
Given a a fixed array of options, return an autocompleter that
completes them.
*/
declare function completeFromList(list: readonly (string | Completion)[]): CompletionSource;
/**
Wrap the given completion source so that it will only fire when the
cursor is in a syntax node with one of the given names.
*/
declare function ifIn(nodes: readonly string[], source: CompletionSource): CompletionSource;
/**
Wrap the given completion source so that it will not fire when the
cursor is in a syntax node with one of the given names.
*/
declare function ifNotIn(nodes: readonly string[], source: CompletionSource): CompletionSource;
/**
The function signature for a completion source. Such a function
may return its [result](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult)
synchronously or as a promise. Returning null indicates no
completions are available.
*/
type CompletionSource = (context: CompletionContext) => CompletionResult | null | Promise<CompletionResult | null>;
/**
Interface for objects returned by completion sources.
*/
interface CompletionResult {
/**
The start of the range that is being completed.
*/
from: number;
/**
The end of the range that is being completed. Defaults to the
main cursor position.
*/
to?: number;
/**
The completions returned. These don't have to be compared with
the input by the source—the autocompletion system will do its
own matching (against the text between `from` and `to`) and
sorting.
*/
options: readonly Completion[];
/**
When given, further typing or deletion that causes the part of
the document between ([mapped](https://codemirror.net/6/docs/ref/#state.ChangeDesc.mapPos)) `from`
and `to` to match this regular expression or predicate function
will not query the completion source again, but continue with
this list of options. This can help a lot with responsiveness,
since it allows the completion list to be updated synchronously.
*/
validFor?: RegExp | ((text: string, from: number, to: number, state: EditorState) => boolean);
/**
By default, the library filters and scores completions. Set
`filter` to `false` to disable this, and cause your completions
to all be included, in the order they were given. When there are
other sources, unfiltered completions appear at the top of the
list of completions. `validFor` must not be given when `filter`
is `false`, because it only works when filtering.
*/
filter?: boolean;
/**
When [`filter`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.filter) is set to
`false` or a completion has a
[`displayLabel`](https://codemirror.net/6/docs/ref/#autocomplete.Completion.displayLabel), this
may be provided to compute the ranges on the label that match
the input. Should return an array of numbers where each pair of
adjacent numbers provide the start and end of a range. The
second argument, the match found by the library, is only passed
when `filter` isn't `false`.
*/
getMatch?: (completion: Completion, matched?: readonly number[]) => readonly number[];
/**
Synchronously update the completion result after typing or
deletion. If given, this should not do any expensive work, since
it will be called during editor state updates. The function
should make sure (similar to
[`validFor`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.validFor)) that the
completion still applies in the new state.
*/
update?: (current: CompletionResult, from: number, to: number, context: CompletionContext) => CompletionResult | null;
/**
When results contain position-dependent information in, for
example, `apply` methods, you can provide this method to update
the result for transactions that happen after the query. It is
not necessary to update `from` and `to`—those are tracked
automatically.
*/
map?: (current: CompletionResult, changes: ChangeDesc) => CompletionResult | null;
/**
Set a default set of [commit
characters](https://codemirror.net/6/docs/ref/#autocomplete.Completion.commitCharacters) for all
options in this result.
*/
commitCharacters?: readonly string[];
}
/**
This annotation is added to transactions that are produced by
picking a completion.
*/
declare const pickedCompletion: _codemirror_state.AnnotationType<Completion>;
/**
Helper function that returns a transaction spec which inserts a
completion's text in the main selection range, and any other
selection range that has the same text in front of it.
*/
declare function insertCompletionText(state: EditorState, text: string, from: number, to: number): TransactionSpec;
interface CompletionConfig {
/**
When enabled (defaults to true), autocompletion will start
whenever the user types something that can be completed.
*/
activateOnTyping?: boolean;
/**
When given, if a completion that matches the predicate is
picked, reactivate completion again as if it was typed normally.
*/
activateOnCompletion?: (completion: Completion) => boolean;
/**
The amount of time to wait for further typing before querying
completion sources via
[`activateOnTyping`](https://codemirror.net/6/docs/ref/#autocomplete.autocompletion^config.activateOnTyping).
Defaults to 100, which should be fine unless your completion
source is very slow and/or doesn't use `validFor`.
*/
activateOnTypingDelay?: number;
/**
By default, when completion opens, the first option is selected
and can be confirmed with
[`acceptCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.acceptCompletion). When this
is set to false, the completion widget starts with no completion
selected, and the user has to explicitly move to a completion
before you can confirm one.
*/
selectOnOpen?: boolean;
/**
Override the completion sources used. By default, they will be
taken from the `"autocomplete"` [language
data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) (which should hold
[completion sources](https://codemirror.net/6/docs/ref/#autocomplete.CompletionSource) or arrays
of [completions](https://codemirror.net/6/docs/ref/#autocomplete.Completion)).
*/
override?: readonly CompletionSource[] | null;
/**
Determines whether the completion tooltip is closed when the
editor loses focus. Defaults to true.
*/
closeOnBlur?: boolean;
/**
The maximum number of options to render to the DOM.
*/
maxRenderedOptions?: number;
/**
Set this to false to disable the [default completion
keymap](https://codemirror.net/6/docs/ref/#autocomplete.completionKeymap). (This requires you to
add bindings to control completion yourself. The bindings should
probably have a higher precedence than other bindings for the
same keys.)
*/
defaultKeymap?: boolean;
/**
By default, completions are shown below the cursor when there is
space. Setting this to true will make the extension put the
completions above the cursor when possible.
*/
aboveCursor?: boolean;
/**
When given, this may return an additional CSS class to add to
the completion dialog element.
*/
tooltipClass?: (state: EditorState) => string;
/**
This can be used to add additional CSS classes to completion
options.
*/
optionClass?: (completion: Completion) => string;
/**
By default, the library will render icons based on the
completion's [type](https://codemirror.net/6/docs/ref/#autocomplete.Completion.type) in front of
each option. Set this to false to turn that off.
*/
icons?: boolean;
/**
This option can be used to inject additional content into
options. The `render` function will be called for each visible
completion, and should produce a DOM node to show. `position`
determines where in the DOM the result appears, relative to
other added widgets and the standard content. The default icons
have position 20, the label position 50, and the detail position
80.
*/
addToOptions?: {
render: (completion: Completion, state: EditorState, view: EditorView) => Node | null;
position: number;
}[];
/**
By default, [info](https://codemirror.net/6/docs/ref/#autocomplete.Completion.info) tooltips are
placed to the side of the selected completion. This option can
be used to override that. It will be given rectangles for the
list of completions, the selected option, the info element, and
the availble [tooltip
space](https://codemirror.net/6/docs/ref/#view.tooltips^config.tooltipSpace), and should return
style and/or class strings for the info element.
*/
positionInfo?: (view: EditorView, list: Rect, option: Rect, info: Rect, space: Rect) => {
style?: string;
class?: string;
};
/**
The comparison function to use when sorting completions with the same
match score. Defaults to using
[`localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare).
*/
compareCompletions?: (a: Completion, b: Completion) => number;
/**
When set to true (the default is false), turn off fuzzy matching
of completions and only show those that start with the text the
user typed. Only takes effect for results where
[`filter`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.filter) isn't false.
*/
filterStrict?: boolean;
/**
By default, commands relating to an open completion only take
effect 75 milliseconds after the completion opened, so that key
presses made before the user is aware of the tooltip don't go to
the tooltip. This option can be used to configure that delay.
*/
interactionDelay?: number;
/**
When there are multiple asynchronous completion sources, this
controls how long the extension waits for a slow source before
displaying results from faster sources. Defaults to 100
milliseconds.
*/
updateSyncTime?: number;
}
/**
Convert a snippet template to a function that can
[apply](https://codemirror.net/6/docs/ref/#autocomplete.Completion.apply) it. Snippets are written
using syntax like this:
"for (let ${index} = 0; ${index} < ${end}; ${index}++) {\n\t${}\n}"
Each `${}` placeholder (you may also use `#{}`) indicates a field
that the user can fill in. Its name, if any, will be the default
content for the field.
When the snippet is activated by calling the returned function,
the code is inserted at the given position. Newlines in the
template are indented by the indentation of the start line, plus
one [indent unit](https://codemirror.net/6/docs/ref/#language.indentUnit) per tab character after
the newline.
On activation, (all instances of) the first field are selected.
The user can move between fields with Tab and Shift-Tab as long as
the fields are active. Moving to the last field or moving the
cursor out of the current field deactivates the fields.
The order of fields defaults to textual order, but you can add
numbers to placeholders (`${1}` or `${1:defaultText}`) to provide
a custom order.
To include a literal `{` or `}` in your template, put a backslash
in front of it. This will be removed and the brace will not be
interpreted as indicating a placeholder.
*/
declare function snippet(template: string): (editor: {
state: EditorState;
dispatch: (tr: Transaction) => void;
}, completion: Completion | null, from: number, to: number) => void;
/**
A command that clears the active snippet, if any.
*/
declare const clearSnippet: StateCommand;
/**
Move to the next snippet field, if available.
*/
declare const nextSnippetField: StateCommand;
/**
Move to the previous snippet field, if available.
*/
declare const prevSnippetField: StateCommand;
/**
Check if there is an active snippet with a next field for
`nextSnippetField` to move to.
*/
declare function hasNextSnippetField(state: EditorState): boolean;
/**
Returns true if there is an active snippet and a previous field
for `prevSnippetField` to move to.
*/
declare function hasPrevSnippetField(state: EditorState): boolean;
/**
A facet that can be used to configure the key bindings used by
snippets. The default binds Tab to
[`nextSnippetField`](https://codemirror.net/6/docs/ref/#autocomplete.nextSnippetField), Shift-Tab to
[`prevSnippetField`](https://codemirror.net/6/docs/ref/#autocomplete.prevSnippetField), and Escape
to [`clearSnippet`](https://codemirror.net/6/docs/ref/#autocomplete.clearSnippet).
*/
declare const snippetKeymap: Facet<readonly KeyBinding[], readonly KeyBinding[]>;
/**
Create a completion from a snippet. Returns an object with the
properties from `completion`, plus an `apply` function that
applies the snippet.
*/
declare function snippetCompletion(template: string, completion: Completion): Completion;
/**
Returns a command that moves the completion selection forward or
backward by the given amount.
*/
declare function moveCompletionSelection(forward: boolean, by?: "option" | "page"): Command;
/**
Accept the current completion.
*/
declare const acceptCompletion: Command;
/**
Explicitly start autocompletion.
*/
declare const startCompletion: Command;
/**
Close the currently active completion.
*/
declare const closeCompletion: Command;
/**
A completion source that will scan the document for words (using a
[character categorizer](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer)), and
return those as completions.
*/
declare const completeAnyWord: CompletionSource;
/**
Configures bracket closing behavior for a syntax (via
[language data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt)) using the `"closeBrackets"`
identifier.
*/
interface CloseBracketConfig {
/**
The opening brackets to close. Defaults to `["(", "[", "{", "'",
'"']`. Brackets may be single characters or a triple of quotes
(as in `"'''"`).
*/
brackets?: string[];
/**
Characters in front of which newly opened brackets are
automatically closed. Closing always happens in front of
whitespace. Defaults to `")]}:;>"`.
*/
before?: string;
/**
When determining whether a given node may be a string, recognize
these prefixes before the opening quote.
*/
stringPrefixes?: string[];
}
/**
Extension to enable bracket-closing behavior. When a closeable
bracket is typed, its closing bracket is immediately inserted
after the cursor. When closing a bracket directly in front of a
closing bracket inserted by the extension, the cursor moves over
that bracket.
*/
declare function closeBrackets(): Extension;
/**
Command that implements deleting a pair of matching brackets when
the cursor is between them.
*/
declare const deleteBracketPair: StateCommand;
/**
Close-brackets related key bindings. Binds Backspace to
[`deleteBracketPair`](https://codemirror.net/6/docs/ref/#autocomplete.deleteBracketPair).
*/
declare const closeBracketsKeymap: readonly KeyBinding[];
/**
Implements the extension's behavior on text insertion. If the
given string counts as a bracket in the language around the
selection, and replacing the selection with it requires custom
behavior (inserting a closing version or skipping past a
previously-closed bracket), this function returns a transaction
representing that custom behavior. (You only need this if you want
to programmatically insert brackets—the
[`closeBrackets`](https://codemirror.net/6/docs/ref/#autocomplete.closeBrackets) extension will
take care of running this for user input.)
*/
declare function insertBracket(state: EditorState, bracket: string): Transaction | null;
/**
Returns an extension that enables autocompletion.
*/
declare function autocompletion(config?: CompletionConfig): Extension;
/**
Basic keybindings for autocompletion.
- Ctrl-Space (and Alt-\` or Alt-i on macOS): [`startCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.startCompletion)
- Escape: [`closeCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.closeCompletion)
- ArrowDown: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(true)`
- ArrowUp: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(false)`
- PageDown: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(true, "page")`
- PageUp: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(false, "page")`
- Enter: [`acceptCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.acceptCompletion)
*/
declare const completionKeymap: readonly KeyBinding[];
/**
Get the current completion status. When completions are available,
this will return `"active"`. When completions are pending (in the
process of being queried), this returns `"pending"`. Otherwise, it
returns `null`.
*/
declare function completionStatus(state: EditorState): null | "active" | "pending";
/**
Returns the available completions as an array.
*/
declare function currentCompletions(state: EditorState): readonly Completion[];
/**
Return the currently selected completion, if any.
*/
declare function selectedCompletion(state: EditorState): Completion | null;
/**
Returns the currently selected position in the active completion
list, or null if no completions are active.
*/
declare function selectedCompletionIndex(state: EditorState): number | null;
/**
Create an effect that can be attached to a transaction to change
the currently selected completion.
*/
declare function setSelectedCompletion(index: number): StateEffect<unknown>;
export { type CloseBracketConfig, type Completion, CompletionContext, type CompletionInfo, type CompletionResult, type CompletionSection, type CompletionSource, acceptCompletion, autocompletion, clearSnippet, closeBrackets, closeBracketsKeymap, closeCompletion, completeAnyWord, completeFromList, completionKeymap, completionStatus, currentCompletions, deleteBracketPair, hasNextSnippetField, hasPrevSnippetField, ifIn, ifNotIn, insertBracket, insertCompletionText, moveCompletionSelection, nextSnippetField, pickedCompletion, prevSnippetField, selectedCompletion, selectedCompletionIndex, setSelectedCompletion, snippet, snippetCompletion, snippetKeymap, startCompletion };
@@ -0,0 +1,3 @@
const compareByDepth = (a, b) => a.depth - b.depth;
export { compareByDepth };
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=Snapshot.js.map
@@ -0,0 +1,31 @@
var has = Object.prototype.hasOwnProperty;
function dequal(foo, bar) {
var ctor, len;
if (foo === bar) return true;
if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
if (ctor === Date) return foo.getTime() === bar.getTime();
if (ctor === RegExp) return foo.toString() === bar.toString();
if (ctor === Array) {
if ((len=foo.length) === bar.length) {
while (len-- && dequal(foo[len], bar[len]));
}
return len === -1;
}
if (!ctor || typeof foo === 'object') {
len = 0;
for (ctor in foo) {
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
}
return Object.keys(bar).length === len;
}
}
return foo !== foo && bar !== bar;
}
exports.dequal = dequal;
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/es-to-primitive
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,73 @@
{
"name": "cross-spawn",
"version": "7.0.6",
"description": "Cross platform child_process#spawn and child_process#spawnSync",
"keywords": [
"spawn",
"spawnSync",
"windows",
"cross-platform",
"path-ext",
"shebang",
"cmd",
"execute"
],
"author": "André Cruz <andre@moxy.studio>",
"homepage": "https://github.com/moxystudio/node-cross-spawn",
"repository": {
"type": "git",
"url": "git@github.com:moxystudio/node-cross-spawn.git"
},
"license": "MIT",
"main": "index.js",
"files": [
"lib"
],
"scripts": {
"lint": "eslint .",
"test": "jest --env node --coverage",
"prerelease": "npm t && npm run lint",
"release": "standard-version",
"postrelease": "git push --follow-tags origin HEAD && npm publish"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"eslint --fix",
"git add"
]
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"dependencies": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
},
"devDependencies": {
"@commitlint/cli": "^8.1.0",
"@commitlint/config-conventional": "^8.1.0",
"babel-core": "^6.26.3",
"babel-jest": "^24.9.0",
"babel-preset-moxy": "^3.1.0",
"eslint": "^5.16.0",
"eslint-config-moxy": "^7.1.0",
"husky": "^3.0.5",
"jest": "^24.9.0",
"lint-staged": "^9.2.5",
"mkdirp": "^0.5.1",
"rimraf": "^3.0.0",
"standard-version": "^9.5.0"
},
"engines": {
"node": ">= 8"
}
}
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2019_full: LibDefinition;
@@ -0,0 +1,5 @@
import { InternalBindingConstraints } from '../../binding/models/BindingConstraintsImplementation';
import { SingleImmutableLinkedList } from '../../common/models/SingleImmutableLinkedList';
import { PlanParams } from '../models/PlanParams';
export declare function buildPlanBindingConstraintsList(params: PlanParams): SingleImmutableLinkedList<InternalBindingConstraints>;
//# sourceMappingURL=buildPlanBindingConstraintsList.d.ts.map
@@ -0,0 +1,90 @@
/*!
Copyright 2013 Lovell Fuller and others.
SPDX-License-Identifier: Apache-2.0
*/
#ifndef SRC_METADATA_H_
#define SRC_METADATA_H_
#include <string>
#include <vector>
#include <napi.h>
#include "./common.h"
typedef std::vector<std::pair<std::string, std::string>> MetadataComments;
struct MetadataBaton {
// Input
sharp::InputDescriptor *input;
// Output
std::string format;
int width;
int height;
std::string space;
int channels;
std::string depth;
int density;
std::string chromaSubsampling;
bool isProgressive;
bool isPalette;
int bitsPerSample;
int pages;
int pageHeight;
int loop;
std::vector<int> delay;
int pagePrimary;
std::string compression;
std::string resolutionUnit;
std::string formatMagick;
std::vector<std::pair<int, int>> levels;
int subifds;
std::vector<double> background;
bool hasProfile;
bool hasAlpha;
int orientation;
char *exif;
size_t exifLength;
char *icc;
size_t iccLength;
char *iptc;
size_t iptcLength;
char *xmp;
size_t xmpLength;
char *tifftagPhotoshop;
size_t tifftagPhotoshopLength;
MetadataComments comments;
std::string err;
MetadataBaton():
input(nullptr),
width(0),
height(0),
channels(0),
density(0),
isProgressive(false),
isPalette(false),
bitsPerSample(0),
pages(0),
pageHeight(0),
loop(-1),
pagePrimary(-1),
subifds(0),
hasProfile(false),
hasAlpha(false),
orientation(0),
exif(nullptr),
exifLength(0),
icc(nullptr),
iccLength(0),
iptc(nullptr),
iptcLength(0),
xmp(nullptr),
xmpLength(0),
tifftagPhotoshop(nullptr),
tifftagPhotoshopLength(0) {}
};
Napi::Value metadata(const Napi::CallbackInfo& info);
#endif // SRC_METADATA_H_
@@ -0,0 +1,15 @@
/** Used to detect strings that need a more robust regexp to match words. */
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
/**
* Checks if `string` contains a word composed of Unicode symbols.
*
* @private
* @param {string} string The string to inspect.
* @returns {boolean} Returns `true` if a word is found, else `false`.
*/
function hasUnicodeWord(string) {
return reHasUnicodeWord.test(string);
}
module.exports = hasUnicodeWord;
@@ -0,0 +1,43 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("eslint-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Number.isFinite` method.",
category: "ES2015",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-number-isfinite.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' method is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"() {
const tracker = new ReferenceTracker(context.getScope())
for (const { node, path } of tracker.iterateGlobalReferences({
Number: {
isFinite: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1,9 @@
"use client";
import {
modal_default
} from "./chunk-3BLMMOBU.mjs";
import "./chunk-Z2LRST4N.mjs";
import "./chunk-UX6VCJJD.mjs";
export {
modal_default as default
};
@@ -0,0 +1 @@
{"version":3,"file":"binary-search.d.ts","sourceRoot":"","sources":["../src/binary-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG5E,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,IAAI,KAAK,SAAQ,CAAC;AAEzB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,MAAM,CAmBR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,aAAa,IAAI,SAAS,CAMzC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAsBR"}
@@ -0,0 +1,15 @@
/** Used to detect strings that need a more robust regexp to match words. */
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
/**
* Checks if `string` contains a word composed of Unicode symbols.
*
* @private
* @param {string} string The string to inspect.
* @returns {boolean} Returns `true` if a word is found, else `false`.
*/
function hasUnicodeWord(string) {
return reHasUnicodeWord.test(string);
}
export default hasUnicodeWord;
@@ -0,0 +1,212 @@
## 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,174 @@
/**
* @import {SafeConfig, State} from 'mdast-util-to-markdown'
*/
import {encodeCharacterReference} from './encode-character-reference.js'
import {patternInScope} from './pattern-in-scope.js'
/**
* Make a string safe for embedding in markdown constructs.
*
* In markdown, almost all punctuation characters can, in certain cases,
* result in something.
* Whether they do is highly subjective to where they happen and in what
* they happen.
*
* To solve this, `mdast-util-to-markdown` tracks:
*
* * Characters before and after something;
* * What “constructs” we are in.
*
* This information is then used by this function to escape or encode
* special characters.
*
* @param {State} state
* Info passed around about the current state.
* @param {string | null | undefined} input
* Raw value to make safe.
* @param {SafeConfig} config
* Configuration.
* @returns {string}
* Serialized markdown safe for embedding.
*/
export function safe(state, input, config) {
const value = (config.before || '') + (input || '') + (config.after || '')
/** @type {Array<number>} */
const positions = []
/** @type {Array<string>} */
const result = []
/** @type {Record<number, {before: boolean, after: boolean}>} */
const infos = {}
let index = -1
while (++index < state.unsafe.length) {
const pattern = state.unsafe[index]
if (!patternInScope(state.stack, pattern)) {
continue
}
const expression = state.compilePattern(pattern)
/** @type {RegExpExecArray | null} */
let match
while ((match = expression.exec(value))) {
const before = 'before' in pattern || Boolean(pattern.atBreak)
const after = 'after' in pattern
const position = match.index + (before ? match[1].length : 0)
if (positions.includes(position)) {
if (infos[position].before && !before) {
infos[position].before = false
}
if (infos[position].after && !after) {
infos[position].after = false
}
} else {
positions.push(position)
infos[position] = {before, after}
}
}
}
positions.sort(numerical)
let start = config.before ? config.before.length : 0
const end = value.length - (config.after ? config.after.length : 0)
index = -1
while (++index < positions.length) {
const position = positions[index]
// Character before or after matched:
if (position < start || position >= end) {
continue
}
// If this character is supposed to be escaped because it has a condition on
// the next character, and the next character is definitly being escaped,
// then skip this escape.
if (
(position + 1 < end &&
positions[index + 1] === position + 1 &&
infos[position].after &&
!infos[position + 1].before &&
!infos[position + 1].after) ||
(positions[index - 1] === position - 1 &&
infos[position].before &&
!infos[position - 1].before &&
!infos[position - 1].after)
) {
continue
}
if (start !== position) {
// If we have to use a character reference, an ampersand would be more
// correct, but as backslashes only care about punctuation, either will
// do the trick
result.push(escapeBackslashes(value.slice(start, position), '\\'))
}
start = position
if (
/[!-/:-@[-`{-~]/.test(value.charAt(position)) &&
(!config.encode || !config.encode.includes(value.charAt(position)))
) {
// Character escape.
result.push('\\')
} else {
// Character reference.
result.push(encodeCharacterReference(value.charCodeAt(position)))
start++
}
}
result.push(escapeBackslashes(value.slice(start, end), config.after))
return result.join('')
}
/**
* @param {number} a
* @param {number} b
* @returns {number}
*/
function numerical(a, b) {
return a - b
}
/**
* @param {string} value
* @param {string} after
* @returns {string}
*/
function escapeBackslashes(value, after) {
const expression = /\\(?=[!-/:-@[-`{-~])/g
/** @type {Array<number>} */
const positions = []
/** @type {Array<string>} */
const results = []
const whole = value + after
let index = -1
let start = 0
/** @type {RegExpExecArray | null} */
let match
while ((match = expression.exec(whole))) {
positions.push(match.index)
}
while (++index < positions.length) {
if (start !== positions[index]) {
results.push(value.slice(start, positions[index]))
}
results.push('\\')
start = positions[index]
}
results.push(value.slice(start))
return results.join('')
}
@@ -0,0 +1,8 @@
function _array_like_to_array(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
export { _array_like_to_array as _ };
@@ -0,0 +1 @@
{"name":"pvtsutils","version":"1.3.6","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532102969,"integrity":"sha512-N4iGh9caZ43qsXD/ay04OFLDQUGy5xqLdEppu+89p2vv79Ybsi/l5L6BSfZ+vJmpLF8v1U+Iu0BFSwBhUBQiyQ==","mode":420,"size":1084},"build/index.es.js":{"checkedAt":1794532102970,"integrity":"sha512-HE5J4lbWZhKur84duOgsVDWrxeaTbFUIWauekU9oH1/gyfGZEVVwATHZASfu9dfVv/B8y85E9eMb7MQLjZGsdw==","mode":420,"size":13455},"build/index.js":{"checkedAt":1794532102970,"integrity":"sha512-kVHziQ++3Z10qKkKx8C8XeEYDQPhoCInVoXxZdf43uxtXXECip5UcH5naNphtjl/1SJlcRnLwkm7+GibfjDrDA==","mode":420,"size":13562},"package.json":{"checkedAt":1794532102970,"integrity":"sha512-jaEa96qmq3TJerNJQKEW0Ex3HBaEiiFXvNQiz/JDjhK5FD0/c0GoCrZtVjH3yTkSSvXNgbYJ8HZp2FqUQN/9bg==","mode":420,"size":2018},"README.md":{"checkedAt":1794532102970,"integrity":"sha512-ZYTP8JNYDFcGMP/7dsvSg9KySMBaB72WI/OeDn82faCpxXx4GDl589vtfmu9hPAF204YrseNCKvoQfQAS2meJQ==","mode":420,"size":2022},"build/index.d.ts":{"checkedAt":1794532102970,"integrity":"sha512-PDSzLydM4Helo5uEtmw4eosw7eAo4ApdNgSvA8NYoUJ0sWvvMl37c2LeMcXIVgzRQuI0zHUGmHlLsZzr/L7x9Q==","mode":420,"size":8622}}}
@@ -0,0 +1,153 @@
/**
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
* @license MIT
*/
/**
* C0 control codes
* See = https://en.wikipedia.org/wiki/C0_and_C1_control_codes
*/
export namespace C0 {
/** Null (Caret = ^@, C = \0) */
export const NUL = '\x00';
/** Start of Heading (Caret = ^A) */
export const SOH = '\x01';
/** Start of Text (Caret = ^B) */
export const STX = '\x02';
/** End of Text (Caret = ^C) */
export const ETX = '\x03';
/** End of Transmission (Caret = ^D) */
export const EOT = '\x04';
/** Enquiry (Caret = ^E) */
export const ENQ = '\x05';
/** Acknowledge (Caret = ^F) */
export const ACK = '\x06';
/** Bell (Caret = ^G, C = \a) */
export const BEL = '\x07';
/** Backspace (Caret = ^H, C = \b) */
export const BS = '\x08';
/** Character Tabulation, Horizontal Tabulation (Caret = ^I, C = \t) */
export const HT = '\x09';
/** Line Feed (Caret = ^J, C = \n) */
export const LF = '\x0a';
/** Line Tabulation, Vertical Tabulation (Caret = ^K, C = \v) */
export const VT = '\x0b';
/** Form Feed (Caret = ^L, C = \f) */
export const FF = '\x0c';
/** Carriage Return (Caret = ^M, C = \r) */
export const CR = '\x0d';
/** Shift Out (Caret = ^N) */
export const SO = '\x0e';
/** Shift In (Caret = ^O) */
export const SI = '\x0f';
/** Data Link Escape (Caret = ^P) */
export const DLE = '\x10';
/** Device Control One (XON) (Caret = ^Q) */
export const DC1 = '\x11';
/** Device Control Two (Caret = ^R) */
export const DC2 = '\x12';
/** Device Control Three (XOFF) (Caret = ^S) */
export const DC3 = '\x13';
/** Device Control Four (Caret = ^T) */
export const DC4 = '\x14';
/** Negative Acknowledge (Caret = ^U) */
export const NAK = '\x15';
/** Synchronous Idle (Caret = ^V) */
export const SYN = '\x16';
/** End of Transmission Block (Caret = ^W) */
export const ETB = '\x17';
/** Cancel (Caret = ^X) */
export const CAN = '\x18';
/** End of Medium (Caret = ^Y) */
export const EM = '\x19';
/** Substitute (Caret = ^Z) */
export const SUB = '\x1a';
/** Escape (Caret = ^[, C = \e) */
export const ESC = '\x1b';
/** File Separator (Caret = ^\) */
export const FS = '\x1c';
/** Group Separator (Caret = ^]) */
export const GS = '\x1d';
/** Record Separator (Caret = ^^) */
export const RS = '\x1e';
/** Unit Separator (Caret = ^_) */
export const US = '\x1f';
/** Space */
export const SP = '\x20';
/** Delete (Caret = ^?) */
export const DEL = '\x7f';
}
/**
* C1 control codes
* See = https://en.wikipedia.org/wiki/C0_and_C1_control_codes
*/
export namespace C1 {
/** padding character */
export const PAD = '\x80';
/** High Octet Preset */
export const HOP = '\x81';
/** Break Permitted Here */
export const BPH = '\x82';
/** No Break Here */
export const NBH = '\x83';
/** Index */
export const IND = '\x84';
/** Next Line */
export const NEL = '\x85';
/** Start of Selected Area */
export const SSA = '\x86';
/** End of Selected Area */
export const ESA = '\x87';
/** Horizontal Tabulation Set */
export const HTS = '\x88';
/** Horizontal Tabulation With Justification */
export const HTJ = '\x89';
/** Vertical Tabulation Set */
export const VTS = '\x8a';
/** Partial Line Down */
export const PLD = '\x8b';
/** Partial Line Up */
export const PLU = '\x8c';
/** Reverse Index */
export const RI = '\x8d';
/** Single-Shift 2 */
export const SS2 = '\x8e';
/** Single-Shift 3 */
export const SS3 = '\x8f';
/** Device Control String */
export const DCS = '\x90';
/** Private Use 1 */
export const PU1 = '\x91';
/** Private Use 2 */
export const PU2 = '\x92';
/** Set Transmit State */
export const STS = '\x93';
/** Destructive backspace, intended to eliminate ambiguity about meaning of BS. */
export const CCH = '\x94';
/** Message Waiting */
export const MW = '\x95';
/** Start of Protected Area */
export const SPA = '\x96';
/** End of Protected Area */
export const EPA = '\x97';
/** Start of String */
export const SOS = '\x98';
/** Single Graphic Character Introducer */
export const SGCI = '\x99';
/** Single Character Introducer */
export const SCI = '\x9a';
/** Control Sequence Introducer */
export const CSI = '\x9b';
/** String Terminator */
export const ST = '\x9c';
/** Operating System Command */
export const OSC = '\x9d';
/** Privacy Message */
export const PM = '\x9e';
/** Application Program Command */
export const APC = '\x9f';
}
export namespace C1_ESCAPED {
export const ST = `${C0.ESC}\\`;
}
@@ -0,0 +1,3 @@
declare const _exports: import('eslint').Rule.RuleModule;
export = _exports;
//# sourceMappingURL=jsx-child-element-spacing.d.ts.map
@@ -0,0 +1,37 @@
function resolveEnd(end, offset, reqSpace, onError) {
let comment = '';
if (end) {
let hasSpace = false;
let sep = '';
for (const token of end) {
const { source, type } = token;
switch (type) {
case 'space':
hasSpace = true;
break;
case 'comment': {
if (reqSpace && !hasSpace)
onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters');
const cb = source.substring(1) || ' ';
if (!comment)
comment = cb;
else
comment += sep + cb;
sep = '';
break;
}
case 'newline':
if (comment)
sep += source;
hasSpace = true;
break;
default:
onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${type} at node end`);
}
offset += source.length;
}
}
return { comment, offset };
}
export { resolveEnd };
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more