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

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

No files matched your search

@@ -0,0 +1,447 @@
import Decimal from 'decimal.js';
import { S_UNICODE_REGEX } from '../regex.generated';
import { digitMapping } from './digit-mapping.generated';
import { GetUnsignedRoundingMode } from './GetUnsignedRoundingMode';
import { ToRawFixed } from './ToRawFixed';
// This is from: unicode-12.1.0/General_Category/Symbol/regex.js
// IE11 does not support unicode flag, otherwise this is just /\p{S}/u.
// /^\p{S}/u
var CARET_S_UNICODE_REGEX = new RegExp("^".concat(S_UNICODE_REGEX.source));
// /\p{S}$/u
var S_DOLLAR_UNICODE_REGEX = new RegExp("".concat(S_UNICODE_REGEX.source, "$"));
var CLDR_NUMBER_PATTERN = /[#0](?:[\.,][#0]+)*/g;
export default function formatToParts(numberResult, data, pl, options) {
var _a;
var sign = numberResult.sign, exponent = numberResult.exponent, magnitude = numberResult.magnitude;
var notation = options.notation, style = options.style, numberingSystem = options.numberingSystem;
var defaultNumberingSystem = data.numbers.nu[0];
// #region Part 1: partition and interpolate the CLDR number pattern.
// ----------------------------------------------------------
var compactNumberPattern = null;
if (notation === 'compact' && magnitude) {
compactNumberPattern = getCompactDisplayPattern(numberResult, pl, data, style, options.compactDisplay, options.currencyDisplay, numberingSystem);
}
// This is used multiple times
var nonNameCurrencyPart;
if (style === 'currency' && options.currencyDisplay !== 'name') {
var byCurrencyDisplay = data.currencies[options.currency];
if (byCurrencyDisplay) {
switch (options.currencyDisplay) {
case 'code':
nonNameCurrencyPart = options.currency;
break;
case 'symbol':
nonNameCurrencyPart = byCurrencyDisplay.symbol;
break;
default:
nonNameCurrencyPart = byCurrencyDisplay.narrow;
break;
}
}
else {
// Fallback for unknown currency
nonNameCurrencyPart = options.currency;
}
}
var numberPattern;
if (!compactNumberPattern) {
// Note: if the style is unit, or is currency and the currency display is name,
// its unit parts will be interpolated in part 2. So here we can fallback to decimal.
if (style === 'decimal' ||
style === 'unit' ||
(style === 'currency' && options.currencyDisplay === 'name')) {
// Shortcut for decimal
var decimalData = data.numbers.decimal[numberingSystem] ||
data.numbers.decimal[defaultNumberingSystem];
numberPattern = getPatternForSign(decimalData.standard, sign);
}
else if (style === 'currency') {
var currencyData = data.numbers.currency[numberingSystem] ||
data.numbers.currency[defaultNumberingSystem];
// We replace number pattern part with `0` for easier postprocessing.
numberPattern = getPatternForSign(currencyData[options.currencySign], sign);
}
else {
// percent
var percentPattern = data.numbers.percent[numberingSystem] ||
data.numbers.percent[defaultNumberingSystem];
numberPattern = getPatternForSign(percentPattern, sign);
}
}
else {
numberPattern = compactNumberPattern;
}
// Extract the decimal number pattern string. It looks like "#,##0,00", which will later be
// used to infer decimal group sizes.
var decimalNumberPattern = CLDR_NUMBER_PATTERN.exec(numberPattern)[0];
// Now we start to substitute patterns
// 1. replace strings like `0` and `#,##0.00` with `{0}`
// 2. unquote characters (invariant: the quoted characters does not contain the special tokens)
numberPattern = numberPattern
.replace(CLDR_NUMBER_PATTERN, '{0}')
.replace(/'(.)'/g, '$1');
// Handle currency spacing (both compact and non-compact).
if (style === 'currency' && options.currencyDisplay !== 'name') {
var currencyData = data.numbers.currency[numberingSystem] ||
data.numbers.currency[defaultNumberingSystem];
// See `currencySpacing` substitution rule in TR-35.
// Here we always assume the currencyMatch is "[:^S:]" and surroundingMatch is "[:digit:]".
//
// Example 1: for pattern "#,##0.00¤" with symbol "US$", we replace "¤" with the symbol,
// but insert an extra non-break space before the symbol, because "[:^S:]" matches "U" in
// "US$" and "[:digit:]" matches the latn numbering system digits.
//
// Example 2: for pattern "¤#,##0.00" with symbol "US$", there is no spacing between symbol
// and number, because `$` does not match "[:^S:]".
//
// Implementation note: here we do the best effort to infer the insertion.
// We also assume that `beforeInsertBetween` and `afterInsertBetween` will never be `;`.
var afterCurrency = currencyData.currencySpacing.afterInsertBetween;
if (afterCurrency && !S_DOLLAR_UNICODE_REGEX.test(nonNameCurrencyPart)) {
numberPattern = numberPattern.replace('¤{0}', "\u00A4".concat(afterCurrency, "{0}"));
}
var beforeCurrency = currencyData.currencySpacing.beforeInsertBetween;
if (beforeCurrency && !CARET_S_UNICODE_REGEX.test(nonNameCurrencyPart)) {
numberPattern = numberPattern.replace('{0}¤', "{0}".concat(beforeCurrency, "\u00A4"));
}
}
// The following tokens are special: `{0}`, `¤`, `%`, `-`, `+`, `{c:...}.
var numberPatternParts = numberPattern.split(/({c:[^}]+}|\{0\}|[¤%\-\+])/g);
var numberParts = [];
var symbols = data.numbers.symbols[numberingSystem] ||
data.numbers.symbols[defaultNumberingSystem];
for (var _i = 0, numberPatternParts_1 = numberPatternParts; _i < numberPatternParts_1.length; _i++) {
var part = numberPatternParts_1[_i];
if (!part) {
continue;
}
switch (part) {
case '{0}': {
// We only need to handle scientific and engineering notation here.
numberParts.push.apply(numberParts, partitionNumberIntoParts(symbols, numberResult, notation, exponent, numberingSystem,
// If compact number pattern exists, do not insert group separators.
!compactNumberPattern && ((_a = options.useGrouping) !== null && _a !== void 0 ? _a : true), decimalNumberPattern, style, options.roundingIncrement, GetUnsignedRoundingMode(options.roundingMode, sign === -1)));
break;
}
case '-':
numberParts.push({ type: 'minusSign', value: symbols.minusSign });
break;
case '+':
numberParts.push({ type: 'plusSign', value: symbols.plusSign });
break;
case '%':
numberParts.push({ type: 'percentSign', value: symbols.percentSign });
break;
case '¤':
// Computed above when handling currency spacing.
numberParts.push({ type: 'currency', value: nonNameCurrencyPart });
break;
default:
if (/^\{c:/.test(part)) {
numberParts.push({
type: 'compact',
value: part.substring(3, part.length - 1),
});
}
else {
// literal
numberParts.push({ type: 'literal', value: part });
}
break;
}
}
// #endregion
// #region Part 2: interpolate unit pattern if necessary.
// ----------------------------------------------
switch (style) {
case 'currency': {
// `currencyDisplay: 'name'` has similar pattern handling as units.
if (options.currencyDisplay === 'name') {
var unitPattern = (data.numbers.currency[numberingSystem] ||
data.numbers.currency[defaultNumberingSystem]).unitPattern;
// Select plural
var unitName = void 0;
var currencyNameData = data.currencies[options.currency];
if (currencyNameData) {
unitName = selectPlural(pl, numberResult.roundedNumber
.times(Decimal.pow(10, exponent))
.toNumber(), currencyNameData.displayName);
}
else {
// Fallback for unknown currency
unitName = options.currency;
}
// Do {0} and {1} substitution
var unitPatternParts = unitPattern.split(/(\{[01]\})/g);
var result = [];
for (var _b = 0, unitPatternParts_1 = unitPatternParts; _b < unitPatternParts_1.length; _b++) {
var part = unitPatternParts_1[_b];
switch (part) {
case '{0}':
result.push.apply(result, numberParts);
break;
case '{1}':
result.push({ type: 'currency', value: unitName });
break;
default:
if (part) {
result.push({ type: 'literal', value: part });
}
break;
}
}
return result;
}
else {
return numberParts;
}
}
case 'unit': {
var unit = options.unit, unitDisplay = options.unitDisplay;
var unitData = data.units.simple[unit];
var unitPattern = void 0;
if (unitData) {
// Simple unit pattern
unitPattern = selectPlural(pl, numberResult.roundedNumber
.times(Decimal.pow(10, exponent))
.toNumber(), data.units.simple[unit][unitDisplay]);
}
else {
// See: http://unicode.org/reports/tr35/tr35-general.html#perUnitPatterns
// If cannot find unit in the simple pattern, it must be "per" compound pattern.
// Implementation note: we are not following TR-35 here because we need to format to parts!
var _c = unit.split('-per-'), numeratorUnit = _c[0], denominatorUnit = _c[1];
unitData = data.units.simple[numeratorUnit];
var numeratorUnitPattern = selectPlural(pl, numberResult.roundedNumber
.times(Decimal.pow(10, exponent))
.toNumber(), data.units.simple[numeratorUnit][unitDisplay]);
var perUnitPattern = data.units.simple[denominatorUnit].perUnit[unitDisplay];
if (perUnitPattern) {
// perUnitPattern exists, combine it with numeratorUnitPattern
unitPattern = perUnitPattern.replace('{0}', numeratorUnitPattern);
}
else {
// get compoundUnit pattern (e.g. "{0} per {1}"), repalce {0} with numerator pattern and {1} with
// the denominator pattern in singular form.
var perPattern = data.units.compound.per[unitDisplay];
var denominatorPattern = selectPlural(pl, 1, data.units.simple[denominatorUnit][unitDisplay]);
unitPattern = unitPattern = perPattern
.replace('{0}', numeratorUnitPattern)
.replace('{1}', denominatorPattern.replace('{0}', ''));
}
}
var result = [];
// We need spacing around "{0}" because they are not treated as "unit" parts, but "literal".
for (var _d = 0, _e = unitPattern.split(/(\s*\{0\}\s*)/); _d < _e.length; _d++) {
var part = _e[_d];
var interpolateMatch = /^(\s*)\{0\}(\s*)$/.exec(part);
if (interpolateMatch) {
// Space before "{0}"
if (interpolateMatch[1]) {
result.push({ type: 'literal', value: interpolateMatch[1] });
}
// "{0}" itself
result.push.apply(result, numberParts);
// Space after "{0}"
if (interpolateMatch[2]) {
result.push({ type: 'literal', value: interpolateMatch[2] });
}
}
else if (part) {
result.push({ type: 'unit', value: part });
}
}
return result;
}
default:
return numberParts;
}
// #endregion
}
// A subset of https://tc39.es/ecma402/#sec-partitionnotationsubpattern
// Plus the exponent parts handling.
function partitionNumberIntoParts(symbols, numberResult, notation, exponent, numberingSystem, useGrouping,
/**
* This is the decimal number pattern without signs or symbols.
* It is used to infer the group size when `useGrouping` is true.
*
* A typical value looks like "#,##0.00" (primary group size is 3).
* Some locales like Hindi has secondary group size of 2 (e.g. "#,##,##0.00").
*/
decimalNumberPattern, style, roundingIncrement, unsignedRoundingMode) {
var result = [];
// eslint-disable-next-line prefer-const
var n = numberResult.formattedString, x = numberResult.roundedNumber;
if (x.isNaN()) {
return [{ type: 'nan', value: n }];
}
else if (!x.isFinite()) {
return [{ type: 'infinity', value: n }];
}
var digitReplacementTable = digitMapping[numberingSystem];
if (digitReplacementTable) {
n = n.replace(/\d/g, function (digit) { return digitReplacementTable[+digit] || digit; });
}
// TODO: Else use an implementation dependent algorithm to map n to the appropriate
// representation of n in the given numbering system.
var decimalSepIndex = n.indexOf('.');
var integer;
var fraction;
if (decimalSepIndex > 0) {
integer = n.slice(0, decimalSepIndex);
fraction = n.slice(decimalSepIndex + 1);
}
else {
integer = n;
}
// #region Grouping integer digits
// The weird compact and x >= 10000 check is to ensure consistency with Node.js and Chrome.
// Note that `de` does not have compact form for thousands, but Node.js does not insert grouping separator
// unless the rounded number is greater than 10000:
// NumberFormat('de', {notation: 'compact', compactDisplay: 'short'}).format(1234) //=> "1234"
// NumberFormat('de').format(1234) //=> "1.234"
var shouldUseGrouping = false;
if (useGrouping === 'always') {
shouldUseGrouping = true;
}
else if (useGrouping === 'min2') {
shouldUseGrouping = x.greaterThanOrEqualTo(10000);
}
else if (useGrouping === 'auto' || useGrouping) {
shouldUseGrouping = notation !== 'compact' || x.greaterThanOrEqualTo(10000);
}
if (shouldUseGrouping) {
// a. Let groupSepSymbol be the implementation-, locale-, and numbering system-dependent (ILND) String representing the grouping separator.
// For currency we should use `currencyGroup` instead of generic `group`
var groupSepSymbol = style === 'currency' && symbols.currencyGroup != null
? symbols.currencyGroup
: symbols.group;
var groups = [];
// > There may be two different grouping sizes: The primary grouping size used for the least
// > significant integer group, and the secondary grouping size used for more significant groups.
// > If a pattern contains multiple grouping separators, the interval between the last one and the
// > end of the integer defines the primary grouping size, and the interval between the last two
// > defines the secondary grouping size. All others are ignored.
var integerNumberPattern = decimalNumberPattern.split('.')[0];
var patternGroups = integerNumberPattern.split(',');
var primaryGroupingSize = 3;
var secondaryGroupingSize = 3;
if (patternGroups.length > 1) {
primaryGroupingSize = patternGroups[patternGroups.length - 1].length;
}
if (patternGroups.length > 2) {
secondaryGroupingSize = patternGroups[patternGroups.length - 2].length;
}
var i = integer.length - primaryGroupingSize;
if (i > 0) {
// Slice the least significant integer group
groups.push(integer.slice(i, i + primaryGroupingSize));
// Then iteratively push the more signicant groups
// TODO: handle surrogate pairs in some numbering system digits
for (i -= secondaryGroupingSize; i > 0; i -= secondaryGroupingSize) {
groups.push(integer.slice(i, i + secondaryGroupingSize));
}
groups.push(integer.slice(0, i + secondaryGroupingSize));
}
else {
groups.push(integer);
}
while (groups.length > 0) {
var integerGroup = groups.pop();
result.push({ type: 'integer', value: integerGroup });
if (groups.length > 0) {
result.push({ type: 'group', value: groupSepSymbol });
}
}
}
else {
result.push({ type: 'integer', value: integer });
}
// #endregion
if (fraction !== undefined) {
var decimalSepSymbol = style === 'currency' && symbols.currencyDecimal != null
? symbols.currencyDecimal
: symbols.decimal;
result.push({ type: 'decimal', value: decimalSepSymbol }, { type: 'fraction', value: fraction });
}
if ((notation === 'scientific' || notation === 'engineering') &&
x.isFinite()) {
result.push({ type: 'exponentSeparator', value: symbols.exponential });
if (exponent < 0) {
result.push({ type: 'exponentMinusSign', value: symbols.minusSign });
exponent = -exponent;
}
var exponentResult = ToRawFixed(new Decimal(exponent), 0, 0, roundingIncrement, unsignedRoundingMode);
result.push({
type: 'exponentInteger',
value: exponentResult.formattedString,
});
}
return result;
}
function getPatternForSign(pattern, sign) {
if (pattern.indexOf(';') < 0) {
pattern = "".concat(pattern, ";-").concat(pattern);
}
var _a = pattern.split(';'), zeroPattern = _a[0], negativePattern = _a[1];
switch (sign) {
case 0:
return zeroPattern;
case -1:
return negativePattern;
default:
return negativePattern.indexOf('-') >= 0
? negativePattern.replace(/-/g, '+')
: "+".concat(zeroPattern);
}
}
// Find the CLDR pattern for compact notation based on the magnitude of data and style.
//
// Example return value: "¤ {c:laki}000;¤{c:laki} -0" (`sw` locale):
// - Notice the `{c:...}` token that wraps the compact literal.
// - The consecutive zeros are normalized to single zero to match CLDR_NUMBER_PATTERN.
//
// Returning null means the compact display pattern cannot be found.
function getCompactDisplayPattern(numberResult, pl, data, style, compactDisplay, currencyDisplay, numberingSystem) {
var _a;
var roundedNumber = numberResult.roundedNumber, sign = numberResult.sign, magnitude = numberResult.magnitude;
var magnitudeKey = String(Math.pow(10, magnitude));
var defaultNumberingSystem = data.numbers.nu[0];
var pattern;
if (style === 'currency' && currencyDisplay !== 'name') {
var byNumberingSystem = data.numbers.currency;
var currencyData = byNumberingSystem[numberingSystem] ||
byNumberingSystem[defaultNumberingSystem];
// NOTE: compact notation ignores currencySign!
var compactPluralRules = (_a = currencyData.short) === null || _a === void 0 ? void 0 : _a[magnitudeKey];
if (!compactPluralRules) {
return null;
}
pattern = selectPlural(pl, roundedNumber.toNumber(), compactPluralRules);
}
else {
var byNumberingSystem = data.numbers.decimal;
var byCompactDisplay = byNumberingSystem[numberingSystem] ||
byNumberingSystem[defaultNumberingSystem];
var compactPlaralRule = byCompactDisplay[compactDisplay][magnitudeKey];
if (!compactPlaralRule) {
return null;
}
pattern = selectPlural(pl, roundedNumber.toNumber(), compactPlaralRule);
}
// See https://unicode.org/reports/tr35/tr35-numbers.html#Compact_Number_Formats
// > If the value is precisely “0”, either explicit or defaulted, then the normal number format
// > pattern for that sort of object is supplied.
if (pattern === '0') {
return null;
}
pattern = getPatternForSign(pattern, sign)
// Extract compact literal from the pattern
.replace(/([^\s;\-\+\d¤]+)/g, '{c:$1}')
// We replace one or more zeros with a single zero so it matches `CLDR_NUMBER_PATTERN`.
.replace(/0+/, '0');
return pattern;
}
function selectPlural(pl, x, rules) {
return rules[pl.select(x)] || rules.other;
}
@@ -0,0 +1,22 @@
var $9da8e3f192aba981$exports = require("./useFormValidation.main.js");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useFormValidation", () => $9da8e3f192aba981$exports.useFormValidation);
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
//# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
{"version":3,"file":"no-array-index-key.d.ts","sourceRoot":"","sources":["no-array-index-key.js"],"names":[],"mappings":"wBA2CW,OAAO,QAAQ,EAAE,IAAI,CAAC,UAAU"}
@@ -0,0 +1,110 @@
import flat from 'array.prototype.flat';
import values from 'object.values';
/**
* Common event handlers for JSX element event binding.
*/
const eventHandlersByType = {
clipboard: [
'onCopy',
'onCut',
'onPaste',
],
composition: [
'onCompositionEnd',
'onCompositionStart',
'onCompositionUpdate',
],
keyboard: [
'onKeyDown',
'onKeyPress',
'onKeyUp',
],
focus: [
'onFocus',
'onBlur',
],
form: [
'onChange',
'onInput',
'onSubmit',
],
mouse: [
'onClick',
'onContextMenu',
'onDblClick',
'onDoubleClick',
'onDrag',
'onDragEnd',
'onDragEnter',
'onDragExit',
'onDragLeave',
'onDragOver',
'onDragStart',
'onDrop',
'onMouseDown',
'onMouseEnter',
'onMouseLeave',
'onMouseMove',
'onMouseOut',
'onMouseOver',
'onMouseUp',
],
selection: [
'onSelect',
],
touch: [
'onTouchCancel',
'onTouchEnd',
'onTouchMove',
'onTouchStart',
],
ui: [
'onScroll',
],
wheel: [
'onWheel',
],
media: [
'onAbort',
'onCanPlay',
'onCanPlayThrough',
'onDurationChange',
'onEmptied',
'onEncrypted',
'onEnded',
'onError',
'onLoadedData',
'onLoadedMetadata',
'onLoadStart',
'onPause',
'onPlay',
'onPlaying',
'onProgress',
'onRateChange',
'onSeeked',
'onSeeking',
'onStalled',
'onSuspend',
'onTimeUpdate',
'onVolumeChange',
'onWaiting',
],
image: [
'onLoad',
'onError',
],
animation: [
'onAnimationStart',
'onAnimationEnd',
'onAnimationIteration',
],
transition: [
'onTransitionEnd',
],
};
export default flat(values(eventHandlersByType));
export { eventHandlersByType };
@@ -0,0 +1 @@
var Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7Line truncated
@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var docEpilogueRole = {
abstract: false,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author'],
prohibitedProps: [],
props: {
'aria-disabled': null,
'aria-errormessage': null,
'aria-expanded': null,
'aria-haspopup': null,
'aria-invalid': null
},
relatedConcepts: [{
concept: {
name: 'epilogue [EPUB-SSV]'
},
module: 'EPUB'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'structure', 'section', 'landmark']]
};
var _default = exports.default = docEpilogueRole;
@@ -0,0 +1,14 @@
var Attributes_1;
import { __decorate } from "tslib";
import { AsnArray, AsnType, AsnTypeTypes } from "@peculiar/asn1-schema";
import { Attribute } from "@peculiar/asn1-x509";
let Attributes = Attributes_1 = class Attributes extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, Attributes_1.prototype);
}
};
Attributes = Attributes_1 = __decorate([
AsnType({ type: AsnTypeTypes.Sequence, itemType: Attribute })
], Attributes);
export { Attributes };
@@ -0,0 +1,118 @@
var minus = '-'.charCodeAt(0)
var plus = '+'.charCodeAt(0)
var dot = '.'.charCodeAt(0)
var exp = 'e'.charCodeAt(0)
var EXP = 'E'.charCodeAt(0)
// Check if three code points would start a number
// https://www.w3.org/TR/css-syntax-3/#starts-with-a-number
function likeNumber(value) {
var code = value.charCodeAt(0)
var nextCode
if (code === plus || code === minus) {
nextCode = value.charCodeAt(1)
if (nextCode >= 48 && nextCode <= 57) {
return true
}
var nextNextCode = value.charCodeAt(2)
if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {
return true
}
return false
}
if (code === dot) {
nextCode = value.charCodeAt(1)
if (nextCode >= 48 && nextCode <= 57) {
return true
}
return false
}
if (code >= 48 && code <= 57) {
return true
}
return false
}
// Consume a number
// https://www.w3.org/TR/css-syntax-3/#consume-number
module.exports = function (value) {
var pos = 0
var length = value.length
var code
var nextCode
var nextNextCode
if (length === 0 || !likeNumber(value)) {
return false
}
code = value.charCodeAt(pos)
if (code === plus || code === minus) {
pos++
}
while (pos < length) {
code = value.charCodeAt(pos)
if (code < 48 || code > 57) {
break
}
pos += 1
}
code = value.charCodeAt(pos)
nextCode = value.charCodeAt(pos + 1)
if (code === dot && nextCode >= 48 && nextCode <= 57) {
pos += 2
while (pos < length) {
code = value.charCodeAt(pos)
if (code < 48 || code > 57) {
break
}
pos += 1
}
}
code = value.charCodeAt(pos)
nextCode = value.charCodeAt(pos + 1)
nextNextCode = value.charCodeAt(pos + 2)
if (
(code === exp || code === EXP) &&
((nextCode >= 48 && nextCode <= 57) ||
((nextCode === plus || nextCode === minus) && nextNextCode >= 48 && nextNextCode <= 57))
) {
pos += nextCode === plus || nextCode === minus ? 3 : 2
while (pos < length) {
code = value.charCodeAt(pos)
if (code < 48 || code > 57) {
break
}
pos += 1
}
}
return {
number: value.slice(0, pos),
unit: value.slice(pos),
}
}
@@ -0,0 +1,63 @@
'use strict';
var once = require('once');
var helpers = require('./helpers');
function mapSeries(values, iterator, extensions, done) {
// Allow for extensions to not be specified
if (typeof extensions === 'function') {
done = extensions;
extensions = {};
}
// Handle no callback case
if (typeof done !== 'function') {
done = helpers.noop;
}
done = once(done);
// Will throw if non-object
var keys = Object.keys(values);
var length = keys.length;
var idx = 0;
// Return the same type as passed in
var results = helpers.initializeResults(values);
var exts = helpers.defaultExtensions(extensions);
if (length === 0) {
return done(null, results);
}
var key = keys[idx];
next(key);
function next(key) {
var value = values[key];
var storage = exts.create(value, key) || {};
exts.before(storage);
iterator(value, key, once(handler));
function handler(err, result) {
if (err) {
exts.error(err, storage);
return done(err, results);
}
exts.after(result, storage);
results[key] = result;
if (++idx >= length) {
done(err, results);
} else {
next(keys[idx]);
}
}
}
}
module.exports = mapSeries;
@@ -0,0 +1,219 @@
# micromark-util-chunked
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]
[micromark][] utility to splice and push with giant arrays.
## Contents
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`push(list, items)`](#pushlist-items)
* [`splice(list, start, remove, items)`](#splicelist-start-remove-items)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This package exposes an algorithm to splice for giant arrays, which V8 bugs
out on.
## When should I use this?
This package might be useful when you are making your own micromark extensions.
## Install
This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:
```sh
npm install micromark-util-chunked
```
In Deno with [`esm.sh`][esmsh]:
```js
import {push, splice} from 'https://esm.sh/micromark-util-chunked@1'
```
In browsers with [`esm.sh`][esmsh]:
```html
<script type="module">
import {push, splice} from 'https://esm.sh/micromark-util-chunked@1?bundle'
</script>
```
## Use
```js
import {push, splice} from 'micromark-util-chunked'
// …
nextEvents = push(nextEvents, [
['enter', events[open][1], context],
['exit', events[open][1], context]
])
// …
splice(events, open - 1, index - open + 3, nextEvents)
// …
```
## API
This module exports the identifiers [`push`][api-push]
and [`splice`][api-splice].
There is no default export.
### `push(list, items)`
Append `items` (an array) at the end of `list` (another array).
When `list` was empty, returns `items` instead.
This prevents a potentially expensive operation when `list` is empty,
and adds items in batches to prevent V8 from hanging.
###### Parameters
* `list` (`Array<unknown>`)
— list to operate on
* `items` (`Array<unknown>`)
— items to add to `list`
###### Returns
Either `list` or `items` (`Array<unknown>`).
### `splice(list, start, remove, items)`
Like `Array#splice`, but smarter for giant arrays.
`Array#splice` takes all items to be inserted as individual argument which
causes a stack overflow in V8 when trying to insert 100k items for instance.
Otherwise, this does not return the removed items, and takes `items` as an
array instead of rest parameters.
###### Parameters
* `list` (`Array<unknown>`)
— list to operate on
* `start` (`number`)
— index to remove/insert at (can be negative)
* `remove` (`number`)
— number of items to remove
* `items` (`Array<unknown>`)
— items to inject into `list`
###### Returns
Nothing (`undefined`).
## Types
This package is fully typed with [TypeScript][].
It exports no additional types.
## Compatibility
Projects maintained by the unified collective are compatible with maintained
versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-util-chunked@2`, compatible with Node.js 16.
This package works with `micromark@3`.
## Security
This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.
## Contribute
See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.
This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg
[build]: https://github.com/micromark/micromark/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg
[coverage]: https://codecov.io/github/micromark/micromark
[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-chunked.svg
[downloads]: https://www.npmjs.com/package/micromark-util-chunked
[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-chunked
[bundle-size]: https://bundlejs.com/?q=micromark-util-chunked
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
[opencollective]: https://opencollective.com/unified
[npm]: https://docs.npmjs.com/cli/install
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[esmsh]: https://esm.sh
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
[chat]: https://github.com/micromark/micromark/discussions
[license]: https://github.com/micromark/micromark/blob/main/license
[author]: https://wooorm.com
[health]: https://github.com/micromark/.github
[securitymd]: https://github.com/micromark/.github/blob/main/security.md
[contributing]: https://github.com/micromark/.github/blob/main/contributing.md
[support]: https://github.com/micromark/.github/blob/main/support.md
[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
[typescript]: https://www.typescriptlang.org
[micromark]: https://github.com/micromark/micromark
[api-push]: #pushlist-items
[api-splice]: #splicelist-start-remove-items
@@ -0,0 +1 @@
module.exports={C:{"78":0.17121,"82":0.00439,"102":0.01756,"110":0.01317,"115":0.26779,"127":0.00878,"128":0.10097,"131":0.00439,"134":0.00439,"136":0.12292,"137":0.00439,"138":0.00439,"139":0.01756,"140":0.10097,"141":0.00878,"142":0.03512,"143":1.69454,"144":1.87453,"146":0.00439,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 103 104 105 106 107 108 109 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 129 130 132 133 135 145 147 3.5 3.6"},D:{"39":0.00439,"40":0.00439,"41":0.00439,"42":0.00439,"43":0.00439,"44":0.00439,"45":0.00439,"46":0.00439,"47":0.00878,"48":0.00439,"49":0.48729,"50":0.00439,"51":0.00439,"52":0.00439,"53":0.00439,"54":0.00439,"55":0.00439,"56":0.00439,"57":0.00439,"58":0.00439,"60":0.00439,"78":0.06146,"79":0.02195,"85":0.00878,"86":0.00439,"87":0.01756,"88":0.03512,"102":0.00439,"103":0.04829,"104":0.07024,"108":0.09658,"109":0.60582,"110":0.00439,"111":0.00439,"113":0.00439,"116":0.06146,"118":0.00439,"119":0.00439,"120":0.01317,"121":0.00439,"122":0.05707,"123":0.00439,"124":0.01756,"125":2.09403,"126":0.01317,"127":0.0439,"128":0.08341,"129":0.00439,"130":0.01317,"131":0.01317,"132":0.06146,"133":0.02634,"134":0.03073,"135":0.01317,"136":0.01756,"137":0.06585,"138":0.22389,"139":0.59265,"140":5.20215,"141":11.87934,"142":0.16243,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 59 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 80 81 83 84 89 90 91 92 93 94 95 96 97 98 99 100 101 105 106 107 112 114 115 117 143 144 145"},F:{"46":0.00439,"91":0.01317,"92":0.00878,"95":0.00878,"114":0.00439,"120":0.1756,"121":0.21072,"122":1.63308,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 117 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00439,"96":0.00878,"109":0.02634,"114":0.0439,"122":0.00878,"129":0.00439,"130":0.00439,"131":0.02634,"132":0.00439,"133":0.17999,"134":0.03073,"136":0.00439,"137":0.01317,"138":0.01756,"139":0.01756,"140":0.89556,"141":5.42165,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 119 120 121 123 124 125 126 127 128 135 142"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 26.2","12.1":0.00439,"13.1":0.03073,"14.1":0.01317,"15.1":0.00878,"15.2-15.3":0.00439,"15.4":0.00878,"15.5":0.00439,"15.6":0.14487,"16.0":0.00878,"16.1":0.00439,"16.2":0.04829,"16.3":0.02634,"16.4":0.01317,"16.5":0.02195,"16.6":0.1756,"17.0":0.00439,"17.1":0.07463,"17.2":0.01756,"17.3":0.00878,"17.4":0.02634,"17.5":0.01317,"17.6":0.19316,"18.0":0.08341,"18.1":0.02634,"18.2":0.00439,"18.3":0.03951,"18.4":0.02634,"18.5-18.6":0.22389,"26.0":0.58387,"26.1":0.00439},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00148,"5.0-5.1":0,"6.0-6.1":0.00593,"7.0-7.1":0.00445,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01334,"10.0-10.2":0.00148,"10.3":0.02519,"11.0-11.2":0.37343,"11.3-11.4":0.00889,"12.0-12.1":0.00296,"12.2-12.5":0.07261,"13.0-13.1":0,"13.2":0.00741,"13.3":0.00296,"13.4-13.7":0.01185,"14.0-14.4":0.02519,"14.5-14.8":0.02667,"15.0-15.1":0.02519,"15.2-15.3":0.01926,"15.4":0.02223,"15.5":0.02519,"15.6-15.8":0.32897,"16.0":0.04446,"16.1":0.08298,"16.2":0.04297,"16.3":0.07706,"16.4":0.01926,"16.5":0.03408,"16.6-16.7":0.44011,"17.0":0.03112,"17.1":0.04742,"17.2":0.03408,"17.3":0.05038,"17.4":0.08891,"17.5":0.15263,"17.6-17.7":0.38528,"18.0":0.08743,"18.1":0.18079,"18.2":0.0978,"18.3":0.31416,"18.4":0.16152,"18.5-18.6":8.23621,"26.0":1.01804,"26.1":0.03705},P:{"4":0.01034,"21":0.07235,"22":0.01034,"23":0.01034,"24":0.06202,"25":0.07235,"26":0.02067,"27":0.05168,"28":2.27393,"29":0.17571,_:"20 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 16.0 17.0 18.0 19.0","7.2-7.4":0.16538,"14.0":0.01034,"15.0":0.01034},I:{"0":0.05603,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00003},K:{"0":0.16761,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.42083},Q:{_:"14.9"},O:{"0":0.0505},H:{"0":0.04},L:{"0":41.18749}};
@@ -0,0 +1,42 @@
import baseSortedIndexBy from './_baseSortedIndexBy.js';
import identity from './identity.js';
import isSymbol from './isSymbol.js';
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295,
HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
/**
* The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
* performs a binary search of `array` to determine the index at which `value`
* should be inserted into `array` in order to maintain its sort order.
*
* @private
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {boolean} [retHighest] Specify returning the highest qualified index.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
*/
function baseSortedIndex(array, value, retHighest) {
var low = 0,
high = array == null ? low : array.length;
if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
while (low < high) {
var mid = (low + high) >>> 1,
computed = array[mid];
if (computed !== null && !isSymbol(computed) &&
(retHighest ? (computed <= value) : (computed < value))) {
low = mid + 1;
} else {
high = mid;
}
}
return high;
}
return baseSortedIndexBy(array, value, identity, retHighest);
}
export default baseSortedIndex;
@@ -0,0 +1,71 @@
let crypto = require('crypto')
let { urlAlphabet } = require('../url-alphabet/index.cjs')
// `crypto.randomFill()` is a little faster than `crypto.randomBytes()`,
// because it is possible to use in combination with `Buffer.allocUnsafe()`.
let random = bytes =>
new Promise((resolve, reject) => {
// `Buffer.allocUnsafe()` is faster because it doesn’t flush the memory.
// Memory flushing is unnecessary since the buffer allocation itself resets
// the memory with the new bytes.
crypto.randomFill(Buffer.allocUnsafe(bytes), (err, buf) => {
if (err) {
reject(err)
} else {
resolve(buf)
}
})
})
let customAlphabet = (alphabet, defaultSize = 21) => {
// First, a bitmask is necessary to generate the ID. The bitmask makes bytes
// values closer to the alphabet size. The bitmask calculates the closest
// `2^31 - 1` number, which exceeds the alphabet size.
// For example, the bitmask for the alphabet size 30 is 31 (00011111).
let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1
// Though, the bitmask solution is not perfect since the bytes exceeding
// the alphabet size are refused. Therefore, to reliably generate the ID,
// the random bytes redundancy has to be satisfied.
// Note: every hardware random generator call is performance expensive,
// because the system call for entropy collection takes a lot of time.
// So, to avoid additional system calls, extra bytes are requested in advance.
// Next, a step determines how many random bytes to generate.
// The number of random bytes gets decided upon the ID size, mask,
// alphabet size, and magic number 1.6 (using 1.6 peaks at performance
// according to benchmarks).
let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)
let tick = (id, size = defaultSize) =>
random(step).then(bytes => {
// A compact alternative for `for (var i = 0; i < step; i++)`.
let i = step
while (i--) {
// Adding `|| ''` refuses a random byte that exceeds the alphabet size.
id += alphabet[bytes[i] & mask] || ''
if (id.length >= size) return id
}
return tick(id, size)
})
return size => tick('', size)
}
let nanoid = (size = 21) =>
random((size |= 0)).then(bytes => {
let id = ''
// A compact alternative for `for (var i = 0; i < step; i++)`.
while (size--) {
// It is incorrect to use bytes exceeding the alphabet size.
// The following mask reduces the random byte in the 0-255 value
// range to the 0-63 value range. Therefore, adding hacks, such
// as empty string fallback or magic numbers, is unneccessary because
// the bitmask trims bytes down to the alphabet size.
id += urlAlphabet[bytes[size] & 63]
}
return id
})
module.exports = { nanoid, customAlphabet, random }
@@ -0,0 +1,93 @@
{
"name": "available-typed-arrays",
"version": "1.0.7",
"description": "Returns an array of Typed Array names that are available in the current environment",
"main": "index.js",
"type": "commonjs",
"exports": {
".": "./index.js",
"./package.json": "./package.json"
},
"types": "./index.d.ts",
"sideEffects": false,
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"prelint": "evalmd README.md",
"lint": "eslint --ext=js,mjs .",
"postlint": "tsc -p .",
"pretest": "npm run lint",
"tests-only": "nyc tape 'test/**/*.js'",
"test:harmony": "nyc node --harmony --es-staging test",
"test": "npm run tests-only && npm run test:harmony",
"posttest": "aud --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/inspect-js/available-typed-arrays.git"
},
"keywords": [
"typed",
"arrays",
"Float32Array",
"Float64Array",
"Int8Array",
"Int16Array",
"Int32Array",
"Uint8Array",
"Uint8ClampedArray",
"Uint16Array",
"Uint32Array",
"BigInt64Array",
"BigUint64Array"
],
"author": "Jordan Harband <ljharb@gmail.com>",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/inspect-js/available-typed-arrays/issues"
},
"homepage": "https://github.com/inspect-js/available-typed-arrays#readme",
"engines": {
"node": ">= 0.4"
},
"devDependencies": {
"@ljharb/eslint-config": "^21.1.0",
"@types/array.prototype.every": "^1.1.1",
"@types/isarray": "^2.0.2",
"@types/tape": "^5.6.4",
"array.prototype.every": "^1.1.5",
"aud": "^2.0.4",
"auto-changelog": "^2.4.0",
"eslint": "=8.8.0",
"evalmd": "^0.0.19",
"in-publish": "^2.0.1",
"isarray": "^2.0.5",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"tape": "^5.7.4",
"typescript": "^5.4.0-dev.20240131"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows"
]
},
"dependencies": {
"possible-typed-array-names": "^1.0.0"
}
}
@@ -0,0 +1,5 @@
# react-refresh
This package implements the wiring necessary to integrate Fast Refresh into bundlers. Fast Refresh is a feature that lets you edit React components in a running application without losing their state. It is similar to an old feature known as "hot reloading", but Fast Refresh is more reliable and officially supported by React.
This package is primarily aimed at developers of bundler plugins. If you’re working on one, here is a [rough guide](https://github.com/facebook/react/issues/16604#issuecomment-528663101) for Fast Refresh integration using this package.
@@ -0,0 +1,40 @@
import { LocaleData } from './core';
import { LDMLPluralRule } from './plural-rules';
export interface FieldData {
'0'?: string;
'1'?: string;
'-1'?: string;
'2'?: string;
'-2'?: string;
'3'?: string;
'-3'?: string;
future: RelativeTimeData;
past: RelativeTimeData;
}
type RelativeTimeData = {
[u in LDMLPluralRule]?: string;
};
export type UnpackedLocaleFieldsData = {
[f in RelativeTimeField]?: FieldData;
} & {
nu: Array<string | null>;
};
export type LocaleFieldsData = {
[f in RelativeTimeField]?: FieldData;
} & {
nu?: Array<string | null>;
};
export type RelativeTimeField = 'second' | 'second-short' | 'second-narrow' | 'minute' | 'minute-short' | 'minute-narrow' | 'hour' | 'hour-short' | 'hour-narrow' | 'day' | 'day-short' | 'day-narrow' | 'week' | 'week-short' | 'week-narrow' | 'month' | 'month-short' | 'month-narrow' | 'quarter' | 'quarter-short' | 'quarter-narrow' | 'year' | 'year-short' | 'year-narrow';
export type RelativeTimeFormatSingularUnit = Exclude<Intl.RelativeTimeFormatUnit, 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years'>;
export type RelativeTimeLocaleData = LocaleData<LocaleFieldsData>;
export interface RelativeTimeFormatInternal {
numberFormat: Intl.NumberFormat;
pluralRules: Intl.PluralRules;
locale: string;
fields: LocaleFieldsData;
style: Intl.ResolvedRelativeTimeFormatOptions['style'];
numeric: Intl.ResolvedRelativeTimeFormatOptions['numeric'];
numberingSystem: string;
initializedRelativeTimeFormat: boolean;
}
export {};
@@ -0,0 +1,152 @@
'use strict'
const { describe, it } = require('mocha')
const assert = require('assert')
const path = require('path')
const fs = require('graceful-fs')
const childProcess = require('child_process')
const os = require('os')
const addonPath = path.resolve(__dirname, 'node_modules', 'hello_world')
const nodeGyp = path.resolve(__dirname, '..', 'bin', 'node-gyp.js')
const execFileSync = childProcess.execFileSync || require('./process-exec-sync')
const execFile = childProcess.execFile
function runHello (hostProcess) {
if (!hostProcess) {
hostProcess = process.execPath
}
var testCode = "console.log(require('hello_world').hello())"
return execFileSync(hostProcess, ['-e', testCode], { cwd: __dirname }).toString()
}
function getEncoding () {
var code = 'import locale;print(locale.getdefaultlocale()[1])'
return execFileSync('python', ['-c', code]).toString().trim()
}
function checkCharmapValid () {
var data
try {
data = execFileSync('python', ['fixtures/test-charmap.py'],
{ cwd: __dirname })
} catch (err) {
return false
}
var lines = data.toString().trim().split('\n')
return lines.pop() === 'True'
}
describe('addon', function () {
this.timeout(300000)
it('build simple addon', function (done) {
// Set the loglevel otherwise the output disappears when run via 'npm test'
var cmd = [nodeGyp, 'rebuild', '-C', addonPath, '--loglevel=verbose']
var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) {
var logLines = stderr.toString().trim().split(/\r?\n/)
var lastLine = logLines[logLines.length - 1]
assert.strictEqual(err, null)
assert.strictEqual(lastLine, 'gyp info ok', 'should end in ok')
assert.strictEqual(runHello().trim(), 'world')
done()
})
proc.stdout.setEncoding('utf-8')
proc.stderr.setEncoding('utf-8')
})
it('build simple addon in path with non-ascii characters', function (done) {
if (!checkCharmapValid()) {
return this.skip('python console app can\'t encode non-ascii character.')
}
var testDirNames = {
cp936: '文件夹',
cp1252: 'Latīna',
cp932: 'フォルダ'
}
// Select non-ascii characters by current encoding
var testDirName = testDirNames[getEncoding()]
// If encoding is UTF-8 or other then no need to test
if (!testDirName) {
return this.skip('no need to test')
}
this.timeout(300000)
var data
var configPath = path.join(addonPath, 'build', 'config.gypi')
try {
data = fs.readFileSync(configPath, 'utf8')
} catch (err) {
assert.fail(err)
return
}
var config = JSON.parse(data.replace(/#.+\n/, ''))
var nodeDir = config.variables.nodedir
var testNodeDir = path.join(addonPath, testDirName)
// Create symbol link to path with non-ascii characters
try {
fs.symlinkSync(nodeDir, testNodeDir, 'dir')
} catch (err) {
switch (err.code) {
case 'EEXIST': break
case 'EPERM':
assert.fail(err, null, 'Please try to running console as an administrator')
return
default:
assert.fail(err)
return
}
}
var cmd = [
nodeGyp,
'rebuild',
'-C',
addonPath,
'--loglevel=verbose',
'-nodedir=' + testNodeDir
]
var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) {
try {
fs.unlink(testNodeDir)
} catch (err) {
assert.fail(err)
}
var logLines = stderr.toString().trim().split(/\r?\n/)
var lastLine = logLines[logLines.length - 1]
assert.strictEqual(err, null)
assert.strictEqual(lastLine, 'gyp info ok', 'should end in ok')
assert.strictEqual(runHello().trim(), 'world')
done()
})
proc.stdout.setEncoding('utf-8')
proc.stderr.setEncoding('utf-8')
})
it('addon works with renamed host executable', function (done) {
// No `fs.copyFileSync` before node8.
if (process.version.substr(1).split('.')[0] < 8) {
return this.skip('skipping test for old node version')
}
this.timeout(300000)
var notNodePath = path.join(os.tmpdir(), 'notnode' + path.extname(process.execPath))
fs.copyFileSync(process.execPath, notNodePath)
var cmd = [nodeGyp, 'rebuild', '-C', addonPath, '--loglevel=verbose']
var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) {
var logLines = stderr.toString().trim().split(/\r?\n/)
var lastLine = logLines[logLines.length - 1]
assert.strictEqual(err, null)
assert.strictEqual(lastLine, 'gyp info ok', 'should end in ok')
assert.strictEqual(runHello(notNodePath).trim(), 'world')
fs.unlinkSync(notNodePath)
done()
})
proc.stdout.setEncoding('utf-8')
proc.stderr.setEncoding('utf-8')
})
})
@@ -0,0 +1,172 @@
import { LazyServiceIdentifier, ServiceIdentifier, Newable } from '@inversifyjs/common';
import { MetadataName, MetadataTag, BindingConstraints, BindingActivation, BindingDeactivation, DynamicValueBuilder, Factory, ResolutionContext, Provider, GetOptionsTagConstraint, OptionalGetOptions, GetOptions, GetAllOptions, BindingScope } from '@inversifyjs/core';
interface BindingIdentifier {
readonly id: number;
}
type ResolvedValueInjectOptions<T> = LazyServiceIdentifier<T> | ResolvedValueMetadataInjectOptions<T> | ServiceIdentifier<T>;
type ResolvedValueMetadataInjectOptions<T> = [T] extends [
(infer U)[] | undefined
] ? [T] extends [U[]] ? MultipleResolvedValueMetadataInjectOptions<U> : MultipleOptionalResolvedValueMetadataInjectOptions<U> : T extends undefined ? OptionalResolvedValueMetadataInjectOptions<T> : BaseResolvedValueMetadataInjectOptions<T>;
interface BaseResolvedValueMetadataInjectOptions<T> {
name?: MetadataName;
serviceIdentifier: ServiceIdentifier<T> | LazyServiceIdentifier<T>;
tags?: ResolvedValueMetadataInjectTagOptions[];
}
interface BaseMultipleResolvedValueMetadataInjectOptions {
chained?: boolean;
isMultiple: true;
}
interface BaseOptionalResolvedValueMetadataInjectOptions {
optional: true;
}
interface MultipleResolvedValueMetadataInjectOptions<T> extends BaseResolvedValueMetadataInjectOptions<T>, BaseMultipleResolvedValueMetadataInjectOptions {
}
interface MultipleOptionalResolvedValueMetadataInjectOptions<T> extends BaseResolvedValueMetadataInjectOptions<T>, BaseMultipleResolvedValueMetadataInjectOptions, BaseOptionalResolvedValueMetadataInjectOptions {
}
interface OptionalResolvedValueMetadataInjectOptions<T> extends BaseResolvedValueMetadataInjectOptions<T>, BaseOptionalResolvedValueMetadataInjectOptions {
}
interface ResolvedValueMetadataInjectTagOptions {
key: MetadataTag;
value: unknown;
}
type MapToResolvedValueInjectOptions<TArgs extends unknown[]> = {
[K in keyof TArgs]-?: ResolvedValueInjectOptions<TArgs[K]>;
};
interface BoundServiceSyntax {
getIdentifier(): BindingIdentifier;
}
interface BindToFluentSyntax<T> {
to(type: Newable<T>): BindInWhenOnFluentSyntax<T>;
toSelf(): BindInWhenOnFluentSyntax<T>;
toConstantValue(value: T): BindWhenOnFluentSyntax<T>;
toDynamicValue(builder: DynamicValueBuilder<T>): BindInWhenOnFluentSyntax<T>;
toFactory(factory: T extends Factory<unknown, any> ? (context: ResolutionContext) => T | Promise<T> : never): BindWhenOnFluentSyntax<T>;
/**
* @deprecated Use `toFactory()` instead. Providers will be removed in v8.
* Providers exist for historical reasons from v5 when async dependencies weren't supported.
* Factories are more flexible and can handle both sync and async operations.
*/
toProvider(provider: T extends Provider<unknown, any> ? (context: ResolutionContext) => T : never): BindWhenOnFluentSyntax<T>;
toResolvedValue(factory: () => T | Promise<T>): BindInWhenOnFluentSyntax<T>;
toResolvedValue<TArgs extends unknown[] = any[]>(factory: (...args: TArgs) => T | Promise<T>, injectOptions: MapToResolvedValueInjectOptions<TArgs>): BindInWhenOnFluentSyntax<T>;
toService(service: ServiceIdentifier<T>): void;
}
interface BindInFluentSyntax<T> extends BoundServiceSyntax {
inSingletonScope(): BindWhenOnFluentSyntax<T>;
inTransientScope(): BindWhenOnFluentSyntax<T>;
inRequestScope(): BindWhenOnFluentSyntax<T>;
}
interface BindInWhenOnFluentSyntax<T> extends BindInFluentSyntax<T>, BindWhenOnFluentSyntax<T> {
}
interface BindOnFluentSyntax<T> extends BoundServiceSyntax {
onActivation(activation: BindingActivation<T>): BindWhenFluentSyntax<T>;
onDeactivation(deactivation: BindingDeactivation<T>): BindWhenFluentSyntax<T>;
}
interface BindWhenOnFluentSyntax<T> extends BindWhenFluentSyntax<T>, BindOnFluentSyntax<T> {
}
interface BindWhenFluentSyntax<T> extends BoundServiceSyntax {
when(constraint: (metadata: BindingConstraints) => boolean): BindOnFluentSyntax<T>;
whenAnyAncestor(constraint: (metadata: BindingConstraints) => boolean): BindOnFluentSyntax<T>;
whenAnyAncestorIs(serviceIdentifier: ServiceIdentifier): BindOnFluentSyntax<T>;
whenAnyAncestorNamed(name: MetadataName): BindOnFluentSyntax<T>;
whenAnyAncestorTagged(tag: MetadataTag, tagValue: unknown): BindOnFluentSyntax<T>;
whenDefault(): BindOnFluentSyntax<T>;
whenNamed(name: MetadataName): BindOnFluentSyntax<T>;
whenNoAncestor(constraint: (metadata: BindingConstraints) => boolean): BindOnFluentSyntax<T>;
whenNoAncestorIs(serviceIdentifier: ServiceIdentifier): BindOnFluentSyntax<T>;
whenNoAncestorNamed(name: MetadataName): BindOnFluentSyntax<T>;
whenNoAncestorTagged(tag: MetadataTag, tagValue: unknown): BindOnFluentSyntax<T>;
whenNoParent(constraint: (metadata: BindingConstraints) => boolean): BindOnFluentSyntax<T>;
whenNoParentIs(serviceIdentifier: ServiceIdentifier): BindOnFluentSyntax<T>;
whenNoParentNamed(name: MetadataName): BindOnFluentSyntax<T>;
whenNoParentTagged(tag: MetadataTag, tagValue: unknown): BindOnFluentSyntax<T>;
whenParent(constraint: (metadata: BindingConstraints) => boolean): BindOnFluentSyntax<T>;
whenParentIs(serviceIdentifier: ServiceIdentifier): BindOnFluentSyntax<T>;
whenParentNamed(name: MetadataName): BindOnFluentSyntax<T>;
whenParentTagged(tag: MetadataTag, tagValue: unknown): BindOnFluentSyntax<T>;
whenTagged(tag: MetadataTag, tagValue: unknown): BindOnFluentSyntax<T>;
}
interface IsBoundOptions {
name?: MetadataName;
tag?: GetOptionsTagConstraint;
}
type Bind = <T>(serviceIdentifier: ServiceIdentifier<T>) => BindToFluentSyntax<T>;
type IsBound = (serviceIdentifier: ServiceIdentifier, options?: IsBoundOptions) => boolean;
type OnActivation = <T>(serviceIdentifier: ServiceIdentifier<T>, activation: BindingActivation<T>) => void;
type OnDeactivation = <T>(serviceIdentifier: ServiceIdentifier<T>, deactivation: BindingDeactivation<T>) => void;
type Rebind = <T>(serviceIdentifier: ServiceIdentifier<T>) => Promise<BindToFluentSyntax<T>>;
type RebindSync = <T>(serviceIdentifier: ServiceIdentifier<T>) => BindToFluentSyntax<T>;
type Unbind = (identifier: BindingIdentifier | ServiceIdentifier) => Promise<void>;
type UnbindSync = (identifier: BindingIdentifier | ServiceIdentifier) => void;
interface ContainerModuleLoadOptions {
bind: Bind;
isBound: IsBound;
onActivation: OnActivation;
onDeactivation: OnDeactivation;
rebind: Rebind;
rebindSync: RebindSync;
unbind: Unbind;
unbindSync: UnbindSync;
}
declare class ContainerModule {
#private;
constructor(load: (options: ContainerModuleLoadOptions) => void | Promise<void>);
get id(): number;
load(options: ContainerModuleLoadOptions): void | Promise<void>;
}
declare class Container {
#private;
constructor(options?: ContainerOptions);
bind<T>(serviceIdentifier: ServiceIdentifier<T>): BindToFluentSyntax<T>;
get<T>(serviceIdentifier: ServiceIdentifier<T>, options: OptionalGetOptions): T | undefined;
get<T>(serviceIdentifier: ServiceIdentifier<T>, options?: GetOptions): T;
getAll<T>(serviceIdentifier: ServiceIdentifier<T>, options?: GetAllOptions): T[];
getAllAsync<T>(serviceIdentifier: ServiceIdentifier<T>, options?: GetAllOptions): Promise<T[]>;
getAsync<T>(serviceIdentifier: ServiceIdentifier<T>, options: OptionalGetOptions): Promise<T | undefined>;
getAsync<T>(serviceIdentifier: ServiceIdentifier<T>, options?: GetOptions): Promise<T>;
isBound(serviceIdentifier: ServiceIdentifier, options?: IsBoundOptions): boolean;
isCurrentBound(serviceIdentifier: ServiceIdentifier, options?: IsBoundOptions): boolean;
load(...modules: ContainerModule[]): Promise<void>;
loadSync(...modules: ContainerModule[]): void;
onActivation<T>(serviceIdentifier: ServiceIdentifier<T>, activation: BindingActivation<T>): void;
onDeactivation<T>(serviceIdentifier: ServiceIdentifier<T>, deactivation: BindingDeactivation<T>): void;
register(pluginConstructor: Newable): void;
restore(): void;
rebind<T>(serviceIdentifier: ServiceIdentifier<T>): Promise<BindToFluentSyntax<T>>;
rebindSync<T>(serviceIdentifier: ServiceIdentifier<T>): BindToFluentSyntax<T>;
snapshot(): void;
unbind(identifier: BindingIdentifier | ServiceIdentifier): Promise<void>;
unbindAll(): Promise<void>;
unbindSync(identifier: BindingIdentifier | ServiceIdentifier): void;
unload(...modules: ContainerModule[]): Promise<void>;
unloadSync(...modules: ContainerModule[]): void;
}
interface ContainerOptions {
autobind?: true;
defaultScope?: BindingScope | undefined;
parent?: Container | undefined;
}
declare enum InversifyContainerErrorKind {
invalidOperation = 0
}
declare const isAppErrorSymbol: unique symbol;
declare class InversifyContainerError extends Error {
[isAppErrorSymbol]: true;
kind: InversifyContainerErrorKind;
constructor(kind: InversifyContainerErrorKind, message?: string, options?: ErrorOptions);
static is(value: unknown): value is InversifyContainerError;
static isErrorOfKind(value: unknown, kind: InversifyContainerErrorKind): value is InversifyContainerError;
}
export { Container, ContainerModule, InversifyContainerError, InversifyContainerErrorKind };
export type { Bind, BindInFluentSyntax, BindInWhenOnFluentSyntax, BindOnFluentSyntax, BindToFluentSyntax, BindWhenFluentSyntax, BindWhenOnFluentSyntax, BindingIdentifier, BoundServiceSyntax, ContainerModuleLoadOptions, ContainerOptions, IsBound, IsBoundOptions, MapToResolvedValueInjectOptions, OnActivation, OnDeactivation, Rebind, RebindSync, ResolvedValueInjectOptions, ResolvedValueMetadataInjectOptions, ResolvedValueMetadataInjectTagOptions, Unbind, UnbindSync };
@@ -0,0 +1,104 @@
# fast-levenshtein - Levenshtein algorithm in Javascript
[![Build Status](https://secure.travis-ci.org/hiddentao/fast-levenshtein.png)](http://travis-ci.org/hiddentao/fast-levenshtein)
[![NPM module](https://badge.fury.io/js/fast-levenshtein.png)](https://badge.fury.io/js/fast-levenshtein)
[![NPM downloads](https://img.shields.io/npm/dm/fast-levenshtein.svg?maxAge=2592000)](https://www.npmjs.com/package/fast-levenshtein)
[![Follow on Twitter](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/hiddentao)
An efficient Javascript implementation of the [Levenshtein algorithm](http://en.wikipedia.org/wiki/Levenshtein_distance) with locale-specific collator support.
## Features
* Works in node.js and in the browser.
* Better performance than other implementations by not needing to store the whole matrix ([more info](http://www.codeproject.com/Articles/13525/Fast-memory-efficient-Levenshtein-algorithm)).
* Locale-sensitive string comparisions if needed.
* Comprehensive test suite and performance benchmark.
* Small: <1 KB minified and gzipped
## Installation
### node.js
Install using [npm](http://npmjs.org/):
```bash
$ npm install fast-levenshtein
```
### Browser
Using bower:
```bash
$ bower install fast-levenshtein
```
If you are not using any module loader system then the API will then be accessible via the `window.Levenshtein` object.
## Examples
**Default usage**
```javascript
var levenshtein = require('fast-levenshtein');
var distance = levenshtein.get('back', 'book'); // 2
var distance = levenshtein.get('我愛你', '我叫你'); // 1
```
**Locale-sensitive string comparisons**
It supports using [Intl.Collator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator) for locale-sensitive string comparisons:
```javascript
var levenshtein = require('fast-levenshtein');
levenshtein.get('mikailovitch', 'Mikhaïlovitch', { useCollator: true});
// 1
```
## Building and Testing
To build the code and run the tests:
```bash
$ npm install -g grunt-cli
$ npm install
$ npm run build
```
## Performance
_Thanks to [Titus Wormer](https://github.com/wooorm) for [encouraging me](https://github.com/hiddentao/fast-levenshtein/issues/1) to do this._
Benchmarked against other node.js levenshtein distance modules (on Macbook Air 2012, Core i7, 8GB RAM):
```bash
Running suite Implementation comparison [benchmark/speed.js]...
>> levenshtein-edit-distance x 234 ops/sec ±3.02% (73 runs sampled)
>> levenshtein-component x 422 ops/sec ±4.38% (83 runs sampled)
>> levenshtein-deltas x 283 ops/sec ±3.83% (78 runs sampled)
>> natural x 255 ops/sec ±0.76% (88 runs sampled)
>> levenshtein x 180 ops/sec ±3.55% (86 runs sampled)
>> fast-levenshtein x 1,792 ops/sec ±2.72% (95 runs sampled)
Benchmark done.
Fastest test is fast-levenshtein at 4.2x faster than levenshtein-component
```
You can run this benchmark yourself by doing:
```bash
$ npm install
$ npm run build
$ npm run benchmark
```
## Contributing
If you wish to submit a pull request please update and/or create new tests for any changes you make and ensure the grunt build passes.
See [CONTRIBUTING.md](https://github.com/hiddentao/fast-levenshtein/blob/master/CONTRIBUTING.md) for details.
## License
MIT - see [LICENSE.md](https://github.com/hiddentao/fast-levenshtein/blob/master/LICENSE.md)
@@ -0,0 +1,20 @@
'use strict';
var fileType = require('file-type');
var PassThrough = require('readable-stream/passthrough');
var uuid = require('uuid');
var Vinyl = require('vinyl');
module.exports.file = function (buf, name) {
var ext = fileType(buf) ? '.' + fileType(buf).ext : null;
return new Vinyl({
contents: buf,
path: (name || uuid.v4()) + (ext || '')
});
};
module.exports.stream = function (buf, name) {
var stream = new PassThrough({objectMode: true});
stream.end(module.exports.file(buf, name));
return stream;
};
@@ -0,0 +1,7 @@
"use client";
import {
ariaShouldCloseOnInteractOutside
} from "../chunk-CTXDOZRW.mjs";
export {
ariaShouldCloseOnInteractOutside
};
@@ -0,0 +1,57 @@
'use strict';
var defineProperties = require('define-properties');
var test = require('tape');
var Index = require('../Iterator.prototype.constructor');
var Impl = require('../Iterator.prototype.constructor/implementation');
var $Iterator = require('../Iterator/polyfill')();
var isEnumerable = Object.prototype.propertyIsEnumerable;
module.exports = {
tests: function (t, constructor, name) {
t.equal(constructor, $Iterator, name + ' is Iterator');
},
index: function () {
test('Iterator.prototype.constructor: index', function (t) {
t.notEqual(Index, $Iterator, 'index is not Iterator itself');
t.equal(typeof Index, 'function', 'index is a function');
t['throws'](
function () { Index(); }, // eslint-disable-line new-cap
TypeError,
'index throws when Call-ed'
);
t['throws'](
function () { return new Index(); },
TypeError,
'index throws when Construct-ed'
);
t.end();
});
},
implementation: function () {
test('Iterator.prototype.constructor: implementation', function (t) {
t.equal(Impl, $Iterator, 'implementation is Iterator itself');
module.exports.tests(t, Impl, 'Iterator.prototype.constructor');
t.end();
});
},
shimmed: function () {
test('Iterator.prototype.constructor: shimmed', function (t) {
module.exports.tests(t, Iterator.prototype.constructor, 'Iterator.prototype.constructor');
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(Iterator.prototype, 'constructor'), 'Iterator#constructor is not enumerable');
et.end();
});
t.end();
});
}
};
@@ -0,0 +1,339 @@
/**
* Copyright (c) 2018 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { IBufferLine, ICellData, CharData } from 'common/Types';
import { ICharacterJoiner } from 'browser/Types';
import { AttributeData } from 'common/buffer/AttributeData';
import { WHITESPACE_CELL_CHAR, Content } from 'common/buffer/Constants';
import { CellData } from 'common/buffer/CellData';
import { IBufferService } from 'common/services/Services';
import { ICharacterJoinerService } from 'browser/services/Services';
export class JoinedCellData extends AttributeData implements ICellData {
private _width: number;
// .content carries no meaning for joined CellData, simply nullify it
// thus we have to overload all other .content accessors
public content: number = 0;
public fg: number;
public bg: number;
public combinedData: string = '';
constructor(firstCell: ICellData, chars: string, width: number) {
super();
this.fg = firstCell.fg;
this.bg = firstCell.bg;
this.combinedData = chars;
this._width = width;
}
public isCombined(): number {
// always mark joined cell data as combined
return Content.IS_COMBINED_MASK;
}
public getWidth(): number {
return this._width;
}
public getChars(): string {
return this.combinedData;
}
public getCode(): number {
// code always gets the highest possible fake codepoint (read as -1)
// this is needed as code is used by caches as identifier
return 0x1FFFFF;
}
public setFromCharData(value: CharData): void {
throw new Error('not implemented');
}
public getAsCharData(): CharData {
return [this.fg, this.getChars(), this.getWidth(), this.getCode()];
}
}
export class CharacterJoinerService implements ICharacterJoinerService {
public serviceBrand: undefined;
private _characterJoiners: ICharacterJoiner[] = [];
private _nextCharacterJoinerId: number = 0;
private _workCell: CellData = new CellData();
constructor(
@IBufferService private _bufferService: IBufferService
) { }
public register(handler: (text: string) => [number, number][]): number {
const joiner: ICharacterJoiner = {
id: this._nextCharacterJoinerId++,
handler
};
this._characterJoiners.push(joiner);
return joiner.id;
}
public deregister(joinerId: number): boolean {
for (let i = 0; i < this._characterJoiners.length; i++) {
if (this._characterJoiners[i].id === joinerId) {
this._characterJoiners.splice(i, 1);
return true;
}
}
return false;
}
public getJoinedCharacters(row: number): [number, number][] {
if (this._characterJoiners.length === 0) {
return [];
}
const line = this._bufferService.buffer.lines.get(row);
if (!line || line.length === 0) {
return [];
}
const ranges: [number, number][] = [];
const lineStr = line.translateToString(true);
// Because some cells can be represented by multiple javascript characters,
// we track the cell and the string indexes separately. This allows us to
// translate the string ranges we get from the joiners back into cell ranges
// for use when rendering
let rangeStartColumn = 0;
let currentStringIndex = 0;
let rangeStartStringIndex = 0;
let rangeAttrFG = line.getFg(0);
let rangeAttrBG = line.getBg(0);
for (let x = 0; x < line.getTrimmedLength(); x++) {
line.loadCell(x, this._workCell);
if (this._workCell.getWidth() === 0) {
// If this character is of width 0, skip it.
continue;
}
// End of range
if (this._workCell.fg !== rangeAttrFG || this._workCell.bg !== rangeAttrBG) {
// If we ended up with a sequence of more than one character,
// look for ranges to join.
if (x - rangeStartColumn > 1) {
const joinedRanges = this._getJoinedRanges(
lineStr,
rangeStartStringIndex,
currentStringIndex,
line,
rangeStartColumn
);
for (let i = 0; i < joinedRanges.length; i++) {
ranges.push(joinedRanges[i]);
}
}
// Reset our markers for a new range.
rangeStartColumn = x;
rangeStartStringIndex = currentStringIndex;
rangeAttrFG = this._workCell.fg;
rangeAttrBG = this._workCell.bg;
}
currentStringIndex += this._workCell.getChars().length || WHITESPACE_CELL_CHAR.length;
}
// Process any trailing ranges.
if (this._bufferService.cols - rangeStartColumn > 1) {
const joinedRanges = this._getJoinedRanges(
lineStr,
rangeStartStringIndex,
currentStringIndex,
line,
rangeStartColumn
);
for (let i = 0; i < joinedRanges.length; i++) {
ranges.push(joinedRanges[i]);
}
}
return ranges;
}
/**
* Given a segment of a line of text, find all ranges of text that should be
* joined in a single rendering unit. Ranges are internally converted to
* column ranges, rather than string ranges.
* @param line String representation of the full line of text
* @param startIndex Start position of the range to search in the string (inclusive)
* @param endIndex End position of the range to search in the string (exclusive)
*/
private _getJoinedRanges(line: string, startIndex: number, endIndex: number, lineData: IBufferLine, startCol: number): [number, number][] {
const text = line.substring(startIndex, endIndex);
// At this point we already know that there is at least one joiner so
// we can just pull its value and assign it directly rather than
// merging it into an empty array, which incurs unnecessary writes.
let allJoinedRanges: [number, number][] = [];
try {
allJoinedRanges = this._characterJoiners[0].handler(text);
} catch (error) {
console.error(error);
}
for (let i = 1; i < this._characterJoiners.length; i++) {
// We merge any overlapping ranges across the different joiners
try {
const joinerRanges = this._characterJoiners[i].handler(text);
for (let j = 0; j < joinerRanges.length; j++) {
CharacterJoinerService._mergeRanges(allJoinedRanges, joinerRanges[j]);
}
} catch (error) {
console.error(error);
}
}
this._stringRangesToCellRanges(allJoinedRanges, lineData, startCol);
return allJoinedRanges;
}
/**
* Modifies the provided ranges in-place to adjust for variations between
* string length and cell width so that the range represents a cell range,
* rather than the string range the joiner provides.
* @param ranges String ranges containing start (inclusive) and end (exclusive) index
* @param line Cell data for the relevant line in the terminal
* @param startCol Offset within the line to start from
*/
private _stringRangesToCellRanges(ranges: [number, number][], line: IBufferLine, startCol: number): void {
let currentRangeIndex = 0;
let currentRangeStarted = false;
let currentStringIndex = 0;
let currentRange = ranges[currentRangeIndex];
// If we got through all of the ranges, stop searching
if (!currentRange) {
return;
}
for (let x = startCol; x < this._bufferService.cols; x++) {
const width = line.getWidth(x);
const length = line.getString(x).length || WHITESPACE_CELL_CHAR.length;
// We skip zero-width characters when creating the string to join the text
// so we do the same here
if (width === 0) {
continue;
}
// Adjust the start of the range
if (!currentRangeStarted && currentRange[0] <= currentStringIndex) {
currentRange[0] = x;
currentRangeStarted = true;
}
// Adjust the end of the range
if (currentRange[1] <= currentStringIndex) {
currentRange[1] = x;
// We're finished with this range, so we move to the next one
currentRange = ranges[++currentRangeIndex];
// If there are no more ranges left, stop searching
if (!currentRange) {
break;
}
// Ranges can be on adjacent characters. Because the end index of the
// ranges are exclusive, this means that the index for the start of a
// range can be the same as the end index of the previous range. To
// account for the start of the next range, we check here just in case.
if (currentRange[0] <= currentStringIndex) {
currentRange[0] = x;
currentRangeStarted = true;
} else {
currentRangeStarted = false;
}
}
// Adjust the string index based on the character length to line up with
// the column adjustment
currentStringIndex += length;
}
// If there is still a range left at the end, it must extend all the way to
// the end of the line.
if (currentRange) {
currentRange[1] = this._bufferService.cols;
}
}
/**
* Merges the range defined by the provided start and end into the list of
* existing ranges. The merge is done in place on the existing range for
* performance and is also returned.
* @param ranges Existing range list
* @param newRange Tuple of two numbers representing the new range to merge in.
* @returns The ranges input with the new range merged in place
*/
private static _mergeRanges(ranges: [number, number][], newRange: [number, number]): [number, number][] {
let inRange = false;
for (let i = 0; i < ranges.length; i++) {
const range = ranges[i];
if (!inRange) {
if (newRange[1] <= range[0]) {
// Case 1: New range is before the search range
ranges.splice(i, 0, newRange);
return ranges;
}
if (newRange[1] <= range[1]) {
// Case 2: New range is either wholly contained within the
// search range or overlaps with the front of it
range[0] = Math.min(newRange[0], range[0]);
return ranges;
}
if (newRange[0] < range[1]) {
// Case 3: New range either wholly contains the search range
// or overlaps with the end of it
range[0] = Math.min(newRange[0], range[0]);
inRange = true;
}
// Case 4: New range starts after the search range
continue;
} else {
if (newRange[1] <= range[0]) {
// Case 5: New range extends from previous range but doesn't
// reach the current one
ranges[i - 1][1] = newRange[1];
return ranges;
}
if (newRange[1] <= range[1]) {
// Case 6: New range extends from prvious range into the
// current range
ranges[i - 1][1] = Math.max(newRange[1], range[1]);
ranges.splice(i, 1);
return ranges;
}
// Case 7: New range extends from previous range past the
// end of the current range
ranges.splice(i, 1);
i--;
}
}
if (inRange) {
// Case 8: New range extends past the last existing range
ranges[ranges.length - 1][1] = newRange[1];
} else {
// Case 9: New range starts after the last existing range
ranges.push(newRange);
}
return ranges;
}
}
@@ -0,0 +1 @@
{"version":3,"file":"buildPlanBindingConstraintsList.js","sourceRoot":"","sources":["../../../../src/planning/calculations/buildPlanBindingConstraintsList.ts"],"names":[],"mappings":";;AAKA,0EAkBC;AAtBD,6FAA0F;AAI1F,SAAgB,+BAA+B,CAC7C,MAAkB;IAElB,MAAM,IAAI,GAA8B,IAAI,GAAG,EAAE,CAAC;IAElD,IAAI,MAAM,CAAC,eAAe,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QAC7C,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO,IAAI,qDAAyB,CAAC;QACnC,IAAI,EAAE;YACJ,kBAAkB,EAAE,KAAK;YACzB,IAAI,EAAE,MAAM,CAAC,eAAe,CAAC,IAAI;YACjC,iBAAiB,EAAE,MAAM,CAAC,eAAe,CAAC,iBAAiB;YAC3D,IAAI;SACL;QACD,QAAQ,EAAE,SAAS;KACpB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,24 @@
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseFindIndex(array, predicate, fromIndex, fromRight) {
var length = array.length,
index = fromIndex + (fromRight ? 1 : -1);
while ((fromRight ? index-- : ++index < length)) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
}
module.exports = baseFindIndex;
@@ -0,0 +1,22 @@
(The MIT License)
Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,72 @@
'use strict';
var defineProperties = require('define-properties');
var test = require('tape');
var hasSymbols = require('has-symbols')();
var hasToStringTag = require('has-tostringtag');
var functionsHaveNames = require('functions-have-names')();
var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames();
var index = require('../Iterator.prototype');
var impl = require('../Iterator.prototype/implementation');
var isEnumerable = Object.prototype.propertyIsEnumerable;
var $Iterator = require('../Iterator/implementation');
module.exports = {
tests: function (proto, name, t) {
t.notEqual(proto, null, 'is not null');
t.equal(typeof proto, 'object', 'is an object');
t.test('Symbol.iterator', { skip: !hasSymbols }, function (st) {
st.equal(typeof proto[Symbol.iterator], 'function', 'has a `Symbol.iterator` method');
st.equal(
proto[Symbol.iterator].name,
'[Symbol.iterator]',
'has name "[Symbol.iterator]"',
{ skip: functionsHaveNames && !functionsHaveConfigurableNames }
);
st.equal(proto[Symbol.iterator](), proto, 'function returns proto');
st.equal(proto[Symbol.iterator].call($Iterator), $Iterator, 'function returns receiver');
st.end();
});
t.test(
'Symbol.toStringTag',
{ skip: !hasToStringTag || 'temporarily skipped pending https://bugs.chromium.org/p/chromium/issues/detail?id=1477372' },
function (st) {
st.equal(proto[Symbol.toStringTag], 'Iterator', 'has a `Symbol.toStringTag` property');
st.end();
}
);
},
index: function () {
test('Iterator.prototype: index', function (t) {
module.exports.tests(index, 'Iterator.prototype', t);
t.end();
});
},
implementation: function () {
test('Iterator.prototype: implementation', function (t) {
module.exports.tests(impl, 'Iterator.prototype', t);
t.end();
});
},
shimmed: function () {
test('Iterator.prototype: shimmed', function (t) {
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(Iterator, 'prototype'), 'Iterator.prototype is not enumerable');
et.end();
});
module.exports.tests(Iterator.prototype, 'Iterator.prototype', t);
t.end();
});
}
};
@@ -0,0 +1,110 @@
import $k51So$arAEmodulejs from "./ar-AE.module.js";
import $k51So$bgBGmodulejs from "./bg-BG.module.js";
import $k51So$csCZmodulejs from "./cs-CZ.module.js";
import $k51So$daDKmodulejs from "./da-DK.module.js";
import $k51So$deDEmodulejs from "./de-DE.module.js";
import $k51So$elGRmodulejs from "./el-GR.module.js";
import $k51So$enUSmodulejs from "./en-US.module.js";
import $k51So$esESmodulejs from "./es-ES.module.js";
import $k51So$etEEmodulejs from "./et-EE.module.js";
import $k51So$fiFImodulejs from "./fi-FI.module.js";
import $k51So$frFRmodulejs from "./fr-FR.module.js";
import $k51So$heILmodulejs from "./he-IL.module.js";
import $k51So$hrHRmodulejs from "./hr-HR.module.js";
import $k51So$huHUmodulejs from "./hu-HU.module.js";
import $k51So$itITmodulejs from "./it-IT.module.js";
import $k51So$jaJPmodulejs from "./ja-JP.module.js";
import $k51So$koKRmodulejs from "./ko-KR.module.js";
import $k51So$ltLTmodulejs from "./lt-LT.module.js";
import $k51So$lvLVmodulejs from "./lv-LV.module.js";
import $k51So$nbNOmodulejs from "./nb-NO.module.js";
import $k51So$nlNLmodulejs from "./nl-NL.module.js";
import $k51So$plPLmodulejs from "./pl-PL.module.js";
import $k51So$ptBRmodulejs from "./pt-BR.module.js";
import $k51So$ptPTmodulejs from "./pt-PT.module.js";
import $k51So$roROmodulejs from "./ro-RO.module.js";
import $k51So$ruRUmodulejs from "./ru-RU.module.js";
import $k51So$skSKmodulejs from "./sk-SK.module.js";
import $k51So$slSImodulejs from "./sl-SI.module.js";
import $k51So$srSPmodulejs from "./sr-SP.module.js";
import $k51So$svSEmodulejs from "./sv-SE.module.js";
import $k51So$trTRmodulejs from "./tr-TR.module.js";
import $k51So$ukUAmodulejs from "./uk-UA.module.js";
import $k51So$zhCNmodulejs from "./zh-CN.module.js";
import $k51So$zhTWmodulejs from "./zh-TW.module.js";
var $a2f21f5f14f60553$exports = {};
$a2f21f5f14f60553$exports = {
"ar-AE": $k51So$arAEmodulejs,
"bg-BG": $k51So$bgBGmodulejs,
"cs-CZ": $k51So$csCZmodulejs,
"da-DK": $k51So$daDKmodulejs,
"de-DE": $k51So$deDEmodulejs,
"el-GR": $k51So$elGRmodulejs,
"en-US": $k51So$enUSmodulejs,
"es-ES": $k51So$esESmodulejs,
"et-EE": $k51So$etEEmodulejs,
"fi-FI": $k51So$fiFImodulejs,
"fr-FR": $k51So$frFRmodulejs,
"he-IL": $k51So$heILmodulejs,
"hr-HR": $k51So$hrHRmodulejs,
"hu-HU": $k51So$huHUmodulejs,
"it-IT": $k51So$itITmodulejs,
"ja-JP": $k51So$jaJPmodulejs,
"ko-KR": $k51So$koKRmodulejs,
"lt-LT": $k51So$ltLTmodulejs,
"lv-LV": $k51So$lvLVmodulejs,
"nb-NO": $k51So$nbNOmodulejs,
"nl-NL": $k51So$nlNLmodulejs,
"pl-PL": $k51So$plPLmodulejs,
"pt-BR": $k51So$ptBRmodulejs,
"pt-PT": $k51So$ptPTmodulejs,
"ro-RO": $k51So$roROmodulejs,
"ru-RU": $k51So$ruRUmodulejs,
"sk-SK": $k51So$skSKmodulejs,
"sl-SI": $k51So$slSImodulejs,
"sr-SP": $k51So$srSPmodulejs,
"sv-SE": $k51So$svSEmodulejs,
"tr-TR": $k51So$trTRmodulejs,
"uk-UA": $k51So$ukUAmodulejs,
"zh-CN": $k51So$zhCNmodulejs,
"zh-TW": $k51So$zhTWmodulejs
};
export {$a2f21f5f14f60553$exports as default};
//# sourceMappingURL=intlStrings.module.js.map
@@ -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 `Array.from` method.",
category: "ES2015",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-array-from.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({
Array: {
from: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1,88 @@
import * as pirates from "pirates";
import { transform} from "./index";
export function addHook(
extension,
sucraseOptions,
hookOptions,
) {
let mergedSucraseOptions = sucraseOptions;
const sucraseOptionsEnvJSON = process.env.SUCRASE_OPTIONS;
if (sucraseOptionsEnvJSON) {
mergedSucraseOptions = {...mergedSucraseOptions, ...JSON.parse(sucraseOptionsEnvJSON)};
}
return pirates.addHook(
(code, filePath) => {
const {code: transformedCode, sourceMap} = transform(code, {
...mergedSucraseOptions,
sourceMapOptions: {compiledFilename: filePath},
filePath,
});
const mapBase64 = Buffer.from(JSON.stringify(sourceMap)).toString("base64");
const suffix = `//# sourceMappingURL=data:application/json;charset=utf-8;base64,${mapBase64}`;
return `${transformedCode}\n${suffix}`;
},
{...hookOptions, exts: [extension]},
);
}
export function registerJS(hookOptions) {
return addHook(".js", {transforms: ["imports", "flow", "jsx"]}, hookOptions);
}
export function registerJSX(hookOptions) {
return addHook(".jsx", {transforms: ["imports", "flow", "jsx"]}, hookOptions);
}
export function registerTS(hookOptions) {
return addHook(".ts", {transforms: ["imports", "typescript"]}, hookOptions);
}
export function registerTSX(hookOptions) {
return addHook(".tsx", {transforms: ["imports", "typescript", "jsx"]}, hookOptions);
}
export function registerTSLegacyModuleInterop(hookOptions) {
return addHook(
".ts",
{
transforms: ["imports", "typescript"],
enableLegacyTypeScriptModuleInterop: true,
},
hookOptions,
);
}
export function registerTSXLegacyModuleInterop(hookOptions) {
return addHook(
".tsx",
{
transforms: ["imports", "typescript", "jsx"],
enableLegacyTypeScriptModuleInterop: true,
},
hookOptions,
);
}
export function registerAll(hookOptions) {
const reverts = [
registerJS(hookOptions),
registerJSX(hookOptions),
registerTS(hookOptions),
registerTSX(hookOptions),
];
return () => {
for (const fn of reverts) {
fn();
}
};
}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=curryBuildServiceNodeBindings.spec.d.ts.map
@@ -0,0 +1,9 @@
/**
* We could use NoInfer typescript build-in utility
* introduced in typescript 5.4, however at the moment of creation
* the supported ts versions are >=4.8.4 <5.7.0
* so for the moment we have to stick to this polyfill.
*
* @see https://github.com/millsp/ts-toolbelt/blob/master/sources/Function/NoInfer.ts
*/
export type NoInfer<A> = [A][A extends unknown ? 0 : never];
@@ -0,0 +1,93 @@
# queue-lit
This package is a tiny queue data structure in case you `Array#push()` or
`Array#shift()` on large arrays very often.
`Array#shift()` has linear time complexity `O(n)` while `Queue#push()` has
constant time complexity `O(1)`.
## Installation
```bash
$ npm i queue-lit
# or
$ yarn add queue-lit
```
## Usage
```js
import { Queue } from 'queue-lit';
const queue = new Queue();
queue.push('Hello');
queue.push('World');
console.log(queue.size);
// => 2
console.log(...queue);
// => 'Hello World'
console.log(queue.pop());
//=> 'Hello'
console.log(queue.pop());
//=> 'World'
```
## API
### `queue = new Queue()`
The instance is an [`Iterable`], which means you can iterate over the queue
front to back with a `for...of` loop, or use spreading to convert the queue to
an array.
#### `.push(value)`
Adds one element to the end of the queue and returns the new length of
the queue.
This method changes the size of the queue.
#### `.pop()`
Pop removes the last element from the queue and returns that element.
This method changes the size of the queue.
Returns `undefined` if the queue is empty.
#### `.clear()`
Clears the queue and removes all elements.
This method changes the size of the queue.
#### `.size`
Static method that returns the size of the queue.
## Development
(1) Install dependencies
```bash
$ npm i
# or
$ yarn
```
(2) Run initial validation
```bash
$ ./Taskfile.sh validate
```
(3) Start developing. See [`./Taskfile.sh`](./Taskfile.sh) for more tasks to
help you develop.
---
_This project was set up by @jvdx/core_
[`Iterable`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols
@@ -0,0 +1,21 @@
'use strict';
var $TypeError = require('es-errors/type');
var IteratorComplete = require('./IteratorComplete');
var IteratorNext = require('./IteratorNext');
var isIteratorRecord = require('../helpers/records/iterator-record');
// https://262.ecma-international.org/15.0/#sec-iteratorstep
module.exports = function IteratorStep(iteratorRecord) {
if (!isIteratorRecord(iteratorRecord)) {
throw new $TypeError('Assertion failed: `iteratorRecord` must be an Iterator Record'); // step 1
}
var result = IteratorNext(iteratorRecord); // step 1
var done = IteratorComplete(result); // step 2
return done === true ? false : result; // steps 3-4
};
@@ -0,0 +1,133 @@
import type { PayloadAction } from '@reduxjs/toolkit'
import {
createAsyncThunk,
createAction,
createSlice,
configureStore,
createEntityAdapter,
} from '@reduxjs/toolkit'
import type { EntityAdapter } from '@internal/entities/models'
import type { BookModel } from '@internal/entities/tests/fixtures/book'
describe('Combined entity slice', () => {
let adapter: EntityAdapter<BookModel, string>
beforeEach(() => {
adapter = createEntityAdapter({
selectId: (book: BookModel) => book.id,
sortComparer: (a, b) => a.title.localeCompare(b.title),
})
})
it('Entity and async features all works together', async () => {
const upsertBook = createAction<BookModel>('otherBooks/upsert')
type BooksState = ReturnType<typeof adapter.getInitialState> & {
loading: 'initial' | 'pending' | 'finished' | 'failed'
lastRequestId: string | null
}
const initialState: BooksState = adapter.getInitialState({
loading: 'initial',
lastRequestId: null,
})
const fakeBooks: BookModel[] = [
{ id: 'b', title: 'Second' },
{ id: 'a', title: 'First' },
]
const fetchBooksTAC = createAsyncThunk<
BookModel[],
void,
{
state: { books: BooksState }
}
>(
'books/fetch',
async (arg, { getState, dispatch, extra, requestId, signal }) => {
const state = getState()
return fakeBooks
},
)
const booksSlice = createSlice({
name: 'books',
initialState,
reducers: {
addOne: adapter.addOne,
removeOne(state, action: PayloadAction<string>) {
const sizeBefore = state.ids.length
// Originally, having nested `produce` calls don't mutate `state` here as I would have expected.
// (note that `state` here is actually an Immer Draft<S>, from `createReducer`)
// One woarkound was to return the new plain result value instead
// See https://github.com/immerjs/immer/issues/533
// However, after tweaking `createStateOperator` to check if the argument is a draft,
// we can just treat the operator as strictly mutating, without returning a result,
// and the result should be correct.
const result = adapter.removeOne(state, action)
const sizeAfter = state.ids.length
if (sizeBefore > 0) {
expect(sizeAfter).toBe(sizeBefore - 1)
}
//Deliberately _don't_ return result
},
},
extraReducers: (builder) => {
builder.addCase(upsertBook, (state, action) => {
return adapter.upsertOne(state, action)
})
builder.addCase(fetchBooksTAC.pending, (state, action) => {
state.loading = 'pending'
state.lastRequestId = action.meta.requestId
})
builder.addCase(fetchBooksTAC.fulfilled, (state, action) => {
if (
state.loading === 'pending' &&
action.meta.requestId === state.lastRequestId
) {
adapter.setAll(state, action.payload)
state.loading = 'finished'
state.lastRequestId = null
}
})
},
})
const { addOne, removeOne } = booksSlice.actions
const { reducer } = booksSlice
const store = configureStore({
reducer: {
books: reducer,
},
})
await store.dispatch(fetchBooksTAC())
const { books: booksAfterLoaded } = store.getState()
// Sorted, so "First" goes first
expect(booksAfterLoaded.ids).toEqual(['a', 'b'])
expect(booksAfterLoaded.lastRequestId).toBe(null)
expect(booksAfterLoaded.loading).toBe('finished')
store.dispatch(addOne({ id: 'd', title: 'Remove Me' }))
store.dispatch(removeOne('d'))
store.dispatch(addOne({ id: 'c', title: 'Middle' }))
const { books: booksAfterAddOne } = store.getState()
// Sorted, so "Middle" goes in the middle
expect(booksAfterAddOne.ids).toEqual(['a', 'c', 'b'])
store.dispatch(upsertBook({ id: 'c', title: 'Zeroth' }))
const { books: booksAfterUpsert } = store.getState()
// Sorted, so "Zeroth" goes last
expect(booksAfterUpsert.ids).toEqual(['a', 'b', 'c'])
})
})
@@ -0,0 +1,17 @@
import { DragGesture } from '../../gestures/drag/index.mjs';
import { PanGesture } from '../../gestures/pan/index.mjs';
import { MeasureLayout } from './layout/MeasureLayout.mjs';
import { HTMLProjectionNode } from '../../projection/node/HTMLProjectionNode.mjs';
const drag = {
pan: {
Feature: PanGesture,
},
drag: {
Feature: DragGesture,
ProjectionNode: HTMLProjectionNode,
MeasureLayout,
},
};
export { drag };
@@ -0,0 +1,103 @@
/**
* Syntactic units in unist syntax trees are called nodes.
*
* @typeParam TData Information from the ecosystem. Useful for more specific {@link Node.data}.
*/
export interface Node<TData extends object = Data> {
/**
* The variant of a node.
*/
type: string;
/**
* Information from the ecosystem.
*/
data?: TData | undefined;
/**
* Location of a node in a source document.
* Must not be present if a node is generated.
*/
position?: Position | undefined;
}
/**
* Information associated by the ecosystem with the node.
* Space is guaranteed to never be specified by unist or specifications
* implementing unist.
*/
export interface Data {
[key: string]: unknown;
}
/**
* Location of a node in a source file.
*/
export interface Position {
/**
* Place of the first character of the parsed source region.
*/
start: Point;
/**
* Place of the first character after the parsed source region.
*/
end: Point;
/**
* Start column at each index (plus start line) in the source region,
* for elements that span multiple lines.
*/
indent?: number[] | undefined;
}
/**
* One place in a source file.
*/
export interface Point {
/**
* Line in a source file (1-indexed integer).
*/
line: number;
/**
* Column in a source file (1-indexed integer).
*/
column: number;
/**
* Character in a source file (0-indexed integer).
*/
offset?: number | undefined;
}
/**
* Util for extracting type of {@link Node.data}
*
* @typeParam TNode Specific node type such as {@link Node} with {@link Data}, {@link Literal}, etc.
*
* @example `NodeData<Node<{ key: string }>>` -> `{ key: string }`
*/
export type NodeData<TNode extends Node<object>> = TNode extends Node<infer TData> ? TData : never;
/**
* Nodes containing other nodes.
*
* @typeParam ChildNode Node item of {@link Parent.children}
*/
export interface Parent<ChildNode extends Node<object> = Node, TData extends object = NodeData<ChildNode>>
extends Node<TData>
{
/**
* List representing the children of a node.
*/
children: ChildNode[];
}
/**
* Nodes containing a value.
*
* @typeParam Value Specific value type of {@link Literal.value} such as `string` for `Text` node
*/
export interface Literal<Value = unknown, TData extends object = Data> extends Node<TData> {
value: Value;
}
@@ -0,0 +1,241 @@
'use strict'
const fs = require('@npmcli/fs')
const fsm = require('fs-minipass')
const ssri = require('ssri')
const contentPath = require('./path')
const Pipeline = require('minipass-pipeline')
module.exports = read
const MAX_SINGLE_READ_SIZE = 64 * 1024 * 1024
async function read (cache, integrity, opts = {}) {
const { size } = opts
const { stat, cpath, sri } = await withContentSri(cache, integrity, async (cpath, sri) => {
// get size
const stat = await fs.stat(cpath)
return { stat, cpath, sri }
})
if (typeof size === 'number' && stat.size !== size) {
throw sizeError(size, stat.size)
}
if (stat.size > MAX_SINGLE_READ_SIZE) {
return readPipeline(cpath, stat.size, sri, new Pipeline()).concat()
}
const data = await fs.readFile(cpath, { encoding: null })
if (!ssri.checkData(data, sri)) {
throw integrityError(sri, cpath)
}
return data
}
const readPipeline = (cpath, size, sri, stream) => {
stream.push(
new fsm.ReadStream(cpath, {
size,
readSize: MAX_SINGLE_READ_SIZE,
}),
ssri.integrityStream({
integrity: sri,
size,
})
)
return stream
}
module.exports.sync = readSync
function readSync (cache, integrity, opts = {}) {
const { size } = opts
return withContentSriSync(cache, integrity, (cpath, sri) => {
const data = fs.readFileSync(cpath, { encoding: null })
if (typeof size === 'number' && size !== data.length) {
throw sizeError(size, data.length)
}
if (ssri.checkData(data, sri)) {
return data
}
throw integrityError(sri, cpath)
})
}
module.exports.stream = readStream
module.exports.readStream = readStream
function readStream (cache, integrity, opts = {}) {
const { size } = opts
const stream = new Pipeline()
// Set all this up to run on the stream and then just return the stream
Promise.resolve().then(async () => {
const { stat, cpath, sri } = await withContentSri(cache, integrity, async (cpath, sri) => {
// just stat to ensure it exists
const stat = await fs.stat(cpath)
return { stat, cpath, sri }
})
if (typeof size === 'number' && size !== stat.size) {
return stream.emit('error', sizeError(size, stat.size))
}
return readPipeline(cpath, stat.size, sri, stream)
}).catch(err => stream.emit('error', err))
return stream
}
module.exports.copy = copy
module.exports.copy.sync = copySync
function copy (cache, integrity, dest) {
return withContentSri(cache, integrity, (cpath, sri) => {
return fs.copyFile(cpath, dest)
})
}
function copySync (cache, integrity, dest) {
return withContentSriSync(cache, integrity, (cpath, sri) => {
return fs.copyFileSync(cpath, dest)
})
}
module.exports.hasContent = hasContent
async function hasContent (cache, integrity) {
if (!integrity) {
return false
}
try {
return await withContentSri(cache, integrity, async (cpath, sri) => {
const stat = await fs.stat(cpath)
return { size: stat.size, sri, stat }
})
} catch (err) {
if (err.code === 'ENOENT') {
return false
}
if (err.code === 'EPERM') {
/* istanbul ignore else */
if (process.platform !== 'win32') {
throw err
} else {
return false
}
}
}
}
module.exports.hasContent.sync = hasContentSync
function hasContentSync (cache, integrity) {
if (!integrity) {
return false
}
return withContentSriSync(cache, integrity, (cpath, sri) => {
try {
const stat = fs.statSync(cpath)
return { size: stat.size, sri, stat }
} catch (err) {
if (err.code === 'ENOENT') {
return false
}
if (err.code === 'EPERM') {
/* istanbul ignore else */
if (process.platform !== 'win32') {
throw err
} else {
return false
}
}
}
})
}
async function withContentSri (cache, integrity, fn) {
const sri = ssri.parse(integrity)
// If `integrity` has multiple entries, pick the first digest
// with available local data.
const algo = sri.pickAlgorithm()
const digests = sri[algo]
if (digests.length <= 1) {
const cpath = contentPath(cache, digests[0])
return fn(cpath, digests[0])
} else {
// Can't use race here because a generic error can happen before
// a ENOENT error, and can happen before a valid result
const results = await Promise.all(digests.map(async (meta) => {
try {
return await withContentSri(cache, meta, fn)
} catch (err) {
if (err.code === 'ENOENT') {
return Object.assign(
new Error('No matching content found for ' + sri.toString()),
{ code: 'ENOENT' }
)
}
return err
}
}))
// Return the first non error if it is found
const result = results.find((r) => !(r instanceof Error))
if (result) {
return result
}
// Throw the No matching content found error
const enoentError = results.find((r) => r.code === 'ENOENT')
if (enoentError) {
throw enoentError
}
// Throw generic error
throw results.find((r) => r instanceof Error)
}
}
function withContentSriSync (cache, integrity, fn) {
const sri = ssri.parse(integrity)
// If `integrity` has multiple entries, pick the first digest
// with available local data.
const algo = sri.pickAlgorithm()
const digests = sri[algo]
if (digests.length <= 1) {
const cpath = contentPath(cache, digests[0])
return fn(cpath, digests[0])
} else {
let lastErr = null
for (const meta of digests) {
try {
return withContentSriSync(cache, meta, fn)
} catch (err) {
lastErr = err
}
}
throw lastErr
}
}
function sizeError (expected, found) {
/* eslint-disable-next-line max-len */
const err = new Error(`Bad data size: expected inserted data to be ${expected} bytes, but got ${found} instead`)
err.expected = expected
err.found = found
err.code = 'EBADSIZE'
return err
}
function integrityError (sri, path) {
const err = new Error(`Integrity verification failed for ${sri} (${path})`)
err.code = 'EINTEGRITY'
err.sri = sri
err.path = path
return err
}
@@ -0,0 +1,31 @@
import { fullJitter } from './full.jitter';
describe(`Testing ${fullJitter.name}`, () => {
const delay = 100;
function arrayWith5FullJitterDelays() {
return Array(5).fill(delay).map(fullJitter)
}
describe(`when calling #fullJitter on the same delay multiple times`, () => {
it('all the delays are greater than or equal to 0', () => {
arrayWith5FullJitterDelays()
.forEach(value => expect(value).toBeGreaterThanOrEqual(0));
})
it('all the delays are less than or equal to the original delay', () => {
arrayWith5FullJitterDelays()
.forEach(value => expect(value).toBeLessThanOrEqual(delay));
})
it('the delays are not equal to one another', () => {
const delays = arrayWith5FullJitterDelays();
expect(new Set(delays).size).not.toBe(1);
})
it('the delays are integers', () => {
arrayWith5FullJitterDelays()
.forEach(value => expect(Number.isInteger(value)).toBe(true))
})
})
})
@@ -0,0 +1,27 @@
declare const _default: {
/**
* Custom utilities
*/
".leading-inherit": {
"line-height": string;
};
".bg-img-inherit": {
"background-image": string;
};
".bg-clip-inherit": {
"background-clip": string;
};
".text-fill-inherit": {
"-webkit-text-fill-color": string;
};
".tap-highlight-transparent": {
"-webkit-tap-highlight-color": string;
};
".input-search-cancel-button-none": {
"&::-webkit-search-cancel-button": {
"-webkit-appearance": string;
};
};
};
export { _default as default };
@@ -0,0 +1 @@
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAwCxC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AAC7D,MAAM,aAAa,GAAG,CAAC,CAAS,EAAoB,EAAE,CACpD,KAAK,CAAC,GAAG,CAAC,CAAgB,CAAC,CAAA;AAE7B,iEAAiE;AACjE,gEAAgE;AAChE,0CAA0C;AAC1C,uEAAuE;AACvE,MAAM,gBAAgB,GAAG,2BAA2B,CAAA;AACpD,MAAM,UAAU,GAAG,SAAS,CAAA;AAE5B,uEAAuE;AACvE,qEAAqE;AACrE,qEAAqE;AACrE,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AAC3C,0DAA0D;AAC1D,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAA;AACrC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,iBAAiB,CAAC,CAAA;AAC7C,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CACjC,CAAC,CAAC,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAA;AAE/C,gCAAgC;AAChC,MAAM,KAAK,GAAG,MAAM,CAAA;AAEpB,gCAAgC;AAChC,MAAM,IAAI,GAAG,KAAK,GAAG,IAAI,CAAA;AACzB,0EAA0E;AAC1E,sCAAsC;AACtC,MAAM,WAAW,GAAG,KAAK,GAAG,IAAI,CAAA;AAEhC,yEAAyE;AACzE,2DAA2D;AAE3D,MAAM,OAAO,GAAG;IACd,IAAI,CAAoB;IACf,KAAK,CAAK;IAEnB,SAAS,CAAU;IACnB,MAAM,GAAY,KAAK,CAAA;IACvB,MAAM,GAAqB,EAAE,CAAA;IACpB,OAAO,CAAM;IACb,YAAY,CAAQ;IAC7B,KAAK,CAAO;IACZ,WAAW,GAAY,KAAK,CAAA;IAC5B,QAAQ,CAAkB;IAC1B,SAAS,CAAS;IAClB,kDAAkD;IAClD,uCAAuC;IACvC,SAAS,GAAY,KAAK,CAAA;IAE1B,YACE,IAAwB,EACxB,MAAY,EACZ,UAA4B,EAAE;QAE9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,kCAAkC;QAClC,IAAI,IAAI;YAAE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;QAC/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;QACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAA;QACnE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAA;QACxD,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW;YAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;IACnE,CAAC;IAED,IAAI,QAAQ;QACV,qBAAqB;QACrB,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC,SAAS,CAAA;QACvD,oBAAoB;QACpB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC5B,IAAI,OAAO,CAAC,KAAK,QAAQ;gBAAE,SAAQ;YACnC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ;gBAAE,OAAO,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAA;QAC1D,CAAC;QACD,wEAAwE;QACxE,OAAO,IAAI,CAAC,SAAS,CAAA;IACvB,CAAC;IAED,2BAA2B;IAC3B,QAAQ;QACN,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC,SAAS,CAAA;QACvD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;QACpE,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,SAAS;gBACpB,IAAI,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAA;QACtE,CAAC;IACH,CAAC;IAED,SAAS;QACP,qBAAqB;QACrB,IAAI,IAAI,KAAK,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACpE,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAA;QACjC,oBAAoB;QAEpB,wCAAwC;QACxC,IAAI,CAAC,QAAQ,EAAE,CAAA;QACf,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA;QACvB,IAAI,CAAkB,CAAA;QACtB,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,CAAC,IAAI,KAAK,GAAG;gBAAE,SAAQ;YAC5B,qEAAqE;YACrE,IAAI,CAAC,GAAoB,CAAC,CAAA;YAC1B,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAA;YAClB,OAAO,EAAE,EAAE,CAAC;gBACV,KACE,IAAI,CAAC,GAAG,CAAC,CAAC,YAAY,GAAG,CAAC,EAC1B,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAChC,CAAC,EAAE,EACH,CAAC;oBACD,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;wBAC5B,qBAAqB;wBACrB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;4BAC7B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;wBACjD,CAAC;wBACD,oBAAoB;wBACpB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;oBAC3B,CAAC;gBACH,CAAC;gBACD,CAAC,GAAG,EAAE,CAAA;gBACN,EAAE,GAAG,CAAC,CAAC,OAAO,CAAA;YAChB,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,CAAC,GAAG,KAAuB;QAC7B,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;YACtB,IAAI,CAAC,KAAK,EAAE;gBAAE,SAAQ;YACtB,qBAAqB;YACrB,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,EAAE,CAAC;gBACvE,MAAM,IAAI,KAAK,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAA;YACvC,CAAC;YACD,oBAAoB;YACpB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACrB,CAAC;IACH,CAAC;IAED,MAAM;QACJ,MAAM,GAAG,GACP,IAAI,CAAC,IAAI,KAAK,IAAI;YAChB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;YACxE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAE,CAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;QAC/D,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QACjD,IACE,IAAI,CAAC,KAAK,EAAE;YACZ,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK;gBAClB,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC,EACzD,CAAC;YACD,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QACD,OAAO,GAAG,CAAALine truncated
@@ -0,0 +1 @@
{"name":"generator-function","version":"2.0.1","requiresBuild":false,"files":{".eslintrc":{"checkedAt":1794532097656,"integrity":"sha512-iy7Ml6WpX2GcZlEWz7LIPv76jVOLIhJG01STRCQa8ArHF2u4aJVcv1YlP6knWEajzZQP6mfxaqYvdY6WM3qELw==","mode":420,"size":229},".nycrc":{"checkedAt":1794532097656,"integrity":"sha512-2vm1RFz8Ajl/OYrfoCWPJIm3Bpnf7Gyn5bha/lZx/cq+We3uMy9xj15XeP6x4wF3jf/pO7KMHAkU9mllm605xg==","mode":420,"size":139},"index.js":{"checkedAt":1794532097656,"integrity":"sha512-oEOpdE3pSFkRet8+y2nQ2n9K7poZ4ky5+CxE/ihPdmIFk18LIMY7GAJA2LqXxCNtghYIT4pA6LWLoCbjuSppYw==","mode":420,"size":228},"test/index.js":{"checkedAt":1794532097656,"integrity":"sha512-RBl6NG6QkZg15ApGeJlAxWDHY1xcwEexBmaj64de76BNfhJRz4Fk+yqKpBHk52EvlnCjy/PJ6xZwVxp1CybhhQ==","mode":420,"size":1165},"legacy.js":{"checkedAt":1794532097656,"integrity":"sha512-UzrpQORMP+aToEJ6H5WsFTThH4FWlkAfOMxLuW9f35GZMSf+W3DZrzm2vfYvYx7/cgb7gACEMF/EwhH+eAF1bQ==","mode":420,"size":380},"package.json":{"checkedAt":1794532097656,"integrity":"sha512-iPXtFQJDY6A/JtgmiLmHNXN4fwopdYS5GIiQJ9ogkYyVWzMSRHW4VTiF0SJjwYh650J4tT/9qinECDbx6yFjrw==","mode":420,"size":2350},"tsconfig.json":{"checkedAt":1794532097657,"integrity":"sha512-NbUb3qW9MICwZdeqct5d4Wxdg5xq+GcfgyXTW2n32l2aXVPFPDjM2890hHzAu/PQbh7KAUFaFUb/1VgXR7FDSg==","mode":420,"size":116},"CHANGELOG.md":{"checkedAt":1794532097657,"integrity":"sha512-BL/clEgxYmHA0lTJks5cr+5WCXhoEJUFOAfpjkK5fVIXBIKPS7lQuSYpq7mJ06Nokw2Vl2zQaVCmCTl76PE1VA==","mode":420,"size":1345},"LICENSE.md":{"checkedAt":1794532097657,"integrity":"sha512-fIMD2siQj0msjMDnjPxGVNpd2ygs4OlofT4IYbo+JqfAvXqUGK2kPRRFYIpVr6OEWb2uSvzDou3nv1OQa6PmuQ==","mode":420,"size":1070},"README.md":{"checkedAt":1794532097657,"integrity":"sha512-l+DV3cdHFI5uA6MayiSRKdIHtFAah4wWw0HDlUYsBqnC494cOFa9HFAl10T9GOSTS1ChKJtlnbCwEKF3f3xvuw==","mode":420,"size":1989},"index.mjs":{"checkedAt":1794532097657,"integrity":"sha512-B5jmX39x8zsdnr1dfGxP7fJiNQnUKe97xU0f0e7TCZpA740oir383o9hrKY2Ew1im3ZTdSJf9QaVtd07Nz83yg==","mode":420,"size":132},"require.mjs":{"checkedAt":1794532097657,"integrity":"sha512-1fnfP5RbfaeEL36mT8cFWnZ3CkDZ8bTqLcLG2H1cLRus8dITTd3vgnqaJoZJztXtWbmASoTDkFVEtj3m/6adSA==","mode":420,"size":139},"index.d.mts":{"checkedAt":1794532097658,"integrity":"sha512-FkjLCvcMWc3KFyXw2nMD1dc5S6IdA8kU7idC6iYYQNuMvsh+JcHUmphGs/mVEkg3Uyk2zWkcygS1qvhsWGcBFw==","mode":420,"size":97},"index.d.ts":{"checkedAt":1794532097658,"integrity":"sha512-qGqUf1MqhLcXRV929OQnXPCqcvJAjsBsoH8G9mQwDsKcspbKZcH5bw7etoh4vfZv2204RJHpJsdQBtcwocIL/Q==","mode":420,"size":110},".github/FUNDING.yml":{"checkedAt":1794532097658,"integrity":"sha512-5LQkUydqD0TThLi0f5olNRhuydtgTi2eSZMCtMyngxcx6SOgXTA9qq1Q/qI2MFIH27LDG3i2Qqlim439dHVLDQ==","mode":420,"size":589}}}
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const getType = require("./getType.js");
function isAsyncFunction(value) {
return getType.getType(value) === "AsyncFunction";
}
exports.isAsyncFunction = isAsyncFunction;
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('lastIndexOf', require('../lastIndexOf'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,177 @@
## ASN1js
[![License](https://img.shields.io/badge/license-BSD-green.svg?style=flat)](https://raw.githubusercontent.com/PeculiarVentures/ASN1.js/master/LICENSE) [![Test](https://github.com/PeculiarVentures/ASN1.js/actions/workflows/test.yml/badge.svg)](https://github.com/PeculiarVentures/ASN1.js/actions/workflows/test.yml) [![NPM version](https://badge.fury.io/js/asn1js.svg)](http://badge.fury.io/js/asn1js) [![Coverage Status](https://coveralls.io/repos/github/PeculiarVentures/ASN1.js/badge.svg?branch=master)](https://coveralls.io/github/PeculiarVentures/ASN1.js?branch=master)
[![NPM](https://nodei.co/npm-dl/asn1js.png?months=3&height=2)](https://nodei.co/npm/asn1js/)
Abstract Syntax Notation One (ASN.1) is a standard and notation that describes rules and structures for representing, encoding, transmitting, and decoding data in telecommunications and computer networking. [ASN1js] is a pure JavaScript library implementing this standard. ASN.1 is the basis of all X.509 related data structures and numerous other protocols used on the web.
## Important Information for ASN1.js V1 Users
ASN1.js V2 (ES2015 version) is **incompatible** with ASN1.js V1 code.
## Introduction
[ASN1js] is the first library for [BER] encoding/decoding in Javascript designed for browser use. [BER] is the basic encoding rules for [ASN.1] that all others are based on, [DER] is the encoding rules used by PKI applications - it is a subset of [BER]. The [ASN1js] library was tested against [freely available ASN.1:2008 test suite], with some limitations related to JavaScript language.
## Features of the library
* Based on latest features of JavaScript language from ES2015 standard;
* [ASN1js] is a "base layer" for full-featured JS library [PKIjs], which is using Web Cryptography API and has all classes, necessary to work with PKI-related data;
* Fully object-oriented library. Inheritance is using everywhere inside the lib;
* Working with HTML5 data objects (ArrayBuffer, Uint8Array etc.);
* Working with all ASN.1:2008 types;
* Working with [BER] encoded data;
* All types inside the library constantly stores information about all ASN.1 sub blocks (tag block, length block or value block);
* User may have access to any byte inside any ASN.1 sub-block;
* Any sub-block may have unlimited length, as it described in ASN.1 standard (even "tag block");
* Ability to work with ASN.1 string date types (including all "international" strings like UniversalString, BMPString, UTF8String) by passing native JavaScript strings into constructors. And vice versa - all initially parsed data of ASN.1 string types right after decoding automatically converts into native JavaScript strings;
* Same with ASN.1 date-time types: for major types like UTCTime and GeneralizedTime there are automatic conversion between "JS date type - ASN.1 date-time type" + vice versa;
* Same with ASN.1 OBJECT-IDENTIFIER (OID) data-type: you can initialize OID by JavaScript string and can get string representation via calling "oid.valueBlock.toString()";
* Working with "easy-to-understand" ASN.1 schemas (pre-defined or built by user);
* Has special types to work with ASN.1 schemas:
* Any
* Choice
* Repeated
* User can name any block inside ASN.1 schema and easily get information by name;
* Ability to parse internal data inside a primitively encoded data types and automatically validate it against special schema;
* All types inside library are dynamic;
* All types can be initialized in static or dynamic ways.
* [ASN1js] fully tested against [ASN.1:2008 TestSuite].
## Examples
### How to create new ASN. structures
```javascript
var sequence = new asn1js.Sequence();
sequence.valueBlock.value.push(new asn1js.Integer({ value: 1 }));
var sequence_buffer = sequence.toBER(false); // Encode current sequence to BER (in ArrayBuffer)
var current_size = sequence_buffer.byteLength;
var integer_data = new ArrayBuffer(8);
var integer_view = new Uint8Array(integer_data);
integer_view[0] = 0x01;
integer_view[1] = 0x01;
integer_view[2] = 0x01;
integer_view[3] = 0x01;
integer_view[4] = 0x01;
integer_view[5] = 0x01;
integer_view[6] = 0x01;
integer_view[7] = 0x01;
sequence.valueBlock.value.push(new asn1js.Integer({
isHexOnly: true,
valueHex: integer_data,
})); // Put too long for decoding Integer value
sequence_buffer = sequence.toBER();
current_size = sequence_buffer.byteLength;
```
### How to create new ASN.1 structures by calling constructors with parameters
```javascript
var sequence2 = new asn1js.Sequence({
value: [
new asn1js.Integer({ value: 1 }),
new asn1js.Integer({
isHexOnly: true,
valueHex: integer_data
}),
]
});
```
### How to validate ASN.1 against pre-defined schema
```javascript
var asn1_schema = new asn1js.Sequence({
name: "block1",
value: [
new asn1js.Null({
name: "block2"
}),
new asn1js.Integer({
name: "block3",
optional: true // This block is absent inside data, but it's "optional". Hence verification against the schema will be passed.
})
]
});
var variant1 = org.pkijs.verifySchema(encoded_sequence, asn1_schema); // Verify schema together with decoding of raw data
var variant1_verified = variant1.verified;
var variant1_result = variant1.result; // Verified decoded data with all block names inside
```
### How to use "internal schemas" for primitively encoded data types
```javascript
var primitive_octetstring = new asn1js.OctetString({ valueHex: encoded_sequence }); // Create a primitively encoded OctetString where internal data is an encoded Sequence
var asn1_schema_internal = new asn1js.OctetString({
name: "outer_block",
primitiveSchema: new asn1js.Sequence({
name: "block1",
value: [
new asn1js.Null({
name: "block2"
})
]
})
});
var variant6 = org.pkijs.compareSchema(primitive_octetstring, primitive_octetstring, asn1_schema_internal);
var variant6_verified = variant4.verified;
var variant6_block1_tag_num = variant6.result.block1.idBlock.tagNumber;
var variant6_block2_tag_num = variant6.result.block2.idBlock.tagNumber;
```
More examples could be found in "examples" directory or inside [PKIjs] library.
## Related source code
* [C++ ASN1:2008 BER coder/decoder](https://github.com/YuryStrozhevsky/C-plus-plus-ASN.1-2008-coder-decoder) - the "father" of [ASN1js] project;
* [Freely available ASN.1:2008 test suite](https://github.com/YuryStrozhevsky/ASN1-2008-free-test-suite) - the suite which can help you to validate (and better understand) any ASN.1 coder/decoder;
* [NPM package for ASN.1:2008 test suite](https://github.com/YuryStrozhevsky/asn1-test-suite)
## Suitability
There are several commercial products, enterprise solutions as well as open source project based on versions of ASN1js. You should, however, do your own code and security review before utilization in a production application before utilizing any open source library to ensure it will meet your needs.
## License
Copyright (c) 2014, [GMO GlobalSign](http://www.globalsign.com/)
Copyright (c) 2015-2022, [Peculiar Ventures](http://peculiarventures.com/)
All rights reserved.
Author 2014-2018, [Yury Strozhevsky](http://www.strozhevsky.com/).
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
[ASN.1]: http://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One
[ASN1js]: http://asn1js.org/
[PKIjs]: http://pkijs.org/
[BER]: http://en.wikipedia.org/wiki/X.690#BER_encoding
[DER]: http://en.wikipedia.org/wiki/X.690#DER_encoding
[freely available ASN.1:2008 test suite]: http://www.strozhevsky.com/free_docs/free_asn1_testsuite_descr.pdf
[ASN.1:2008 TestSuite]: https://github.com/YuryStrozhevsky/asn1-test-suite
@@ -0,0 +1,748 @@
/*!
* router
* Copyright(c) 2013 Roman Shtylman
* Copyright(c) 2014-2022 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module dependencies.
* @private
*/
const isPromise = require('is-promise')
const Layer = require('./lib/layer')
const { METHODS } = require('node:http')
const parseUrl = require('parseurl')
const Route = require('./lib/route')
const debug = require('debug')('router')
const deprecate = require('depd')('router')
/**
* Module variables.
* @private
*/
const slice = Array.prototype.slice
const flatten = Array.prototype.flat
const methods = METHODS.map((method) => method.toLowerCase())
/**
* Expose `Router`.
*/
module.exports = Router
/**
* Expose `Route`.
*/
module.exports.Route = Route
/**
* Initialize a new `Router` with the given `options`.
*
* @param {object} [options]
* @return {Router} which is a callable function
* @public
*/
function Router (options) {
if (!(this instanceof Router)) {
return new Router(options)
}
const opts = options || {}
function router (req, res, next) {
router.handle(req, res, next)
}
// inherit from the correct prototype
Object.setPrototypeOf(router, this)
router.caseSensitive = opts.caseSensitive
router.mergeParams = opts.mergeParams
router.params = {}
router.strict = opts.strict
router.stack = []
return router
}
/**
* Router prototype inherits from a Function.
*/
/* istanbul ignore next */
Router.prototype = function () {}
/**
* Map the given param placeholder `name`(s) to the given callback.
*
* Parameter mapping is used to provide pre-conditions to routes
* which use normalized placeholders. For example a _:user_id_ parameter
* could automatically load a user's information from the database without
* any additional code.
*
* The callback uses the same signature as middleware, the only difference
* being that the value of the placeholder is passed, in this case the _id_
* of the user. Once the `next()` function is invoked, just like middleware
* it will continue on to execute the route, or subsequent parameter functions.
*
* Just like in middleware, you must either respond to the request or call next
* to avoid stalling the request.
*
* router.param('user_id', function(req, res, next, id){
* User.find(id, function(err, user){
* if (err) {
* return next(err)
* } else if (!user) {
* return next(new Error('failed to load user'))
* }
* req.user = user
* next()
* })
* })
*
* @param {string} name
* @param {function} fn
* @public
*/
Router.prototype.param = function param (name, fn) {
if (!name) {
throw new TypeError('argument name is required')
}
if (typeof name !== 'string') {
throw new TypeError('argument name must be a string')
}
if (!fn) {
throw new TypeError('argument fn is required')
}
if (typeof fn !== 'function') {
throw new TypeError('argument fn must be a function')
}
let params = this.params[name]
if (!params) {
params = this.params[name] = []
}
params.push(fn)
return this
}
/**
* Dispatch a req, res into the router.
*
* @private
*/
Router.prototype.handle = function handle (req, res, callback) {
if (!callback) {
throw new TypeError('argument callback is required')
}
debug('dispatching %s %s', req.method, req.url)
let idx = 0
let methods
const protohost = getProtohost(req.url) || ''
let removed = ''
const self = this
let slashAdded = false
let sync = 0
const paramcalled = {}
// middleware and routes
const stack = this.stack
// manage inter-router variables
const parentParams = req.params
const parentUrl = req.baseUrl || ''
let done = restore(callback, req, 'baseUrl', 'next', 'params')
// setup next layer
req.next = next
// for options requests, respond with a default if nothing else responds
if (req.method === 'OPTIONS') {
methods = []
done = wrap(done, generateOptionsResponder(res, methods))
}
// setup basic req values
req.baseUrl = parentUrl
req.originalUrl = req.originalUrl || req.url
next()
function next (err) {
let layerError = err === 'route'
? null
: err
// remove added slash
if (slashAdded) {
req.url = req.url.slice(1)
slashAdded = false
}
// restore altered req.url
if (removed.length !== 0) {
req.baseUrl = parentUrl
req.url = protohost + removed + req.url.slice(protohost.length)
removed = ''
}
// signal to exit router
if (layerError === 'router') {
setImmediate(done, null)
return
}
// no more matching layers
if (idx >= stack.length) {
setImmediate(done, layerError)
return
}
// max sync stack
if (++sync > 100) {
return setImmediate(next, err)
}
// get pathname of request
const path = getPathname(req)
if (path == null) {
return done(layerError)
}
// find next matching layer
let layer
let match
let route
while (match !== true && idx < stack.length) {
layer = stack[idx++]
match = matchLayer(layer, path)
route = layer.route
if (typeof match !== 'boolean') {
// hold on to layerError
layerError = layerError || match
}
if (match !== true) {
continue
}
if (!route) {
// process non-route handlers normally
continue
}
if (layerError) {
// routes do not match with a pending error
match = false
continue
}
const method = req.method
const hasMethod = route._handlesMethod(method)
// build up automatic options response
if (!hasMethod && method === 'OPTIONS' && methods) {
methods.push.apply(methods, route._methods())
}
// don't even bother matching route
if (!hasMethod && method !== 'HEAD') {
match = false
}
}
// no match
if (match !== true) {
return done(layerError)
}
// store route for dispatch on change
if (route) {
req.route = route
}
// Capture one-time layer values
req.params = self.mergeParams
? mergeParams(layer.params, parentParams)
: layer.params
const layerPath = layer.path
// this should be done for the layer
processParams(self.params, layer, paramcalled, req, res, function (err) {
if (err) {
next(layerError || err)
} else if (route) {
layer.handleRequest(req, res, next)
} else {
trimPrefix(layer, layerError, layerPath, path)
}
sync = 0
})
}
function trimPrefix (layer, layerError, layerPath, path) {
if (layerPath.length !== 0) {
// Validate path is a prefix match
if (layerPath !== path.substring(0, layerPath.length)) {
next(layerError)
return
}
// Validate path breaks on a path separator
const c = path[layerPath.length]
if (c && c !== '/') {
next(layerError)
return
}
// Trim off the part of the url that matches the route
// middleware (.use stuff) needs to have the path stripped
debug('trim prefix (%s) from url %s', layerPath, req.url)
removed = layerPath
req.url = protohost + req.url.slice(protohost.length + removed.length)
// Ensure leading slash
if (!protohost && req.url[0] !== '/') {
req.url = '/' + req.url
slashAdded = true
}
// Setup base URL (no trailing slash)
req.baseUrl = parentUrl + (removed[removed.length - 1] === '/'
? removed.substring(0, removed.length - 1)
: removed)
}
debug('%s %s : %s', layer.name, layerPath, req.originalUrl)
if (layerError) {
layer.handleError(layerError, req, res, next)
} else {
layer.handleRequest(req, res, next)
}
}
}
/**
* Use the given middleware function, with optional path, defaulting to "/".
*
* Use (like `.all`) will run for any http METHOD, but it will not add
* handlers for those methods so OPTIONS requests will not consider `.use`
* functions even if they could respond.
*
* The other difference is that _route_ path is stripped and not visible
* to the handler function. The main effect of this feature is that mounted
* handlers can operate without any code changes regardless of the "prefix"
* pathname.
*
* @public
*/
Router.prototype.use = function use (handler) {
let offset = 0
let path = '/'
// default path to '/'
// disambiguate router.use([handler])
if (typeof handler !== 'function') {
let arg = handler
while (Array.isArray(arg) && arg.length !== 0) {
arg = arg[0]
}
// first arg is the path
if (typeof arg !== 'function') {
offset = 1
path = handler
}
}
const callbacks = flatten.call(slice.call(arguments, offset), Infinity)
if (callbacks.length === 0) {
throw new TypeError('argument handler is required')
}
for (let i = 0; i < callbacks.length; i++) {
const fn = callbacks[i]
if (typeof fn !== 'function') {
throw new TypeError('argument handler must be a function')
}
// add the middleware
debug('use %o %s', path, fn.name || '<anonymous>')
const layer = new Layer(path, {
sensitive: this.caseSensitive,
strict: false,
end: false
}, fn)
layer.route = undefined
this.stack.push(layer)
}
return this
}
/**
* Create a new Route for the given path.
*
* Each route contains a separate middleware stack and VERB handlers.
*
* See the Route api documentation for details on adding handlers
* and middleware to routes.
*
* @param {string} path
* @return {Route}
* @public
*/
Router.prototype.route = function route (path) {
const route = new Route(path)
const layer = new Layer(path, {
sensitive: this.caseSensitive,
strict: this.strict,
end: true
}, handle)
function handle (req, res, next) {
route.dispatch(req, res, next)
}
layer.route = route
this.stack.push(layer)
return route
}
// create Router#VERB functions
methods.concat('all').forEach(function (method) {
Router.prototype[method] = function (path) {
const route = this.route(path)
route[method].apply(route, slice.call(arguments, 1))
return this
}
})
/**
* Generate a callback that will make an OPTIONS response.
*
* @param {OutgoingMessage} res
* @param {array} methods
* @private
*/
function generateOptionsResponder (res, methods) {
return function onDone (fn, err) {
if (err || methods.length === 0) {
return fn(err)
}
trySendOptionsResponse(res, methods, fn)
}
}
/**
* Get pathname of request.
*
* @param {IncomingMessage} req
* @private
*/
function getPathname (req) {
try {
return parseUrl(req).pathname
} catch (err) {
return undefined
}
}
/**
* Get get protocol + host for a URL.
*
* @param {string} url
* @private
*/
function getProtohost (url) {
if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {
return undefined
}
const searchIndex = url.indexOf('?')
const pathLength = searchIndex !== -1
? searchIndex
: url.length
const fqdnIndex = url.substring(0, pathLength).indexOf('://')
return fqdnIndex !== -1
? url.substring(0, url.indexOf('/', 3 + fqdnIndex))
: undefined
}
/**
* Match path to a layer.
*
* @param {Layer} layer
* @param {string} path
* @private
*/
function matchLayer (layer, path) {
try {
return layer.match(path)
} catch (err) {
return err
}
}
/**
* Merge params with parent params
*
* @private
*/
function mergeParams (params, parent) {
if (typeof parent !== 'object' || !parent) {
return params
}
// make copy of parent for base
const obj = Object.assign({}, parent)
// simple non-numeric merging
if (!(0 in params) || !(0 in parent)) {
return Object.assign(obj, params)
}
let i = 0
let o = 0
// determine numeric gap in params
while (i in params) {
i++
}
// determine numeric gap in parent
while (o in parent) {
o++
}
// offset numeric indices in params before merge
for (i--; i >= 0; i--) {
params[i + o] = params[i]
// create holes for the merge when necessary
if (i < o) {
delete params[i]
}
}
return Object.assign(obj, params)
}
/**
* Process any parameters for the layer.
*
* @private
*/
function processParams (params, layer, called, req, res, done) {
// captured parameters from the layer, keys and values
const keys = layer.keys
// fast track
if (!keys || keys.length === 0) {
return done()
}
let i = 0
let paramIndex = 0
let key
let paramVal
let paramCallbacks
let paramCalled
// process params in order
// param callbacks can be async
function param (err) {
if (err) {
return done(err)
}
if (i >= keys.length) {
return done()
}
paramIndex = 0
key = keys[i++]
paramVal = req.params[key]
paramCallbacks = params[key]
paramCalled = called[key]
if (paramVal === undefined || !paramCallbacks) {
return param()
}
// param previously called with same value or error occurred
if (paramCalled && (paramCalled.match === paramVal ||
(paramCalled.error && paramCalled.error !== 'route'))) {
// restore value
req.params[key] = paramCalled.value
// next param
return param(paramCalled.error)
}
called[key] = paramCalled = {
error: null,
match: paramVal,
value: paramVal
}
paramCallback()
}
// single param callbacks
function paramCallback (err) {
const fn = paramCallbacks[paramIndex++]
// store updated value
paramCalled.value = req.params[key]
if (err) {
// store error
paramCalled.error = err
param(err)
return
}
if (!fn) return param()
try {
const ret = fn(req, res, paramCallback, paramVal, key)
if (isPromise(ret)) {
if (!(ret instanceof Promise)) {
deprecate('parameters that are Promise-like are deprecated, use a native Promise instead')
}
ret.then(null, function (error) {
paramCallback(error || new Error('Rejected promise'))
})
}
} catch (e) {
paramCallback(e)
}
}
param()
}
/**
* Restore obj props after function
*
* @private
*/
function restore (fn, obj) {
const props = new Array(arguments.length - 2)
const vals = new Array(arguments.length - 2)
for (let i = 0; i < props.length; i++) {
props[i] = arguments[i + 2]
vals[i] = obj[props[i]]
}
return function () {
// restore vals
for (let i = 0; i < props.length; i++) {
obj[props[i]] = vals[i]
}
return fn.apply(this, arguments)
}
}
/**
* Send an OPTIONS response.
*
* @private
*/
function sendOptionsResponse (res, methods) {
const options = Object.create(null)
// build unique method map
for (let i = 0; i < methods.length; i++) {
options[methods[i]] = true
}
// construct the allow list
const allow = Object.keys(options).sort().join(', ')
// send response
res.setHeader('Allow', allow)
res.setHeader('Content-Length', Buffer.byteLength(allow))
res.setHeader('Content-Type', 'text/plain')
res.setHeader('X-Content-Type-Options', 'nosniff')
res.end(allow)
}
/**
* Try to send an OPTIONS response.
*
* @private
*/
function trySendOptionsResponse (res, methods, next) {
try {
sendOptionsResponse(res, methods)
} catch (err) {
next(err)
}
}
/**
* Wrap a function
*
* @private
*/
function wrap (old, fn) {
return function proxy () {
const args = new Array(arguments.length + 1)
args[0] = old
for (let i = 0, len = arguments.length; i < len; i++) {
args[i + 1] = arguments[i]
}
fn.apply(this, args)
}
}
@@ -0,0 +1,88 @@
import test from 'tape';
import isDisabledElement from '../../../src/util/isDisabledElement';
import JSXAttributeMock from '../../../__mocks__/JSXAttributeMock';
test('isDisabledElement', (t) => {
t.test('HTML5', (st) => {
st.equal(
isDisabledElement([
JSXAttributeMock('disabled', 'disabled'),
]),
true,
'identifies HTML5 disabled elements',
);
st.equal(
isDisabledElement([
JSXAttributeMock('disabled', null),
]),
true,
'identifies HTML5 disabled elements with null as the value',
);
st.equal(
isDisabledElement([
JSXAttributeMock('disabled', undefined),
]),
false,
'does not identify HTML5 disabled elements with undefined as the value',
);
st.end();
});
t.test('ARIA', (st) => {
st.equal(
isDisabledElement([
JSXAttributeMock('aria-disabled', 'true'),
]),
true,
'does not identify ARIA disabled elements',
);
st.equal(
isDisabledElement([
JSXAttributeMock('aria-disabled', true),
]),
true,
'does not identify ARIA disabled elements',
);
st.equal(
isDisabledElement([
JSXAttributeMock('aria-disabled', 'false'),
]),
false,
'does not identify ARIA disabled elements',
);
st.equal(
isDisabledElement([
JSXAttributeMock('aria-disabled', false),
]),
false,
'does not identify ARIA disabled elements',
);
st.equal(
isDisabledElement([
JSXAttributeMock('aria-disabled', null),
]),
false,
'does not identify ARIA disabled elements with null as the value',
);
st.equal(
isDisabledElement([
JSXAttributeMock('aria-disabled', undefined),
]),
false,
'does not identify ARIA disabled elements with undefined as the value',
);
st.end();
});
t.end();
});
@@ -0,0 +1,14 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}
{{
var $regexp = $isData
? '(new RegExp(' + $schemaValue + '))'
: it.usePattern($schema);
}}
if ({{# def.$dataNotType:'string' }} !{{=$regexp}}.test({{=$data}}) ) {
{{# def.error:'pattern' }}
} {{? $breakOnError }} else { {{?}}
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../../src/index.ts"],
"sourcesContent": ["/**\n * @module LRUCache\n */\n\n// module-private names and types\ntype Perf = { now: () => number }\nconst perf: Perf =\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ? performance\n : Date\n\nconst warned = new Set<string>()\n\n// either a function or a class\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ? process : {}\n) as { [k: string]: any }\n/* c8 ignore start */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC\n) => {\n typeof PROCESS.emitWarning === 'function'\n ? PROCESS.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`)\n}\n\nlet AC = globalThis.AbortController\nlet AS = globalThis.AbortSignal\n\n/* c8 ignore start */\nif (typeof AC === 'undefined') {\n //@ts-ignore\n AS = class AbortSignal {\n onabort?: (...a: any[]) => any\n _onabort: ((...a: any[]) => any)[] = []\n reason?: any\n aborted: boolean = false\n addEventListener(_: string, fn: (...a: any[]) => any) {\n this._onabort.push(fn)\n }\n }\n //@ts-ignore\n AC = class AbortController {\n constructor() {\n warnACPolyfill()\n }\n signal = new AS()\n abort(reason: any) {\n if (this.signal.aborted) return\n //@ts-ignore\n this.signal.reason = reason\n //@ts-ignore\n this.signal.aborted = true\n //@ts-ignore\n for (const fn of this.signal._onabort) {\n fn(reason)\n }\n this.signal.onabort?.(reason)\n }\n }\n let printACPolyfillWarning =\n PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1'\n const warnACPolyfill = () => {\n if (!printACPolyfillWarning) return\n printACPolyfillWarning = false\n emitWarning(\n 'AbortController is not defined. If using lru-cache in ' +\n 'node 14, load an AbortController polyfill from the ' +\n '`node-abort-controller` package. A minimal polyfill is ' +\n 'provided for use by LRUCache.fetch(), but it should not be ' +\n 'relied upon in other contexts (eg, passing it to other APIs that ' +\n 'use AbortController/AbortSignal might have undesirable effects). ' +\n 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.',\n 'NO_ABORT_CONTROLLER',\n 'ENOTSUP',\n warnACPolyfill\n )\n }\n}\n/* c8 ignore stop */\n\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: any): n is PosInt =>\n n && n === Math.floor(n) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max: number) =>\n !isPosInt(max)\n ? null\n : max <= Math.pow(2, 8)\n ? Uint8Array\n : max <= Math.pow(2, 16)\n ? Uint16Array\n : max <= Math.pow(2, 32)\n ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER\n ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array<number> {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n heap: NumberArray\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(\n max: number,\n HeapCls: { new (n: number): NumberArray }\n ) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch<V> = Promise<V | undefined> & {\n __returned: BackgroundFetch<V> | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport typLine truncated
"mappings": "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 truncated
"names": ["perf", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "AC", "AS", "_", "warnACPolyfill", "reason", "printACPolyfillWarning", "shouldWarn", "TYPE", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "_Stack", "HeapCls", "__privateSet", "_constructing", "s", "__privateGet", "Stack", "__privateAdd", "LRUCache", "#max", "#maxSize", "#dispose", "#disposeAfter", "#fetchMethod", "#memoMethod", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "key", "ttls", "starts", "#setItemTTL", "start", "t", "#delete", "#updateItemAge", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "getOptions", "value", "thisp", "deleted", "entry", "remain", "arr", "setOptions", "oldVal", "oldValue", "dt", "task", "val", "free", "head", "hasOptions", "peekOptions", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "fetchFail", "bf", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "forceRefresh", "stale", "isStale", "staleVal", "memoOptions", "vv", "fetching", "#connect", "#clear", "pi", "ni"]
}
@@ -0,0 +1,3 @@
import type { ModuleOptions } from '../utils/index.js';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noAllowed", [(ModuleOptions | undefined)?], import("../utils/create-rule.ts").ImportXPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
export default _default;
@@ -0,0 +1,2 @@
import type { Token } from "../parser/tokenizer";
export default function formatTokens(code: string, tokens: Array<Token>): string;
@@ -0,0 +1,21 @@
import {
tv
} from "./chunk-UWE6H66T.mjs";
// src/components/divider.ts
var divider = tv({
base: "shrink-0 bg-divider border-none",
variants: {
orientation: {
horizontal: "w-full h-divider",
vertical: "h-full w-divider"
}
},
defaultVariants: {
orientation: "horizontal"
}
});
export {
divider
};
@@ -0,0 +1,14 @@
'use strict';
var $TypeError = require('es-errors/type');
var NumberBitwiseOp = require('../NumberBitwiseOp');
// https://262.ecma-international.org/11.0/#sec-numeric-types-number-bitwiseXOR
module.exports = function NumberBitwiseXOR(x, y) {
if (typeof x !== 'number' || typeof y !== 'number') {
throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers');
}
return NumberBitwiseOp('^', x, y);
};
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=container_module.int.spec.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"plan.spec.d.ts","sourceRoot":"","sources":["../../../../src/planning/actions/plan.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,600 @@
flf2a 1 1 2 -1 13 0 0 242
Terminal by Glenn Chappell 4/93
Includes characters 128-255
Enhanced for Latin-2,3,4 by John Cowan <cowan@ccil.org>
Latin character sets supported only if your screen font does
figlet release 2.2 -- November 1996
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
Double-checked by Paul Burton <solution@earthlink.net> 12/96. Added the new
parameter supported by FIGlet and FIGWin. Unlike all other FIGfonts, this one
is intended to produce output exactly the same as the input unless a control
file is used. Therefore it produces the SAME output for smush, kern or fit.
@
!@
"@
#@
$@
%@
&@
'@
(@
)@
*@
+@
,@
-@
.@
/@
0@
1@
2@
3@
4@
5@
6@
7@
8@
9@
:@
;@
<@
=@
>@
?@
@#
A@
B@
C@
D@
E@
F@
G@
H@
I@
J@
K@
L@
M@
N@
O@
P@
Q@
R@
S@
T@
U@
V@
W@
X@
Y@
Z@
[@
\@
]@
^@
_@
`@
a@
b@
c@
d@
e@
f@
g@
h@
i@
j@
k@
l@
m@
n@
o@
p@
q@
r@
s@
t@
u@
v@
w@
x@
y@
z@
{@
|@
}@
~@
願
淐
軹
裰
蠩
廹
稛
128
�@
129
�
130
�
131
�
132
�
133
�
134
�
135
䏰
136
㇀
137
𪎩
138
𧶄
139
𣏴
140
倻
141
𠮟
142
𣻗
143
蕋
144
趩
145
𥜆
146
𡏆
147
媁
148
銉
149
𦅜
150
桇
151
愌
152
𦴦
153
䄉
154
鋣
155
𡨭
156
嵛
157
𨆉
158
𠺢
159
籖
160 NO-BREAK SPACE
𨩚
161 INVERTED EXCLAMATION MARK
 
162 CENT SIGN
\
163 POUND SIGN
w
164 CURRENCY SIGN
一
165 YEN SIGN
世
166 BROKEN BAR
共
167 SECTION SIGN
作
168 DIAERESIS
杓
169 COPYRIGHT SIGN
咖
170 FEMININE ORDINAL INDICATOR
昇
171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
陂
172 NOT SIGN
拯
173 SOFT HYPHEN
耐
174 REGISTERED SIGN
哦
175 MACRON
浬
176 DEGREE SIGN
虔
177 PLUS-MINUS SIGN
娼
178 SUPERSCRIPT TWO
毫
179 SUPERSCRIPT THREE
莆
180 ACUTE ACCENT
婷
181 MICRO SIGN
溉
182 PILCROW SIGN
詔
183 MIDDLE DOT
媳
184 CEDILLA
睹
185 SUPERSCRIPT ONE
辟
186 MASCULINE ORDINAL INDICATOR
愿
187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
罰
188 VULGAR FRACTION ONE QUARTER
劇
189 VULGAR FRACTION ONE HALF
瑾
190 VULGAR FRACTION THREE QUARTERS
輥
191 INVERTED QUESTION MARK
濃
192 LATIN CAPITAL LETTER A WITH GRAVE
錐
193 LATIN CAPITAL LETTER A WITH ACUTE
瞧
194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
駿
195 LATIN CAPITAL LETTER A WITH TILDE
鞭
196 LATIN CAPITAL LETTER A WITH DIAERESIS
願
197 LATIN CAPITAL LETTER A WITH RING ABOVE
護
198 LATIN CAPITAL LETTER AE
讖
199 LATIN CAPITAL LETTER C WITH CEDILLA
す
200 LATIN CAPITAL LETTER E WITH GRAVE
Л
201 LATIN CAPITAL LETTER E WITH ACUTE
乂
202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX
汌
203 LATIN CAPITAL LETTER E WITH DIAERESIS
杙
204 LATIN CAPITAL LETTER I WITH GRAVE
坨
205 LATIN CAPITAL LETTER I WITH ACUTE
泒
206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX
哃
207 LATIN CAPITAL LETTER I WITH DIAERESIS
柜
208 LATIN CAPITAL LETTER ETH
穾
209 LATIN CAPITAL LETTER N WITH TILDE
唊
210 LATIN CAPITAL LETTER O WITH GRAVE
毨
211 LATIN CAPITAL LETTER O WITH ACUTE
笄
212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
酎
213 LATIN CAPITAL LETTER O WITH TILDE
崰
214 LATIN CAPITAL LETTER O WITH DIAERESIS
淐
215 MULTIPLICATION SIGN
耞
216 LATIN CAPITAL LETTER O WITH STROKE
釫
217 LATIN CAPITAL LETTER U WITH GRAVE
惲
218 LATIN CAPITAL LETTER U WITH ACUTE
湨
219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX
罦
220 LATIN CAPITAL LETTER U WITH DIAERESIS
軹
221 LATIN CAPITAL LETTER Y WITH ACUTE
媷
222 LATIN CAPITAL LETTER THORN
毹
223 LATIN SMALL LETTER SHARP S
稛
224 LATIN SMALL LETTER A WITH GRAVE
觡
225 LATIN SMALL LETTER A WITH ACUTE
凘
226 LATIN SMALL LETTER A WITH CIRCUMFLEX
榠
227 LATIN SMALL LETTER A WITH TILDE
禗
228 LATIN SMALL LETTER A WITH DIAERESIS
裰
229 LATIN SMALL LETTER A WITH RING ABOVE
噚
230 LATIN SMALL LETTER AE
澍
231 LATIN SMALL LETTER C WITH CEDILLA
膞
232 LATIN SMALL LETTER E WITH GRAVE
踔
233 LATIN SMALL LETTER E WITH ACUTE
噳
234 LATIN SMALL LETTER E WITH CIRCUMFLEX
澢
235 LATIN SMALL LETTER E WITH DIAERESIS
蕀
236 LATIN SMALL LETTER I WITH GRAVE
錋
237 LATIN SMALL LETTER I WITH ACUTE
檕
238 LATIN SMALL LETTER I WITH CIRCUMFLEX
蕷
239 LATIN SMALL LETTER I WITH DIAERESIS
鞞
240 LATIN SMALL LETTER ETH
璸
241 LATIN SMALL LETTER N WITH TILDE
蹛
242 LATIN SMALL LETTER O WITH GRAVE
徿
243 LATIN SMALL LETTER O WITH ACUTE
譑
244 LATIN SMALL LETTER O WITH CIRCUMFLEX
嚵
245 LATIN SMALL LETTER O WITH TILDE
鏼
246 LATIN SMALL LETTER O WITH DIAERESIS
蠩
247 DIVISION SIGN
糴
248 LATIN SMALL LETTER O WITH STROKE
讌
249 LATIN SMALL LETTER U WITH GRAVE
纘
250 LATIN SMALL LETTER U WITH ACUTE
𠕇
251 LATIN SMALL LETTER U WITH CIRCUMFLEX
𨦼
252 LATIN SMALL LETTER U WITH DIAERESIS
廹
253 LATIN SMALL LETTER Y WITH ACUTE
𣑯
254 LATIN SMALL LETTER THORN
鑂
255 LATIN SMALL LETTER Y WITH DIAERESIS
�@
0x0100 LATIN CAPITAL LETTER A WITH MACRON
錐
0x0101 LATIN SMALL LETTER A WITH MACRON
觡
0x0102 LATIN CAPITAL LETTER A WITH BREVE
鞭
0x0103 LATIN SMALL LETTER A WITH BREVE
禗
0x0104 LATIN CAPITAL LETTER A WITH OGONEK
 
0x0105 LATIN SMALL LETTER A WITH OGONEK
娼
0x0106 LATIN CAPITAL LETTER C WITH ACUTE
讖
0x0107 LATIN SMALL LETTER C WITH ACUTE
澍
0x0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX
讖
0x0109 LATIN SMALL LETTER C WITH CIRCUMFLEX
澍
0x010A LATIN CAPITAL LETTER C WITH DOT ABOVE
護
0x010B LATIN SMALL LETTER C WITH DOT ABOVE
噚
0x010C LATIN CAPITAL LETTER C WITH CARON
Л
0x010D LATIN SMALL LETTER C WITH CARON
踔
0x010E LATIN CAPITAL LETTER D WITH CARON
柜
0x010F LATIN SMALL LETTER D WITH CARON
鞞
0x0110 LATIN CAPITAL LETTER D WITH STROKE
穾
0x0111 LATIN SMALL LETTER D WITH STROKE
璸
0x0112 LATIN CAPITAL LETTER E WITH MACRON
昇
0x0113 LATIN SMALL LETTER E WITH MACRON
愿
0x0116 LATIN CAPITAL LETTER E WITH DOT ABOVE
坨
0x0117 LATIN SMALL LETTER E WITH DOT ABOVE
錋
0x0118 LATIN CAPITAL LETTER E WITH OGONEK
汌
0x0119 LATIN SMALL LETTER E WITH OGONEK
澢
0x011A LATIN CAPITAL LETTER E WITH CARON
坨
0x011B LATIN SMALL LETTER E WITH CARON
錋
0x011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX
釫
0x011D LATIN SMALL LETTER G WITH CIRCUMFLEX
讌
0x011E LATIN CAPITAL LETTER G WITH BREVE
陂
0x011F LATIN SMALL LETTER G WITH BREVE
罰
0x0120 LATIN CAPITAL LETTER G WITH DOT ABOVE
崰
0x0121 LATIN SMALL LETTER G WITH DOT ABOVE
鏼
0x0122 LATIN CAPITAL LETTER G WITH CEDILLA
陂
0x0123 LATIN SMALL LETTER G WITH CEDILLA
罰
0x0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX
共
0x0125 LATIN SMALL LETTER H WITH CIRCUMFLEX
詔
0x0126 LATIN CAPITAL LETTER H WITH STROKE
 
0x0127 LATIN SMALL LETTER H WITH STROKE
娼
0x0128 LATIN CAPITAL LETTER I WITH TILDE
世
0x0129 LATIN SMALL LETTER I WITH TILDE
溉
0x012A LATIN CAPITAL LETTER I WITH MACRON
柜
0x012B LATIN SMALL LETTER I WITH MACRON
鞞
0x012E LATIN CAPITAL LETTER I WITH OGONEK
す
0x012F LATIN SMALL LETTER I WITH OGONEK
膞
0x0130 LATIN CAPITAL LETTER I WITH DOT ABOVE
咖
0x0131 LATIN SMALL LETTER DOTLESS I
辟
0x0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX
拯
0x0135 LATIN SMALL LETTER J WITH CIRCUMFLEX
劇
0x0136 LATIN CAPITAL LETTER K WITH CEDILLA
笄
0x0137 LATIN SMALL LETTER K WITH CEDILLA
譑
0x0138 LATIN SMALL LETTER KRA
\
0x0139 LATIN CAPITAL LETTER L WITH ACUTE
護
0x013A LATIN SMALL LETTER L WITH ACUTE
噚
0x013B LATIN CAPITAL LETTER L WITH CEDILLA
共
0x013C LATIN SMALL LETTER L WITH CEDILLA
詔
0x013D LATIN CAPITAL LETTER L WITH CARON
世
0x013E LATIN SMALL LETTER L WITH CARON
溉
0x0141 LATIN CAPITAL LETTER L WITH STROKE
w
0x0142 LATIN SMALL LETTER L WITH STROKE
莆
0x0143 LATIN CAPITAL LETTER N WITH ACUTE
唊
0x0144 LATIN SMALL LETTER N WITH ACUTE
蹛
0x0145 LATIN CAPITAL LETTER N WITH CEDILLA
唊
0x0146 LATIN SMALL LETTER N WITH CEDILLA
蹛
0x0147 LATIN CAPITAL LETTER N WITH CARON
毨
0x0148 LATIN SMALL LETTER N WITH CARON
徿
0x014A LATIN CAPITAL LETTER ENG
瑾
0x014B LATIN SMALL LETTER ENG
濃
0x014C LATIN CAPITAL LETTER O WITH MACRON
毨
0x014D LATIN SMALL LETTER O WITH MACRON
徿
0x0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
崰
0x0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE
鏼
0x0154 LATIN CAPITAL LETTER R WITH ACUTE
錐
0x0155 LATIN SMALL LETTER R WITH ACUTE
觡
0x0156 LATIN CAPITAL LETTER R WITH CEDILLA
w
0x0157 LATIN SMALL LETTER R WITH CEDILLA
莆
0x0158 LATIN CAPITAL LETTER R WITH CARON
釫
0x0159 LATIN SMALL LETTER R WITH CARON
讌
0x015A LATIN CAPITAL LETTER S WITH ACUTE
共
0x015B LATIN SMALL LETTER S WITH ACUTE
詔
0x015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX
毹
0x015D LATIN SMALL LETTER S WITH CIRCUMFLEX
鑂
0x015E LATIN CAPITAL LETTER S WITH CEDILLA
昇
0x015F LATIN SMALL LETTER S WITH CEDILLA
愿
0x0160 LATIN CAPITAL LETTER S WITH CARON
咖
0x0161 LATIN SMALL LETTER S WITH CARON
辟
0x0162 LATIN CAPITAL LETTER T WITH CEDILLA
毹
0x0163 LATIN SMALL LETTER T WITH CEDILLA
鑂
0x0164 LATIN CAPITAL LETTER T WITH CARON
陂
0x0165 LATIN SMALL LETTER T WITH CARON
罰
0x0166 LATIN CAPITAL LETTER T WITH STROKE
拯
0x0167 LATIN SMALL LETTER T WITH STROKE
劇
0x0168 LATIN CAPITAL LETTER U WITH TILDE
媷
0x0169 LATIN SMALL LETTER U WITH TILDE
𣑯
0x016A LATIN CAPITAL LETTER U WITH MACRON
毹
0x016B LATIN SMALL LETTER U WITH MACRON
鑂
0x016C LATIN CAPITAL LETTER U WITH BREVE
媷
0x016D LATIN SMALL LETTER U WITH BREVE
𣑯
0x016E LATIN CAPITAL LETTER U WITH RING ABOVE
惲
0x016F LATIN SMALL LETTER U WITH RING ABOVE
纘
0x0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
罦
0x0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE
𨦼
0x0172 LATIN CAPITAL LETTER U WITH OGONEK
惲
0x0173 LATIN SMALL LETTER U WITH OGONEK
纘
0x0179 LATIN CAPITAL LETTER Z WITH ACUTE
拯
0x017A LATIN SMALL LETTER Z WITH ACUTE
劇
0x017B LATIN CAPITAL LETTER Z WITH DOT ABOVE
浬
0x017C LATIN SMALL LETTER Z WITH DOT ABOVE
濃
0x017D LATIN CAPITAL LETTER Z WITH CARON
哦
0x017E LATIN SMALL LETTER Z WITH CARON
輥
0x02C7 CARON
媳
0x02D8 BREVE
\
0x02D9 DOT ABOVE
�@
0x02DB OGONEK
毫
0x02DD DOUBLE ACUTE ACCENT
瑾
@@ -0,0 +1,34 @@
# Installation
> `npm install --save @types/type-is`
# Summary
This package contains type definitions for type-is (https://github.com/jshttp/type-is#readme).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/type-is.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/type-is/index.d.ts)
````ts
/// <reference types="node" />
import { IncomingMessage } from "http";
export = typeIs;
declare function typeIs(request: IncomingMessage, types: string[]): string | false | null;
declare function typeIs(request: IncomingMessage, ...types: string[]): string | false | null;
declare namespace typeIs {
function normalize(type: string): string | false;
function hasBody(request: IncomingMessage): boolean;
function is(mediaType: string, types: string[]): string | false;
function is(mediaType: string, ...types: string[]): string | false;
function match(expected: false | string, actual: string): boolean;
}
````
### Additional Details
* Last updated: Wed, 15 Jan 2025 05:02:45 GMT
* Dependencies: [@types/node](https://npmjs.com/package/@types/node)
# Credits
These definitions were written by [BendingBender](https://github.com/BendingBender).
@@ -0,0 +1,2 @@
let nesting = require('../lib/postcss-plugins/nesting')
module.exports = (nesting.__esModule ? nesting : { default: nesting }).default
@@ -0,0 +1,7 @@
import type { BasicTarget } from '../utils/domTarget';
export interface Options {
onFocus?: (e: FocusEvent) => void;
onBlur?: (e: FocusEvent) => void;
onChange?: (isFocusWithin: boolean) => void;
}
export default function useFocusWithin(target: BasicTarget, options?: Options): boolean;
@@ -0,0 +1 @@
export { _ as default } from "../esm/_to_consumable_array.js";
@@ -0,0 +1,43 @@
# unpipe
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Node.js Version][node-image]][node-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]
Unpipe a stream from all destinations.
## Installation
```sh
$ npm install unpipe
```
## API
```js
var unpipe = require('unpipe')
```
### unpipe(stream)
Unpipes all destinations from a given stream. With stream 2+, this is
equivalent to `stream.unpipe()`. When used with streams 1 style streams
(typically Node.js 0.8 and below), this module attempts to undo the
actions done in `stream.pipe(dest)`.
## License
[MIT](LICENSE)
[npm-image]: https://img.shields.io/npm/v/unpipe.svg
[npm-url]: https://npmjs.org/package/unpipe
[node-image]: https://img.shields.io/node/v/unpipe.svg
[node-url]: http://nodejs.org/download/
[travis-image]: https://img.shields.io/travis/stream-utils/unpipe.svg
[travis-url]: https://travis-ci.org/stream-utils/unpipe
[coveralls-image]: https://img.shields.io/coveralls/stream-utils/unpipe.svg
[coveralls-url]: https://coveralls.io/r/stream-utils/unpipe?branch=master
[downloads-image]: https://img.shields.io/npm/dm/unpipe.svg
[downloads-url]: https://npmjs.org/package/unpipe
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2020_intl: LibDefinition;
@@ -0,0 +1,19 @@
import {MessageDictionary as $d6fd23bc337660df$export$64839e615120df17} from "./MessageDictionary.module.js";
import {MessageFormatter as $972eb555d604f491$export$526ebc05ff964723} from "./MessageFormatter.module.js";
/*
* 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 {$d6fd23bc337660df$export$64839e615120df17 as MessageDictionary, $972eb555d604f491$export$526ebc05ff964723 as MessageFormatter};
//# sourceMappingURL=module.js.map
@@ -0,0 +1,8 @@
import Dispatcher from './dispatcher'
import RetryHandler from './retry-handler'
export default RetryAgent
declare class RetryAgent extends Dispatcher {
constructor(dispatcher: Dispatcher, options?: RetryHandler.RetryOptions)
}
@@ -0,0 +1 @@
{"version":3,"file":"manage-subscribers.js","sourceRoot":"","sources":["../../src/lib/manage-subscribers.ts"],"names":[],"mappings":";;;AAMA,IAAM,WAAW,GAAgB,EAAE,CAAC;AACpC,IAAM,UAAU,GAAiB,EAAE,CAAC;AAE7B,IAAM,cAAc,GAAG,UAAC,GAAW;IACtC,IAAI,IAAA,sBAAc,EAAC,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,UAAU,CAAC;AACtB,CAAC,CAAC;AALW,QAAA,cAAc,kBAKzB;AAEK,IAAM,cAAc,GAAG,UAAC,GAAW;;IACtC,OAAO,CAAA,MAAA,WAAW,CAAC,GAAG,CAAC,0CAAE,IAAI,IAAG,CAAC,CAAC;AACtC,CAAC,CAAC;AAFW,QAAA,cAAc,kBAEzB;AAEK,IAAM,aAAa,GAAG,UAAC,GAAW,EAAE,UAAsB;IAC7D,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,EAAc,CAAC;IAC7D,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACrC,CAAC,CAAC;AAHW,QAAA,aAAa,iBAGxB;AAEK,IAAM,gBAAgB,GAAG,UAAC,GAAW,EAAE,UAAsB;IAChE,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACxC,CAAC,CAAC;AAFW,QAAA,gBAAgB,oBAE3B;AAEK,IAAM,gBAAgB,GAAG,UAAC,GAAY;IACzC,IAAI,GAAG,IAAI,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;SAAM,CAAC;QACJ,KAAK,IAAI,KAAG,IAAI,WAAW,EAAC,CAAC;YACzB,IAAI,WAAW,CAAC,cAAc,CAAC,KAAG,CAAC,EAAC,CAAC;gBACjC,OAAO,WAAW,CAAC,KAAG,CAAC,CAAC;YAC5B,CAAC;QACL,CAAC;IACL,CAAC;AACL,CAAC,CAAA;AAVY,QAAA,gBAAgB,oBAU5B"}
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,62 @@
/**
* @file otf格式转ttf格式对象
* @author mengke01(kekee000@gmail.com)
*/
import error from './error';
import OTFReader from './otfreader';
import otfContours2ttfContours from './util/otfContours2ttfContours';
import {computePathBox} from '../graphics/computeBoundingBox';
/**
* otf格式转ttf格式对象
*
* @param {ArrayBuffer|otfObject} otfBuffer 原始数据或者解析后的otf数据
* @param {Object} options 参数
* @return {Object} ttfObject对象
*/
export default function otf2ttfobject(otfBuffer, options) {
let otfObject;
if (otfBuffer instanceof ArrayBuffer) {
const otfReader = new OTFReader(options);
otfObject = otfReader.read(otfBuffer);
otfReader.dispose();
}
else if (otfBuffer.head && otfBuffer.glyf && otfBuffer.cmap) {
otfObject = otfBuffer;
}
else {
error.raise(10111);
}
// 转换otf轮廓
otfObject.glyf.forEach((g) => {
g.contours = otfContours2ttfContours(g.contours);
const box = computePathBox(...g.contours);
if (box) {
g.xMin = box.x;
g.xMax = box.x + box.width;
g.yMin = box.y;
g.yMax = box.y + box.height;
g.leftSideBearing = g.xMin;
}
else {
g.xMin = 0;
g.xMax = 0;
g.yMin = 0;
g.yMax = 0;
g.leftSideBearing = 0;
}
});
otfObject.version = 0x1;
// 修改maxp相关配置
otfObject.maxp.version = 1.0;
otfObject.maxp.maxZones = otfObject.maxp.maxTwilightPoints ? 2 : 1;
delete otfObject.CFF;
delete otfObject.VORG;
return otfObject;
}
@@ -0,0 +1,32 @@
import { createRule, moduleVisitor, resolve } from '../utils/index.js';
function isImportingSelf(context, node, requireName) {
const filename = context.physicalFilename;
if (filename !== '<text>' && filename === resolve(requireName, context)) {
context.report({
node,
messageId: 'self',
});
}
}
export default createRule({
name: 'no-self-import',
meta: {
type: 'problem',
docs: {
category: 'Static analysis',
description: 'Forbid a module from importing itself.',
recommended: true,
},
schema: [],
messages: {
self: 'Module imports itself.',
},
},
defaultOptions: [],
create(context) {
return moduleVisitor((source, node) => {
isImportingSelf(context, node, source.value);
}, { commonjs: true });
},
});
//# sourceMappingURL=no-self-import.js.map
@@ -0,0 +1,38 @@
// English (Israel) [en-il]
import dayjs from '../index';
var locale = {
name: 'en-il',
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.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'
},
relativeTime: {
future: 'in %s',
past: '%s ago',
s: 'a few seconds',
m: 'a minute',
mm: '%d minutes',
h: 'an hour',
hh: '%d hours',
d: 'a day',
dd: '%d days',
M: 'a month',
MM: '%d months',
y: 'a year',
yy: '%d years'
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,85 @@
{
"name": "side-channel",
"version": "1.1.0",
"description": "Store information about any JS value in a side channel. Uses WeakMap if available.",
"main": "index.js",
"exports": {
".": "./index.js",
"./package.json": "./package.json"
},
"types": "./index.d.ts",
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')",
"lint": "eslint --ext=js,mjs .",
"postlint": "tsc -p . && attw -P",
"pretest": "npm run lint",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only",
"posttest": "npx npm@'>=10.2' audit --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/ljharb/side-channel.git"
},
"keywords": [
"weakmap",
"map",
"side",
"channel",
"metadata"
],
"author": "Jordan Harband <ljharb@gmail.com>",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/ljharb/side-channel/issues"
},
"homepage": "https://github.com/ljharb/side-channel#readme",
"dependencies": {
"es-errors": "^1.3.0",
"object-inspect": "^1.13.3",
"side-channel-list": "^1.0.0",
"side-channel-map": "^1.0.1",
"side-channel-weakmap": "^1.0.2"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.1",
"@ljharb/eslint-config": "^21.1.1",
"@ljharb/tsconfig": "^0.2.2",
"@types/object-inspect": "^1.13.0",
"@types/tape": "^5.6.5",
"auto-changelog": "^2.5.0",
"eclint": "^2.8.1",
"encoding": "^0.1.13",
"eslint": "=8.8.0",
"in-publish": "^2.0.1",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"tape": "^5.9.0",
"typescript": "next"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows"
]
},
"engines": {
"node": ">= 0.4"
}
}
@@ -0,0 +1,15 @@
/**
* DON'T EDIT THIS FILE.
* This file was generated by "scripts/update-lib-configs.js" script.
*/
"use strict"
module.exports = {
extends: [
require.resolve("./no-new-in-es2023-intl-api"),
require.resolve("./no-new-in-es2022-intl-api"),
require.resolve("./no-new-in-es2021-intl-api"),
require.resolve("./no-new-in-es2020-intl-api"),
require.resolve("./no-new-in-es2019-intl-api"),
],
}
@@ -0,0 +1,113 @@
'use strict';
// Built-in types
var types = [
'object',
'number',
'string',
'symbol',
'boolean',
'date',
'function', // Weird to expose this
];
function normalize(coercer, value) {
if (typeof value === 'function') {
if (coercer === 'function') {
return value;
}
value = value.apply(this, slice(arguments, 2));
}
return coerce(this, coercer, value);
}
function coerce(ctx, coercer, value) {
// Handle built-in types
if (typeof coercer === 'string') {
if (coerce[coercer]) {
return coerce[coercer].call(ctx, value);
}
return typeOf(coercer, value);
}
// Handle custom coercer
if (typeof coercer === 'function') {
return coercer.call(ctx, value);
}
// Array of coercers, try in order until one returns a non-null value
var result;
coercer.some(function(coercer) {
result = coerce(ctx, coercer, value);
return result != null;
});
return result;
}
coerce.string = function(value) {
if (value != null &&
typeof value === 'object' &&
typeof value.toString === 'function') {
value = value.toString();
}
return typeOf('string', primitive(value));
};
coerce.number = function(value) {
return typeOf('number', primitive(value));
};
coerce.boolean = function(value) {
return typeOf('boolean', primitive(value));
};
coerce.date = function(value) {
value = primitive(value);
if (typeof value === 'number' && !isNaN(value) && isFinite(value)) {
return new Date(value);
}
};
function typeOf(type, value) {
if (typeof value === type) {
return value;
}
}
function primitive(value) {
if (value != null &&
typeof value === 'object' &&
typeof value.valueOf === 'function') {
value = value.valueOf();
}
return value;
}
function slice(value, from) {
return Array.prototype.slice.call(value, from);
}
// Add methods for each type
types.forEach(function(type) {
// Make it an array for easier concat
var typeArg = [type];
normalize[type] = function() {
var args = slice(arguments);
return normalize.apply(this, typeArg.concat(args));
};
});
module.exports = normalize;
@@ -0,0 +1,78 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {CollectionStateBase, Key, Node, Selection, SingleSelection} from '@react-types/shared';
import {ListState, useListState} from './useListState';
import {useControlledState} from '@react-stately/utils';
import {useMemo} from 'react';
export interface SingleSelectListProps<T> extends CollectionStateBase<T>, Omit<SingleSelection, 'disallowEmptySelection'> {
/** Filter function to generate a filtered list of nodes. */
filter?: (nodes: Iterable<Node<T>>) => Iterable<Node<T>>,
/** @private */
suppressTextValueWarning?: boolean
}
export interface SingleSelectListState<T> extends ListState<T> {
/** The key for the currently selected item. */
readonly selectedKey: Key | null,
/** Sets the selected key. */
setSelectedKey(key: Key | null): void,
/** The value of the currently selected item. */
readonly selectedItem: Node<T> | null
}
/**
* Provides state management for list-like components with single selection.
* Handles building a collection of items from props, and manages selection state.
*/
export function useSingleSelectListState<T extends object>(props: SingleSelectListProps<T>): SingleSelectListState<T> {
let [selectedKey, setSelectedKey] = useControlledState(props.selectedKey, props.defaultSelectedKey ?? null, props.onSelectionChange);
let selectedKeys = useMemo(() => selectedKey != null ? [selectedKey] : [], [selectedKey]);
let {collection, disabledKeys, selectionManager} = useListState({
...props,
selectionMode: 'single',
disallowEmptySelection: true,
allowDuplicateSelectionEvents: true,
selectedKeys,
onSelectionChange: (keys: Selection) => {
// impossible, but TS doesn't know that
if (keys === 'all') {
return;
}
let key = keys.values().next().value ?? null;
// Always fire onSelectionChange, even if the key is the same
// as the current key (useControlledState does not).
if (key === selectedKey && props.onSelectionChange) {
props.onSelectionChange(key);
}
setSelectedKey(key);
}
});
let selectedItem = selectedKey != null
? collection.getItem(selectedKey)
: null;
return {
collection,
disabledKeys,
selectionManager,
selectedKey,
setSelectedKey,
selectedItem
};
}
@@ -0,0 +1 @@
module.exports={C:{"11":0.18861,"44":0.01179,"52":0.01179,"59":0.00589,"78":0.01768,"115":0.14735,"117":0.00589,"118":0.60119,"123":0.00589,"125":0.01179,"128":0.02947,"132":0.00589,"133":0.00589,"134":0.00589,"135":0.01179,"136":0.01768,"137":0.01768,"138":0.01768,"139":0.01179,"140":0.0943,"141":0.02358,"142":0.07662,"143":0.92536,"144":0.79569,_:"2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 53 54 55 56 57 58 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 119 120 121 122 124 126 127 129 130 131 145 146 147 3.5 3.6"},D:{"39":0.00589,"40":0.00589,"41":0.01179,"42":0.00589,"43":0.01179,"44":0.00589,"45":0.00589,"46":0.01179,"47":0.01179,"48":0.03536,"49":0.02358,"50":0.01179,"51":0.01179,"52":0.01768,"53":0.01179,"54":0.01179,"55":0.01179,"56":0.02947,"57":0.01179,"58":0.01179,"59":0.01179,"60":0.01179,"62":0.00589,"63":0.00589,"64":0.00589,"65":0.00589,"66":0.02358,"67":0.00589,"70":0.00589,"74":0.00589,"75":0.00589,"76":0.00589,"77":0.00589,"78":0.00589,"79":0.21808,"80":0.01179,"81":0.21218,"83":0.1945,"84":0.01179,"85":0.00589,"86":0.00589,"87":0.02358,"88":0.00589,"90":0.00589,"91":0.01768,"92":0.00589,"93":0.01768,"96":0.00589,"98":0.01179,"99":0.02358,"100":0.00589,"101":0.01768,"102":0.00589,"103":0.14146,"104":0.03536,"105":0.00589,"106":0.00589,"107":0.00589,"108":0.01179,"109":0.2947,"110":0.00589,"111":0.00589,"112":0.01179,"113":0.00589,"114":0.04715,"115":0.02358,"116":0.11199,"117":0.43616,"118":0.02358,"119":0.02947,"120":0.05305,"121":0.08841,"122":0.11788,"123":0.02358,"124":0.11199,"125":7.53843,"126":0.41847,"127":0.02947,"128":0.10609,"129":0.03536,"130":6.52466,"131":0.31828,"132":0.22397,"133":0.07073,"134":0.12377,"135":0.08841,"136":0.15914,"137":0.46563,"138":1.34383,"139":1.99217,"140":6.13565,"141":11.16913,"142":0.23576,"143":0.00589,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 61 68 69 71 72 73 89 94 95 97 144 145"},F:{"91":0.01179,"92":0.02947,"95":0.02358,"114":0.00589,"117":0.00589,"118":0.00589,"119":0.00589,"120":0.06483,"121":0.05305,"122":0.48331,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"17":0.00589,"91":0.00589,"109":0.04715,"120":0.00589,"121":0.04715,"122":0.00589,"124":0.00589,"126":0.00589,"128":0.00589,"129":0.00589,"130":0.00589,"131":0.01768,"132":0.01179,"133":0.01179,"134":0.04126,"135":0.01768,"136":0.01768,"137":0.01768,"138":0.04126,"139":0.06483,"140":1.11397,"141":4.65037,"142":0.01179,_:"12 13 14 15 16 18 79 80 81 83 84 85 86 87 88 89 90 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 119 123 125 127"},E:{"9":0.00589,"14":0.01768,"15":0.00589,_:"0 4 5 6 7 8 10 11 12 13 3.1 3.2 5.1 6.1 7.1 9.1 10.1 26.2","11.1":0.00589,"12.1":0.01179,"13.1":0.05305,"14.1":0.04126,"15.1":0.04715,"15.2-15.3":0.00589,"15.4":0.00589,"15.5":0.01179,"15.6":0.14735,"16.0":0.00589,"16.1":0.01768,"16.2":0.01768,"16.3":0.03536,"16.4":0.01768,"16.5":0.02358,"16.6":0.26523,"17.0":0.01179,"17.1":0.18271,"17.2":0.01768,"17.3":0.02358,"17.4":0.04715,"17.5":0.07073,"17.6":0.30649,"18.0":0.02947,"18.1":0.04715,"18.2":0.02947,"18.3":0.10609,"18.4":0.05894,"18.5-18.6":0.23576,"26.0":0.55404,"26.1":0.02358},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00203,"5.0-5.1":0,"6.0-6.1":0.00811,"7.0-7.1":0.00608,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01825,"10.0-10.2":0.00203,"10.3":0.03448,"11.0-11.2":0.51113,"11.3-11.4":0.01217,"12.0-12.1":0.00406,"12.2-12.5":0.09939,"13.0-13.1":0,"13.2":0.01014,"13.3":0.00406,"13.4-13.7":0.01623,"14.0-14.4":0.03448,"14.5-14.8":0.03651,"15.0-15.1":0.03448,"15.2-15.3":0.02637,"15.4":0.03042,"15.5":0.03448,"15.6-15.8":0.45028,"16.0":0.06085,"16.1":0.11358,"16.2":0.05882,"16.3":0.10547,"16.4":0.02637,"16.5":0.04665,"16.6-16.7":0.6024,"17.0":0.04259,"17.1":0.0649,"17.2":0.04665,"17.3":0.06896,"17.4":0.1217,"17.5":0.20891,"17.6-17.7":0.52735,"18.0":0.11967,"18.1":0.24745,"18.2":0.13387,"18.3":0.43,"18.4":0.22108,"18.5-18.6":11.27318,"26.0":1.39343,"26.1":0.05071},P:{"4":0.0107,"21":0.0107,"22":0.0107,"23":0.02141,"24":0.0107,"25":0.0107,"26":0.02141,"27":0.03211,"28":1.12398,"29":0.12845,_:"20 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.0107},I:{"0":0.18037,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00004,"4.4":0,"4.4.3-4.4.4":0.00009},K:{"0":0.27093,_:"10 11 12 11.1 11.5 12.1"},A:{"8":0.00786,"9":0.03929,"11":0.04715,_:"6 7 10 5.5"},S:{"2.5":0.00411,_:"3.0-3.1"},J:{_:"7 10"},Line truncated
@@ -0,0 +1,115 @@
"use client";
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/use-menu.ts
var use_menu_exports = {};
__export(use_menu_exports, {
useMenu: () => useMenu
});
module.exports = __toCommonJS(use_menu_exports);
var import_system = require("@heroui/system");
var import_menu = require("@react-aria/menu");
var import_theme = require("@heroui/theme");
var import_tree = require("@react-stately/tree");
var import_react_utils = require("@heroui/react-utils");
var import_react = require("react");
var import_shared_utils = require("@heroui/shared-utils");
function useMenu(props) {
var _a;
const globalContext = (0, import_system.useProviderContext)();
const {
as,
ref,
variant,
color,
children,
disableAnimation = (_a = globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _a : false,
onAction,
closeOnSelect,
itemClasses,
className,
state: propState,
topContent,
bottomContent,
hideEmptyContent = false,
hideSelectedIcon = false,
emptyContent = "No items.",
menuProps: userMenuProps,
onClose,
classNames,
...otherProps
} = props;
const Component = as || "ul";
const domRef = (0, import_react_utils.useDOMRef)(ref);
const shouldFilterDOMProps = typeof Component === "string";
const innerState = (0, import_tree.useTreeState)({ ...otherProps, ...userMenuProps, children });
const state = propState || innerState;
const { menuProps } = (0, import_menu.useMenu)({ ...otherProps, ...userMenuProps, onAction }, state, domRef);
const slots = (0, import_react.useMemo)(() => (0, import_theme.menu)({ className }), [className]);
const baseStyles = (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.base, className);
const getBaseProps = (props2 = {}) => {
return {
ref: domRef,
"data-slot": "base",
className: slots.base({ class: baseStyles }),
...(0, import_react_utils.filterDOMProps)(otherProps, {
enabled: shouldFilterDOMProps
}),
...props2
};
};
const getListProps = (props2 = {}) => {
return {
"data-slot": "list",
className: slots.list({ class: classNames == null ? void 0 : classNames.list }),
...menuProps,
...props2
};
};
const getEmptyContentProps = (props2 = {}) => {
return {
children: emptyContent,
className: slots.emptyContent({ class: classNames == null ? void 0 : classNames.emptyContent }),
...props2
};
};
return {
Component,
state,
variant,
color,
disableAnimation,
onClose,
topContent,
bottomContent,
closeOnSelect,
className,
itemClasses,
getBaseProps,
getListProps,
hideEmptyContent,
hideSelectedIcon,
getEmptyContentProps
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
useMenu
});
@@ -0,0 +1,363 @@
var chownr = require('chownr')
var tar = require('tar-stream')
var pump = require('pump')
var mkdirp = require('mkdirp-classic')
var fs = require('fs')
var path = require('path')
var os = require('os')
var win32 = os.platform() === 'win32'
var noop = function () {}
var echo = function (name) {
return name
}
var normalize = !win32 ? echo : function (name) {
return name.replace(/\\/g, '/').replace(/[:?<>|]/g, '_')
}
var statAll = function (fs, stat, cwd, ignore, entries, sort) {
var queue = entries || ['.']
return function loop (callback) {
if (!queue.length) return callback()
var next = queue.shift()
var nextAbs = path.join(cwd, next)
stat.call(fs, nextAbs, function (err, stat) {
if (err) return callback(err)
if (!stat.isDirectory()) return callback(null, next, stat)
fs.readdir(nextAbs, function (err, files) {
if (err) return callback(err)
if (sort) files.sort()
for (var i = 0; i < files.length; i++) {
if (!ignore(path.join(cwd, next, files[i]))) queue.push(path.join(next, files[i]))
}
callback(null, next, stat)
})
})
}
}
var strip = function (map, level) {
return function (header) {
header.name = header.name.split('/').slice(level).join('/')
var linkname = header.linkname
if (linkname && (header.type === 'link' || path.isAbsolute(linkname))) {
header.linkname = linkname.split('/').slice(level).join('/')
}
return map(header)
}
}
exports.pack = function (cwd, opts) {
if (!cwd) cwd = '.'
if (!opts) opts = {}
var xfs = opts.fs || fs
var ignore = opts.ignore || opts.filter || noop
var map = opts.map || noop
var mapStream = opts.mapStream || echo
var statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat, cwd, ignore, opts.entries, opts.sort)
var strict = opts.strict !== false
var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask()
var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0
var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0
var pack = opts.pack || tar.pack()
var finish = opts.finish || noop
if (opts.strip) map = strip(map, opts.strip)
if (opts.readable) {
dmode |= parseInt(555, 8)
fmode |= parseInt(444, 8)
}
if (opts.writable) {
dmode |= parseInt(333, 8)
fmode |= parseInt(222, 8)
}
var onsymlink = function (filename, header) {
xfs.readlink(path.join(cwd, filename), function (err, linkname) {
if (err) return pack.destroy(err)
header.linkname = normalize(linkname)
pack.entry(header, onnextentry)
})
}
var onstat = function (err, filename, stat) {
if (err) return pack.destroy(err)
if (!filename) {
if (opts.finalize !== false) pack.finalize()
return finish(pack)
}
if (stat.isSocket()) return onnextentry() // tar does not support sockets...
var header = {
name: normalize(filename),
mode: (stat.mode | (stat.isDirectory() ? dmode : fmode)) & umask,
mtime: stat.mtime,
size: stat.size,
type: 'file',
uid: stat.uid,
gid: stat.gid
}
if (stat.isDirectory()) {
header.size = 0
header.type = 'directory'
header = map(header) || header
return pack.entry(header, onnextentry)
}
if (stat.isSymbolicLink()) {
header.size = 0
header.type = 'symlink'
header = map(header) || header
return onsymlink(filename, header)
}
// TODO: add fifo etc...
header = map(header) || header
if (!stat.isFile()) {
if (strict) return pack.destroy(new Error('unsupported type for ' + filename))
return onnextentry()
}
var entry = pack.entry(header, onnextentry)
if (!entry) return
var rs = mapStream(xfs.createReadStream(path.join(cwd, filename), { start: 0, end: header.size > 0 ? header.size - 1 : header.size }), header)
rs.on('error', function (err) { // always forward errors on destroy
entry.destroy(err)
})
pump(rs, entry)
}
var onnextentry = function (err) {
if (err) return pack.destroy(err)
statNext(onstat)
}
onnextentry()
return pack
}
var head = function (list) {
return list.length ? list[list.length - 1] : null
}
var processGetuid = function () {
return process.getuid ? process.getuid() : -1
}
var processUmask = function () {
return process.umask ? process.umask() : 0
}
exports.extract = function (cwd, opts) {
if (!cwd) cwd = '.'
if (!opts) opts = {}
var xfs = opts.fs || fs
var ignore = opts.ignore || opts.filter || noop
var map = opts.map || noop
var mapStream = opts.mapStream || echo
var own = opts.chown !== false && !win32 && processGetuid() === 0
var extract = opts.extract || tar.extract()
var stack = []
var now = new Date()
var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask()
var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0
var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0
var strict = opts.strict !== false
if (opts.strip) map = strip(map, opts.strip)
if (opts.readable) {
dmode |= parseInt(555, 8)
fmode |= parseInt(444, 8)
}
if (opts.writable) {
dmode |= parseInt(333, 8)
fmode |= parseInt(222, 8)
}
var utimesParent = function (name, cb) { // we just set the mtime on the parent dir again everytime we write an entry
var top
while ((top = head(stack)) && name.slice(0, top[0].length) !== top[0]) stack.pop()
if (!top) return cb()
xfs.utimes(top[0], now, top[1], cb)
}
var utimes = function (name, header, cb) {
if (opts.utimes === false) return cb()
if (header.type === 'directory') return xfs.utimes(name, now, header.mtime, cb)
if (header.type === 'symlink') return utimesParent(name, cb) // TODO: how to set mtime on link?
xfs.utimes(name, now, header.mtime, function (err) {
if (err) return cb(err)
utimesParent(name, cb)
})
}
var chperm = function (name, header, cb) {
var link = header.type === 'symlink'
/* eslint-disable node/no-deprecated-api */
var chmod = link ? xfs.lchmod : xfs.chmod
var chown = link ? xfs.lchown : xfs.chown
/* eslint-enable node/no-deprecated-api */
if (!chmod) return cb()
var mode = (header.mode | (header.type === 'directory' ? dmode : fmode)) & umask
if (chown && own) chown.call(xfs, name, header.uid, header.gid, onchown)
else onchown(null)
function onchown (err) {
if (err) return cb(err)
if (!chmod) return cb()
chmod.call(xfs, name, mode, cb)
}
}
extract.on('entry', function (header, stream, next) {
header = map(header) || header
header.name = normalize(header.name)
var name = path.join(cwd, path.join('/', header.name))
if (ignore(name, header)) {
stream.resume()
return next()
}
var stat = function (err) {
if (err) return next(err)
utimes(name, header, function (err) {
if (err) return next(err)
if (win32) return next()
chperm(name, header, next)
})
}
var onsymlink = function () {
if (win32) return next() // skip symlinks on win for now before it can be tested
xfs.unlink(name, function () {
var dst = path.resolve(path.dirname(name), header.linkname)
if (!inCwd(dst, cwd)) return next(new Error(name + ' is not a valid symlink'))
xfs.symlink(header.linkname, name, stat)
})
}
var onlink = function () {
if (win32) return next() // skip links on win for now before it can be tested
xfs.unlink(name, function () {
var srcpath = path.join(cwd, path.join('/', header.linkname))
xfs.realpath(srcpath, function (err, dst) {
if (err || !inCwd(dst, cwd)) return next(new Error(name + ' is not a valid hardlink'))
xfs.link(dst, name, function (err) {
if (err && err.code === 'EPERM' && opts.hardlinkAsFilesFallback) {
stream = xfs.createReadStream(srcpath)
return onfile()
}
stat(err)
})
})
})
}
var onfile = function () {
var ws = xfs.createWriteStream(name)
var rs = mapStream(stream, header)
ws.on('error', function (err) { // always forward errors on destroy
rs.destroy(err)
})
pump(rs, ws, function (err) {
if (err) return next(err)
ws.on('close', stat)
})
}
if (header.type === 'directory') {
stack.push([name, header.mtime])
return mkdirfix(name, {
fs: xfs, own: own, uid: header.uid, gid: header.gid
}, stat)
}
var dir = path.dirname(name)
validate(xfs, dir, path.join(cwd, '.'), function (err, valid) {
if (err) return next(err)
if (!valid) return next(new Error(dir + ' is not a valid path'))
mkdirfix(dir, {
fs: xfs, own: own, uid: header.uid, gid: header.gid
}, function (err) {
if (err) return next(err)
switch (header.type) {
case 'file': return onfile()
case 'link': return onlink()
case 'symlink': return onsymlink()
}
if (strict) return next(new Error('unsupported type for ' + name + ' (' + header.type + ')'))
stream.resume()
next()
})
})
})
if (opts.finish) extract.on('finish', opts.finish)
return extract
}
function validate (fs, name, root, cb) {
if (name === root) return cb(null, true)
fs.lstat(name, function (err, st) {
if (err && err.code !== 'ENOENT') return cb(err)
if (err || st.isDirectory()) return validate(fs, path.join(name, '..'), root, cb)
cb(null, false)
})
}
function mkdirfix (name, opts, cb) {
mkdirp(name, { fs: opts.fs }, function (err, made) {
if (!err && made && opts.own) {
chownr(made, opts.uid, opts.gid, cb)
} else {
cb(err)
}
})
}
function inCwd (dst, cwd) {
cwd = path.resolve(cwd)
return cwd === dst || dst.startsWith(cwd + path.sep)
}
@@ -0,0 +1,25 @@
# tinyglobby
[![npm version](https://img.shields.io/npm/v/tinyglobby.svg?maxAge=3600)](https://npmjs.com/package/tinyglobby)
[![monthly downloads](https://img.shields.io/npm/dm/tinyglobby.svg?maxAge=3600)](https://npmjs.com/package/tinyglobby)
A fast and minimal alternative to globby and fast-glob, meant to behave the same way.
Both globby and fast-glob present some behavior no other globbing lib has,
which makes it hard to manually replace with something smaller and better.
This library uses only two subdependencies, compared to `globby`'s [23](https://npmgraph.js.org/?q=globby@14.1.0)
and `fast-glob`'s [17](https://npmgraph.js.org/?q=fast-glob@3.3.3).
## Usage
```js
import { glob, globSync } from 'tinyglobby';
await glob(['files/*.ts', '!**/*.d.ts'], { cwd: 'src' });
globSync('src/**/*.ts', { ignore: '**/*.d.ts' });
```
## Documentation
Visit https://superchupu.dev/tinyglobby to read the full documentation.
@@ -0,0 +1,41 @@
# Is Module
Check whether a source string looks like an ES6 module.
This doesn't actually execute the code,
and doesn't check other module types.
So source strings without any module loaders returns `false`.
This is just what I need from https://github.com/yahoo/js-module-formats, which actually executes the sauce string in a subcontext.
## API
```js
var isES6Module = require('is-module');
console.log(isES6Module('import * from "emitter";')) // => true
```
## License
(The MIT License)
Copyright (c) 2014 segmentio &lt;team@segment.io&gt;
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,713 @@
# Commander.js
[![Build Status](https://api.travis-ci.org/tj/commander.js.svg?branch=master)](http://travis-ci.org/tj/commander.js)
[![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander)
[![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://npmcharts.com/compare/commander?minimal=true)
[![Install Size](https://packagephobia.now.sh/badge?p=commander)](https://packagephobia.now.sh/result?p=commander)
The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/commander-rb/commander).
Read this in other languages: English | [简体中文](./Readme_zh-CN.md)
- [Commander.js](#commanderjs)
- [Installation](#installation)
- [Declaring program variable](#declaring-program-variable)
- [Options](#options)
- [Common option types, boolean and value](#common-option-types-boolean-and-value)
- [Default option value](#default-option-value)
- [Other option types, negatable boolean and flag|value](#other-option-types-negatable-boolean-and-flagvalue)
- [Custom option processing](#custom-option-processing)
- [Required option](#required-option)
- [Version option](#version-option)
- [Commands](#commands)
- [Specify the argument syntax](#specify-the-argument-syntax)
- [Action handler (sub)commands](#action-handler-subcommands)
- [Git-style executable (sub)commands](#git-style-executable-subcommands)
- [Automated --help](#automated---help)
- [Custom help](#custom-help)
- [.usage and .name](#usage-and-name)
- [.outputHelp(cb)](#outputhelpcb)
- [.helpOption(flags, description)](#helpoptionflags-description)
- [.help(cb)](#helpcb)
- [Custom event listeners](#custom-event-listeners)
- [Bits and pieces](#bits-and-pieces)
- [Avoiding option name clashes](#avoiding-option-name-clashes)
- [TypeScript](#typescript)
- [Node options such as --harmony](#node-options-such-as---harmony)
- [Node debugging](#node-debugging)
- [Override exit handling](#override-exit-handling)
- [Examples](#examples)
- [License](#license)
- [Support](#support)
- [Commander for enterprise](#commander-for-enterprise)
## Installation
```bash
npm install commander
```
## Declaring _program_ variable
Commander exports a global object which is convenient for quick programs.
This is used in the examples in this README for brevity.
```js
const program = require('commander');
program.version('0.0.1');
```
For larger programs which may use commander in multiple ways, including unit testing, it is better to create a local Command object to use.
```js
const commander = require('commander');
const program = new commander.Command();
program.version('0.0.1');
```
## Options
Options are defined with the `.option()` method, also serving as documentation for the options. Each option can have a short flag (single character) and a long name, separated by a comma or space.
The options can be accessed as properties on the Command object. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. Multiple short flags may be combined as a single arg, for example `-abc` is equivalent to `-a -b -c`.
See also optional new behaviour to [avoid name clashes](#avoiding-option-name-clashes).
### Common option types, boolean and value
The two most used option types are a boolean flag, and an option which takes a value (declared using angle brackets). Both are `undefined` unless specified on command line.
```js
const program = require('commander');
program
.option('-d, --debug', 'output extra debugging')
.option('-s, --small', 'small pizza size')
.option('-p, --pizza-type <type>', 'flavour of pizza');
program.parse(process.argv);
if (program.debug) console.log(program.opts());
console.log('pizza details:');
if (program.small) console.log('- small pizza size');
if (program.pizzaType) console.log(`- ${program.pizzaType}`);
```
```bash
$ pizza-options -d
{ debug: true, small: undefined, pizzaType: undefined }
pizza details:
$ pizza-options -p
error: option '-p, --pizza-type <type>' argument missing
$ pizza-options -ds -p vegetarian
{ debug: true, small: true, pizzaType: 'vegetarian' }
pizza details:
- small pizza size
- vegetarian
$ pizza-options --pizza-type=cheese
pizza details:
- cheese
```
`program.parse(arguments)` processes the arguments, leaving any args not consumed by the options as the `program.args` array.
### Default option value
You can specify a default value for an option which takes a value.
```js
const program = require('commander');
program
.option('-c, --cheese <type>', 'add the specified type of cheese', 'blue');
program.parse(process.argv);
console.log(`cheese: ${program.cheese}`);
```
```bash
$ pizza-options
cheese: blue
$ pizza-options --cheese stilton
cheese: stilton
```
### Other option types, negatable boolean and flag|value
You can specify a boolean option long name with a leading `no-` to set the option value to false when used.
Defined alone this also makes the option true by default.
If you define `--foo` first, adding `--no-foo` does not change the default value from what it would
otherwise be. You can specify a default boolean value for a boolean flag and it can be overridden on command line.
```js
const program = require('commander');
program
.option('--no-sauce', 'Remove sauce')
.option('--cheese <flavour>', 'cheese flavour', 'mozzarella')
.option('--no-cheese', 'plain with no cheese')
.parse(process.argv);
const sauceStr = program.sauce ? 'sauce' : 'no sauce';
const cheeseStr = (program.cheese === false) ? 'no cheese' : `${program.cheese} cheese`;
console.log(`You ordered a pizza with ${sauceStr} and ${cheeseStr}`);
```
```bash
$ pizza-options
You ordered a pizza with sauce and mozzarella cheese
$ pizza-options --sauce
error: unknown option '--sauce'
$ pizza-options --cheese=blue
You ordered a pizza with sauce and blue cheese
$ pizza-options --no-sauce --no-cheese
You ordered a pizza with no sauce and no cheese
```
You can specify an option which functions as a flag but may also take a value (declared using square brackets).
```js
const program = require('commander');
program
.option('-c, --cheese [type]', 'Add cheese with optional type');
program.parse(process.argv);
if (program.cheese === undefined) console.log('no cheese');
else if (program.cheese === true) console.log('add cheese');
else console.log(`add cheese type ${program.cheese}`);
```
```bash
$ pizza-options
no cheese
$ pizza-options --cheese
add cheese
$ pizza-options --cheese mozzarella
add cheese type mozzarella
```
### Custom option processing
You may specify a function to do custom processing of option values. The callback function receives two parameters, the user specified value and the
previous value for the option. It returns the new value for the option.
This allows you to coerce the option value to the desired type, or accumulate values, or do entirely custom processing.
You can optionally specify the default/starting value for the option after the function.
```js
const program = require('commander');
function myParseInt(value, dummyPrevious) {
// parseInt takes a string and an optional radix
return parseInt(value);
}
function increaseVerbosity(dummyValue, previous) {
return previous + 1;
}
function collect(value, previous) {
return previous.concat([value]);
}
function commaSeparatedList(value, dummyPrevious) {
return value.split(',');
}
program
.option('-f, --float <number>', 'float argument', parseFloat)
.option('-i, --integer <number>', 'integer argument', myParseInt)
.option('-v, --verbose', 'verbosity that can be increased', increaseVerbosity, 0)
.option('-c, --collect <value>', 'repeatable value', collect, [])
.option('-l, --list <items>', 'comma separated list', commaSeparatedList)
;
program.parse(process.argv);
if (program.float !== undefined) console.log(`float: ${program.float}`);
if (program.integer !== undefined) console.log(`integer: ${program.integer}`);
if (program.verbose > 0) console.log(`verbosity: ${program.verbose}`);
if (program.collect.length > 0) console.log(program.collect);
if (program.list !== undefined) console.log(program.list);
```
```bash
$ custom -f 1e2
float: 100
$ custom --integer 2
integer: 2
$ custom -v -v -v
verbose: 3
$ custom -c a -c b -c c
[ 'a', 'b', 'c' ]
$ custom --list x,y,z
[ 'x', 'y', 'z' ]
```
### Required option
You may specify a required (mandatory) option using `.requiredOption`. The option must be specified on the command line, or by having a default value. The method is otherwise the same as `.option` in format, taking flags and description, and optional default value or custom processing.
```js
const program = require('commander');
program
.requiredOption('-c, --cheese <type>', 'pizza must have cheese');
program.parse(process.argv);
```
```
$ pizza
error: required option '-c, --cheese <type>' not specified
```
### Version option
The optional `version` method adds handling for displaying the command version. The default option flags are `-V` and `--version`, and when present the command prints the version number and exits.
```js
program.version('0.0.1');
```
```bash
$ ./examples/pizza -V
0.0.1
```
You may change the flags and description by passing additional parameters to the `version` method, using
the same syntax for flags as the `option` method. The version flags can be named anything, but a long name is required.
```js
program.version('0.0.1', '-v, --vers', 'output the current version');
```
## Commands
You can specify (sub)commands for your top-level command using `.command`. There are two ways these can be implemented: using an action handler attached to the command, or as a separate executable file (described in more detail later). In the first parameter to `.command` you specify the command name and any command arguments. The arguments may be `<required>` or `[optional]`, and the last argument may also be `variadic...`.
For example:
```js
// Command implemented using action handler (description is supplied separately to `.command`)
// Returns new command for configuring.
program
.command('clone <source> [destination]')
.description('clone a repository into a newly created directory')
.action((source, destination) => {
console.log('clone command called');
});
// Command implemented using separate executable file (description is second parameter to `.command`)
// Returns top-level command for adding more commands.
program
.command('start <service>', 'start named service')
.command('stop [service]', 'stop named service, or all if no name supplied');
```
### Specify the argument syntax
You use `.arguments` to specify the arguments for the top-level command, and for subcommands they are included in the `.command` call. Angled brackets (e.g. `<required>`) indicate required input. Square brackets (e.g. `[optional]`) indicate optional input.
```js
const program = require('commander');
program
.version('0.1.0')
.arguments('<cmd> [env]')
.action(function (cmd, env) {
cmdValue = cmd;
envValue = env;
});
program.parse(process.argv);
if (typeof cmdValue === 'undefined') {
console.error('no command given!');
process.exit(1);
}
console.log('command:', cmdValue);
console.log('environment:', envValue || "no environment given");
```
The last argument of a command can be variadic, and only the last argument. To make an argument variadic you
append `...` to the argument name. For example:
```js
const program = require('commander');
program
.version('0.1.0')
.command('rmdir <dir> [otherDirs...]')
.action(function (dir, otherDirs) {
console.log('rmdir %s', dir);
if (otherDirs) {
otherDirs.forEach(function (oDir) {
console.log('rmdir %s', oDir);
});
}
});
program.parse(process.argv);
```
The variadic argument is passed to the action handler as an array. (And this also applies to `program.args`.)
### Action handler (sub)commands
You can add options to a command that uses an action handler.
The action handler gets passed a parameter for each argument you declared, and one additional argument which is the
command object itself. This command argument has the values for the command-specific options added as properties.
```js
const program = require('commander');
program
.command('rm <dir>')
.option('-r, --recursive', 'Remove recursively')
.action(function (dir, cmdObj) {
console.log('remove ' + dir + (cmdObj.recursive ? ' recursively' : ''))
})
program.parse(process.argv)
```
You may supply an `async` action handler, in which case you call `.parseAsync` rather than `.parse`.
```js
async function run() { /* code goes here */ }
async function main() {
program
.command('run')
.action(run);
await program.parseAsync(process.argv);
}
```
A command's options on the command line are validated when the command is used. Any unknown options will be reported as an error. However, if an action-based command does not define an action, then the options are not validated.
Configuration options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the command from the generated help output.
### Git-style executable (sub)commands
When `.command()` is invoked with a description argument, this tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools.
Commander will search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-subcommand`, like `pm-install`, `pm-search`.
You can specify a custom name with the `executableFile` configuration option.
You handle the options for an executable (sub)command in the executable, and don't declare them at the top-level.
```js
// file: ./examples/pm
const program = require('commander');
program
.version('0.1.0')
.command('install [name]', 'install one or more packages')
.command('search [query]', 'search with optional query')
.command('update', 'update installed packages', {executableFile: 'myUpdateSubCommand'})
.command('list', 'list packages installed', {isDefault: true})
.parse(process.argv);
```
Configuration options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the command from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified.
Specifying a name with `executableFile` will override the default constructed name.
If the program is designed to be installed globally, make sure the executables have proper modes, like `755`.
## Automated --help
The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
```bash
$ ./examples/pizza --help
Usage: pizza [options]
An application for pizzas ordering
Options:
-V, --version output the version number
-p, --peppers Add peppers
-P, --pineapple Add pineapple
-b, --bbq Add bbq sauce
-c, --cheese <type> Add the specified type of cheese (default: "marble")
-C, --no-cheese You do not want any cheese
-h, --help output usage information
```
### Custom help
You can display arbitrary `-h, --help` information
by listening for "--help". Commander will automatically
exit once you are done so that the remainder of your program
does not execute causing undesired behaviors, for example
in the following executable "stuff" will not output when
`--help` is used.
```js
#!/usr/bin/env node
const program = require('commander');
program
.version('0.1.0')
.option('-f, --foo', 'enable some foo')
.option('-b, --bar', 'enable some bar')
.option('-B, --baz', 'enable some baz');
// must be before .parse() since
// node's emit() is immediate
program.on('--help', function(){
console.log('')
console.log('Examples:');
console.log(' $ custom-help --help');
console.log(' $ custom-help -h');
});
program.parse(process.argv);
console.log('stuff');
```
Yields the following help output when `node script-name.js -h` or `node script-name.js --help` are run:
```Text
Usage: custom-help [options]
Options:
-h, --help output usage information
-V, --version output the version number
-f, --foo enable some foo
-b, --bar enable some bar
-B, --baz enable some baz
Examples:
$ custom-help --help
$ custom-help -h
```
### .usage and .name
These allow you to customise the usage description in the first line of the help. The name is otherwise
deduced from the (full) program arguments. Given:
```js
program
.name("my-command")
.usage("[global options] command")
```
The help will start with:
```Text
Usage: my-command [global options] command
```
### .outputHelp(cb)
Output help information without exiting.
Optional callback cb allows post-processing of help text before it is displayed.
If you want to display help by default (e.g. if no command was provided), you can use something like:
```js
const program = require('commander');
const colors = require('colors');
program
.version('0.1.0')
.command('getstream [url]', 'get stream URL')
.parse(process.argv);
if (!process.argv.slice(2).length) {
program.outputHelp(make_red);
}
function make_red(txt) {
return colors.red(txt); //display the help text in red on the console
}
```
### .helpOption(flags, description)
Override the default help flags and description.
```js
program
.helpOption('-e, --HELP', 'read more information');
```
### .help(cb)
Output help information and exit immediately.
Optional callback cb allows post-processing of help text before it is displayed.
## Custom event listeners
You can execute custom actions by listening to command and option events.
```js
program.on('option:verbose', function () {
process.env.VERBOSE = this.verbose;
});
// error on unknown commands
program.on('command:*', function () {
console.error('Invalid command: %s\nSee --help for a list of available commands.', program.args.join(' '));
process.exit(1);
});
```
## Bits and pieces
### Avoiding option name clashes
The original and default behaviour is that the option values are stored
as properties on the program, and the action handler is passed a
command object with the options values stored as properties.
This is very convenient to code, but the downside is possible clashes with
existing properties of Command.
There are two new routines to change the behaviour, and the default behaviour may change in the future:
- `storeOptionsAsProperties`: whether to store option values as properties on command object, or store separately (specify false) and access using `.opts()`
- `passCommandToAction`: whether to pass command to action handler,
or just the options (specify false)
```js
// file: ./examples/storeOptionsAsProperties.action.js
program
.storeOptionsAsProperties(false)
.passCommandToAction(false);
program
.name('my-program-name')
.option('-n,--name <name>');
program
.command('show')
.option('-a,--action <action>')
.action((options) => {
console.log(options.action);
});
program.parse(process.argv);
const programOptions = program.opts();
console.log(programOptions.name);
```
### TypeScript
The Commander package includes its TypeScript Definition file, but also requires the node types which you need to install yourself. e.g.
```bash
npm install commander
npm install --save-dev @types/node
```
If you use `ts-node` and git-style sub-commands written as `.ts` files, you need to call your program through node to get the sub-commands called correctly. e.g.
```bash
node -r ts-node/register pm.ts
```
### Node options such as `--harmony`
You can enable `--harmony` option in two ways:
- Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. (Note Windows does not support this pattern.)
- Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process.
### Node debugging
If you are using the node inspector for [debugging](https://nodejs.org/en/docs/guides/debugging-getting-started/) git-style executable (sub)commands using `node --inspect` et al,
the inspector port is incremented by 1 for the spawned subcommand.
### Override exit handling
By default Commander calls `process.exit` when it detects errors, or after displaying the help or version. You can override
this behaviour and optionally supply a callback. The default override throws a `CommanderError`.
The override callback is passed a `CommanderError` with properties `exitCode` number, `code` string, and `message`. The default override behaviour is to throw the error, except for async handling of executable subcommand completion which carries on. The normal display of error messages or version or help
is not affected by the override which is called after the display.
``` js
program.exitOverride();
try {
program.parse(process.argv);
} catch (err) {
// custom processing...
}
```
## Examples
```js
const program = require('commander');
program
.version('0.1.0')
.option('-C, --chdir <path>', 'change the working directory')
.option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
.option('-T, --no-tests', 'ignore test hook');
program
.command('setup [env]')
.description('run setup commands for all envs')
.option("-s, --setup_mode [mode]", "Which setup mode to use")
.action(function(env, options){
const mode = options.setup_mode || "normal";
env = env || 'all';
console.log('setup for %s env(s) with %s mode', env, mode);
});
program
.command('exec <cmd>')
.alias('ex')
.description('execute the given remote cmd')
.option("-e, --exec_mode <mode>", "Which exec mode to use")
.action(function(cmd, options){
console.log('exec "%s" using %s mode', cmd, options.exec_mode);
}).on('--help', function() {
console.log('');
console.log('Examples:');
console.log('');
console.log(' $ deploy exec sequential');
console.log(' $ deploy exec async');
});
program
.command('*')
.action(function(env){
console.log('deploying "%s"', env);
});
program.parse(process.argv);
```
More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory.
## License
[MIT](https://github.com/tj/commander.js/blob/master/LICENSE)
## Support
Commander 4.x is supported on Node 8 and above, and is likely to work with Node 6 but not tested.
(For versions of Node below Node 6, use Commander 3.x or 2.x.)
The main forum for free and community support is the project [Issues](https://github.com/tj/commander.js/issues) on GitHub.
### Commander for enterprise
Available as part of the Tidelift Subscription
The maintainers of Commander and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-commander?utm_source=npm-commander&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
@@ -0,0 +1,39 @@
export { default as ar } from "./ar.js";
export { default as az } from "./az.js";
export { default as be } from "./be.js";
export { default as ca } from "./ca.js";
export { default as cs } from "./cs.js";
export { default as de } from "./de.js";
export { default as en } from "./en.js";
export { default as eo } from "./eo.js";
export { default as es } from "./es.js";
export { default as fa } from "./fa.js";
export { default as fi } from "./fi.js";
export { default as fr } from "./fr.js";
export { default as frCA } from "./fr-CA.js";
export { default as he } from "./he.js";
export { default as hu } from "./hu.js";
export { default as id } from "./id.js";
export { default as it } from "./it.js";
export { default as ja } from "./ja.js";
export { default as kh } from "./kh.js";
export { default as ko } from "./ko.js";
export { default as mk } from "./mk.js";
export { default as ms } from "./ms.js";
export { default as nl } from "./nl.js";
export { default as no } from "./no.js";
export { default as ota } from "./ota.js";
export { default as ps } from "./ps.js";
export { default as pl } from "./pl.js";
export { default as pt } from "./pt.js";
export { default as ru } from "./ru.js";
export { default as sl } from "./sl.js";
export { default as sv } from "./sv.js";
export { default as ta } from "./ta.js";
export { default as th } from "./th.js";
export { default as tr } from "./tr.js";
export { default as ua } from "./ua.js";
export { default as ur } from "./ur.js";
export { default as vi } from "./vi.js";
export { default as zhCN } from "./zh-CN.js";
export { default as zhTW } from "./zh-TW.js";
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,32 @@
"use client";
import {
useLink
} from "./chunk-3GGKNGCF.mjs";
// src/link.tsx
import { forwardRef } from "@heroui/system";
import { LinkIcon } from "@heroui/shared-icons";
import { linkAnchorClasses } from "@heroui/theme";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
var Link = forwardRef((props, ref) => {
const {
Component,
children,
showAnchorIcon,
anchorIcon = /* @__PURE__ */ jsx(LinkIcon, { className: linkAnchorClasses }),
getLinkProps
} = useLink({
ref,
...props
});
return /* @__PURE__ */ jsx(Component, { ...getLinkProps(), children: /* @__PURE__ */ jsxs(Fragment, { children: [
children,
showAnchorIcon && anchorIcon
] }) });
});
Link.displayName = "HeroUI.Link";
var link_default = Link;
export {
link_default
};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"6 7 8 9 xC TC J ZB K D E F A B C L M G N O P aB AB 0C 1C","194":"nB oB pB","450":"BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB","2242":"qB rB sB tB uB vB"},D:{"1":"0 1 2 3 4 5 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB","578":"oB pB qB rB sB tB uB vB wB xB yB zB 0B"},E:{"1":"G 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","2":"J ZB K D E F A 2C ZC 3C 4C 5C 6C","1090":"B C L M aC NC OC 7C 8C"},F:{"1":"0 1 2 3 4 5 oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB FD GD HD ID NC uC JD OC"},G:{"1":"dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","2":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD","1090":"VD WD XD YD ZD aD bD cD"},H:{"2":"hD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB qD rD sD aC tD uD vD wD xD QC RC SC yD","2":"J oD pD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"2D","2242":"1D"}},B:6,C:"WebGL 2.0",D:true};
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _identity;
function _identity(x) {
return x;
}
//# sourceMappingURL=identity.js.map
@@ -0,0 +1,117 @@
"use client";
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/popover-content.tsx
var popover_content_exports = {};
__export(popover_content_exports, {
default: () => popover_content_default
});
module.exports = __toCommonJS(popover_content_exports);
var import_react = require("react");
var import_overlays = require("@react-aria/overlays");
var import_framer_utils = require("@heroui/framer-utils");
var import_framer_motion = require("framer-motion");
var import_aria_utils = require("@heroui/aria-utils");
var import_dialog = require("@react-aria/dialog");
// src/popover-context.ts
var import_react_utils = require("@heroui/react-utils");
var [PopoverProvider, usePopoverContext] = (0, import_react_utils.createContext)({
name: "PopoverContext",
errorMessage: "usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"
});
// src/popover-content.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var domAnimation = () => import("@heroui/dom-animation").then((res) => res.default);
var PopoverContent = (props) => {
const { as, children, className, ...otherProps } = props;
const {
Component: OverlayComponent,
placement,
backdrop,
motionProps,
disableAnimation,
getPopoverProps,
getDialogProps,
getBackdropProps,
getContentProps,
isNonModal,
onClose
} = usePopoverContext();
const dialogRef = (0, import_react.useRef)(null);
const { dialogProps: ariaDialogProps, titleProps } = (0, import_dialog.useDialog)({}, dialogRef);
const dialogProps = getDialogProps({
ref: dialogRef,
...ariaDialogProps,
...otherProps
});
const Component = as || OverlayComponent || "div";
const content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
!isNonModal && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_overlays.DismissButton, { onDismiss: onClose }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ...dialogProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...getContentProps({ className }), children: typeof children === "function" ? children(titleProps) : children }) }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_overlays.DismissButton, { onDismiss: onClose })
] });
const backdropContent = (0, import_react.useMemo)(() => {
if (backdrop === "transparent") {
return null;
}
if (disableAnimation) {
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...getBackdropProps() });
}
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.LazyMotion, { features: domAnimation, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
import_framer_motion.m.div,
{
animate: "enter",
exit: "exit",
initial: "exit",
variants: import_framer_utils.TRANSITION_VARIANTS.fade,
...getBackdropProps()
}
) });
}, [backdrop, disableAnimation, getBackdropProps]);
const style = placement ? (0, import_aria_utils.getTransformOrigins)(placement === "center" ? "top" : placement) : void 0;
const contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: disableAnimation ? content : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.LazyMotion, { features: domAnimation, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
import_framer_motion.m.div,
{
animate: "enter",
exit: "exit",
initial: "initial",
style,
variants: import_framer_utils.TRANSITION_VARIANTS.scaleSpringOpacity,
...motionProps,
children: content
}
) }) });
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ...getPopoverProps(), children: [
backdropContent,
contents
] });
};
PopoverContent.displayName = "HeroUI.PopoverContent";
var popover_content_default = PopoverContent;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {});
@@ -0,0 +1,48 @@
'use strict';
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var AdvanceStringIndex = require('./AdvanceStringIndex');
var Call = require('./Call');
var GetIteratorDirect = require('./GetIteratorDirect');
var GetMethod = require('./GetMethod');
var IsArray = require('./IsArray');
var getIteratorMethod = require('../helpers/getIteratorMethod');
// https://262.ecma-international.org/16.0/#sec-getiteratorflattenable
module.exports = function GetIteratorFlattenable(obj, primitiveHandling) {
if (primitiveHandling !== 'REJECT-PRIMITIVES' && primitiveHandling !== 'ITERATE-STRING-PRIMITIVES') {
throw new $TypeError('Assertion failed: `stringHandling` must be "REJECT-PRIMITIVES" or "ITERATE-STRING-PRIMITIVES"');
}
if (!isObject(obj)) {
if (primitiveHandling === 'REJECT-PRIMITIVES' || typeof obj !== 'string') {
throw new $TypeError('obj must be an Object'); // step 1.a
}
}
// var method = GetMethod(obj, Symbol.iterator); // step 2
var method = getIteratorMethod(
{
AdvanceStringIndex: AdvanceStringIndex,
GetMethod: GetMethod,
IsArray: IsArray
},
obj
);
var iterator;
if (typeof method === 'undefined') { // step 3
iterator = obj; // step 3.a
} else { // step 4
iterator = Call(method, obj); // step 4.a
}
if (!isObject(iterator)) {
throw new $TypeError('iterator must be an Object'); // step 5
}
return GetIteratorDirect(iterator); // step 6
};
@@ -0,0 +1,32 @@
import isArrayLike from './isArrayLike.js';
/**
* Creates a `baseEach` or `baseEachRight` function.
*
* @private
* @param {Function} eachFunc The function to iterate over a collection.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseEach(eachFunc, fromRight) {
return function(collection, iteratee) {
if (collection == null) {
return collection;
}
if (!isArrayLike(collection)) {
return eachFunc(collection, iteratee);
}
var length = collection.length,
index = fromRight ? length : -1,
iterable = Object(collection);
while ((fromRight ? index-- : ++index < length)) {
if (iteratee(iterable[index], index, iterable) === false) {
break;
}
}
return collection;
};
}
export default createBaseEach;
@@ -0,0 +1,11 @@
import { getWebCrypto } from './getWebCrypto.js';
/**
* Fill up the provided bytes array with random bytes equal to its length.
*
* @returns the same bytes array passed into the method
*/
export async function getRandomValues(array) {
const WebCrypto = await getWebCrypto();
WebCrypto.getRandomValues(array);
return array;
}
@@ -0,0 +1,98 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _regeneratorRuntime;
var _OverloadYield = require("./OverloadYield.js");
var _regenerator = require("./regenerator.js");
var _regeneratorAsync = require("./regeneratorAsync.js");
var _regeneratorAsyncGen = require("./regeneratorAsyncGen.js");
var _regeneratorAsyncIterator = require("./regeneratorAsyncIterator.js");
var _regeneratorKeys = require("./regeneratorKeys.js");
var _regeneratorValues = require("./regeneratorValues.js");
function _regeneratorRuntime() {
"use strict";
var r = (0, _regenerator.default)();
var gen = r.m(_regeneratorRuntime);
var GeneratorFunctionPrototype = Object.getPrototypeOf ? Object.getPrototypeOf(gen) : gen.__proto__;
var GeneratorFunction = GeneratorFunctionPrototype.constructor;
function isGeneratorFunction(genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
}
var abruptMap = {
throw: 1,
return: 2,
break: 3,
continue: 3
};
function wrapInnerFn(innerFn) {
var compatContext;
var callSyncState;
return function (context) {
if (!compatContext) {
compatContext = {
stop: function () {
return callSyncState(context.a, 2);
},
catch: function () {
return context.v;
},
abrupt: function (type, arg) {
return callSyncState(context.a, abruptMap[type], arg);
},
delegateYield: function (iterable, resultName, nextLoc) {
compatContext.resultName = resultName;
return callSyncState(context.d, (0, _regeneratorValues.default)(iterable), nextLoc);
},
finish: function (finallyLoc) {
return callSyncState(context.f, finallyLoc);
}
};
callSyncState = function (fn, a1, a2) {
context.p = compatContext.prev;
context.n = compatContext.next;
try {
return fn(a1, a2);
} finally {
compatContext.next = context.n;
}
};
}
if (compatContext.resultName) {
compatContext[compatContext.resultName] = context.v;
compatContext.resultName = undefined;
}
compatContext.sent = context.v;
compatContext.next = context.n;
try {
return innerFn.call(this, compatContext);
} finally {
context.p = compatContext.prev;
context.n = compatContext.next;
}
};
}
return (exports.default = _regeneratorRuntime = function () {
return {
wrap: function (innerFn, outerFn, self, tryLocsList) {
return r.w(wrapInnerFn(innerFn), outerFn, self, tryLocsList && tryLocsList.reverse());
},
isGeneratorFunction: isGeneratorFunction,
mark: r.m,
awrap: function (value, kind) {
return new _OverloadYield.default(value, kind);
},
AsyncIterator: _regeneratorAsyncIterator.default,
async: function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
return (isGeneratorFunction(outerFn) ? _regeneratorAsyncGen.default : _regeneratorAsync.default)(wrapInnerFn(innerFn), outerFn, self, tryLocsList, PromiseImpl);
},
keys: _regeneratorKeys.default,
values: _regeneratorValues.default
};
})();
}
//# sourceMappingURL=regeneratorRuntime.js.map
@@ -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-object
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 a single custom sponsorship URL
@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TaggedTemplateExpression = TaggedTemplateExpression;
exports.TemplateElement = TemplateElement;
exports.TemplateLiteral = TemplateLiteral;
exports._printTemplate = _printTemplate;
function TaggedTemplateExpression(node) {
this.print(node.tag);
{
this.print(node.typeParameters);
}
this.print(node.quasi);
}
function TemplateElement() {
throw new Error("TemplateElement printing is handled in TemplateLiteral");
}
function _printTemplate(node, substitutions) {
const quasis = node.quasis;
let partRaw = "`";
for (let i = 0; i < quasis.length - 1; i++) {
partRaw += quasis[i].value.raw;
this.token(partRaw + "${", true);
this.print(substitutions[i]);
partRaw = "}";
if (this.tokenMap) {
const token = this.tokenMap.findMatching(node, "}", i);
if (token) this._catchUpTo(token.loc.start);
}
}
partRaw += quasis[quasis.length - 1].value.raw;
this.token(partRaw + "`", true);
}
function TemplateLiteral(node) {
this._printTemplate(node, node.expressions);
}
//# sourceMappingURL=template-literals.js.map
@@ -0,0 +1,133 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HasTransform = HasTransform;
const index_1 = require("../deref/index");
const index_2 = require("../../type/symbols/index");
// ------------------------------------------------------------------
// KindGuard
// ------------------------------------------------------------------
const kind_1 = require("../../type/guard/kind");
// ------------------------------------------------------------------
// ValueGuard
// ------------------------------------------------------------------
const index_3 = require("../guard/index");
// prettier-ignore
function FromArray(schema, references) {
return (0, kind_1.IsTransform)(schema) || Visit(schema.items, references);
}
// prettier-ignore
function FromAsyncIterator(schema, references) {
return (0, kind_1.IsTransform)(schema) || Visit(schema.items, references);
}
// prettier-ignore
function FromConstructor(schema, references) {
return (0, kind_1.IsTransform)(schema) || Visit(schema.returns, references) || schema.parameters.some((schema) => Visit(schema, references));
}
// prettier-ignore
function FromFunction(schema, references) {
return (0, kind_1.IsTransform)(schema) || Visit(schema.returns, references) || schema.parameters.some((schema) => Visit(schema, references));
}
// prettier-ignore
function FromIntersect(schema, references) {
return (0, kind_1.IsTransform)(schema) || (0, kind_1.IsTransform)(schema.unevaluatedProperties) || schema.allOf.some((schema) => Visit(schema, references));
}
// prettier-ignore
function FromImport(schema, references) {
const additional = globalThis.Object.getOwnPropertyNames(schema.$defs).reduce((result, key) => [...result, schema.$defs[key]], []);
const target = schema.$defs[schema.$ref];
return (0, kind_1.IsTransform)(schema) || Visit(target, [...additional, ...references]);
}
// prettier-ignore
function FromIterator(schema, references) {
return (0, kind_1.IsTransform)(schema) || Visit(schema.items, references);
}
// prettier-ignore
function FromNot(schema, references) {
return (0, kind_1.IsTransform)(schema) || Visit(schema.not, references);
}
// prettier-ignore
function FromObject(schema, references) {
return ((0, kind_1.IsTransform)(schema) ||
Object.values(schema.properties).some((schema) => Visit(schema, references)) ||
((0, kind_1.IsSchema)(schema.additionalProperties) && Visit(schema.additionalProperties, references)));
}
// prettier-ignore
function FromPromise(schema, references) {
return (0, kind_1.IsTransform)(schema) || Visit(schema.item, references);
}
// prettier-ignore
function FromRecord(schema, references) {
const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0];
const property = schema.patternProperties[pattern];
return (0, kind_1.IsTransform)(schema) || Visit(property, references) || ((0, kind_1.IsSchema)(schema.additionalProperties) && (0, kind_1.IsTransform)(schema.additionalProperties));
}
// prettier-ignore
function FromRef(schema, references) {
if ((0, kind_1.IsTransform)(schema))
return true;
return Visit((0, index_1.Deref)(schema, references), references);
}
// prettier-ignore
function FromThis(schema, references) {
if ((0, kind_1.IsTransform)(schema))
return true;
return Visit((0, index_1.Deref)(schema, references), references);
}
// prettier-ignore
function FromTuple(schema, references) {
return (0, kind_1.IsTransform)(schema) || (!(0, index_3.IsUndefined)(schema.items) && schema.items.some((schema) => Visit(schema, references)));
}
// prettier-ignore
function FromUnion(schema, references) {
return (0, kind_1.IsTransform)(schema) || schema.anyOf.some((schema) => Visit(schema, references));
}
// prettier-ignore
function Visit(schema, references) {
const references_ = (0, index_1.Pushref)(schema, references);
const schema_ = schema;
if (schema.$id && visited.has(schema.$id))
return false;
if (schema.$id)
visited.add(schema.$id);
switch (schema[index_2.Kind]) {
case 'Array':
return FromArray(schema_, references_);
case 'AsyncIterator':
return FromAsyncIterator(schema_, references_);
case 'Constructor':
return FromConstructor(schema_, references_);
case 'Function':
return FromFunction(schema_, references_);
case 'Import':
return FromImport(schema_, references_);
case 'Intersect':
return FromIntersect(schema_, references_);
case 'Iterator':
return FromIterator(schema_, references_);
case 'Not':
return FromNot(schema_, references_);
case 'Object':
return FromObject(schema_, references_);
case 'Promise':
return FromPromise(schema_, references_);
case 'Record':
return FromRecord(schema_, references_);
case 'Ref':
return FromRef(schema_, references_);
case 'This':
return FromThis(schema_, references_);
case 'Tuple':
return FromTuple(schema_, references_);
case 'Union':
return FromUnion(schema_, references_);
default:
return (0, kind_1.IsTransform)(schema);
}
}
const visited = new Set();
/** Returns true if this schema contains a transform codec */
function HasTransform(schema, references) {
visited.clear();
return Visit(schema, references);
}
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more