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,23 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, OctetString } from "@peculiar/asn1-schema";
import { CMSVersion, KeyDerivationAlgorithmIdentifier, KeyEncryptionAlgorithmIdentifier, } from "./types";
export class PasswordRecipientInfo {
constructor(params = {}) {
this.version = CMSVersion.v0;
this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
this.encryptedKey = new OctetString();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.Integer })
], PasswordRecipientInfo.prototype, "version", void 0);
__decorate([
AsnProp({ type: KeyDerivationAlgorithmIdentifier, context: 0, optional: true })
], PasswordRecipientInfo.prototype, "keyDerivationAlgorithm", void 0);
__decorate([
AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
], PasswordRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
__decorate([
AsnProp({ type: OctetString })
], PasswordRecipientInfo.prototype, "encryptedKey", void 0);
@@ -0,0 +1,187 @@
export default `tlf2a 1 1 3 -1 15 0 0 0
===============================================================================
This is circle.tlf, or “Circle”, by Sam Hocevar <sam@hocevar.net>. It was
created on October 1st, 2006.
This font is free software. It comes without any warranty, to the extent
permitted by applicable law. You can redistribute it and/or modify it under
the terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more
details.
Missing: ! " # $ % & ' ( ) , : ; < > ? @ [ \\ ] ^ _ \` { | } ~ Ä Ö Ü ä ö ü ß
This font is part of TOIlet’s official distribution. More information
on the TOIlet website at http://caca.zoy.org/wiki/toilet
===============================================================================
@
!@
"@
#@
$@
%@
&@
'@
(@
)@
⊛*
⊕+
,@
⊖-
⊙.
⊘/
⓪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
{@
|@
}@
~@
Ä@
Ö@
Ü@
ä@
ö@
ü@
ß@
0x3131 ㄱ HANGUL LETTER KIYEOK
㉠@
0x3134 ㄴ HANGUL LETTER NIEUN
㉡@
0x3137 ㄷ HANGUL LETTER TIKEUT
㉢@
0x3139 ㄹ HANGUL LETTER RIEUL
㉣@
0x3141 ㅁ HANGUL LETTER MIEUM
㉤@
0x3142 ㅂ HANGUL LETTER PIEUP
㉥@
0x3145 ㅅ HANGUL LETTER SIOS
㉦@
0x3147 ㅇ HANGUL LETTER IEUNG
㉧@
0x3148 ㅈ HANGUL LETTER CIEUC
㉨@
0x314A ㅊ HANGUL LETTER CHIEUCH
㉩@
0x314B ㅋ HANGUL LETTER KHIEUKH
㉪@
0x314C ㅌ HANGUL LETTER THIEUTH
㉫@
0x314D ㅍ HANGUL LETTER PHIEUPH
㉬@
0x314E ㅎ HANGUL LETTER HIEUH
㉭@
0xAC00 가 HANGUL SYLLABLE GA
㉮@
0xB098 나 HANGUL SYLLABLE NA
㉯@
0xB2E4 다 HANGUL SYLLABLE DA
㉰@
0xB77C 라 HANGUL SYLLABLE RA
㉱@
0xB9C8 마 HANGUL SYLLABLE MA
㉲@
0xBC14 바 HANGUL SYLLABLE BA
㉳@
0xC0AC 사 HANGUL SYLLABLE SA
㉴@
0xC544 아 HANGUL SYLLABLE A
㉵@
0xC790 자 HANGUL SYLLABLE JA
㉶@
0xCC28 차 HANGUL SYLLABLE CA
㉷@
0xCE74 카 HANGUL SYLLABLE KA
㉸@
0xD0C0 타 HANGUL SYLLABLE TA
㉹@
0xD30C 파 HANGUL SYLLABLE PA
㉺@
0xD558 하 HANGUL SYLLABLE HA
㉻@
0x6B63 正 CJK UNIFIED IDEOGRAPH-6B63
㊣@
0x4E0A 上 CJK UNIFIED IDEOGRAPH-4E0A
㊤@
0x4E2D 中 CJK UNIFIED IDEOGRAPH-4E2D
㊥@
0x4E0B 下 CJK UNIFIED IDEOGRAPH-4E0B
㊦@
0x5DE6 左 CJK UNIFIED IDEOGRAPH-5DE6
㊧@
0x53F3 右 CJK UNIFIED IDEOGRAPH-53F3
㊨@
`
@@ -0,0 +1 @@
{"version":3,"file":"multiInject.js","sourceRoot":"","sources":["../../../../src/metadata/decorators/multiInject.ts"],"names":[],"mappings":";;AAUA,kCAaC;AArBD,sGAAmG;AACnG,yIAAsI;AAEtI,iFAA8E;AAG9E,6CAA0C;AAE1C,SAAgB,WAAW,CACzB,iBAA4D,EAC5D,OAA4B;IAE5B,MAAM,cAAc,GAEQ,IAAA,qGAAiD,EAC3E,mDAAwB,CAAC,iBAAiB,EAC1C,iBAAiB,EACjB,OAAO,CACR,CAAC;IAEF,OAAO,IAAA,uBAAU,EAAC,cAAc,EAAE,uEAAkC,CAAC,CAAC;AACxE,CAAC"}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=isNotParentBindingConstraintsWithServiceId.spec.d.ts.map
@@ -0,0 +1,134 @@
/*
* 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.
*/
// Portions of the code in this file are based on code from react.
// Original licensing for the following can be found in the
// NOTICE file in the root directory of this source tree.
// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
import {getOwnerDocument, useEffectEvent} from '@react-aria/utils';
import {RefObject} from '@react-types/shared';
import {useEffect, useRef} from 'react';
export interface InteractOutsideProps {
ref: RefObject<Element | null>,
onInteractOutside?: (e: PointerEvent) => void,
onInteractOutsideStart?: (e: PointerEvent) => void,
/** Whether the interact outside events should be disabled. */
isDisabled?: boolean
}
/**
* Example, used in components like Dialogs and Popovers so they can close
* when a user clicks outside them.
*/
export function useInteractOutside(props: InteractOutsideProps) {
let {ref, onInteractOutside, isDisabled, onInteractOutsideStart} = props;
let stateRef = useRef({
isPointerDown: false,
ignoreEmulatedMouseEvents: false
});
let onPointerDown = useEffectEvent((e) => {
if (onInteractOutside && isValidEvent(e, ref)) {
if (onInteractOutsideStart) {
onInteractOutsideStart(e);
}
stateRef.current.isPointerDown = true;
}
});
let triggerInteractOutside = useEffectEvent((e: PointerEvent) => {
if (onInteractOutside) {
onInteractOutside(e);
}
});
useEffect(() => {
let state = stateRef.current;
if (isDisabled) {
return;
}
const element = ref.current;
const documentObject = getOwnerDocument(element);
// Use pointer events if available. Otherwise, fall back to mouse and touch events.
if (typeof PointerEvent !== 'undefined') {
let onPointerUp = (e) => {
if (state.isPointerDown && isValidEvent(e, ref)) {
triggerInteractOutside(e);
}
state.isPointerDown = false;
};
// changing these to capture phase fixed combobox
documentObject.addEventListener('pointerdown', onPointerDown, true);
documentObject.addEventListener('pointerup', onPointerUp, true);
return () => {
documentObject.removeEventListener('pointerdown', onPointerDown, true);
documentObject.removeEventListener('pointerup', onPointerUp, true);
};
} else {
let onMouseUp = (e) => {
if (state.ignoreEmulatedMouseEvents) {
state.ignoreEmulatedMouseEvents = false;
} else if (state.isPointerDown && isValidEvent(e, ref)) {
triggerInteractOutside(e);
}
state.isPointerDown = false;
};
let onTouchEnd = (e) => {
state.ignoreEmulatedMouseEvents = true;
if (state.isPointerDown && isValidEvent(e, ref)) {
triggerInteractOutside(e);
}
state.isPointerDown = false;
};
documentObject.addEventListener('mousedown', onPointerDown, true);
documentObject.addEventListener('mouseup', onMouseUp, true);
documentObject.addEventListener('touchstart', onPointerDown, true);
documentObject.addEventListener('touchend', onTouchEnd, true);
return () => {
documentObject.removeEventListener('mousedown', onPointerDown, true);
documentObject.removeEventListener('mouseup', onMouseUp, true);
documentObject.removeEventListener('touchstart', onPointerDown, true);
documentObject.removeEventListener('touchend', onTouchEnd, true);
};
}
}, [ref, isDisabled, onPointerDown, triggerInteractOutside]);
}
function isValidEvent(event, ref) {
if (event.button > 0) {
return false;
}
if (event.target) {
// if the event target is no longer in the document, ignore
const ownerDocument = event.target.ownerDocument;
if (!ownerDocument || !ownerDocument.documentElement.contains(event.target)) {
return false;
}
// If the target is within a top layer element (e.g. toasts), ignore.
if (event.target.closest('[data-react-aria-top-layer]')) {
return false;
}
}
return ref.current && !ref.current.contains(event.target);
}
@@ -0,0 +1,7 @@
'use strict';
// https://262.ecma-international.org/5.1/#sec-7.3
module.exports = function isLineTerminator(c) {
return c === '\n' || c === '\r' || c === '\u2028' || c === '\u2029';
};
@@ -0,0 +1,654 @@
/**
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { CircularList, IInsertEvent } from 'common/CircularList';
import { IdleTaskQueue } from 'common/TaskQueue';
import { IAttributeData, IBufferLine, ICellData, ICharset } from 'common/Types';
import { ExtendedAttrs } from 'common/buffer/AttributeData';
import { BufferLine, DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';
import { getWrappedLineTrimmedLength, reflowLargerApplyNewLayout, reflowLargerCreateNewLayout, reflowLargerGetLinesToRemove, reflowSmallerGetNewLineLengths } from 'common/buffer/BufferReflow';
import { CellData } from 'common/buffer/CellData';
import { NULL_CELL_CHAR, NULL_CELL_CODE, NULL_CELL_WIDTH, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_CODE, WHITESPACE_CELL_WIDTH } from 'common/buffer/Constants';
import { Marker } from 'common/buffer/Marker';
import { IBuffer } from 'common/buffer/Types';
import { DEFAULT_CHARSET } from 'common/data/Charsets';
import { IBufferService, IOptionsService } from 'common/services/Services';
export const MAX_BUFFER_SIZE = 4294967295; // 2^32 - 1
/**
* This class represents a terminal buffer (an internal state of the terminal), where the
* following information is stored (in high-level):
* - text content of this particular buffer
* - cursor position
* - scroll position
*/
export class Buffer implements IBuffer {
public lines: CircularList<IBufferLine>;
public ydisp: number = 0;
public ybase: number = 0;
public y: number = 0;
public x: number = 0;
public scrollBottom: number;
public scrollTop: number;
public tabs: { [column: number]: boolean | undefined } = {};
public savedY: number = 0;
public savedX: number = 0;
public savedCurAttrData = DEFAULT_ATTR_DATA.clone();
public savedCharset: ICharset | undefined = DEFAULT_CHARSET;
public markers: Marker[] = [];
private _nullCell: ICellData = CellData.fromCharData([0, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]);
private _whitespaceCell: ICellData = CellData.fromCharData([0, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_WIDTH, WHITESPACE_CELL_CODE]);
private _cols: number;
private _rows: number;
private _isClearing: boolean = false;
constructor(
private _hasScrollback: boolean,
private _optionsService: IOptionsService,
private _bufferService: IBufferService
) {
this._cols = this._bufferService.cols;
this._rows = this._bufferService.rows;
this.lines = new CircularList<IBufferLine>(this._getCorrectBufferLength(this._rows));
this.scrollTop = 0;
this.scrollBottom = this._rows - 1;
this.setupTabStops();
}
public getNullCell(attr?: IAttributeData): ICellData {
if (attr) {
this._nullCell.fg = attr.fg;
this._nullCell.bg = attr.bg;
this._nullCell.extended = attr.extended;
} else {
this._nullCell.fg = 0;
this._nullCell.bg = 0;
this._nullCell.extended = new ExtendedAttrs();
}
return this._nullCell;
}
public getWhitespaceCell(attr?: IAttributeData): ICellData {
if (attr) {
this._whitespaceCell.fg = attr.fg;
this._whitespaceCell.bg = attr.bg;
this._whitespaceCell.extended = attr.extended;
} else {
this._whitespaceCell.fg = 0;
this._whitespaceCell.bg = 0;
this._whitespaceCell.extended = new ExtendedAttrs();
}
return this._whitespaceCell;
}
public getBlankLine(attr: IAttributeData, isWrapped?: boolean): IBufferLine {
return new BufferLine(this._bufferService.cols, this.getNullCell(attr), isWrapped);
}
public get hasScrollback(): boolean {
return this._hasScrollback && this.lines.maxLength > this._rows;
}
public get isCursorInViewport(): boolean {
const absoluteY = this.ybase + this.y;
const relativeY = absoluteY - this.ydisp;
return (relativeY >= 0 && relativeY < this._rows);
}
/**
* Gets the correct buffer length based on the rows provided, the terminal's
* scrollback and whether this buffer is flagged to have scrollback or not.
* @param rows The terminal rows to use in the calculation.
*/
private _getCorrectBufferLength(rows: number): number {
if (!this._hasScrollback) {
return rows;
}
const correctBufferLength = rows + this._optionsService.rawOptions.scrollback;
return correctBufferLength > MAX_BUFFER_SIZE ? MAX_BUFFER_SIZE : correctBufferLength;
}
/**
* Fills the buffer's viewport with blank lines.
*/
public fillViewportRows(fillAttr?: IAttributeData): void {
if (this.lines.length === 0) {
if (fillAttr === undefined) {
fillAttr = DEFAULT_ATTR_DATA;
}
let i = this._rows;
while (i--) {
this.lines.push(this.getBlankLine(fillAttr));
}
}
}
/**
* Clears the buffer to it's initial state, discarding all previous data.
*/
public clear(): void {
this.ydisp = 0;
this.ybase = 0;
this.y = 0;
this.x = 0;
this.lines = new CircularList<IBufferLine>(this._getCorrectBufferLength(this._rows));
this.scrollTop = 0;
this.scrollBottom = this._rows - 1;
this.setupTabStops();
}
/**
* Resizes the buffer, adjusting its data accordingly.
* @param newCols The new number of columns.
* @param newRows The new number of rows.
*/
public resize(newCols: number, newRows: number): void {
// store reference to null cell with default attrs
const nullCell = this.getNullCell(DEFAULT_ATTR_DATA);
// count bufferlines with overly big memory to be cleaned afterwards
let dirtyMemoryLines = 0;
// Increase max length if needed before adjustments to allow space to fill
// as required.
const newMaxLength = this._getCorrectBufferLength(newRows);
if (newMaxLength > this.lines.maxLength) {
this.lines.maxLength = newMaxLength;
}
// The following adjustments should only happen if the buffer has been
// initialized/filled.
if (this.lines.length > 0) {
// Deal with columns increasing (reducing needs to happen after reflow)
if (this._cols < newCols) {
for (let i = 0; i < this.lines.length; i++) {
// +boolean for fast 0 or 1 conversion
dirtyMemoryLines += +this.lines.get(i)!.resize(newCols, nullCell);
}
}
// Resize rows in both directions as needed
let addToY = 0;
if (this._rows < newRows) {
for (let y = this._rows; y < newRows; y++) {
if (this.lines.length < newRows + this.ybase) {
if (this._optionsService.rawOptions.windowsMode || this._optionsService.rawOptions.windowsPty.backend !== undefined || this._optionsService.rawOptions.windowsPty.buildNumber !== undefined) {
// Just add the new missing rows on Windows as conpty reprints the screen with it's
// view of the world. Once a line enters scrollback for conpty it remains there
this.lines.push(new BufferLine(newCols, nullCell));
} else {
if (this.ybase > 0 && this.lines.length <= this.ybase + this.y + addToY + 1) {
// There is room above the buffer and there are no empty elements below the line,
// scroll up
this.ybase--;
addToY++;
if (this.ydisp > 0) {
// Viewport is at the top of the buffer, must increase downwards
this.ydisp--;
}
} else {
// Add a blank line if there is no buffer left at the top to scroll to, or if there
// are blank lines after the cursor
this.lines.push(new BufferLine(newCols, nullCell));
}
}
}
}
} else { // (this._rows >= newRows)
for (let y = this._rows; y > newRows; y--) {
if (this.lines.length > newRows + this.ybase) {
if (this.lines.length > this.ybase + this.y + 1) {
// The line is a blank line below the cursor, remove it
this.lines.pop();
} else {
// The line is the cursor, scroll down
this.ybase++;
this.ydisp++;
}
}
}
}
// Reduce max length if needed after adjustments, this is done after as it
// would otherwise cut data from the bottom of the buffer.
if (newMaxLength < this.lines.maxLength) {
// Trim from the top of the buffer and adjust ybase and ydisp.
const amountToTrim = this.lines.length - newMaxLength;
if (amountToTrim > 0) {
this.lines.trimStart(amountToTrim);
this.ybase = Math.max(this.ybase - amountToTrim, 0);
this.ydisp = Math.max(this.ydisp - amountToTrim, 0);
this.savedY = Math.max(this.savedY - amountToTrim, 0);
}
this.lines.maxLength = newMaxLength;
}
// Make sure that the cursor stays on screen
this.x = Math.min(this.x, newCols - 1);
this.y = Math.min(this.y, newRows - 1);
if (addToY) {
this.y += addToY;
}
this.savedX = Math.min(this.savedX, newCols - 1);
this.scrollTop = 0;
}
this.scrollBottom = newRows - 1;
if (this._isReflowEnabled) {
this._reflow(newCols, newRows);
// Trim the end of the line off if cols shrunk
if (this._cols > newCols) {
for (let i = 0; i < this.lines.length; i++) {
// +boolean for fast 0 or 1 conversion
dirtyMemoryLines += +this.lines.get(i)!.resize(newCols, nullCell);
}
}
}
this._cols = newCols;
this._rows = newRows;
this._memoryCleanupQueue.clear();
// schedule memory cleanup only, if more than 10% of the lines are affected
if (dirtyMemoryLines > 0.1 * this.lines.length) {
this._memoryCleanupPosition = 0;
this._memoryCleanupQueue.enqueue(() => this._batchedMemoryCleanup());
}
}
private _memoryCleanupQueue = new IdleTaskQueue();
private _memoryCleanupPosition = 0;
private _batchedMemoryCleanup(): boolean {
let normalRun = true;
if (this._memoryCleanupPosition >= this.lines.length) {
// cleanup made it once through all lines, thus rescan in loop below to also catch shifted
// lines, which should finish rather quick if there are no more cleanups pending
this._memoryCleanupPosition = 0;
normalRun = false;
}
let counted = 0;
while (this._memoryCleanupPosition < this.lines.length) {
counted += this.lines.get(this._memoryCleanupPosition++)!.cleanupMemory();
// cleanup max 100 lines per batch
if (counted > 100) {
return true;
}
}
// normal runs always need another rescan afterwards
// if we made it here with normalRun=false, we are in a final run
// and can end the cleanup task for sure
return normalRun;
}
private get _isReflowEnabled(): boolean {
const windowsPty = this._optionsService.rawOptions.windowsPty;
if (windowsPty && windowsPty.buildNumber) {
return this._hasScrollback && windowsPty.backend === 'conpty' && windowsPty.buildNumber >= 21376;
}
return this._hasScrollback && !this._optionsService.rawOptions.windowsMode;
}
private _reflow(newCols: number, newRows: number): void {
if (this._cols === newCols) {
return;
}
// Iterate through rows, ignore the last one as it cannot be wrapped
if (newCols > this._cols) {
this._reflowLarger(newCols, newRows);
} else {
this._reflowSmaller(newCols, newRows);
}
}
private _reflowLarger(newCols: number, newRows: number): void {
const toRemove: number[] = reflowLargerGetLinesToRemove(this.lines, this._cols, newCols, this.ybase + this.y, this.getNullCell(DEFAULT_ATTR_DATA));
if (toRemove.length > 0) {
const newLayoutResult = reflowLargerCreateNewLayout(this.lines, toRemove);
reflowLargerApplyNewLayout(this.lines, newLayoutResult.layout);
this._reflowLargerAdjustViewport(newCols, newRows, newLayoutResult.countRemoved);
}
}
private _reflowLargerAdjustViewport(newCols: number, newRows: number, countRemoved: number): void {
const nullCell = this.getNullCell(DEFAULT_ATTR_DATA);
// Adjust viewport based on number of items removed
let viewportAdjustments = countRemoved;
while (viewportAdjustments-- > 0) {
if (this.ybase === 0) {
if (this.y > 0) {
this.y--;
}
if (this.lines.length < newRows) {
// Add an extra row at the bottom of the viewport
this.lines.push(new BufferLine(newCols, nullCell));
}
} else {
if (this.ydisp === this.ybase) {
this.ydisp--;
}
this.ybase--;
}
}
this.savedY = Math.max(this.savedY - countRemoved, 0);
}
private _reflowSmaller(newCols: number, newRows: number): void {
const nullCell = this.getNullCell(DEFAULT_ATTR_DATA);
// Gather all BufferLines that need to be inserted into the Buffer here so that they can be
// batched up and only committed once
const toInsert = [];
let countToInsert = 0;
// Go backwards as many lines may be trimmed and this will avoid considering them
for (let y = this.lines.length - 1; y >= 0; y--) {
// Check whether this line is a problem
let nextLine = this.lines.get(y) as BufferLine;
if (!nextLine || !nextLine.isWrapped && nextLine.getTrimmedLength() <= newCols) {
continue;
}
// Gather wrapped lines and adjust y to be the starting line
const wrappedLines: BufferLine[] = [nextLine];
while (nextLine.isWrapped && y > 0) {
nextLine = this.lines.get(--y) as BufferLine;
wrappedLines.unshift(nextLine);
}
// If these lines contain the cursor don't touch them, the program will handle fixing up
// wrapped lines with the cursor
const absoluteY = this.ybase + this.y;
if (absoluteY >= y && absoluteY < y + wrappedLines.length) {
continue;
}
const lastLineLength = wrappedLines[wrappedLines.length - 1].getTrimmedLength();
const destLineLengths = reflowSmallerGetNewLineLengths(wrappedLines, this._cols, newCols);
const linesToAdd = destLineLengths.length - wrappedLines.length;
let trimmedLines: number;
if (this.ybase === 0 && this.y !== this.lines.length - 1) {
// If the top section of the buffer is not yet filled
trimmedLines = Math.max(0, this.y - this.lines.maxLength + linesToAdd);
} else {
trimmedLines = Math.max(0, this.lines.length - this.lines.maxLength + linesToAdd);
}
// Add the new lines
const newLines: BufferLine[] = [];
for (let i = 0; i < linesToAdd; i++) {
const newLine = this.getBlankLine(DEFAULT_ATTR_DATA, true) as BufferLine;
newLines.push(newLine);
}
if (newLines.length > 0) {
toInsert.push({
// countToInsert here gets the actual index, taking into account other inserted items.
// using this we can iterate through the list forwards
start: y + wrappedLines.length + countToInsert,
newLines
});
countToInsert += newLines.length;
}
wrappedLines.push(...newLines);
// Copy buffer data to new locations, this needs to happen backwards to do in-place
let destLineIndex = destLineLengths.length - 1; // Math.floor(cellsNeeded / newCols);
let destCol = destLineLengths[destLineIndex]; // cellsNeeded % newCols;
if (destCol === 0) {
destLineIndex--;
destCol = destLineLengths[destLineIndex];
}
let srcLineIndex = wrappedLines.length - linesToAdd - 1;
let srcCol = lastLineLength;
while (srcLineIndex >= 0) {
const cellsToCopy = Math.min(srcCol, destCol);
if (wrappedLines[destLineIndex] === undefined) {
// Sanity check that the line exists, this has been known to fail for an unknown reason
// which would stop the reflow from happening if an exception would throw.
break;
}
wrappedLines[destLineIndex].copyCellsFrom(wrappedLines[srcLineIndex], srcCol - cellsToCopy, destCol - cellsToCopy, cellsToCopy, true);
destCol -= cellsToCopy;
if (destCol === 0) {
destLineIndex--;
destCol = destLineLengths[destLineIndex];
}
srcCol -= cellsToCopy;
if (srcCol === 0) {
srcLineIndex--;
const wrappedLinesIndex = Math.max(srcLineIndex, 0);
srcCol = getWrappedLineTrimmedLength(wrappedLines, wrappedLinesIndex, this._cols);
}
}
// Null out the end of the line ends if a wide character wrapped to the following line
for (let i = 0; i < wrappedLines.length; i++) {
if (destLineLengths[i] < newCols) {
wrappedLines[i].setCell(destLineLengths[i], nullCell);
}
}
// Adjust viewport as needed
let viewportAdjustments = linesToAdd - trimmedLines;
while (viewportAdjustments-- > 0) {
if (this.ybase === 0) {
if (this.y < newRows - 1) {
this.y++;
this.lines.pop();
} else {
this.ybase++;
this.ydisp++;
}
} else {
// Ensure ybase does not exceed its maximum value
if (this.ybase < Math.min(this.lines.maxLength, this.lines.length + countToInsert) - newRows) {
if (this.ybase === this.ydisp) {
this.ydisp++;
}
this.ybase++;
}
}
}
this.savedY = Math.min(this.savedY + linesToAdd, this.ybase + newRows - 1);
}
// Rearrange lines in the buffer if there are any insertions, this is done at the end rather
// than earlier so that it's a single O(n) pass through the buffer, instead of O(n^2) from many
// costly calls to CircularList.splice.
if (toInsert.length > 0) {
// Record buffer insert events and then play them back backwards so that the indexes are
// correct
const insertEvents: IInsertEvent[] = [];
// Record original lines so they don't get overridden when we rearrange the list
const originalLines: BufferLine[] = [];
for (let i = 0; i < this.lines.length; i++) {
originalLines.push(this.lines.get(i) as BufferLine);
}
const originalLinesLength = this.lines.length;
let originalLineIndex = originalLinesLength - 1;
let nextToInsertIndex = 0;
let nextToInsert = toInsert[nextToInsertIndex];
this.lines.length = Math.min(this.lines.maxLength, this.lines.length + countToInsert);
let countInsertedSoFar = 0;
for (let i = Math.min(this.lines.maxLength - 1, originalLinesLength + countToInsert - 1); i >= 0; i--) {
if (nextToInsert && nextToInsert.start > originalLineIndex + countInsertedSoFar) {
// Insert extra lines here, adjusting i as needed
for (let nextI = nextToInsert.newLines.length - 1; nextI >= 0; nextI--) {
this.lines.set(i--, nextToInsert.newLines[nextI]);
}
i++;
// Create insert events for later
insertEvents.push({
index: originalLineIndex + 1,
amount: nextToInsert.newLines.length
});
countInsertedSoFar += nextToInsert.newLines.length;
nextToInsert = toInsert[++nextToInsertIndex];
} else {
this.lines.set(i, originalLines[originalLineIndex--]);
}
}
// Update markers
let insertCountEmitted = 0;
for (let i = insertEvents.length - 1; i >= 0; i--) {
insertEvents[i].index += insertCountEmitted;
this.lines.onInsertEmitter.fire(insertEvents[i]);
insertCountEmitted += insertEvents[i].amount;
}
const amountToTrim = Math.max(0, originalLinesLength + countToInsert - this.lines.maxLength);
if (amountToTrim > 0) {
this.lines.onTrimEmitter.fire(amountToTrim);
}
}
}
/**
* Translates a buffer line to a string, with optional start and end columns.
* Wide characters will count as two columns in the resulting string. This
* function is useful for getting the actual text underneath the raw selection
* position.
* @param lineIndex The absolute index of the line being translated.
* @param trimRight Whether to trim whitespace to the right.
* @param startCol The column to start at.
* @param endCol The column to end at.
*/
public translateBufferLineToString(lineIndex: number, trimRight: boolean, startCol: number = 0, endCol?: number): string {
const line = this.lines.get(lineIndex);
if (!line) {
return '';
}
return line.translateToString(trimRight, startCol, endCol);
}
public getWrappedRangeForLine(y: number): { first: number, last: number } {
let first = y;
let last = y;
// Scan upwards for wrapped lines
while (first > 0 && this.lines.get(first)!.isWrapped) {
first--;
}
// Scan downwards for wrapped lines
while (last + 1 < this.lines.length && this.lines.get(last + 1)!.isWrapped) {
last++;
}
return { first, last };
}
/**
* Setup the tab stops.
* @param i The index to start setting up tab stops from.
*/
public setupTabStops(i?: number): void {
if (i !== null && i !== undefined) {
if (!this.tabs[i]) {
i = this.prevStop(i);
}
} else {
this.tabs = {};
i = 0;
}
for (; i < this._cols; i += this._optionsService.rawOptions.tabStopWidth) {
this.tabs[i] = true;
}
}
/**
* Move the cursor to the previous tab stop from the given position (default is current).
* @param x The position to move the cursor to the previous tab stop.
*/
public prevStop(x?: number): number {
if (x === null || x === undefined) {
x = this.x;
}
while (!this.tabs[--x] && x > 0);
return x >= this._cols ? this._cols - 1 : x < 0 ? 0 : x;
}
/**
* Move the cursor one tab stop forward from the given position (default is current).
* @param x The position to move the cursor one tab stop forward.
*/
public nextStop(x?: number): number {
if (x === null || x === undefined) {
x = this.x;
}
while (!this.tabs[++x] && x < this._cols);
return x >= this._cols ? this._cols - 1 : x < 0 ? 0 : x;
}
/**
* Clears markers on single line.
* @param y The line to clear.
*/
public clearMarkers(y: number): void {
this._isClearing = true;
for (let i = 0; i < this.markers.length; i++) {
if (this.markers[i].line === y) {
this.markers[i].dispose();
this.markers.splice(i--, 1);
}
}
this._isClearing = false;
}
/**
* Clears markers on all lines
*/
public clearAllMarkers(): void {
this._isClearing = true;
for (let i = 0; i < this.markers.length; i++) {
this.markers[i].dispose();
this.markers.splice(i--, 1);
}
this._isClearing = false;
}
public addMarker(y: number): Marker {
const marker = new Marker(y);
this.markers.push(marker);
marker.register(this.lines.onTrim(amount => {
marker.line -= amount;
// The marker should be disposed when the line is trimmed from the buffer
if (marker.line < 0) {
marker.dispose();
}
}));
marker.register(this.lines.onInsert(event => {
if (marker.line >= event.index) {
marker.line += event.amount;
}
}));
marker.register(this.lines.onDelete(event => {
// Delete the marker if it's within the range
if (marker.line >= event.index && marker.line < event.index + event.amount) {
marker.dispose();
}
// Shift the marker if it's after the deleted range
if (marker.line > event.index) {
marker.line -= event.amount;
}
}));
marker.register(marker.onDispose(() => this._removeMarker(marker)));
return marker;
}
private _removeMarker(marker: Marker): void {
if (!this._isClearing) {
this.markers.splice(this.markers.indexOf(marker), 1);
}
}
}
@@ -0,0 +1,30 @@
export {
_lt as lt,
_lte as lte,
_gt as gt,
_gte as gte,
_positive as positive,
_negative as negative,
_nonpositive as nonpositive,
_nonnegative as nonnegative,
_multipleOf as multipleOf,
_maxSize as maxSize,
_minSize as minSize,
_size as size,
_maxLength as maxLength,
_minLength as minLength,
_length as length,
_regex as regex,
_lowercase as lowercase,
_uppercase as uppercase,
_includes as includes,
_startsWith as startsWith,
_endsWith as endsWith,
_property as property,
_mime as mime,
_overwrite as overwrite,
_normalize as normalize,
_trim as trim,
_toLowerCase as toLowerCase,
_toUpperCase as toUpperCase,
} from "../core/index.js";
@@ -0,0 +1 @@
{"name":"@types/ws","version":"8.18.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532089978,"integrity":"sha512-HQaIQk9pwOcyKutyDk4o2a87WnotwYuLGYFW43emGm4FvIJFKPyg+OYaw5sTegKAKf+C5SKa1ACjzCLivbaHrQ==","mode":420,"size":1141},"README.md":{"checkedAt":1794532103497,"integrity":"sha512-5TPrXZeQOBrrEzcF7vZxLtsW68dFC7VT1c1UcVTwSgFqnCIq1xuvejFUNvRVPHVx2vuUmUFZ/ivsBXs1TbT8cg==","mode":420,"size":810},"index.d.mts":{"checkedAt":1794532103497,"integrity":"sha512-gpK//Fr/+iPhTvK4tMN4OuE1KXmqMinNSYhXClBUFerf6s06A+JpI3fxVkDbaD5rugcJArrgu8WKLT/nicsHZQ==","mode":420,"size":19317},"index.d.ts":{"checkedAt":1794532103497,"integrity":"sha512-mCKFG+r47E3SNe8k8fzWlcd06u5U3eRhrQfuhoBbMzOZ45D3dm2mOinXzYoQn/sph29CZvqb2R7cebIBcfODiA==","mode":420,"size":19007},"package.json":{"checkedAt":1794532103498,"integrity":"sha512-BTgMytFsgQ6fA8ftdyduJGfD4GaaN9pIH5EhvIwGOfGfvz+v32/xq1w+1BNCuW8E4dRG11yHZBq4Lek9zNkTaQ==","mode":420,"size":2072}}}
@@ -0,0 +1,3 @@
import { MaybeClassElementMetadata } from '../models/MaybeClassElementMetadata';
export declare function incrementPendingClassMetadataCount(type: object): (metadata: MaybeClassElementMetadata | undefined) => void;
//# sourceMappingURL=incrementPendingClassMetadataCount.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.esm.js","sources":["../src/timer.js","../src/domHelpers.js","../src/createGridComponent.js","../src/VariableSizeGrid.js","../src/createListComponent.js","../src/VariableSizeList.js","../src/FixedSizeGrid.js","../src/FixedSizeList.js","../src/shallowDiffers.js","../src/areEqual.js","../src/shouldComponentUpdate.js"],"sourcesContent":["// @flow\n\n// Animation frame based implementation of setTimeout.\n// Inspired by Joe Lambert, https://gist.github.com/joelambert/1002116#file-requesttimeout-js\n\nconst hasNativePerformanceNow =\n typeof performance === 'object' && typeof performance.now === 'function';\n\nconst now = hasNativePerformanceNow\n ? () => performance.now()\n : () => Date.now();\n\nexport type TimeoutID = {|\n id: AnimationFrameID,\n|};\n\nexport function cancelTimeout(timeoutID: TimeoutID) {\n cancelAnimationFrame(timeoutID.id);\n}\n\nexport function requestTimeout(callback: Function, delay: number): TimeoutID {\n const start = now();\n\n function tick() {\n if (now() - start >= delay) {\n callback.call(null);\n } else {\n timeoutID.id = requestAnimationFrame(tick);\n }\n }\n\n const timeoutID: TimeoutID = {\n id: requestAnimationFrame(tick),\n };\n\n return timeoutID;\n}\n","// @flow\n\nlet size: number = -1;\n\n// This utility copied from \"dom-helpers\" package.\nexport function getScrollbarSize(recalculate?: boolean = false): number {\n if (size === -1 || recalculate) {\n const div = document.createElement('div');\n const style = div.style;\n style.width = '50px';\n style.height = '50px';\n style.overflow = 'scroll';\n\n ((document.body: any): HTMLBodyElement).appendChild(div);\n\n size = div.offsetWidth - div.clientWidth;\n\n ((document.body: any): HTMLBodyElement).removeChild(div);\n }\n\n return size;\n}\n\nexport type RTLOffsetType =\n | 'negative'\n | 'positive-descending'\n | 'positive-ascending';\n\nlet cachedRTLResult: RTLOffsetType | null = null;\n\n// TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.\n// Chrome does not seem to adhere; its scrollLeft values are positive (measured relative to the left).\n// Safari's elastic bounce makes detecting this even more complicated wrt potential false positives.\n// The safest way to check this is to intentionally set a negative offset,\n// and then verify that the subsequent \"scroll\" event matches the negative offset.\n// If it does not match, then we can assume a non-standard RTL scroll implementation.\nexport function getRTLOffsetType(recalculate?: boolean = false): RTLOffsetType {\n if (cachedRTLResult === null || recalculate) {\n const outerDiv = document.createElement('div');\n const outerStyle = outerDiv.style;\n outerStyle.width = '50px';\n outerStyle.height = '50px';\n outerStyle.overflow = 'scroll';\n outerStyle.direction = 'rtl';\n\n const innerDiv = document.createElement('div');\n const innerStyle = innerDiv.style;\n innerStyle.width = '100px';\n innerStyle.height = '100px';\n\n outerDiv.appendChild(innerDiv);\n\n ((document.body: any): HTMLBodyElement).appendChild(outerDiv);\n\n if (outerDiv.scrollLeft > 0) {\n cachedRTLResult = 'positive-descending';\n } else {\n outerDiv.scrollLeft = 1;\n if (outerDiv.scrollLeft === 0) {\n cachedRTLResult = 'negative';\n } else {\n cachedRTLResult = 'positive-ascending';\n }\n }\n\n ((document.body: any): HTMLBodyElement).removeChild(outerDiv);\n\n return cachedRTLResult;\n }\n\n return cachedRTLResult;\n}\n","// @flow\n\nimport memoizeOne from 'memoize-one';\nimport { createElement, PureComponent } from 'react';\nimport { cancelTimeout, requestTimeout } from './timer';\nimport { getScrollbarSize, getRTLOffsetType } from './domHelpers';\n\nimport type { TimeoutID } from './timer';\n\ntype Direction = 'ltr' | 'rtl';\nexport type ScrollToAlign = 'auto' | 'smart' | 'center' | 'start' | 'end';\n\ntype itemSize = number | ((index: number) => number);\n\ntype RenderComponentProps<T> = {|\n columnIndex: number,\n data: T,\n isScrolling?: boolean,\n rowIndex: number,\n style: Object,\n|};\nexport type RenderComponent<T> = React$ComponentType<\n $Shape<RenderComponentProps<T>>\n>;\n\ntype ScrollDirection = 'forward' | 'backward';\n\ntype OnItemsRenderedCallback = ({\n overscanColumnStartIndex: number,\n overscanColumnStopIndex: number,\n overscanRowStartIndex: number,\n overscanRowStopIndex: number,\n visibleColumnStartIndex: number,\n visibleColumnStopIndex: number,\n visibleRowStartIndex: number,\n visibleRowStopIndex: number,\n}) => void;\ntype OnScrollCallback = ({\n horizontalScrollDirection: ScrollDirection,\n scrollLeft: number,\n scrollTop: number,\n scrollUpdateWasRequested: boolean,\n verticalScrollDirection: ScrollDirection,\n}) => void;\n\ntype ScrollEvent = SyntheticEvent<HTMLDivElement>;\ntype ItemStyleCache = { [key: string]: Object };\n\ntype OuterPrLine truncated
@@ -0,0 +1,283 @@
export default async function pMap(
iterable,
mapper,
{
concurrency = Number.POSITIVE_INFINITY,
stopOnError = true,
signal,
} = {},
) {
return new Promise((resolve_, reject_) => {
if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
}
if (typeof mapper !== 'function') {
throw new TypeError('Mapper function is required');
}
if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
}
const result = [];
const errors = [];
const skippedIndexesMap = new Map();
let isRejected = false;
let isResolved = false;
let isIterableDone = false;
let resolvingCount = 0;
let currentIndex = 0;
const iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
const signalListener = () => {
reject(signal.reason);
};
const cleanup = () => {
signal?.removeEventListener('abort', signalListener);
};
const resolve = value => {
resolve_(value);
cleanup();
};
const reject = reason => {
isRejected = true;
isResolved = true;
reject_(reason);
cleanup();
};
if (signal) {
if (signal.aborted) {
reject(signal.reason);
}
signal.addEventListener('abort', signalListener, {once: true});
}
const next = async () => {
if (isResolved) {
return;
}
const nextItem = await iterator.next();
const index = currentIndex;
currentIndex++;
// Note: `iterator.next()` can be called many times in parallel.
// This can cause multiple calls to this `next()` function to
// receive a `nextItem` with `done === true`.
// The shutdown logic that rejects/resolves must be protected
// so it runs only one time as the `skippedIndex` logic is
// non-idempotent.
if (nextItem.done) {
isIterableDone = true;
if (resolvingCount === 0 && !isResolved) {
if (!stopOnError && errors.length > 0) {
reject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message
return;
}
isResolved = true;
if (skippedIndexesMap.size === 0) {
resolve(result);
return;
}
const pureResult = [];
// Support multiple `pMapSkip`'s.
for (const [index, value] of result.entries()) {
if (skippedIndexesMap.get(index) === pMapSkip) {
continue;
}
pureResult.push(value);
}
resolve(pureResult);
}
return;
}
resolvingCount++;
// Intentionally detached
(async () => {
try {
const element = await nextItem.value;
if (isResolved) {
return;
}
const value = await mapper(element, index);
// Use Map to stage the index of the element.
if (value === pMapSkip) {
skippedIndexesMap.set(index, value);
}
result[index] = value;
resolvingCount--;
await next();
} catch (error) {
if (stopOnError) {
reject(error);
} else {
errors.push(error);
resolvingCount--;
// In that case we can't really continue regardless of `stopOnError` state
// since an iterable is likely to continue throwing after it throws once.
// If we continue calling `next()` indefinitely we will likely end up
// in an infinite loop of failed iteration.
try {
await next();
} catch (error) {
reject(error);
}
}
}
})();
};
// Create the concurrent runners in a detached (non-awaited)
// promise. We need this so we can await the `next()` calls
// to stop creating runners before hitting the concurrency limit
// if the iterable has already been marked as done.
// NOTE: We *must* do this for async iterators otherwise we'll spin up
// infinite `next()` calls by default and never start the event loop.
(async () => {
for (let index = 0; index < concurrency; index++) {
try {
// eslint-disable-next-line no-await-in-loop
await next();
} catch (error) {
reject(error);
break;
}
if (isIterableDone || isRejected) {
break;
}
}
})();
});
}
export function pMapIterable(
iterable,
mapper,
{
concurrency = Number.POSITIVE_INFINITY,
backpressure = concurrency,
} = {},
) {
if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
}
if (typeof mapper !== 'function') {
throw new TypeError('Mapper function is required');
}
if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
}
if (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) {
throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${concurrency}) and up or \`Infinity\`, got \`${backpressure}\` (${typeof backpressure})`);
}
return {
async * [Symbol.asyncIterator]() {
const iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();
const promises = [];
let pendingPromisesCount = 0;
let isDone = false;
let index = 0;
function trySpawn() {
if (isDone || !(pendingPromisesCount < concurrency && promises.length < backpressure)) {
return;
}
pendingPromisesCount++;
const promise = (async () => {
const {done, value} = await iterator.next();
if (done) {
pendingPromisesCount--;
return {done: true};
}
// Spawn if still below concurrency and backpressure limit
trySpawn();
try {
const returnValue = await mapper(await value, index++);
pendingPromisesCount--;
if (returnValue === pMapSkip) {
const index = promises.indexOf(promise);
if (index > 0) {
promises.splice(index, 1);
}
}
// Spawn if still below backpressure limit and just dropped below concurrency limit
trySpawn();
return {done: false, value: returnValue};
} catch (error) {
pendingPromisesCount--;
isDone = true;
return {error};
}
})();
promises.push(promise);
}
trySpawn();
while (promises.length > 0) {
const {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop
promises.shift();
if (error) {
throw error;
}
if (done) {
return;
}
// Spawn if just dropped below backpressure limit and below the concurrency limit
trySpawn();
if (value === pMapSkip) {
continue;
}
yield value;
}
},
};
}
export const pMapSkip = Symbol('skip');
@@ -0,0 +1,78 @@
'use strict';
var test = require('tape');
var typedArrayByteOffset = require('../');
var isCallable = require('is-callable');
var generators = require('make-generator-function')();
var arrowFn = require('make-arrow-function')();
var forEach = require('for-each');
var inspect = require('object-inspect');
var typedArrayNames = require('possible-typed-array-names');
test('not arrays', function (t) {
t.test('non-number/string primitives', function (st) {
// @ts-expect-error
st.equal(false, typedArrayByteOffset(), 'undefined is not typed array');
st.equal(false, typedArrayByteOffset(null), 'null is not typed array');
st.equal(false, typedArrayByteOffset(false), 'false is not typed array');
st.equal(false, typedArrayByteOffset(true), 'true is not typed array');
st.end();
});
t.equal(false, typedArrayByteOffset({}), 'object is not typed array');
t.equal(false, typedArrayByteOffset(/a/g), 'regex literal is not typed array');
t.equal(false, typedArrayByteOffset(new RegExp('a', 'g')), 'regex object is not typed array');
t.equal(false, typedArrayByteOffset(new Date()), 'new Date() is not typed array');
t.test('numbers', function (st) {
st.equal(false, typedArrayByteOffset(42), 'number is not typed array');
st.equal(false, typedArrayByteOffset(Object(42)), 'number object is not typed array');
st.equal(false, typedArrayByteOffset(NaN), 'NaN is not typed array');
st.equal(false, typedArrayByteOffset(Infinity), 'Infinity is not typed array');
st.end();
});
t.test('strings', function (st) {
st.equal(false, typedArrayByteOffset('foo'), 'string primitive is not typed array');
st.equal(false, typedArrayByteOffset(Object('foo')), 'string object is not typed array');
st.end();
});
t.end();
});
test('Functions', function (t) {
t.equal(false, typedArrayByteOffset(function () {}), 'function is not typed array');
t.end();
});
test('Generators', { skip: generators.length === 0 }, function (t) {
forEach(generators, function (genFn) {
t.equal(false, typedArrayByteOffset(genFn), 'generator function ' + inspect(genFn) + ' is not typed array');
});
t.end();
});
test('Arrow functions', { skip: !arrowFn }, function (t) {
t.equal(false, typedArrayByteOffset(arrowFn), 'arrow function is not typed array');
t.end();
});
test('Typed Arrays', function (t) {
var length = 32;
var byteOffset = 16;
forEach(typedArrayNames, function (typedArray) {
var buffer = new ArrayBuffer(length);
var TypedArray = global[typedArray];
if (isCallable(TypedArray)) {
// @ts-expect-error hush, TS, TAs can take an optional byte offset arg
var arr = new TypedArray(buffer, byteOffset);
t.equal(typedArrayByteOffset(arr), byteOffset, 'new ' + typedArray + '(new ArrayBuffer(' + length + '), ' + byteOffset + ') is typed array of byte offset ' + byteOffset);
} else {
t.comment('# SKIP ' + typedArray + ' is not supported');
}
});
t.end();
});
@@ -0,0 +1,29 @@
"use client";
// src/resizable-panel.tsx
import { forwardRef } from "react";
import { domAnimation, LazyMotion, m } from "framer-motion";
import { useMeasure } from "@heroui/use-measure";
import { jsx } from "react/jsx-runtime";
var ResizablePanel = forwardRef(
(originalProps, ref) => {
const { children, ...props } = originalProps;
let [measureRef, bounds] = useMeasure();
return /* @__PURE__ */ jsx(LazyMotion, { features: domAnimation, children: /* @__PURE__ */ jsx(
m.div,
{
ref,
animate: {
width: bounds.width && (bounds == null ? void 0 : bounds.width) > 0 ? bounds.width : "auto",
height: bounds.height && bounds.height > 0 ? bounds.height : "auto"
},
children: /* @__PURE__ */ jsx("div", { ref: measureRef, ...props, children })
}
) });
}
);
ResizablePanel.displayName = "HeroUI - ResizablePanel";
export {
ResizablePanel
};
@@ -0,0 +1,537 @@
# mdast-util-from-markdown
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]
**[mdast][]** utility that turns markdown into a syntax tree.
## Contents
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`fromMarkdown(value[, encoding][, options])`](#frommarkdownvalue-encoding-options)
* [`CompileContext`](#compilecontext)
* [`CompileData`](#compiledata)
* [`Encoding`](#encoding)
* [`Extension`](#extension)
* [`Handle`](#handle)
* [`OnEnterError`](#onentererror)
* [`OnExitError`](#onexiterror)
* [`Options`](#options)
* [`Token`](#token)
* [`Transform`](#transform)
* [`Value`](#value)
* [List of extensions](#list-of-extensions)
* [Syntax](#syntax)
* [Syntax tree](#syntax-tree)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This package is a utility that takes markdown input and turns it into an
[mdast][] syntax tree.
This utility uses [`micromark`][micromark], which turns markdown into tokens,
and then turns those tokens into nodes.
This package is used inside [`remark-parse`][remark-parse], which focusses on
making it easier to transform content by abstracting these internals away.
## When should I use this?
If you want to handle syntax trees manually, use this.
When you *just* want to turn markdown into HTML, use [`micromark`][micromark]
instead.
For an easier time processing content, use the **[remark][]** ecosystem instead.
You can combine this package with other packages to add syntax extensions to
markdown.
Notable examples that deeply integrate with this package are
[`mdast-util-gfm`][mdast-util-gfm],
[`mdast-util-mdx`][mdast-util-mdx],
[`mdast-util-frontmatter`][mdast-util-frontmatter],
[`mdast-util-math`][mdast-util-math], and
[`mdast-util-directive`][mdast-util-directive].
## Install
This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:
```sh
npm install mdast-util-from-markdown
```
In Deno with [`esm.sh`][esmsh]:
```js
import {fromMarkdown} from 'https://esm.sh/mdast-util-from-markdown@2'
```
In browsers with [`esm.sh`][esmsh]:
```html
<script type="module">
import {fromMarkdown} from 'https://esm.sh/mdast-util-from-markdown@2?bundle'
</script>
```
## Use
Say we have the following markdown file `example.md`:
```markdown
## Hello, *World*!
```
…and our module `example.js` looks as follows:
```js
import fs from 'node:fs/promises'
import {fromMarkdown} from 'mdast-util-from-markdown'
const doc = await fs.readFile('example.md')
const tree = fromMarkdown(doc)
console.log(tree)
```
…now running `node example.js` yields (positional info removed for brevity):
```js
{
type: 'root',
children: [
{
type: 'heading',
depth: 2,
children: [
{type: 'text', value: 'Hello, '},
{type: 'emphasis', children: [{type: 'text', value: 'World'}]},
{type: 'text', value: '!'}
]
}
]
}
```
## API
This package exports the identifier [`fromMarkdown`][api-from-markdown].
There is no default export.
The export map supports the [`development` condition][development].
Run `node --conditions development example.js` to get instrumented dev code.
Without this condition, production code is loaded.
### `fromMarkdown(value[, encoding][, options])`
Turn markdown into a syntax tree.
###### Overloads
* `(value: Value, encoding: Encoding, options?: Options) => Root`
* `(value: Value, options?: Options) => Root`
###### Parameters
* `value` ([`Value`][api-value])
— markdown to parse
* `encoding` ([`Encoding`][api-encoding], default: `'utf8'`)
— [character encoding][encoding] for when `value` is
[`Uint8Array`][uint8-array]
* `options` ([`Options`][api-options], optional)
— configuration
###### Returns
mdast tree ([`Root`][root]).
### `CompileContext`
mdast compiler context (TypeScript type).
###### Fields
* `stack` ([`Array<Node>`][node])
— stack of nodes
* `tokenStack` (`Array<[Token, OnEnterError | undefined]>`)
— stack of tokens
* `data` ([`CompileData`][api-compile-data])
— info passed around; key/value store
* `buffer` (`() => undefined`)
— capture some of the output data
* `resume` (`() => string`)
— stop capturing and access the output data
* `enter` (`(node: Node, token: Token, onError?: OnEnterError) => undefined`)
— enter a node
* `exit` (`(token: Token, onError?: OnExitError) => undefined`)
— exit a node
* `sliceSerialize` (`(token: Token, expandTabs?: boolean) => string`)
— get the string value of a token
* `config` (`Required<Extension>`)
— configuration
### `CompileData`
Interface of tracked data (TypeScript type).
###### Type
```ts
interface CompileData { /* see code */ }
```
When working on extensions that use more data, extend the corresponding
interface to register their types:
```ts
declare module 'mdast-util-from-markdown' {
interface CompileData {
// Register a new field.
mathFlowInside?: boolean | undefined
}
}
```
### `Encoding`
Encodings supported by the [`Uint8Array`][uint8-array] class (TypeScript type).
See [`micromark`][micromark-api] for more info.
###### Type
```ts
type Encoding = 'utf8' | /* … */
```
### `Extension`
Change how markdown tokens from micromark are turned into mdast (TypeScript
type).
###### Properties
* `canContainEols` (`Array<string>`, optional)
— token types where line endings are used
* `enter` ([`Record<string, Handle>`][api-handle], optional)
— opening handles
* `exit` ([`Record<string, Handle>`][api-handle], optional)
— closing handles
* `transforms` ([`Array<Transform>`][api-transform], optional)
— tree transforms
### `Handle`
Handle a token (TypeScript type).
###### Parameters
* `this` ([`CompileContext`][api-compile-context])
— context
* `token` ([`Token`][api-token])
— current token
###### Returns
Nothing (`undefined`).
### `OnEnterError`
Handle the case where the `right` token is open, but it is closed (by the
`left` token) or because we reached the end of the document (TypeScript type).
###### Parameters
* `this` ([`CompileContext`][api-compile-context])
— context
* `left` ([`Token`][api-token] or `undefined`)
— left token
* `right` ([`Token`][api-token])
— right token
###### Returns
Nothing (`undefined`).
### `OnExitError`
Handle the case where the `right` token is open but it is closed by
exiting the `left` token (TypeScript type).
###### Parameters
* `this` ([`CompileContext`][api-compile-context])
— context
* `left` ([`Token`][api-token])
— left token
* `right` ([`Token`][api-token])
— right token
###### Returns
Nothing (`undefined`).
### `Options`
Configuration (TypeScript type).
###### Properties
* `extensions` ([`Array<MicromarkExtension>`][micromark-extension], optional)
— micromark extensions to change how markdown is parsed
* `mdastExtensions` ([`Array<Extension | Array<Extension>>`][api-extension],
optional)
— extensions for this utility to change how tokens are turned into a tree
### `Token`
Token from micromark (TypeScript type).
###### Type
```ts
type Token = { /* … */ }
```
### `Transform`
Extra transform, to change the AST afterwards (TypeScript type).
###### Parameters
* `tree` ([`Root`][root])
— tree to transform
###### Returns
New tree ([`Root`][root]) or nothing (in which case the current tree is used).
### `Value`
Contents of the file (TypeScript type).
See [`micromark`][micromark-api] for more info.
###### Type
```ts
type Value = Uint8Array | string
```
## List of extensions
* [`syntax-tree/mdast-util-directive`](https://github.com/syntax-tree/mdast-util-directive)
— directives
* [`syntax-tree/mdast-util-frontmatter`](https://github.com/syntax-tree/mdast-util-frontmatter)
— frontmatter (YAML, TOML, more)
* [`syntax-tree/mdast-util-gfm`](https://github.com/syntax-tree/mdast-util-gfm)
— GFM
* [`syntax-tree/mdast-util-gfm-autolink-literal`](https://github.com/syntax-tree/mdast-util-gfm-autolink-literal)
— GFM autolink literals
* [`syntax-tree/mdast-util-gfm-footnote`](https://github.com/syntax-tree/mdast-util-gfm-footnote)
— GFM footnotes
* [`syntax-tree/mdast-util-gfm-strikethrough`](https://github.com/syntax-tree/mdast-util-gfm-strikethrough)
— GFM strikethrough
* [`syntax-tree/mdast-util-gfm-table`](https://github.com/syntax-tree/mdast-util-gfm-table)
— GFM tables
* [`syntax-tree/mdast-util-gfm-task-list-item`](https://github.com/syntax-tree/mdast-util-gfm-task-list-item)
— GFM task list items
* [`syntax-tree/mdast-util-math`](https://github.com/syntax-tree/mdast-util-math)
— math
* [`syntax-tree/mdast-util-mdx`](https://github.com/syntax-tree/mdast-util-mdx)
— MDX
* [`syntax-tree/mdast-util-mdx-expression`](https://github.com/syntax-tree/mdast-util-mdx-expression)
— MDX expressions
* [`syntax-tree/mdast-util-mdx-jsx`](https://github.com/syntax-tree/mdast-util-mdx-jsx)
— MDX JSX
* [`syntax-tree/mdast-util-mdxjs-esm`](https://github.com/syntax-tree/mdast-util-mdxjs-esm)
— MDX ESM
## Syntax
Markdown is parsed according to CommonMark.
Extensions can add support for other syntax.
If you’re interested in extending markdown,
[more information is available in micromark’s readme][micromark-extension].
## Syntax tree
The syntax tree is [mdast][].
## Types
This package is fully typed with [TypeScript][].
It exports the additional types [`CompileContext`][api-compile-context],
[`CompileData`][api-compile-data],
[`Encoding`][api-encoding],
[`Extension`][api-extension],
[`Handle`][api-handle],
[`OnEnterError`][api-on-enter-error],
[`OnExitError`][api-on-exit-error],
[`Options`][api-options],
[`Token`][api-token],
[`Transform`][api-transform], and
[`Value`][api-value].
## 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,
`mdast-util-from-markdown@^2`, compatible with Node.js 16.
## Security
As markdown is sometimes used for HTML, and improper use of HTML can open you up
to a [cross-site scripting (XSS)][xss] attack, use of `mdast-util-from-markdown`
can also be unsafe.
When going to HTML, use this utility in combination with
[`hast-util-sanitize`][hast-util-sanitize] to make the tree safe.
## Related
* [`syntax-tree/mdast-util-to-markdown`](https://github.com/syntax-tree/mdast-util-to-markdown)
— serialize mdast as markdown
* [`micromark/micromark`](https://github.com/micromark/micromark)
— parse markdown
* [`remarkjs/remark`](https://github.com/remarkjs/remark)
— process markdown
## Contribute
See [`contributing.md`][contributing] in [`syntax-tree/.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, organization, or community you agree to
abide by its terms.
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://github.com/syntax-tree/mdast-util-from-markdown/workflows/main/badge.svg
[build]: https://github.com/syntax-tree/mdast-util-from-markdown/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-from-markdown.svg
[coverage]: https://codecov.io/github/syntax-tree/mdast-util-from-markdown
[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-from-markdown.svg
[downloads]: https://www.npmjs.com/package/mdast-util-from-markdown
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-from-markdown
[size]: https://bundlejs.com/?q=mdast-util-from-markdown
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
[collective]: https://opencollective.com/unified
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
[chat]: https://github.com/syntax-tree/unist/discussions
[npm]: https://docs.npmjs.com/cli/install
[esmsh]: https://esm.sh
[license]: license
[author]: https://wooorm.com
[health]: https://github.com/syntax-tree/.github
[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md
[support]: https://github.com/syntax-tree/.github/blob/main/support.md
[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[typescript]: https://www.typescriptlang.org
[mdast]: https://github.com/syntax-tree/mdast
[node]: https://github.com/syntax-tree/mdast#nodes
[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm
[mdast-util-mdx]: https://github.com/syntax-tree/mdast-util-mdx
[mdast-util-frontmatter]: https://github.com/syntax-tree/mdast-util-frontmatter
[mdast-util-math]: https://github.com/syntax-tree/mdast-util-math
[mdast-util-directive]: https://github.com/syntax-tree/mdast-util-directive
[root]: https://github.com/syntax-tree/mdast#root
[uint8-array]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array
[encoding]: https://nodejs.org/api/util.html#whatwg-supported-encodings
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
[hast-util-sanitize]: https://github.com/syntax-tree/hast-util-sanitize
[micromark]: https://github.com/micromark/micromark
[micromark-api]: https://github.com/micromark/micromark/tree/main/packages/micromark#micromarkvalue-encoding-options
[micromark-extension]: https://github.com/micromark/micromark#extensions
[remark]: https://github.com/remarkjs/remark
[remark-parse]: https://github.com/remarkjs/remark/tree/main/packages/remark-parse
[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions
[api-from-markdown]: #frommarkdownvalue-encoding-options
[api-compile-context]: #compilecontext
[api-compile-data]: #compiledata
[api-encoding]: #encoding
[api-extension]: #extension
[api-handle]: #handle
[api-on-enter-error]: #onentererror
[api-on-exit-error]: #onexiterror
[api-options]: #options
[api-token]: #token
[api-transform]: #transform
[api-value]: #value
@@ -0,0 +1,88 @@
import { isNode } from '../nodes/identity.js';
import { Scalar } from '../nodes/Scalar.js';
import { YAMLMap } from '../nodes/YAMLMap.js';
import { YAMLSeq } from '../nodes/YAMLSeq.js';
import { resolveBlockMap } from './resolve-block-map.js';
import { resolveBlockSeq } from './resolve-block-seq.js';
import { resolveFlowCollection } from './resolve-flow-collection.js';
function resolveCollection(CN, ctx, token, onError, tagName, tag) {
const coll = token.type === 'block-map'
? resolveBlockMap(CN, ctx, token, onError, tag)
: token.type === 'block-seq'
? resolveBlockSeq(CN, ctx, token, onError, tag)
: resolveFlowCollection(CN, ctx, token, onError, tag);
const Coll = coll.constructor;
// If we got a tagName matching the class, or the tag name is '!',
// then use the tagName from the node class used to create it.
if (tagName === '!' || tagName === Coll.tagName) {
coll.tag = Coll.tagName;
return coll;
}
if (tagName)
coll.tag = tagName;
return coll;
}
function composeCollection(CN, ctx, token, props, onError) {
const tagToken = props.tag;
const tagName = !tagToken
? null
: ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg));
if (token.type === 'block-seq') {
const { anchor, newlineAfterProp: nl } = props;
const lastProp = anchor && tagToken
? anchor.offset > tagToken.offset
? anchor
: tagToken
: (anchor ?? tagToken);
if (lastProp && (!nl || nl.offset < lastProp.offset)) {
const message = 'Missing newline after block sequence props';
onError(lastProp, 'MISSING_CHAR', message);
}
}
const expType = token.type === 'block-map'
? 'map'
: token.type === 'block-seq'
? 'seq'
: token.start.source === '{'
? 'map'
: 'seq';
// shortcut: check if it's a generic YAMLMap or YAMLSeq
// before jumping into the custom tag logic.
if (!tagToken ||
!tagName ||
tagName === '!' ||
(tagName === YAMLMap.tagName && expType === 'map') ||
(tagName === YAMLSeq.tagName && expType === 'seq')) {
return resolveCollection(CN, ctx, token, onError, tagName);
}
let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType);
if (!tag) {
const kt = ctx.schema.knownTags[tagName];
if (kt?.collection === expType) {
ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
tag = kt;
}
else {
if (kt) {
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);
}
else {
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
}
return resolveCollection(CN, ctx, token, onError, tagName);
}
}
const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);
const res = tag.resolve?.(coll, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg), ctx.options) ?? coll;
const node = isNode(res)
? res
: new Scalar(res);
node.range = coll.range;
node.tag = tagName;
if (tag?.format)
node.format = tag.format;
return node;
}
export { composeCollection };
@@ -0,0 +1,173 @@
/**
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { FontWeight, Terminal } from '@xterm/xterm';
import { IColorSet, ITerminal } from 'browser/Types';
import { IDisposable } from 'common/Types';
import { IEvent } from 'common/EventEmitter';
export interface ICharAtlasConfig {
customGlyphs: boolean;
devicePixelRatio: number;
letterSpacing: number;
lineHeight: number;
fontSize: number;
fontFamily: string;
fontWeight: FontWeight;
fontWeightBold: FontWeight;
deviceCellWidth: number;
deviceCellHeight: number;
deviceCharWidth: number;
deviceCharHeight: number;
allowTransparency: boolean;
drawBoldTextInBrightColors: boolean;
minimumContrastRatio: number;
colors: IColorSet;
}
export interface IDimensions {
width: number;
height: number;
}
export interface IOffset {
top: number;
left: number;
}
export interface IRenderDimensions {
/**
* Dimensions measured in CSS pixels (ie. device pixels / device pixel ratio).
*/
css: {
canvas: IDimensions;
cell: IDimensions;
};
/**
* Dimensions measured in actual pixels as rendered to the device.
*/
device: {
canvas: IDimensions;
cell: IDimensions;
char: IDimensions & IOffset;
};
}
export interface IRequestRedrawEvent {
start: number;
end: number;
}
/**
* Note that IRenderer implementations should emit the refresh event after
* rendering rows to the screen.
*/
export interface IRenderer extends IDisposable {
readonly dimensions: IRenderDimensions;
/**
* Fires when the renderer is requesting to be redrawn on the next animation
* frame but is _not_ a result of content changing (eg. selection changes).
*/
readonly onRequestRedraw: IEvent<IRequestRedrawEvent>;
dispose(): void;
handleDevicePixelRatioChange(): void;
handleResize(cols: number, rows: number): void;
handleCharSizeChanged(): void;
handleBlur(): void;
handleFocus(): void;
handleSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void;
handleCursorMove(): void;
clear(): void;
renderRows(start: number, end: number): void;
clearTextureAtlas?(): void;
}
export interface ITextureAtlas extends IDisposable {
readonly pages: { canvas: HTMLCanvasElement, version: number }[];
onAddTextureAtlasCanvas: IEvent<HTMLCanvasElement>;
onRemoveTextureAtlasCanvas: IEvent<HTMLCanvasElement>;
/**
* Warm up the texture atlas, adding common glyphs to avoid slowing early frame.
*/
warmUp(): void;
/**
* Call when a frame is being drawn, this will return true if the atlas was cleared to make room
* for a new set of glyphs.
*/
beginFrame(): boolean;
/**
* Clear all glyphs from the texture atlas.
*/
clearTexture(): void;
getRasterizedGlyph(code: number, bg: number, fg: number, ext: number, restrictToCellHeight: boolean): IRasterizedGlyph;
getRasterizedGlyphCombinedChar(chars: string, bg: number, fg: number, ext: number, restrictToCellHeight: boolean): IRasterizedGlyph;
}
/**
* Represents a rasterized glyph within a texture atlas. Some numbers are
* tracked in CSS pixels as well in order to reduce calculations during the
* render loop.
*/
export interface IRasterizedGlyph {
/**
* The x and y offset between the glyph's top/left and the top/left of a cell
* in pixels.
*/
offset: IVector;
/**
* The index of the texture page that the glyph is on.
*/
texturePage: number;
/**
* the x and y position of the glyph in the texture in pixels.
*/
texturePosition: IVector;
/**
* the x and y position of the glyph in the texture in clip space coordinates.
*/
texturePositionClipSpace: IVector;
/**
* The width and height of the glyph in the texture in pixels.
*/
size: IVector;
/**
* The width and height of the glyph in the texture in clip space coordinates.
*/
sizeClipSpace: IVector;
}
export interface IVector {
x: number;
y: number;
}
export interface IBoundingBox {
top: number;
left: number;
right: number;
bottom: number;
}
export interface ISelectionRenderModel {
readonly hasSelection: boolean;
readonly columnSelectMode: boolean;
readonly viewportStartRow: number;
readonly viewportEndRow: number;
readonly viewportCappedStartRow: number;
readonly viewportCappedEndRow: number;
readonly startCol: number;
readonly endCol: number;
readonly selectionStart: [number, number] | undefined;
readonly selectionEnd: [number, number] | undefined;
clear(): void;
update(terminal: ITerminal, start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode?: boolean): void;
isCellSelected(terminal: Terminal, x: number, y: number): boolean;
}
@@ -0,0 +1,4 @@
import { MultipleInjectionManagedClassElementMetadata } from './MultipleInjectionManagedClassElementMetadata';
import { SingleInjectionManagedClassElementMetadata } from './SingleInjectionManagedClassElementMetadata';
export type ManagedClassElementMetadata = SingleInjectionManagedClassElementMetadata | MultipleInjectionManagedClassElementMetadata;
//# sourceMappingURL=ManagedClassElementMetadata.d.ts.map
@@ -0,0 +1,4 @@
import type { LegacyImportResolver, LegacyResolver, LegacyResolverObject, ResolvedResult } from 'eslint-import-context';
export declare function resolveWithLegacyResolver(resolver: LegacyResolver, config: unknown, modulePath: string, sourceFile: string): ResolvedResult;
export declare function normalizeConfigResolvers(resolvers: LegacyImportResolver, sourceFile: string): Required<LegacyResolverObject>[];
export declare const LEGACY_NODE_RESOLVERS: Set<string>;
@@ -0,0 +1,128 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _templateLiterals = require("./template-literals.js");
Object.keys(_templateLiterals).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _templateLiterals[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _templateLiterals[key];
}
});
});
var _expressions = require("./expressions.js");
Object.keys(_expressions).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _expressions[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _expressions[key];
}
});
});
var _statements = require("./statements.js");
Object.keys(_statements).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _statements[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _statements[key];
}
});
});
var _classes = require("./classes.js");
Object.keys(_classes).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _classes[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _classes[key];
}
});
});
var _methods = require("./methods.js");
Object.keys(_methods).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _methods[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _methods[key];
}
});
});
var _modules = require("./modules.js");
Object.keys(_modules).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _modules[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _modules[key];
}
});
});
var _types = require("./types.js");
Object.keys(_types).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _types[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _types[key];
}
});
});
var _flow = require("./flow.js");
Object.keys(_flow).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _flow[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _flow[key];
}
});
});
var _base = require("./base.js");
Object.keys(_base).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _base[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _base[key];
}
});
});
var _jsx = require("./jsx.js");
Object.keys(_jsx).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _jsx[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _jsx[key];
}
});
});
var _typescript = require("./typescript.js");
Object.keys(_typescript).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _typescript[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _typescript[key];
}
});
});
//# sourceMappingURL=index.js.map
@@ -0,0 +1,72 @@
'use strict';
var $TypeError = require('es-errors/type');
var GetUTCEpochNanoseconds = require('./GetUTCEpochNanoseconds');
var isInteger = require('math-intrinsics/isInteger');
// https://262.ecma-international.org/14.0/#sec-getnamedtimezoneepochnanoseconds
// eslint-disable-next-line max-params
module.exports = function GetNamedTimeZoneEpochNanoseconds(
timeZoneIdentifier,
year,
month,
day,
hour,
minute,
second,
millisecond,
microsecond,
nanosecond
) {
if (typeof timeZoneIdentifier !== 'string') {
throw new $TypeError('Assertion failed: `timeZoneIdentifier` must be a string');
}
if (!isInteger(year)) {
throw new $TypeError('Assertion failed: `year` must be an integral number');
}
if (!isInteger(month) || month < 1 || month > 12) {
throw new $TypeError('Assertion failed: `month` must be an integral number between 1 and 12, inclusive');
}
if (!isInteger(day) || day < 1 || day > 31) {
throw new $TypeError('Assertion failed: `day` must be an integral number between 1 and 31, inclusive');
}
if (!isInteger(hour) || hour < 0 || hour > 23) {
throw new $TypeError('Assertion failed: `hour` must be an integral number between 0 and 23, inclusive');
}
if (!isInteger(minute) || minute < 0 || minute > 59) {
throw new $TypeError('Assertion failed: `minute` must be an integral number between 0 and 59, inclusive');
}
if (!isInteger(second) || second < 0 || second > 999) {
throw new $TypeError('Assertion failed: `second` must be an integral number between 0 and 999, inclusive');
}
if (!isInteger(millisecond) || millisecond < 0 || millisecond > 999) {
throw new $TypeError('Assertion failed: `millisecond` must be an integral number between 0 and 999, inclusive');
}
if (!isInteger(microsecond) || microsecond < 0 || microsecond > 999) {
throw new $TypeError('Assertion failed: `microsecond` must be an integral number between 0 and 999, inclusive');
}
if (!isInteger(nanosecond) || nanosecond < 0 || nanosecond > 999) {
throw new $TypeError('Assertion failed: `nanosecond` must be an integral number between 0 and 999, inclusive');
}
if (timeZoneIdentifier !== 'UTC') {
throw new $TypeError('Assertion failed: only UTC time zone is supported'); // step 1
}
var epochNanoseconds = GetUTCEpochNanoseconds(
year,
month,
day,
hour,
minute,
second,
millisecond,
microsecond,
nanosecond
); // step 2
return [epochNanoseconds]; // step 3
};
@@ -0,0 +1,581 @@
# inversify
## 7.10.4
### Patch Changes
- Updated dependencies
- @inversifyjs/core@9.1.1
- @inversifyjs/container@1.14.1
## 7.10.3
### Patch Changes
- Updated `BindToFluentSyntax.factory` to allow async factory builders
- Updated `Factory` to allow async functions
- Updated dependencies
- @inversifyjs/container@1.14.0
- @inversifyjs/core@9.1.0
## 7.10.2
### Patch Changes
- Updated dependencies
- @inversifyjs/container@1.13.2
- @inversifyjs/core@9.0.1
## 7.10.1
### Patch Changes
- Added `MapToResolvedValueInjectOptions` type
- Updated dependencies
- @inversifyjs/container@1.13.1
## 7.10.0
### Added
- Added `InjectFromBaseOptionsLifecycle`.
- Added `InjectFromHierarchyOptionsLifecycle`.
### Changed
- Updated `injectFromBase` with `lifecycle` property.
- Updated `injectFromHierarchy` with `lifecycle` property.
## 7.9.1
### Changed
- Updated `Container` to trigger autobind options on autobound parent container related binding requests.
## 7.9.0
### Changed
- Updated `decorate` to allow method parameter decoration.
## 7.8.1
### Changed
- Fixed `injectFromHierarchy` avoiding crash when traversing `Object` metadata.
## 7.8.0
### Added
- Added `injectFromHierarchy`.
## 7.7.1
### Changed
- Fixed a bug involving circular dependencies when resolving services in some edge cases.
- Fixed a bug involving circular dependencies when bindings are bound in some edge cases.
## 7.7.1-beta.0
### Changed
- Fixed a bug causing `Container.bind` and `Container.unbind` to avoid throwing planning errors.
- Fixed a bug causing wrong cached plans involving bindings with ancestor related constraints.
## 7.7.0
### Added
- Added `Bind` type.
- Added `IsBound` type.
- Added `OnActivation` type.
- Added `OnDeactivation` type.
- Added `Rebind` type.
- Added `RebindSync` type.
- Added `Unbind` type.
- Added `UnbindSync` type.
### Changed
- Updated `BindOnFluentSyntaxImplementation.onDeactivation` to throw an error on non singleton scoped bindings.
- Updated `ServiceResolutionManager` to provide right `getChained` operation after computed properties are reset.
- Updated `Container` to properly manage bindings bindings on child containers after a parent container restores a snapshot.
## 7.6.1
### Changed
- Updated `getAll` and `getAllAsync` options with missing `chained` property.
## 7.6.0
### Added
- Added `MultiInjectOptions`.
### Changed
- Updated `multiInject` decorator with optional `MultiInjectOptions`.
- Updated `getAll` and `getAllAsync` options with optional`chained` property.
## 7.5.4
### Changed
- Updated `ServiceIdentifier` to rely on `Function` again. This solves an issue affecting classes with protected constructors.
## 7.5.3
### Changed
- Updated `ServiceIdentifier` removing `Function` in favor of a new `AbstractNewable` type. ServiceIdentifier now uses AbstractNewable instead of Function to better represent abstract classes. This provides better type safety and semantics.
## 7.5.2
### Changed
- Fixed `Container.snapshot` so snapshot bindings are not updated after a snapshot is taken.
- Fixed a memory leak affecting child containers.
## 7.5.1
### Changed
- Updated `Container.get` like methods to properly set bindings when autobind mode is set:
- `@injectable` scopes properly handled.
- Autobind mode no longer creates duplicated bindings.
## 7.5.0
### Changed
- Updated `Container` with `unloadSync`.
- Updated `Container` with `loadSync`.
## 7.4.0
### Changed
- Updated `ContainerModuleLoadOptions` with `rebind`.
- Updated `ContainerModuleLoadOptions` with `rebindSync`.
- Updated `BindToFluentSyntax.toResolvedValue` with additional type constraints.
## 7.3.0
### Changed
- Updated `Container` with `rebindSync`.
- Updated `Container` with `unbindSync`.
- Updated `Container` with `rebind`.
- Updated `ContainerModuleLoadOptions` with `unbindSync`.
- Updated `ContainerModuleLoadOptions.unbind` to accept `BindingIdentifier`.
## 7.2.0
### Added
- Added `BindingIdentifier`.
### Changed
- Updated `BindInFluentSyntax` with `getIdentifier`.
- Updated `Container.unbind` to handle `BindingIdentifier`.
- Updated `BindOnFluentSyntax` with `getIdentifier`.
- Updated `BindWhenFluentSyntax` with `getIdentifier`.
## 7.1.0
### Added
- Added `BindingActivation`.
- Added `BindingDeactivation`.
## 7.0.2
### Changed
- Updated `container.get` like methods to no longer initialize twice singleton scoped bindings.
## 7.0.1
### Changed
- Updated `Container.get` like methods to no longer initialize twice singleton scoped bindings.
## 7.0.0
Parity version with `7.0.0-alpha.5`
## 7.0.0-alpha.5
### Changed
- Renamed `BindingMetadata` to `BindingConstraints`.
- Improved performance on `Container.get` like methods.
## 7.0.0-alpha.4
Parity version with `7.0.0-alpha.3`.
## 6.2.2
- Solved issue with npm registry.
## 7.0.0-alpha.3
### Changed
- Updated `BindToFluentSyntax` with `.toResolvedValue`.
## 7.0.0-alpha.2
### Changed
- Updated `Container` with a plan cache. `Container.get`, `Container.getAll`, `Container.getAllAsync` and `Container.getAsync` performance has been improved.
## 7.0.0-alpha.1
### Changed
- Updated `GetOptions` with `autobind`.
- Updated `ContainerOptions` with `autobind`.
## 7.0.0-alpha.0
### Added
- Added `BindInFluentSyntax`.
- Added `BindInWhenOnFluentSyntax`.
- Added `BindOnFluentSyntax`.
- Added `BindingScope`.
- Added `BindToFluentSyntax`.
- Added `BindWhenFluentSyntax`.
- Added `BindWhenOnFluentSyntax`.
- Added `ContainerModuleLoadOptions`.
- Added `DynamicValueBuilder`.
- Added `Factory`.
- Added `GetOptions`.
- Added `GetOptionsTagConstraint`.
- Added `IsBoundOptions`.
- Added `MetadataName`.
- Added `MetadataTag`.
- Added `MetadataTargetName`.
- Added `OptionalGetOptions`.
- Added `Provider`.
- Added `ResolutionContext`.
- Added `bindingScopeValues`.
- Added `bindingTypeValues`.
- Added `injectFromBase` decorator.
### Changed
- Updated `injectable` with optional `scope`.
- [Breaking] Updated `ContainerModule` constructor to receive a callback with `ContainerModuleLoadOptions` instead of `interfaces.ContainerModuleCallBack`.
- [Breaking] Updated `ContainerModule`.load to return `Promise<void>`.
- Updated `ContainerOptions` with `parent`.
- Updated `ContainerOptions` without `autoBindInjectable` and `skipBaseClassChecks`.
- [Breaking] Updated `Container` to no longer expose `id`, `parent` nor `options`.
- [Breaking] Updated `Container` with no `applyCustomMetadataReader`, `applyMiddleware`, `createChild`, `merge` and `rebind` methods.
- [Breaking] Updated `Container` with no `isCurrentBound`, `isBoundNamed`, `isBoundTagged` methods in favor of using `Container.isBound` with `isBoundOptions`.
- [Breaking] Updated `Container` with no `getNamed`, `getTagged`, `tryGet`, `tryGetNamed` and `tryGetTagged` methods in favor of `Container.get` with `OptionalGetOptions` options.
- [Breaking] Updated `Container` with no `getNamedAsync`, `getTaggedAsync`, `tryGetAsync`, `tryGetNamedAsync` and `tryGetTaggedAsync` methods in favor of `Container.getAsync` with `OptionalGetOptions` options.
- [Breaking] Updated `Container` with no `getAllNamed`, `getAllTagged`, `tryGetAll`, `tryGetAllNamed` and `tryGetAllTagged` methods in favor of `Container.getAll` with `GetOptions` options.
- [Breaking] Updated `Container` with no `getAllNamedAsync`, `getAllTaggedAsync`, `tryGetAllAsync`, `tryGetAllNamedAsync` and `tryGetAllTaggedAsync` methods in favor of `Container.getAllAsync` with `GetOptions` options.
- [Breaking] Updated `Container` with no `loadAsync` in favor of an async `Container.load`.
- [Breaking] Updated `Container` with no `unbindAsync` in favor of an async `Container.unbind`.
- [Breaking] Updated `Container` with no `unbindAllAsync` in favor of an async `Container.unbindAll`.
- [Breaking] Updated `Container` with no `unloadAsync` in favor of an async `Container.unload`.
### Fixed
- Updated `decorate` to no longer require a unexpected prototypes to decorate property nor methods.
### Removed
- [Breaking] Removed deprecated `LazyServiceIdentifer`. Use `LazyServiceIdentifier` instead.
- [Breaking] Removed `BindingScopeEnum`. Use `bindingScopeValues` instead.
- [Breaking] Removed `BindingTypeEnum`.
- [Breaking] Removed `TargetTypeEnum`.
- [Breaking] Removed `METADATA_KEY`.
- [Breaking] Removed `AsyncContainerModule`. Use `ContainerModule` instead.
- [Breaking] Removed `createTaggedDecorator`.
- [Breaking] Removed `MetadataReader`.
- [Breaking] Removed `id`.
- [Breaking] Removed `interfaces` types. Rely on new types instead.
- [Breaking] Removed `traverseAncerstors`.
- [Breaking] Removed `taggedConstraint`.
- [Breaking] Removed `namedConstraint`.
- [Breaking] Removed `typeConstraint`.
- [Breaking] Removed `getServiceIdentifierAsString`.
- [Breaking] Removed `multiBindToService`.
## 6.2.1
### Fixed
- Added missing `LazyServiceIdentifer`.
## 6.2.0
### Added
- Added `interfaces.GetAllOptions`.
### Changed
- Updated `container.getAll` with `options` optional param.
- Updated `container.getAllAsync` with `options` optional param.
- Updated `interfaces.NextArgs` with optional `isOptional` param.
- Updated `container` with `tryGet`.
- Updated `container` with `tryGetAsync`.
- Updated `container` with `tryGetTagged`.
- Updated `container` with `tryGetTaggedAsync`.
- Updated `container` with `tryGetNamed`.
- Updated `container` with `tryGetNamedAsync`.
- Updated `container` with `tryGetAll`.
- Updated `container` with `tryGetAllAsync`.
- Updated `container` with `tryGetAllTagged`.
- Updated `container` with `tryGetAllTaggedAsync`.
- Updated `container` with `tryGetAllNamed`.
- Updated `container` with `tryGetAllNamedAsync`.
## 6.2.0-beta.1
### Added
### Changed
- Updated `interfaces.NextArgs` with optional `isOptional` param.
- Updated `container` with `tryGet`.
- Updated `container` with `tryGetAsync`.
- Updated `container` with `tryGetTagged`.
- Updated `container` with `tryGetTaggedAsync`.
- Updated `container` with `tryGetNamed`.
- Updated `container` with `tryGetNamedAsync`.
- Updated `container` with `tryGetAll`.
- Updated `container` with `tryGetAllAsync`.
- Updated `container` with `tryGetAllTagged`.
- Updated `container` with `tryGetAllTaggedAsync`.
- Updated `container` with `tryGetAllNamed`.
- Updated `container` with `tryGetAllNamedAsync`.
### Fixed
## 6.2.0-beta.0
### Added
- Added `interfaces.GetAllOptions`.
### Changed
- Updated `container.getAll` with `options` optional param.
- Updated `container.getAllAsync` with `options` optional param.
### Fixed
## 6.1.6
### Fixed
- Fixed unexpected property access while running planning checks on injected base types.
- Updated ESM sourcemaps to refelct the right source code files.
## 6.1.5
### Changed
- Updated library to import `reflect-metadata`. Importing `reflect-metadata` before bootstraping a module in the userland is no longer required.
### Fixed
- Updated ESM build to provide proper types regardless of the ts resolution module strategy in the userland.
- Fixed container to properly resolve async `.toService` bindings.
- Fixed `.toService` binding to properly disable caching any values.
## 6.1.5-beta.2
### Fixed
- Updated ESM bundled types to solve circularly referenced types.
## 6.1.5-beta.1
### Fixed
- Updated ESM build to provide proper types regardless of the ts resolution module strategy in the userland.
## 6.1.5-beta.0
### Changed
- Updated library to import `reflect-metadata`. Importing `reflect-metadata` before bootstraping a module in the userland is no longer required.
### Fixed
- Fixed container to properly resolve async `.toService` bindings.
- Fixed `.toService` binding to properly disable caching any values.
## 6.1.4
### Changed
- Updated planner with better error description when a binding can not be properly resolved.
### Fixed
- Updated container to allow deactivating singleton undefined values.
- Updated ESM build to be compatible with both bundler and NodeJS module resolution algorithms.
## 6.1.4-beta.1
### Fixed
- Updated ESM build to be compatible with both bundler and NodeJS module resolution algorithms.
## 6.1.4-beta.0
### Changed
- Updated planner with better error description when a binding can not be properly resolved.
## 6.1.3
### Fixed
- Updated ESM build with missing types.
## 6.1.2
### Changed
- Updated `package.json` to include the `exports` field for better bundler support.
### Fixed
- Updated fetch metadata flows with better error descriptions.
## 6.1.2-beta.1
### Changed
- Updated `package.json` to include the `exports` field for better bundler support.
## 6.1.2-beta.0
### Fixed
- Updated fetch metadata flows with better error descriptions.
## 6.1.1
### Fixed
- Bumped `@inversifyjs/common` and `@inversifyjs/core` fixing wrong dev engines constraints.
## 6.1.0
### Changed
- Updated `ServiceIdentifier` to rely on `Function` instead of `Abstract<T>`.
### Fixed
- Fixed `Target.getNameTag` with the right type: `number | string | symbol`.
- Fixed `interfaces.ModuleActivationStore.addDeactivation` to enforce `serviceIdentifier` and `onDeactivation` are consistent.
- Fixed `interfaces.ModuleActivationStore.addActivation` to enforce `serviceIdentifier` and `onDeactivation` are consistent.
## 6.0.3
### Fixed
property injection tagged as @optional no longer overrides default values with `undefined`.
Updated `targetName` to be a valid `typescript@5` decorator.
## 6.0.2
### Added
Brought tests up to 100% Code Coverage
### Changed
LazyIdentfier Tests
Removed browser test pipeline, browserify, karma (#1542)
Update all dependencies except typescript (#1531)
### Fixed
Less than 100% code coverage
Use default class property for @optional injected properties (#1467)
Remove circular import (#1516)
Fix strict type checking on @unmanaged decorator (#1499)
Fix typo (LazyServiceIdentifer -> LazyServiceIdentifier) (#1483)
Fix typo (circular dependency error message) (#1485)
## 6.0.1 - 2021-10-14
### Added
- add API method for check dependency only in current container
- createTaggedDecorator #1343
- Async bindings #1132
- Async binding resolution (getAllAsync, getAllNamedAsync, getAllTaggedAsync, getAsync, getNamedAsync, getTaggedAsync, rebindAsync, unbindAsync, unbindAllAsync, unloadAsync) #1132
- Global onActivation / onDeactivation #1132
- Parent/Child onActivation / onDeactivation #1132
- Module onActivation / onDeactivation #1132
- Added @preDestroy decorator #1132
### Changed
- @postConstruct can target an asyncronous function #1132
- Singleton scoped services cache resolved values once the result promise is fulfilled #1320
### Fixed
- only inject decorator can be applied to setters #1342
- Container.resolve should resolve in that container #1338
## 5.1.1 - 2021-04-25
-Fix pre-publish for build artifacts
## 5.1.0 - 2021-04-25
### Added
- Upgrade information for v4.x to v5.x
### Changed
- Update BindingToSyntax with `.toAutoNamedFactory()`.
### Fixed
- Fix `Target.isTagged()` to exclude `optional` from tag injections #1190.
- Update `toConstructor`, `toFactory`, `toFunction`, `toAutoFactory`, `toProvider` and `toConstantValue` to have singleton scope #1297.
- Fix injection on optional properties when targeting ES6 #928
## 5.0.1 - 2018-10-17
### Added
- Updating constructor injection wiki document with concrete injection example #922
### Changed
- Change GUID to incremented counter for better performance #882
### Fixed
- fix broken compilation by adding `.toString()` so symbols serialization #893
- Fix problem with applying options on Container.resolve (fix #914) #915
- Fixed documentation issues
## 4.14.0 - 2018-10-16
Deprecated - Replaced by 5.0.1
@@ -0,0 +1,229 @@
'use strict'
// wrapper around mkdirp for tar's needs.
// TODO: This should probably be a class, not functionally
// passing around state in a gazillion args.
const mkdirp = require('mkdirp')
const fs = require('fs')
const path = require('path')
const chownr = require('chownr')
const normPath = require('./normalize-windows-path.js')
class SymlinkError extends Error {
constructor (symlink, path) {
super('Cannot extract through symbolic link')
this.path = path
this.symlink = symlink
}
get name () {
return 'SylinkError'
}
}
class CwdError extends Error {
constructor (path, code) {
super(code + ': Cannot cd into \'' + path + '\'')
this.path = path
this.code = code
}
get name () {
return 'CwdError'
}
}
const cGet = (cache, key) => cache.get(normPath(key))
const cSet = (cache, key, val) => cache.set(normPath(key), val)
const checkCwd = (dir, cb) => {
fs.stat(dir, (er, st) => {
if (er || !st.isDirectory()) {
er = new CwdError(dir, er && er.code || 'ENOTDIR')
}
cb(er)
})
}
module.exports = (dir, opt, cb) => {
dir = normPath(dir)
// if there's any overlap between mask and mode,
// then we'll need an explicit chmod
const umask = opt.umask
const mode = opt.mode | 0o0700
const needChmod = (mode & umask) !== 0
const uid = opt.uid
const gid = opt.gid
const doChown = typeof uid === 'number' &&
typeof gid === 'number' &&
(uid !== opt.processUid || gid !== opt.processGid)
const preserve = opt.preserve
const unlink = opt.unlink
const cache = opt.cache
const cwd = normPath(opt.cwd)
const done = (er, created) => {
if (er) {
cb(er)
} else {
cSet(cache, dir, true)
if (created && doChown) {
chownr(created, uid, gid, er => done(er))
} else if (needChmod) {
fs.chmod(dir, mode, cb)
} else {
cb()
}
}
}
if (cache && cGet(cache, dir) === true) {
return done()
}
if (dir === cwd) {
return checkCwd(dir, done)
}
if (preserve) {
return mkdirp(dir, { mode }).then(made => done(null, made), done)
}
const sub = normPath(path.relative(cwd, dir))
const parts = sub.split('/')
mkdir_(cwd, parts, mode, cache, unlink, cwd, null, done)
}
const mkdir_ = (base, parts, mode, cache, unlink, cwd, created, cb) => {
if (!parts.length) {
return cb(null, created)
}
const p = parts.shift()
const part = normPath(path.resolve(base + '/' + p))
if (cGet(cache, part)) {
return mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)
}
fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb))
}
const onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => er => {
if (er) {
fs.lstat(part, (statEr, st) => {
if (statEr) {
statEr.path = statEr.path && normPath(statEr.path)
cb(statEr)
} else if (st.isDirectory()) {
mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)
} else if (unlink) {
fs.unlink(part, er => {
if (er) {
return cb(er)
}
fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb))
})
} else if (st.isSymbolicLink()) {
return cb(new SymlinkError(part, part + '/' + parts.join('/')))
} else {
cb(er)
}
})
} else {
created = created || part
mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)
}
}
const checkCwdSync = dir => {
let ok = false
let code = 'ENOTDIR'
try {
ok = fs.statSync(dir).isDirectory()
} catch (er) {
code = er.code
} finally {
if (!ok) {
throw new CwdError(dir, code)
}
}
}
module.exports.sync = (dir, opt) => {
dir = normPath(dir)
// if there's any overlap between mask and mode,
// then we'll need an explicit chmod
const umask = opt.umask
const mode = opt.mode | 0o0700
const needChmod = (mode & umask) !== 0
const uid = opt.uid
const gid = opt.gid
const doChown = typeof uid === 'number' &&
typeof gid === 'number' &&
(uid !== opt.processUid || gid !== opt.processGid)
const preserve = opt.preserve
const unlink = opt.unlink
const cache = opt.cache
const cwd = normPath(opt.cwd)
const done = (created) => {
cSet(cache, dir, true)
if (created && doChown) {
chownr.sync(created, uid, gid)
}
if (needChmod) {
fs.chmodSync(dir, mode)
}
}
if (cache && cGet(cache, dir) === true) {
return done()
}
if (dir === cwd) {
checkCwdSync(cwd)
return done()
}
if (preserve) {
return done(mkdirp.sync(dir, mode))
}
const sub = normPath(path.relative(cwd, dir))
const parts = sub.split('/')
let created = null
for (let p = parts.shift(), part = cwd;
p && (part += '/' + p);
p = parts.shift()) {
part = normPath(path.resolve(part))
if (cGet(cache, part)) {
continue
}
try {
fs.mkdirSync(part, mode)
created = created || part
cSet(cache, part, true)
} catch (er) {
const st = fs.lstatSync(part)
if (st.isDirectory()) {
cSet(cache, part, true)
continue
} else if (unlink) {
fs.unlinkSync(part)
fs.mkdirSync(part, mode)
created = created || part
cSet(cache, part, true)
continue
} else if (st.isSymbolicLink()) {
return new SymlinkError(part, part + '/' + parts.join('/'))
}
}
}
return done(created)
}
@@ -0,0 +1,33 @@
/**
* This function removes any uses of CSS variables used as an alpha channel
*
* This is required for selectors like `:visited` which do not allow
* changes in opacity or external control using CSS variables.
*
* @param {import('postcss').Container} container
* @param {string[]} toRemove
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "removeAlphaVariables", {
enumerable: true,
get: function() {
return removeAlphaVariables;
}
});
function removeAlphaVariables(container, toRemove) {
container.walkDecls((decl)=>{
if (toRemove.includes(decl.prop)) {
decl.remove();
return;
}
for (let varName of toRemove){
if (decl.value.includes(`/ var(${varName})`)) {
decl.value = decl.value.replace(`/ var(${varName})`, "");
} else if (decl.value.includes(`/ var(${varName}, 1)`)) {
decl.value = decl.value.replace(`/ var(${varName}, 1)`, "");
}
}
});
}
@@ -0,0 +1,129 @@
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*/
"use strict"
const path = require("path")
const fs = require("fs")
const getTryExtensions = require("../util/get-try-extensions")
const visitImport = require("../util/visit-import")
const packageNamePattern = /^(?:@[^/\\]+[/\\])?[^/\\]+$/u
const corePackageOverridePattern = /^(?:assert|async_hooks|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|http2|https|inspector|module|net|os|path|perf_hooks|process|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|trace_events|tty|url|util|v8|vm|worker_threads|zlib)[/\\]$/u
/**
* Get all file extensions of the files which have the same basename.
* @param {string} filePath The path to the original file to check.
* @returns {string[]} File extensions.
*/
function getExistingExtensions(filePath) {
const basename = path.basename(filePath, path.extname(filePath))
try {
return fs
.readdirSync(path.dirname(filePath))
.filter(
filename =>
path.basename(filename, path.extname(filename)) === basename
)
.map(filename => path.extname(filename))
} catch (_error) {
return []
}
}
module.exports = {
meta: {
docs: {
description:
"enforce the style of file extensions in `import` declarations",
category: "Stylistic Issues",
recommended: false,
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/file-extension-in-import.md",
},
fixable: "code",
messages: {
requireExt: "require file extension '{{ext}}'.",
forbidExt: "forbid file extension '{{ext}}'.",
},
schema: [
{
enum: ["always", "never"],
},
{
type: "object",
properties: {
tryExtensions: getTryExtensions.schema,
},
additionalProperties: {
enum: ["always", "never"],
},
},
],
type: "suggestion",
},
create(context) {
if (context.getFilename().startsWith("<")) {
return {}
}
const defaultStyle = context.options[0] || "always"
const overrideStyle = context.options[1] || {}
function verify({ filePath, name, node }) {
// Ignore if it's not resolved to a file or it's a bare module.
if (
!filePath ||
packageNamePattern.test(name) ||
corePackageOverridePattern.test(name)
) {
return
}
// Get extension.
const originalExt = path.extname(name)
const resolvedExt = path.extname(filePath)
const existingExts = getExistingExtensions(filePath)
if (!resolvedExt && existingExts.length !== 1) {
// Ignore if the file extension could not be determined one.
return
}
const ext = resolvedExt || existingExts[0]
const style = overrideStyle[ext] || defaultStyle
// Verify.
if (style === "always" && ext !== originalExt) {
context.report({
node,
messageId: "requireExt",
data: { ext },
fix(fixer) {
if (existingExts.length !== 1) {
return null
}
const index = node.range[1] - 1
return fixer.insertTextBeforeRange([index, index], ext)
},
})
} else if (style === "never" && ext === originalExt) {
context.report({
node,
messageId: "forbidExt",
data: { ext },
fix(fixer) {
if (existingExts.length !== 1) {
return null
}
const index = name.lastIndexOf(ext)
const start = node.range[0] + 1 + index
const end = start + ext.length
return fixer.removeRange([start, end])
},
})
}
}
return visitImport(context, { optionIndex: 1 }, targets => {
targets.forEach(verify)
})
},
}
@@ -0,0 +1,19 @@
Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
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 @@
module.exports={C:{"34":0.00975,"46":0.00488,"47":0.00975,"52":0.00488,"68":0.00488,"72":0.00488,"88":0.00488,"93":0.00488,"112":0.00488,"115":0.05364,"125":0.01463,"128":0.01463,"136":0.00975,"138":0.00488,"139":0.03413,"140":0.02438,"141":0.00975,"142":0.02438,"143":0.5071,"144":0.38033,"145":0.01463,_:"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 35 36 37 38 39 40 41 42 43 44 45 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 69 70 71 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 89 90 91 92 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 113 114 116 117 118 119 120 121 122 123 124 126 127 129 130 131 132 133 134 135 137 146 147 3.5 3.6"},D:{"39":0.00975,"40":0.00975,"41":0.00975,"42":0.00975,"43":0.00975,"44":0.00488,"45":0.00488,"46":0.00975,"47":0.00975,"48":0.00488,"49":0.01463,"50":0.00975,"51":0.00975,"52":0.00488,"53":0.00488,"54":0.00488,"55":0.00488,"56":0.00975,"57":0.00488,"58":0.00488,"59":0.00488,"60":0.00975,"65":0.00488,"66":0.00488,"68":0.00488,"72":0.00488,"73":0.00488,"75":0.03413,"76":0.00488,"78":0.00488,"79":0.01463,"81":0.00488,"83":0.00488,"85":0.00488,"86":0.01463,"88":0.00488,"90":0.00488,"91":0.00975,"93":0.01463,"98":0.06339,"100":0.02926,"102":0.00975,"103":0.01463,"104":0.03901,"105":0.00488,"106":0.04876,"107":0.00488,"108":0.00488,"109":0.629,"111":0.03901,"112":10.22497,"113":0.00488,"114":0.01463,"116":0.03901,"117":0.00975,"119":0.04388,"120":0.0195,"121":0.00975,"122":0.03901,"123":0.00488,"124":0.33157,"125":3.47659,"126":1.219,"127":0.01463,"128":0.03901,"129":0.01463,"130":0.02926,"131":0.05851,"132":0.0195,"133":0.03413,"134":0.03901,"135":0.13653,"136":0.08289,"137":0.08289,"138":0.29256,"139":0.34132,"140":4.44691,"141":8.94258,"142":0.10727,_:"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 62 63 64 67 69 70 71 74 77 80 84 87 89 92 94 95 96 97 99 101 110 115 118 143 144 145"},F:{"90":0.00488,"91":0.00488,"92":0.00488,"95":0.0195,"102":0.03901,"117":0.00975,"120":0.04876,"121":0.0195,"122":0.55586,_:"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 93 94 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 113 114 115 116 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.00488,"13":0.00488,"14":0.00488,"16":0.00488,"18":0.02926,"84":0.00488,"92":0.02438,"100":0.00488,"109":0.02438,"114":0.14628,"115":0.00488,"122":0.01463,"126":0.00488,"127":0.00975,"131":0.00488,"132":0.00975,"133":0.00488,"134":0.0195,"135":0.01463,"136":0.00975,"137":0.01463,"138":0.05851,"139":0.07314,"140":0.85818,"141":4.3689,"142":0.00488,_:"15 17 79 80 81 83 85 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 116 117 118 119 120 121 123 124 125 128 129 130"},E:{"13":0.00488,"14":0.00488,_:"0 4 5 6 7 8 9 10 11 12 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 15.5 16.0 16.2 16.3 16.5 17.0 18.0 26.2","13.1":0.01463,"14.1":0.00488,"15.6":0.02438,"16.1":0.00488,"16.4":0.00975,"16.6":0.06826,"17.1":0.02438,"17.2":0.02438,"17.3":0.00488,"17.4":0.00488,"17.5":0.01463,"17.6":0.05851,"18.1":0.00488,"18.2":0.00488,"18.3":0.11215,"18.4":0.00488,"18.5-18.6":0.03901,"26.0":0.28768,"26.1":0.00488},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00038,"5.0-5.1":0,"6.0-6.1":0.0015,"7.0-7.1":0.00113,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00338,"10.0-10.2":0.00038,"10.3":0.00639,"11.0-11.2":0.09476,"11.3-11.4":0.00226,"12.0-12.1":0.00075,"12.2-12.5":0.01843,"13.0-13.1":0,"13.2":0.00188,"13.3":0.00075,"13.4-13.7":0.00301,"14.0-14.4":0.00639,"14.5-14.8":0.00677,"15.0-15.1":0.00639,"15.2-15.3":0.00489,"15.4":0.00564,"15.5":0.00639,"15.6-15.8":0.08348,"16.0":0.01128,"16.1":0.02106,"16.2":0.0109,"16.3":0.01955,"16.4":0.00489,"16.5":0.00865,"16.6-16.7":0.11168,"17.0":0.0079,"17.1":0.01203,"17.2":0.00865,"17.3":0.01278,"17.4":0.02256,"17.5":0.03873,"17.6-17.7":0.09777,"18.0":0.02219,"18.1":0.04588,"18.2":0.02482,"18.3":0.07972,"18.4":0.04099,"18.5-18.6":2.08996,"26.0":0.25833,"26.1":0.0094},P:{"4":0.04132,"22":0.03099,"23":0.01033,"24":0.13429,"25":0.05165,"26":0.03099,"27":0.1033,"28":1.81802,"29":0.05165,_:"20 21 5.0-5.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","6.2-6.4":0.01033,"7.2-7.4":0.24791},I:{"0":0.03069,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00002},K:{"0":0.66673,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00975,_:"6 7 8 9 10 5.5"},S:{"2.5":0.02049,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.10246},Q:{"14.9":0.00512},O:{"0":0.17418},H:{"0":0.03},L:{"0":52.03875}};
@@ -0,0 +1 @@
{"version":3,"file":"always.delay.js","sourceRoot":"","sources":["../../../src/delay/always/always.delay.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAsC;AAEtC;IAAiC,+BAAK;IAAtC;;IAAwC,CAAC;IAAD,kBAAC;AAAD,CAAC,AAAzC,CAAiC,kBAAK,GAAG;AAA5B,kCAAW"}
@@ -0,0 +1,212 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.2.1](https://github.com/es-shims/iterator-helpers/compare/v1.2.0...v1.2.1) - 2024-12-20
### Commits
- [Tests] `Iterator.concat`: add most of the tests from https://github.com/tc39/test262/pull/4326 [`2e340da`](https://github.com/es-shims/iterator-helpers/commit/2e340daf021139ea41dc828c7f99452114db8561)
- [Fix] `Iterator.concat`: rewrite implementation to match updated spec text [`1a70fd3`](https://github.com/es-shims/iterator-helpers/commit/1a70fd33ab81738ad2b748812a431d51e0c4d758)
- [Fix] `IteratorZip` AO: allow an empty list of iterators [`265e566`](https://github.com/es-shims/iterator-helpers/commit/265e5664dade59e2faa5d7d2e203b92cd0af5c35)
- [actions] split out node 10-20, and 20+ [`3cc9db0`](https://github.com/es-shims/iterator-helpers/commit/3cc9db03118e2b4b6432e262e7936a7e2f3074c4)
- [Fix] `IteratorHelperPrototype`: in pre-proto envs, use same `.return` impl [`da02ab6`](https://github.com/es-shims/iterator-helpers/commit/da02ab656dce1c4f73355290a3bd9e4c25ccc3b6)
- [Deps] update `call-bind`, `es-abstract`, `get-intrinsic`, `gopd`, `has-proto`, `internal-slot`, `iterator.prototype`, `safe-array-concat` [`e9eefab`](https://github.com/es-shims/iterator-helpers/commit/e9eefab99fb496f9a4600193126c69c321394d42)
- [Tests] `Iterator.zip`: nullish non-function Symbol.iterator does not throw [`c6b0705`](https://github.com/es-shims/iterator-helpers/commit/c6b0705e2b601c1c8d412679eca4fe4618051d8f)
- [Refactor] use `call-bound` directly [`92afc5a`](https://github.com/es-shims/iterator-helpers/commit/92afc5a7ed014b5e2b52db1b1a6a99d16f50d5d2)
- [Deps] update `gopd`, `has-proto`, `has-symbols` [`7f8a1c0`](https://github.com/es-shims/iterator-helpers/commit/7f8a1c0049dfd649bea9a707b9c451ba7e9f3b0e)
- [readme] add missing info for `Iterator.zip`, `Iterator.zipKeyed` [`dd80b2f`](https://github.com/es-shims/iterator-helpers/commit/dd80b2f1718092219e94e24afdc1737f062e3df4)
- [Dev Deps] update `@es-shims/api` [`1e9857c`](https://github.com/es-shims/iterator-helpers/commit/1e9857c497f8f4e6053c9adb7dddb98b6800c628)
- [Deps] update `es-abstract` [`c8157da`](https://github.com/es-shims/iterator-helpers/commit/c8157da5194372ddc968e0f512d0740544752d30)
- [Deps] update `es-abstract` [`256de0e`](https://github.com/es-shims/iterator-helpers/commit/256de0e1aa45d6d0ad12a19ef04491816bcb7288)
- [Dev Deps] update `object-inspect` [`2f8544b`](https://github.com/es-shims/iterator-helpers/commit/2f8544b7baa80174e7368d475a4e3fa577418938)
## [v1.2.0](https://github.com/es-shims/iterator-helpers/compare/v1.1.0...v1.2.0) - 2024-11-04
### Commits
- [New] add `Iterator.zip`, `Iterator.zipKeyed` [`d11073f`](https://github.com/es-shims/iterator-helpers/commit/d11073fd27fcdaf696c3d9b00634b6a5144f75b1)
- [Fix] `concat`: add missing slot for `.return`; convert singular slot to plural slot [`cc4b586`](https://github.com/es-shims/iterator-helpers/commit/cc4b586cdb0ad6ba540043077c3d71ff79d528cd)
- [Dev Deps] update `@es-shims/api` [`dd14f1b`](https://github.com/es-shims/iterator-helpers/commit/dd14f1b9f06c37f3bcb0a20bacd6e7f031c0724d)
## [v1.1.0](https://github.com/es-shims/iterator-helpers/compare/v1.0.19...v1.1.0) - 2024-10-09
### Commits
- [New] add `Iterator.concat` [`1c07c21`](https://github.com/es-shims/iterator-helpers/commit/1c07c21d42fa6f3de516191a2b7fb848679314e7)
- [readme] add ESM and CJS examples [`ae0b60c`](https://github.com/es-shims/iterator-helpers/commit/ae0b60cae42a5e6174809859e29d16085042e3b2)
- [Dev Deps] update `@es-shims/api`, `auto-changelog`, `es-value-fixtures`, `eslint-plugin-import`, `tape` [`bd34766`](https://github.com/es-shims/iterator-helpers/commit/bd34766d527cc625dcbc242297290a793f21b055)
- [Dev Deps] update `@ljharb/eslint-config`, `mock-property`, `object-inspect`, `tape` [`2016080`](https://github.com/es-shims/iterator-helpers/commit/201608082a32bc1fa114c012eeb72744e1bf5bfa)
- [readme] fix copy-paste errors [`799255c`](https://github.com/es-shims/iterator-helpers/commit/799255ce358f9f19ab54cc2377aafb404463d917)
- [Tests] replace `aud` with `npm audit` [`4c48a77`](https://github.com/es-shims/iterator-helpers/commit/4c48a77d90a6894863ad160fd0f88b3fc76653b6)
- [Deps] update `globalthis` [`14d9e97`](https://github.com/es-shims/iterator-helpers/commit/14d9e971f976da482cbb7ee76b583db9ce17e056)
- [Dev Deps] update `@es-shims/api` [`15d84bb`](https://github.com/es-shims/iterator-helpers/commit/15d84bbbe1864dfd028f30f98251cbdf19e74908)
- [Dev Deps] add missing peer dep [`34559b9`](https://github.com/es-shims/iterator-helpers/commit/34559b9a263dfbc3551fd0ff586639692c04e514)
## [v1.0.19](https://github.com/es-shims/iterator-helpers/compare/v1.0.18...v1.0.19) - 2024-04-24
### Commits
- [patch] remove unused AOs [`698cef7`](https://github.com/es-shims/iterator-helpers/commit/698cef79757378a74500690d5a5dc2a6b86cd304)
- [Fix] `drop`, `filter`, `flatMap`, `map`: rpatch a v8 bug when polyfilling [`3670395`](https://github.com/es-shims/iterator-helpers/commit/36703956321c201933c4c701c78304669a46947b)
- [Deps] update `es-abstract` [`d2b47a5`](https://github.com/es-shims/iterator-helpers/commit/d2b47a5f46d3f874aad67375346cb58bf8c9e8b2)
## [v1.0.18](https://github.com/es-shims/iterator-helpers/compare/v1.0.17...v1.0.18) - 2024-03-15
### Commits
- [Deps] update `es-abstract` [`6b45f15`](https://github.com/es-shims/iterator-helpers/commit/6b45f150e939cfbf93b816431a407c0838250e85)
- [Deps] update `es-set-tostringtag`, `has-proto`, `safe-array-concat` [`6350106`](https://github.com/es-shims/iterator-helpers/commit/6350106c9e5c18a67754ced3fd90465b0032f1e3)
- [Dev Deps] update `tape` [`5509b40`](https://github.com/es-shims/iterator-helpers/commit/5509b408791402d2f7d7882f905741e5a5dd805b)
- [Deps] remove an unused dep [`78e34a5`](https://github.com/es-shims/iterator-helpers/commit/78e34a5452e7b7ef3dc239a62dd8a7324fbb2305)
## [v1.0.17](https://github.com/es-shims/iterator-helpers/compare/v1.0.16...v1.0.17) - 2024-02-13
### Fixed
- [Fix] avoid use of internal `assertRecord` helper from `es-abstract` [`#5`](https://github.com/es-shims/iterator-helpers/issues/5)
### Commits
- [Deps] update `call-bind`, `es-abstract`, `has-property-descriptors` [`e563ee7`](https://github.com/es-shims/iterator-helpers/commit/e563ee7230897c41f7f3623a11fc0ecc6862ee1c)
## [v1.0.16](https://github.com/es-shims/iterator-helpers/compare/v1.0.15...v1.0.16) - 2024-02-09
### Commits
- [Refactor] use `IteratorStepValue` [`aa62d72`](https://github.com/es-shims/iterator-helpers/commit/aa62d72c52d86218942b4792c7131f72d939b733)
- [Refactor] use `es-errors` instead of `get-intrinsic` where possible [`05a25ae`](https://github.com/es-shims/iterator-helpers/commit/05a25aeccd0523df86b401c771d88fbea06558c9)
- [Deps] update `call-bind`, `es-abstract`, `es-set-tostringtag`, `function-bind`, `get-intrinsic`, `has-property-descriptors`, `internal-slot`, `safe-array-concat` [`6aeee43`](https://github.com/es-shims/iterator-helpers/commit/6aeee435ed5956b7c5ee66a51b86c26827874eae)
- [Dev Deps] update `aud`, `eslint-plugin-import`, `mock-property`, `npmignore`, `object-inspect`, `tape` [`0a21fdb`](https://github.com/es-shims/iterator-helpers/commit/0a21fdb4a59d25c248561b7f476fc9670b411855)
- [Deps] update `call-bind`, `es-errors`, `get-intrinsic`, `internal-slot` [`5b10625`](https://github.com/es-shims/iterator-helpers/commit/5b106251dad4252a744b2e0aa0d1be4c1c62b779)
- [meta] add missing `engines.node` [`1534039`](https://github.com/es-shims/iterator-helpers/commit/1534039eca062429c0df68dcc3459ce9ba7c69be)
- [Deps] update `get-intrinsic` [`37da5f2`](https://github.com/es-shims/iterator-helpers/commit/37da5f201940c78526de647ef9ba84d9152349c1)
- [Dev Deps] update `has-tostringtag` [`a7cac51`](https://github.com/es-shims/iterator-helpers/commit/a7cac51cc027e6274918cb1ea0cf1fa1a194fcd9)
## [v1.0.15](https://github.com/es-shims/iterator-helpers/compare/v1.0.14...v1.0.15) - 2023-09-13
### Commits
- [New] add `Iterator.prototype` shim [`c4a6203`](https://github.com/es-shims/iterator-helpers/commit/c4a6203a0ac87bf0a33835e775c207ff1911225d)
- [Tests] add passing tests for native generators [`57bae8c`](https://github.com/es-shims/iterator-helpers/commit/57bae8ccbeb27ed0e6c449f35cddbda6cf6757e8)
- [Deps] update `define-properties`, `iterator.prototype`, `safe-array-concat` [`56ca087`](https://github.com/es-shims/iterator-helpers/commit/56ca087f924dbefee47f0a1cb3b8468de76cd234)
## [v1.0.14](https://github.com/es-shims/iterator-helpers/compare/v1.0.13...v1.0.14) - 2023-08-26
### Commits
- [Deps] update `es-abstract` [`477b123`](https://github.com/es-shims/iterator-helpers/commit/477b1233acd36fdbbccd79fbb69cde325bc3e6a9)
- [Dev Deps] update `aud`, `eslint-plugin-import`, `tape` [`e4ea414`](https://github.com/es-shims/iterator-helpers/commit/e4ea4146feffb72fd828e5d883e960e0ad589a35)
## [v1.0.13](https://github.com/es-shims/iterator-helpers/compare/v1.0.12...v1.0.13) - 2023-08-16
### Fixed
- [Deps] add missing deps; add eslint-plugin-import [`#3`](https://github.com/es-shims/iterator-helpers/issues/3)
## [v1.0.12](https://github.com/es-shims/iterator-helpers/compare/v1.0.11...v1.0.12) - 2023-07-14
### Commits
- [Fix] avoid creating string wrapper objects with sloppy mode flatMap mappers [`db16b34`](https://github.com/es-shims/iterator-helpers/commit/db16b34aec554934ec2bfd62629fb66cebc311f8)
- [Deps] update `es-abstract` [`f002147`](https://github.com/es-shims/iterator-helpers/commit/f002147f0afbb2cd7c2d2e1207685f52e33abf0f)
- [Dev Deps] update `@ljharb/eslint-config`, `aud [`42064e8`](https://github.com/es-shims/iterator-helpers/commit/42064e80e0cc37f5e4676c2133dacae7456e313f)
- [meta] fix tidelift funding identifier [`896fd4f`](https://github.com/es-shims/iterator-helpers/commit/896fd4f2e4b419945bfbd85024a2c96248323151)
## [v1.0.11](https://github.com/es-shims/iterator-helpers/compare/v1.0.10...v1.0.11) - 2023-05-22
### Commits
- [Fix] iterator helpers are not a constructor [`8a7f999`](https://github.com/es-shims/iterator-helpers/commit/8a7f9996ba3600ef30f3a9c75f9f994e88d075c6)
## [v1.0.10](https://github.com/es-shims/iterator-helpers/compare/v1.0.9...v1.0.10) - 2023-05-18
### Commits
- [patch] remove IsCallable check on NextMethod, deferring errors to callsite [`bbb7efa`](https://github.com/es-shims/iterator-helpers/commit/bbb7efac8349273fe17c86194ef13af45bcb8e24)
- [patch] change Symbol.iterator fallback from callable check to nullish check [`ec3e255`](https://github.com/es-shims/iterator-helpers/commit/ec3e255dfe30ea6650d8a697e6c4f16fa393e923)
- [Tests] add test cases [`5117c47`](https://github.com/es-shims/iterator-helpers/commit/5117c477348407ebdfc9410dd437a68634c39a8e)
- [Dev Deps] update `@es-shims/api` [`9fa13a0`](https://github.com/es-shims/iterator-helpers/commit/9fa13a0739f353536de58b2b648aa9eacfa49479)
- [Dev Deps] update `@es-shims/api` [`b74b0ac`](https://github.com/es-shims/iterator-helpers/commit/b74b0ac2bd7e920f760bae7ba7c6c5310f5123d8)
## [v1.0.9](https://github.com/es-shims/iterator-helpers/compare/v1.0.8...v1.0.9) - 2023-05-02
### Commits
- [Refactor] use 2022 AO instead of 2015 AO [`75ee5c4`](https://github.com/es-shims/iterator-helpers/commit/75ee5c4dea0037f02a61c240114bb6bd8c8b48f1)
## [v1.0.8](https://github.com/es-shims/iterator-helpers/compare/v1.0.7...v1.0.8) - 2023-05-02
### Commits
- [Fix] `flatMap`: close the inner iterator when applicable [`4dc94e0`](https://github.com/es-shims/iterator-helpers/commit/4dc94e0117e34b4c99f9ed96c4fe306896c47da1)
## [v1.0.7](https://github.com/es-shims/iterator-helpers/compare/v1.0.6...v1.0.7) - 2023-05-01
### Commits
- [Fix] `flatMap`: properly handle yielded iterables [`3a78767`](https://github.com/es-shims/iterator-helpers/commit/3a78767e86394d45b212a225e4253745f8b1dc8d)
- [Fix] `flatMap`: only increment the count when iterating the outer iterator [`955d0b0`](https://github.com/es-shims/iterator-helpers/commit/955d0b00f5660db0d9febef2a16426dfc32e8be4)
## [v1.0.6](https://github.com/es-shims/iterator-helpers/compare/v1.0.5...v1.0.6) - 2023-04-20
### Commits
- [Refactor] `GetIteratorFlattenable`: remove hint [`781fc7c`](https://github.com/es-shims/iterator-helpers/commit/781fc7c28615aaaef139cbcd9e6ade513419bea1)
- [Refactor] `GetIteratorFlattenable`: use `GetIteratorDirect` [`026118b`](https://github.com/es-shims/iterator-helpers/commit/026118b8c884adaee5ab0eb12de838ef9abdbb6f)
- [Refactor] use `safe-array-concat` [`1d985a4`](https://github.com/es-shims/iterator-helpers/commit/1d985a449be212523f05ba4a359a162931ddf3d3)
## [v1.0.5](https://github.com/es-shims/iterator-helpers/compare/v1.0.4...v1.0.5) - 2023-03-22
### Commits
- [Tests] add passing tests for 4240029 [`c2082fe`](https://github.com/es-shims/iterator-helpers/commit/c2082fee3e73dc1998a67fbe0014e3ebdceb8ec0)
- [Fix] properly allow subclasses of Iterator to be constructed [`5cebe2a`](https://github.com/es-shims/iterator-helpers/commit/5cebe2a5767393696d0ce4e9325edf78c300f938)
## [v1.0.4](https://github.com/es-shims/iterator-helpers/compare/v1.0.3...v1.0.4) - 2023-03-21
### Commits
- [Fix] validate arguments first [`4240029`](https://github.com/es-shims/iterator-helpers/commit/42400297454909ddccc899a012dc55bbd403eb8b)
- [Fix] close underlying iterator when helper is closed [`f5372c7`](https://github.com/es-shims/iterator-helpers/commit/f5372c78cafff64bfda5849386538f806916049a)
- [Tests] `Iterator`: remove an unnecessary call-bind [`7d0ba59`](https://github.com/es-shims/iterator-helpers/commit/7d0ba59f672e690b189f91e0348f6b5e00f934e1)
## [v1.0.3](https://github.com/es-shims/iterator-helpers/compare/v1.0.2...v1.0.3) - 2023-03-17
### Commits
- [Fix] `drop`/`filter`/`flatMap`/`map`/`take`: properly IfAbruptCloseIterator [`ff643a0`](https://github.com/es-shims/iterator-helpers/commit/ff643a0b7c4e5c2b00e794ba9b988b47e783f235)
- [Refactor] use `NormalCompletion`/`ThrowCompletion` instead of thunks [`68fd937`](https://github.com/es-shims/iterator-helpers/commit/68fd937b53c107481a9f868bda5b2bd5cbc00142)
- [Fix] `filter`: IteratorClose needs to rethrow the error [`200474f`](https://github.com/es-shims/iterator-helpers/commit/200474ff289dea77c696c0c025f4602405cf3fff)
- [Fix] `filter`: properly increment the counter [`14aa2d8`](https://github.com/es-shims/iterator-helpers/commit/14aa2d8b75fd16378c2be183fd5b008712547ed4)
- [Fix] `Iterator` can not be `new`ed or invoked directly [`6fbd68e`](https://github.com/es-shims/iterator-helpers/commit/6fbd68e778dd455c4aa63f4e1f39e0b583610509)
- [Fix] `Iterator.prototype` should be non-writable [`1080288`](https://github.com/es-shims/iterator-helpers/commit/108028858067e40ea56dca9a68dd6cea4966e904)
- [Deps] update `es-abstract` [`b7913da`](https://github.com/es-shims/iterator-helpers/commit/b7913da9cddef1ec40b4827821c6069019b79093)
- [Dev Deps] update `@es-shims/api` [`0071bed`](https://github.com/es-shims/iterator-helpers/commit/0071bed9e13231317d2cdb9ae0ecb6603784ad1f)
## [v1.0.2](https://github.com/es-shims/iterator-helpers/compare/v1.0.1...v1.0.2) - 2023-02-09
### Commits
- [Refactor] inline 2023 impls of Iterator AOs until es-abstract is published with them [`b9c80c5`](https://github.com/es-shims/iterator-helpers/commit/b9c80c5aba0deaaabef7e650fe7ec231fdc695e3)
- [Fix] ensure calling `.return` does not invoke the next iteration [`9e28ed5`](https://github.com/es-shims/iterator-helpers/commit/9e28ed5af44a660a0d2e80684cb9a4bf3d86e09a)
- [Fix] `map`: pass the proper index argument to the mapper [`125e3ca`](https://github.com/es-shims/iterator-helpers/commit/125e3cac192ef650a88f774a5a2dd9afe395a5b8)
- [Deps] update `internal-slot` [`43351b6`](https://github.com/es-shims/iterator-helpers/commit/43351b63545e3698f54daf5dc0652a7b2fb7cb28)
## [v1.0.1](https://github.com/es-shims/iterator-helpers/compare/v1.0.0...v1.0.1) - 2023-02-07
### Commits
- [Fix] `Iterator`: throw when Iterator() is called without new [`a6fc7e7`](https://github.com/es-shims/iterator-helpers/commit/a6fc7e768cbf4d43117365ec2f1bd300247d8dfd)
## v1.0.0 - 2023-02-05
### Commits
- Initial implementation, tests, readme [`650713e`](https://github.com/es-shims/iterator-helpers/commit/650713eecc9d4dab28d5ba3dc5afcbdb8ff99b5a)
- Initial commit [`2379dfd`](https://github.com/es-shims/iterator-helpers/commit/2379dfdad70f64efb31e342a4a7779b1140b2481)
- npm init [`f77411a`](https://github.com/es-shims/iterator-helpers/commit/f77411a443f1a103dbb92a69210228d4fc1e6d04)
- Only apps should have lockfiles [`313dcf5`](https://github.com/es-shims/iterator-helpers/commit/313dcf5211e99569ad275885728b5ac7af30f4ec)
@@ -0,0 +1 @@
{"version":3,"names":["_toPropertyKey","require","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","toPropertyKey","key","_createClass","Constructor","protoProps","staticProps","prototype"],"sources":["../../src/helpers/createClass.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport toPropertyKey from \"./toPropertyKey.ts\";\n\ninterface Prop extends PropertyDescriptor {\n key: PropertyKey;\n}\n\nfunction _defineProperties(target: object, props: Prop[]): void {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\n\nexport default function _createClass<T extends new (...args: any[]) => any>(\n Constructor: T,\n protoProps?: Prop[],\n staticProps?: Prop[],\n): T {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", { writable: false });\n return Constructor;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAMA,SAASC,iBAAiBA,CAACC,MAAc,EAAEC,KAAa,EAAQ;EAC9D,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,KAAK,CAACE,MAAM,EAAED,CAAC,EAAE,EAAE;IACrC,IAAIE,UAAU,GAAGH,KAAK,CAACC,CAAC,CAAC;IACzBE,UAAU,CAACC,UAAU,GAAGD,UAAU,CAACC,UAAU,IAAI,KAAK;IACtDD,UAAU,CAACE,YAAY,GAAG,IAAI;IAC9B,IAAI,OAAO,IAAIF,UAAU,EAAEA,UAAU,CAACG,QAAQ,GAAG,IAAI;IACrDC,MAAM,CAACC,cAAc,CAACT,MAAM,EAAE,IAAAU,sBAAa,EAACN,UAAU,CAACO,GAAG,CAAC,EAAEP,UAAU,CAAC;EAC1E;AACF;AAEe,SAASQ,YAAYA,CAClCC,WAAc,EACdC,UAAmB,EACnBC,WAAoB,EACjB;EACH,IAAID,UAAU,EAAEf,iBAAiB,CAACc,WAAW,CAACG,SAAS,EAAEF,UAAU,CAAC;EACpE,IAAIC,WAAW,EAAEhB,iBAAiB,CAACc,WAAW,EAAEE,WAAW,CAAC;EAC5DP,MAAM,CAACC,cAAc,CAACI,WAAW,EAAE,WAAW,EAAE;IAAEN,QAAQ,EAAE;EAAM,CAAC,CAAC;EACpE,OAAOM,WAAW;AACpB","ignoreList":[]}
@@ -0,0 +1,13 @@
import { cancelFrame, frame } from '../frameloop/frame.mjs';
function subscribeValue(inputValues, outputValue, getLatest) {
const update = () => outputValue.set(getLatest());
const scheduleUpdate = () => frame.preRender(update, false, true);
const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate));
outputValue.on("destroy", () => {
subscriptions.forEach((unsubscribe) => unsubscribe());
cancelFrame(update);
});
}
export { subscribeValue };
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var IframeRole = {
relatedConcepts: [{
module: 'HTML',
concept: {
name: 'iframe'
}
}],
type: 'window'
};
var _default = IframeRole;
exports.default = _default;
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L M G N"},C:{"1":"0 1 2 3 4 5 uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"6 7 8 9 xC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB 0C 1C"},D:{"1":"0 1 2 3 4 5 zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB","194":"xB yB"},E:{"1":"A B C L M G aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","2":"J ZB K D E F 2C ZC 3C 4C 5C 6C"},F:{"1":"0 1 2 3 4 5 mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","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 FD GD HD ID NC uC JD OC","194":"lB"},G:{"1":"RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","2":"E ZC KD vC LD MD ND OD PD QD"},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 pD qD rD sD aC tD uD vD wD xD QC RC SC yD","2":"J oD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"2D","2":"1D"}},B:1,C:"DOM manipulation convenience methods",D:true};
@@ -0,0 +1,133 @@
# parseurl
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Node.js Version][node-image]][node-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]
Parse a URL with memoization.
## Install
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```sh
$ npm install parseurl
```
## API
```js
var parseurl = require('parseurl')
```
### parseurl(req)
Parse the URL of the given request object (looks at the `req.url` property)
and return the result. The result is the same as `url.parse` in Node.js core.
Calling this function multiple times on the same `req` where `req.url` does
not change will return a cached parsed object, rather than parsing again.
### parseurl.original(req)
Parse the original URL of the given request object and return the result.
This works by trying to parse `req.originalUrl` if it is a string, otherwise
parses `req.url`. The result is the same as `url.parse` in Node.js core.
Calling this function multiple times on the same `req` where `req.originalUrl`
does not change will return a cached parsed object, rather than parsing again.
## Benchmark
```bash
$ npm run-script bench
> parseurl@1.3.3 bench nodejs-parseurl
> node benchmark/index.js
http_parser@2.8.0
node@10.6.0
v8@6.7.288.46-node.13
uv@1.21.0
zlib@1.2.11
ares@1.14.0
modules@64
nghttp2@1.32.0
napi@3
openssl@1.1.0h
icu@61.1
unicode@10.0
cldr@33.0
tz@2018c
> node benchmark/fullurl.js
Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy"
4 tests completed.
fasturl x 2,207,842 ops/sec ±3.76% (184 runs sampled)
nativeurl - legacy x 507,180 ops/sec ±0.82% (191 runs sampled)
nativeurl - whatwg x 290,044 ops/sec ±1.96% (189 runs sampled)
parseurl x 488,907 ops/sec ±2.13% (192 runs sampled)
> node benchmark/pathquery.js
Parsing URL "/foo/bar?user=tj&pet=fluffy"
4 tests completed.
fasturl x 3,812,564 ops/sec ±3.15% (188 runs sampled)
nativeurl - legacy x 2,651,631 ops/sec ±1.68% (189 runs sampled)
nativeurl - whatwg x 161,837 ops/sec ±2.26% (189 runs sampled)
parseurl x 4,166,338 ops/sec ±2.23% (184 runs sampled)
> node benchmark/samerequest.js
Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object
4 tests completed.
fasturl x 3,821,651 ops/sec ±2.42% (185 runs sampled)
nativeurl - legacy x 2,651,162 ops/sec ±1.90% (187 runs sampled)
nativeurl - whatwg x 175,166 ops/sec ±1.44% (188 runs sampled)
parseurl x 14,912,606 ops/sec ±3.59% (183 runs sampled)
> node benchmark/simplepath.js
Parsing URL "/foo/bar"
4 tests completed.
fasturl x 12,421,765 ops/sec ±2.04% (191 runs sampled)
nativeurl - legacy x 7,546,036 ops/sec ±1.41% (188 runs sampled)
nativeurl - whatwg x 198,843 ops/sec ±1.83% (189 runs sampled)
parseurl x 24,244,006 ops/sec ±0.51% (194 runs sampled)
> node benchmark/slash.js
Parsing URL "/"
4 tests completed.
fasturl x 17,159,456 ops/sec ±3.25% (188 runs sampled)
nativeurl - legacy x 11,635,097 ops/sec ±3.79% (184 runs sampled)
nativeurl - whatwg x 240,693 ops/sec ±0.83% (189 runs sampled)
parseurl x 42,279,067 ops/sec ±0.55% (190 runs sampled)
```
## License
[MIT](LICENSE)
[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/parseurl/master
[coveralls-url]: https://coveralls.io/r/pillarjs/parseurl?branch=master
[node-image]: https://badgen.net/npm/node/parseurl
[node-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/parseurl
[npm-url]: https://npmjs.org/package/parseurl
[npm-version-image]: https://badgen.net/npm/v/parseurl
[travis-image]: https://badgen.net/travis/pillarjs/parseurl/master
[travis-url]: https://travis-ci.org/pillarjs/parseurl
@@ -0,0 +1,47 @@
'use strict'
const browsers = require('./browsers').browsers
const versions = require('./browserVersions').browserVersions
const agentsData = require('../../data/agents')
function unpackBrowserVersions(versionsData) {
return Object.keys(versionsData).reduce((usage, version) => {
usage[versions[version]] = versionsData[version]
return usage
}, {})
}
module.exports.agents = Object.keys(agentsData).reduce((map, key) => {
let versionsData = agentsData[key]
map[browsers[key]] = Object.keys(versionsData).reduce((data, entry) => {
if (entry === 'A') {
data.usage_global = unpackBrowserVersions(versionsData[entry])
} else if (entry === 'C') {
data.versions = versionsData[entry].reduce((list, version) => {
if (version === '') {
list.push(null)
} else {
list.push(versions[version])
}
return list
}, [])
} else if (entry === 'D') {
data.prefix_exceptions = unpackBrowserVersions(versionsData[entry])
} else if (entry === 'E') {
data.browser = versionsData[entry]
} else if (entry === 'F') {
data.release_date = Object.keys(versionsData[entry]).reduce(
(map2, key2) => {
map2[versions[key2]] = versionsData[entry][key2]
return map2
},
{}
)
} else {
// entry is B
data.prefix = versionsData[entry]
}
return data
}, {})
return map
}, {})
@@ -0,0 +1,86 @@
Starting with version 7.0.0, the `{preview}` property generation on the [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects and the `{disablePreview}` property on the `<Dropzone>` have been removed.
If you need the `{preview}`, it can be easily achieved in the `onDrop()` callback:
```jsx harmony
import React, {useEffect, useState} from 'react';
import {useDropzone} from 'react-dropzone';
const thumbsContainer = {
display: 'flex',
flexDirection: 'row',
flexWrap: 'wrap',
marginTop: 16
};
const thumb = {
display: 'inline-flex',
borderRadius: 2,
border: '1px solid #eaeaea',
marginBottom: 8,
marginRight: 8,
width: 100,
height: 100,
padding: 4,
boxSizing: 'border-box'
};
const thumbInner = {
display: 'flex',
minWidth: 0,
overflow: 'hidden'
};
const img = {
display: 'block',
width: 'auto',
height: '100%'
};
function Previews(props) {
const [files, setFiles] = useState([]);
const {getRootProps, getInputProps} = useDropzone({
accept: {
'image/*': []
},
onDrop: acceptedFiles => {
setFiles(acceptedFiles.map(file => Object.assign(file, {
preview: URL.createObjectURL(file)
})));
}
});
const thumbs = files.map(file => (
<div style={thumb} key={file.name}>
<div style={thumbInner}>
<img
src={file.preview}
style={img}
// Revoke data uri after image is loaded
onLoad={() => { URL.revokeObjectURL(file.preview) }}
/>
</div>
</div>
));
useEffect(() => {
// Make sure to revoke the data uris to avoid memory leaks, will run on unmount
return () => files.forEach(file => URL.revokeObjectURL(file.preview));
}, [files]);
return (
<section className="container">
<div {...getRootProps({className: 'dropzone'})}>
<input {...getInputProps()} />
<p>Drag 'n' drop some files here, or click to select files</p>
</div>
<aside style={thumbsContainer}>
{thumbs}
</aside>
</section>
);
}
<Previews />
```
@@ -0,0 +1,706 @@
// THIS FILE IS AUTO GENERATED
import type { IconType } from '../lib/index'
export declare const CgAbstract: IconType;
export declare const CgAddR: IconType;
export declare const CgAdd: IconType;
export declare const CgAdidas: IconType;
export declare const CgAirplane: IconType;
export declare const CgAlarm: IconType;
export declare const CgAlbum: IconType;
export declare const CgAlignBottom: IconType;
export declare const CgAlignCenter: IconType;
export declare const CgAlignLeft: IconType;
export declare const CgAlignMiddle: IconType;
export declare const CgAlignRight: IconType;
export declare const CgAlignTop: IconType;
export declare const CgAnchor: IconType;
export declare const CgAppleWatch: IconType;
export declare const CgArrangeBack: IconType;
export declare const CgArrangeFront: IconType;
export declare const CgArrowAlignH: IconType;
export declare const CgArrowAlignV: IconType;
export declare const CgArrowBottomLeftO: IconType;
export declare const CgArrowBottomLeftR: IconType;
export declare const CgArrowBottomLeft: IconType;
export declare const CgArrowBottomRightO: IconType;
export declare const CgArrowBottomRightR: IconType;
export declare const CgArrowBottomRight: IconType;
export declare const CgArrowDownO: IconType;
export declare const CgArrowDownR: IconType;
export declare const CgArrowDown: IconType;
export declare const CgArrowLeftO: IconType;
export declare const CgArrowLeftR: IconType;
export declare const CgArrowLeft: IconType;
export declare const CgArrowLongDownC: IconType;
export declare const CgArrowLongDownE: IconType;
export declare const CgArrowLongDownL: IconType;
export declare const CgArrowLongDownR: IconType;
export declare const CgArrowLongDown: IconType;
export declare const CgArrowLongLeftC: IconType;
export declare const CgArrowLongLeftE: IconType;
export declare const CgArrowLongLeftL: IconType;
export declare const CgArrowLongLeftR: IconType;
export declare const CgArrowLongLeft: IconType;
export declare const CgArrowLongRightC: IconType;
export declare const CgArrowLongRightE: IconType;
export declare const CgArrowLongRightL: IconType;
export declare const CgArrowLongRightR: IconType;
export declare const CgArrowLongRight: IconType;
export declare const CgArrowLongUpC: IconType;
export declare const CgArrowLongUpE: IconType;
export declare const CgArrowLongUpL: IconType;
export declare const CgArrowLongUpR: IconType;
export declare const CgArrowLongUp: IconType;
export declare const CgArrowRightO: IconType;
export declare const CgArrowRightR: IconType;
export declare const CgArrowRight: IconType;
export declare const CgArrowTopLeftO: IconType;
export declare const CgArrowTopLeftR: IconType;
export declare const CgArrowTopLeft: IconType;
export declare const CgArrowTopRightO: IconType;
export declare const CgArrowTopRightR: IconType;
export declare const CgArrowTopRight: IconType;
export declare const CgArrowUpO: IconType;
export declare const CgArrowUpR: IconType;
export declare const CgArrowUp: IconType;
export declare const CgArrowsBreakeH: IconType;
export declare const CgArrowsBreakeV: IconType;
export declare const CgArrowsExchangeAltV: IconType;
export declare const CgArrowsExchangeAlt: IconType;
export declare const CgArrowsExchangeV: IconType;
export declare const CgArrowsExchange: IconType;
export declare const CgArrowsExpandDownLeft: IconType;
export declare const CgArrowsExpandDownRight: IconType;
export declare const CgArrowsExpandLeftAlt: IconType;
export declare const CgArrowsExpandLeft: IconType;
export declare const CgArrowsExpandRightAlt: IconType;
export declare const CgArrowsExpandRight: IconType;
export declare const CgArrowsExpandUpLeft: IconType;
export declare const CgArrowsExpandUpRight: IconType;
export declare const CgArrowsHAlt: IconType;
export declare const CgArrowsH: IconType;
export declare const CgArrowsMergeAltH: IconType;
export declare const CgArrowsMergeAltV: IconType;
export declare const CgArrowsScrollH: IconType;
export declare const CgArrowsScrollV: IconType;
export declare const CgArrowsShrinkH: IconType;
export declare const CgArrowsShrinkV: IconType;
export declare const CgArrowsVAlt: IconType;
export declare const CgArrowsV: IconType;
export declare const CgAssign: IconType;
export declare const CgAsterisk: IconType;
export declare const CgAtlasian: IconType;
export declare const CgAttachment: IconType;
export declare const CgAttribution: IconType;
export declare const CgAwards: IconType;
export declare const CgBackspace: IconType;
export declare const CgBandAid: IconType;
export declare const CgBatteryEmpty: IconType;
export declare const CgBatteryFull: IconType;
export declare const CgBattery: IconType;
export declare const CgBee: IconType;
export declare const CgBell: IconType;
export declare const CgBitbucket: IconType;
export declare const CgBlock: IconType;
export declare const CgBmw: IconType;
export declare const CgBoard: IconType;
export declare const CgBolt: IconType;
export declare const CgBookmark: IconType;
export declare const CgBorderAll: IconType;
export declare const CgBorderBottom: IconType;
export declare const CgBorderLeft: IconType;
export declare const CgBorderRight: IconType;
export declare const CgBorderStyleDashed: IconType;
export declare const CgBorderStyleDotted: IconType;
export declare const CgBorderStyleSolid: IconType;
export declare const CgBorderTop: IconType;
export declare const CgBot: IconType;
export declare const CgBowl: IconType;
export declare const CgBox: IconType;
export declare const CgBoy: IconType;
export declare const CgBrackets: IconType;
export declare const CgBriefcase: IconType;
export declare const CgBrowse: IconType;
export declare const CgBrowser: IconType;
export declare const CgBrush: IconType;
export declare const CgBulb: IconType;
export declare const CgCPlusPlus: IconType;
export declare const CgCalculator: IconType;
export declare const CgCalendarDates: IconType;
export declare const CgCalendarDue: IconType;
export declare const CgCalendarNext: IconType;
export declare const CgCalendarToday: IconType;
export declare const CgCalendarTwo: IconType;
export declare const CgCalendar: IconType;
export declare const CgCalibrate: IconType;
export declare const CgCamera: IconType;
export declare const CgCap: IconType;
export declare const CgCaptions: IconType;
export declare const CgCardClubs: IconType;
export declare const CgCardDiamonds: IconType;
export declare const CgCardHearts: IconType;
export declare const CgCardSpades: IconType;
export declare const CgCarousel: IconType;
export declare const CgCast: IconType;
export declare const CgChanel: IconType;
export declare const CgChart: IconType;
export declare const CgCheckO: IconType;
export declare const CgCheckR: IconType;
export declare const CgCheck: IconType;
export declare const CgChevronDoubleDownO: IconType;
export declare const CgChevronDoubleDownR: IconType;
export declare const CgChevronDoubleDown: IconType;
export declare const CgChevronDoubleLeftO: IconType;
export declare const CgChevronDoubleLeftR: IconType;
export declare const CgChevronDoubleLeft: IconType;
export declare const CgChevronDoubleRightO: IconType;
export declare const CgChevronDoubleRightR: IconType;
export declare const CgChevronDoubleRight: IconType;
export declare const CgChevronDoubleUpO: IconType;
export declare const CgChevronDoubleUpR: IconType;
export declare const CgChevronDoubleUp: IconType;
export declare const CgChevronDownO: IconType;
export declare const CgChevronDownR: IconType;
export declare const CgChevronDown: IconType;
export declare const CgChevronLeftO: IconType;
export declare const CgChevronLeftR: IconType;
export declare const CgChevronLeft: IconType;
export declare const CgChevronRightO: IconType;
export declare const CgChevronRightR: IconType;
export declare const CgChevronRight: IconType;
export declare const CgChevronUpO: IconType;
export declare const CgChevronUpR: IconType;
export declare const CgChevronUp: IconType;
export declare const CgCircleci: IconType;
export declare const CgClapperBoard: IconType;
export declare const CgClipboard: IconType;
export declare const CgCloseO: IconType;
export declare const CgCloseR: IconType;
export declare const CgClose: IconType;
export declare const CgCloud: IconType;
export declare const CgCodeClimate: IconType;
export declare const CgCodeSlash: IconType;
export declare const CgCode: IconType;
export declare const CgCoffee: IconType;
export declare const CgCollage: IconType;
export declare const CgColorBucket: IconType;
export declare const CgColorPicker: IconType;
export declare const CgComedyCentral: IconType;
export declare const CgComment: IconType;
export declare const CgCommunity: IconType;
export declare const CgComponents: IconType;
export declare const CgCompressLeft: IconType;
export declare const CgCompressRight: IconType;
export declare const CgCompressV: IconType;
export declare const CgCompress: IconType;
export declare const CgController: IconType;
export declare const CgCopy: IconType;
export declare const CgCopyright: IconType;
export declare const CgCornerDoubleDownLeft: IconType;
export declare const CgCornerDoubleDownRight: IconType;
export declare const CgCornerDoubleLeftDown: IconType;
export declare const CgCornerDoubleLeftUp: IconType;
export declare const CgCornerDoubleRightDown: IconType;
export declare const CgCornerDoubleRightUp: IconType;
export declare const CgCornerDoubleUpLeft: IconType;
export declare const CgCornerDoubleUpRight: IconType;
export declare const CgCornerDownLeft: IconType;
export declare const CgCornerDownRight: IconType;
export declare const CgCornerLeftDown: IconType;
export declare const CgCornerLeftUp: IconType;
export declare const CgCornerRightDown: IconType;
export declare const CgCornerRightUp: IconType;
export declare const CgCornerUpLeft: IconType;
export declare const CgCornerUpRight: IconType;
export declare const CgCreditCard: IconType;
export declare const CgCrop: IconType;
export declare const CgCross: IconType;
export declare const CgCrowdfire: IconType;
export declare const CgCrown: IconType;
export declare const CgDanger: IconType;
export declare const CgDarkMode: IconType;
export declare const CgData: IconType;
export declare const CgDatabase: IconType;
export declare const CgDebug: IconType;
export declare const CgDesignmodo: IconType;
export declare const CgDesktop: IconType;
export declare const CgDetailsLess: IconType;
export declare const CgDetailsMore: IconType;
export declare const CgDialpad: IconType;
export declare const CgDice1: IconType;
export declare const CgDice2: IconType;
export declare const CgDice3: IconType;
export declare const CgDice4: IconType;
export declare const CgDice5: IconType;
export declare const CgDice6: IconType;
export declare const CgDigitalocean: IconType;
export declare const CgDisc: IconType;
export declare const CgDisplayFlex: IconType;
export declare const CgDisplayFullwidth: IconType;
export declare const CgDisplayGrid: IconType;
export declare const CgDisplaySpacing: IconType;
export declare const CgDistributeHorizontal: IconType;
export declare const CgDistributeVertical: IconType;
export declare const CgDockBottom: IconType;
export declare const CgDockLeft: IconType;
export declare const CgDockRight: IconType;
export declare const CgDockWindow: IconType;
export declare const CgDolby: IconType;
export declare const CgDollar: IconType;
export declare const CgDribbble: IconType;
export declare const CgDrive: IconType;
export declare const CgDropInvert: IconType;
export declare const CgDropOpacity: IconType;
export declare const CgDrop: IconType;
export declare const CgDuplicate: IconType;
export declare const CgEditBlackPoint: IconType;
export declare const CgEditContrast: IconType;
export declare const CgEditExposure: IconType;
export declare const CgEditFade: IconType;
export declare const CgEditFlipH: IconType;
export declare const CgEditFlipV: IconType;
export declare const CgEditHighlight: IconType;
export declare const CgEditMarkup: IconType;
export declare const CgEditMask: IconType;
export declare const CgEditNoise: IconType;
export declare const CgEditShadows: IconType;
export declare const CgEditStraight: IconType;
export declare const CgEditUnmask: IconType;
export declare const CgEject: IconType;
export declare const CgEnter: IconType;
export declare const CgErase: IconType;
export declare const CgEreader: IconType;
export declare const CgEricsson: IconType;
export declare const CgEthernet: IconType;
export declare const CgEuro: IconType;
export declare const CgEventbrite: IconType;
export declare const CgExpand: IconType;
export declare const CgExport: IconType;
export declare const CgExtensionAdd: IconType;
export declare const CgExtensionAlt: IconType;
export declare const CgExtensionRemove: IconType;
export declare const CgExtension: IconType;
export declare const CgExternal: IconType;
export declare const CgEyeAlt: IconType;
export declare const CgEye: IconType;
export declare const CgFacebook: IconType;
export declare const CgFeed: IconType;
export declare const CgFigma: IconType;
export declare const CgFileAdd: IconType;
export declare const CgFileDocument: IconType;
export declare const CgFileRemove: IconType;
export declare const CgFile: IconType;
export declare const CgFilm: IconType;
export declare const CgFilters: IconType;
export declare const CgFlagAlt: IconType;
export declare const CgFlag: IconType;
export declare const CgFolderAdd: IconType;
export declare const CgFolderRemove: IconType;
export declare const CgFolder: IconType;
export declare const CgFontHeight: IconType;
export declare const CgFontSpacing: IconType;
export declare const CgFormatBold: IconType;
export declare const CgFormatCenter: IconType;
export declare const CgFormatColor: IconType;
export declare const CgFormatHeading: IconType;
export declare const CgFormatIndentDecrease: IconType;
export declare const CgFormatIndentIncrease: IconType;
export declare const CgFormatItalic: IconType;
export declare const CgFormatJustify: IconType;
export declare const CgFormatLeft: IconType;
export declare const CgFormatLineHeight: IconType;
export declare const CgFormatRight: IconType;
export declare const CgFormatSeparator: IconType;
export declare const CgFormatSlash: IconType;
export declare const CgFormatStrike: IconType;
export declare const CgFormatText: IconType;
export declare const CgFormatUnderline: IconType;
export declare const CgFormatUppercase: IconType;
export declare const CgFramer: IconType;
export declare const CgGames: IconType;
export declare const CgGenderFemale: IconType;
export declare const CgGenderMale: IconType;
export declare const CgGhostCharacter: IconType;
export declare const CgGhost: IconType;
export declare const CgGift: IconType;
export declare const CgGirl: IconType;
export declare const CgGitBranch: IconType;
export declare const CgGitCommit: IconType;
export declare const CgGitFork: IconType;
export declare const CgGitPull: IconType;
export declare const CgGitter: IconType;
export declare const CgGlassAlt: IconType;
export declare const CgGlass: IconType;
export declare const CgGlobeAlt: IconType;
export declare const CgGlobe: IconType;
export declare const CgGoogleTasks: IconType;
export declare const CgGoogle: IconType;
export declare const CgGym: IconType;
export declare const CgHashtag: IconType;
export declare const CgHeadset: IconType;
export declare const CgHeart: IconType;
export declare const CgHello: IconType;
export declare const CgHomeAlt: IconType;
export declare const CgHomeScreen: IconType;
export declare const CgHome: IconType;
export declare const CgIcecream: IconType;
export declare const CgIfDesign: IconType;
export declare const CgImage: IconType;
export declare const CgImport: IconType;
export declare const CgInbox: IconType;
export declare const CgIndieHackers: IconType;
export declare const CgInfinity: IconType;
export declare const CgInfo: IconType;
export declare const CgInpicture: IconType;
export declare const CgInsertAfterO: IconType;
export declare const CgInsertAfterR: IconType;
export declare const CgInsertAfter: IconType;
export declare const CgInsertBeforeO: IconType;
export declare const CgInsertBeforeR: IconType;
export declare const CgInsertBefore: IconType;
export declare const CgInsights: IconType;
export declare const CgInstagram: IconType;
export declare const CgInternal: IconType;
export declare const CgKey: IconType;
export declare const CgKeyboard: IconType;
export declare const CgKeyhole: IconType;
export declare const CgLaptop: IconType;
export declare const CgLastpass: IconType;
export declare const CgLayoutGridSmall: IconType;
export declare const CgLayoutGrid: IconType;
export declare const CgLayoutList: IconType;
export declare const CgLayoutPin: IconType;
export declare const CgLinear: IconType;
export declare const CgLink: IconType;
export declare const CgListTree: IconType;
export declare const CgList: IconType;
export declare const CgLivePhoto: IconType;
export declare const CgLoadbarAlt: IconType;
export declare const CgLoadbarDoc: IconType;
export declare const CgLoadbarSound: IconType;
export declare const CgLoadbar: IconType;
export declare const CgLockUnlock: IconType;
export declare const CgLock: IconType;
export declare const CgLogIn: IconType;
export declare const CgLogOff: IconType;
export declare const CgLogOut: IconType;
export declare const CgLoupe: IconType;
export declare const CgMagnet: IconType;
export declare const CgMailForward: IconType;
export declare const CgMailOpen: IconType;
export declare const CgMailReply: IconType;
export declare const CgMail: IconType;
export declare const CgMathDivide: IconType;
export declare const CgMathEqual: IconType;
export declare const CgMathMinus: IconType;
export declare const CgMathPercent: IconType;
export declare const CgMathPlus: IconType;
export declare const CgMaximizeAlt: IconType;
export declare const CgMaximize: IconType;
export declare const CgMaze: IconType;
export declare const CgMediaLive: IconType;
export declare const CgMediaPodcast: IconType;
export declare const CgMenuBoxed: IconType;
export declare const CgMenuCake: IconType;
export declare const CgMenuCheese: IconType;
export declare const CgMenuGridO: IconType;
export declare const CgMenuGridR: IconType;
export declare const CgMenuHotdog: IconType;
export declare const CgMenuLeftAlt: IconType;
export declare const CgMenuLeft: IconType;
export declare const CgMenuMotion: IconType;
export declare const CgMenuOreos: IconType;
export declare const CgMenuRightAlt: IconType;
export declare const CgMenuRight: IconType;
export declare const CgMenuRound: IconType;
export declare const CgMenu: IconType;
export declare const CgMergeHorizontal: IconType;
export declare const CgMergeVertical: IconType;
export declare const CgMic: IconType;
export declare const CgMicrobit: IconType;
export declare const CgMicrosoft: IconType;
export declare const CgMiniPlayer: IconType;
export declare const CgMinimizeAlt: IconType;
export declare const CgMinimize: IconType;
export declare const CgModem: IconType;
export declare const CgMonday: IconType;
export declare const CgMoon: IconType;
export declare const CgMoreAlt: IconType;
export declare const CgMoreO: IconType;
export declare const CgMoreR: IconType;
export declare const CgMoreVerticalAlt: IconType;
export declare const CgMoreVerticalO: IconType;
export declare const CgMoreVerticalR: IconType;
export declare const CgMoreVertical: IconType;
export declare const CgMore: IconType;
export declare const CgMouse: IconType;
export declare const CgMoveDown: IconType;
export declare const CgMoveLeft: IconType;
export declare const CgMoveRight: IconType;
export declare const CgMoveTask: IconType;
export declare const CgMoveUp: IconType;
export declare const CgMusicNote: IconType;
export declare const CgMusicSpeaker: IconType;
export declare const CgMusic: IconType;
export declare const CgNametag: IconType;
export declare const CgNotes: IconType;
export declare const CgNotifications: IconType;
export declare const CgNpm: IconType;
export declare const CgOculus: IconType;
export declare const CgOpenCollective: IconType;
export declare const CgOptions: IconType;
export declare const CgOrganisation: IconType;
export declare const CgOverflow: IconType;
export declare const CgPacman: IconType;
export declare const CgPassword: IconType;
export declare const CgPathBack: IconType;
export declare const CgPathCrop: IconType;
export declare const CgPathDivide: IconType;
export declare const CgPathExclude: IconType;
export declare const CgPathFront: IconType;
export declare const CgPathIntersect: IconType;
export declare const CgPathOutline: IconType;
export declare const CgPathTrim: IconType;
export declare const CgPathUnite: IconType;
export declare const CgPatreon: IconType;
export declare const CgPaypal: IconType;
export declare const CgPen: IconType;
export declare const CgPentagonBottomLeft: IconType;
export declare const CgPentagonBottomRight: IconType;
export declare const CgPentagonDown: IconType;
export declare const CgPentagonLeft: IconType;
export declare const CgPentagonRight: IconType;
export declare const CgPentagonTopLeft: IconType;
export declare const CgPentagonTopRight: IconType;
export declare const CgPentagonUp: IconType;
export declare const CgPerformance: IconType;
export declare const CgPexels: IconType;
export declare const CgPhone: IconType;
export declare const CgPhotoscan: IconType;
export declare const CgPiano: IconType;
export declare const CgPill: IconType;
export declare const CgPinAlt: IconType;
export declare const CgPinBottom: IconType;
export declare const CgPinTop: IconType;
export declare const CgPin: IconType;
export declare const CgPlayBackwards: IconType;
export declare const CgPlayButtonO: IconType;
export declare const CgPlayButtonR: IconType;
export declare const CgPlayButton: IconType;
export declare const CgPlayForwards: IconType;
export declare const CgPlayListAdd: IconType;
export declare const CgPlayListCheck: IconType;
export declare const CgPlayListRemove: IconType;
export declare const CgPlayListSearch: IconType;
export declare const CgPlayList: IconType;
export declare const CgPlayPauseO: IconType;
export declare const CgPlayPauseR: IconType;
export declare const CgPlayPause: IconType;
export declare const CgPlayStopO: IconType;
export declare const CgPlayStopR: IconType;
export declare const CgPlayStop: IconType;
export declare const CgPlayTrackNextO: IconType;
export declare const CgPlayTrackNextR: IconType;
export declare const CgPlayTrackNext: IconType;
export declare const CgPlayTrackPrevO: IconType;
export declare const CgPlayTrackPrevR: IconType;
export declare const CgPlayTrackPrev: IconType;
export declare const CgPlug: IconType;
export declare const CgPocket: IconType;
export declare const CgPokemon: IconType;
export declare const CgPolaroid: IconType;
export declare const CgPoll: IconType;
export declare const CgPresentation: IconType;
export declare const CgPrinter: IconType;
export declare const CgProductHunt: IconType;
export declare const CgProfile: IconType;
export declare const CgPullClear: IconType;
export declare const CgPushChevronDownO: IconType;
export declare const CgPushChevronDownR: IconType;
export declare const CgPushChevronDown: IconType;
export declare const CgPushChevronLeftO: IconType;
export declare const CgPushChevronLeftR: IconType;
export declare const CgPushChevronLeft: IconType;
export declare const CgPushChevronRightO: IconType;
export declare const CgPushChevronRightR: IconType;
export declare const CgPushChevronRight: IconType;
export declare const CgPushChevronUpO: IconType;
export declare const CgPushChevronUpR: IconType;
export declare const CgPushChevronUp: IconType;
export declare const CgPushDown: IconType;
export declare const CgPushLeft: IconType;
export declare const CgPushRight: IconType;
export declare const CgPushUp: IconType;
export declare const CgQr: IconType;
export declare const CgQuoteO: IconType;
export declare const CgQuote: IconType;
export declare const CgRadioCheck: IconType;
export declare const CgRadioChecked: IconType;
export declare const CgRatio: IconType;
export declare const CgRead: IconType;
export declare const CgReadme: IconType;
export declare const CgRecord: IconType;
export declare const CgRedo: IconType;
export declare const CgRemote: IconType;
export declare const CgRemoveR: IconType;
export declare const CgRemove: IconType;
export declare const CgRename: IconType;
export declare const CgReorder: IconType;
export declare const CgRepeat: IconType;
export declare const CgRing: IconType;
export declare const CgRowFirst: IconType;
export declare const CgRowLast: IconType;
export declare const CgRuler: IconType;
export declare const CgSandClock: IconType;
export declare const CgScan: IconType;
export declare const CgScreenMirror: IconType;
export declare const CgScreenShot: IconType;
export declare const CgScreenWide: IconType;
export declare const CgScreen: IconType;
export declare const CgScrollH: IconType;
export declare const CgScrollV: IconType;
export declare const CgSearchFound: IconType;
export declare const CgSearchLoading: IconType;
export declare const CgSearch: IconType;
export declare const CgSelectO: IconType;
export declare const CgSelectR: IconType;
export declare const CgSelect: IconType;
export declare const CgServer: IconType;
export declare const CgServerless: IconType;
export declare const CgShapeCircle: IconType;
export declare const CgShapeHalfCircle: IconType;
export declare const CgShapeHexagon: IconType;
export declare const CgShapeRhombus: IconType;
export declare const CgShapeSquare: IconType;
export declare const CgShapeTriangle: IconType;
export declare const CgShapeZigzag: IconType;
export declare const CgShare: IconType;
export declare const CgShield: IconType;
export declare const CgShoppingBag: IconType;
export declare const CgShoppingCart: IconType;
export declare const CgShortcut: IconType;
export declare const CgShutterstock: IconType;
export declare const CgSidebarOpen: IconType;
export declare const CgSidebarRight: IconType;
export declare const CgSidebar: IconType;
export declare const CgSignal: IconType;
export declare const CgSize: IconType;
export declare const CgSketch: IconType;
export declare const CgSlack: IconType;
export declare const CgSleep: IconType;
export declare const CgSmartHomeBoiler: IconType;
export declare const CgSmartHomeCooker: IconType;
export declare const CgSmartHomeHeat: IconType;
export declare const CgSmartHomeLight: IconType;
export declare const CgSmartHomeRefrigerator: IconType;
export declare const CgSmartHomeWashMachine: IconType;
export declare const CgSmartphoneChip: IconType;
export declare const CgSmartphoneRam: IconType;
export declare const CgSmartphoneShake: IconType;
export declare const CgSmartphone: IconType;
export declare const CgSmileMouthOpen: IconType;
export declare const CgSmileNeutral: IconType;
export declare const CgSmileNoMouth: IconType;
export declare const CgSmileNone: IconType;
export declare const CgSmileSad: IconType;
export declare const CgSmileUpside: IconType;
export declare const CgSmile: IconType;
export declare const CgSoftwareDownload: IconType;
export declare const CgSoftwareUpload: IconType;
export declare const CgSortAz: IconType;
export declare const CgSortZa: IconType;
export declare const CgSpaceBetweenV: IconType;
export declare const CgSpaceBetween: IconType;
export declare const CgSpectrum: IconType;
export declare const CgSpinnerAlt: IconType;
export declare const CgSpinnerTwoAlt: IconType;
export declare const CgSpinnerTwo: IconType;
export declare const CgSpinner: IconType;
export declare const CgSquare: IconType;
export declare const CgStack: IconType;
export declare const CgStark: IconType;
export declare const CgStopwatch: IconType;
export declare const CgStories: IconType;
export declare const CgStudio: IconType;
export declare const CgStyle: IconType;
export declare const CgSun: IconType;
export declare const CgSupport: IconType;
export declare const CgSwapVertical: IconType;
export declare const CgSwap: IconType;
export declare const CgSweden: IconType;
export declare const CgSwiss: IconType;
export declare const CgSync: IconType;
export declare const CgTab: IconType;
export declare const CgTag: IconType;
export declare const CgTally: IconType;
export declare const CgTapDouble: IconType;
export declare const CgTapSingle: IconType;
export declare const CgTemplate: IconType;
export declare const CgTennis: IconType;
export declare const CgTerminal: IconType;
export declare const CgTerrain: IconType;
export declare const CgThermometer: IconType;
export declare const CgThermostat: IconType;
export declare const CgTikcode: IconType;
export declare const CgTime: IconType;
export declare const CgTimelapse: IconType;
export declare const CgTimer: IconType;
export declare const CgToday: IconType;
export declare const CgToggleOff: IconType;
export declare const CgToggleOn: IconType;
export declare const CgToggleSquareOff: IconType;
export declare const CgToggleSquare: IconType;
export declare const CgToolbarBottom: IconType;
export declare const CgToolbarLeft: IconType;
export declare const CgToolbarRight: IconType;
export declare const CgToolbarTop: IconType;
export declare const CgToolbox: IconType;
export declare const CgTouchpad: IconType;
export declare const CgTrack: IconType;
export declare const CgTranscript: IconType;
export declare const CgTrashEmpty: IconType;
export declare const CgTrash: IconType;
export declare const CgTree: IconType;
export declare const CgTrees: IconType;
export declare const CgTrello: IconType;
export declare const CgTrendingDown: IconType;
export declare const CgTrending: IconType;
export declare const CgTrophy: IconType;
export declare const CgTv: IconType;
export declare const CgTwilio: IconType;
export declare const CgTwitter: IconType;
export declare const CgUiKit: IconType;
export declare const CgUmbrella: IconType;
export declare const CgUnavailable: IconType;
export declare const CgUnblock: IconType;
export declare const CgUndo: IconType;
export declare const CgUnfold: IconType;
export declare const CgUnsplash: IconType;
export declare const CgUsbC: IconType;
export declare const CgUsb: IconType;
export declare const CgUserAdd: IconType;
export declare const CgUserList: IconType;
export declare const CgUserRemove: IconType;
export declare const CgUser: IconType;
export declare const CgUserlane: IconType;
export declare const CgVercel: IconType;
export declare const CgViewCols: IconType;
export declare const CgViewComfortable: IconType;
export declare const CgViewDay: IconType;
export declare const CgViewGrid: IconType;
export declare const CgViewList: IconType;
export declare const CgViewMonth: IconType;
export declare const CgViewSplit: IconType;
export declare const CgVinyl: IconType;
export declare const CgVoicemailO: IconType;
export declare const CgVoicemailR: IconType;
export declare const CgVoicemail: IconType;
export declare const CgVolume: IconType;
export declare const CgWebcam: IconType;
export declare const CgWebsite: IconType;
export declare const CgWindows: IconType;
export declare const CgWorkAlt: IconType;
export declare const CgYinyang: IconType;
export declare const CgYoutube: IconType;
export declare const CgZoomIn: IconType;
export declare const CgZoomOut: IconType;
@@ -0,0 +1,19 @@
import _typeof from "./typeof.js";
function _regeneratorValues(e) {
if (null != e) {
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
r = 0;
if (t) return t.call(e);
if ("function" == typeof e.next) return e;
if (!isNaN(e.length)) return {
next: function next() {
return e && r >= e.length && (e = void 0), {
value: e && e[r++],
done: !e
};
}
};
}
throw new TypeError(_typeof(e) + " is not iterable");
}
export { _regeneratorValues as default };
@@ -0,0 +1 @@
{"name":"type-is","version":"1.6.18","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532101622,"integrity":"sha512-w4TzaBl8HrFCUlaDmO/dH6/kl7qYVTizlTKU1d1rg7dFsGSO3WBInWrj6hRgeq0+bg04y27UvlaEqq3kTDA9kA==","mode":420,"size":1133},"HISTORY.md":{"checkedAt":1794532101622,"integrity":"sha512-GIUU4i26tvVftlJmUT9zb5GIVtNNwvb8I//qV6g979zyYUDROCr3ChdZ5zgtWH03Z0DF0A/X5wgSRikMrw6Ayw==","mode":420,"size":5447},"index.js":{"checkedAt":1794532101622,"integrity":"sha512-61bs1IoiiTPtW/AFV5H+4je9o8YJzfhN8CHWjvWSJAGxihxckJmwo6FQkb62HFg3qahHNVJxz8rvTNzgDyvkdA==","mode":420,"size":5562},"LICENSE":{"checkedAt":1794532088693,"integrity":"sha512-68E3wBwT2p2Q/UEXKbEMsV5rfqPzGmud0j0Kdprv5hy+pzaMNmmLDVYuhdygjryqWZlvllMpWhx5JSy6PaPTrQ==","mode":420,"size":1172},"README.md":{"checkedAt":1794532101622,"integrity":"sha512-cepc6nPF5UGJC7Ma5akKiMoZp1ZbCilXr6D4dd+1lvm3Re4dMQ0hSc7d67cAjvhEX/a3G04+BFb/i3saWa+XSg==","mode":420,"size":5183}}}
@@ -0,0 +1,201 @@
declare type voidCallback = () => void;
declare type stringCallback = (arg0: string) => void;
declare type objectCallback<T> = (arg0: T) => void;
declare type booleanCallback = (arg0: boolean) => void;
declare interface JsonT {
/**
* loads JSON from file sync.
* @param {string} path path to load from.
* @param {boolean} hasComments file to load has comments in json.
* @return {T}
*/
loadS: <T = any>(path: string, hasComments?: boolean) => T;
/**
* saves JSON data to file sync.
* @param {string} path path to save to.
* @param {T} data data to save.
* @return {void}
*/
saveS: <T = any>(path: string, data: T) => void;
/**
* loads JSON from file.
* @param {string} path path to load from.
* @param {objectCallback<T>} callback callback to call.
* @param {boolean} hasComments file to load has comments in json.
* @return {Promise<T>}
*/
load: <T = any>(path: string, callback?: objectCallback<T> | undefined, hasComments?: boolean) => Promise<T>;
/**
* saves JSON data to file.
* @param {string} path path to save to.
* @param {T} data data to save.
* @param {voidCallback} callback callback to call.
* @return {Promise<void>}
*/
save: <T = any>(path: string, data: T, callback?: voidCallback | undefined) => Promise<void>;
/**
* loads JSON from file.
* @param {string} path path to load from.
* @param {objectCallback<T>} callback callback to call.
* @param {boolean} hasComments file to load has comments in json.
*/
loadW: <T = any>(path: string, callback?: objectCallback<T> | undefined, hasComments?: boolean) => Promise<T>;
/**
* saves JSON data to file.
* @param {string} path path to save to.
* @param {T} data data to save.
* @param {voidCallback} callback callback to call.
*/
saveW: <T = any>(path: string, data: T, callback?: voidCallback | undefined) => Promise<void>;
}
declare interface StringSave {
/**
* saves string to file sync.
* @param {string} path path to save to.
* @return {void}
*/
saveS: (path: string) => void;
/**
* saves string to file async.
* @param {string} path path to save to.
* @param {voidCallback} callback callback to call.
* @return {Promise<void>}
*/
save: (path: string, callback?: voidCallback | undefined) => Promise<void>;
/**
* saves string to file with worker.
* @param {string} path path to save to.
* @param {voidCallback} callback callback to call.
*/
saveW: (path: string, callback?: voidCallback | undefined) => Promise<void>;
}
declare interface FileT {
/**
* loads string data from file sync.
* @param {string} path path to load from.
* @return {string}
*/
loadS: (path: string) => string;
/**
* loads string data from file async.
* @param {string} path path to load from.
* @param {stringCallback} callback callback to call.
* @return {Promise<string>}
*/
load: (path: string, callback?: stringCallback | undefined) => Promise<string>;
/**
* loads string data from file with worker.
* @param {string} path path to load from.
* @param {stringCallback} callback callback to call.
*/
loadW: (path: string, callback?: stringCallback | undefined) => Promise<string>;
/**
* saves string to file sync.
* @param {string} path path to save to.
* @param {string} data data to save.
* @return {void}
*/
saveS: (path: string, data: string) => void;
/**
* saves string to file async.
* @param {string} path path to save to.
* @param {string} data data to save.
* @param {voidCallback} callback callback to call.
* @return {Promise<void>}
*/
save: (path: string, data: string, callback?: voidCallback | undefined) => Promise<void>;
/**
* saves string to file with worker.
* @param {string} path path to save to.
* @param {string} data data to save.
* @param {voidCallback} callback callback to call.
*/
saveW: (path: string, data: string, callback?: voidCallback | undefined) => Promise<void>;
}
declare interface DirT {
/**
* Creates directory on filesystem synchronous.
* @param {string} path path to dir
* @return {void}
*/
mkS: (path: string) => void;
/**
* Removes directory on filesystem synchronous.
* @param {string} path path to dir
* @return {void}
*/
rmS: (path: string) => void;
/**
* Checks if directory exists on filesystem synchronous.
* @param {string} path path to dir.
* @return {boolean}
*/
checkS: (path: string) => boolean;
/**
* Creates directory on filesystem asynchronous.
* @param {string} path path to dir
* @param {voidCallback} callback callback to call.
* @return {Promise<void>}
*/
mk: (path: string, callback?: voidCallback | undefined) => Promise<void>;
/**
* Removes directory on filesystem asynchronous.
* @param {string} path path to dir
* @param {voidCallback} callback callback to call.
* @return {Promise<void>}
*/
rm: (path: string, callback?: voidCallback | undefined) => Promise<void>;
/**
* Checks if directory exists on filesystem asynchronous.
* @param {string} path path to dir.
* @param {booleanCallback} callback callback to call.
* @return {Promise<boolean>}
*/
check: (path: string, callback?: booleanCallback | undefined) => Promise<boolean>;
/**
* NodeModules finds where the node_modules directories are.
* @param {{ cwd?: string; relative?: boolean; } | string} input optional cwd input.
* @returns an array of locations where node_modules is found.
*/
nodeModules: (input?: { cwd?: string; relative?: boolean; } | string) => string[];
}
declare interface BufT {
/**
* loads buffer data from file.
* @param {string} path path to load from.
* @param {objectCallback<Buffer>} callback callback to call.
* @return {Promise<Buffer>}
*/
load: (path: string, callback?: objectCallback<Buffer> | undefined) => Promise<Buffer>;
/**
* saves buffer to file.
* @param {string} path path to save to.
* @param {Buffer} data data to save.
* @param {voidCallback} callback callback to call.
* @return {Promise<void>}
*/
save: (path: string, data: Buffer, callback?: voidCallback | undefined) => Promise<void>;
/**
* loads buffer data from file.
* @param {string} path path to load from.
* @param {objectCallback<Buffer>} callback callback to call.
*/
loadW: (path: string, callback?: objectCallback<Buffer> | undefined) => Promise<Buffer>;
/**
* saves buffer to file.
* @param {string} path path to save to.
* @param {Buffer} data data to save.
* @param {voidCallback} callback callback to call.
*/
saveW: (path: string, data: Buffer, callback?: voidCallback | undefined) => Promise<void>;
}
export {
FileT,
JsonT,
StringSave,
BufT,
DirT,
};
@@ -0,0 +1,52 @@
{
"name": "p-limit",
"version": "3.1.0",
"description": "Run multiple promise-returning & async functions with limited concurrency",
"license": "MIT",
"repository": "sindresorhus/p-limit",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=10"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"promise",
"limit",
"limited",
"concurrency",
"throttle",
"throat",
"rate",
"batch",
"ratelimit",
"task",
"queue",
"async",
"await",
"promises",
"bluebird"
],
"dependencies": {
"yocto-queue": "^0.1.0"
},
"devDependencies": {
"ava": "^2.4.0",
"delay": "^4.4.0",
"in-range": "^2.0.0",
"random-int": "^2.0.1",
"time-span": "^4.0.0",
"tsd": "^0.13.1",
"xo": "^0.35.0"
}
}
@@ -0,0 +1,4 @@
'use strict';
// TODO, semver-major: delete
module.exports = require('math-intrinsics/isInteger');
@@ -0,0 +1,119 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const node_path_1 = require("node:path");
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-unnecessary-type-constraint',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow unnecessary constraints on generic types',
recommended: 'recommended',
},
hasSuggestions: true,
messages: {
removeUnnecessaryConstraint: 'Remove the unnecessary `{{constraint}}` constraint.',
unnecessaryConstraint: 'Constraining the generic type `{{name}}` to `{{constraint}}` does nothing and is unnecessary.',
},
schema: [],
},
defaultOptions: [],
create(context) {
// In theory, we could use the type checker for more advanced constraint types...
// ...but in practice, these types are rare, and likely not worth requiring type info.
// https://github.com/typescript-eslint/typescript-eslint/pull/2516#discussion_r495731858
const unnecessaryConstraints = new Map([
[utils_1.AST_NODE_TYPES.TSAnyKeyword, 'any'],
[utils_1.AST_NODE_TYPES.TSUnknownKeyword, 'unknown'],
]);
function checkRequiresGenericDeclarationDisambiguation(filename) {
const pathExt = (0, node_path_1.extname)(filename).toLocaleLowerCase();
switch (pathExt) {
case ts.Extension.Cts:
case ts.Extension.Mts:
case ts.Extension.Tsx:
return true;
default:
return false;
}
}
const requiresGenericDeclarationDisambiguation = checkRequiresGenericDeclarationDisambiguation(context.filename);
const checkNode = (node, inArrowFunction) => {
const constraint = unnecessaryConstraints.get(node.constraint.type);
function shouldAddTrailingComma() {
if (!inArrowFunction || !requiresGenericDeclarationDisambiguation) {
return false;
}
// Only <T>() => {} would need trailing comma
return (node.parent.params.length ===
1 &&
context.sourceCode.getTokensAfter(node)[0].value !== ',' &&
!node.default);
}
if (constraint) {
context.report({
node,
messageId: 'unnecessaryConstraint',
data: {
name: node.name.name,
constraint,
},
suggest: [
{
messageId: 'removeUnnecessaryConstraint',
data: {
constraint,
},
fix(fixer) {
return fixer.replaceTextRange([node.name.range[1], node.constraint.range[1]], shouldAddTrailingComma() ? ',' : '');
},
},
],
});
}
};
return {
':not(ArrowFunctionExpression) > TSTypeParameterDeclaration > TSTypeParameter[constraint]'(node) {
checkNode(node, false);
},
'ArrowFunctionExpression > TSTypeParameterDeclaration > TSTypeParameter[constraint]'(node) {
checkNode(node, true);
},
};
},
});
@@ -0,0 +1,327 @@
/*!
* proxy-addr
* Copyright(c) 2014-2016 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module exports.
* @public
*/
module.exports = proxyaddr
module.exports.all = alladdrs
module.exports.compile = compile
/**
* Module dependencies.
* @private
*/
var forwarded = require('forwarded')
var ipaddr = require('ipaddr.js')
/**
* Variables.
* @private
*/
var DIGIT_REGEXP = /^[0-9]+$/
var isip = ipaddr.isValid
var parseip = ipaddr.parse
/**
* Pre-defined IP ranges.
* @private
*/
var IP_RANGES = {
linklocal: ['169.254.0.0/16', 'fe80::/10'],
loopback: ['127.0.0.1/8', '::1/128'],
uniquelocal: ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', 'fc00::/7']
}
/**
* Get all addresses in the request, optionally stopping
* at the first untrusted.
*
* @param {Object} request
* @param {Function|Array|String} [trust]
* @public
*/
function alladdrs (req, trust) {
// get addresses
var addrs = forwarded(req)
if (!trust) {
// Return all addresses
return addrs
}
if (typeof trust !== 'function') {
trust = compile(trust)
}
for (var i = 0; i < addrs.length - 1; i++) {
if (trust(addrs[i], i)) continue
addrs.length = i + 1
}
return addrs
}
/**
* Compile argument into trust function.
*
* @param {Array|String} val
* @private
*/
function compile (val) {
if (!val) {
throw new TypeError('argument is required')
}
var trust
if (typeof val === 'string') {
trust = [val]
} else if (Array.isArray(val)) {
trust = val.slice()
} else {
throw new TypeError('unsupported trust argument')
}
for (var i = 0; i < trust.length; i++) {
val = trust[i]
if (!Object.prototype.hasOwnProperty.call(IP_RANGES, val)) {
continue
}
// Splice in pre-defined range
val = IP_RANGES[val]
trust.splice.apply(trust, [i, 1].concat(val))
i += val.length - 1
}
return compileTrust(compileRangeSubnets(trust))
}
/**
* Compile `arr` elements into range subnets.
*
* @param {Array} arr
* @private
*/
function compileRangeSubnets (arr) {
var rangeSubnets = new Array(arr.length)
for (var i = 0; i < arr.length; i++) {
rangeSubnets[i] = parseipNotation(arr[i])
}
return rangeSubnets
}
/**
* Compile range subnet array into trust function.
*
* @param {Array} rangeSubnets
* @private
*/
function compileTrust (rangeSubnets) {
// Return optimized function based on length
var len = rangeSubnets.length
return len === 0
? trustNone
: len === 1
? trustSingle(rangeSubnets[0])
: trustMulti(rangeSubnets)
}
/**
* Parse IP notation string into range subnet.
*
* @param {String} note
* @private
*/
function parseipNotation (note) {
var pos = note.lastIndexOf('/')
var str = pos !== -1
? note.substring(0, pos)
: note
if (!isip(str)) {
throw new TypeError('invalid IP address: ' + str)
}
var ip = parseip(str)
if (pos === -1 && ip.kind() === 'ipv6' && ip.isIPv4MappedAddress()) {
// Store as IPv4
ip = ip.toIPv4Address()
}
var max = ip.kind() === 'ipv6'
? 128
: 32
var range = pos !== -1
? note.substring(pos + 1, note.length)
: null
if (range === null) {
range = max
} else if (DIGIT_REGEXP.test(range)) {
range = parseInt(range, 10)
} else if (ip.kind() === 'ipv4' && isip(range)) {
range = parseNetmask(range)
} else {
range = null
}
if (range <= 0 || range > max) {
throw new TypeError('invalid range on address: ' + note)
}
return [ip, range]
}
/**
* Parse netmask string into CIDR range.
*
* @param {String} netmask
* @private
*/
function parseNetmask (netmask) {
var ip = parseip(netmask)
var kind = ip.kind()
return kind === 'ipv4'
? ip.prefixLengthFromSubnetMask()
: null
}
/**
* Determine address of proxied request.
*
* @param {Object} request
* @param {Function|Array|String} trust
* @public
*/
function proxyaddr (req, trust) {
if (!req) {
throw new TypeError('req argument is required')
}
if (!trust) {
throw new TypeError('trust argument is required')
}
var addrs = alladdrs(req, trust)
var addr = addrs[addrs.length - 1]
return addr
}
/**
* Static trust function to trust nothing.
*
* @private
*/
function trustNone () {
return false
}
/**
* Compile trust function for multiple subnets.
*
* @param {Array} subnets
* @private
*/
function trustMulti (subnets) {
return function trust (addr) {
if (!isip(addr)) return false
var ip = parseip(addr)
var ipconv
var kind = ip.kind()
for (var i = 0; i < subnets.length; i++) {
var subnet = subnets[i]
var subnetip = subnet[0]
var subnetkind = subnetip.kind()
var subnetrange = subnet[1]
var trusted = ip
if (kind !== subnetkind) {
if (subnetkind === 'ipv4' && !ip.isIPv4MappedAddress()) {
// Incompatible IP addresses
continue
}
if (!ipconv) {
// Convert IP to match subnet IP kind
ipconv = subnetkind === 'ipv4'
? ip.toIPv4Address()
: ip.toIPv4MappedAddress()
}
trusted = ipconv
}
if (trusted.match(subnetip, subnetrange)) {
return true
}
}
return false
}
}
/**
* Compile trust function for single subnet.
*
* @param {Object} subnet
* @private
*/
function trustSingle (subnet) {
var subnetip = subnet[0]
var subnetkind = subnetip.kind()
var subnetisipv4 = subnetkind === 'ipv4'
var subnetrange = subnet[1]
return function trust (addr) {
if (!isip(addr)) return false
var ip = parseip(addr)
var kind = ip.kind()
if (kind !== subnetkind) {
if (subnetisipv4 && !ip.isIPv4MappedAddress()) {
// Incompatible IP addresses
return false
}
// Convert IP to match subnet IP kind
ip = subnetisipv4
? ip.toIPv4Address()
: ip.toIPv4MappedAddress()
}
return ip.match(subnetip, subnetrange)
}
}
@@ -0,0 +1,11 @@
import { pxValues } from '../../waapi/utils/px-values.mjs';
function applyPxDefaults(keyframes, name) {
for (let i = 0; i < keyframes.length; i++) {
if (typeof keyframes[i] === "number" && pxValues.has(name)) {
keyframes[i] = keyframes[i] + "px";
}
}
}
export { applyPxDefaults };
@@ -0,0 +1,130 @@
/**
* @file util
* @author junmer
*/
/* eslint-env node */
var fs = require('fs');
var path = require('path');
var _ = require('lodash');
var codePoints = require('code-points');
/**
* getFontFolder
*
* @return {string} fontFolder
*/
function getFontFolder() {
return path.resolve({
win32: '/Windows/fonts',
darwin: '/Library/Fonts',
linux: '/usr/share/fonts/truetype'
}[process.platform]);
}
/**
* getFonts
*
* @param {string} path path
* @return {Array} fonts
*/
function getFonts() {
return fs.readdirSync(getFontFolder());
}
/**
* getPureText
*
* @see https://msdn.microsoft.com/zh-cn/library/ie/2yfce773
* @see http://www.unicode.org/charts/
*
* @param {string} str target text
* @return {string} pure text
*/
function getPureText(str) {
// fix space
var emptyTextMap = {};
function replaceEmpty (word) {
emptyTextMap[word] = 1;
return '';
}
var pureText = String(str)
.trim()
.replace(/[\s]/g, replaceEmpty)
// .replace(/[\f]/g, '')
// .replace(/[\b]/g, '')
// .replace(/[\n]/g, '')
// .replace(/[\t]/g, '')
// .replace(/[\r]/g, '')
.replace(/[\u2028]/g, '')
.replace(/[\u2029]/g, '');
var emptyText = Object.keys(emptyTextMap).join('');
return pureText + emptyText;
}
/**
* getUniqText
*
* @deprecated since version 0.9.9
*
* @param {string} str target text
* @return {string} uniq text
*/
function getUniqText(str) {
return _.uniq(
str.split('')
).join('');
}
/**
* basic chars
*
* "!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}"
*
* @type {string}
*/
var basicText = String.fromCharCode.apply(this, _.range(33, 126));
/**
* get subset text
*
* @param {Object} opts opts
* @return {string} subset text
*/
function getSubsetText(opts) {
var text = opts.text || '';
// trim
text && opts.trim && (text = getPureText(text));
// basicText
opts.basicText && (text += basicText);
return text;
}
/**
* string to unicodes
*
* @param {string} str string
* @return {Array} unicodes
*/
function string2unicodes(str) {
return _.uniq(codePoints(str));
}
exports.getFontFolder = getFontFolder;
exports.getFonts = getFonts;
exports.getPureText = getPureText;
exports.getUniqText = getUniqText;
exports.getSubsetText = getSubsetText;
exports.string2unicodes = string2unicodes;
@@ -0,0 +1,15 @@
# Installation
> `npm install --save @types/react-window`
# Summary
This package contains type definitions for react-window (https://github.com/bvaughn/react-window/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-window.
### Additional Details
* Last updated: Tue, 07 Nov 2023 09:09:39 GMT
* Dependencies: [@types/react](https://npmjs.com/package/@types/react)
# Credits
These definitions were written by [Martynas Kadiša](https://github.com/martynaskadisa), [Alex Guerra](https://github.com/heyimalex), and [John Gozde](https://github.com/jgoz).
@@ -0,0 +1,118 @@
# import/group-exports
<!-- end auto-generated rule header -->
Reports when named exports are not grouped together in a single `export` declaration or when multiple assignments to CommonJS `module.exports` or `exports` object are present in a single file.
**Rationale:** An `export` declaration or `module.exports` assignment can appear anywhere in the code. By requiring a single export declaration all your exports will remain at one place, making it easier to see what exports a module provides.
## Rule Details
This rule warns whenever a single file contains multiple named export declarations or multiple assignments to `module.exports` (or `exports`).
### Valid
```js
// A single named export declaration -> ok
export const valid = true
```
```js
const first = true
const second = true
// A single named export declaration -> ok
export {
first,
second,
}
```
```js
// Aggregating exports -> ok
export { default as module1 } from 'module-1'
export { default as module2 } from 'module-2'
```
```js
// A single exports assignment -> ok
module.exports = {
first: true,
second: true
}
```
```js
const first = true
const second = true
// A single exports assignment -> ok
module.exports = {
first,
second,
}
```
```js
function test() {}
test.property = true
test.another = true
// A single exports assignment -> ok
module.exports = test
```
```ts
const first = true;
type firstType = boolean
// A single named export declaration (type exports handled separately) -> ok
export {first}
export type {firstType}
```
### Invalid
```js
// Multiple named export statements -> not ok!
export const first = true
export const second = true
```
```js
// Aggregating exports from the same module -> not ok!
export { module1 } from 'module-1'
export { module2 } from 'module-1'
```
```js
// Multiple exports assignments -> not ok!
exports.first = true
exports.second = true
```
```js
// Multiple exports assignments -> not ok!
module.exports = {}
module.exports.first = true
```
```js
// Multiple exports assignments -> not ok!
module.exports = () => {}
module.exports.first = true
module.exports.second = true
```
```ts
type firstType = boolean
type secondType = any
// Multiple named type export statements -> not ok!
export type {firstType}
export type {secondType}
```
## When Not To Use It
If you do not mind having your exports spread across the file, you can safely turn this rule off.
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Discard = Discard;
function DiscardKey(value, key) {
const { [key]: _, ...rest } = value;
return rest;
}
/** Discards property keys from the given value. This function returns a shallow Clone. */
function Discard(value, keys) {
return keys.reduce((acc, key) => DiscardKey(acc, key), value);
}
@@ -0,0 +1,17 @@
import type { BasicTarget } from '../utils/domTarget';
export interface CursorState {
screenX: number;
screenY: number;
clientX: number;
clientY: number;
pageX: number;
pageY: number;
elementX: number;
elementY: number;
elementH: number;
elementW: number;
elementPosX: number;
elementPosY: number;
}
declare const _default: (target?: BasicTarget) => CursorState;
export default _default;
@@ -0,0 +1,23 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { UseMenuItemProps } from './use-menu-item.js';
import './base/menu-item-base.js';
import '@heroui/theme';
import '@react-aria/menu';
import '@react-types/shared';
import '@heroui/aria-utils';
import 'react';
import 'tailwind-variants';
import '@heroui/system';
import '@react-stately/tree';
interface MenuItemProps<T extends object = object> extends Omit<UseMenuItemProps<T>, "hasDescriptionTextChild" | "hasTitleTextChild"> {
}
/**
* @internal
*/
declare const MenuItem: {
(props: MenuItemProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
export { MenuItemProps, MenuItem as default };
@@ -0,0 +1 @@
{"version":3,"file":"convertCertBufferToPEM.d.ts","sourceRoot":"","sources":["../../src/helpers/convertCertBufferToPEM.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGtE;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,WAAW,GAAG,eAAe,GACxC,MAAM,CA4BR"}
@@ -0,0 +1,30 @@
var OtherPrimeInfos_1;
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, AsnIntegerArrayBufferConverter, AsnArray, AsnType, AsnTypeTypes, } from "@peculiar/asn1-schema";
export class OtherPrimeInfo {
constructor(params = {}) {
this.prime = new ArrayBuffer(0);
this.exponent = new ArrayBuffer(0);
this.coefficient = new ArrayBuffer(0);
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
], OtherPrimeInfo.prototype, "prime", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
], OtherPrimeInfo.prototype, "exponent", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
], OtherPrimeInfo.prototype, "coefficient", void 0);
let OtherPrimeInfos = OtherPrimeInfos_1 = class OtherPrimeInfos extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, OtherPrimeInfos_1.prototype);
}
};
OtherPrimeInfos = OtherPrimeInfos_1 = __decorate([
AsnType({ type: AsnTypeTypes.Sequence, itemType: OtherPrimeInfo })
], OtherPrimeInfos);
export { OtherPrimeInfos };
@@ -0,0 +1,24 @@
'use strict';
var os = require('os');
// adapted from https://github.com/sindresorhus/os-homedir/blob/11e089f4754db38bb535e5a8416320c4446e8cfd/index.js
module.exports = os.homedir || function homedir() {
var home = process.env.HOME;
var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
if (process.platform === 'win32') {
return process.env.USERPROFILE || process.env.HOMEDRIVE + process.env.HOMEPATH || home || null;
}
if (process.platform === 'darwin') {
return home || (user ? '/Users/' + user : null);
}
if (process.platform === 'linux') {
return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null)); // eslint-disable-line no-extra-parens
}
return home || null;
};
@@ -0,0 +1,819 @@
flf2a$ 8 6 20 15 2
bigchf.flf 10/94 pk6811s@acad.drake.edu, update 1/95 syb3@ABER.AC.UK
Mrs. Penderson is SO proud of me!
____@
@
$$$$@
----@
$$$$@
____@
@
@@
_______@
/ @
/ @
---/---@
/ @
_o_____@
@
@@
____@
@
// @
----@
@
____@
@
@@
_________@
-/--/- @
-/--/- @
---------@
@
_________@
@
@@
___________@
__/_ @
( / ) @
-----\-----@
(__/_) @
___/_______@
@
@@
_____@
@
()/ @
--/--@
/() @
_____@
@
@@
________@
__ @
( ) @
---\/---@
/ \ @
_(__ \__@
) @
@@
___@
@
/ @
---@
@
___@
@
@@
_________@
.- @
/ @
----/----@
/ @
__/______@
/ @
- @@
________@
-. @
/ @
-----/--@
/ @
___/____@
/ @
- @@
______@
@
@
-_\/_-@
/\ @
______@
@
@@
_____@
@
@
-_|_-@
| @
_____@
@
@@
____@
@
@
----@
@
__/_@
/ @
@@
_____@
@
@
-----@
$=== @
_____@
@
@@
___@
$ @
$ @
---@
$$ @
_o_@
$ @
$ @@
_______$@
$@
/ @
---/----@
/ @
_/______@
@
@@
__________@
__ @
/ )@
---/----/-@
/ / @
_(____/___@
@
@@
__________@
_ @
// @
-----/----@
/ @
___/______@
@
@@
__________@
__ @
/ ) @
----___/--@
/ @
_/____/___@
@
@@
__________@
__ @
/ ) @
---- _ /--@
) @
_(____/___@
@
@@
__________@
@
/ / @
--/____/--@
/ @
_____/____@
@
@@
__________@
____ @
/ @
---/___---@
) @
_(____/___@
@
@@
__________@
___ @
/ @
---/___---@
/ ) @
_(____/___@
@
@@
__________@
____ @
/ / @
-------/--@
/ @
_____/____@
@
@@
__________@
__ @
/ )@
----___ --@
/ / @
_(____/___@
@
@@
__________@
__ @
/ )@
---(___ /-@
/ @
_(____/___@
@
@@
___@
@
@
---@
$o$@
_o_@
@
@@
___@
@
@
---@
@
___@
/ @
@@
____@
@
/ @
-<--@
\ @
____@
@
@@
____@
@
__ @
-__-@
@
____@
@
@@
____@
@
\ @
-->-@
/ @
____@
@
@@
________@
___ @
( ) @
----/---@
/ @
__o_____@
@
@@
________@
_ @
/ ) @
-/--O---@
\__ / @
________@
@
@@
________@
__ @
/ | @
---/__|-@
/ | @
_/____|_@
@
@@
__________@
____ @
/ ) @
---/__ /--@
/ ) @
_/____/___@
@
@@
__________@
__ @
/ )@
---/------@
/ @
_(____/___@
@
@@
__________@
_____ @
/ )@
---/----/-@
/ / @
_/____/___@
@
@@
__________@
_____ @
/ '@
---/__----@
/ @
_/____$___@
@
@@
__________@
_____ @
/ '@
---/__----@
/ @
_/________@
@
@@
__________@
__ @
/ )@
---/------@
/ --, @
_(____/___@
@
@@
___________@
_ _@
/ / @
---/___ /--@
/ / @
_/____/____@
@
@@
_______@
__@
/ @
----/--@
/ @
$_/_$__@
@
@@
__________@
__@
/ @
-------/--@
/ @
_(___/____@
@
@@
__________@
_ _@
/ ,' @
---/_.'---@
/ \ @
_/____\___@
@
@@
________@
_ @
/ @
---/----@
/ @
_/____/_@
@
@@
__________@
_ _ @
/ /| @
---/| /-|-@
/ |/ | @
_/__/___|_@
@
@@
___________@
_ _@
/| / @
---/-| -/--@
/ | / @
_/___|/____@
@
@@
__________@
__ @
/ )@
---/----/-@
/ / @
_(____/___@
@
@@
__________@
____ @
/ )@
---/____/-@
/ @
_/________@
@
@@
__________@
__ @
/ )@
---/----/-@
/ \ / @
_(____X___@
\ @
@@
__________@
____ @
/ )@
---/___ /-@
/ | @
_/_____|__@
@
@@
__________@
__ @
/ )@
----\-----@
\ @
_(____/___@
@
@@
________@
______@
/ @
---/----@
/ @
_/______@
@
@@
___________@
_ _@
/ / @
---/----/--@
/ / @
_(____/____@
@
@@
________@
_ _@
| / @
--|--/--@
| / @
__|/____@
@
@@
__________@
_ _@
| | / @
--|-/|-/--@
|/ |/ @
__/__|____@
@
@@
_______@
_ _@
| / @
---|---@
/| @
_/_|___@
@
@@
___________@
_ _@
| / @
----|---/--@
| / @
____|_/____@
/ @
(_ / @@
__________@
___ @
/ @
-------/--@
/ @
____(_____@
/ @
(_ / @@
________@
__@
/ @
----/---@
/ @
__/_____@
/__ @
@@
______@
@
\ @
--\---@
\ @
____\_@
@
@@
________@
__@
/@
------/-@
/ @
____/___@
__/ @
@@
____@
@
| @
-/|-@
@
____@
@
@@
______@
@
@
------@
@
______@
------@
@@
___@
@
\ @
---@
@
___@
@
@@
_______@
@
@
----__-@
/ )@
_(___(_@
@
@@
_______@
@
/ @
---/__-@
/ )@
_(___/_@
@
@@
_______@
@
@
----__-@
/ '@
_(___$_@
@
@@
_________@
@
/@
----__-/-@
/ / @
_(___/___@
@
@@
_______@
@
@
----__-@
/___)@
_(___$_@
@
@@
________@
_ @
/ `@
--_/__--@
/ @
_/______@
@
@@
_______@
@
@
----__-@
/ )@
_(___/_@
/ @
(_ / @@
_______@
@
/ @
---/__-@
/ )@
_/___/_@
@
@@
_____@
@
,@
-----@
/ @
_/___@
@
@@
_________@
@
,@
---------@
/ @
_____/___@
/ @
(_ / @@
________@
@
/ @
---/-__-@
/( @
_/___\__@
@
@@
_____@
@
/@
---/-@
/ @
_/___@
@
@@
________@
@
@
---_--_-@
/ / )@
_/_/__/_@
@
@@
_______@
@
@
----__-@
/ )@
_/___/_@
@
@@
_______@
@
@
----__-@
/ )@
_(___/_@
@
@@
_________@
@
@
------__-@
/ )@
___/___/_@
/ @
/ @@
_______@
@
@
----__-@
/ )@
_(___/_@
/ @
(_ @@
_______@
@
@
---)__-@
/ )@
_/_____@
@
@@
______@
@
@
---__-@
(_ `@
_(__)_@
@
@@
______@
@
@
--_/_-@
/ @
_(_$__@
@
@@
________@
@
@
--------@
/ / @
_(___(__@
@
@@
______@
@
@
------@
| / @
__|/__@
@
@@
________@
@
@
--------@
| /| / @
_|/_|/__@
@
@@
_____@
@
@
---|/@
| @
__/|_@
/ @
@@
_______@
@
@
-------@
/ /@
_(___/_@
/ @
(_ / @@
_______@
@
@
----__-@
/@
____(__@
/ @
(_ / @@
________@
_@
/ @
----/---@
< @
__/_____@
(__ @
@@
_@
|@
|@
|@
|@
|@
$@
$@@
________@
_ @
)@
------/-@
> @
____/___@
_ / @
@@
_______@
_ _@
/ \_/ @
-------@
@
_______@
@
@@
________@
, , @
__ @
---/__|-@
/ | @
_/____|_@
@
@@
_________@
, ,@
__ @
---/----)@
/ / @
_(____/__@
@
@@
________@
, ,@
@
---/---/@
/ / @
_(___(__@
@
@@
_______@
@
, ,@
----_--@
/ )@
_(___(_@
@
@@
_______@
@
, ,@
----_--@
/ )@
_(___/_@
@
@@
_______@
@
, ,@
-------@
/ /@
_(___(_@
@
@@
___________@
_____ @
// )@
---//__ ,/-@
// ) @
_//____/___@
/ @
@@
@@ -0,0 +1 @@
{"version":3,"file":"GetPlanOptionsTagConstraint.js","sourceRoot":"","sources":["../../../../src/planning/models/GetPlanOptionsTagConstraint.ts"],"names":[],"mappings":""}
@@ -0,0 +1,50 @@
# Empty String
""
==>
JsonText(String)
# Non-empty String
"This is a boring old string"
==>
JsonText(String)
# All The Valid One-Character Escapes
"\"\\\/\b\f\n\rt\t"
==>
JsonText(String)
# Unicode Escape
"\u005C"
==>
JsonText(String)
# XXX
{
"description": "Some description",
"keywords": [],
"author": "",
"license": "ISC",
"scripts": {
"test": "echo \"no test specified\" && exit 1"
},
"dependencies": {
"@lezer/common": "^1.2.1"
}
}
==>
JsonText
@@ -0,0 +1 @@
{"version":3,"names":["_semver","require","_pretty","_utils","getInclusionReasons","item","targetVersions","list","minVersions","Object","keys","reduce","result","env","minVersion","getLowestImplementedVersion","targetVersion","prettifyVersion","minIsUnreleased","isUnreleasedVersion","targetIsUnreleased","semver","lt","toString","semverify"],"sources":["../src/debug.ts"],"sourcesContent":["import semver from \"semver\";\nimport { prettifyVersion } from \"./pretty.ts\";\nimport {\n semverify,\n isUnreleasedVersion,\n getLowestImplementedVersion,\n} from \"./utils.ts\";\nimport type { Target, Targets } from \"./types.ts\";\n\nexport function getInclusionReasons(\n item: string,\n targetVersions: Targets,\n list: { [key: string]: Targets },\n) {\n const minVersions = list[item] || {};\n\n return (Object.keys(targetVersions) as Target[]).reduce(\n (result, env) => {\n const minVersion = getLowestImplementedVersion(minVersions, env);\n const targetVersion = targetVersions[env];\n\n if (!minVersion) {\n result[env] = prettifyVersion(targetVersion);\n } else {\n const minIsUnreleased = isUnreleasedVersion(minVersion, env);\n const targetIsUnreleased = isUnreleasedVersion(targetVersion, env);\n\n if (\n !targetIsUnreleased &&\n (minIsUnreleased ||\n semver.lt(targetVersion.toString(), semverify(minVersion)))\n ) {\n result[env] = prettifyVersion(targetVersion);\n }\n }\n\n return result;\n },\n {} as Partial<Record<Target, string>>,\n );\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAOO,SAASG,mBAAmBA,CACjCC,IAAY,EACZC,cAAuB,EACvBC,IAAgC,EAChC;EACA,MAAMC,WAAW,GAAGD,IAAI,CAACF,IAAI,CAAC,IAAI,CAAC,CAAC;EAEpC,OAAQI,MAAM,CAACC,IAAI,CAACJ,cAAc,CAAC,CAAcK,MAAM,CACrD,CAACC,MAAM,EAAEC,GAAG,KAAK;IACf,MAAMC,UAAU,GAAG,IAAAC,kCAA2B,EAACP,WAAW,EAAEK,GAAG,CAAC;IAChE,MAAMG,aAAa,GAAGV,cAAc,CAACO,GAAG,CAAC;IAEzC,IAAI,CAACC,UAAU,EAAE;MACfF,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAI,uBAAe,EAACD,aAAa,CAAC;IAC9C,CAAC,MAAM;MACL,MAAME,eAAe,GAAG,IAAAC,0BAAmB,EAACL,UAAU,EAAED,GAAG,CAAC;MAC5D,MAAMO,kBAAkB,GAAG,IAAAD,0BAAmB,EAACH,aAAa,EAAEH,GAAG,CAAC;MAElE,IACE,CAACO,kBAAkB,KAClBF,eAAe,IACdG,OAAM,CAACC,EAAE,CAACN,aAAa,CAACO,QAAQ,CAAC,CAAC,EAAE,IAAAC,gBAAS,EAACV,UAAU,CAAC,CAAC,CAAC,EAC7D;QACAF,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAI,uBAAe,EAACD,aAAa,CAAC;MAC9C;IACF;IAEA,OAAOJ,MAAM;EACf,CAAC,EACD,CAAC,CACH,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,18 @@
'use strict';
var define = require('define-properties');
var callBind = require('call-bind');
var implementation = require('./implementation');
var getPolyfill = require('./polyfill');
var shim = require('./shim');
var bound = callBind(implementation);
define(bound, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = bound;
@@ -0,0 +1,54 @@
{
"name": "@standard-schema/utils",
"description": "The official runtime utils for Standard Schema",
"version": "0.3.0",
"license": "MIT",
"author": "Fabian Hiller",
"repository": {
"type": "git",
"url": "https://github.com/standard-schema/standard-schema"
},
"keywords": [
"standard",
"schema",
"utils"
],
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
}
},
"sideEffects": false,
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@standard-schema/spec": "npm:@jsr/standard-schema__spec@1.0.0-beta.4",
"@vitest/coverage-v8": "2.1.2",
"tsup": "^8.3.0",
"typescript": "^5.6.2",
"vite": "^5.4.8",
"vitest": "^2.1.2"
},
"scripts": {
"test": "vitest",
"coverage": "vitest run --coverage --isolate",
"lint": "pnpm biome lint ./src",
"format": "pnpm biome format --write ./src",
"check": "pnpm biome check ./src",
"build": "tsup"
}
}
@@ -0,0 +1 @@
{"name":"mdast-util-find-and-replace","version":"3.0.2","requiresBuild":false,"files":{"license":{"checkedAt":1794532115733,"integrity":"sha512-ic4iF2Ap25Sn5T9MMw7nJ9C20WL6V01rybBBQi2Qx8cQC9/ERFEqGnove1HT65tK2TIKM30PZoOV3Qbz2FE//A==","mode":420,"size":1094},"index.js":{"checkedAt":1794532115733,"integrity":"sha512-7ANg5bZHRG8NUWfRscb7jFUkVaO6B0c5cOLZYE7Sz2n9bxQgXvw/X8a+TdSQ+PDGEv2uZdLkiJGFZd1f5RY9PA==","mode":420,"size":516},"lib/index.js":{"checkedAt":1794532115733,"integrity":"sha512-ElLUrfqgiWW9Z3/KIpxH3uwaADJ2M+jV8NtZsegdhU2gB2oeQ2Nr4bnIRAJguOlP6PUcUq2pVBpj74LkXg41HQ==","mode":420,"size":6692},"package.json":{"checkedAt":1794532115733,"integrity":"sha512-vTeazVq7V0IbWiWB7MQm8yopr6GPUcerZzdsUKudrpZeqvDdWgrNCYFcntwHZ+sVjQz6XUwbi1uMBtbhVYXTQg==","mode":420,"size":2130},"index.d.ts.map":{"checkedAt":1794532115733,"integrity":"sha512-cOs1ta2yvUCL2TvltqNGm42WfW0KZqC3Zw3N296W0yNCz96OMALqRAtHMXURYBjduS3YU16zAjwIZTw+wdmEbQ==","mode":420,"size":305},"lib/index.d.ts.map":{"checkedAt":1794532115734,"integrity":"sha512-XOwsB0rUtsWElJ22geWMMBc2juha0yBNqWCPkm7xtoH0xhF0UcvEiv1s8yKHtdgCNyLX682CeVA6qnt5RdB02w==","mode":420,"size":696},"readme.md":{"checkedAt":1794532115734,"integrity":"sha512-K4O+dLjKFrzWLp/tqV0trKv9XjUqb808fYeixvylSQ9orut4+aHvf7XH4iaFpDNHXYL6cnEutuPNCM84UCdIRQ==","mode":420,"size":9257},"index.d.ts":{"checkedAt":1794532115734,"integrity":"sha512-MH6a8NbP2Tm/0ee4WPJID9RZFQZTjSWdsf2QOTiscYpc6xyKkXPwIVzlWBMHdM116S0MOaWeKlyTQ2mTfvFFwQ==","mode":420,"size":552},"lib/index.d.ts":{"checkedAt":1794532115734,"integrity":"sha512-KFW4vDAQ3J2726wsLTZ0E7GP/K5rpPBScY7x1XX43NJzvt6orwX8SvGaCws/lomWN74rJyK0lMDXl6+MVYyAbA==","mode":420,"size":2158}}}
@@ -0,0 +1,8 @@
var $442f5f6ac211e29f$exports = {};
$442f5f6ac211e29f$exports = {
"longPressMessage": `Mantenga pulsado o pulse Alt + flecha abajo para abrir el men\xfa`
};
export {$442f5f6ac211e29f$exports as default};
//# sourceMappingURL=es-ES.module.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["googleDocs","msWord","NORMALIZERS","normalizeExternalHTML","doc","documentElement","forEach","normalize"],"sources":["../../../src/modules/normalizeExternalHTML/index.ts"],"sourcesContent":["import googleDocs from './normalizers/googleDocs.js';\nimport msWord from './normalizers/msWord.js';\n\nconst NORMALIZERS = [msWord, googleDocs];\n\nconst normalizeExternalHTML = (doc: Document) => {\n if (doc.documentElement) {\n NORMALIZERS.forEach((normalize) => {\n normalize(doc);\n });\n }\n};\n\nexport default normalizeExternalHTML;\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,6BAA6B;AACpD,OAAOC,MAAM,MAAM,yBAAyB;AAE5C,MAAMC,WAAW,GAAG,CAACD,MAAM,EAAED,UAAU,CAAC;AAExC,MAAMG,qBAAqB,GAAIC,GAAa,IAAK;EAC/C,IAAIA,GAAG,CAACC,eAAe,EAAE;IACvBH,WAAW,CAACI,OAAO,CAAEC,SAAS,IAAK;MACjCA,SAAS,CAACH,GAAG,CAAC;IAChB,CAAC,CAAC;EACJ;AACF,CAAC;AAED,eAAeD,qBAAqB","ignoreList":[]}
@@ -0,0 +1,46 @@
# safe-regex-test <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
Give a regex, get a robust predicate function that tests it against a string. This will work even if `RegExp.prototype` is altered later.
## Getting started
```sh
npm install --save safe-regex-test
```
## Usage/Examples
```js
var regexTester = require('safe-regex-test');
var assert = require('assert');
var tester = regexTester('a');
assert.ok(tester('a'));
assert.notOk(tester('b'));
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/safe-regex-test
[npm-version-svg]: https://versionbadg.es/ljharb/safe-regex-test.svg
[deps-svg]: https://david-dm.org/ljharb/safe-regex-test.svg
[deps-url]: https://david-dm.org/ljharb/safe-regex-test
[dev-deps-svg]: https://david-dm.org/ljharb/safe-regex-test/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/safe-regex-test#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/safe-regex-test.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/safe-regex-test.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/safe-regex-test.svg
[downloads-url]: https://npm-stat.com/charts.html?package=safe-regex-test
[codecov-image]: https://codecov.io/gh/ljharb/safe-regex-test/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/safe-regex-test/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/safe-regex-test
[actions-url]: https://github.com/ljharb/safe-regex-test/actions
@@ -0,0 +1 @@
{"version":3,"file":"PluginApi.d.ts","sourceRoot":"","sources":["../../../../src/plugin/models/PluginApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/D,MAAM,WAAW,SAAS;IACxB,MAAM,CACJ,IAAI,EAAE,MAAM,GAAG,MAAM,EAErB,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,GAClC,IAAI,CAAC;IACR,MAAM,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI,CAAC;CAC9E"}
@@ -0,0 +1,18 @@
/**
* This method returns `false`.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {boolean} Returns `false`.
* @example
*
* _.times(2, _.stubFalse);
* // => [false, false]
*/
function stubFalse() {
return false;
}
export default stubFalse;
@@ -0,0 +1 @@
{"mappings":"AAAA;;;;;;;;;;CAUC,GAQD,MAAM,yCAAmB,IAAI;AAC7B,MAAM,0CAAoB,IAAI;AAMvB,MAAM;IASX,8EAA8E,GAC9E,OAAO,GAAM,EAAE,SAAqB,EAAU;QAC5C,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC,MAAM;QAC9D,OAAO,OAAO,YAAY,aAAa,QAAQ,WAAW,IAAI,IAAI;IACpE;IAEU,OAAO,KAAa,EAAE,OAAuC,EAAE,OAA4B,UAAU,EAAU;QACvH,IAAI,MAAM,OAAO,CAAC,MAAM,MAAM;QAC9B,IAAI,KACF,OAAO,OAAO,QAAQ,aAAa,QAAQ;QAG7C,IAAI,MAAM,IAAI,CAAC,MAAM,GAAG,MAAM;QAC9B,IAAI,cAAc,uCAAiB,GAAG,CAAC;QACvC,IAAI,CAAC,aAAa;YAChB,cAAc,IAAI,KAAK,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE;sBAAC;YAAI;YACrD,uCAAiB,GAAG,CAAC,KAAK;QAC5B;QAEA,IAAI,WAAW,YAAY,MAAM,CAAC;QAClC,MAAM,OAAO,CAAC,SAAS,IAAI,QAAQ,KAAK;QACxC,OAAO,OAAO,QAAQ,aAAa,QAAQ;IAC7C;IAEU,OAAO,KAAa,EAAU;QACtC,IAAI,eAAe,wCAAkB,GAAG,CAAC,IAAI,CAAC,MAAM;QACpD,IAAI,CAAC,cAAc;YACjB,eAAe,IAAI,KAAK,YAAY,CAAC,IAAI,CAAC,MAAM;YAChD,wCAAkB,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE;QACrC;QACA,OAAO,aAAa,MAAM,CAAC;IAC7B;IAEU,OAAO,OAAuC,EAAE,KAAa,EAAU;QAC/E,IAAI,MAAM,OAAO,CAAC,MAAM,IAAI,QAAQ,KAAK;QACzC,OAAO,OAAO,QAAQ,aAAa,QAAQ;IAC7C;IAzCA,YAAY,MAAc,EAAE,OAAwC,CAAE;QACpE,IAAI,CAAC,MAAM,GAAG;QACd,IAAI,CAAC,OAAO,GAAG;IACjB;AAuCF","sources":["packages/@internationalized/string/src/LocalizedStringFormatter.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {LocalizedStringDictionary} from './LocalizedStringDictionary';\n\nexport type Variables = Record<string, string | number | boolean> | undefined;\nexport type LocalizedString = string | ((args: Variables, formatter?: LocalizedStringFormatter<any, any>) => string);\ntype InternalString = string | (() => string);\n\nconst pluralRulesCache = new Map<string, Intl.PluralRules>();\nconst numberFormatCache = new Map<string, Intl.NumberFormat>();\n\n/**\n * Formats localized strings from a LocalizedStringDictionary. Supports interpolating variables,\n * selecting the correct pluralization, and formatting numbers for the locale.\n */\nexport class LocalizedStringFormatter<K extends string = string, T extends LocalizedString = string> {\n private locale: string;\n private strings: LocalizedStringDictionary<K, T>;\n\n constructor(locale: string, strings: LocalizedStringDictionary<K, T>) {\n this.locale = locale;\n this.strings = strings;\n }\n\n /** Formats a localized string for the given key with the provided variables. */\n format(key: K, variables?: Variables): string {\n let message = this.strings.getStringForLocale(key, this.locale);\n return typeof message === 'function' ? message(variables, this) : message;\n }\n\n protected plural(count: number, options: Record<string, InternalString>, type: Intl.PluralRuleType = 'cardinal'): string {\n let opt = options['=' + count];\n if (opt) {\n return typeof opt === 'function' ? opt() : opt;\n }\n\n let key = this.locale + ':' + type;\n let pluralRules = pluralRulesCache.get(key);\n if (!pluralRules) {\n pluralRules = new Intl.PluralRules(this.locale, {type});\n pluralRulesCache.set(key, pluralRules);\n }\n\n let selected = pluralRules.select(count);\n opt = options[selected] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n\n protected number(value: number): string {\n let numberFormat = numberFormatCache.get(this.locale);\n if (!numberFormat) {\n numberFormat = new Intl.NumberFormat(this.locale);\n numberFormatCache.set(this.locale, numberFormat);\n }\n return numberFormat.format(value);\n }\n\n protected select(options: Record<string, InternalString>, value: string): string {\n let opt = options[value] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n}\n"],"names":[],"version":3,"file":"LocalizedStringFormatter.module.js.map"}
@@ -0,0 +1,9 @@
"use strict";
var _check_private_redeclaration = require("./_check_private_redeclaration.cjs");
function _class_private_method_init(obj, privateSet) {
_check_private_redeclaration._(obj, privateSet);
privateSet.add(obj);
}
exports._ = _class_private_method_init;
@@ -0,0 +1,14 @@
import type { DeclarationMetadata, ModuleOptions } from '../utils/index.js';
import { ExportMap } from '../utils/index.js';
export interface Options extends ModuleOptions {
allowUnsafeDynamicCyclicDependency?: boolean;
ignoreExternal?: boolean;
maxDepth?: number | '∞';
}
export type MessageId = 'cycle' | 'cycleSource';
export interface Traverser {
mget(): ExportMap | null;
route: Array<DeclarationMetadata['source']>;
}
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageId, [(Options | undefined)?], import("../utils/create-rule.ts").ImportXPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
export default _default;
@@ -0,0 +1,32 @@
{
"name": "rimraf",
"version": "3.0.2",
"main": "rimraf.js",
"description": "A deep deletion module for node (like `rm -rf`)",
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"license": "ISC",
"repository": "git://github.com/isaacs/rimraf.git",
"scripts": {
"preversion": "npm test",
"postversion": "npm publish",
"postpublish": "git push origin --follow-tags",
"test": "tap test/*.js"
},
"bin": "./bin.js",
"dependencies": {
"glob": "^7.1.3"
},
"files": [
"LICENSE",
"README.md",
"bin.js",
"rimraf.js"
],
"devDependencies": {
"mkdirp": "^0.5.1",
"tap": "^12.1.1"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
}
@@ -0,0 +1,104 @@
// Copyright (c) 2016 Ryan Prichard
//
// 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.
#ifndef WINPTY_WINDOWS_SECURITY_H
#define WINPTY_WINDOWS_SECURITY_H
#include <windows.h>
#include <aclapi.h>
#include <memory>
#include <string>
#include <tuple>
#include <utility>
// PSID and PSECURITY_DESCRIPTOR are both pointers to void, but we want
// Sid and SecurityDescriptor to be different types.
struct SidTag { typedef PSID type; };
struct AclTag { typedef PACL type; };
struct SecurityDescriptorTag { typedef PSECURITY_DESCRIPTOR type; };
template <typename T>
class SecurityItem {
public:
struct Impl {
virtual ~Impl() {}
};
private:
typedef typename T::type P;
P m_v;
std::unique_ptr<Impl> m_pimpl;
public:
P get() const { return m_v; }
operator bool() const { return m_v != nullptr; }
SecurityItem() : m_v(nullptr) {}
SecurityItem(P v, std::unique_ptr<Impl> &&pimpl) :
m_v(v), m_pimpl(std::move(pimpl)) {}
SecurityItem(SecurityItem &&other) :
m_v(other.m_v), m_pimpl(std::move(other.m_pimpl)) {
other.m_v = nullptr;
}
SecurityItem &operator=(SecurityItem &&other) {
m_v = other.m_v;
other.m_v = nullptr;
m_pimpl = std::move(other.m_pimpl);
return *this;
}
};
typedef SecurityItem<SidTag> Sid;
typedef SecurityItem<AclTag> Acl;
typedef SecurityItem<SecurityDescriptorTag> SecurityDescriptor;
Sid getOwnerSid();
Sid wellKnownSid(
const wchar_t *debuggingName,
SID_IDENTIFIER_AUTHORITY authority,
BYTE authorityCount,
DWORD subAuthority0=0,
DWORD subAuthority1=0);
Sid builtinAdminsSid();
Sid localSystemSid();
Sid everyoneSid();
SecurityDescriptor createPipeSecurityDescriptorOwnerFullControl();
SecurityDescriptor createPipeSecurityDescriptorOwnerFullControlEveryoneWrite();
SecurityDescriptor getObjectSecurityDescriptor(HANDLE handle);
std::wstring sidToString(PSID sid);
Sid stringToSid(const std::wstring &str);
SecurityDescriptor stringToSd(const std::wstring &str);
std::wstring sdToString(PSECURITY_DESCRIPTOR sd);
DWORD rejectRemoteClientsPipeFlag();
enum class GetNamedPipeClientProcessId_Result {
Success,
Failure,
UnsupportedOs,
};
std::tuple<GetNamedPipeClientProcessId_Result, DWORD, DWORD>
getNamedPipeClientProcessId(HANDLE serverPipe);
#endif // WINPTY_WINDOWS_SECURITY_H
@@ -0,0 +1,18 @@
import $HgANd$react from "react";
/*
* 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.
*/
const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== 'undefined' ? (0, $HgANd$react).useLayoutEffect : ()=>{};
export {$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect};
//# sourceMappingURL=useLayoutEffect.module.js.map
@@ -0,0 +1,394 @@
// prettier-ignore
/* eslint-disable */
// @ts-nocheck
/* auto-generated by NAPI-RS */
const { createRequire } = require('node:module')
require = createRequire(__filename)
const { readFileSync } = require('node:fs')
let nativeBinding = null
const loadErrors = []
const isMusl = () => {
let musl = false
if (process.platform === 'linux') {
musl = isMuslFromFilesystem()
if (musl === null) {
musl = isMuslFromReport()
}
if (musl === null) {
musl = isMuslFromChildProcess()
}
}
return musl
}
const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
const isMuslFromFilesystem = () => {
try {
return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
} catch {
return null
}
}
const isMuslFromReport = () => {
let report = null
if (typeof process.report?.getReport === 'function') {
process.report.excludeNetwork = true
report = process.report.getReport()
}
if (!report) {
return null
}
if (report.header && report.header.glibcVersionRuntime) {
return false
}
if (Array.isArray(report.sharedObjects)) {
if (report.sharedObjects.some(isFileMusl)) {
return true
}
}
return false
}
const isMuslFromChildProcess = () => {
try {
return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
} catch (e) {
// If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
return false
}
}
function requireNative() {
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
try {
nativeBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
} catch (err) {
loadErrors.push(err)
}
} else if (process.platform === 'android') {
if (process.arch === 'arm64') {
try {
return require('./resolver.android-arm64.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-android-arm64')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'arm') {
try {
return require('./resolver.android-arm-eabi.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-android-arm-eabi')
} catch (e) {
loadErrors.push(e)
}
} else {
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
}
} else if (process.platform === 'win32') {
if (process.arch === 'x64') {
try {
return require('./resolver.win32-x64-msvc.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-win32-x64-msvc')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'ia32') {
try {
return require('./resolver.win32-ia32-msvc.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-win32-ia32-msvc')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'arm64') {
try {
return require('./resolver.win32-arm64-msvc.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-win32-arm64-msvc')
} catch (e) {
loadErrors.push(e)
}
} else {
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
}
} else if (process.platform === 'darwin') {
try {
return require('./resolver.darwin-universal.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-darwin-universal')
} catch (e) {
loadErrors.push(e)
}
if (process.arch === 'x64') {
try {
return require('./resolver.darwin-x64.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-darwin-x64')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'arm64') {
try {
return require('./resolver.darwin-arm64.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-darwin-arm64')
} catch (e) {
loadErrors.push(e)
}
} else {
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
}
} else if (process.platform === 'freebsd') {
if (process.arch === 'x64') {
try {
return require('./resolver.freebsd-x64.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-freebsd-x64')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'arm64') {
try {
return require('./resolver.freebsd-arm64.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-freebsd-arm64')
} catch (e) {
loadErrors.push(e)
}
} else {
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
}
} else if (process.platform === 'linux') {
if (process.arch === 'x64') {
if (isMusl()) {
try {
return require('./resolver.linux-x64-musl.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-linux-x64-musl')
} catch (e) {
loadErrors.push(e)
}
} else {
try {
return require('./resolver.linux-x64-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-linux-x64-gnu')
} catch (e) {
loadErrors.push(e)
}
}
} else if (process.arch === 'arm64') {
if (isMusl()) {
try {
return require('./resolver.linux-arm64-musl.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-linux-arm64-musl')
} catch (e) {
loadErrors.push(e)
}
} else {
try {
return require('./resolver.linux-arm64-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-linux-arm64-gnu')
} catch (e) {
loadErrors.push(e)
}
}
} else if (process.arch === 'arm') {
if (isMusl()) {
try {
return require('./resolver.linux-arm-musleabihf.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-linux-arm-musleabihf')
} catch (e) {
loadErrors.push(e)
}
} else {
try {
return require('./resolver.linux-arm-gnueabihf.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-linux-arm-gnueabihf')
} catch (e) {
loadErrors.push(e)
}
}
} else if (process.arch === 'riscv64') {
if (isMusl()) {
try {
return require('./resolver.linux-riscv64-musl.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-linux-riscv64-musl')
} catch (e) {
loadErrors.push(e)
}
} else {
try {
return require('./resolver.linux-riscv64-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-linux-riscv64-gnu')
} catch (e) {
loadErrors.push(e)
}
}
} else if (process.arch === 'ppc64') {
try {
return require('./resolver.linux-ppc64-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-linux-ppc64-gnu')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 's390x') {
try {
return require('./resolver.linux-s390x-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@unrs/resolver-binding-linux-s390x-gnu')
} catch (e) {
loadErrors.push(e)
}
} else {
loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
}
} else {
loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
}
}
nativeBinding = requireNative()
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
try {
nativeBinding = require('./resolver.wasi.cjs')
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
loadErrors.push(err)
}
}
if (!nativeBinding) {
try {
nativeBinding = require('@unrs/resolver-binding-wasm32-wasi')
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
loadErrors.push(err)
}
}
}
}
if (!nativeBinding && process.env.SKIP_UNRS_RESOLVER_FALLBACK !== '1') {
try {
nativeBinding = require('napi-postinstall/fallback')(require.resolve('./package.json'), true)
} catch (err) {
loadErrors.push(err)
}
}
if (!nativeBinding) {
if (loadErrors.length > 0) {
throw new Error(
`Cannot find native binding. ` +
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
{ cause: loadErrors }
)
}
throw new Error(`Failed to load native binding`)
}
module.exports = nativeBinding
module.exports.ResolverFactory = nativeBinding.ResolverFactory
module.exports.EnforceExtension = nativeBinding.EnforceExtension
module.exports.ModuleType = nativeBinding.ModuleType
module.exports.sync = nativeBinding.sync
if (process.versions.pnp) {
process.env.UNRS_RESOLVER_YARN_PNP = '1'
}
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAcM,MAAM,4CAAgD,OAAO,aAAa,cAC7E,CAAA,GAAA,sCAAI,EAAE,eAAe,GACrB,KAAO;AAqBJ,SAAS,0CAAkD,IAA+B;IAC/F,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,qBAAO,EAAE,IAAI,CAAA,GAAA,8BAAG,EAAE,GAAG,GAAG,GAAG;IAC/D,IAAI,CAAC,aAAa,aAAa,GAAG,CAAA,GAAA,qBAAO,EAAE;IAC3C,IAAI,CAAC,qBAAqB,uBAAuB,GAAG,CAAA,GAAA,qBAAO,EAAuB,CAAC;IACnF,IAAI,qBAAqB,CAAA,GAAA,mBAAK,EAAE;IAChC,IAAI,CAAC,YAAY,GAAG,CAAA,GAAA,qBAAO,EAAE,IAAM,IAAI,CAAA,GAAA,qCAAU,EAAQ;YACvD,YAAY,KAAK,UAAU;YAC3B,QAAQ,KAAK,MAAM;YACnB,UAAU;gBACR,gBAAe,IAAI;oBACjB,eAAe;oBACf,mBAAmB,OAAO,GAAG;gBAC/B;gBACA,2DAA2D;gBAC3D,YAAY,KAAK,UAAU;gBAC3B,YAAY;YACd;QACF;IAEA,wEAAwE;IACxE,0CAAgB;QACd,IAAI,mBAAmB,OAAO,EAAE;YAC9B,mBAAmB,OAAO,GAAG;YAC7B,KAAK,mBAAmB,CAAC;QAC3B;IACF;IAEA,IAAI,4BAA4B,CAAA,GAAA,oBAAM,EAAE;QACtC,IAAI,KAAK,aAAa,IAAI,MACxB,OAAO;YAAC,GAAG,mBAAmB;YAAE,eAAe,KAAK,aAAa;QAAA;QAEnE,OAAO;IACT,GAAG;QAAC;QAAqB,KAAK,aAAa;KAAC;IAE5C,IAAI,eAAe,YAAY,MAAM,CAAC;QACpC,QAAQ,KAAK,MAAM;QACnB,YAAY,KAAK,UAAU;QAC3B,eAAe,KAAK,aAAa;QACjC,eAAe,KAAK,aAAa;qBACjC;QACA,qBAAqB;qBACrB;IACF;IAEA,IAAI,cAAc,YAAY,WAAW;IAEzC,IAAI,iBAAiB,CAAA,GAAA,wBAAU,EAAE;QAC/B,aAAa;IACf,GAAG,EAAE;IACL,IAAI,eAAe,CAAA,GAAA,wBAAU,EAAE;QAC7B,aAAa;IACf,GAAG,EAAE;IAEL,IAAI,QAAQ,CAAA,GAAA,oBAAM,EAAE,IAAO,CAAA;yBACzB;0BACA;4BACA;yBACA;yBACA;4BACA;0BACA;QACF,CAAA,GAAI;QACF;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,OAAO;AACT","sources":["packages/@react-stately/virtualizer/src/useVirtualizerState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, Key} from '@react-types/shared';\nimport {InvalidationContext} from './types';\nimport {Layout} from './Layout';\nimport React, {useCallback, useMemo, useRef, useState} from 'react';\nimport {Rect} from './Rect';\nimport {ReusableView} from './ReusableView';\nimport {Size} from './Size';\nimport {Virtualizer} from './Virtualizer';\n\n// During SSR, React emits a warning when calling useLayoutEffect.\n// Since neither useLayoutEffect nor useEffect run on the server,\n// we can suppress this by replace it with a noop on the server.\nexport const useLayoutEffect: typeof React.useLayoutEffect = typeof document !== 'undefined'\n ? React.useLayoutEffect\n : () => {};\n\ninterface VirtualizerProps<T extends object, V, O> {\n renderView(type: string, content: T | null): V,\n layout: Layout<T>,\n collection: Collection<T>,\n onVisibleRectChange(rect: Rect): void,\n persistedKeys?: Set<Key> | null,\n layoutOptions?: O\n}\n\nexport interface VirtualizerState<T extends object, V> {\n visibleViews: ReusableView<T, V>[],\n setVisibleRect: (rect: Rect) => void,\n contentSize: Size,\n virtualizer: Virtualizer<T, V>,\n isScrolling: boolean,\n startScrolling: () => void,\n endScrolling: () => void\n}\n\nexport function useVirtualizerState<T extends object, V, O = any>(opts: VirtualizerProps<T, V, O>): VirtualizerState<T, V> {\n let [visibleRect, setVisibleRect] = useState(new Rect(0, 0, 0, 0));\n let [isScrolling, setScrolling] = useState(false);\n let [invalidationContext, setInvalidationContext] = useState<InvalidationContext>({});\n let visibleRectChanged = useRef(false);\n let [virtualizer] = useState(() => new Virtualizer<T, V>({\n collection: opts.collection,\n layout: opts.layout,\n delegate: {\n setVisibleRect(rect) {\n setVisibleRect(rect);\n visibleRectChanged.current = true;\n },\n // TODO: should changing these invalidate the entire cache?\n renderView: opts.renderView,\n invalidate: setInvalidationContext\n }\n }));\n\n // onVisibleRectChange must be called from an effect, not during render.\n useLayoutEffect(() => {\n if (visibleRectChanged.current) {\n visibleRectChanged.current = false;\n opts.onVisibleRectChange(visibleRect);\n }\n });\n\n let mergedInvalidationContext = useMemo(() => {\n if (opts.layoutOptions != null) {\n return {...invalidationContext, layoutOptions: opts.layoutOptions};\n }\n return invalidationContext;\n }, [invalidationContext, opts.layoutOptions]);\n\n let visibleViews = virtualizer.render({\n layout: opts.layout,\n collection: opts.collection,\n persistedKeys: opts.persistedKeys,\n layoutOptions: opts.layoutOptions,\n visibleRect,\n invalidationContext: mergedInvalidationContext,\n isScrolling\n });\n\n let contentSize = virtualizer.contentSize;\n\n let startScrolling = useCaLine truncated
@@ -0,0 +1,9 @@
export type {Test} from 'unist-util-is'
export type {
Action,
ActionTuple,
Index,
VisitorResult
} from 'unist-util-visit-parents'
export type {Visitor, BuildVisitor} from './lib/index.js'
export {CONTINUE, EXIT, SKIP, visit} from './lib/index.js'
@@ -0,0 +1,43 @@
/**
* Get type of value
*
* 获取值的类型
*
* @example
* ```js
* import { getType } from 'is-what-type';
*
* getType(null) // => 'Null'
* getType(undefined) // => 'Undefined'
* getType(1) // => 'Number'
* getType('') // => 'String'
* getType(true) // => 'Boolean'
* getType([]) // => 'Array'
* getType({}) // => 'Object'
* getType(function() {}) // => 'Function'
* getType(new Date()) // => 'Date'
* getType(new RegExp()) // => 'RegExp'
* getType(new Error()) // => 'Error'
* getType(new Map()) // => 'Map'
* getType(new Set()) // => 'Set'
* getType(new WeakMap()) // => 'WeakMap'
* getType(new WeakSet()) // => 'WeakSet'
* getType(new Promise(() => {})) // => 'Promise'
* getType(Symbol()) // => 'Symbol'
* getType(new Int8Array()) // => 'Int8Array'
* getType(new Uint8Array()) // => 'Uint8Array'
* getType(new Uint8ClampedArray()) // => 'Uint8ClampedArray'
* getType(new Int16Array()) // => 'Int16Array'
* getType(new Uint16Array()) // => 'Uint16Array'
* getType(new Int32Array()) // => 'Int32Array'
* getType(new Uint32Array()) // => 'Uint32Array'
* getType(new Float32Array()) // => 'Float32Array'
* getType(new Float64Array()) // => 'Float64Array'
* getType(new BigInt64Array()) // => 'BigInt64Array'
* getType(new BigUint64Array()) // => 'BigUint64Array'
* ```
*
* @param value - The value to check
* @returns The type of the value
*/
export declare function getType(value: any): string;
@@ -0,0 +1 @@
"use strict";var b=Object.defineProperty;var C=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var A=(i,e,E)=>e in i?b(i,e,{enumerable:!0,configurable:!0,writable:!0,value:E}):i[e]=E,O=(i,e)=>{for(var E in e||(e={}))g.call(e,E)&&A(i,E,e[E]);if(C)for(var E of C(e))x.call(e,E)&&A(i,E,e[E]);return i};var _,D,a,L,c,S,N,u,P,d;const r$2=Object.create(null),s=i=>{var e,E;return((e=globalThis.process)==null?void 0:e.env)||void 0||((E=globalThis.Deno)==null?void 0:E.env.toObject())||globalThis.__env__||(i?r$2:globalThis)},env=new Proxy(r$2,{get(i,e){var E;return(E=s()[e])!=null?E:r$2[e]},has(i,e){const E=s();return e in E||e in r$2},set(i,e,E){const l=s(!0);return l[e]=E,!0},deleteProperty(i,e){if(!e)return!1;const E=s(!0);return delete E[e],!0},ownKeys(){const i=s(!0);return Object.keys(i)}}),nodeENV=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",r$1=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CLOUDFLARE_WORKERS","WORKERS_CI",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function I(){var i,e,E,l,R,p;if((i=globalThis.process)!=null&&i.env)for(const T of r$1){const B=T[1]||T[0];if((e=globalThis.process)!=null&&e.env[B])return O({name:T[0].toLowerCase()},T[2])}return((l=(E=globalThis.process)==null?void 0:E.env)==null?void 0:l.SHELL)==="/bin/jsh"&&((p=(R=globalThis.process)==null?void 0:R.versions)!=null&&p.webcontainer)?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const providerInfo=I(),provider=providerInfo.name;function toBoolean(i){return i?i!=="false":!1}const platform=((_=globalThis.process)==null?void 0:_.platform)||"",isCI=toBoolean(env.CI)||providerInfo.ci!==!1,hasTTY=toBoolean(((D=globalThis.process)==null?void 0:D.stdout)&&((a=globalThis.process)==null?void 0:a.stdout.isTTY)),hasWindow=typeof window<"u",isDebug=toBoolean(env.DEBUG),isTest=nodeENV==="test"||toBoolean(env.TEST),isProduction=nodeENV==="production",isDevelopment=nodeENV==="dev"||nodeENV==="development",isMinimal=toBoolean(env.MINIMAL)||isCI||isTest||!hasTTY,isWindows=/^win/i.test(platform),isLinux=/^linux/i.test(platform),isMacOS=/^darwin/i.test(platform),isColorSupported=!toBoolean(env.NO_COLOR)&&(toBoolean(env.FORCE_COLOR)||(hasTTY||isWindows)&&env.TERM!=="dumb"||isCI),nodeVersion=(((c=(L=globalThis.process)==null?void 0:L.versions)==null?void 0:c.node)||"").replace(/^v/,"")||null,nodeMajorVersion=Number(nodeVersion==null?void 0:nodeVersion.split(".")[0])||null,o=globalThis.process||Object.create(null),r={versions:{}},process$1=new Proxy(o,{get(i,e){if(e==="env")return env;if(e in i)return i[e];if(e in r)return r[e]}}),isNode=((N=(S=globalThis.process)==null?void 0:S.release)==null?void 0:N.name)==="node",isBun=!!globalThis.Bun||!!((P=(u=globalThis.process)==null?void 0:u.versions)!=null&&P.bun),isDeno=!!globalThis.Deno,isFastly=!!globalThis.fastly,isNetlify=!!globalThis.Netlify,isEdgeLight=!!globalThis.EdgeRuntime,isWorkerd=((d=globalThis.navigator)==null?void 0:d.userAgent)==="Cloudflare-Workers",n=[[isNetlify,"netlify"],[isEdgeLight,"edge-light"],[isWorkerd,"workerd"],[isFastly,"fastly"],[isDeno,"deno"],[isBun,"bun"],[isNode,"node"]];function t(){const i=n.find(e=>e[0]);if(i)return{name:i[1]}}const runtimeInfo=t(),runtime=(runtimeInfo==null?void 0:runtimeInfo.name)||"";exports.env=env,exports.hasTTY=hasTTY,exports.hasWindow=hasWindow,exports.isBun=isBun,exports.isCI=isCI,exports.isColorSupported=isColorSupported,exports.isDebug=isDebug,exports.isDeno=isDeno,exports.isDevelopment=isDevelopment,exports.isEdgeLight=isEdgeLight,exports.isFastly=isFastly,exports.isLinux=isLinux,exports.isMacOS=isMacOS,exports.isMinimal=isMinimal,exports.isNetlify=isNetlify,exports.isNode=isNode,exports.isProduction=isProduction,eLine truncated
@@ -0,0 +1,16 @@
import getMapData from './_getMapData.js';
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
export default mapCacheGet;
@@ -0,0 +1 @@
{"version":3,"names":["_setPrototypeOf","require","_inherits","_wrapRegExp","exports","default","re","groups","BabelRegExp","undefined","_super","RegExp","prototype","_groups","WeakMap","flags","_this","set","get","setPrototypeOf","inherits","exec","str","result","call","buildGroups","indices","Symbol","replace","substitution","match","name","end","group","Array","isArray","join","args","arguments","length","slice","push","apply","g","Object","keys","reduce","i","k","create"],"sources":["../../src/helpers/wrapRegExp.ts"],"sourcesContent":["/* @minVersion 7.19.0 */\n\nimport setPrototypeOf from \"./setPrototypeOf.ts\";\nimport inherits from \"./inherits.ts\";\n\n// Define interfaces for clarity and type safety\ninterface GroupMap {\n [key: string]: number | [number, number];\n}\n\ndeclare class BabelRegExp extends RegExp {\n exec(str: string): RegExpExecArray | null;\n [Symbol.replace](str: string, substitution: string | Function): string;\n}\n\ninterface BabelRegExpConstructor {\n new (re: RegExp, flags?: string, groups?: GroupMap): BabelRegExp;\n readonly prototype: BabelRegExp;\n}\n\nexport default function _wrapRegExp(this: any): RegExp {\n // @ts-expect-error -- deliberately re-assign\n _wrapRegExp = function (re: RegExp, groups?: GroupMap): RegExp {\n return new (BabelRegExp as any as BabelRegExpConstructor)(\n re,\n undefined,\n groups,\n );\n };\n\n var _super = RegExp.prototype;\n var _groups = new WeakMap<RegExp, GroupMap>();\n\n function BabelRegExp(\n this: BabelRegExp,\n re: RegExp,\n flags?: string,\n groups?: GroupMap,\n ) {\n var _this = new RegExp(re, flags);\n // if the regex is re-created with 'g' flag\n _groups.set(_this, groups || _groups.get(re)!);\n return setPrototypeOf(_this, BabelRegExp.prototype) as BabelRegExp;\n }\n inherits(BabelRegExp, RegExp);\n\n BabelRegExp.prototype.exec = function (\n this: BabelRegExp,\n str: string,\n ): RegExpExecArray | null {\n var result = _super.exec.call(this, str);\n if (result) {\n result.groups = buildGroups(result, this);\n var indices = result.indices;\n if (indices) indices.groups = buildGroups(indices, this);\n }\n return result;\n };\n\n BabelRegExp.prototype[Symbol.replace] = function (\n this: BabelRegExp,\n str: string,\n substitution: string | Function,\n ): string {\n if (typeof substitution === \"string\") {\n var groups = _groups.get(this)!;\n return (\n _super[Symbol.replace] as (\n string: string,\n replaceValue: string,\n ) => string\n ).call(\n this,\n str,\n substitution.replace(/\\$<([^>]+)(>|$)/g, function (match, name, end) {\n if (end === \"\") {\n // return unterminated group name as-is\n return match;\n } else {\n var group = groups[name];\n return Array.isArray(group)\n ? \"$\" + group.join(\"$\")\n : typeof group === \"number\"\n ? \"$\" + group\n : \"\";\n }\n }),\n );\n } else if (typeof substitution === \"function\") {\n var _this = this;\n return (\n _super[Symbol.replace] as (\n string: string,\n replacer: (substring: string, ...args: any[]) => string,\n ) => string\n ).call(this, str, function (this: any) {\n var args: IArguments | any[] = arguments;\n // Modern engines already pass result.groups returned by exec() as the last arg.\n if (typeof args[args.length - 1] !== \"object\") {\n args = [].slice.call(args) as any[];\n args.push(buildGroups(args, _this));\n }\n return substitution.apply(this, args);\n });\n } else {\n return _super[Symbol.replace].call(this, str, substitution);\n }\n };\n\n function buildGroups(\n result: RegExpExecArray,\n re: RegExp,\n ): Record<string, string>;\n function buildGroups(\n result: RegExpIndicesArray,\n re: RegExp,\n ): Record<string, [number, number]>;\n function buildGroups(\n result: RegExpExecArray | RegExpIndicesArray,\n re: RegExp,\n ): Record<string, string> | Record<string, [number, number]> {\n var g = _groups.get(re)!;\n return Object.keys(g).reduce(function (groups, name) {\n var i = g[name];\n if (typeof i === \"number\") groups[name] = result[i];\n else {\n var k = 0;\n while (result[i[k]] === undefined && k + 1 < i.length) {\n k++;\n }\n groups[name] = result[i[k]];\n }\n return groups;\n }, Object.create(null));\n }\n\n return _wrapRegExp.apply(this, arguments as any);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAiBe,SAASE,WAAWA,CAAA,EAAoB;EAErDC,OAAA,CAAAC,OAAA,GAAAF,WAAW,GAAG,SAAAA,CAAUG,EAAU,EAAEC,MAAiB,EAAU;IAC7D,OAAO,IAAKC,WAAW,CACrBF,EAAE,EACFG,SAAS,EACTF,MACF,CAAC;EACH,CAAC;EAED,IAAIG,MAAM,GAAGC,MLine truncated
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F wC","8":"A B"},B:{"1":"Q","2":"0 1 2 3 4 5 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","8":"C L M G N O P"},C:{"2":"0 1 2 3 4 5 6 7 8 xC TC J ZB K D E F A B C L M G N O P aB UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC 0C 1C","66":"9 AB BB CB DB EB FB","72":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B"},D:{"1":"eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q","2":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB 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","66":"DB EB FB bB cB dB"},E:{"2":"J ZB 2C ZC 3C","8":"K D E F A B C L M G 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED"},F:{"1":"6 7 8 9 AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B","2":"0 1 2 3 4 5 F B C AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z FD GD HD ID NC uC JD OC","66":"G N O P aB"},G:{"2":"ZC KD vC LD MD","8":"E ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"2":"hD"},I:{"1":"nD","2":"TC J I iD jD kD lD vC mD"},J:{"2":"D A"},K:{"2":"A B C H NC uC OC"},L:{"2":"I"},M:{"2":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"J oD pD qD rD sD aC tD uD","2":"6 7 8 9 AB BB CB DB EB FB vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"2":"0D"},S:{"2":"2D","72":"1D"}},B:7,C:"Custom Elements (deprecated V0 spec)",D:true};
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,oBAAoB,CAAC,gFAAiE,CAAC;AAC3G","sources":["packages/@react-aria/menu/intl/sv-SE.json"],"sourcesContent":["{\n \"longPressMessage\": \"Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn\"\n}\n"],"names":[],"version":3,"file":"sv-SE.module.js.map"}
@@ -0,0 +1,10 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from './types.mjs';
import 'react';
interface CheckIconProps extends IconSvgProps {
filled?: boolean;
}
declare const CheckIcon: ({ filled, ...props }: CheckIconProps) => react_jsx_runtime.JSX.Element;
export { CheckIcon, type CheckIconProps };
@@ -0,0 +1,49 @@
import { PopoverProps } from '@heroui/popover';
import { MenuTriggerType } from '@react-types/menu';
import { Ref } from 'react';
import { PropGetter, HTMLHeroUIProps } from '@heroui/system';
import { ReactRef } from '@heroui/react-utils';
import { MenuProps } from '@heroui/menu';
interface Props extends HTMLHeroUIProps<"div"> {
/**
* Type of overlay that is opened by the trigger.
*/
type?: "menu" | "listbox";
/**
* Ref to the DOM node.
*/
ref?: ReactRef<HTMLElement | null>;
/**
* How the menu is triggered.
* @default 'press'
*/
trigger?: MenuTriggerType;
/**
* Whether menu trigger is disabled.
* @default false
*/
isDisabled?: boolean;
/**
* Whether the Menu closes when a selection is made.
* @default true
*/
closeOnSelect?: boolean;
}
type UseDropdownProps = Props & Omit<PopoverProps, "children" | "color" | "variant">;
declare function useDropdown(props: UseDropdownProps): UseDropdownReturn;
type UseDropdownReturn = {
Component: string | React.ElementType;
menuRef: React.RefObject<HTMLUListElement>;
menuProps: any;
classNames: string;
closeOnSelect: boolean;
onClose: () => void;
autoFocus: any;
disableAnimation: boolean;
getPopoverProps: PropGetter;
getMenuProps: <T extends object>(props?: Partial<MenuProps<T>>, ref?: Ref<any>) => MenuProps;
getMenuTriggerProps: (props?: any) => any;
};
export { UseDropdownProps, UseDropdownReturn, useDropdown };
@@ -0,0 +1,496 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {DOMAttributes, FocusableElement, FocusStrategy, Key, KeyboardDelegate, RefObject} from '@react-types/shared';
import {flushSync} from 'react-dom';
import {FocusEvent, KeyboardEvent, useEffect, useRef} from 'react';
import {focusSafely, getFocusableTreeWalker} from '@react-aria/focus';
import {focusWithoutScrolling, mergeProps, scrollIntoView, scrollIntoViewport, useEvent, useRouter} from '@react-aria/utils';
import {getInteractionModality} from '@react-aria/interactions';
import {isCtrlKeyPressed, isNonContiguousSelectionModifier} from './utils';
import {MultipleSelectionManager} from '@react-stately/selection';
import {useLocale} from '@react-aria/i18n';
import {useTypeSelect} from './useTypeSelect';
export interface AriaSelectableCollectionOptions {
/**
* An interface for reading and updating multiple selection state.
*/
selectionManager: MultipleSelectionManager,
/**
* A delegate object that implements behavior for keyboard focus movement.
*/
keyboardDelegate: KeyboardDelegate,
/**
* The ref attached to the element representing the collection.
*/
ref: RefObject<HTMLElement | null>,
/**
* Whether the collection or one of its items should be automatically focused upon render.
* @default false
*/
autoFocus?: boolean | FocusStrategy,
/**
* Whether focus should wrap around when the end/start is reached.
* @default false
*/
shouldFocusWrap?: boolean,
/**
* Whether the collection allows empty selection.
* @default false
*/
disallowEmptySelection?: boolean,
/**
* Whether the collection allows the user to select all items via keyboard shortcut.
* @default false
*/
disallowSelectAll?: boolean,
/**
* Whether selection should occur automatically on focus.
* @default false
*/
selectOnFocus?: boolean,
/**
* Whether typeahead is disabled.
* @default false
*/
disallowTypeAhead?: boolean,
/**
* Whether the collection items should use virtual focus instead of being focused directly.
*/
shouldUseVirtualFocus?: boolean,
/**
* Whether navigation through tab key is enabled.
*/
allowsTabNavigation?: boolean,
/**
* Whether the collection items are contained in a virtual scroller.
*/
isVirtualized?: boolean,
/**
* The ref attached to the scrollable body. Used to provide automatic scrolling on item focus for non-virtualized collections.
* If not provided, defaults to the collection ref.
*/
scrollRef?: RefObject<HTMLElement | null>,
/**
* The behavior of links in the collection.
* - 'action': link behaves like onAction.
* - 'selection': link follows selection interactions (e.g. if URL drives selection).
* - 'override': links override all other interactions (link items are not selectable).
* @default 'action'
*/
linkBehavior?: 'action' | 'selection' | 'override'
}
export interface SelectableCollectionAria {
/** Props for the collection element. */
collectionProps: DOMAttributes
}
/**
* Handles interactions with selectable collections.
*/
export function useSelectableCollection(options: AriaSelectableCollectionOptions): SelectableCollectionAria {
let {
selectionManager: manager,
keyboardDelegate: delegate,
ref,
autoFocus = false,
shouldFocusWrap = false,
disallowEmptySelection = false,
disallowSelectAll = false,
selectOnFocus = manager.selectionBehavior === 'replace',
disallowTypeAhead = false,
shouldUseVirtualFocus,
allowsTabNavigation = false,
isVirtualized,
// If no scrollRef is provided, assume the collection ref is the scrollable region
scrollRef = ref,
linkBehavior = 'action'
} = options;
let {direction} = useLocale();
let router = useRouter();
let onKeyDown = (e: KeyboardEvent) => {
// Prevent option + tab from doing anything since it doesn't move focus to the cells, only buttons/checkboxes
if (e.altKey && e.key === 'Tab') {
e.preventDefault();
}
// Keyboard events bubble through portals. Don't handle keyboard events
// for elements outside the collection (e.g. menus).
if (!ref.current?.contains(e.target as Element)) {
return;
}
const navigateToKey = (key: Key | undefined, childFocus?: FocusStrategy) => {
if (key != null) {
if (manager.isLink(key) && linkBehavior === 'selection' && selectOnFocus && !isNonContiguousSelectionModifier(e)) {
// Set focused key and re-render synchronously to bring item into view if needed.
flushSync(() => {
manager.setFocusedKey(key, childFocus);
});
let item = scrollRef.current?.querySelector(`[data-key="${CSS.escape(key.toString())}"]`);
let itemProps = manager.getItemProps(key);
if (item) {
router.open(item, e, itemProps.href, itemProps.routerOptions);
}
return;
}
manager.setFocusedKey(key, childFocus);
if (manager.isLink(key) && linkBehavior === 'override') {
return;
}
if (e.shiftKey && manager.selectionMode === 'multiple') {
manager.extendSelection(key);
} else if (selectOnFocus && !isNonContiguousSelectionModifier(e)) {
manager.replaceSelection(key);
}
}
};
switch (e.key) {
case 'ArrowDown': {
if (delegate.getKeyBelow) {
let nextKey = manager.focusedKey != null
? delegate.getKeyBelow?.(manager.focusedKey)
: delegate.getFirstKey?.();
if (nextKey == null && shouldFocusWrap) {
nextKey = delegate.getFirstKey?.(manager.focusedKey);
}
if (nextKey != null) {
e.preventDefault();
navigateToKey(nextKey);
}
}
break;
}
case 'ArrowUp': {
if (delegate.getKeyAbove) {
let nextKey = manager.focusedKey != null
? delegate.getKeyAbove?.(manager.focusedKey)
: delegate.getLastKey?.();
if (nextKey == null && shouldFocusWrap) {
nextKey = delegate.getLastKey?.(manager.focusedKey);
}
if (nextKey != null) {
e.preventDefault();
navigateToKey(nextKey);
}
}
break;
}
case 'ArrowLeft': {
if (delegate.getKeyLeftOf) {
let nextKey: Key | undefined | null = manager.focusedKey != null ? delegate.getKeyLeftOf?.(manager.focusedKey) : null;
if (nextKey == null && shouldFocusWrap) {
nextKey = direction === 'rtl' ? delegate.getFirstKey?.(manager.focusedKey) : delegate.getLastKey?.(manager.focusedKey);
}
if (nextKey != null) {
e.preventDefault();
navigateToKey(nextKey, direction === 'rtl' ? 'first' : 'last');
}
}
break;
}
case 'ArrowRight': {
if (delegate.getKeyRightOf) {
let nextKey: Key | undefined | null = manager.focusedKey != null ? delegate.getKeyRightOf?.(manager.focusedKey) : null;
if (nextKey == null && shouldFocusWrap) {
nextKey = direction === 'rtl' ? delegate.getLastKey?.(manager.focusedKey) : delegate.getFirstKey?.(manager.focusedKey);
}
if (nextKey != null) {
e.preventDefault();
navigateToKey(nextKey, direction === 'rtl' ? 'last' : 'first');
}
}
break;
}
case 'Home':
if (delegate.getFirstKey) {
e.preventDefault();
let firstKey: Key | null = delegate.getFirstKey(manager.focusedKey, isCtrlKeyPressed(e));
manager.setFocusedKey(firstKey);
if (firstKey != null) {
if (isCtrlKeyPressed(e) && e.shiftKey && manager.selectionMode === 'multiple') {
manager.extendSelection(firstKey);
} else if (selectOnFocus) {
manager.replaceSelection(firstKey);
}
}
}
break;
case 'End':
if (delegate.getLastKey) {
e.preventDefault();
let lastKey = delegate.getLastKey(manager.focusedKey, isCtrlKeyPressed(e));
manager.setFocusedKey(lastKey);
if (lastKey != null) {
if (isCtrlKeyPressed(e) && e.shiftKey && manager.selectionMode === 'multiple') {
manager.extendSelection(lastKey);
} else if (selectOnFocus) {
manager.replaceSelection(lastKey);
}
}
}
break;
case 'PageDown':
if (delegate.getKeyPageBelow && manager.focusedKey != null) {
let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
if (nextKey != null) {
e.preventDefault();
navigateToKey(nextKey);
}
}
break;
case 'PageUp':
if (delegate.getKeyPageAbove && manager.focusedKey != null) {
let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
if (nextKey != null) {
e.preventDefault();
navigateToKey(nextKey);
}
}
break;
case 'a':
if (isCtrlKeyPressed(e) && manager.selectionMode === 'multiple' && disallowSelectAll !== true) {
e.preventDefault();
manager.selectAll();
}
break;
case 'Escape':
if (!disallowEmptySelection && manager.selectedKeys.size !== 0) {
e.stopPropagation();
e.preventDefault();
manager.clearSelection();
}
break;
case 'Tab': {
if (!allowsTabNavigation) {
// There may be elements that are "tabbable" inside a collection (e.g. in a grid cell).
// However, collections should be treated as a single tab stop, with arrow key navigation internally.
// We don't control the rendering of these, so we can't override the tabIndex to prevent tabbing.
// Instead, we handle the Tab key, and move focus manually to the first/last tabbable element
// in the collection, so that the browser default behavior will apply starting from that element
// rather than the currently focused one.
if (e.shiftKey) {
ref.current.focus();
} else {
let walker = getFocusableTreeWalker(ref.current, {tabbable: true});
let next: FocusableElement | undefined = undefined;
let last: FocusableElement;
do {
last = walker.lastChild() as FocusableElement;
if (last) {
next = last;
}
} while (last);
if (next && !next.contains(document.activeElement)) {
focusWithoutScrolling(next);
}
}
break;
}
}
}
};
// Store the scroll position so we can restore it later.
/// TODO: should this happen all the time??
let scrollPos = useRef({top: 0, left: 0});
useEvent(scrollRef, 'scroll', isVirtualized ? undefined : () => {
scrollPos.current = {
top: scrollRef.current?.scrollTop ?? 0,
left: scrollRef.current?.scrollLeft ?? 0
};
});
let onFocus = (e: FocusEvent) => {
if (manager.isFocused) {
// If a focus event bubbled through a portal, reset focus state.
if (!e.currentTarget.contains(e.target)) {
manager.setFocused(false);
}
return;
}
// Focus events can bubble through portals. Ignore these events.
if (!e.currentTarget.contains(e.target)) {
return;
}
manager.setFocused(true);
if (manager.focusedKey == null) {
let navigateToFirstKey = (key: Key | undefined | null) => {
if (key != null) {
manager.setFocusedKey(key);
if (selectOnFocus) {
manager.replaceSelection(key);
}
}
};
// If the user hasn't yet interacted with the collection, there will be no focusedKey set.
// Attempt to detect whether the user is tabbing forward or backward into the collection
// and either focus the first or last item accordingly.
let relatedTarget = e.relatedTarget as Element;
if (relatedTarget && (e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING)) {
navigateToFirstKey(manager.lastSelectedKey ?? delegate.getLastKey?.());
} else {
navigateToFirstKey(manager.firstSelectedKey ?? delegate.getFirstKey?.());
}
} else if (!isVirtualized && scrollRef.current) {
// Restore the scroll position to what it was before.
scrollRef.current.scrollTop = scrollPos.current.top;
scrollRef.current.scrollLeft = scrollPos.current.left;
}
if (manager.focusedKey != null && scrollRef.current) {
// Refocus and scroll the focused item into view if it exists within the scrollable region.
let element = scrollRef.current.querySelector(`[data-key="${CSS.escape(manager.focusedKey.toString())}"]`) as HTMLElement;
if (element) {
// This prevents a flash of focus on the first/last element in the collection, or the collection itself.
if (!element.contains(document.activeElement)) {
focusWithoutScrolling(element);
}
let modality = getInteractionModality();
if (modality === 'keyboard') {
scrollIntoViewport(element, {containingElement: ref.current});
}
}
}
};
let onBlur = (e) => {
// Don't set blurred and then focused again if moving focus within the collection.
if (!e.currentTarget.contains(e.relatedTarget as HTMLElement)) {
manager.setFocused(false);
}
};
const autoFocusRef = useRef(autoFocus);
useEffect(() => {
if (autoFocusRef.current) {
let focusedKey: Key | null = null;
// Check focus strategy to determine which item to focus
if (autoFocus === 'first') {
focusedKey = delegate.getFirstKey?.() ?? null;
} if (autoFocus === 'last') {
focusedKey = delegate.getLastKey?.() ?? null;
}
// If there are any selected keys, make the first one the new focus target
let selectedKeys = manager.selectedKeys;
if (selectedKeys.size) {
for (let key of selectedKeys) {
if (manager.canSelectItem(key)) {
focusedKey = key;
break;
}
}
}
manager.setFocused(true);
manager.setFocusedKey(focusedKey);
// If no default focus key is selected, focus the collection itself.
if (focusedKey == null && !shouldUseVirtualFocus && ref.current) {
focusSafely(ref.current);
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
// Scroll the focused element into view when the focusedKey changes.
let lastFocusedKey = useRef(manager.focusedKey);
useEffect(() => {
if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || autoFocusRef.current) && scrollRef.current && ref.current) {
let modality = getInteractionModality();
let element = ref.current.querySelector(`[data-key="${CSS.escape(manager.focusedKey.toString())}"]`) as HTMLElement;
if (!element) {
// If item element wasn't found, return early (don't update autoFocusRef and lastFocusedKey).
// The collection may initially be empty (e.g. virtualizer), so wait until the element exists.
return;
}
if (modality === 'keyboard' || autoFocusRef.current) {
scrollIntoView(scrollRef.current, element);
// Avoid scroll in iOS VO, since it may cause overlay to close (i.e. RAC submenu)
if (modality !== 'virtual') {
scrollIntoViewport(element, {containingElement: ref.current});
}
}
}
// If the focused key becomes null (e.g. the last item is deleted), focus the whole collection.
if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null && ref.current) {
focusSafely(ref.current);
}
lastFocusedKey.current = manager.focusedKey;
autoFocusRef.current = false;
});
// Intercept FocusScope restoration since virtualized collections can reuse DOM nodes.
useEvent(ref, 'react-aria-focus-scope-restore', e => {
e.preventDefault();
manager.setFocused(true);
});
let handlers = {
onKeyDown,
onFocus,
onBlur,
onMouseDown(e) {
// Ignore events that bubbled through portals.
if (scrollRef.current === e.target) {
// Prevent focus going to the collection when clicking on the scrollbar.
e.preventDefault();
}
}
};
let {typeSelectProps} = useTypeSelect({
keyboardDelegate: delegate,
selectionManager: manager
});
if (!disallowTypeAhead) {
handlers = mergeProps(typeSelectProps, handlers);
}
// If nothing is focused within the collection, make the collection itself tabbable.
// This will be marshalled to either the first or last item depending on where focus came from.
// If using virtual focus, don't set a tabIndex at all so that VoiceOver on iOS 14 doesn't try
// to move real DOM focus to the element anyway.
let tabIndex: number | undefined = undefined;
if (!shouldUseVirtualFocus) {
tabIndex = manager.focusedKey == null ? 0 : -1;
}
return {
collectionProps: {
...handlers,
tabIndex
}
};
}
@@ -0,0 +1,8 @@
import {
getValidChildren,
pickChildren
} from "./chunk-WR7VNGRW.mjs";
export {
getValidChildren,
pickChildren
};
@@ -0,0 +1,23 @@
var LazyWrapper = require('./_LazyWrapper'),
copyArray = require('./_copyArray');
/**
* Creates a clone of the lazy wrapper object.
*
* @private
* @name clone
* @memberOf LazyWrapper
* @returns {Object} Returns the cloned `LazyWrapper` object.
*/
function lazyClone() {
var result = new LazyWrapper(this.__wrapped__);
result.__actions__ = copyArray(this.__actions__);
result.__dir__ = this.__dir__;
result.__filtered__ = this.__filtered__;
result.__iteratees__ = copyArray(this.__iteratees__);
result.__takeCount__ = this.__takeCount__;
result.__views__ = copyArray(this.__views__);
return result;
}
module.exports = lazyClone;
@@ -0,0 +1 @@
{"version":3,"sources":["name.js"],"names":["Object","defineProperty","exports","value","util_js_1","require","isQuoted","s","startsWith","endsWith","nameTokenizer","typeEnd","num","tokens","i","type","spec","source","reduce","description","trimLeft","quotedGroups","split","length","name","postName","splitSpace","slice","brackets","optional","defaultValue","ch","isSpace","problems","push","code","message","line","number","critical","nameToken","parts","trim","undefined","join","test","default"],"mappings":"AAAA;;AACAA,MAAM,CAACC,cAAP,CAAsBC,OAAtB,EAA+B,YAA/B,EAA6C;AAAEC,EAAAA,KAAK,EAAE;AAAT,CAA7C;;AACA,MAAMC,SAAS,GAAGC,OAAH,kBAAf;;AACA,MAAMC,QAAQ,GAAIC,CAAD,IAAOA,CAAC,IAAIA,CAAC,CAACC,UAAF,CAAa,GAAb,CAAL,IAA0BD,CAAC,CAACE,QAAF,CAAW,GAAX,CAAlD;AACA;AACA;AACA;AACA;;;AACA,SAASC,aAAT,GAAyB;AACrB,QAAMC,OAAO,GAAG,CAACC,GAAD,EAAM;AAAEC,IAAAA;AAAF,GAAN,EAAkBC,CAAlB,KAAwBD,MAAM,CAACE,IAAP,KAAgB,EAAhB,GAAqBH,GAArB,GAA2BE,CAAnE;;AACA,SAAQE,IAAD,IAAU;AACb;AACA,UAAM;AAAEH,MAAAA;AAAF,QAAaG,IAAI,CAACC,MAAL,CAAYD,IAAI,CAACC,MAAL,CAAYC,MAAZ,CAAmBP,OAAnB,EAA4B,CAA5B,CAAZ,CAAnB;AACA,UAAMM,MAAM,GAAGJ,MAAM,CAACM,WAAP,CAAmBC,QAAnB,EAAf;AACA,UAAMC,YAAY,GAAGJ,MAAM,CAACK,KAAP,CAAa,GAAb,CAArB,CAJa,CAKb;;AACA,QAAID,YAAY,CAACE,MAAb,GAAsB,CAAtB,IACAF,YAAY,CAAC,CAAD,CAAZ,KAAoB,EADpB,IAEAA,YAAY,CAACE,MAAb,GAAsB,CAAtB,KAA4B,CAFhC,EAEmC;AAC/BP,MAAAA,IAAI,CAACQ,IAAL,GAAYH,YAAY,CAAC,CAAD,CAAxB;AACAR,MAAAA,MAAM,CAACW,IAAP,GAAe,IAAGH,YAAY,CAAC,CAAD,CAAI,GAAlC;AACA,OAACR,MAAM,CAACY,QAAR,EAAkBZ,MAAM,CAACM,WAAzB,IAAwC,CAAC,GAAGf,SAAS,CAACsB,UAAd,EAA0BT,MAAM,CAACU,KAAP,CAAad,MAAM,CAACW,IAAP,CAAYD,MAAzB,CAA1B,CAAxC;AACA,aAAOP,IAAP;AACH;;AACD,QAAIY,QAAQ,GAAG,CAAf;AACA,QAAIJ,IAAI,GAAG,EAAX;AACA,QAAIK,QAAQ,GAAG,KAAf;AACA,QAAIC,YAAJ,CAjBa,CAkBb;;AACA,SAAK,MAAMC,EAAX,IAAiBd,MAAjB,EAAyB;AACrB,UAAIW,QAAQ,KAAK,CAAb,IAAkB,CAAC,GAAGxB,SAAS,CAAC4B,OAAd,EAAuBD,EAAvB,CAAtB,EACI;AACJ,UAAIA,EAAE,KAAK,GAAX,EACIH,QAAQ;AACZ,UAAIG,EAAE,KAAK,GAAX,EACIH,QAAQ;AACZJ,MAAAA,IAAI,IAAIO,EAAR;AACH;;AACD,QAAIH,QAAQ,KAAK,CAAjB,EAAoB;AAChBZ,MAAAA,IAAI,CAACiB,QAAL,CAAcC,IAAd,CAAmB;AACfC,QAAAA,IAAI,EAAE,6BADS;AAEfC,QAAAA,OAAO,EAAE,mBAFM;AAGfC,QAAAA,IAAI,EAAErB,IAAI,CAACC,MAAL,CAAY,CAAZ,EAAeqB,MAHN;AAIfC,QAAAA,QAAQ,EAAE;AAJK,OAAnB;AAMA,aAAOvB,IAAP;AACH;;AACD,UAAMwB,SAAS,GAAGhB,IAAlB;;AACA,QAAIA,IAAI,CAAC,CAAD,CAAJ,KAAY,GAAZ,IAAmBA,IAAI,CAACA,IAAI,CAACD,MAAL,GAAc,CAAf,CAAJ,KAA0B,GAAjD,EAAsD;AAClDM,MAAAA,QAAQ,GAAG,IAAX;AACAL,MAAAA,IAAI,GAAGA,IAAI,CAACG,KAAL,CAAW,CAAX,EAAc,CAAC,CAAf,CAAP;AACA,YAAMc,KAAK,GAAGjB,IAAI,CAACF,KAAL,CAAW,GAAX,CAAd;AACAE,MAAAA,IAAI,GAAGiB,KAAK,CAAC,CAAD,CAAL,CAASC,IAAT,EAAP;AACA,UAAID,KAAK,CAAC,CAAD,CAAL,KAAaE,SAAjB,EACIb,YAAY,GAAGW,KAAK,CAACd,KAAN,CAAY,CAAZ,EAAeiB,IAAf,CAAoB,GAApB,EAAyBF,IAAzB,EAAf;;AACJ,UAAIlB,IAAI,KAAK,EAAb,EAAiB;AACbR,QAAAA,IAAI,CAACiB,QAAL,CAAcC,IAAd,CAAmB;AACfC,UAAAA,IAAI,EAAE,sBADS;AAEfC,UAAAA,OAAO,EAAE,YAFM;AAGfC,UAAAA,IAAI,EAAErB,IAAI,CAACC,MAAL,CAAY,CAAZ,EAAeqB,MAHN;AAIfC,UAAAA,QAAQ,EAAE;AAJK,SAAnB;AAMA,eAAOvB,IAAP;AACH;;AACD,UAAIc,YAAY,KAAK,EAArB,EAAyB;AACrBd,QAAAA,IAAI,CAACiB,QAAL,CAAcC,IAAd,CAAmB;AACfC,UAAAA,IAAI,EAAE,yBADS;AAEfC,UAAAA,OAAO,EAAE,qBAFM;AAGfC,UAAAA,IAAI,EAAErB,IAAI,CAACC,MAAL,CAAY,CAAZ,EAAeqB,MAHN;AAIfC,UAAAA,QAAQ,EAAE;AAJK,SAAnB;AAMA,eAAOvB,IAAP;AACH,OAxBiD,CAyBlD;;;AACA,UAAI,CAACV,QAAQ,CAACwB,YAAD,CAAT,IAA2B,SAASe,IAAT,CAAcf,YAAd,CAA/B,EAA4D;AACxDd,QAAAA,IAAI,CAACiB,QAAL,CAAcC,IAAd,CAAmB;AACfC,UAAAA,IAAI,EAAE,2BADS;AAEfC,UAAAA,OAAO,EAAE,8BAFM;AAGfC,UAAAA,IAAI,EAAErB,IAAI,CAACC,MAAL,CAAY,CAAZ,EAAeqB,MAHN;AAIfC,UAAAA,QAAQ,EAAE;AAJK,SAAnB;AAMA,eAAOvB,IAAP;AACH;AACJ;;AACDA,IAAAA,IAAI,CAACa,QAAL,GAAgBA,QAAhB;AACAb,IAAAA,IAAI,CAACQ,IAAL,GAAYA,IAAZ;AACAX,IAAAA,MAAM,CAACW,IAAP,GAAcgB,SAAd;AACA,QAAIV,YAAY,KAAKa,SAArB,EACI3B,IAAI,CAAC8B,OAAL,GAAehB,YAAf;AACJ,KAACjB,MAAM,CAACY,QAAR,EAAkBZ,MAAM,CAACM,WAAzB,IAAwC,CAAC,GAAGf,SAAS,CAACsB,UAAd,EAA0BT,MAAM,CAACU,KAAP,CAAad,MAAM,CAACW,IAAP,CAAYD,MAAzB,CAA1B,CAAxC;AACA,WAAOP,IAAP;AACH,GAjFD;AAkFH;;AACDd,OAAO,CAAC4C,OAAR,GAAkBpC,aAAlB","sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_js_1 = require(\"../../util.js\");\nconst isQuoted = (s) => s && s.startsWith('\"') && s.endsWith('\"');\n/**\n * Splits remaining `spec.lines[].tokens.description` into `name` and `descriptions` tokens,\n * and populates the `spec.name`\n */\nfunction nameTokenizer() {\n const typeEnd = (num, { tokens }, i) => tokens.type === '' ? num : i;\n return (spec) => {\n // look for the name in the line where {type} ends\n const { tokens } = spec.source[spec.source.reduce(typeEnd, 0)];\n const source = tokens.description.trimLeft();\n const quotedGroups = source.split('\"');\n // if it starts with quoted group, assume it is a literal\n if (quotedGroups.length > 1 &&\n quotedGroups[0] === '' &&\n quotedGroups.length % 2 === 1) {\n spec.name = quotedGroups[1];\n tokens.name = `\"${quotedGroups[1]}\"`;\n [tokens.postName, tokens.description] = (0, uLine truncated
@@ -0,0 +1,425 @@
[
{
"runtime": "node",
"target": "11.0.0",
"lts": false,
"future": false,
"abi": "67"
},
{
"runtime": "node",
"target": "12.0.0",
"lts": [
"2019-10-21",
"2020-11-30"
],
"future": false,
"abi": "72"
},
{
"runtime": "node",
"target": "13.0.0",
"lts": false,
"future": false,
"abi": "79"
},
{
"runtime": "node",
"target": "14.0.0",
"lts": [
"2020-10-27",
"2021-10-19"
],
"future": false,
"abi": "83"
},
{
"runtime": "node",
"target": "15.0.0",
"lts": false,
"future": false,
"abi": "88"
},
{
"runtime": "node",
"target": "16.0.0",
"lts": [
"2021-10-26",
"2022-10-18"
],
"future": false,
"abi": "93"
},
{
"runtime": "node",
"target": "17.0.0",
"lts": false,
"future": false,
"abi": "102"
},
{
"runtime": "node",
"target": "18.0.0",
"lts": [
"2022-10-25",
"2023-10-18"
],
"future": false,
"abi": "108"
},
{
"runtime": "node",
"target": "19.0.0",
"lts": false,
"future": false,
"abi": "111"
},
{
"runtime": "node",
"target": "20.0.0",
"lts": [
"2023-10-24",
"2024-10-22"
],
"future": false,
"abi": "115"
},
{
"runtime": "node",
"target": "21.0.0",
"lts": false,
"future": false,
"abi": "120"
},
{
"runtime": "node",
"target": "22.0.0",
"lts": [
"2024-10-29",
"2025-10-21"
],
"future": false,
"abi": "127"
},
{
"runtime": "node",
"target": "23.0.0",
"lts": false,
"future": false,
"abi": "131"
},
{
"runtime": "node",
"target": "24.0.0",
"lts": [
"2025-10-28",
"2026-10-20"
],
"future": false,
"abi": "137"
},
{
"runtime": "node",
"target": "25.0.0",
"lts": false,
"future": false,
"abi": "141"
},
{
"runtime": "node",
"target": "26.0.0",
"lts": [
"2026-10-28",
"2027-10-20"
],
"future": true,
"abi": "142"
},
{
"abi": "70",
"future": false,
"lts": false,
"runtime": "electron",
"target": "5.0.0-beta.9"
},
{
"abi": "73",
"future": false,
"lts": false,
"runtime": "electron",
"target": "6.0.0-beta.1"
},
{
"abi": "75",
"future": false,
"lts": false,
"runtime": "electron",
"target": "7.0.0-beta.1"
},
{
"abi": "76",
"future": false,
"lts": false,
"runtime": "electron",
"target": "9.0.0-beta.1"
},
{
"abi": "76",
"future": false,
"lts": false,
"runtime": "electron",
"target": "8.0.0-beta.1"
},
{
"abi": "80",
"future": false,
"lts": false,
"runtime": "electron",
"target": "9.0.0-beta.2"
},
{
"abi": "82",
"future": false,
"lts": false,
"runtime": "electron",
"target": "11.0.0-beta.1"
},
{
"abi": "82",
"future": false,
"lts": false,
"runtime": "electron",
"target": "10.0.0-beta.1"
},
{
"abi": "85",
"future": false,
"lts": false,
"runtime": "electron",
"target": "11.0.0-beta.11"
},
{
"abi": "87",
"future": false,
"lts": false,
"runtime": "electron",
"target": "12.0.0-beta.1"
},
{
"abi": "89",
"future": false,
"lts": false,
"runtime": "electron",
"target": "15.0.0-alpha.1"
},
{
"abi": "89",
"future": false,
"lts": false,
"runtime": "electron",
"target": "14.0.0-beta.1"
},
{
"abi": "89",
"future": false,
"lts": false,
"runtime": "electron",
"target": "13.0.0-beta.2"
},
{
"abi": "97",
"future": false,
"lts": false,
"runtime": "electron",
"target": "14.0.2"
},
{
"abi": "98",
"future": false,
"lts": false,
"runtime": "electron",
"target": "15.0.0-beta.7"
},
{
"abi": "99",
"future": false,
"lts": false,
"runtime": "electron",
"target": "16.0.0-alpha.1"
},
{
"abi": "101",
"future": false,
"lts": false,
"runtime": "electron",
"target": "17.0.0-alpha.1"
},
{
"abi": "103",
"future": false,
"lts": false,
"runtime": "electron",
"target": "18.0.0-alpha.1"
},
{
"abi": "106",
"future": false,
"lts": false,
"runtime": "electron",
"target": "19.0.0-alpha.1"
},
{
"abi": "107",
"future": false,
"lts": false,
"runtime": "electron",
"target": "20.0.0-alpha.1"
},
{
"abi": "109",
"future": false,
"lts": false,
"runtime": "electron",
"target": "21.0.0-alpha.1"
},
{
"abi": "110",
"future": false,
"lts": false,
"runtime": "electron",
"target": "22.0.0-alpha.1"
},
{
"abi": "113",
"future": false,
"lts": false,
"runtime": "electron",
"target": "23.0.0-alpha.1"
},
{
"abi": "114",
"future": false,
"lts": false,
"runtime": "electron",
"target": "24.0.0-alpha.1"
},
{
"abi": "116",
"future": false,
"lts": false,
"runtime": "electron",
"target": "26.0.0-alpha.1"
},
{
"abi": "116",
"future": false,
"lts": false,
"runtime": "electron",
"target": "25.0.0-alpha.1"
},
{
"abi": "118",
"future": false,
"lts": false,
"runtime": "electron",
"target": "27.0.0-alpha.1"
},
{
"abi": "119",
"future": false,
"lts": false,
"runtime": "electron",
"target": "28.0.0-alpha.1"
},
{
"abi": "121",
"future": false,
"lts": false,
"runtime": "electron",
"target": "29.0.0-alpha.1"
},
{
"abi": "123",
"future": false,
"lts": false,
"runtime": "electron",
"target": "31.0.0-alpha.1"
},
{
"abi": "123",
"future": false,
"lts": false,
"runtime": "electron",
"target": "30.0.0-alpha.1"
},
{
"abi": "125",
"future": false,
"lts": false,
"runtime": "electron",
"target": "31.0.0-beta.7"
},
{
"abi": "128",
"future": false,
"lts": false,
"runtime": "electron",
"target": "32.0.0-alpha.1"
},
{
"abi": "130",
"future": false,
"lts": false,
"runtime": "electron",
"target": "33.0.0-alpha.1"
},
{
"abi": "132",
"future": false,
"lts": false,
"runtime": "electron",
"target": "34.0.0-alpha.1"
},
{
"abi": "133",
"future": false,
"lts": false,
"runtime": "electron",
"target": "35.0.0-alpha.1"
},
{
"abi": "135",
"future": false,
"lts": false,
"runtime": "electron",
"target": "36.0.0-alpha.1"
},
{
"abi": "136",
"future": false,
"lts": false,
"runtime": "electron",
"target": "37.0.0-alpha.1"
},
{
"abi": "139",
"future": false,
"lts": false,
"runtime": "electron",
"target": "38.0.0-alpha.1"
},
{
"abi": "140",
"future": false,
"lts": false,
"runtime": "electron",
"target": "39.0.0-alpha.1"
},
{
"abi": "143",
"future": true,
"lts": false,
"runtime": "electron",
"target": "40.0.0-alpha.2"
}
]
@@ -0,0 +1,126 @@
import type { ProjectServiceAndMetadata } from '@typescript-eslint/project-service';
import type * as ts from 'typescript';
import type { CanonicalPath } from '../create-program/shared';
import type { TSESTree } from '../ts-estree';
import type { CacheLike } from './ExpiringCache';
type DebugModule = 'eslint' | 'typescript' | 'typescript-eslint';
declare module 'typescript' {
enum JSDocParsingMode {
}
}
declare module 'typescript/lib/tsserverlibrary' {
enum JSDocParsingMode {
}
}
/**
* Internal settings used by the parser to run on a file.
*/
export interface MutableParseSettings {
/**
* Prevents the parser from throwing an error if it receives an invalid AST from TypeScript.
*/
allowInvalidAST: boolean;
/**
* Code of the file being parsed, or raw source file containing it.
*/
code: string | ts.SourceFile;
/**
* Full text of the file being parsed.
*/
codeFullText: string;
/**
* Whether the `comment` parse option is enabled.
*/
comment: boolean;
/**
* If the `comment` parse option is enabled, retrieved comments.
*/
comments: TSESTree.Comment[];
/**
* Which debug areas should be logged.
*/
debugLevel: Set<DebugModule>;
/**
* Whether to error if TypeScript reports a semantic or syntactic error diagnostic.
*/
errorOnTypeScriptSyntacticAndSemanticIssues: boolean;
/**
* Whether to error if an unknown AST node type is encountered.
*/
errorOnUnknownASTType: boolean;
/**
* Any non-standard file extensions which will be parsed.
*/
extraFileExtensions: string[];
/**
* Path of the file being parsed.
*/
filePath: string;
/**
* Sets the external module indicator on the source file.
* Used by Typescript to determine if a sourceFile is an external module.
*
* needed to always parsing `mjs`/`mts` files as ESM
*/
setExternalModuleIndicator?: (file: ts.SourceFile) => void;
/**
* JSDoc parsing style to pass through to TypeScript
*/
jsDocParsingMode: ts.JSDocParsingMode;
/**
* Whether parsing of JSX is enabled.
*
* @remarks The applicable file extension is still required.
*/
jsx: boolean;
/**
* Whether to add `loc` information to each node.
*/
loc: boolean;
/**
* Log function, if not `console.log`.
*/
log: (message: string) => void;
/**
* Whether two-way AST node maps are preserved during the AST conversion process.
*/
preserveNodeMaps?: boolean;
/**
* One or more instances of TypeScript Program objects to be used for type information.
*/
programs: Iterable<ts.Program> | null;
/**
* Normalized paths to provided project paths.
*/
projects: ReadonlyMap<CanonicalPath, string>;
/**
* TypeScript server to power program creation.
*/
projectService: ProjectServiceAndMetadata | undefined;
/**
* Whether to add the `range` property to AST nodes.
*/
range: boolean;
/**
* Whether this is part of a single run, rather than a long-running process.
*/
singleRun: boolean;
/**
* Whether deprecated AST properties should skip calling console.warn on accesses.
*/
suppressDeprecatedPropertyWarnings: boolean;
/**
* If the `tokens` parse option is enabled, retrieved tokens.
*/
tokens: TSESTree.Token[] | null;
/**
* Caches searches for TSConfigs from project directories.
*/
tsconfigMatchCache: CacheLike<string, string>;
/**
* The absolute path to the root directory for all provided `project`s.
*/
tsconfigRootDir: string;
}
export type ParseSettings = Readonly<MutableParseSettings>;
export {};
@@ -0,0 +1,7 @@
parser: typescript
printWidth: 80
tabWidth: 2
singleQuote: true
trailingComma: all
arrowParens: always
bracketSpacing: false
@@ -0,0 +1,6 @@
import type TokenProcessor from "../TokenProcessor";
import type { DeclarationInfo } from "./getDeclarationInfo";
/**
* Common method sharing code between CJS and ESM cases, since they're the same here.
*/
export default function shouldElideDefaultExport(isTypeScriptTransformEnabled: boolean, keepUnusedImports: boolean, tokens: TokenProcessor, declarationInfo: DeclarationInfo): boolean;
@@ -0,0 +1,33 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasChildren = exports.isDocument = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = void 0;
__exportStar(require("./stringify.js"), exports);
__exportStar(require("./traversal.js"), exports);
__exportStar(require("./manipulation.js"), exports);
__exportStar(require("./querying.js"), exports);
__exportStar(require("./legacy.js"), exports);
__exportStar(require("./helpers.js"), exports);
__exportStar(require("./feeds.js"), exports);
/** @deprecated Use these methods from `domhandler` directly. */
var domhandler_1 = require("domhandler");
Object.defineProperty(exports, "isTag", { enumerable: true, get: function () { return domhandler_1.isTag; } });
Object.defineProperty(exports, "isCDATA", { enumerable: true, get: function () { return domhandler_1.isCDATA; } });
Object.defineProperty(exports, "isText", { enumerable: true, get: function () { return domhandler_1.isText; } });
Object.defineProperty(exports, "isComment", { enumerable: true, get: function () { return domhandler_1.isComment; } });
Object.defineProperty(exports, "isDocument", { enumerable: true, get: function () { return domhandler_1.isDocument; } });
Object.defineProperty(exports, "hasChildren", { enumerable: true, get: function () { return domhandler_1.hasChildren; } });
//# sourceMappingURL=index.js.map
@@ -0,0 +1,57 @@
'use strict';
var utils = require('../utils.js');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
var oneVarDeclarationPerLine = utils.createRule({
name: "one-var-declaration-per-line",
package: "js",
meta: {
type: "layout",
docs: {
description: "Require or disallow newlines around variable declarations"
},
schema: [
{
type: "string",
enum: ["always", "initializations"]
}
],
fixable: "whitespace",
messages: {
expectVarOnNewline: "Expected variable declaration to be on a new line."
}
},
create(context) {
const always = context.options[0] === "always";
function isForTypeSpecifier(keyword) {
return keyword === "ForStatement" || keyword === "ForInStatement" || keyword === "ForOfStatement";
}
function checkForNewLine(node) {
if (isForTypeSpecifier(node.parent.type))
return;
const declarations = node.declarations;
let prev;
declarations.forEach((current) => {
if (prev && prev.loc.end.line === current.loc.start.line) {
if (always || prev.init || current.init) {
context.report({
node,
messageId: "expectVarOnNewline",
loc: current.loc,
fix: (fixer) => fixer.insertTextBefore(current, "\n")
});
}
}
prev = current;
});
}
return {
VariableDeclaration: checkForNewLine
};
}
});
module.exports = oneVarDeclarationPerLine;
@@ -0,0 +1 @@
{"name":"ms","version":"2.0.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532103323,"integrity":"sha512-4ymm9qON0zvWAzSo3sSpGqbn2rKPCJMkA3SuajA8EmRjmdghQD47gOtRMX0YCOar8wvZGwvZmVH5aBWiK6EFxw==","mode":420,"size":704},"index.js":{"checkedAt":1794532103324,"integrity":"sha512-TC8x8fKil6tsVaIdWKXCbK0iwe0ZE+ekhgURHSFyV64tnybqiJ6GEOARupucSHyR7NtM6jQ3U0+vkF6PuJuiSA==","mode":420,"size":2764},"license.md":{"checkedAt":1794532103324,"integrity":"sha512-K+we+03Fn6Q2w4obRbPb1Uo2hGC8u7PZeRtlJ1tdw8caTFS+RY9MdHYdzLiJfvqrRt9aQHcj2lxI89sC1VXVuQ==","mode":420,"size":1077},"readme.md":{"checkedAt":1794532103324,"integrity":"sha512-vJhgK7K2euT++siVzvIvPCWy52XZB0EhcA3FIzZf6yUrqBNoQnX3S3/8pKjL80toOEquGoS7dtCeVUE3QRcgBQ==","mode":420,"size":1721}}}
@@ -0,0 +1,104 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _index = require('../tokenizer/index');
var _types = require('../tokenizer/types');
var _charcodes = require('../util/charcodes');
var _base = require('./base');
// ## Parser utilities
// Tests whether parsed token is a contextual keyword.
function isContextual(contextualKeyword) {
return _base.state.contextualKeyword === contextualKeyword;
} exports.isContextual = isContextual;
function isLookaheadContextual(contextualKeyword) {
const l = _index.lookaheadTypeAndKeyword.call(void 0, );
return l.type === _types.TokenType.name && l.contextualKeyword === contextualKeyword;
} exports.isLookaheadContextual = isLookaheadContextual;
// Consumes contextual keyword if possible.
function eatContextual(contextualKeyword) {
return _base.state.contextualKeyword === contextualKeyword && _index.eat.call(void 0, _types.TokenType.name);
} exports.eatContextual = eatContextual;
// Asserts that following token is given contextual keyword.
function expectContextual(contextualKeyword) {
if (!eatContextual(contextualKeyword)) {
unexpected();
}
} exports.expectContextual = expectContextual;
// Test whether a semicolon can be inserted at the current position.
function canInsertSemicolon() {
return _index.match.call(void 0, _types.TokenType.eof) || _index.match.call(void 0, _types.TokenType.braceR) || hasPrecedingLineBreak();
} exports.canInsertSemicolon = canInsertSemicolon;
function hasPrecedingLineBreak() {
const prevToken = _base.state.tokens[_base.state.tokens.length - 1];
const lastTokEnd = prevToken ? prevToken.end : 0;
for (let i = lastTokEnd; i < _base.state.start; i++) {
const code = _base.input.charCodeAt(i);
if (
code === _charcodes.charCodes.lineFeed ||
code === _charcodes.charCodes.carriageReturn ||
code === 0x2028 ||
code === 0x2029
) {
return true;
}
}
return false;
} exports.hasPrecedingLineBreak = hasPrecedingLineBreak;
function hasFollowingLineBreak() {
const nextStart = _index.nextTokenStart.call(void 0, );
for (let i = _base.state.end; i < nextStart; i++) {
const code = _base.input.charCodeAt(i);
if (
code === _charcodes.charCodes.lineFeed ||
code === _charcodes.charCodes.carriageReturn ||
code === 0x2028 ||
code === 0x2029
) {
return true;
}
}
return false;
} exports.hasFollowingLineBreak = hasFollowingLineBreak;
function isLineTerminator() {
return _index.eat.call(void 0, _types.TokenType.semi) || canInsertSemicolon();
} exports.isLineTerminator = isLineTerminator;
// Consume a semicolon, or, failing that, see if we are allowed to
// pretend that there is a semicolon at this position.
function semicolon() {
if (!isLineTerminator()) {
unexpected('Unexpected token, expected ";"');
}
} exports.semicolon = semicolon;
// Expect a token of a given type. If found, consume it, otherwise,
// raise an unexpected token error at given pos.
function expect(type) {
const matched = _index.eat.call(void 0, type);
if (!matched) {
unexpected(`Unexpected token, expected "${_types.formatTokenType.call(void 0, type)}"`);
}
} exports.expect = expect;
/**
* Transition the parser to an error state. All code needs to be written to naturally unwind in this
* state, which allows us to backtrack without exceptions and without error plumbing everywhere.
*/
function unexpected(message = "Unexpected token", pos = _base.state.start) {
if (_base.state.error) {
return;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const err = new SyntaxError(message);
err.pos = pos;
_base.state.error = err;
_base.state.pos = _base.input.length;
_index.finishToken.call(void 0, _types.TokenType.eof);
} exports.unexpected = unexpected;
@@ -0,0 +1,18 @@
'use strict';
var define = require('define-properties');
var callBind = require('call-bind');
var implementation = require('./implementation');
var getPolyfill = require('./polyfill');
var shim = require('./shim');
var bound = callBind(getPolyfill());
define(bound, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = bound;
@@ -0,0 +1,32 @@
{
"name": "@formatjs/ecma402-abstract",
"description": "A collection of implementation for ECMAScript abstract operations",
"version": "2.3.6",
"license": "MIT",
"author": "Long Ho <holevietlong@gmail.com",
"sideEffects": false,
"types": "index.d.ts",
"dependencies": {
"decimal.js": "^10.4.3",
"tslib": "^2.8.0",
"@formatjs/intl-localematcher": "0.6.2",
"@formatjs/fast-memoize": "2.2.7"
},
"bugs": "https://github.com/formatjs/formatjs/issues",
"gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c",
"homepage": "https://github.com/formatjs/formatjs",
"keywords": [
"abstract",
"ecma262",
"ecma402",
"es",
"format",
"i18n",
"intl",
"javascript",
"relative"
],
"main": "index.js",
"module": "lib/index.js",
"repository": "git@github.com:formatjs/formatjs.git"
}
@@ -0,0 +1,83 @@
/*!
* negotiator
* Copyright(c) 2012 Federico Romero
* Copyright(c) 2012-2014 Isaac Z. Schlueter
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict';
var preferredCharsets = require('./lib/charset')
var preferredEncodings = require('./lib/encoding')
var preferredLanguages = require('./lib/language')
var preferredMediaTypes = require('./lib/mediaType')
/**
* Module exports.
* @public
*/
module.exports = Negotiator;
module.exports.Negotiator = Negotiator;
/**
* Create a Negotiator instance from a request.
* @param {object} request
* @public
*/
function Negotiator(request) {
if (!(this instanceof Negotiator)) {
return new Negotiator(request);
}
this.request = request;
}
Negotiator.prototype.charset = function charset(available) {
var set = this.charsets(available);
return set && set[0];
};
Negotiator.prototype.charsets = function charsets(available) {
return preferredCharsets(this.request.headers['accept-charset'], available);
};
Negotiator.prototype.encoding = function encoding(available, opts) {
var set = this.encodings(available, opts);
return set && set[0];
};
Negotiator.prototype.encodings = function encodings(available, options) {
var opts = options || {};
return preferredEncodings(this.request.headers['accept-encoding'], available, opts.preferred);
};
Negotiator.prototype.language = function language(available) {
var set = this.languages(available);
return set && set[0];
};
Negotiator.prototype.languages = function languages(available) {
return preferredLanguages(this.request.headers['accept-language'], available);
};
Negotiator.prototype.mediaType = function mediaType(available) {
var set = this.mediaTypes(available);
return set && set[0];
};
Negotiator.prototype.mediaTypes = function mediaTypes(available) {
return preferredMediaTypes(this.request.headers.accept, available);
};
// Backwards compatibility
Negotiator.prototype.preferredCharset = Negotiator.prototype.charset;
Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets;
Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding;
Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings;
Negotiator.prototype.preferredLanguage = Negotiator.prototype.language;
Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages;
Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType;
Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes;
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more