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,14 @@
import type { CloseEdgeType, ReachType, TouchStartType } from '../types';
/**
* 获取接触边缘类型
*/
export declare const getReachType: (initialTouchState: TouchStartType, horizontalCloseEdge: CloseEdgeType, verticalCloseEdge: CloseEdgeType, reachPosition: ReachType) => ReachType;
/**
* 计算接触边缘位置
* @param position - x/y
* @param scale
* @param size - width/height
* @param innerSize - innerWidth/innerHeight
* @return [CloseEdgeType, position]
*/
export declare const computePositionEdge: (position: number, scale: number, size: number, innerSize: number) => readonly [CloseEdgeType, number];
@@ -0,0 +1,40 @@
'use strict';
const path = require('path');
const yazl = require('yazl');
const TarStream = require('../tar/stream');
class ZipStream extends TarStream {
_init() {
const zipfile = this._zipfile = new yazl.ZipFile();
const stream = zipfile.outputStream;
stream.on('end', () => this.push(null));
stream.on('data', chunk => this.push(chunk));
stream.on('error', err => this.emit('error', err));
}
_addFileEntry(entry, opts) {
this._zipfile.addFile(entry, opts.relativePath || path.basename(entry), opts);
this._onEntryFinish();
}
_addBufferEntry(entry, opts) {
if (!opts.relativePath) return this.emit('error', new Error('opts.relativePath is required if entry is a buffer'));
this._zipfile.addBuffer(entry, opts.relativePath, opts);
this._onEntryFinish();
}
_addStreamEntry(entry, opts) {
if (!opts.relativePath) return this.emit('error', new Error('opts.relativePath is required if entry is a stream'));
entry.on('error', err => this.emit('error', err));
this._zipfile.addReadStream(entry, opts.relativePath, opts);
this._onEntryFinish();
}
_finalize() {
this._zipfile.end();
}
}
module.exports = ZipStream;
@@ -0,0 +1,8 @@
"use client";
import {
pagination_item_default
} from "./chunk-CNAEJLFQ.mjs";
import "./chunk-AQ7H3LB5.mjs";
export {
pagination_item_default as default
};
@@ -0,0 +1 @@
{"name":"typed-array-buffer","version":"1.0.3","requiresBuild":false,"files":{".eslintrc":{"checkedAt":1794532089190,"integrity":"sha512-GJfZ1ARR8/7NEtm1V1LQp0vyNlbIqwNxLAg+bEsnO/FYwdHzKClOXaAb6gvwFrtTRu6XWshDWVOSwCxb0fIguA==","mode":420,"size":144},".nycrc":{"checkedAt":1794532097484,"integrity":"sha512-42sgwWzusJB1Dzhl78jX/Zg65Oi0HDDMOGXS/Uklv1kCYn4fHtRsD/JFPwdu+d40vome9XdUspzRWEQAcTGEeQ==","mode":420,"size":216},"LICENSE":{"checkedAt":1794532097484,"integrity":"sha512-9CCWKHOyAcobQT+fPtmiq2F2+xkrIWD+4MQshpA5agEGKdLA+jCQ3LpOf7KqU2TmrzLa8AoocMeOs+/AxmpiBQ==","mode":420,"size":1071},"index.js":{"checkedAt":1794532097485,"integrity":"sha512-0zpIqY5uhaT0Hk4XpWT+W8Vnmd8Da/SwAfG6BQvIiPsqOEiRhsaj4bOCXp2cXTQ/d3ZjJAtM/r32pDkqKxrUAQ==","mode":420,"size":591},"test/index.js":{"checkedAt":1794532097485,"integrity":"sha512-wDzvmBrVWkdqWk8uf6ysZz2QetdqkUxuGu5kf7LKfmUrqr9dnNYzC/RBKqBtU3LwW/2mIM9YrHMtMraAtdkGnw==","mode":420,"size":728},"package.json":{"checkedAt":1794532097485,"integrity":"sha512-O8D/9UaWUDxGKgFv0H4bmaOzrv288D0HV1d4Tk1zv22XdqxSMflz3j09o4NKroGOWW5hLlKL74wI+bLy1J/VUg==","mode":420,"size":2277},"tsconfig.json":{"checkedAt":1794532097485,"integrity":"sha512-NbUb3qW9MICwZdeqct5d4Wxdg5xq+GcfgyXTW2n32l2aXVPFPDjM2890hHzAu/PQbh7KAUFaFUb/1VgXR7FDSg==","mode":420,"size":116},"CHANGELOG.md":{"checkedAt":1794532097485,"integrity":"sha512-zdcEqqrzxGdX15PXxZnIMXUfh9gNKInYIo05QIfXUuBbrdSNklsO8twTsCKLb/oP5N4ILOHWhl635P8ge2N8xg==","mode":420,"size":4283},"README.md":{"checkedAt":1794532097485,"integrity":"sha512-5T4s/BhQcfjnTzm2yex4iUinMWHx/lnLl1gbJeLd9/Gfa0AgzIJ4XF5I8eK66NysXvQx8Z/aZGsmAup5LK5FpQ==","mode":420,"size":1998},"index.d.ts":{"checkedAt":1794532097485,"integrity":"sha512-TDJkZsmQ+pB8rHftZmUOlj+eGTiYmrfmKSXkwO0h6HDirB3WGoEcUfXDAoazv1bNjr37YX1EOncPiH0B6JmzFg==","mode":420,"size":227},".github/FUNDING.yml":{"checkedAt":1794532097486,"integrity":"sha512-18+4oH8ksdRXspcs07DMakRsrspUflVNVa/3z40eE4llMXzVsFlxE/cw1rnotSUYFf1H+qCLnAYKzV6GnZbrIQ==","mode":420,"size":564}}}
@@ -0,0 +1,9 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from './types.js';
import 'react';
declare const WarningIcon: (props: IconSvgProps & {
className?: string;
}) => react_jsx_runtime.JSX.Element;
export { WarningIcon };
@@ -0,0 +1 @@
{"name":"simple-swizzle","version":"0.2.4","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532104366,"integrity":"sha512-u68++iV/k/zfPFfqR6qzI57plZJhKUc4uyXkFYkZYCE7Hq7+xI4vCnKoKSXTAPrHN8ldJk2ySsLvgTOcUBBr0Q==","mode":420,"size":1077},"index.js":{"checkedAt":1794532104366,"integrity":"sha512-IE4CDXdYvLUinEuO5gaIwMusV2QDW2azUVRQOJ1W223SBN4hGhyMIu65RmaKIiQrrysuGB9e0FkyQVhF/7QMUQ==","mode":420,"size":571},"package.json":{"checkedAt":1794532104366,"integrity":"sha512-aKer9d3IGwc2CTjkDwhu6gcoEK22Xde8i0kwLhBhXC4MnTDu4/vsW+H0/RVmbePQy4L1FBUB5nt1pjrccr1Mzg==","mode":420,"size":726},"README.md":{"checkedAt":1794532104366,"integrity":"sha512-x08zj4Vaeisc0/Kxe/9oxlvKV0CopMoAHy6zpap+z8NSLWh13NFt2s5wY8d7B7OZspdzpUWjmFA2IVBPPZwIXA==","mode":420,"size":1717}}}
@@ -0,0 +1,43 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("eslint-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Number.parseInt` method.",
category: "ES2015",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-number-parseint.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' method is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"() {
const tracker = new ReferenceTracker(context.getScope())
for (const { node, path } of tracker.iterateGlobalReferences({
Number: {
parseInt: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var treeitemRole = {
abstract: false,
accessibleNameRequired: true,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author', 'contents'],
prohibitedProps: [],
props: {
'aria-expanded': null,
'aria-haspopup': null
},
relatedConcepts: [],
requireContextRole: ['group', 'tree'],
requiredContextRole: ['group', 'tree'],
requiredOwnedElements: [],
requiredProps: {
'aria-selected': null
},
superClass: [['roletype', 'structure', 'section', 'listitem'], ['roletype', 'widget', 'input', 'option']]
};
var _default = exports.default = treeitemRole;
@@ -0,0 +1,152 @@
socks-proxy-agent
================
### A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS
[![Build Status](https://github.com/TooTallNate/node-socks-proxy-agent/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-socks-proxy-agent/actions?workflow=Node+CI)
This module provides an `http.Agent` implementation that connects to a
specified SOCKS proxy server, and can be used with the built-in `http`
and `https` modules.
It can also be used in conjunction with the `ws` module to establish a WebSocket
connection over a SOCKS proxy. See the "Examples" section below.
Installation
------------
Install with `npm`:
``` bash
npm install socks-proxy-agent
```
Examples
--------
#### TypeScript example
```ts
import https from 'https';
import { SocksProxyAgent } from 'socks-proxy-agent';
const info = {
hostname: 'br41.nordvpn.com',
userId: 'your-name@gmail.com',
password: 'abcdef12345124'
};
const agent = new SocksProxyAgent(info);
https.get('https://ipinfo.io', { agent }, (res) => {
console.log(res.headers);
res.pipe(process.stdout);
});
```
#### `http` module example
```js
var url = require('url');
var http = require('http');
var { SocksProxyAgent } = require('socks-proxy-agent');
// SOCKS proxy to connect to
var proxy = process.env.socks_proxy || 'socks://127.0.0.1:1080';
console.log('using proxy server %j', proxy);
// HTTP endpoint for the proxy to connect to
var endpoint = process.argv[2] || 'http://nodejs.org/api/';
console.log('attempting to GET %j', endpoint);
var opts = url.parse(endpoint);
// create an instance of the `SocksProxyAgent` class with the proxy server information
var agent = new SocksProxyAgent(proxy);
opts.agent = agent;
http.get(opts, function (res) {
console.log('"response" event!', res.headers);
res.pipe(process.stdout);
});
```
#### `https` module example
```js
var url = require('url');
var https = require('https');
var { SocksProxyAgent } = require('socks-proxy-agent');
// SOCKS proxy to connect to
var proxy = process.env.socks_proxy || 'socks://127.0.0.1:1080';
console.log('using proxy server %j', proxy);
// HTTP endpoint for the proxy to connect to
var endpoint = process.argv[2] || 'https://encrypted.google.com/';
console.log('attempting to GET %j', endpoint);
var opts = url.parse(endpoint);
// create an instance of the `SocksProxyAgent` class with the proxy server information
var agent = new SocksProxyAgent(proxy);
opts.agent = agent;
https.get(opts, function (res) {
console.log('"response" event!', res.headers);
res.pipe(process.stdout);
});
```
#### `ws` WebSocket connection example
``` js
var WebSocket = require('ws');
var { SocksProxyAgent } = require('socks-proxy-agent');
// SOCKS proxy to connect to
var proxy = process.env.socks_proxy || 'socks://127.0.0.1:1080';
console.log('using proxy server %j', proxy);
// WebSocket endpoint for the proxy to connect to
var endpoint = process.argv[2] || 'ws://echo.websocket.org';
console.log('attempting to connect to WebSocket %j', endpoint);
// create an instance of the `SocksProxyAgent` class with the proxy server information
var agent = new SocksProxyAgent(proxy);
// initiate the WebSocket connection
var socket = new WebSocket(endpoint, { agent: agent });
socket.on('open', function () {
console.log('"open" event!');
socket.send('hello world');
});
socket.on('message', function (data, flags) {
console.log('"message" event! %j %j', data, flags);
socket.close();
});
```
License
-------
(The MIT License)
Copyright (c) 2013 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,19 @@
import {useControlledState as $458b0a5536c1a7cf$export$40bfa8c7b0832715} from "./useControlledState.module.js";
import {clamp as $9446cca9a3875146$export$7d15b64cf5a3a4c4, snapValueToStep as $9446cca9a3875146$export$cb6e0bb50bc19463, toFixedNumber as $9446cca9a3875146$export$b6268554fba451f} from "./number.module.js";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
export {$458b0a5536c1a7cf$export$40bfa8c7b0832715 as useControlledState, $9446cca9a3875146$export$7d15b64cf5a3a4c4 as clamp, $9446cca9a3875146$export$cb6e0bb50bc19463 as snapValueToStep, $9446cca9a3875146$export$b6268554fba451f as toFixedNumber};
//# sourceMappingURL=module.js.map
@@ -0,0 +1,46 @@
{
"name": "@react-stately/table",
"version": "3.15.1",
"description": "Spectrum UI components in React",
"license": "Apache-2.0",
"main": "dist/main.js",
"module": "dist/module.js",
"exports": {
"source": "./src/index.ts",
"types": [
"./dist/types.d.ts",
"./src/index.ts"
],
"import": "./dist/import.mjs",
"require": "./dist/main.js"
},
"types": "dist/types.d.ts",
"source": "src/index.ts",
"files": [
"dist",
"src"
],
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/adobe/react-spectrum"
},
"dependencies": {
"@react-stately/collections": "^3.12.8",
"@react-stately/flags": "^3.1.2",
"@react-stately/grid": "^3.11.6",
"@react-stately/selection": "^3.20.6",
"@react-stately/utils": "^3.10.8",
"@react-types/grid": "^3.3.6",
"@react-types/shared": "^3.32.1",
"@react-types/table": "^3.13.4",
"@swc/helpers": "^0.5.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
},
"publishConfig": {
"access": "public"
},
"gitHead": "0bda51183baa23306342af32a82012ea0fe0f2dc"
}
@@ -0,0 +1,583 @@
## Maybe Types
The `Nan::MaybeLocal` and `Nan::Maybe` types are monads that encapsulate `v8::Local` handles that _may be empty_.
* **Maybe Types**
- <a href="#api_nan_maybe_local"><b><code>Nan::MaybeLocal</code></b></a>
- <a href="#api_nan_maybe"><b><code>Nan::Maybe</code></b></a>
- <a href="#api_nan_nothing"><b><code>Nan::Nothing</code></b></a>
- <a href="#api_nan_just"><b><code>Nan::Just</code></b></a>
* **Maybe Helpers**
- <a href="#api_nan_call"><b><code>Nan::Call()</code></b></a>
- <a href="#api_nan_to_detail_string"><b><code>Nan::ToDetailString()</code></b></a>
- <a href="#api_nan_to_array_index"><b><code>Nan::ToArrayIndex()</code></b></a>
- <a href="#api_nan_equals"><b><code>Nan::Equals()</code></b></a>
- <a href="#api_nan_new_instance"><b><code>Nan::NewInstance()</code></b></a>
- <a href="#api_nan_get_function"><b><code>Nan::GetFunction()</code></b></a>
- <a href="#api_nan_set"><b><code>Nan::Set()</code></b></a>
- <a href="#api_nan_define_own_property"><b><code>Nan::DefineOwnProperty()</code></b></a>
- <a href="#api_nan_force_set"><del><b><code>Nan::ForceSet()</code></b></del></a>
- <a href="#api_nan_get"><b><code>Nan::Get()</code></b></a>
- <a href="#api_nan_get_property_attribute"><b><code>Nan::GetPropertyAttributes()</code></b></a>
- <a href="#api_nan_has"><b><code>Nan::Has()</code></b></a>
- <a href="#api_nan_delete"><b><code>Nan::Delete()</code></b></a>
- <a href="#api_nan_get_property_names"><b><code>Nan::GetPropertyNames()</code></b></a>
- <a href="#api_nan_get_own_property_names"><b><code>Nan::GetOwnPropertyNames()</code></b></a>
- <a href="#api_nan_set_prototype"><b><code>Nan::SetPrototype()</code></b></a>
- <a href="#api_nan_object_proto_to_string"><b><code>Nan::ObjectProtoToString()</code></b></a>
- <a href="#api_nan_has_own_property"><b><code>Nan::HasOwnProperty()</code></b></a>
- <a href="#api_nan_has_real_named_property"><b><code>Nan::HasRealNamedProperty()</code></b></a>
- <a href="#api_nan_has_real_indexed_property"><b><code>Nan::HasRealIndexedProperty()</code></b></a>
- <a href="#api_nan_has_real_named_callback_property"><b><code>Nan::HasRealNamedCallbackProperty()</code></b></a>
- <a href="#api_nan_get_real_named_property_in_prototype_chain"><b><code>Nan::GetRealNamedPropertyInPrototypeChain()</code></b></a>
- <a href="#api_nan_get_real_named_property"><b><code>Nan::GetRealNamedProperty()</code></b></a>
- <a href="#api_nan_call_as_function"><b><code>Nan::CallAsFunction()</code></b></a>
- <a href="#api_nan_call_as_constructor"><b><code>Nan::CallAsConstructor()</code></b></a>
- <a href="#api_nan_get_source_line"><b><code>Nan::GetSourceLine()</code></b></a>
- <a href="#api_nan_get_line_number"><b><code>Nan::GetLineNumber()</code></b></a>
- <a href="#api_nan_get_start_column"><b><code>Nan::GetStartColumn()</code></b></a>
- <a href="#api_nan_get_end_column"><b><code>Nan::GetEndColumn()</code></b></a>
- <a href="#api_nan_clone_element_at"><b><code>Nan::CloneElementAt()</code></b></a>
- <a href="#api_nan_has_private"><b><code>Nan::HasPrivate()</code></b></a>
- <a href="#api_nan_get_private"><b><code>Nan::GetPrivate()</code></b></a>
- <a href="#api_nan_set_private"><b><code>Nan::SetPrivate()</code></b></a>
- <a href="#api_nan_delete_private"><b><code>Nan::DeletePrivate()</code></b></a>
- <a href="#api_nan_make_maybe"><b><code>Nan::MakeMaybe()</code></b></a>
<a name="api_nan_maybe_local"></a>
### Nan::MaybeLocal
A `Nan::MaybeLocal<T>` is a wrapper around [`v8::Local<T>`](https://v8docs.nodesource.com/node-8.16/de/deb/classv8_1_1_local.html) that enforces a check that determines whether the `v8::Local<T>` is empty before it can be used.
If an API method returns a `Nan::MaybeLocal`, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a `v8::TerminateExecution` exception was thrown. In that case, an empty `Nan::MaybeLocal` is returned.
Definition:
```c++
template<typename T> class Nan::MaybeLocal {
public:
MaybeLocal();
template<typename S> MaybeLocal(v8::Local<S> that);
bool IsEmpty() const;
template<typename S> bool ToLocal(v8::Local<S> *out);
// Will crash if the MaybeLocal<> is empty.
v8::Local<T> ToLocalChecked();
template<typename S> v8::Local<S> FromMaybe(v8::Local<S> default_value) const;
};
```
See the documentation for [`v8::MaybeLocal`](https://v8docs.nodesource.com/node-8.16/d8/d7d/classv8_1_1_maybe_local.html) for further details.
<a name="api_nan_maybe"></a>
### Nan::Maybe
A simple `Nan::Maybe` type, representing an object which may or may not have a value, see https://hackage.haskell.org/package/base/docs/Data-Maybe.html.
If an API method returns a `Nan::Maybe<>`, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a `v8::TerminateExecution` exception was thrown. In that case, a "Nothing" value is returned.
Definition:
```c++
template<typename T> class Nan::Maybe {
public:
bool IsNothing() const;
bool IsJust() const;
// Will crash if the Maybe<> is nothing.
T FromJust();
T FromMaybe(const T& default_value);
bool operator==(const Maybe &other);
bool operator!=(const Maybe &other);
};
```
See the documentation for [`v8::Maybe`](https://v8docs.nodesource.com/node-8.16/d9/d4b/classv8_1_1_maybe.html) for further details.
<a name="api_nan_nothing"></a>
### Nan::Nothing
Construct an empty `Nan::Maybe` type representing _nothing_.
```c++
template<typename T> Nan::Maybe<T> Nan::Nothing();
```
<a name="api_nan_just"></a>
### Nan::Just
Construct a `Nan::Maybe` type representing _just_ a value.
```c++
template<typename T> Nan::Maybe<T> Nan::Just(const T &t);
```
<a name="api_nan_call"></a>
### Nan::Call()
A helper method for calling a synchronous [`v8::Function#Call()`](https://v8docs.nodesource.com/node-8.16/d5/d54/classv8_1_1_function.html#a9c3d0e4e13ddd7721fce238aa5b94a11) in a way compatible across supported versions of V8.
For asynchronous callbacks, use Nan::Callback::Call along with an AsyncResource.
Signature:
```c++
Nan::MaybeLocal<v8::Value> Nan::Call(v8::Local<v8::Function> fun, v8::Local<v8::Object> recv, int argc, v8::Local<v8::Value> argv[]);
Nan::MaybeLocal<v8::Value> Nan::Call(const Nan::Callback& callback, v8::Local<v8::Object> recv,
int argc, v8::Local<v8::Value> argv[]);
Nan::MaybeLocal<v8::Value> Nan::Call(const Nan::Callback& callback, int argc, v8::Local<v8::Value> argv[]);
```
<a name="api_nan_to_detail_string"></a>
### Nan::ToDetailString()
A helper method for calling [`v8::Value#ToDetailString()`](https://v8docs.nodesource.com/node-8.16/dc/d0a/classv8_1_1_value.html#a2f9770296dc2c8d274bc8cc0dca243e5) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::MaybeLocal<v8::String> Nan::ToDetailString(v8::Local<v8::Value> val);
```
<a name="api_nan_to_array_index"></a>
### Nan::ToArrayIndex()
A helper method for calling [`v8::Value#ToArrayIndex()`](https://v8docs.nodesource.com/node-8.16/dc/d0a/classv8_1_1_value.html#acc5bbef3c805ec458470c0fcd6f13493) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::MaybeLocal<v8::Uint32> Nan::ToArrayIndex(v8::Local<v8::Value> val);
```
<a name="api_nan_equals"></a>
### Nan::Equals()
A helper method for calling [`v8::Value#Equals()`](https://v8docs.nodesource.com/node-8.16/dc/d0a/classv8_1_1_value.html#a08fba1d776a59bbf6864b25f9152c64b) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<bool> Nan::Equals(v8::Local<v8::Value> a, v8::Local<v8::Value>(b));
```
<a name="api_nan_new_instance"></a>
### Nan::NewInstance()
A helper method for calling [`v8::Function#NewInstance()`](https://v8docs.nodesource.com/node-8.16/d5/d54/classv8_1_1_function.html#ae477558b10c14b76ed00e8dbab44ce5b) and [`v8::ObjectTemplate#NewInstance()`](https://v8docs.nodesource.com/node-8.16/db/d5f/classv8_1_1_object_template.html#ad605a7543cfbc5dab54cdb0883d14ae4) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::MaybeLocal<v8::Object> Nan::NewInstance(v8::Local<v8::Function> h);
Nan::MaybeLocal<v8::Object> Nan::NewInstance(v8::Local<v8::Function> h, int argc, v8::Local<v8::Value> argv[]);
Nan::MaybeLocal<v8::Object> Nan::NewInstance(v8::Local<v8::ObjectTemplate> h);
```
<a name="api_nan_get_function"></a>
### Nan::GetFunction()
A helper method for calling [`v8::FunctionTemplate#GetFunction()`](https://v8docs.nodesource.com/node-8.16/d8/d83/classv8_1_1_function_template.html#a56d904662a86eca78da37d9bb0ed3705) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::MaybeLocal<v8::Function> Nan::GetFunction(v8::Local<v8::FunctionTemplate> t);
```
<a name="api_nan_set"></a>
### Nan::Set()
A helper method for calling [`v8::Object#Set()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a67604ea3734f170c66026064ea808f20) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<bool> Nan::Set(v8::Local<v8::Object> obj,
v8::Local<v8::Value> key,
v8::Local<v8::Value> value)
Nan::Maybe<bool> Nan::Set(v8::Local<v8::Object> obj,
uint32_t index,
v8::Local<v8::Value> value);
```
<a name="api_nan_define_own_property"></a>
### Nan::DefineOwnProperty()
A helper method for calling [`v8::Object#DefineOwnProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a6f76b2ed605cb8f9185b92de0033a820) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<bool> Nan::DefineOwnProperty(v8::Local<v8::Object> obj,
v8::Local<v8::String> key,
v8::Local<v8::Value> value,
v8::PropertyAttribute attribs = v8::None);
```
<a name="api_nan_force_set"></a>
### <del>Nan::ForceSet()</del>
Deprecated, use <a href="#api_nan_define_own_property"><code>Nan::DefineOwnProperty()</code></a>.
<del>A helper method for calling [`v8::Object#ForceSet()`](https://v8docs.nodesource.com/node-0.12/db/d85/classv8_1_1_object.html#acfbdfd7427b516ebdb5c47c4df5ed96c) in a way compatible across supported versions of V8.</del>
Signature:
```c++
NAN_DEPRECATED Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object> obj,
v8::Local<v8::Value> key,
v8::Local<v8::Value> value,
v8::PropertyAttribute attribs = v8::None);
```
<a name="api_nan_get"></a>
### Nan::Get()
A helper method for calling [`v8::Object#Get()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a2565f03e736694f6b1e1cf22a0b4eac2) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::MaybeLocal<v8::Value> Nan::Get(v8::Local<v8::Object> obj,
v8::Local<v8::Value> key);
Nan::MaybeLocal<v8::Value> Nan::Get(v8::Local<v8::Object> obj, uint32_t index);
```
<a name="api_nan_get_property_attribute"></a>
### Nan::GetPropertyAttributes()
A helper method for calling [`v8::Object#GetPropertyAttributes()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a9b898894da3d1db2714fd9325a54fe57) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<v8::PropertyAttribute> Nan::GetPropertyAttributes(
v8::Local<v8::Object> obj,
v8::Local<v8::Value> key);
```
<a name="api_nan_has"></a>
### Nan::Has()
A helper method for calling [`v8::Object#Has()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ab3c3d89ea7c2f9afd08965bd7299a41d) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<bool> Nan::Has(v8::Local<v8::Object> obj, v8::Local<v8::String> key);
Nan::Maybe<bool> Nan::Has(v8::Local<v8::Object> obj, uint32_t index);
```
<a name="api_nan_delete"></a>
### Nan::Delete()
A helper method for calling [`v8::Object#Delete()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a48e4a19b2cedff867eecc73ddb7d377f) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<bool> Nan::Delete(v8::Local<v8::Object> obj,
v8::Local<v8::String> key);
Nan::Maybe<bool> Nan::Delete(v8::Local<v8::Object> obj, uint32_t index);
```
<a name="api_nan_get_property_names"></a>
### Nan::GetPropertyNames()
A helper method for calling [`v8::Object#GetPropertyNames()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#aced885270cfd2c956367b5eedc7fbfe8) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::MaybeLocal<v8::Array> Nan::GetPropertyNames(v8::Local<v8::Object> obj);
```
<a name="api_nan_get_own_property_names"></a>
### Nan::GetOwnPropertyNames()
A helper method for calling [`v8::Object#GetOwnPropertyNames()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a79a6e4d66049b9aa648ed4dfdb23e6eb) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::MaybeLocal<v8::Array> Nan::GetOwnPropertyNames(v8::Local<v8::Object> obj);
```
<a name="api_nan_set_prototype"></a>
### Nan::SetPrototype()
A helper method for calling [`v8::Object#SetPrototype()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a442706b22fceda6e6d1f632122a9a9f4) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<bool> Nan::SetPrototype(v8::Local<v8::Object> obj,
v8::Local<v8::Value> prototype);
```
<a name="api_nan_object_proto_to_string"></a>
### Nan::ObjectProtoToString()
A helper method for calling [`v8::Object#ObjectProtoToString()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ab7a92b4dcf822bef72f6c0ac6fea1f0b) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::MaybeLocal<v8::String> Nan::ObjectProtoToString(v8::Local<v8::Object> obj);
```
<a name="api_nan_has_own_property"></a>
### Nan::HasOwnProperty()
A helper method for calling [`v8::Object#HasOwnProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ab7b7245442ca6de1e1c145ea3fd653ff) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<bool> Nan::HasOwnProperty(v8::Local<v8::Object> obj,
v8::Local<v8::String> key);
```
<a name="api_nan_has_real_named_property"></a>
### Nan::HasRealNamedProperty()
A helper method for calling [`v8::Object#HasRealNamedProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ad8b80a59c9eb3c1e6c3cd6c84571f767) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<bool> Nan::HasRealNamedProperty(v8::Local<v8::Object> obj,
v8::Local<v8::String> key);
```
<a name="api_nan_has_real_indexed_property"></a>
### Nan::HasRealIndexedProperty()
A helper method for calling [`v8::Object#HasRealIndexedProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#af94fc1135a5e74a2193fb72c3a1b9855) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<bool> Nan::HasRealIndexedProperty(v8::Local<v8::Object> obj,
uint32_t index);
```
<a name="api_nan_has_real_named_callback_property"></a>
### Nan::HasRealNamedCallbackProperty()
A helper method for calling [`v8::Object#HasRealNamedCallbackProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#af743b7ea132b89f84d34d164d0668811) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<bool> Nan::HasRealNamedCallbackProperty(
v8::Local<v8::Object> obj,
v8::Local<v8::String> key);
```
<a name="api_nan_get_real_named_property_in_prototype_chain"></a>
### Nan::GetRealNamedPropertyInPrototypeChain()
A helper method for calling [`v8::Object#GetRealNamedPropertyInPrototypeChain()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a8700b1862e6b4783716964ba4d5e6172) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::MaybeLocal<v8::Value> Nan::GetRealNamedPropertyInPrototypeChain(
v8::Local<v8::Object> obj,
v8::Local<v8::String> key);
```
<a name="api_nan_get_real_named_property"></a>
### Nan::GetRealNamedProperty()
A helper method for calling [`v8::Object#GetRealNamedProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a84471a824576a5994fdd0ffcbf99ccc0) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::MaybeLocal<v8::Value> Nan::GetRealNamedProperty(v8::Local<v8::Object> obj,
v8::Local<v8::String> key);
```
<a name="api_nan_call_as_function"></a>
### Nan::CallAsFunction()
A helper method for calling [`v8::Object#CallAsFunction()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ad3ffc36f3dfc3592ce2a96bc047ee2cd) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::MaybeLocal<v8::Value> Nan::CallAsFunction(v8::Local<v8::Object> obj,
v8::Local<v8::Object> recv,
int argc,
v8::Local<v8::Value> argv[]);
```
<a name="api_nan_call_as_constructor"></a>
### Nan::CallAsConstructor()
A helper method for calling [`v8::Object#CallAsConstructor()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a50d571de50d0b0dfb28795619d07a01b) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::MaybeLocal<v8::Value> Nan::CallAsConstructor(v8::Local<v8::Object> obj,
int argc,
v8::Local<v8::Value> argv[]);
```
<a name="api_nan_get_source_line"></a>
### Nan::GetSourceLine()
A helper method for calling [`v8::Message#GetSourceLine()`](https://v8docs.nodesource.com/node-8.16/d9/d28/classv8_1_1_message.html#a849f7a6c41549d83d8159825efccd23a) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::MaybeLocal<v8::String> Nan::GetSourceLine(v8::Local<v8::Message> msg);
```
<a name="api_nan_get_line_number"></a>
### Nan::GetLineNumber()
A helper method for calling [`v8::Message#GetLineNumber()`](https://v8docs.nodesource.com/node-8.16/d9/d28/classv8_1_1_message.html#adbe46c10a88a6565f2732a2d2adf99b9) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<int> Nan::GetLineNumber(v8::Local<v8::Message> msg);
```
<a name="api_nan_get_start_column"></a>
### Nan::GetStartColumn()
A helper method for calling [`v8::Message#GetStartColumn()`](https://v8docs.nodesource.com/node-8.16/d9/d28/classv8_1_1_message.html#a60ede616ba3822d712e44c7a74487ba6) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<int> Nan::GetStartColumn(v8::Local<v8::Message> msg);
```
<a name="api_nan_get_end_column"></a>
### Nan::GetEndColumn()
A helper method for calling [`v8::Message#GetEndColumn()`](https://v8docs.nodesource.com/node-8.16/d9/d28/classv8_1_1_message.html#aaa004cf19e529da980bc19fcb76d93be) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<int> Nan::GetEndColumn(v8::Local<v8::Message> msg);
```
<a name="api_nan_clone_element_at"></a>
### Nan::CloneElementAt()
A helper method for calling [`v8::Array#CloneElementAt()`](https://v8docs.nodesource.com/node-4.8/d3/d32/classv8_1_1_array.html#a1d3a878d4c1c7cae974dd50a1639245e) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::MaybeLocal<v8::Object> Nan::CloneElementAt(v8::Local<v8::Array> array, uint32_t index);
```
<a name="api_nan_has_private"></a>
### Nan::HasPrivate()
A helper method for calling [`v8::Object#HasPrivate()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#af68a0b98066cfdeb8f943e98a40ba08d) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<bool> Nan::HasPrivate(v8::Local<v8::Object> object, v8::Local<v8::String> key);
```
<a name="api_nan_get_private"></a>
### Nan::GetPrivate()
A helper method for calling [`v8::Object#GetPrivate()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a169f2da506acbec34deadd9149a1925a) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::MaybeLocal<v8::Value> Nan::GetPrivate(v8::Local<v8::Object> object, v8::Local<v8::String> key);
```
<a name="api_nan_set_private"></a>
### Nan::SetPrivate()
A helper method for calling [`v8::Object#SetPrivate()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ace1769b0f3b86bfe9fda1010916360ee) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<bool> Nan::SetPrivate(v8::Local<v8::Object> object, v8::Local<v8::String> key, v8::Local<v8::Value> value);
```
<a name="api_nan_delete_private"></a>
### Nan::DeletePrivate()
A helper method for calling [`v8::Object#DeletePrivate()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a138bb32a304f3982be02ad499693b8fd) in a way compatible across supported versions of V8.
Signature:
```c++
Nan::Maybe<bool> Nan::DeletePrivate(v8::Local<v8::Object> object, v8::Local<v8::String> key);
```
<a name="api_nan_make_maybe"></a>
### Nan::MakeMaybe()
Wraps a `v8::Local<>` in a `Nan::MaybeLocal<>`. When called with a `Nan::MaybeLocal<>` it just returns its argument. This is useful in generic template code that builds on NAN.
Synopsis:
```c++
MaybeLocal<v8::Number> someNumber = MakeMaybe(New<v8::Number>(3.141592654));
MaybeLocal<v8::String> someString = MakeMaybe(New<v8::String>("probably"));
```
Signature:
```c++
template <typename T, template <typename> class MaybeMaybe>
Nan::MaybeLocal<T> Nan::MakeMaybe(MaybeMaybe<T> v);
```
@@ -0,0 +1,30 @@
import type { Rule } from 'eslint';
import type ModuleCache from './ModuleCache';
import type { ESLintSettings } from './types';
export type ResultNotFound = { found: false, path?: undefined };
export type ResultFound = { found: true, path: string | null };
export type ResolvedResult = ResultNotFound | ResultFound;
export type ResolverResolve = (modulePath: string, sourceFile:string, config: unknown) => ResolvedResult;
export type ResolverResolveImport = (modulePath: string, sourceFile:string, config: unknown) => string | undefined;
export type Resolver = { interfaceVersion?: 1 | 2, resolve: ResolverResolve, resolveImport: ResolverResolveImport };
declare function resolve(
p: string,
context: Rule.RuleContext,
): ResolvedResult['path'];
export default resolve;
declare function fileExistsWithCaseSync(
filepath: string | null,
cacheSettings: ESLintSettings,
strict: boolean
): boolean | ReturnType<typeof ModuleCache.prototype.get>;
declare function relative(modulePath: string, sourceFile: string, settings: ESLintSettings): ResolvedResult['path'];
export { fileExistsWithCaseSync, relative };
@@ -0,0 +1 @@
{"version":3,"file":"cloneBindingCache.js","sourceRoot":"","sources":["../../../../src/binding/calculations/cloneBindingCache.ts"],"names":[],"mappings":";;AAIA,8CAYC;AAZD,SAAgB,iBAAiB,CAC/B,KAA8C;IAE9C,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO;YACL,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB,CAAC;IACJ,CAAC;IAED,4CAA4C;IAC5C,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1 @@
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAWM,MAAM;IAkHX,CAAC,CAAC,OAAO,QAAQ,CAAC,GAAkC;QAClD,OAAO;eAAI,IAAI,CAAC,IAAI;SAAC;IACvB;IAEA,IAAI,OAAe;QACjB,OAAO;eAAI,IAAI,CAAC,IAAI;SAAC,CAAC,MAAM;IAC9B;IAEA,UAAiC;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI;IACzB;IAEA,aAAa,GAAQ,EAAc;QACjC,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;YACb;QAAd,OAAO,OAAO,CAAA,gBAAA,KAAK,OAAO,cAAZ,2BAAA,gBAAgB,OAAO;IACvC;IAEA,YAAY,GAAQ,EAAc;QAChC,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;YACb;QAAd,OAAO,OAAO,CAAA,gBAAA,KAAK,OAAO,cAAZ,2BAAA,gBAAgB,OAAO;IACvC;IAEA,cAA0B;YACjB;QAAP,QAAO,IAAA;eAAI,IAAI,CAAC,IAAI;SAAC,CAAC,EAAE,cAAjB,wBAAA,EAAmB,GAAG;IAC/B;IAEA,aAAyB;YAEhB;QADP,IAAI,OAAO;eAAI,IAAI,CAAC,IAAI;SAAC;QACzB,QAAO,SAAA,IAAI,CAAC,KAAK,MAAM,GAAG,EAAE,cAArB,6BAAA,OAAuB,GAAG;IACnC;IAEA,QAAQ,GAAQ,EAAsB;YAC7B;QAAP,OAAO,CAAA,mBAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,kBAAhB,8BAAA,mBAAwB;IACjC;IAEA,GAAG,GAAW,EAAsB;QAClC,MAAM,OAAO;eAAI,IAAI,CAAC,OAAO;SAAG;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;IAC/B;IAEA,YAAY,GAAQ,EAAyB;QAC3C,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;QAC3B,OAAO,CAAA,iBAAA,2BAAA,KAAM,UAAU,KAAI,EAAE;IAC/B;IAxJA,YAAY,IAA8B,CAAE;aAJ5C,SAAgC,IAAI;QAKlC,IAAI,CAAC,MAAM,GAAG,IAAI;QAClB,IAAI,CAAC,WAAW,GAAG,iBAAA,2BAAA,KAAM,WAAW;QACpC,IAAI,CAAC,IAAI,GAAG,EAAE;QAEd,IAAI,QAAQ,CAAC;YACX,wEAAwE;YACxE,0EAA0E;YAC1E,yDAAyD;YACzD,IAAI,WAAW,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG;YACvC,IAAI,KAAK,SAAS,EAChB,OAAO,KAAK,SAAS,CAAC;YAGxB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE;YAE1B,IAAI,YAAY,IAAI;YACpB,IAAI,OAA2B;YAC/B,IAAI,wBAAwB;YAE5B,IAAI,KAAK,IAAI,KAAK,QAAQ;oBAElB;gBADN,KAAK,IAAI,SAAS,KAAK,UAAU,CAC/B,IAAI,EAAA,eAAA,MAAM,KAAK,cAAX,mCAAA,aAAa,OAAO,MAAK,WAAW;oBACtC,wBAAwB;oBACxB;gBACF;YAEJ;YAEA,KAAK,IAAI,SAAS,KAAK,UAAU,CAA2B;gBAC1D,IAAI,MAAM,IAAI,KAAK,UAAU,uBAAuB;wBAClC,eACA;oBADhB,MAAM,OAAO,IAAG,gBAAA,MAAM,KAAK,cAAX,oCAAA,cAAa,OAAO;oBACpC,MAAM,OAAO,IAAG,gBAAA,MAAM,KAAK,cAAX,oCAAA,cAAa,OAAO;wBACI,gBAAgC;oBAAxE,MAAM,QAAQ,GAAG,CAAC,OAAO,MAAM,KAAK,GAAG,AAAC,CAAA,CAAA,iBAAA,KAAK,QAAQ,cAAb,4BAAA,iBAAiB,KAAK,KAAK,AAAD,IAAM,CAAA,CAAA,gBAAA,KAAK,OAAO,cAAZ,2BAAA,gBAAgB,CAAA;gBAC1F;gBAEA,IAAI,MAAM,IAAI,KAAK,UAAU,MAAM,SAAS,IAAI,MAC9C,4GAA4G;gBAC5G,MAAM,SAAS,GAAG,KAAK,GAAG;gBAE5B,UAAU,GAAG,CAAC,MAAM,GAAG;gBAEvB,IAAI,MAAM;oBACR,KAAK,OAAO,GAAG,MAAM,GAAG;oBACxB,MAAM,OAAO,GAAG,KAAK,GAAG;gBAC1B,OACE,MAAM,OAAO,GAAG;gBAGlB,MAAM;gBACN,OAAO;YACT;YAEA,IAAI,MACF,KAAK,OAAO,GAAG;YAGjB,2DAA2D;YAC3D,IAAI,UAAU;gBACZ,KAAK,IAAI,SAAS,SAAS,UAAU,CACnC,IAAI,CAAC,UAAU,GAAG,CAAC,MAAM,GAAG,GAC1B,OAAO;YAGb;QACF;QAEA,IAAI,SAAS,CAAC;YACZ,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG;YAC3B,KAAK,IAAI,SAAS,KAAK,UAAU,CAC/B,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,MAAM,OACjC,OAAO;QAGb;QAEA,IAAI,OAA2B;QAC/B,KAAK,IAAI,CAAC,GAAG,KAAK,IAAI,KAAK,KAAK,CAAC,OAAO,GAAI;gBAGjC,aACF,WACC,YACC,aAII,iBACJ;YAVT,IAAI,UAAuB;gBACzB,GAAG,IAAI;gBACP,OAAO,CAAA,cAAA,KAAK,KAAK,cAAV,yBAAA,cAAc;gBACrB,KAAK,CAAA,YAAA,KAAK,GAAG,cAAR,uBAAA,YAAY,SAAS;gBAC1B,MAAM,CAAA,aAAA,KAAK,IAAI,cAAT,wBAAA,aAAa;gBACnB,OAAO,CAAA,cAAA,KAAK,KAAK,cAAV,yBAAA,cAAc;gBACrB,eAAe;gBACf,YAAY;uBAAI,KAAK,UAAU;iBAAC;gBAChC,UAAU,KAAK,QAAQ;gBACvB,WAAW,CAAA,kBAAA,KAAK,SAAS,cAAd,6BAAA,kBAAkB;gBAC7B,OAAO,CAAA,cAAA,KAAK,KAAK,cAAV,yBAAA,cAAc;YACvB;YAEA,IAAI,MAAM;gBACR,KAAK,OAAO,GAAG,QAAQ,GAAG;gBAC1B,QAAQ,OAAO,GAAG,KAAK,GAAG;YAC5B,OACE,QAAQ,OAAO,GAAG;YAGpB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YACf,MAAM;YAEN,OAAO;QACT;QAEA,IAAI,MACF,KAAK,OAAO,GAAG;IAEnB;AA8CF","sources":["packages/@react-stately/grid/src/GridCollection.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 {GridNode, GridRow, GridCollection as IGridCollection} from '@react-types/grid';\nimport {Key} from '@react-types/shared';\n\ninterface GridCollectionOptions<T> {\n columnCount: number,\n items: GridRow<T>[],\n visitNode?: (cell: GridNode<T>) => GridNode<T>\n}\n\nexport class GridCollection<T> implements IGridCollection<T> {\n keyMap: Map<Key, GridNode<T>> = new Map();\n columnCount: number;\n rows: GridNode<T>[];\n\n constructor(opts: GridCollectionOptions<T>) {\n this.keyMap = new Map();\n this.columnCount = opts?.columnCount;\n this.rows = [];\n\n let visit = (node: GridNode<T>) => {\n // If the node is the same object as the previous node for the same key,\n // we can skip this node and its children. We always visit columns though,\n // because we depend on order to build the columns array.\n let prevNode = this.keyMap.get(node.key);\n if (opts.visitNode) {\Line truncated
@@ -0,0 +1,122 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TokenContext = void 0;
exports.isLastChild = isLastChild;
exports.needsParens = needsParens;
exports.needsWhitespace = needsWhitespace;
exports.needsWhitespaceAfter = needsWhitespaceAfter;
exports.needsWhitespaceBefore = needsWhitespaceBefore;
var whitespace = require("./whitespace.js");
var parens = require("./parentheses.js");
var _t = require("@babel/types");
const {
FLIPPED_ALIAS_KEYS,
VISITOR_KEYS,
isCallExpression,
isDecorator,
isExpressionStatement,
isMemberExpression,
isNewExpression,
isParenthesizedExpression
} = _t;
const TokenContext = exports.TokenContext = {
normal: 0,
expressionStatement: 1,
arrowBody: 2,
exportDefault: 4,
arrowFlowReturnType: 8,
forInitHead: 16,
forInHead: 32,
forOfHead: 64,
forInOrInitHeadAccumulate: 128,
forInOrInitHeadAccumulatePassThroughMask: 128
};
function expandAliases(obj) {
const map = new Map();
function add(type, func) {
const fn = map.get(type);
map.set(type, fn ? function (node, parent, stack, getRawIdentifier) {
var _fn;
return (_fn = fn(node, parent, stack, getRawIdentifier)) != null ? _fn : func(node, parent, stack, getRawIdentifier);
} : func);
}
for (const type of Object.keys(obj)) {
const aliases = FLIPPED_ALIAS_KEYS[type];
if (aliases) {
for (const alias of aliases) {
add(alias, obj[type]);
}
} else {
add(type, obj[type]);
}
}
return map;
}
const expandedParens = expandAliases(parens);
const expandedWhitespaceNodes = expandAliases(whitespace.nodes);
function isOrHasCallExpression(node) {
if (isCallExpression(node)) {
return true;
}
return isMemberExpression(node) && isOrHasCallExpression(node.object);
}
function needsWhitespace(node, parent, type) {
var _expandedWhitespaceNo;
if (!node) return false;
if (isExpressionStatement(node)) {
node = node.expression;
}
const flag = (_expandedWhitespaceNo = expandedWhitespaceNodes.get(node.type)) == null ? void 0 : _expandedWhitespaceNo(node, parent);
if (typeof flag === "number") {
return (flag & type) !== 0;
}
return false;
}
function needsWhitespaceBefore(node, parent) {
return needsWhitespace(node, parent, 1);
}
function needsWhitespaceAfter(node, parent) {
return needsWhitespace(node, parent, 2);
}
function needsParens(node, parent, tokenContext, getRawIdentifier) {
var _expandedParens$get;
if (!parent) return false;
if (isNewExpression(parent) && parent.callee === node) {
if (isOrHasCallExpression(node)) return true;
}
if (isDecorator(parent)) {
return !isDecoratorMemberExpression(node) && !(isCallExpression(node) && isDecoratorMemberExpression(node.callee)) && !isParenthesizedExpression(node);
}
return ((_expandedParens$get = expandedParens.get(node.type)) == null ? void 0 : _expandedParens$get(node, parent, tokenContext, getRawIdentifier)) || false;
}
function isDecoratorMemberExpression(node) {
switch (node.type) {
case "Identifier":
return true;
case "MemberExpression":
return !node.computed && node.property.type === "Identifier" && isDecoratorMemberExpression(node.object);
default:
return false;
}
}
function isLastChild(parent, child) {
const visitorKeys = VISITOR_KEYS[parent.type];
for (let i = visitorKeys.length - 1; i >= 0; i--) {
const val = parent[visitorKeys[i]];
if (val === child) {
return true;
} else if (Array.isArray(val)) {
let j = val.length - 1;
while (j >= 0 && val[j] === null) j--;
return j >= 0 && val[j] === child;
} else if (val) {
return false;
}
}
return false;
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1,40 @@
{
"name": "@react-stately/virtualizer",
"version": "4.4.4",
"description": "Spectrum UI components in React",
"license": "Apache-2.0",
"main": "dist/main.js",
"module": "dist/module.js",
"exports": {
"source": "./src/index.ts",
"types": [
"./dist/types.d.ts",
"./src/index.ts"
],
"import": "./dist/import.mjs",
"require": "./dist/main.js"
},
"types": "dist/types.d.ts",
"source": "src/index.ts",
"files": [
"dist",
"src"
],
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/adobe/react-spectrum"
},
"dependencies": {
"@react-types/shared": "^3.32.1",
"@swc/helpers": "^0.5.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
},
"publishConfig": {
"access": "public"
},
"gitHead": "0bda51183baa23306342af32a82012ea0fe0f2dc"
}
@@ -0,0 +1,37 @@
var $6acf696f746f932c$exports = require("./utils.main.js");
var $8iEv8$reactariagrid = require("@react-aria/grid");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useTableCell", () => $32387a1f2c61cda2$export$49571c903d73624c);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $32387a1f2c61cda2$export$49571c903d73624c(props, state, ref) {
var _props_node_column;
let { gridCellProps: gridCellProps, isPressed: isPressed } = (0, $8iEv8$reactariagrid.useGridCell)(props, state, ref);
let columnKey = (_props_node_column = props.node.column) === null || _props_node_column === void 0 ? void 0 : _props_node_column.key;
if (columnKey != null && state.collection.rowHeaderColumnKeys.has(columnKey)) {
gridCellProps.role = 'rowheader';
gridCellProps.id = (0, $6acf696f746f932c$exports.getCellId)(state, props.node.parentKey, columnKey);
}
return {
gridCellProps: gridCellProps,
isPressed: isPressed
};
}
//# sourceMappingURL=useTableCell.main.js.map
@@ -0,0 +1,196 @@
/*
* 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 ICU.
// Original licensing can be found in the NOTICE file in the root directory of this source tree.
import {AnyCalendarDate, Calendar} from '../types';
import {CalendarDate} from '../CalendarDate';
import {Mutable} from '../utils';
const ETHIOPIC_EPOCH = 1723856;
const COPTIC_EPOCH = 1824665;
// The delta between Amete Alem 1 and Amete Mihret 1
// AA 5501 = AM 1
const AMETE_MIHRET_DELTA = 5500;
function ceToJulianDay(epoch: number, year: number, month: number, day: number): number {
return (
epoch // difference from Julian epoch to 1,1,1
+ 365 * year // number of days from years
+ Math.floor(year / 4) // extra day of leap year
+ 30 * (month - 1) // number of days from months (1 based)
+ day - 1 // number of days for present month (1 based)
);
}
function julianDayToCE(epoch: number, jd: number) {
let year = Math.floor((4 * (jd - epoch)) / 1461);
let month = 1 + Math.floor((jd - ceToJulianDay(epoch, year, 1, 1)) / 30);
let day = jd + 1 - ceToJulianDay(epoch, year, month, 1);
return [year, month, day];
}
function getLeapDay(year: number) {
return Math.floor((year % 4) / 3);
}
function getDaysInMonth(year: number, month: number) {
// The Ethiopian and Coptic calendars have 13 months, 12 of 30 days each and
// an intercalary month at the end of the year of 5 or 6 days, depending whether
// the year is a leap year or not. The Leap Year follows the same rules as the
// Julian Calendar so that the extra month always has six days in the year before
// a Julian Leap Year.
if (month % 13 !== 0) {
// not intercalary month
return 30;
} else {
// intercalary month 5 days + possible leap day
return getLeapDay(year) + 5;
}
}
/**
* The Ethiopic calendar system is the official calendar used in Ethiopia.
* It includes 12 months of 30 days each, plus 5 or 6 intercalary days depending
* on whether it is a leap year. Two eras are supported: 'AA' and 'AM'.
*/
export class EthiopicCalendar implements Calendar {
identifier = 'ethiopic';
fromJulianDay(jd: number): CalendarDate {
let [year, month, day] = julianDayToCE(ETHIOPIC_EPOCH, jd);
let era = 'AM';
if (year <= 0) {
era = 'AA';
year += AMETE_MIHRET_DELTA;
}
return new CalendarDate(this, era, year, month, day);
}
toJulianDay(date: AnyCalendarDate) {
let year = date.year;
if (date.era === 'AA') {
year -= AMETE_MIHRET_DELTA;
}
return ceToJulianDay(ETHIOPIC_EPOCH, year, date.month, date.day);
}
getDaysInMonth(date: AnyCalendarDate): number {
return getDaysInMonth(date.year, date.month);
}
getMonthsInYear(): number {
return 13;
}
getDaysInYear(date: AnyCalendarDate): number {
return 365 + getLeapDay(date.year);
}
getYearsInEra(date: AnyCalendarDate): number {
// 9999-12-31 gregorian is 9992-20-02 ethiopic.
// Round down to 9991 for the last full year.
// AA 9999-01-01 ethiopic is 4506-09-30 gregorian.
return date.era === 'AA' ? 9999 : 9991;
}
getEras() {
return ['AA', 'AM'];
}
}
/**
* The Ethiopic (Amete Alem) calendar is the same as the modern Ethiopic calendar,
* except years were measured from a different epoch. Only one era is supported: 'AA'.
*/
export class EthiopicAmeteAlemCalendar extends EthiopicCalendar {
identifier = 'ethioaa'; // also known as 'ethiopic-amete-alem' in ICU
fromJulianDay(jd: number): CalendarDate {
let [year, month, day] = julianDayToCE(ETHIOPIC_EPOCH, jd);
year += AMETE_MIHRET_DELTA;
return new CalendarDate(this, 'AA', year, month, day);
}
getEras() {
return ['AA'];
}
getYearsInEra(): number {
// 9999-13-04 ethioaa is the maximum date, which is equivalent to 4506-09-29 gregorian.
return 9999;
}
}
/**
* The Coptic calendar is similar to the Ethiopic calendar.
* It includes 12 months of 30 days each, plus 5 or 6 intercalary days depending
* on whether it is a leap year. Two eras are supported: 'BCE' and 'CE'.
*/
export class CopticCalendar extends EthiopicCalendar {
identifier = 'coptic';
fromJulianDay(jd: number): CalendarDate {
let [year, month, day] = julianDayToCE(COPTIC_EPOCH, jd);
let era = 'CE';
if (year <= 0) {
era = 'BCE';
year = 1 - year;
}
return new CalendarDate(this, era, year, month, day);
}
toJulianDay(date: AnyCalendarDate) {
let year = date.year;
if (date.era === 'BCE') {
year = 1 - year;
}
return ceToJulianDay(COPTIC_EPOCH, year, date.month, date.day);
}
getDaysInMonth(date: AnyCalendarDate): number {
let year = date.year;
if (date.era === 'BCE') {
year = 1 - year;
}
return getDaysInMonth(year, date.month);
}
isInverseEra(date: AnyCalendarDate): boolean {
return date.era === 'BCE';
}
balanceDate(date: Mutable<AnyCalendarDate>) {
if (date.year <= 0) {
date.era = date.era === 'BCE' ? 'CE' : 'BCE';
date.year = 1 - date.year;
}
}
getEras() {
return ['BCE', 'CE'];
}
getYearsInEra(date: AnyCalendarDate): number {
// 9999-12-30 gregorian is 9716-02-20 coptic.
// Round down to 9715 for the last full year.
// BCE 9999-01-01 coptic is BC 9716-06-15 gregorian.
return date.era === 'BCE' ? 9999 : 9715;
}
}
@@ -0,0 +1,106 @@
# 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.0.8](https://github.com/ljharb/call-bind/compare/v1.0.7...v1.0.8) - 2024-12-05
### Commits
- [Refactor] extract out some helpers and avoid get-intrinsic usage [`407fd5e`](https://github.com/ljharb/call-bind/commit/407fd5eec34ec58394522a6ce3badfa4788fd5ae)
- [Refactor] replace code with extracted `call-bind-apply-helpers` [`81018fb`](https://github.com/ljharb/call-bind/commit/81018fb78902ff5acbc6c09300780e97f0db6a34)
- [Tests] use `set-function-length/env` [`0fc311d`](https://github.com/ljharb/call-bind/commit/0fc311de0e115cfa6b02969b23a42ad45aadf224)
- [actions] split out node 10-20, and 20+ [`77a0cad`](https://github.com/ljharb/call-bind/commit/77a0cad75f83f5b8050dc13baef4fa2cff537fa3)
- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `es-value-fixtures`, `gopd`, `object-inspect`, `tape` [`a145d10`](https://github.com/ljharb/call-bind/commit/a145d10fe847f350e11094f8541848b028ee8c91)
- [Tests] replace `aud` with `npm audit` [`30ca3dd`](https://github.com/ljharb/call-bind/commit/30ca3dd7234648eb029947477d06b17879e10727)
- [Deps] update `set-function-length` [`57c79a3`](https://github.com/ljharb/call-bind/commit/57c79a3666022ea797cc2a4a3b43fe089bc97d1b)
- [Dev Deps] add missing peer dep [`601cfa5`](https://github.com/ljharb/call-bind/commit/601cfa5540066b6206039ceb9496cecbd134ff7b)
## [v1.0.7](https://github.com/ljharb/call-bind/compare/v1.0.6...v1.0.7) - 2024-02-12
### Commits
- [Refactor] use `es-define-property` [`09b76a0`](https://github.com/ljharb/call-bind/commit/09b76a01634440461d44a80c9924ec4b500f3b03)
- [Deps] update `get-intrinsic`, `set-function-length` [`ad5136d`](https://github.com/ljharb/call-bind/commit/ad5136ddda2a45c590959829ad3dce0c9f4e3590)
## [v1.0.6](https://github.com/ljharb/call-bind/compare/v1.0.5...v1.0.6) - 2024-02-05
### Commits
- [Dev Deps] update `aud`, `npmignore`, `tape` [`d564d5c`](https://github.com/ljharb/call-bind/commit/d564d5ce3e06a19df4d499c77f8d1a9da44e77aa)
- [Deps] update `get-intrinsic`, `set-function-length` [`cfc2bdc`](https://github.com/ljharb/call-bind/commit/cfc2bdca7b633df0e0e689e6b637f668f1c6792e)
- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`64cd289`](https://github.com/ljharb/call-bind/commit/64cd289ae5862c250a4ca80aa8d461047c166af5)
- [meta] add missing `engines.node` [`32a4038`](https://github.com/ljharb/call-bind/commit/32a4038857b62179f7f9b7b3df2c5260036be582)
## [v1.0.5](https://github.com/ljharb/call-bind/compare/v1.0.4...v1.0.5) - 2023-10-19
### Commits
- [Fix] throw an error on non-functions as early as possible [`f262408`](https://github.com/ljharb/call-bind/commit/f262408f822c840fbc268080f3ad7c429611066d)
- [Deps] update `set-function-length` [`3fff271`](https://github.com/ljharb/call-bind/commit/3fff27145a1e3a76a5b74f1d7c3c43d0fa3b9871)
## [v1.0.4](https://github.com/ljharb/call-bind/compare/v1.0.3...v1.0.4) - 2023-10-19
## [v1.0.3](https://github.com/ljharb/call-bind/compare/v1.0.2...v1.0.3) - 2023-10-19
### Commits
- [actions] reuse common workflows [`a994df6`](https://github.com/ljharb/call-bind/commit/a994df69f401f4bf735a4ccd77029b85d1549453)
- [meta] use `npmignore` to autogenerate an npmignore file [`eef3ef2`](https://github.com/ljharb/call-bind/commit/eef3ef21e1f002790837fedb8af2679c761fbdf5)
- [readme] flesh out content [`1845ccf`](https://github.com/ljharb/call-bind/commit/1845ccfd9976a607884cfc7157c93192cc16cf22)
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`5b47d53`](https://github.com/ljharb/call-bind/commit/5b47d53d2fd74af5ea0a44f1d51e503cd42f7a90)
- [Refactor] use `set-function-length` [`a0e165c`](https://github.com/ljharb/call-bind/commit/a0e165c5dc61db781cbc919b586b1c2b8da0b150)
- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`9c50103`](https://github.com/ljharb/call-bind/commit/9c50103f44137279a817317cf6cc421a658f85b4)
- [meta] simplify "exports" [`019c6d0`](https://github.com/ljharb/call-bind/commit/019c6d06b0e1246ceed8e579f57e44441cbbf6d9)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `safe-publish-latest`, `tape` [`23bd718`](https://github.com/ljharb/call-bind/commit/23bd718a288d3b03042062b4ef5153b3cea83f11)
- [actions] update codecov uploader [`62552d7`](https://github.com/ljharb/call-bind/commit/62552d79cc79e05825e99aaba134ae5b37f33da5)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`ec81665`](https://github.com/ljharb/call-bind/commit/ec81665b300f87eabff597afdc8b8092adfa7afd)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`35d67fc`](https://github.com/ljharb/call-bind/commit/35d67fcea883e686650f736f61da5ddca2592de8)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`0266d8d`](https://github.com/ljharb/call-bind/commit/0266d8d2a45086a922db366d0c2932fa463662ff)
- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`43a5b28`](https://github.com/ljharb/call-bind/commit/43a5b28a444e710e1bbf92adb8afb5cf7523a223)
- [Deps] update `define-data-property`, `function-bind`, `get-intrinsic` [`780eb36`](https://github.com/ljharb/call-bind/commit/780eb36552514f8cc99c70821ce698697c2726a5)
- [Dev Deps] update `aud`, `tape` [`90d50ad`](https://github.com/ljharb/call-bind/commit/90d50ad03b061e0268b3380b0065fcaec183dc05)
- [meta] use `prepublishOnly` script for npm 7+ [`44c5433`](https://github.com/ljharb/call-bind/commit/44c5433b7980e02b4870007046407cf6fc543329)
- [Deps] update `get-intrinsic` [`86bfbfc`](https://github.com/ljharb/call-bind/commit/86bfbfcf34afdc6eabc93ce3d408548d0e27d958)
- [Deps] update `get-intrinsic` [`5c53354`](https://github.com/ljharb/call-bind/commit/5c5335489be0294c18cd7a8bb6e08226ee019ff5)
- [actions] update checkout action [`4c393a8`](https://github.com/ljharb/call-bind/commit/4c393a8173b3c8e5b30d5b3297b3b94d48bf87f3)
- [Deps] update `get-intrinsic` [`4e70bde`](https://github.com/ljharb/call-bind/commit/4e70bdec0626acb11616d66250fc14565e716e91)
- [Deps] update `get-intrinsic` [`55ae803`](https://github.com/ljharb/call-bind/commit/55ae803a920bd93c369cd798c20de31f91e9fc60)
## [v1.0.2](https://github.com/ljharb/call-bind/compare/v1.0.1...v1.0.2) - 2021-01-11
### Commits
- [Fix] properly include the receiver in the bound length [`dbae7bc`](https://github.com/ljharb/call-bind/commit/dbae7bc676c079a0d33c0a43e9ef92cb7b01345d)
## [v1.0.1](https://github.com/ljharb/call-bind/compare/v1.0.0...v1.0.1) - 2021-01-08
### Commits
- [Tests] migrate tests to Github Actions [`b6db284`](https://github.com/ljharb/call-bind/commit/b6db284c36f8ccd195b88a6764fe84b7223a0da1)
- [meta] do not publish github action workflow files [`ec7fe46`](https://github.com/ljharb/call-bind/commit/ec7fe46e60cfa4764ee943d2755f5e5a366e578e)
- [Fix] preserve original function’s length when possible [`adbceaa`](https://github.com/ljharb/call-bind/commit/adbceaa3cac4b41ea78bb19d7ccdbaaf7e0bdadb)
- [Tests] gather coverage data on every job [`d69e23c`](https://github.com/ljharb/call-bind/commit/d69e23cc65f101ba1d4c19bb07fa8eb0ec624be8)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`2fd3586`](https://github.com/ljharb/call-bind/commit/2fd3586c5d47b335364c14293114c6b625ae1f71)
- [Deps] update `get-intrinsic` [`f23e931`](https://github.com/ljharb/call-bind/commit/f23e9318cc271c2add8bb38cfded85ee7baf8eee)
- [Deps] update `get-intrinsic` [`72d9f44`](https://github.com/ljharb/call-bind/commit/72d9f44e184465ba8dd3fb48260bbcff234985f2)
- [meta] fix FUNDING.yml [`e723573`](https://github.com/ljharb/call-bind/commit/e723573438c5a68dcec31fb5d96ea6b7e4a93be8)
- [eslint] ignore coverage output [`15e76d2`](https://github.com/ljharb/call-bind/commit/15e76d28a5f43e504696401e5b31ebb78ee1b532)
- [meta] add Automatic Rebase and Require Allow Edits workflows [`8fa4dab`](https://github.com/ljharb/call-bind/commit/8fa4dabb23ba3dd7bb92c9571c1241c08b56e4b6)
## v1.0.0 - 2020-10-30
### Commits
- Initial commit [`306cf98`](https://github.com/ljharb/call-bind/commit/306cf98c7ec9e7ef66b653ec152277ac1381eb50)
- Tests [`e10d0bb`](https://github.com/ljharb/call-bind/commit/e10d0bbdadc7a10ecedc9a1c035112d3e368b8df)
- Implementation [`43852ed`](https://github.com/ljharb/call-bind/commit/43852eda0f187327b7fad2423ca972149a52bd65)
- npm init [`408f860`](https://github.com/ljharb/call-bind/commit/408f860b773a2f610805fd3613d0d71bac1b6249)
- [meta] add Automatic Rebase and Require Allow Edits workflows [`fb349b2`](https://github.com/ljharb/call-bind/commit/fb349b2e48defbec8b5ec8a8395cc8f69f220b13)
- [meta] add `auto-changelog` [`c4001fc`](https://github.com/ljharb/call-bind/commit/c4001fc43031799ef908211c98d3b0fb2b60fde4)
- [meta] add "funding"; create `FUNDING.yml` [`d4d6d29`](https://github.com/ljharb/call-bind/commit/d4d6d2974a14bc2e98830468eda7fe6d6a776717)
- [Tests] add `npm run lint` [`dedfb98`](https://github.com/ljharb/call-bind/commit/dedfb98bd0ecefb08ddb9a94061bd10cde4332af)
- Only apps should have lockfiles [`54ac776`](https://github.com/ljharb/call-bind/commit/54ac77653db45a7361dc153d2f478e743f110650)
- [meta] add `safe-publish-latest` [`9ea8e43`](https://github.com/ljharb/call-bind/commit/9ea8e435b950ce9b705559cd651039f9bf40140f)
@@ -0,0 +1,160 @@
import { useRef } from 'react';
import useLatest from '../useLatest';
import { getTargetElement } from '../utils/domTarget';
import useEffectWithTarget from '../utils/useEffectWithTarget';
function useLongPress(onLongPress, target, _a) {
var _b = _a === void 0 ? {} : _a, _c = _b.delay, delay = _c === void 0 ? 300 : _c, moveThreshold = _b.moveThreshold, onClick = _b.onClick, onLongPressEnd = _b.onLongPressEnd;
var onLongPressRef = useLatest(onLongPress);
var onClickRef = useLatest(onClick);
var onLongPressEndRef = useLatest(onLongPressEnd);
var timerRef = useRef(undefined);
var isTriggeredRef = useRef(false);
var pervPositionRef = useRef({ x: 0, y: 0 });
var mousePressed = useRef(false);
var touchPressed = useRef(false);
var hasMoveThreshold = !!(((moveThreshold === null || moveThreshold === void 0 ? void 0 : moveThreshold.x) && moveThreshold.x > 0) ||
((moveThreshold === null || moveThreshold === void 0 ? void 0 : moveThreshold.y) && moveThreshold.y > 0));
useEffectWithTarget(function () {
var targetElement = getTargetElement(target);
if (!(targetElement === null || targetElement === void 0 ? void 0 : targetElement.addEventListener)) {
return;
}
var overThreshold = function (event) {
var _a = getClientPosition(event), clientX = _a.clientX, clientY = _a.clientY;
var offsetX = Math.abs(clientX - pervPositionRef.current.x);
var offsetY = Math.abs(clientY - pervPositionRef.current.y);
return !!(((moveThreshold === null || moveThreshold === void 0 ? void 0 : moveThreshold.x) && offsetX > moveThreshold.x) ||
((moveThreshold === null || moveThreshold === void 0 ? void 0 : moveThreshold.y) && offsetY > moveThreshold.y));
};
function getClientPosition(event) {
if ('TouchEvent' in window && event instanceof TouchEvent) {
return {
clientX: event.touches[0].clientX,
clientY: event.touches[0].clientY,
};
}
if (event instanceof MouseEvent) {
return {
clientX: event.clientX,
clientY: event.clientY,
};
}
return { clientX: 0, clientY: 0 };
}
var createTimer = function (event) {
timerRef.current = setTimeout(function () {
onLongPressRef.current(event);
isTriggeredRef.current = true;
}, delay);
};
var onTouchStart = function (event) {
if (touchPressed.current) {
return;
}
touchPressed.current = true;
if (hasMoveThreshold) {
var _a = getClientPosition(event), clientX = _a.clientX, clientY = _a.clientY;
pervPositionRef.current.x = clientX;
pervPositionRef.current.y = clientY;
}
createTimer(event);
};
var onMouseDown = function (event) {
var _a;
if ((_a = event === null || event === void 0 ? void 0 : event.sourceCapabilities) === null || _a === void 0 ? void 0 : _a.firesTouchEvents) {
return;
}
mousePressed.current = true;
if (hasMoveThreshold) {
pervPositionRef.current.x = event.clientX;
pervPositionRef.current.y = event.clientY;
}
createTimer(event);
};
var onMove = function (event) {
if (timerRef.current && overThreshold(event)) {
clearTimeout(timerRef.current);
timerRef.current = undefined;
}
};
var onTouchEnd = function (event) {
var _a;
if (!touchPressed.current) {
return;
}
touchPressed.current = false;
if (timerRef.current) {
clearTimeout(timerRef.current);
timerRef.current = undefined;
}
if (isTriggeredRef.current) {
(_a = onLongPressEndRef.current) === null || _a === void 0 ? void 0 : _a.call(onLongPressEndRef, event);
}
else if (onClickRef.current) {
onClickRef.current(event);
}
isTriggeredRef.current = false;
};
var onMouseUp = function (event) {
var _a, _b;
if ((_a = event === null || event === void 0 ? void 0 : event.sourceCapabilities) === null || _a === void 0 ? void 0 : _a.firesTouchEvents) {
return;
}
if (!mousePressed.current) {
return;
}
mousePressed.current = false;
if (timerRef.current) {
clearTimeout(timerRef.current);
timerRef.current = undefined;
}
if (isTriggeredRef.current) {
(_b = onLongPressEndRef.current) === null || _b === void 0 ? void 0 : _b.call(onLongPressEndRef, event);
}
else if (onClickRef.current) {
onClickRef.current(event);
}
isTriggeredRef.current = false;
};
var onMouseLeave = function (event) {
var _a;
if (!mousePressed.current) {
return;
}
mousePressed.current = false;
if (timerRef.current) {
clearTimeout(timerRef.current);
timerRef.current = undefined;
}
if (isTriggeredRef.current) {
(_a = onLongPressEndRef.current) === null || _a === void 0 ? void 0 : _a.call(onLongPressEndRef, event);
isTriggeredRef.current = false;
}
};
targetElement.addEventListener('mousedown', onMouseDown);
targetElement.addEventListener('mouseup', onMouseUp);
targetElement.addEventListener('mouseleave', onMouseLeave);
targetElement.addEventListener('touchstart', onTouchStart);
targetElement.addEventListener('touchend', onTouchEnd);
if (hasMoveThreshold) {
targetElement.addEventListener('mousemove', onMove);
targetElement.addEventListener('touchmove', onMove);
}
return function () {
if (timerRef.current) {
clearTimeout(timerRef.current);
isTriggeredRef.current = false;
}
targetElement.removeEventListener('mousedown', onMouseDown);
targetElement.removeEventListener('mouseup', onMouseUp);
targetElement.removeEventListener('mouseleave', onMouseLeave);
targetElement.removeEventListener('touchstart', onTouchStart);
targetElement.removeEventListener('touchend', onTouchEnd);
if (hasMoveThreshold) {
targetElement.removeEventListener('mousemove', onMove);
targetElement.removeEventListener('touchmove', onMove);
}
};
}, [], target);
}
export default useLongPress;
@@ -0,0 +1 @@
{"name":"micromark-util-decode-string","version":"2.0.1","requiresBuild":false,"files":{"license":{"checkedAt":1794532112631,"integrity":"sha512-ic4iF2Ap25Sn5T9MMw7nJ9C20WL6V01rybBBQi2Qx8cQC9/ERFEqGnove1HT65tK2TIKM30PZoOV3Qbz2FE//A==","mode":420,"size":1094},"dev/index.js":{"checkedAt":1794532113671,"integrity":"sha512-zRNypNA9/seVBq7sqyeBILGtwmDKo3uJdLhdFhNvzqdXP9apZFHWFMPrJgPsSGZmMFOF6BzNdkIgUWUsD/ve4Q==","mode":420,"size":1412},"index.js":{"checkedAt":1794532113671,"integrity":"sha512-3ceaUEVPZGtoYD71t1+2OKJhLikpWDfx01DfysU35qEdum0yoBPURp2jb4YWKiShXxeqh0c1QC9tPO1tZKRfgg==","mode":420,"size":1250},"package.json":{"checkedAt":1794532113671,"integrity":"sha512-++UtAkvykwgBq9ozBMfPOaN1mdrZ1977FlKE0K1wSY40fOlNsrCDB7lxytzAc2SZDfQyomklrS8bsELIuIS4fg==","mode":420,"size":1517},"dev/index.d.ts.map":{"checkedAt":1794532113672,"integrity":"sha512-SaBWGcfBVzRCx4kyrWiYyhOVC8PmGF0tcdFWMz9EXe0PvA/GabbrME5qTQ55CjoX6a2Hjn1r91rzdi0Bxfn8HA==","mode":420,"size":148},"index.d.ts.map":{"checkedAt":1794532113672,"integrity":"sha512-SaBWGcfBVzRCx4kyrWiYyhOVC8PmGF0tcdFWMz9EXe0PvA/GabbrME5qTQ55CjoX6a2Hjn1r91rzdi0Bxfn8HA==","mode":420,"size":148},"readme.md":{"checkedAt":1794532113672,"integrity":"sha512-npr4yZ7hKKA21nNPjat6y8CR1sMUILvvIAC6R6WlN9zCAqTh1fAqVryox+UhFHyXuJaV2QikCo80ImECTE0Xdw==","mode":420,"size":4699},"dev/index.d.ts":{"checkedAt":1794532113672,"integrity":"sha512-ar1SlZ0cF5nLro7VbRsgvQSpHLIhJqYj5fOGzcG1F9zzekc1JEYrcSgCtaqQhWBchwXesOhm/w2aG6V2N3s2oQ==","mode":420,"size":410},"index.d.ts":{"checkedAt":1794532113672,"integrity":"sha512-ar1SlZ0cF5nLro7VbRsgvQSpHLIhJqYj5fOGzcG1F9zzekc1JEYrcSgCtaqQhWBchwXesOhm/w2aG6V2N3s2oQ==","mode":420,"size":410}}}
@@ -0,0 +1,71 @@
export * from './type/clone/index';
export * from './type/create/index';
export * from './type/error/index';
export * from './type/guard/index';
export * from './type/helpers/index';
export * from './type/patterns/index';
export * from './type/registry/index';
export * from './type/sets/index';
export * from './type/symbols/index';
export * from './type/any/index';
export * from './type/array/index';
export * from './type/argument/index';
export * from './type/async-iterator/index';
export * from './type/awaited/index';
export * from './type/bigint/index';
export * from './type/boolean/index';
export * from './type/composite/index';
export * from './type/const/index';
export * from './type/constructor/index';
export * from './type/constructor-parameters/index';
export * from './type/date/index';
export * from './type/enum/index';
export * from './type/exclude/index';
export * from './type/extends/index';
export * from './type/extract/index';
export * from './type/function/index';
export * from './type/indexed/index';
export * from './type/instance-type/index';
export * from './type/instantiate/index';
export * from './type/integer/index';
export * from './type/intersect/index';
export * from './type/iterator/index';
export * from './type/intrinsic/index';
export * from './type/keyof/index';
export * from './type/literal/index';
export * from './type/module/index';
export * from './type/mapped/index';
export * from './type/never/index';
export * from './type/not/index';
export * from './type/null/index';
export * from './type/number/index';
export * from './type/object/index';
export * from './type/omit/index';
export * from './type/optional/index';
export * from './type/parameters/index';
export * from './type/partial/index';
export * from './type/pick/index';
export * from './type/promise/index';
export * from './type/readonly/index';
export * from './type/readonly-optional/index';
export * from './type/record/index';
export * from './type/recursive/index';
export * from './type/ref/index';
export * from './type/regexp/index';
export * from './type/required/index';
export * from './type/rest/index';
export * from './type/return-type/index';
export * from './type/schema/index';
export * from './type/static/index';
export * from './type/string/index';
export * from './type/symbol/index';
export * from './type/template-literal/index';
export * from './type/transform/index';
export * from './type/tuple/index';
export * from './type/uint8array/index';
export * from './type/undefined/index';
export * from './type/union/index';
export * from './type/unknown/index';
export * from './type/unsafe/index';
export * from './type/void/index';
export * from './type/type/index';
@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return hashConfig;
}
});
const _objecthash = /*#__PURE__*/ _interop_require_default(require("object-hash"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function hashConfig(config) {
return (0, _objecthash.default)(config, {
ignoreUnknown: true
});
}
@@ -0,0 +1 @@
{"version":3,"file":"GraphemerIterator.d.ts","sourceRoot":"","sources":["../src/GraphemerIterator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAM,iBAAkB,YAAW,QAAQ,CAAC,MAAM,CAAC;IACjD,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,UAAU,CAAyC;gBAE/C,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM;IAK1E,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB,IAAI;;;;CAcL;AAED,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,82 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.snipScriptAndStyleTagContent = snipScriptAndStyleTagContent;
var snippedTagContentAttribute = '✂prettier:content✂';
var scriptRegex = /<!--[^]*?-->|<script((?:\s+[^=>'"\/\s]+=(?:"[^"]*"|'[^']*'|[^>\s]+)|\s+[^=>'"\/\s]+)*\s*)>([^]*?)<\/script>/g;
var styleRegex = /<!--[^]*?-->|<style((?:\s+[^=>'"\/\s]+=(?:"[^"]*"|'[^']*'|[^>\s]+)|\s+[^=>'"\/\s]+)*\s*)>([^]*?)<\/style>/g;
var langTsRegex = /\slang=["']?ts["']?/;
var stringToBase64 = typeof Buffer !== 'undefined'
? function (str) { return Buffer.from(str).toString('base64'); }
: function (str) {
return btoa(new TextEncoder()
.encode(str)
.reduce(function (acc, byte) { return acc + String.fromCharCode(byte); }, ''));
};
function snipScriptAndStyleTagContent(source) {
var scriptMatchSpans = getMatchIndexes('script');
var styleMatchSpans = getMatchIndexes('style');
var isTypescript = false;
var text = snipTagContent(snipTagContent(source, 'script', '{}', styleMatchSpans), 'style', '', scriptMatchSpans);
return { text: text, isTypescript: isTypescript };
function getMatchIndexes(tagName) {
var regex = getRegexp(tagName);
var indexes = [];
var match = null;
while ((match = regex.exec(source)) != null) {
if (source.slice(match.index, match.index + 4) !== '<!--') {
indexes.push([match.index, regex.lastIndex]);
}
}
return indexes;
}
function snipTagContent(_source, tagName, placeholder, otherSpans) {
var regex = getRegexp(tagName);
var newScriptMatchSpans = scriptMatchSpans;
var newStyleMatchSpans = styleMatchSpans;
// Replace valid matches
var newSource = _source.replace(regex, function (match, attributes, content, index) {
if (match.startsWith('<!--') || withinOtherSpan(index)) {
return match;
}
if (langTsRegex.test(attributes)) {
isTypescript = true;
}
var encodedContent = stringToBase64(content);
var newContent = "<".concat(tagName).concat(attributes, " ").concat(snippedTagContentAttribute, "=\"").concat(encodedContent, "\">").concat(placeholder, "</").concat(tagName, ">");
// Adjust the spans because the source now has a different content length
var lengthDiff = match.length - newContent.length;
newScriptMatchSpans = adjustSpans(scriptMatchSpans, newScriptMatchSpans);
newStyleMatchSpans = adjustSpans(styleMatchSpans, newStyleMatchSpans);
function adjustSpans(oldSpans, newSpans) {
return oldSpans.map(function (oldSpan, idx) {
var newSpan = newSpans[idx];
// Do the check using the old spans because the replace function works
// on the old spans. Replace oldSpans with newSpans afterwards.
if (oldSpan[0] > index) {
// span is after the match -> adjust start and end
return [newSpan[0] - lengthDiff, newSpan[1] - lengthDiff];
}
else if (oldSpan[0] === index) {
// span is the match -> adjust end only
return [newSpan[0], newSpan[1] - lengthDiff];
}
else {
// span is before the match -> nothing to adjust
return newSpan;
}
});
}
return newContent;
});
// Now that the replacement function ran, we can adjust the spans for the next run
scriptMatchSpans = newScriptMatchSpans;
styleMatchSpans = newStyleMatchSpans;
return newSource;
function withinOtherSpan(idx) {
return otherSpans.some(function (otherSpan) { return idx > otherSpan[0] && idx < otherSpan[1]; });
}
}
function getRegexp(tagName) {
return tagName === 'script' ? scriptRegex : styleRegex;
}
}
@@ -0,0 +1,811 @@
import fs from 'node:fs';
import nodeModule, { isBuiltin } from 'node:module';
import { isBareImport } from '@vitest/utils/helpers';
import { pathToFileURL } from 'node:url';
import { normalize as normalize$1, join as join$1 } from 'pathe';
import { distDir } from '../path.js';
import { serializeValue } from '@vitest/utils/serialize';
import { VitestModuleEvaluator, unwrapId } from '../module-evaluator.js';
import { resolve as resolve$1, isAbsolute as isAbsolute$1 } from 'node:path';
import vm from 'node:vm';
import { MockerRegistry, mockObject, RedirectedModule, AutomockedModule } from '@vitest/mocker';
import * as viteModuleRunner from 'vite/module-runner';
class VitestTransport {
constructor(options) {
this.options = options;
}
async invoke(event) {
if (event.type !== "custom") return { error: /* @__PURE__ */ new Error(`Vitest Module Runner doesn't support Vite HMR events.`) };
if (event.event !== "vite:invoke") return { error: /* @__PURE__ */ new Error(`Vitest Module Runner doesn't support ${event.event} event.`) };
const { name, data } = event.data;
if (name === "getBuiltins")
// we return an empty array here to avoid client-side builtin check,
// as we need builtins to go through `fetchModule`
return { result: [] };
if (name !== "fetchModule") return { error: /* @__PURE__ */ new Error(`Unknown method: ${name}. Expected "fetchModule".`) };
try {
return { result: await this.options.fetchModule(...data) };
} catch (error) {
return { error };
}
}
}
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
function normalizeWindowsPath(input = "") {
if (!input) return input;
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
}
const _UNC_REGEX = /^[/\\]{2}/;
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
const normalize = function(path) {
if (path.length === 0) return ".";
path = normalizeWindowsPath(path);
const isUNCPath = path.match(_UNC_REGEX);
const isPathAbsolute = isAbsolute(path);
const trailingSeparator = path[path.length - 1] === "/";
path = normalizeString(path, !isPathAbsolute);
if (path.length === 0) {
if (isPathAbsolute) return "/";
return trailingSeparator ? "./" : ".";
}
if (trailingSeparator) path += "/";
if (_DRIVE_LETTER_RE.test(path)) path += "/";
if (isUNCPath) {
if (!isPathAbsolute) return `//./${path}`;
return `//${path}`;
}
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
};
const join = function(...segments) {
let path = "";
for (const seg of segments) {
if (!seg) continue;
if (path.length > 0) {
const pathTrailing = path[path.length - 1] === "/";
const segLeading = seg[0] === "/";
if (pathTrailing && segLeading) path += seg.slice(1);
else path += pathTrailing || segLeading ? seg : `/${seg}`;
} else path += seg;
}
return normalize(path);
};
function cwd$1() {
if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
return "/";
}
const resolve = function(...arguments_) {
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
let resolvedPath = "";
let resolvedAbsolute = false;
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
const path = index >= 0 ? arguments_[index] : cwd$1();
if (!path || path.length === 0) continue;
resolvedPath = `${path}/${resolvedPath}`;
resolvedAbsolute = isAbsolute(path);
}
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
return resolvedPath.length > 0 ? resolvedPath : ".";
};
function normalizeString(path, allowAboveRoot) {
let res = "";
let lastSegmentLength = 0;
let lastSlash = -1;
let dots = 0;
let char = null;
for (let index = 0; index <= path.length; ++index) {
if (index < path.length) char = path[index];
else if (char === "/") break;
else char = "/";
if (char === "/") {
if (lastSlash === index - 1 || dots === 1);
else if (dots === 2) {
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
if (res.length > 2) {
const lastSlashIndex = res.lastIndexOf("/");
if (lastSlashIndex === -1) {
res = "";
lastSegmentLength = 0;
} else {
res = res.slice(0, lastSlashIndex);
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
}
lastSlash = index;
dots = 0;
continue;
} else if (res.length > 0) {
res = "";
lastSegmentLength = 0;
lastSlash = index;
dots = 0;
continue;
}
}
if (allowAboveRoot) {
res += res.length > 0 ? "/.." : "..";
lastSegmentLength = 2;
}
} else {
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
else res = path.slice(lastSlash + 1, index);
lastSegmentLength = index - lastSlash - 1;
}
lastSlash = index;
dots = 0;
} else if (char === "." && dots !== -1) ++dots;
else dots = -1;
}
return res;
}
const isAbsolute = function(p) {
return _IS_ABSOLUTE_RE.test(p);
};
const extname = function(p) {
if (p === "..") return "";
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
return match && match[1] || "";
};
const dirname = function(p) {
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
};
const basename = function(p, extension) {
const segments = normalizeWindowsPath(p).split("/");
let lastSegment = "";
for (let i = segments.length - 1; i >= 0; i--) {
const val = segments[i];
if (val) {
lastSegment = val;
break;
}
}
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
};
const { existsSync, readdirSync, statSync } = fs;
function findMockRedirect(root, mockPath, external) {
const path = external || mockPath;
// it's a node_module alias
// all mocks should be inside <root>/__mocks__
if (external || isNodeBuiltin(mockPath) || !existsSync(mockPath)) {
const mockFolder = join(root, "__mocks__", dirname(path));
if (!existsSync(mockFolder)) return null;
const baseOriginal = basename(path);
function findFile(mockFolder, baseOriginal) {
const files = readdirSync(mockFolder);
for (const file of files) if (basename(file, extname(file)) === baseOriginal) {
const path = resolve(mockFolder, file);
// if the same name, return the file
if (statSync(path).isFile()) return path;
else {
// find folder/index.{js,ts}
const indexFile = findFile(path, "index");
if (indexFile) return indexFile;
}
}
return null;
}
return findFile(mockFolder, baseOriginal);
}
const fullPath = resolve(dirname(path), "__mocks__", basename(path));
return existsSync(fullPath) ? fullPath : null;
}
const builtins = new Set([
...nodeModule.builtinModules,
"assert/strict",
"diagnostics_channel",
"dns/promises",
"fs/promises",
"path/posix",
"path/win32",
"readline/promises",
"stream/consumers",
"stream/promises",
"stream/web",
"timers/promises",
"util/types",
"wasi"
]);
// https://nodejs.org/api/modules.html#built-in-modules-with-mandatory-node-prefix
const prefixedBuiltins$1 = new Set([
"node:sea",
"node:sqlite",
"node:test",
"node:test/reporters"
]);
const NODE_BUILTIN_NAMESPACE = "node:";
function isNodeBuiltin(id) {
// Added in v18.6.0
if (nodeModule.isBuiltin) return nodeModule.isBuiltin(id);
if (prefixedBuiltins$1.has(id)) return true;
return builtins.has(id.startsWith(NODE_BUILTIN_NAMESPACE) ? id.slice(5) : id);
}
const spyModulePath = resolve$1(distDir, "spy.js");
class VitestMocker {
static pendingIds = [];
spyModule;
primitives;
filterPublicKeys;
registries = /* @__PURE__ */ new Map();
mockContext = { callstack: null };
constructor(moduleRunner, options) {
this.moduleRunner = moduleRunner;
this.options = options;
const context = this.options.context;
if (context) this.primitives = vm.runInContext("({ Object, Error, Function, RegExp, Symbol, Array, Map })", context);
else this.primitives = {
Object,
Error,
Function,
RegExp,
Symbol: globalThis.Symbol,
Array,
Map
};
if (options.spyModule) this.spyModule = options.spyModule;
const Symbol = this.primitives.Symbol;
this.filterPublicKeys = [
"__esModule",
Symbol.asyncIterator,
Symbol.hasInstance,
Symbol.isConcatSpreadable,
Symbol.iterator,
Symbol.match,
Symbol.matchAll,
Symbol.replace,
Symbol.search,
Symbol.split,
Symbol.species,
Symbol.toPrimitive,
Symbol.toStringTag,
Symbol.unscopables
];
}
get root() {
return this.options.root;
}
get evaluatedModules() {
return this.moduleRunner.evaluatedModules;
}
get moduleDirectories() {
return this.options.moduleDirectories || [];
}
async initializeSpyModule() {
if (this.spyModule) return;
this.spyModule = await this.moduleRunner.import(spyModulePath);
}
getMockerRegistry() {
const suite = this.getSuiteFilepath();
if (!this.registries.has(suite)) this.registries.set(suite, new MockerRegistry());
return this.registries.get(suite);
}
reset() {
this.registries.clear();
}
invalidateModuleById(id) {
const mockId = this.getMockPath(id);
const node = this.evaluatedModules.getModuleById(mockId);
if (node) {
this.evaluatedModules.invalidateModule(node);
node.mockedExports = void 0;
}
}
isModuleDirectory(path) {
return this.moduleDirectories.some((dir) => path.includes(dir));
}
getSuiteFilepath() {
return this.options.getCurrentTestFilepath() || "global";
}
createError(message, codeFrame) {
const Error = this.primitives.Error;
const error = new Error(message);
Object.assign(error, { codeFrame });
return error;
}
async resolveId(rawId, importer) {
const result = await this.options.resolveId(rawId, importer);
if (!result) {
const id = normalizeModuleId(rawId);
return {
id,
url: rawId,
external: id
};
}
// external is node_module or unresolved module
// for example, some people mock "vscode" and don't have it installed
const external = !isAbsolute$1(result.file) || this.isModuleDirectory(result.file) ? normalizeModuleId(rawId) : null;
return {
...result,
id: normalizeModuleId(result.id),
external
};
}
async resolveMocks() {
if (!VitestMocker.pendingIds.length) return;
await Promise.all(VitestMocker.pendingIds.map(async (mock) => {
const { id, url, external } = await this.resolveId(mock.id, mock.importer);
if (mock.action === "unmock") this.unmockPath(id);
if (mock.action === "mock") this.mockPath(mock.id, id, url, external, mock.type, mock.factory);
}));
VitestMocker.pendingIds = [];
}
ensureModule(id, url) {
const node = this.evaluatedModules.ensureModule(id, url);
// TODO
node.meta = {
id,
url,
code: "",
file: null,
invalidate: false
};
return node;
}
async callFunctionMock(id, url, mock) {
const node = this.ensureModule(id, url);
if (node.exports) return node.exports;
const exports$1 = await mock.resolve();
const moduleExports = new Proxy(exports$1, { get: (target, prop) => {
const val = target[prop];
// 'then' can exist on non-Promise objects, need nested instanceof check for logic to work
if (prop === "then") {
if (target instanceof Promise) return target.then.bind(target);
} else if (!(prop in target)) {
if (this.filterPublicKeys.includes(prop)) return;
throw this.createError(`[vitest] No "${String(prop)}" export is defined on the "${mock.raw}" mock. Did you forget to return it from "vi.mock"?
If you need to partially mock a module, you can use "importOriginal" helper inside:
`, `vi.mock(import("${mock.raw}"), async (importOriginal) => {
const actual = await importOriginal()
return {
...actual,
// your mocked methods
}
})`);
}
return val;
} });
node.exports = moduleExports;
return moduleExports;
}
// public method to avoid circular dependency
getMockContext() {
return this.mockContext;
}
// path used to store mocked dependencies
getMockPath(dep) {
return `mock:${dep}`;
}
getDependencyMock(id) {
return this.getMockerRegistry().getById(fixLeadingSlashes(id));
}
findMockRedirect(mockPath, external) {
return findMockRedirect(this.root, mockPath, external);
}
mockObject(object, mockExports = {}, behavior = "automock") {
const createMockInstance = this.spyModule?.createMockInstance;
if (!createMockInstance) throw this.createError("[vitest] `spyModule` is not defined. This is a Vitest error. Please open a new issue with reproduction.");
return mockObject({
globalConstructors: this.primitives,
createMockInstance,
type: behavior
}, object, mockExports);
}
unmockPath(id) {
this.getMockerRegistry().deleteById(id);
this.invalidateModuleById(id);
}
mockPath(originalId, id, url, external, mockType, factory) {
const registry = this.getMockerRegistry();
if (mockType === "manual") registry.register("manual", originalId, id, url, factory);
else if (mockType === "autospy") registry.register("autospy", originalId, id, url);
else {
const redirect = this.findMockRedirect(id, external);
if (redirect) registry.register("redirect", originalId, id, url, redirect);
else registry.register("automock", originalId, id, url);
}
// every time the mock is registered, we remove the previous one from the cache
this.invalidateModuleById(id);
}
async importActual(rawId, importer, callstack) {
const { url } = await this.resolveId(rawId, importer);
const node = await this.moduleRunner.fetchModule(url, importer);
return await this.moduleRunner.cachedRequest(node.url, node, callstack || [importer], void 0, true);
}
async importMock(rawId, importer) {
const { id, url, external } = await this.resolveId(rawId, importer);
let mock = this.getDependencyMock(id);
if (!mock) {
const redirect = this.findMockRedirect(id, external);
if (redirect) mock = new RedirectedModule(rawId, id, rawId, redirect);
else mock = new AutomockedModule(rawId, id, rawId);
}
if (mock.type === "automock" || mock.type === "autospy") {
const node = await this.moduleRunner.fetchModule(url, importer);
const mod = await this.moduleRunner.cachedRequest(url, node, [importer], void 0, true);
const Object = this.primitives.Object;
return this.mockObject(mod, Object.create(Object.prototype), mock.type);
}
if (mock.type === "manual") return this.callFunctionMock(id, url, mock);
const node = await this.moduleRunner.fetchModule(mock.redirect);
return this.moduleRunner.cachedRequest(mock.redirect, node, [importer], void 0, true);
}
async requestWithMockedModule(url, evaluatedNode, callstack, mock) {
const mockId = this.getMockPath(evaluatedNode.id);
if (mock.type === "automock" || mock.type === "autospy") {
const cache = this.evaluatedModules.getModuleById(mockId);
if (cache && cache.mockedExports) return cache.mockedExports;
const Object = this.primitives.Object;
// we have to define a separate object that will copy all properties into itself
// and can't just use the same `exports` define automatically by Vite before the evaluator
const exports$1 = Object.create(null);
Object.defineProperty(exports$1, Symbol.toStringTag, {
value: "Module",
configurable: true,
writable: true
});
const node = this.ensureModule(mockId, this.getMockPath(evaluatedNode.url));
node.meta = evaluatedNode.meta;
node.file = evaluatedNode.file;
node.mockedExports = exports$1;
const mod = await this.moduleRunner.cachedRequest(url, node, callstack, void 0, true);
this.mockObject(mod, exports$1, mock.type);
return exports$1;
}
if (mock.type === "manual" && !callstack.includes(mockId) && !callstack.includes(url)) try {
callstack.push(mockId);
// this will not work if user does Promise.all(import(), import())
// we can also use AsyncLocalStorage to store callstack, but this won't work in the browser
// maybe we should improve mock API in the future?
this.mockContext.callstack = callstack;
return await this.callFunctionMock(mockId, this.getMockPath(url), mock);
} finally {
this.mockContext.callstack = null;
const indexMock = callstack.indexOf(mockId);
callstack.splice(indexMock, 1);
}
else if (mock.type === "redirect" && !callstack.includes(mock.redirect)) return mock.redirect;
}
async mockedRequest(url, evaluatedNode, callstack) {
const mock = this.getDependencyMock(evaluatedNode.id);
if (!mock) return;
return this.requestWithMockedModule(url, evaluatedNode, callstack, mock);
}
queueMock(id, importer, factoryOrOptions) {
const mockType = getMockType(factoryOrOptions);
VitestMocker.pendingIds.push({
action: "mock",
id,
importer,
factory: typeof factoryOrOptions === "function" ? factoryOrOptions : void 0,
type: mockType
});
}
queueUnmock(id, importer) {
VitestMocker.pendingIds.push({
action: "unmock",
id,
importer
});
}
}
function getMockType(factoryOrOptions) {
if (!factoryOrOptions) return "automock";
if (typeof factoryOrOptions === "function") return "manual";
return factoryOrOptions.spy ? "autospy" : "automock";
}
// unique id that is not available as "$bare_import" like "test"
// https://nodejs.org/api/modules.html#built-in-modules-with-mandatory-node-prefix
const prefixedBuiltins = new Set([
"node:sea",
"node:sqlite",
"node:test",
"node:test/reporters"
]);
const isWindows$1 = process.platform === "win32";
// transform file url to id
// virtual:custom -> virtual:custom
// \0custom -> \0custom
// /root/id -> /id
// /root/id.js -> /id.js
// C:/root/id.js -> /id.js
// C:\root\id.js -> /id.js
// TODO: expose this in vite/module-runner
function normalizeModuleId(file) {
if (prefixedBuiltins.has(file)) return file;
// if it's not in the root, keep it as a path, not a URL
return slash(file).replace(/^\/@fs\//, isWindows$1 ? "" : "/").replace(/^node:/, "").replace(/^\/+/, "/").replace(/^file:\//, "/");
}
const windowsSlashRE = /\\/g;
function slash(p) {
return p.replace(windowsSlashRE, "/");
}
const multipleSlashRe = /^\/+/;
// module-runner incorrectly replaces file:///path with `///path`
function fixLeadingSlashes(id) {
if (id.startsWith("//")) return id.replace(multipleSlashRe, "/");
return id;
}
const createNodeImportMeta = (modulePath) => {
if (!viteModuleRunner.createDefaultImportMeta) throw new Error(`createNodeImportMeta is not supported in this version of Vite.`);
const defaultMeta = viteModuleRunner.createDefaultImportMeta(modulePath);
const href = defaultMeta.url;
const importMetaResolver = createImportMetaResolver();
return {
...defaultMeta,
main: false,
resolve(id, parent) {
return (importMetaResolver ?? defaultMeta.resolve)(id, parent ?? href);
}
};
};
function createImportMetaResolver() {
if (!import.meta.resolve) return;
return (specifier, importer) => import.meta.resolve(specifier, importer);
}
// @ts-expect-error overriding private method
class VitestModuleRunner extends viteModuleRunner.ModuleRunner {
mocker;
moduleExecutionInfo;
constructor(vitestOptions) {
const options = vitestOptions;
const transport = new VitestTransport(options.transport);
const evaluatedModules = options.evaluatedModules;
super({
transport,
hmr: false,
evaluatedModules,
sourcemapInterceptor: "prepareStackTrace",
createImportMeta: vitestOptions.createImportMeta
}, options.evaluator);
this.vitestOptions = vitestOptions;
this.moduleExecutionInfo = options.getWorkerState().moduleExecutionInfo;
this.mocker = options.mocker || new VitestMocker(this, {
spyModule: options.spyModule,
context: options.vm?.context,
resolveId: options.transport.resolveId,
get root() {
return options.getWorkerState().config.root;
},
get moduleDirectories() {
return options.getWorkerState().config.deps.moduleDirectories || [];
},
getCurrentTestFilepath() {
return options.getWorkerState().filepath;
}
});
if (options.vm) options.vm.context.__vitest_mocker__ = this.mocker;
else Object.defineProperty(globalThis, "__vitest_mocker__", {
configurable: true,
writable: true,
value: this.mocker
});
}
/**
* Vite checks that the module has exports emulating the Node.js behaviour,
* but Vitest is more relaxed.
*
* We should keep the Vite behavour when there is a `strict` flag.
* @internal
*/
processImport(exports$1) {
return exports$1;
}
async import(rawId) {
const resolved = await this.vitestOptions.transport.resolveId(rawId);
return super.import(resolved ? resolved.url : rawId);
}
async fetchModule(url, importer) {
return await this.cachedModule(url, importer);
}
_cachedRequest(url, module, callstack = [], metadata) {
// @ts-expect-error "cachedRequest" is private
return super.cachedRequest(url, module, callstack, metadata);
}
/**
* @internal
*/
async cachedRequest(url, mod, callstack = [], metadata, ignoreMock = false) {
if (ignoreMock) return this._cachedRequest(url, mod, callstack, metadata);
let mocked;
if (mod.meta && "mockedModule" in mod.meta) mocked = await this.mocker.requestWithMockedModule(url, mod, callstack, mod.meta.mockedModule);
else mocked = await this.mocker.mockedRequest(url, mod, callstack);
if (typeof mocked === "string") {
const node = await this.fetchModule(mocked);
return this._cachedRequest(mocked, node, callstack, metadata);
}
if (mocked != null && typeof mocked === "object") return mocked;
return this._cachedRequest(url, mod, callstack, metadata);
}
/** @internal */
_invalidateSubTreeById(ids, invalidated = /* @__PURE__ */ new Set()) {
for (const id of ids) {
if (invalidated.has(id)) continue;
const node = this.evaluatedModules.getModuleById(id);
if (!node) continue;
invalidated.add(id);
const subIds = Array.from(this.evaluatedModules.idToModuleMap).filter(([, mod]) => mod.importers.has(id)).map(([key]) => key);
if (subIds.length) this._invalidateSubTreeById(subIds, invalidated);
this.evaluatedModules.invalidateModule(node);
}
}
}
const bareVitestRegexp = /^@?vitest(?:\/|$)/;
const normalizedDistDir = normalize$1(distDir);
const relativeIds = {};
const externalizeMap = /* @__PURE__ */ new Map();
// all Vitest imports always need to be externalized
function getCachedVitestImport(id, state) {
if (id.startsWith("/@fs/") || id.startsWith("\\@fs\\")) id = id.slice(process.platform === "win32" ? 5 : 4);
if (externalizeMap.has(id)) return {
externalize: externalizeMap.get(id),
type: "module"
};
// always externalize Vitest because we import from there before running tests
// so we already have it cached by Node.js
const root = state().config.root;
const relativeRoot = relativeIds[root] ?? (relativeIds[root] = normalizedDistDir.slice(root.length));
if (id.includes(distDir) || id.includes(normalizedDistDir)) {
const externalize = id.startsWith("file://") ? id : pathToFileURL(id).toString();
externalizeMap.set(id, externalize);
return {
externalize,
type: "module"
};
}
if (relativeRoot && relativeRoot !== "/" && id.startsWith(relativeRoot)) {
const externalize = pathToFileURL(join$1(root, id)).toString();
externalizeMap.set(id, externalize);
return {
externalize,
type: "module"
};
}
if (bareVitestRegexp.test(id)) {
externalizeMap.set(id, id);
return {
externalize: id,
type: "module"
};
}
return null;
}
// Store globals in case tests overwrite them
const processListeners = process.listeners.bind(process);
const processOn = process.on.bind(process);
const processOff = process.off.bind(process);
const dispose = [];
function listenForErrors(state) {
dispose.forEach((fn) => fn());
dispose.length = 0;
function catchError(err, type, event) {
const worker = state();
// if there is another listener, assume that it's handled by user code
// one is Vitest's own listener
if (processListeners(event).length > 1) return;
const error = serializeValue(err);
if (typeof error === "object" && error != null) {
error.VITEST_TEST_NAME = worker.current?.type === "test" ? worker.current.name : void 0;
if (worker.filepath) error.VITEST_TEST_PATH = worker.filepath;
}
state().rpc.onUnhandledError(error, type);
}
const uncaughtException = (e) => catchError(e, "Uncaught Exception", "uncaughtException");
const unhandledRejection = (e) => catchError(e, "Unhandled Rejection", "unhandledRejection");
processOn("uncaughtException", uncaughtException);
processOn("unhandledRejection", unhandledRejection);
dispose.push(() => {
processOff("uncaughtException", uncaughtException);
processOff("unhandledRejection", unhandledRejection);
});
}
const { readFileSync } = fs;
const browserExternalId = "__vite-browser-external";
const browserExternalLength = 24;
const VITEST_VM_CONTEXT_SYMBOL = "__vitest_vm_context__";
const cwd = process.cwd();
const isWindows = process.platform === "win32";
function startVitestModuleRunner(options) {
const state = () => globalThis.__vitest_worker__ || options.state;
const rpc = () => state().rpc;
process.exit = (code = process.exitCode || 0) => {
throw new Error(`process.exit unexpectedly called with "${code}"`);
};
listenForErrors(state);
const environment = () => {
const environment = state().environment;
return environment.viteEnvironment || environment.name;
};
const vm = options.context && options.externalModulesExecutor ? {
context: options.context,
externalModulesExecutor: options.externalModulesExecutor
} : void 0;
const evaluator = options.evaluator || new VitestModuleEvaluator(vm, {
get moduleExecutionInfo() {
return state().moduleExecutionInfo;
},
get interopDefault() {
return state().config.deps.interopDefault;
},
getCurrentTestFilepath: () => state().filepath
});
const moduleRunner = new VitestModuleRunner({
spyModule: options.spyModule,
evaluatedModules: options.evaluatedModules,
evaluator,
mocker: options.mocker,
transport: {
async fetchModule(id, importer, options) {
const resolvingModules = state().resolvingModules;
if (isWindows) {
if (id[1] === ":") {
// The drive letter is different for whatever reason, we need to normalize it to CWD
if (id[0] !== cwd[0] && id[0].toUpperCase() === cwd[0].toUpperCase()) id = (cwd[0].toUpperCase() === cwd[0] ? id[0].toUpperCase() : id[0].toLowerCase()) + id.slice(1);
// always mark absolute windows paths, otherwise Vite will externalize it
id = `/@id/${id}`;
}
}
const vitest = getCachedVitestImport(id, state);
if (vitest) return vitest;
const rawId = unwrapId(id);
resolvingModules.add(rawId);
try {
if (VitestMocker.pendingIds.length) await moduleRunner.mocker.resolveMocks();
const resolvedMock = moduleRunner.mocker.getDependencyMock(rawId);
if (resolvedMock?.type === "manual" || resolvedMock?.type === "redirect") return {
code: "",
file: null,
id,
url: id,
invalidate: false,
mockedModule: resolvedMock
};
if (isBuiltin(rawId) || rawId.startsWith(browserExternalId)) return {
externalize: toBuiltin(rawId),
type: "builtin"
};
const result = await rpc().fetch(id, importer, environment(), options);
if ("cached" in result) return {
code: readFileSync(result.tmp, "utf-8"),
...result
};
return result;
} catch (cause) {
// rethrow vite error if it cannot load the module because it's not resolved
if (typeof cause === "object" && cause != null && cause.code === "ERR_LOAD_URL" || typeof cause?.message === "string" && cause.message.includes("Failed to load url") || typeof cause?.message === "string" && cause.message.startsWith("Cannot find module '")) {
const error = new Error(`Cannot find ${isBareImport(id) ? "package" : "module"} '${id}'${importer ? ` imported from '${importer}'` : ""}`, { cause });
error.code = "ERR_MODULE_NOT_FOUND";
throw error;
}
throw cause;
} finally {
resolvingModules.delete(rawId);
}
},
resolveId(id, importer) {
return rpc().resolve(id, importer, environment());
}
},
getWorkerState: state,
vm,
createImportMeta: options.createImportMeta
});
return moduleRunner;
}
function toBuiltin(id) {
if (id.startsWith(browserExternalId)) id = id.slice(browserExternalLength);
if (!id.startsWith("node:")) id = `node:${id}`;
return id;
}
export { VitestModuleRunner as V, VITEST_VM_CONTEXT_SYMBOL as a, VitestTransport as b, createNodeImportMeta as c, startVitestModuleRunner as s };
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L M G"},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 wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","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"},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 jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","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 FD GD HD ID NC uC JD OC"},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 oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD","2":"J"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"2D","2":"1D"}},B:1,C:"Passive event listeners",D:true};
@@ -0,0 +1,2 @@
var convert = require('./convert');
module.exports = convert(require('../array'));
@@ -0,0 +1,287 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ExportAllDeclaration = ExportAllDeclaration;
exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
exports.ExportDefaultSpecifier = ExportDefaultSpecifier;
exports.ExportNamedDeclaration = ExportNamedDeclaration;
exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier;
exports.ExportSpecifier = ExportSpecifier;
exports.ImportAttribute = ImportAttribute;
exports.ImportDeclaration = ImportDeclaration;
exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
exports.ImportExpression = ImportExpression;
exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
exports.ImportSpecifier = ImportSpecifier;
exports._printAttributes = _printAttributes;
var _t = require("@babel/types");
var _index = require("../node/index.js");
const {
isClassDeclaration,
isExportDefaultSpecifier,
isExportNamespaceSpecifier,
isImportDefaultSpecifier,
isImportNamespaceSpecifier,
isStatement
} = _t;
function ImportSpecifier(node) {
if (node.importKind === "type" || node.importKind === "typeof") {
this.word(node.importKind);
this.space();
}
this.print(node.imported);
if (node.local && node.local.name !== node.imported.name) {
this.space();
this.word("as");
this.space();
this.print(node.local);
}
}
function ImportDefaultSpecifier(node) {
this.print(node.local);
}
function ExportDefaultSpecifier(node) {
this.print(node.exported);
}
function ExportSpecifier(node) {
if (node.exportKind === "type") {
this.word("type");
this.space();
}
this.print(node.local);
if (node.exported && node.local.name !== node.exported.name) {
this.space();
this.word("as");
this.space();
this.print(node.exported);
}
}
function ExportNamespaceSpecifier(node) {
this.tokenChar(42);
this.space();
this.word("as");
this.space();
this.print(node.exported);
}
let warningShown = false;
function _printAttributes(node, hasPreviousBrace) {
var _node$extra;
const {
importAttributesKeyword
} = this.format;
const {
attributes,
assertions
} = node;
if (attributes && !importAttributesKeyword && node.extra && (node.extra.deprecatedAssertSyntax || node.extra.deprecatedWithLegacySyntax) && !warningShown) {
warningShown = true;
console.warn(`\
You are using import attributes, without specifying the desired output syntax.
Please specify the "importAttributesKeyword" generator option, whose value can be one of:
- "with" : \`import { a } from "b" with { type: "json" };\`
- "assert" : \`import { a } from "b" assert { type: "json" };\`
- "with-legacy" : \`import { a } from "b" with type: "json";\`
`);
}
const useAssertKeyword = importAttributesKeyword === "assert" || !importAttributesKeyword && assertions;
this.word(useAssertKeyword ? "assert" : "with");
this.space();
if (!useAssertKeyword && (importAttributesKeyword === "with-legacy" || !importAttributesKeyword && (_node$extra = node.extra) != null && _node$extra.deprecatedWithLegacySyntax)) {
this.printList(attributes || assertions);
return;
}
const occurrenceCount = hasPreviousBrace ? 1 : 0;
this.token("{", undefined, occurrenceCount);
this.space();
this.printList(attributes || assertions, this.shouldPrintTrailingComma("}"));
this.space();
this.token("}", undefined, occurrenceCount);
}
function ExportAllDeclaration(node) {
var _node$attributes, _node$assertions;
this.word("export");
this.space();
if (node.exportKind === "type") {
this.word("type");
this.space();
}
this.tokenChar(42);
this.space();
this.word("from");
this.space();
if ((_node$attributes = node.attributes) != null && _node$attributes.length || (_node$assertions = node.assertions) != null && _node$assertions.length) {
this.print(node.source, true);
this.space();
this._printAttributes(node, false);
} else {
this.print(node.source);
}
this.semicolon();
}
function maybePrintDecoratorsBeforeExport(printer, node) {
if (isClassDeclaration(node.declaration) && printer._shouldPrintDecoratorsBeforeExport(node)) {
printer.printJoin(node.declaration.decorators);
}
}
function ExportNamedDeclaration(node) {
maybePrintDecoratorsBeforeExport(this, node);
this.word("export");
this.space();
if (node.declaration) {
const declar = node.declaration;
this.print(declar);
if (!isStatement(declar)) this.semicolon();
} else {
if (node.exportKind === "type") {
this.word("type");
this.space();
}
const specifiers = node.specifiers.slice(0);
let hasSpecial = false;
for (;;) {
const first = specifiers[0];
if (isExportDefaultSpecifier(first) || isExportNamespaceSpecifier(first)) {
hasSpecial = true;
this.print(specifiers.shift());
if (specifiers.length) {
this.tokenChar(44);
this.space();
}
} else {
break;
}
}
let hasBrace = false;
if (specifiers.length || !specifiers.length && !hasSpecial) {
hasBrace = true;
this.tokenChar(123);
if (specifiers.length) {
this.space();
this.printList(specifiers, this.shouldPrintTrailingComma("}"));
this.space();
}
this.tokenChar(125);
}
if (node.source) {
var _node$attributes2, _node$assertions2;
this.space();
this.word("from");
this.space();
if ((_node$attributes2 = node.attributes) != null && _node$attributes2.length || (_node$assertions2 = node.assertions) != null && _node$assertions2.length) {
this.print(node.source, true);
this.space();
this._printAttributes(node, hasBrace);
} else {
this.print(node.source);
}
}
this.semicolon();
}
}
function ExportDefaultDeclaration(node) {
maybePrintDecoratorsBeforeExport(this, node);
this.word("export");
this.noIndentInnerCommentsHere();
this.space();
this.word("default");
this.space();
this.tokenContext |= _index.TokenContext.exportDefault;
const declar = node.declaration;
this.print(declar);
if (!isStatement(declar)) this.semicolon();
}
function ImportDeclaration(node) {
var _node$attributes3, _node$assertions3;
this.word("import");
this.space();
const isTypeKind = node.importKind === "type" || node.importKind === "typeof";
if (isTypeKind) {
this.noIndentInnerCommentsHere();
this.word(node.importKind);
this.space();
} else if (node.module) {
this.noIndentInnerCommentsHere();
this.word("module");
this.space();
} else if (node.phase) {
this.noIndentInnerCommentsHere();
this.word(node.phase);
this.space();
}
const specifiers = node.specifiers.slice(0);
const hasSpecifiers = !!specifiers.length;
while (hasSpecifiers) {
const first = specifiers[0];
if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) {
this.print(specifiers.shift());
if (specifiers.length) {
this.tokenChar(44);
this.space();
}
} else {
break;
}
}
let hasBrace = false;
if (specifiers.length) {
hasBrace = true;
this.tokenChar(123);
this.space();
this.printList(specifiers, this.shouldPrintTrailingComma("}"));
this.space();
this.tokenChar(125);
} else if (isTypeKind && !hasSpecifiers) {
hasBrace = true;
this.tokenChar(123);
this.tokenChar(125);
}
if (hasSpecifiers || isTypeKind) {
this.space();
this.word("from");
this.space();
}
if ((_node$attributes3 = node.attributes) != null && _node$attributes3.length || (_node$assertions3 = node.assertions) != null && _node$assertions3.length) {
this.print(node.source, true);
this.space();
this._printAttributes(node, hasBrace);
} else {
this.print(node.source);
}
this.semicolon();
}
function ImportAttribute(node) {
this.print(node.key);
this.tokenChar(58);
this.space();
this.print(node.value);
}
function ImportNamespaceSpecifier(node) {
this.tokenChar(42);
this.space();
this.word("as");
this.space();
this.print(node.local);
}
function ImportExpression(node) {
this.word("import");
if (node.phase) {
this.tokenChar(46);
this.word(node.phase);
}
this.tokenChar(40);
const shouldPrintTrailingComma = this.shouldPrintTrailingComma(")");
this.print(node.source);
if (node.options != null) {
this.tokenChar(44);
this.space();
this.print(node.options);
}
if (shouldPrintTrailingComma) {
this.tokenChar(44);
}
this.rightParens(node);
}
//# sourceMappingURL=modules.js.map
@@ -0,0 +1,44 @@
var $51588fd411aace25$exports = require("./CollectionBuilder.main.js");
var $bSehf$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useCollection", () => $98fc0fafaca75b6a$export$6cd28814d92fa9c9);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $98fc0fafaca75b6a$export$6cd28814d92fa9c9(props, factory, context) {
let builder = (0, $bSehf$react.useMemo)(()=>new (0, $51588fd411aace25$exports.CollectionBuilder)(), []);
let { children: children, items: items, collection: collection } = props;
let result = (0, $bSehf$react.useMemo)(()=>{
if (collection) return collection;
let nodes = builder.build({
children: children,
items: items
}, context);
return factory(nodes);
}, [
builder,
children,
items,
collection,
context,
factory
]);
return result;
}
//# sourceMappingURL=useCollection.main.js.map
@@ -0,0 +1,62 @@
var baseGetTag = require('./_baseGetTag'),
getPrototype = require('./_getPrototype'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var objectTag = '[object Object]';
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString;
}
module.exports = isPlainObject;
@@ -0,0 +1 @@
{"name":"glob","version":"7.2.3","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532120654,"integrity":"sha512-zZT1RifZPqDEvsUSnXCwoEU5ebufUnImMS3WOv9Yxi2MVzmZCkdqYFJ8TDT+oj96oaq7a8AGxAIZIi2/BMi/sA==","mode":420,"size":976},"common.js":{"checkedAt":1794532120655,"integrity":"sha512-P2YzjYTsHW7YdCKJJ9qd4LicKQF2TV5XyzI/NFu8fjkvNTOZeUxqOWIZ8X5SKTTu9j4n0RVRkARsIRntmgjAyA==","mode":420,"size":6149},"glob.js":{"checkedAt":1794532120655,"integrity":"sha512-e9LU/RCqdCZyfZMyLuVupXZ8h/w60dJiDMkoip7zJni+mBbDejZxNyDTCmlGjLDotXfbGv+sIX9V+0VfXbLjwA==","mode":420,"size":19445},"sync.js":{"checkedAt":1794532120655,"integrity":"sha512-LbcMAZSgZke0JPC3IJr+d1FjPtLqH/XCSWnEGi1ZUenQE8Z4uswfswCRnRjzp4jcWQH1d20bYgJEocgfxHBWIQ==","mode":420,"size":12020},"package.json":{"checkedAt":1794532120655,"integrity":"sha512-jbn7g7Rd9ULQb0Bc5QCuxj47DONWwwmMnFj1b9RjX6HQFtpvpdoztHYxt6AEyGadgoGkMM7L/Y43V3yRIw82fg==","mode":420,"size":1237},"README.md":{"checkedAt":1794532120655,"integrity":"sha512-NTadTNEHf3Jf+FG8j8I8Us3xQ25+JQ2q4L57ATsL7wyYJ8d2ZwqGDW9qrO7+qvePTS+qUfTPPvepUHfrg7SAsQ==","mode":420,"size":15237}}}
@@ -0,0 +1,2 @@
export function peowly<Flags extends import("./flag-types.d.ts").AnyFlags>(options: import("./peowly-types.d.ts").PeowlyOptions<Flags>): import("./peowly-types.d.ts").PeowlyResult<Flags>;
//# sourceMappingURL=peowly.d.ts.map
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = cloneWithoutLoc;
var _cloneNode = require("./cloneNode.js");
function cloneWithoutLoc(node) {
return (0, _cloneNode.default)(node, false, true);
}
//# sourceMappingURL=cloneWithoutLoc.js.map
@@ -0,0 +1,8 @@
var $9f576b39d8e7a9d6$exports = {};
$9f576b39d8e7a9d6$exports = {
"dismiss": `Lukk`
};
export {$9f576b39d8e7a9d6$exports as default};
//# sourceMappingURL=nb-NO.module.js.map
@@ -0,0 +1,10 @@
"use client";
import {
checkbox_default
} from "./chunk-XJ2YRSUP.mjs";
import "./chunk-FFVF7OUL.mjs";
import "./chunk-VBM6YDUQ.mjs";
import "./chunk-LK575OWX.mjs";
export {
checkbox_default as default
};
@@ -0,0 +1,62 @@
{
"name": "wrap-ansi",
"version": "7.0.0",
"description": "Wordwrap a string with ANSI escape codes",
"license": "MIT",
"repository": "chalk/wrap-ansi",
"funding": "https://github.com/chalk/wrap-ansi?sponsor=1",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=10"
},
"scripts": {
"test": "xo && nyc ava"
},
"files": [
"index.js"
],
"keywords": [
"wrap",
"break",
"wordwrap",
"wordbreak",
"linewrap",
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"cli",
"string",
"tty",
"escape",
"formatting",
"rgb",
"256",
"shell",
"xterm",
"log",
"logging",
"command-line",
"text"
],
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"devDependencies": {
"ava": "^2.1.0",
"chalk": "^4.0.0",
"coveralls": "^3.0.3",
"has-ansi": "^4.0.0",
"nyc": "^15.0.1",
"xo": "^0.29.1"
}
}
@@ -0,0 +1,11 @@
var adapter = require('./');
/**
* Extracts the values from process.env.
*
* @type {Function}
* @public
*/
module.exports = adapter(function storage() {
return localStorage.getItem('debug') || localStorage.getItem('diagnostics');
});
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_initializer_warning_helper.cjs",
"module": "../../esm/_initializer_warning_helper.js"
}
@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveBindingDeactivations = resolveBindingDeactivations;
const common_1 = require("@inversifyjs/common");
const resolveBindingPreDestroy_1 = require("./resolveBindingPreDestroy");
const resolveBindingServiceDeactivations_1 = require("./resolveBindingServiceDeactivations");
const CACHE_KEY_TYPE = 'cache';
function resolveBindingDeactivations(params, binding) {
const preDestroyResult = (0, resolveBindingPreDestroy_1.resolveBindingPreDestroy)(params, binding);
if (preDestroyResult === undefined) {
return resolveBindingDeactivationsAfterPreDestroy(params, binding);
}
return preDestroyResult.then(() => resolveBindingDeactivationsAfterPreDestroy(params, binding));
}
function resolveBindingDeactivationsAfterPreDestroy(params, binding) {
const bindingCache = binding.cache;
if ((0, common_1.isPromise)(bindingCache.value)) {
return bindingCache.value.then((resolvedValue) => resolveBindingDeactivationsAfterPreDestroyFromValue(params, binding, resolvedValue));
}
return resolveBindingDeactivationsAfterPreDestroyFromValue(params, binding, bindingCache.value);
}
function resolveBindingDeactivationsAfterPreDestroyFromValue(params, binding, resolvedValue) {
let deactivationResult = undefined;
if (binding.onDeactivation !== undefined) {
const bindingDeactivation = binding.onDeactivation;
deactivationResult = bindingDeactivation(resolvedValue);
}
if (deactivationResult === undefined) {
return (0, resolveBindingServiceDeactivations_1.resolveBindingServiceDeactivations)(params, binding.serviceIdentifier, resolvedValue);
}
else {
return deactivationResult.then(() => (0, resolveBindingServiceDeactivations_1.resolveBindingServiceDeactivations)(params, binding.serviceIdentifier, resolvedValue));
}
}
//# sourceMappingURL=resolveBindingDeactivations.js.map
@@ -0,0 +1,400 @@
import { Decimal } from 'decimal.js';
import { ZERO } from './constants';
import { invariant } from './utils';
/**
* https://tc39.es/ecma262/#sec-tostring
*/
export function ToString(o) {
// Only symbol is irregular...
if (typeof o === 'symbol') {
throw TypeError('Cannot convert a Symbol value to a string');
}
return String(o);
}
/**
* https://tc39.es/ecma262/#sec-tonumber
* @param val
*/
export function ToNumber(arg) {
if (typeof arg === 'number') {
return new Decimal(arg);
}
invariant(typeof arg !== 'bigint' && typeof arg !== 'symbol', 'BigInt and Symbol are not supported', TypeError);
if (arg === undefined) {
return new Decimal(NaN);
}
if (arg === null || arg === 0) {
return ZERO;
}
if (arg === true) {
return new Decimal(1);
}
if (typeof arg === 'string') {
try {
return new Decimal(arg);
}
catch (e) {
return new Decimal(NaN);
}
}
invariant(typeof arg === 'object', 'object expected', TypeError);
var primValue = ToPrimitive(arg, 'number');
invariant(typeof primValue !== 'object', 'object expected', TypeError);
return ToNumber(primValue);
}
/**
* https://tc39.es/ecma262/#sec-tointeger
* @param n
*/
function ToInteger(n) {
var number = ToNumber(n);
if (number.isNaN() || number.isZero()) {
return ZERO;
}
if (number.isFinite()) {
return number;
}
var integer = number.abs().floor();
if (number.isNegative()) {
integer = integer.negated();
}
return integer;
}
/**
* https://tc39.es/ecma262/#sec-timeclip
* @param time
*/
export function TimeClip(time) {
if (!time.isFinite()) {
return new Decimal(NaN);
}
if (time.abs().greaterThan(8.64 * 1e15)) {
return new Decimal(NaN);
}
return ToInteger(time);
}
/**
* https://tc39.es/ecma262/#sec-toobject
* @param arg
*/
export function ToObject(arg) {
if (arg == null) {
throw new TypeError('undefined/null cannot be converted to object');
}
return Object(arg);
}
/**
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-samevalue
* @param x
* @param y
*/
export function SameValue(x, y) {
if (Object.is) {
return Object.is(x, y);
}
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
return x !== 0 || 1 / x === 1 / y;
}
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
/**
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-arraycreate
* @param len
*/
export function ArrayCreate(len) {
return new Array(len);
}
/**
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-hasownproperty
* @param o
* @param prop
*/
export function HasOwnProperty(o, prop) {
return Object.prototype.hasOwnProperty.call(o, prop);
}
/**
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-type
* @param x
*/
export function Type(x) {
if (x === null) {
return 'Null';
}
if (typeof x === 'undefined') {
return 'Undefined';
}
if (typeof x === 'function' || typeof x === 'object') {
return 'Object';
}
if (typeof x === 'number') {
return 'Number';
}
if (typeof x === 'boolean') {
return 'Boolean';
}
if (typeof x === 'string') {
return 'String';
}
if (typeof x === 'symbol') {
return 'Symbol';
}
if (typeof x === 'bigint') {
return 'BigInt';
}
}
var MS_PER_DAY = 86400000;
/**
* https://www.ecma-international.org/ecma-262/11.0/index.html#eqn-modulo
* @param x
* @param y
* @return k of the same sign as y
*/
function mod(x, y) {
return x - Math.floor(x / y) * y;
}
/**
* https://tc39.es/ecma262/#eqn-Day
* @param t
*/
export function Day(t) {
return Math.floor(t / MS_PER_DAY);
}
/**
* https://tc39.es/ecma262/#sec-week-day
* @param t
*/
export function WeekDay(t) {
return mod(Day(t) + 4, 7);
}
/**
* https://tc39.es/ecma262/#sec-year-number
* @param y
*/
export function DayFromYear(y) {
if (y < 100) {
// Date.UTC parses 0 - 99 as 1900 - 1999
var date = new Date(0);
date.setUTCFullYear(y, 0, 1);
date.setUTCHours(0, 0, 0, 0);
return date.getTime() / MS_PER_DAY;
}
return Date.UTC(y, 0) / MS_PER_DAY;
}
/**
* https://tc39.es/ecma262/#sec-year-number
* @param y
*/
export function TimeFromYear(y) {
return Date.UTC(y, 0);
}
/**
* https://tc39.es/ecma262/#sec-year-number
* @param t
*/
export function YearFromTime(t) {
return new Date(t).getUTCFullYear();
}
export function DaysInYear(y) {
if (y % 4 !== 0) {
return 365;
}
if (y % 100 !== 0) {
return 366;
}
if (y % 400 !== 0) {
return 365;
}
return 366;
}
export function DayWithinYear(t) {
return Day(t) - DayFromYear(YearFromTime(t));
}
export function InLeapYear(t) {
return DaysInYear(YearFromTime(t)) === 365 ? 0 : 1;
}
/**
* https://tc39.es/ecma262/#sec-month-number
* @param t
*/
export function MonthFromTime(t) {
var dwy = DayWithinYear(t);
var leap = InLeapYear(t);
if (dwy >= 0 && dwy < 31) {
return 0;
}
if (dwy < 59 + leap) {
return 1;
}
if (dwy < 90 + leap) {
return 2;
}
if (dwy < 120 + leap) {
return 3;
}
if (dwy < 151 + leap) {
return 4;
}
if (dwy < 181 + leap) {
return 5;
}
if (dwy < 212 + leap) {
return 6;
}
if (dwy < 243 + leap) {
return 7;
}
if (dwy < 273 + leap) {
return 8;
}
if (dwy < 304 + leap) {
return 9;
}
if (dwy < 334 + leap) {
return 10;
}
if (dwy < 365 + leap) {
return 11;
}
throw new Error('Invalid time');
}
export function DateFromTime(t) {
var dwy = DayWithinYear(t);
var mft = MonthFromTime(t);
var leap = InLeapYear(t);
if (mft === 0) {
return dwy + 1;
}
if (mft === 1) {
return dwy - 30;
}
if (mft === 2) {
return dwy - 58 - leap;
}
if (mft === 3) {
return dwy - 89 - leap;
}
if (mft === 4) {
return dwy - 119 - leap;
}
if (mft === 5) {
return dwy - 150 - leap;
}
if (mft === 6) {
return dwy - 180 - leap;
}
if (mft === 7) {
return dwy - 211 - leap;
}
if (mft === 8) {
return dwy - 242 - leap;
}
if (mft === 9) {
return dwy - 272 - leap;
}
if (mft === 10) {
return dwy - 303 - leap;
}
if (mft === 11) {
return dwy - 333 - leap;
}
throw new Error('Invalid time');
}
var HOURS_PER_DAY = 24;
var MINUTES_PER_HOUR = 60;
var SECONDS_PER_MINUTE = 60;
var MS_PER_SECOND = 1e3;
var MS_PER_MINUTE = MS_PER_SECOND * SECONDS_PER_MINUTE;
var MS_PER_HOUR = MS_PER_MINUTE * MINUTES_PER_HOUR;
export function HourFromTime(t) {
return mod(Math.floor(t / MS_PER_HOUR), HOURS_PER_DAY);
}
export function MinFromTime(t) {
return mod(Math.floor(t / MS_PER_MINUTE), MINUTES_PER_HOUR);
}
export function SecFromTime(t) {
return mod(Math.floor(t / MS_PER_SECOND), SECONDS_PER_MINUTE);
}
function IsCallable(fn) {
return typeof fn === 'function';
}
/**
* The abstract operation OrdinaryHasInstance implements
* the default algorithm for determining if an object O
* inherits from the instance object inheritance path
* provided by constructor C.
* @param C class
* @param O object
* @param internalSlots internalSlots
*/
export function OrdinaryHasInstance(C, O, internalSlots) {
if (!IsCallable(C)) {
return false;
}
if (internalSlots === null || internalSlots === void 0 ? void 0 : internalSlots.boundTargetFunction) {
var BC = internalSlots === null || internalSlots === void 0 ? void 0 : internalSlots.boundTargetFunction;
return O instanceof BC;
}
if (typeof O !== 'object') {
return false;
}
var P = C.prototype;
if (typeof P !== 'object') {
throw new TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.');
}
return Object.prototype.isPrototypeOf.call(P, O);
}
export function msFromTime(t) {
return mod(t, MS_PER_SECOND);
}
function OrdinaryToPrimitive(O, hint) {
var methodNames;
if (hint === 'string') {
methodNames = ['toString', 'valueOf'];
}
else {
methodNames = ['valueOf', 'toString'];
}
for (var _i = 0, methodNames_1 = methodNames; _i < methodNames_1.length; _i++) {
var name_1 = methodNames_1[_i];
var method = O[name_1];
if (IsCallable(method)) {
var result = method.call(O);
if (typeof result !== 'object') {
return result;
}
}
}
throw new TypeError('Cannot convert object to primitive value');
}
export function ToPrimitive(input, preferredType) {
if (typeof input === 'object' && input != null) {
var exoticToPrim = Symbol.toPrimitive in input ? input[Symbol.toPrimitive] : undefined;
var hint = void 0;
if (exoticToPrim !== undefined) {
if (preferredType === undefined) {
hint = 'default';
}
else if (preferredType === 'string') {
hint = 'string';
}
else {
invariant(preferredType === 'number', 'preferredType must be "string" or "number"');
hint = 'number';
}
var result = exoticToPrim.call(input, hint);
if (typeof result !== 'object') {
return result;
}
throw new TypeError('Cannot convert exotic object to primitive.');
}
if (preferredType === undefined) {
preferredType = 'number';
}
return OrdinaryToPrimitive(input, preferredType);
}
return input;
}
@@ -0,0 +1,26 @@
/**
* Check if the value is a plain object
*
* 校验是否是一个普通对象
*
* @example
* ```js
* import { isPlainObject } from 'is-what-type';
*
* isPlainObject({}); // true
* isPlainObject({ key: 'value' }); // true
* isPlainObject([]); // false
* isPlainObject(null); // false
* isPlainObject(undefined); // false
* isPlainObject(function() {}); // false
* isPlainObject(new Date()); // false
* isPlainObject(new (class {})()); // false
*
* function Fn() {}
* isPlainObject(new Fn()); // false
* ```
*
* @param value The value to check
* @returns `true` if the value is a plain object, else `false`
*/
export declare function isPlainObject<T = object>(value: unknown): value is T;
@@ -0,0 +1,50 @@
"use strict";
exports.__esModule = true;
exports["default"] = void 0;
var _cssesc = _interopRequireDefault(require("cssesc"));
var _util = require("../util");
var _node = _interopRequireDefault(require("./node"));
var _types = require("./types");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
var ClassName = /*#__PURE__*/function (_Node) {
_inheritsLoose(ClassName, _Node);
function ClassName(opts) {
var _this;
_this = _Node.call(this, opts) || this;
_this.type = _types.CLASS;
_this._constructed = true;
return _this;
}
var _proto = ClassName.prototype;
_proto.valueToString = function valueToString() {
return '.' + _Node.prototype.valueToString.call(this);
};
_createClass(ClassName, [{
key: "value",
get: function get() {
return this._value;
},
set: function set(v) {
if (this._constructed) {
var escaped = (0, _cssesc["default"])(v, {
isIdentifier: true
});
if (escaped !== v) {
(0, _util.ensureObject)(this, "raws");
this.raws.value = escaped;
} else if (this.raws) {
delete this.raws.value;
}
}
this._value = v;
}
}]);
return ClassName;
}(_node["default"]);
exports["default"] = ClassName;
module.exports = exports.default;
@@ -0,0 +1,4 @@
import { ServiceIdentifier } from '@inversifyjs/common';
import { BindingConstraints } from '@inversifyjs/core';
export declare function isParentBindingConstraintsWithServiceId(serviceId: ServiceIdentifier): (constraints: BindingConstraints) => boolean;
//# sourceMappingURL=isParentBindingConstraintsWithServiceId.d.ts.map
@@ -0,0 +1,13 @@
'use strict';
const callsites = () => {
const _prepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = (_, stack) => stack;
const stack = new Error().stack.slice(1);
Error.prepareStackTrace = _prepareStackTrace;
return stack;
};
module.exports = callsites;
// TODO: Remove this for the next major release
module.exports.default = callsites;
@@ -0,0 +1 @@
{"version":3,"file":"PlanParamsOperationsManager.d.ts","sourceRoot":"","sources":["../../../../src/container/services/PlanParamsOperationsManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,qBAAa,2BAA2B;;IACtC,SAAgB,oBAAoB,EAAE,oBAAoB,CAAC;gBAG/C,uBAAuB,EAAE,uBAAuB;CAoD7D"}
@@ -0,0 +1,29 @@
import {createFocusManager as $9bf71ea28793e738$export$c5251b9e124bf29, FocusScope as $9bf71ea28793e738$export$20e40289641fbbb6, getFocusableTreeWalker as $9bf71ea28793e738$export$2d6ec8fc375ceafa, isElementInChildOfActiveScope as $9bf71ea28793e738$export$1258395f99bf9cbf, useFocusManager as $9bf71ea28793e738$export$10c5169755ce7bd7} from "./FocusScope.mjs";
import {FocusRing as $907718708eab68af$export$1a38b4ad7f578e1d} from "./FocusRing.mjs";
import {useFocusRing as $f7dceffc5ad7768b$export$4e328f61c538687f} from "./useFocusRing.mjs";
import {useHasTabbableChild as $83013635b024ae3d$export$eac1895992b9f3d6} from "./useHasTabbableChild.mjs";
import {dispatchVirtualBlur as $55f9b1ae81f22853$export$6c5dc7e81d2cc29a, dispatchVirtualFocus as $55f9b1ae81f22853$export$2b35b76d2e30e129, getVirtuallyFocusedElement as $55f9b1ae81f22853$export$759df0d867455a91, moveVirtualFocus as $55f9b1ae81f22853$export$76e4e37e5339496d} from "./virtualFocus.mjs";
import {isFocusable as $d48f97c9d1a8e323$re_export$isFocusable} from "@react-aria/utils";
import {FocusableProvider as $d48f97c9d1a8e323$re_export$FocusableProvider, Focusable as $d48f97c9d1a8e323$re_export$Focusable, useFocusable as $d48f97c9d1a8e323$re_export$useFocusable, focusSafely as $d48f97c9d1a8e323$re_export$focusSafely} from "@react-aria/interactions";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
export {$9bf71ea28793e738$export$20e40289641fbbb6 as FocusScope, $9bf71ea28793e738$export$10c5169755ce7bd7 as useFocusManager, $9bf71ea28793e738$export$2d6ec8fc375ceafa as getFocusableTreeWalker, $9bf71ea28793e738$export$c5251b9e124bf29 as createFocusManager, $9bf71ea28793e738$export$1258395f99bf9cbf as isElementInChildOfActiveScope, $907718708eab68af$export$1a38b4ad7f578e1d as FocusRing, $f7dceffc5ad7768b$export$4e328f61c538687f as useFocusRing, $83013635b024ae3d$export$eac1895992b9f3d6 as useHasTabbableChild, $55f9b1ae81f22853$export$76e4e37e5339496d as moveVirtualFocus, $55f9b1ae81f22853$export$6c5dc7e81d2cc29a as dispatchVirtualBlur, $55f9b1ae81f22853$export$2b35b76d2e30e129 as dispatchVirtualFocus, $55f9b1ae81f22853$export$759df0d867455a91 as getVirtuallyFocusedElement, $d48f97c9d1a8e323$re_export$isFocusable as isFocusable, $d48f97c9d1a8e323$re_export$FocusableProvider as FocusableProvider, $d48f97c9d1a8e323$re_export$Focusable as Focusable, $d48f97c9d1a8e323$re_export$useFocusable as useFocusable, $d48f97c9d1a8e323$re_export$focusSafely as focusSafely};
//# sourceMappingURL=module.js.map
@@ -0,0 +1,94 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* @file 字符串相关的函数
* @author mengke01(kekee000@gmail.com)
*/
var _default = exports.default = {
/**
* HTML解码字符串
*
* @param {string} source 源字符串
* @return {string}
*/
decodeHTML: function decodeHTML(source) {
var str = String(source).replace(/&quot;/g, '"').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, '&');
// 处理转义的中文和实体字符
return str.replace(/&#([\d]+);/g, function ($0, $1) {
return String.fromCodePoint(parseInt($1, 10));
});
},
/**
* HTML编码字符串
*
* @param {string} source 源字符串
* @return {string}
*/
encodeHTML: function encodeHTML(source) {
return String(source).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#39;');
},
/**
* 获取string字节长度
*
* @param {string} source 源字符串
* @return {number} 长度
*/
getLength: function getLength(source) {
// eslint-disable-next-line no-control-regex
return String(source).replace(/[^\x00-\xff]/g, '11').length;
},
/**
* 字符串格式化,支持如 ${xxx.xxx} 的语法
*
* @param {string} source 模板字符串
* @param {Object} data 数据
* @return {string} 格式化后字符串
*/
format: function format(source, data) {
return source.replace(/\$\{([\w.]+)\}/g, function ($0, $1) {
var ref = $1.split('.');
var refObject = data;
var level;
while (refObject != null && (level = ref.shift())) {
refObject = refObject[level];
}
return refObject != null ? refObject : '';
});
},
/**
* 使用指定字符填充字符串,默认`0`
*
* @param {string} str 字符串
* @param {number} size 填充到的大小
* @param {string=} ch 填充字符
* @return {string} 字符串
*/
pad: function pad(str, size, ch) {
str = String(str);
if (str.length > size) {
return str.slice(str.length - size);
}
return new Array(size - str.length + 1).join(ch || '0') + str;
},
/**
* 获取字符串哈希编码
*
* @param {string} str 字符串
* @return {number} 哈希值
*/
hashcode: function hashcode(str) {
if (!str) {
return 0;
}
var hash = 0;
for (var i = 0, l = str.length; i < l; i++) {
hash = 0x7FFFFFFFF & hash * 31 + str.charCodeAt(i);
}
return hash;
}
};
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from './types.mjs';
import 'react';
declare const CopyIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { CopyIcon };
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAOD,mFAAmF;AACnF,IAAI,kCAAY,QACd,OAAO,WAAW,eAClB,OAAO,QAAQ,IACf,OAAO,QAAQ,CAAC,aAAa;AAG/B,IAAI,sCAAyD,IAAI;AAM1D,SAAS,0CAAM,SAAkB;IACtC,IAAI,CAAC,OAAO,SAAS,GAAG,CAAA,GAAA,qBAAO,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAE;IAEpB,IAAI,MAAM,CAAA,GAAA,gCAAW,EAAE;IAEvB,IAAI,cAAc,CAAA,GAAA,wBAAU,EAAE,CAAC;QAC7B,OAAO,OAAO,GAAG;IACnB,GAAG,EAAE;IAEL,IAAI;QACF,gEAAgE;QAChE,IAAI,oCAAc,GAAG,CAAC,QAAQ,CAAC,oCAAc,GAAG,CAAC,KAAM,QAAQ,CAAC,cAC9D,oCAAc,GAAG,CAAC,KAAK;eAAI,oCAAc,GAAG,CAAC;YAAO;SAAY;aAEhE,oCAAc,GAAG,CAAC,KAAK;YAAC;SAAY;;IAIxC,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,IAAI;QACR,OAAO;YACL,oCAAc,MAAM,CAAC;QACvB;IACF,GAAG;QAAC;KAAI;IAER,uEAAuE;IACvE,2BAA2B;IAC3B,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,QAAQ,OAAO,OAAO;QAC1B,IAAI,OAAO;YACT,OAAO,OAAO,GAAG;YACjB,SAAS;QACX;IACF;IAEA,OAAO;AACT;AAMO,SAAS,0CAAS,GAAW,EAAE,GAAW;IAC/C,IAAI,QAAQ,KACV,OAAO;IAGT,IAAI,UAAU,oCAAc,GAAG,CAAC;IAChC,IAAI,SAAS;QACX,QAAQ,OAAO,CAAC,CAAA,KAAM,GAAG;QACzB,OAAO;IACT;IAEA,IAAI,UAAU,oCAAc,GAAG,CAAC;IAChC,IAAI,SAAS;QACX,QAAQ,OAAO,CAAC,CAAA,KAAM,GAAG;QACzB,OAAO;IACT;IAEA,OAAO;AACT;AAOO,SAAS,0CAAU,WAA+B,EAAE;IACzD,IAAI,KAAK;IACT,IAAI,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,wCAAa,EAAE;IACjD,IAAI,WAAW,CAAA,GAAA,wBAAU,EAAE;QACzB,cAAc;YACZ,MAAM;YAEN,MAAM,SAAS,cAAc,CAAC,MAAM,KAAK;QAC3C;IACF,GAAG;QAAC;QAAI;KAAc;IAEtB,CAAA,GAAA,yCAAc,EAAE,UAAU;QAAC;QAAI;WAAa;KAAS;IAErD,OAAO;AACT","sources":["packages/@react-aria/utils/src/useId.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 {useCallback, useEffect, useRef, useState} from 'react';\nimport {useLayoutEffect} from './useLayoutEffect';\nimport {useSSRSafeId} from '@react-aria/ssr';\nimport {useValueEffect} from './';\n\n// copied from SSRProvider.tsx to reduce exports, if needed again, consider sharing\nlet canUseDOM = Boolean(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n\nlet idsUpdaterMap: Map<string, Array<(v: string) => void>> = new Map();\n\n/**\n * If a default is not provided, generate an id.\n * @param defaultId - Default component id.\n */\nexport function useId(defaultId?: string): string {\n let [value, setValue] = useState(defaultId);\n let nextId = useRef(null);\n\n let res = useSSRSafeId(value);\n\n let updateValue = useCallback((val) => {\n nextId.current = val;\n }, []);\n\n if (canUseDOM) {\n // TS not smart enough to know that `has` means the value exists\n if (idsUpdaterMap.has(res) && !idsUpdaterMap.get(res)!.includes(updateValue)) {\n idsUpdaterMap.set(res, [...idsUpdaterMap.get(res)!, updateValue]);\n } else {\n idsUpdaterMap.set(res, [updateValue]);\n }\n }\n\n useLayoutEffect(() => {\n let r = res;\n return () => {\n idsUpdaterMap.delete(r);\n };\n }, [res]);\n\n // This cannot cause an infinite loop because the ref is updated first.\n // eslint-disable-next-line\n useEffect(() => {\n let newId = nextId.current;\n if (newId) {\n nextId.current = null;\n setValue(newId);\n }\n });\n\n return res;\n}\n\n/**\n * Merges two ids.\n * Different ids will trigger a side-effect and re-render components hooked up with `useId`.\n */\nexport function mergeIds(idA: string, idB: string): string {\n if (idA === idB) {\n return idA;\n }\n\n let setIdsA = idsUpdaterMap.get(idA);\n if (setIdsA) {\n setIdsA.forEach(fn => fn(idB));\n return idB;\n }\n\n let setIdsB = idsUpdaterMap.get(idB);\n if (setIdsB) {\n setIdsB.forEach(fn => fn(idA));\n return idA;\n }\n\n return idB;\n}\n\n/**\n * Used to generate an id, and after render, check if that id is rendered so we know\n * if we can use it in places such as labelledby.\n * @param depArray - When to recalculate if the id is in the DOM.\n */\nexport function useSlotId(depArray: ReadonlyArray<any> = []): string {\n let id = useId();\n let [resolvedId, setResolvedId] = useValueEffect(id);\n let updateId = useCallback(() => {\n setResolvedId(function *() {\n yield id;\n\n yield document.getElementById(id) ? id : undefined;\n });\n }, [id, setResolvedId]);\n\n useLayoutEffect(updateId, [id, updateId, ...depArray]);\n\n return resolvedId;\n}\n"],"names":[],"version":3,"file":"useId.main.js.map"}
@@ -0,0 +1,54 @@
'use strict';
require('../auto');
var test = require('tape');
var defineProperties = require('define-properties');
var callBind = require('call-bind');
var isEnumerable = Object.prototype.propertyIsEnumerable;
var functionsHaveNames = require('functions-have-names')();
var hasStrictMode = require('has-strict-mode')();
var runTests = require('./tests');
test('shimmed', function (t) {
t.test('ArrayBuffer support', { skip: typeof ArrayBuffer === 'undefined' }, function (st) {
var method = ArrayBuffer.prototype.slice;
st.equal(method.length, 2, 'ArrayBuffer#slice has a length of 2');
st.test('Function name', { skip: !functionsHaveNames }, function (s2t) {
s2t.equal(method.name, 'slice', 'ArrayBuffer#slice name "slice"');
s2t.end();
});
st.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(ArrayBuffer.prototype, 'slice'), 'ArrayBuffer#slice is not enumerable');
et.end();
});
st.test('bad array/this value', { skip: !hasStrictMode }, function (s2t) {
/* eslint no-useless-call: 0 */
s2t['throws'](function () { return method.call(undefined); }, TypeError, 'undefined is not an object');
s2t['throws'](function () { return method.call(null); }, TypeError, 'null is not an object');
s2t.end();
});
t.test('has the correct descriptor', { skip: !Object.getOwnPropertyDescriptor }, function (s2t) {
var descriptor = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'slice');
s2t.equal(descriptor.configurable, true);
s2t.equal(descriptor.enumerable, false);
s2t.equal(typeof descriptor.value, 'function');
s2t.equal(descriptor.writable, true);
s2t.end();
});
runTests(callBind(method), st);
st.end();
});
t.end();
});
@@ -0,0 +1,89 @@
# p-map [![Build Status](https://travis-ci.org/sindresorhus/p-map.svg?branch=master)](https://travis-ci.org/sindresorhus/p-map)
> Map over promises concurrently
Useful when you need to run promise-returning & async functions multiple times with different inputs concurrently.
## Install
```
$ npm install p-map
```
## Usage
```js
const pMap = require('p-map');
const got = require('got');
const sites = [
getWebsiteFromUsername('https://sindresorhus'), //=> Promise
'https://ava.li',
'https://github.com'
];
(async () => {
const mapper = async site => {
const {requestUrl} = await got.head(site);
return requestUrl;
};
const result = await pMap(sites, mapper, {concurrency: 2});
console.log(result);
//=> ['https://sindresorhus.com/', 'https://ava.li/', 'https://github.com/']
})();
```
## API
### pMap(input, mapper, options?)
Returns a `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values returned from `mapper` in `input` order.
#### input
Type: `Iterable<Promise | unknown>`
Iterated over concurrently in the `mapper` function.
#### mapper(element, index)
Type: `Function`
Expected to return a `Promise` or value.
#### options
Type: `object`
##### concurrency
Type: `number` (Integer)\
Default: `Infinity`\
Minimum: `1`
Number of concurrently pending promises returned by `mapper`.
##### stopOnError
Type: `boolean`\
Default: `true`
When set to `false`, instead of stopping when a promise rejects, it will wait for all the promises to settle and then reject with an [aggregated error](https://github.com/sindresorhus/aggregate-error) containing all the errors from the rejected promises.
## p-map for enterprise
Available as part of the Tidelift Subscription.
The maintainers of p-map and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-p-map?utm_source=npm-p-map&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
## Related
- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency
- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently
- [p-times](https://github.com/sindresorhus/p-times) - Run promise-returning & async functions a specific number of times concurrently
- [p-props](https://github.com/sindresorhus/p-props) - Like `Promise.all()` but for `Map` and `Object`
- [p-map-series](https://github.com/sindresorhus/p-map-series) - Map over promises serially
- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control
- [More…](https://github.com/sindresorhus/promise-fun)
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_inherits.cjs",
"module": "../../esm/_inherits.js"
}
@@ -0,0 +1,4 @@
function _classCallCheck(a, n) {
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
}
export { _classCallCheck as default };
@@ -0,0 +1 @@
{"version":3,"file":"DynamicValueBuilder.js","sourceRoot":"","sources":["../../../../src/binding/models/DynamicValueBuilder.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
{"name":"@xterm/addon-web-links","version":"0.11.0","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532126844,"integrity":"sha512-iVPiKUl7UcCTocOOG4pEnsYjAPNdFoCFz/lIYUdi9vIY8BO0v2DuP2FJoGsyWfNKzNF9cH54+P6TgAC4N2fS1w==","mode":420,"size":1103},"lib/addon-web-links.js":{"checkedAt":1794532126844,"integrity":"sha512-SuZRMtyN2mQZcVYwipLP0eIdxNIQwahWaFrpMprTv9FhobgL69s59nztk09N/GNlOUaGAPSsbTo6BoQ3xswttQ==","mode":420,"size":3090},"package.json":{"checkedAt":1794532126845,"integrity":"sha512-QDNtZvxAoc2BiNDvVdlsT00ID76+XBgalM4xiJ64SAM/6M1zKFo+gnNyXn9pyIupIBDRPrzIKXj6Hib5Fq2cxw==","mode":420,"size":656},"lib/addon-web-links.js.map":{"checkedAt":1794532126845,"integrity":"sha512-VCxjhVm85xuVLKzgYbFSBURIu9qx94iKCl26Yky4Sor9x6tgW08/bMJkerZ6jp59tfYTvLuIQsWbJbhjvgh+vg==","mode":420,"size":14865},"README.md":{"checkedAt":1794532126845,"integrity":"sha512-ZNDoC3GvSCkw2b6XPUYWNUXfHJw76Ud6m+FbMtc+16Rkj8eVzzHbrFxNnbQ8GHkYM2PwtjAMqvYxyVYZns2dng==","mode":420,"size":554},"typings/addon-web-links.d.ts":{"checkedAt":1794532126845,"integrity":"sha512-B5OWR8Aiz0lnnJaPybk1DqBfvVU7a8Rs4jv5B8FbuSt6JLc2a2ZvCdzp7G8Rw8WlWD4gOFQuNpf7CuUqCFzAxg==","mode":420,"size":1406},"src/WebLinkProvider.ts":{"checkedAt":1794532126845,"integrity":"sha512-XEQTptaP5sk5tXHiu2iEAejfbdVuijP2ZVWF99vodg87KmAH7ttecIeKP9rbqNwDCQtA91gF046Y269dH1qMvw==","mode":420,"size":6466},"src/WebLinksAddon.ts":{"checkedAt":1794532126845,"integrity":"sha512-k/c1irqNz70kP15tGNMVpcjeBxuGBGLlelkAYTQPj90hRVbvW3fWfxq4dXw9CEx9tZe5ERFokhS2iPgj1cQtAA==","mode":420,"size":2057}}}
@@ -0,0 +1,138 @@
// 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.
#include "GenRandom.h"
#include <stdint.h>
#include <string.h>
#include "DebugClient.h"
#include "StringBuilder.h"
static volatile LONG g_pipeCounter;
GenRandom::GenRandom() : m_advapi32(L"advapi32.dll") {
// First try to use the pseudo-documented RtlGenRandom function from
// advapi32.dll. Creating a CryptoAPI context is slow, and RtlGenRandom
// avoids the overhead. It's documented in this blog post[1] and on
// MSDN[2] with a disclaimer about future breakage. This technique is
// apparently built-in into the MSVC CRT, though, for the rand_s function,
// so perhaps it is stable enough.
//
// [1] http://blogs.msdn.com/b/michael_howard/archive/2005/01/14/353379.aspx
// [2] https://msdn.microsoft.com/en-us/library/windows/desktop/aa387694(v=vs.85).aspx
//
// Both RtlGenRandom and the Crypto API functions exist in XP and up.
m_rtlGenRandom = reinterpret_cast<RtlGenRandom_t*>(
m_advapi32.proc("SystemFunction036"));
// The OsModule class logs an error message if the proc is nullptr.
if (m_rtlGenRandom != nullptr) {
return;
}
// Fall back to the crypto API.
m_cryptProvIsValid =
CryptAcquireContext(&m_cryptProv, nullptr, nullptr,
PROV_RSA_FULL, CRYPT_VERIFYCONTEXT) != 0;
if (!m_cryptProvIsValid) {
trace("GenRandom: CryptAcquireContext failed: %u",
static_cast<unsigned>(GetLastError()));
}
}
GenRandom::~GenRandom() {
if (m_cryptProvIsValid) {
CryptReleaseContext(m_cryptProv, 0);
}
}
// Returns false if the context is invalid or the generation fails.
bool GenRandom::fillBuffer(void *buffer, size_t size) {
memset(buffer, 0, size);
bool success = false;
if (m_rtlGenRandom != nullptr) {
success = m_rtlGenRandom(buffer, size) != 0;
if (!success) {
trace("GenRandom: RtlGenRandom/SystemFunction036 failed: %u",
static_cast<unsigned>(GetLastError()));
}
} else if (m_cryptProvIsValid) {
success =
CryptGenRandom(m_cryptProv, size,
reinterpret_cast<BYTE*>(buffer)) != 0;
if (!success) {
trace("GenRandom: CryptGenRandom failed, size=%d, lasterror=%u",
static_cast<int>(size),
static_cast<unsigned>(GetLastError()));
}
}
return success;
}
// Returns an empty string if either of CryptAcquireContext or CryptGenRandom
// fail.
std::string GenRandom::randomBytes(size_t numBytes) {
std::string ret(numBytes, '\0');
if (!fillBuffer(&ret[0], numBytes)) {
return std::string();
}
return ret;
}
std::wstring GenRandom::randomHexString(size_t numBytes) {
const std::string bytes = randomBytes(numBytes);
std::wstring ret(bytes.size() * 2, L'\0');
for (size_t i = 0; i < bytes.size(); ++i) {
static const wchar_t hex[] = L"0123456789abcdef";
ret[i * 2] = hex[static_cast<uint8_t>(bytes[i]) >> 4];
ret[i * 2 + 1] = hex[static_cast<uint8_t>(bytes[i]) & 0xF];
}
return ret;
}
// Returns a 64-bit value representing the number of 100-nanosecond intervals
// since January 1, 1601.
static uint64_t systemTimeAsUInt64() {
FILETIME monotonicTime = {};
GetSystemTimeAsFileTime(&monotonicTime);
return (static_cast<uint64_t>(monotonicTime.dwHighDateTime) << 32) |
static_cast<uint64_t>(monotonicTime.dwLowDateTime);
}
// Generates a unique and hard-to-guess case-insensitive string suitable for
// use in a pipe filename or a Windows object name.
std::wstring GenRandom::uniqueName() {
// First include enough information to avoid collisions assuming
// cooperative software. This code assumes that a process won't die and
// be replaced with a recycled PID within a single GetSystemTimeAsFileTime
// interval.
WStringBuilder sb(64);
sb << GetCurrentProcessId()
<< L'-' << InterlockedIncrement(&g_pipeCounter)
<< L'-' << whexOfInt(systemTimeAsUInt64());
// It isn't clear to me how the crypto APIs would fail. It *probably*
// doesn't matter that much anyway? In principle, a predictable pipe name
// is subject to a local denial-of-service attack.
auto random = randomHexString(16);
if (!random.empty()) {
sb << L'-' << random;
}
return sb.str_moved();
}
@@ -0,0 +1,6 @@
"use strict";
module.exports = function () {
// https://mths.be/emoji
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uLine truncated
};
@@ -0,0 +1 @@
{"version":3,"file":"injectFromBase.d.ts","sourceRoot":"","sources":["../../../../src/metadata/decorators/injectFromBase.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,wBAAgB,cAAc,CAC5B,OAAO,CAAC,EAAE,qBAAqB,GAC9B,cAAc,CAiBhB"}
@@ -0,0 +1,43 @@
export var ContextualKeyword; (function (ContextualKeyword) {
const NONE = 0; ContextualKeyword[ContextualKeyword["NONE"] = NONE] = "NONE";
const _abstract = NONE + 1; ContextualKeyword[ContextualKeyword["_abstract"] = _abstract] = "_abstract";
const _accessor = _abstract + 1; ContextualKeyword[ContextualKeyword["_accessor"] = _accessor] = "_accessor";
const _as = _accessor + 1; ContextualKeyword[ContextualKeyword["_as"] = _as] = "_as";
const _assert = _as + 1; ContextualKeyword[ContextualKeyword["_assert"] = _assert] = "_assert";
const _asserts = _assert + 1; ContextualKeyword[ContextualKeyword["_asserts"] = _asserts] = "_asserts";
const _async = _asserts + 1; ContextualKeyword[ContextualKeyword["_async"] = _async] = "_async";
const _await = _async + 1; ContextualKeyword[ContextualKeyword["_await"] = _await] = "_await";
const _checks = _await + 1; ContextualKeyword[ContextualKeyword["_checks"] = _checks] = "_checks";
const _constructor = _checks + 1; ContextualKeyword[ContextualKeyword["_constructor"] = _constructor] = "_constructor";
const _declare = _constructor + 1; ContextualKeyword[ContextualKeyword["_declare"] = _declare] = "_declare";
const _enum = _declare + 1; ContextualKeyword[ContextualKeyword["_enum"] = _enum] = "_enum";
const _exports = _enum + 1; ContextualKeyword[ContextualKeyword["_exports"] = _exports] = "_exports";
const _from = _exports + 1; ContextualKeyword[ContextualKeyword["_from"] = _from] = "_from";
const _get = _from + 1; ContextualKeyword[ContextualKeyword["_get"] = _get] = "_get";
const _global = _get + 1; ContextualKeyword[ContextualKeyword["_global"] = _global] = "_global";
const _implements = _global + 1; ContextualKeyword[ContextualKeyword["_implements"] = _implements] = "_implements";
const _infer = _implements + 1; ContextualKeyword[ContextualKeyword["_infer"] = _infer] = "_infer";
const _interface = _infer + 1; ContextualKeyword[ContextualKeyword["_interface"] = _interface] = "_interface";
const _is = _interface + 1; ContextualKeyword[ContextualKeyword["_is"] = _is] = "_is";
const _keyof = _is + 1; ContextualKeyword[ContextualKeyword["_keyof"] = _keyof] = "_keyof";
const _mixins = _keyof + 1; ContextualKeyword[ContextualKeyword["_mixins"] = _mixins] = "_mixins";
const _module = _mixins + 1; ContextualKeyword[ContextualKeyword["_module"] = _module] = "_module";
const _namespace = _module + 1; ContextualKeyword[ContextualKeyword["_namespace"] = _namespace] = "_namespace";
const _of = _namespace + 1; ContextualKeyword[ContextualKeyword["_of"] = _of] = "_of";
const _opaque = _of + 1; ContextualKeyword[ContextualKeyword["_opaque"] = _opaque] = "_opaque";
const _out = _opaque + 1; ContextualKeyword[ContextualKeyword["_out"] = _out] = "_out";
const _override = _out + 1; ContextualKeyword[ContextualKeyword["_override"] = _override] = "_override";
const _private = _override + 1; ContextualKeyword[ContextualKeyword["_private"] = _private] = "_private";
const _protected = _private + 1; ContextualKeyword[ContextualKeyword["_protected"] = _protected] = "_protected";
const _proto = _protected + 1; ContextualKeyword[ContextualKeyword["_proto"] = _proto] = "_proto";
const _public = _proto + 1; ContextualKeyword[ContextualKeyword["_public"] = _public] = "_public";
const _readonly = _public + 1; ContextualKeyword[ContextualKeyword["_readonly"] = _readonly] = "_readonly";
const _require = _readonly + 1; ContextualKeyword[ContextualKeyword["_require"] = _require] = "_require";
const _satisfies = _require + 1; ContextualKeyword[ContextualKeyword["_satisfies"] = _satisfies] = "_satisfies";
const _set = _satisfies + 1; ContextualKeyword[ContextualKeyword["_set"] = _set] = "_set";
const _static = _set + 1; ContextualKeyword[ContextualKeyword["_static"] = _static] = "_static";
const _symbol = _static + 1; ContextualKeyword[ContextualKeyword["_symbol"] = _symbol] = "_symbol";
const _type = _symbol + 1; ContextualKeyword[ContextualKeyword["_type"] = _type] = "_type";
const _unique = _type + 1; ContextualKeyword[ContextualKeyword["_unique"] = _unique] = "_unique";
const _using = _unique + 1; ContextualKeyword[ContextualKeyword["_using"] = _using] = "_using";
})(ContextualKeyword || (ContextualKeyword = {}));
@@ -0,0 +1,2 @@
export { getKeys } from './get-keys';
export { visitorKeys, type VisitorKeys } from './visitor-keys';
@@ -0,0 +1,64 @@
"use client";
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/modal-body.tsx
var modal_body_exports = {};
__export(modal_body_exports, {
default: () => modal_body_default
});
module.exports = __toCommonJS(modal_body_exports);
var import_react = require("react");
var import_system = require("@heroui/system");
var import_react_utils2 = require("@heroui/react-utils");
var import_shared_utils = require("@heroui/shared-utils");
// src/modal-context.ts
var import_react_utils = require("@heroui/react-utils");
var [ModalProvider, useModalContext] = (0, import_react_utils.createContext)({
name: "ModalContext",
errorMessage: "useModalContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Modal />`"
});
// src/modal-body.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var ModalBody = (0, import_system.forwardRef)((props, ref) => {
const { as, children, className, ...otherProps } = props;
const { slots, classNames, bodyId, setBodyMounted } = useModalContext();
const domRef = (0, import_react_utils2.useDOMRef)(ref);
const Component = as || "div";
(0, import_react.useEffect)(() => {
setBodyMounted(true);
return () => setBodyMounted(false);
}, [setBodyMounted]);
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
Component,
{
ref: domRef,
className: slots.body({ class: (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.body, className) }),
id: bodyId,
...otherProps,
children
}
);
});
ModalBody.displayName = "HeroUI.ModalBody";
var modal_body_default = ModalBody;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {});
@@ -0,0 +1,68 @@
#!/usr/bin/env node
const rimraf = require('./')
const path = require('path')
const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg))
const filterOutRoot = arg => {
const ok = preserveRoot === false || !isRoot(arg)
if (!ok) {
console.error(`refusing to remove ${arg}`)
console.error('Set --no-preserve-root to allow this')
}
return ok
}
let help = false
let dashdash = false
let noglob = false
let preserveRoot = true
const args = process.argv.slice(2).filter(arg => {
if (dashdash)
return !!arg
else if (arg === '--')
dashdash = true
else if (arg === '--no-glob' || arg === '-G')
noglob = true
else if (arg === '--glob' || arg === '-g')
noglob = false
else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/))
help = true
else if (arg === '--preserve-root')
preserveRoot = true
else if (arg === '--no-preserve-root')
preserveRoot = false
else
return !!arg
}).filter(arg => !preserveRoot || filterOutRoot(arg))
const go = n => {
if (n >= args.length)
return
const options = noglob ? { glob: false } : {}
rimraf(args[n], options, er => {
if (er)
throw er
go(n+1)
})
}
if (help || args.length === 0) {
// If they didn't ask for help, then this is not a "success"
const log = help ? console.log : console.error
log('Usage: rimraf <path> [<path> ...]')
log('')
log(' Deletes all files and folders at "path" recursively.')
log('')
log('Options:')
log('')
log(' -h, --help Display this usage info')
log(' -G, --no-glob Do not expand glob patterns in arguments')
log(' -g, --glob Expand glob patterns in arguments (default)')
log(' --preserve-root Do not remove \'/\' (default)')
log(' --no-preserve-root Do not treat \'/\' specially')
log(' -- Stop parsing flags')
process.exit(help ? 0 : 1)
} else
go(0)
@@ -0,0 +1,29 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"id-length": [2, { "min": 1, "max": 26 }],
"new-cap": [2, {
"capIsNewExceptions": [
"GetIntrinsic",
"ToObject",
"ToIntegerOrInfinity",
"ToLength",
"SameValueZero",
"RequireObjectCoercible",
],
}],
},
"overrides": [
{
"files": "test/**",
"rules": {
"max-lines-per-function": 0,
"no-invalid-this": 1,
},
},
],
}
@@ -0,0 +1,6 @@
module.exports = {
"breadcrumbs": `\u{5E9}\u{5D1}\u{5D9}\u{5DC}\u{5D9} \u{5E0}\u{5D9}\u{5D5}\u{5D5}\u{5D8}`
};
//# sourceMappingURL=he-IL.main.js.map
@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,10 @@
import { ClassAttributor, Scope } from 'parchment';
import { ColorAttributor } from './color.js';
const BackgroundClass = new ClassAttributor('background', 'ql-bg', {
scope: Scope.INLINE
});
const BackgroundStyle = new ColorAttributor('background', 'background-color', {
scope: Scope.INLINE
});
export { BackgroundClass, BackgroundStyle };
//# sourceMappingURL=background.js.map
@@ -0,0 +1,10 @@
import injectable from "./injectable";
import { instance as globalContainer } from "../dependency-container";
export default function scoped(lifecycle, token) {
return function (target) {
injectable()(target);
globalContainer.register(token || target, target, {
lifecycle: lifecycle
});
};
}
@@ -0,0 +1,73 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}
{{## def.validateIfClause:_clause:
{{
$it.schema = it.schema['_clause'];
$it.schemaPath = it.schemaPath + '._clause';
$it.errSchemaPath = it.errSchemaPath + '/_clause';
}}
{{# def.insertSubschemaCode }}
{{=$valid}} = {{=$nextValid}};
{{? $thenPresent && $elsePresent }}
{{ $ifClause = 'ifClause' + $lvl; }}
var {{=$ifClause}} = '_clause';
{{??}}
{{ $ifClause = '\'_clause\''; }}
{{?}}
#}}
{{
var $thenSch = it.schema['then']
, $elseSch = it.schema['else']
, $thenPresent = $thenSch !== undefined && {{# def.nonEmptySchema:$thenSch }}
, $elsePresent = $elseSch !== undefined && {{# def.nonEmptySchema:$elseSch }}
, $currentBaseId = $it.baseId;
}}
{{? $thenPresent || $elsePresent }}
{{
var $ifClause;
$it.createErrors = false;
$it.schema = $schema;
$it.schemaPath = $schemaPath;
$it.errSchemaPath = $errSchemaPath;
}}
var {{=$errs}} = errors;
var {{=$valid}} = true;
{{# def.setCompositeRule }}
{{# def.insertSubschemaCode }}
{{ $it.createErrors = true; }}
{{# def.resetErrors }}
{{# def.resetCompositeRule }}
{{? $thenPresent }}
if ({{=$nextValid}}) {
{{# def.validateIfClause:then }}
}
{{? $elsePresent }}
else {
{{?}}
{{??}}
if (!{{=$nextValid}}) {
{{?}}
{{? $elsePresent }}
{{# def.validateIfClause:else }}
}
{{?}}
if (!{{=$valid}}) {
{{# def.extraError:'if' }}
}
{{? $breakOnError }} else { {{?}}
{{??}}
{{? $breakOnError }}
if (true) {
{{?}}
{{?}}
@@ -0,0 +1,374 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { IEvent, IEventEmitter } from 'common/EventEmitter';
import { IBuffer, IBufferSet } from 'common/buffer/Types';
import { IDecPrivateModes, ICoreMouseEvent, CoreMouseEncoding, ICoreMouseProtocol, CoreMouseEventType, ICharset, IWindowOptions, IModes, IAttributeData, ScrollSource, IDisposable, IColor, CursorStyle, CursorInactiveStyle, IOscLinkData } from 'common/Types';
import { createDecorator } from 'common/services/ServiceRegistry';
import { IDecorationOptions, IDecoration, ILinkHandler, IWindowsPty, ILogger } from '@xterm/xterm';
export const IBufferService = createDecorator<IBufferService>('BufferService');
export interface IBufferService {
serviceBrand: undefined;
readonly cols: number;
readonly rows: number;
readonly buffer: IBuffer;
readonly buffers: IBufferSet;
isUserScrolling: boolean;
onResize: IEvent<{ cols: number, rows: number }>;
onScroll: IEvent<number>;
scroll(eraseAttr: IAttributeData, isWrapped?: boolean): void;
scrollLines(disp: number, suppressScrollEvent?: boolean, source?: ScrollSource): void;
resize(cols: number, rows: number): void;
reset(): void;
}
export const ICoreMouseService = createDecorator<ICoreMouseService>('CoreMouseService');
export interface ICoreMouseService {
activeProtocol: string;
activeEncoding: string;
areMouseEventsActive: boolean;
addProtocol(name: string, protocol: ICoreMouseProtocol): void;
addEncoding(name: string, encoding: CoreMouseEncoding): void;
reset(): void;
/**
* Triggers a mouse event to be sent.
*
* Returns true if the event passed all protocol restrictions and a report
* was sent, otherwise false. The return value may be used to decide whether
* the default event action in the bowser component should be omitted.
*
* Note: The method will change values of the given event object
* to fullfill protocol and encoding restrictions.
*/
triggerMouseEvent(event: ICoreMouseEvent): boolean;
/**
* Event to announce changes in mouse tracking.
*/
onProtocolChange: IEvent<CoreMouseEventType>;
/**
* Human readable version of mouse events.
*/
explainEvents(events: CoreMouseEventType): { [event: string]: boolean };
}
export const ICoreService = createDecorator<ICoreService>('CoreService');
export interface ICoreService {
serviceBrand: undefined;
/**
* Initially the cursor will not be visible until the first time the terminal
* is focused.
*/
isCursorInitialized: boolean;
isCursorHidden: boolean;
readonly modes: IModes;
readonly decPrivateModes: IDecPrivateModes;
readonly onData: IEvent<string>;
readonly onUserInput: IEvent<void>;
readonly onBinary: IEvent<string>;
readonly onRequestScrollToBottom: IEvent<void>;
reset(): void;
/**
* Triggers the onData event in the public API.
* @param data The data that is being emitted.
* @param wasUserInput Whether the data originated from the user (as opposed to
* resulting from parsing incoming data). When true this will also:
* - Scroll to the bottom of the buffer if option scrollOnUserInput is true.
* - Fire the `onUserInput` event (so selection can be cleared).
*/
triggerDataEvent(data: string, wasUserInput?: boolean): void;
/**
* Triggers the onBinary event in the public API.
* @param data The data that is being emitted.
*/
triggerBinaryEvent(data: string): void;
}
export const ICharsetService = createDecorator<ICharsetService>('CharsetService');
export interface ICharsetService {
serviceBrand: undefined;
charset: ICharset | undefined;
readonly glevel: number;
reset(): void;
/**
* Set the G level of the terminal.
* @param g
*/
setgLevel(g: number): void;
/**
* Set the charset for the given G level of the terminal.
* @param g
* @param charset
*/
setgCharset(g: number, charset: ICharset | undefined): void;
}
export interface IServiceIdentifier<T> {
(...args: any[]): void;
type: T;
}
export interface IBrandedService {
serviceBrand: undefined;
}
type GetLeadingNonServiceArgs<TArgs extends any[]> = TArgs extends [] ? []
: TArgs extends [...infer TFirst, infer TLast] ? TLast extends IBrandedService ? GetLeadingNonServiceArgs<TFirst> : TArgs
: never;
export const IInstantiationService = createDecorator<IInstantiationService>('InstantiationService');
export interface IInstantiationService {
serviceBrand: undefined;
setService<T>(id: IServiceIdentifier<T>, instance: T): void;
getService<T>(id: IServiceIdentifier<T>): T | undefined;
createInstance<Ctor extends new (...args: any[]) => any, R extends InstanceType<Ctor>>(t: Ctor, ...args: GetLeadingNonServiceArgs<ConstructorParameters<Ctor>>): R;
}
export enum LogLevelEnum {
TRACE = 0,
DEBUG = 1,
INFO = 2,
WARN = 3,
ERROR = 4,
OFF = 5
}
export const ILogService = createDecorator<ILogService>('LogService');
export interface ILogService {
serviceBrand: undefined;
readonly logLevel: LogLevelEnum;
trace(message: any, ...optionalParams: any[]): void;
debug(message: any, ...optionalParams: any[]): void;
info(message: any, ...optionalParams: any[]): void;
warn(message: any, ...optionalParams: any[]): void;
error(message: any, ...optionalParams: any[]): void;
}
export const IOptionsService = createDecorator<IOptionsService>('OptionsService');
export interface IOptionsService {
serviceBrand: undefined;
/**
* Read only access to the raw options object, this is an internal-only fast path for accessing
* single options without any validation as we trust TypeScript to enforce correct usage
* internally.
*/
readonly rawOptions: Required<ITerminalOptions>;
/**
* Options as exposed through the public API, this property uses getters and setters with
* validation which makes it safer but slower. {@link rawOptions} should be used for pretty much
* all internal usage for performance reasons.
*/
readonly options: Required<ITerminalOptions>;
/**
* Adds an event listener for when any option changes.
*/
readonly onOptionChange: IEvent<keyof ITerminalOptions>;
/**
* Adds an event listener for when a specific option changes, this is a convenience method that is
* preferred over {@link onOptionChange} when only a single option is being listened to.
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
onSpecificOptionChange<T extends keyof ITerminalOptions>(key: T, listener: (arg1: Required<ITerminalOptions>[T]) => any): IDisposable;
/**
* Adds an event listener for when a set of specific options change, this is a convenience method
* that is preferred over {@link onOptionChange} when multiple options are being listened to and
* handled the same way.
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
onMultipleOptionChange(keys: (keyof ITerminalOptions)[], listener: () => any): IDisposable;
}
export type FontWeight = 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | number;
export type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'off';
export interface ITerminalOptions {
allowProposedApi?: boolean;
allowTransparency?: boolean;
altClickMovesCursor?: boolean;
cols?: number;
convertEol?: boolean;
cursorBlink?: boolean;
cursorStyle?: CursorStyle;
cursorWidth?: number;
cursorInactiveStyle?: CursorInactiveStyle;
customGlyphs?: boolean;
disableStdin?: boolean;
documentOverride?: any | null;
drawBoldTextInBrightColors?: boolean;
fastScrollModifier?: 'none' | 'alt' | 'ctrl' | 'shift';
fastScrollSensitivity?: number;
fontSize?: number;
fontFamily?: string;
fontWeight?: FontWeight;
fontWeightBold?: FontWeight;
ignoreBracketedPasteMode?: boolean;
letterSpacing?: number;
lineHeight?: number;
linkHandler?: ILinkHandler | null;
logLevel?: LogLevel;
logger?: ILogger | null;
macOptionIsMeta?: boolean;
macOptionClickForcesSelection?: boolean;
minimumContrastRatio?: number;
rescaleOverlappingGlyphs?: boolean;
rightClickSelectsWord?: boolean;
rows?: number;
screenReaderMode?: boolean;
scrollback?: number;
scrollOnUserInput?: boolean;
scrollSensitivity?: number;
smoothScrollDuration?: number;
tabStopWidth?: number;
theme?: ITheme;
windowsMode?: boolean;
windowsPty?: IWindowsPty;
windowOptions?: IWindowOptions;
wordSeparator?: string;
overviewRulerWidth?: number;
[key: string]: any;
cancelEvents: boolean;
termName: string;
}
export interface ITheme {
foreground?: string;
background?: string;
cursor?: string;
cursorAccent?: string;
selectionForeground?: string;
selectionBackground?: string;
selectionInactiveBackground?: string;
black?: string;
red?: string;
green?: string;
yellow?: string;
blue?: string;
magenta?: string;
cyan?: string;
white?: string;
brightBlack?: string;
brightRed?: string;
brightGreen?: string;
brightYellow?: string;
brightBlue?: string;
brightMagenta?: string;
brightCyan?: string;
brightWhite?: string;
extendedAnsi?: string[];
}
export const IOscLinkService = createDecorator<IOscLinkService>('OscLinkService');
export interface IOscLinkService {
serviceBrand: undefined;
/**
* Registers a link to the service, returning the link ID. The link data is managed by this
* service and will be freed when this current cursor position is trimmed off the buffer.
*/
registerLink(linkData: IOscLinkData): number;
/**
* Adds a line to a link if needed.
*/
addLineToLink(linkId: number, y: number): void;
/** Get the link data associated with a link ID. */
getLinkData(linkId: number): IOscLinkData | undefined;
}
/*
* Width and Grapheme_Cluster_Break properties of a character as a bit mask.
*
* bit 0: shouldJoin - should combine with preceding character.
* bit 1..2: wcwidth - see UnicodeCharWidth.
* bit 3..31: class of character (currently only 4 bits are used).
* This is used to determined grapheme clustering - i.e. which codepoints
* are to be combined into a single compound character.
*
* Use the UnicodeService static function createPropertyValue to create a
* UnicodeCharProperties; use extractShouldJoin, extractWidth, and
* extractCharKind to extract the components.
*/
export type UnicodeCharProperties = number;
/**
* Width in columns of a character.
* In a CJK context, "half-width" characters (such as Latin) are width 1,
* while "full-width" characters (such as Kanji) are 2 columns wide.
* Combining characters (such as accents) are width 0.
*/
export type UnicodeCharWidth = 0 | 1 | 2;
export const IUnicodeService = createDecorator<IUnicodeService>('UnicodeService');
export interface IUnicodeService {
serviceBrand: undefined;
/** Register an Unicode version provider. */
register(provider: IUnicodeVersionProvider): void;
/** Registered Unicode versions. */
readonly versions: string[];
/** Currently active version. */
activeVersion: string;
/** Event triggered, when activate version changed. */
readonly onChange: IEvent<string>;
/**
* Unicode version dependent
*/
wcwidth(codepoint: number): UnicodeCharWidth;
getStringCellWidth(s: string): number;
/**
* Return character width and type for grapheme clustering.
* If preceding != 0, it is the return code from the previous character;
* in that case the result specifies if the characters should be joined.
*/
charProperties(codepoint: number, preceding: UnicodeCharProperties): UnicodeCharProperties;
}
export interface IUnicodeVersionProvider {
readonly version: string;
wcwidth(ucs: number): UnicodeCharWidth;
charProperties(codepoint: number, preceding: UnicodeCharProperties): UnicodeCharProperties;
}
export const IDecorationService = createDecorator<IDecorationService>('DecorationService');
export interface IDecorationService extends IDisposable {
serviceBrand: undefined;
readonly decorations: IterableIterator<IInternalDecoration>;
readonly onDecorationRegistered: IEvent<IInternalDecoration>;
readonly onDecorationRemoved: IEvent<IInternalDecoration>;
registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined;
reset(): void;
/**
* Trigger a callback over the decoration at a cell (in no particular order). This uses a callback
* instead of an iterator as it's typically used in hot code paths.
*/
forEachDecorationAtCell(x: number, line: number, layer: 'bottom' | 'top' | undefined, callback: (decoration: IInternalDecoration) => void): void;
}
export interface IInternalDecoration extends IDecoration {
readonly options: IDecorationOptions;
readonly backgroundColorRGB: IColor | undefined;
readonly foregroundColorRGB: IColor | undefined;
readonly onRenderEmitter: IEventEmitter<HTMLElement>;
}
@@ -0,0 +1,32 @@
var baseRest = require('./_baseRest'),
unzipWith = require('./unzipWith');
/**
* This method is like `_.zip` except that it accepts `iteratee` to specify
* how grouped values should be combined. The iteratee is invoked with the
* elements of each group: (...group).
*
* @static
* @memberOf _
* @since 3.8.0
* @category Array
* @param {...Array} [arrays] The arrays to process.
* @param {Function} [iteratee=_.identity] The function to combine
* grouped values.
* @returns {Array} Returns the new array of grouped elements.
* @example
*
* _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
* return a + b + c;
* });
* // => [111, 222]
*/
var zipWith = baseRest(function(arrays) {
var length = arrays.length,
iteratee = length > 1 ? arrays[length - 1] : undefined;
iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
return unzipWith(arrays, iteratee);
});
module.exports = zipWith;
@@ -0,0 +1,26 @@
1.1.0 / 2025-07-17
==================
* - Fix [CVE-2025-7339](https://www.cve.org/CVERecord?id=CVE-2025-7339) ([GHSA-76c9-3jph-rj3q](https://github.com/expressjs/multer/security/advisories/GHSA-76c9-3jph-rj3q))
1.0.2 / 2019-02-21
==================
* Fix `res.writeHead` patch missing return value
1.0.1 / 2015-09-29
==================
* perf: enable strict mode
1.0.0 / 2014-08-10
==================
* Honor `res.statusCode` change in `listener`
* Move to `jshttp` organization
* Prevent `arguments`-related de-opt
0.0.0 / 2014-05-13
==================
* Initial implementation
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Kind = exports.Hint = exports.OptionalKind = exports.ReadonlyKind = exports.TransformKind = void 0;
/** Symbol key applied to transform types */
exports.TransformKind = Symbol.for('TypeBox.Transform');
/** Symbol key applied to readonly types */
exports.ReadonlyKind = Symbol.for('TypeBox.Readonly');
/** Symbol key applied to optional types */
exports.OptionalKind = Symbol.for('TypeBox.Optional');
/** Symbol key applied to types */
exports.Hint = Symbol.for('TypeBox.Hint');
/** Symbol key applied to types */
exports.Kind = Symbol.for('TypeBox.Kind');
@@ -0,0 +1,9 @@
import freeGlobal from './_freeGlobal.js';
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
export default root;
@@ -0,0 +1 @@
{"version":3,"file":"jsx-no-constructed-context-values.d.ts","sourceRoot":"","sources":["jsx-no-constructed-context-values.js"],"names":[],"mappings":"wBA2KW,OAAO,QAAQ,EAAE,IAAI,CAAC,UAAU"}
@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var radioRole = {
abstract: false,
accessibleNameRequired: true,
baseConcepts: [],
childrenPresentational: true,
nameFrom: ['author', 'contents'],
prohibitedProps: [],
props: {
'aria-checked': null,
'aria-posinset': null,
'aria-setsize': null
},
relatedConcepts: [{
concept: {
attributes: [{
name: 'type',
value: 'radio'
}],
name: 'input'
},
module: 'HTML'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {
'aria-checked': null
},
superClass: [['roletype', 'widget', 'input']]
};
var _default = exports.default = radioRole;
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"PB QB RB SB TB UB VB WB XB YB I","2":"0 1 2 3 4 5 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB","322":"LB MB NB OB"},C:{"2":"0 1 2 3 4 5 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 uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC 0C 1C"},D:{"1":"QB RB SB TB UB VB WB XB YB I XC MC YC","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 DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB","322":"LB MB NB OB PB"},E:{"1":"oC pC qC rC sC tC DD ED","2":"J ZB K D E F A B C L M G 2C ZC 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC","194":"gC hC BD RC iC jC kC lC mC CD SC nC"},F:{"2":"6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB 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 FD GD HD ID NC uC JD OC","322":"0 1 2 3 4 5"},G:{"1":"oC pC qC rC sC tC","2":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC","194":"gC hC fD RC iC jC kC lC mC gD SC nC"},H:{"2":"hD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"},J:{"2":"D A"},K:{"2":"A B C H NC uC OC"},L:{"1":"I"},M:{"2":"MC"},N:{"2":"A B"},O:{"2":"PC"},P:{"2":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"2":"zD"},R:{"2":"0D"},S:{"2":"1D 2D"}},B:5,C:"CSS Text Box",D:true};
@@ -0,0 +1 @@
{"name":"object.assign","version":"4.1.7","requiresBuild":false,"files":{".editorconfig":{"checkedAt":1794532125335,"integrity":"sha512-gD3iQtgC7ZgFS97pyZqR0FPjMNyRAfat8dipbSL28iiJ6B1MP5dDeDYeEnP5sYMTz8whQIk3E5vltk2kcyJJEQ==","mode":420,"size":286},".eslintrc":{"checkedAt":1794532125335,"integrity":"sha512-KAI7U04Z/IY912UBA1BsCbfi2r/FfBc1qTyVxc3D2cSXagHjOsxNdh+jdvDS0bmdSYiIDZ+0VG0GkPkpHb9ggw==","mode":420,"size":627},".nycrc":{"checkedAt":1794532125335,"integrity":"sha512-2vm1RFz8Ajl/OYrfoCWPJIm3Bpnf7Gyn5bha/lZx/cq+We3uMy9xj15XeP6x4wF3jf/pO7KMHAkU9mllm605xg==","mode":420,"size":139},"LICENSE":{"checkedAt":1794532125335,"integrity":"sha512-ycq5LwlQmq8PJoYqtzoO6EwHCSGsLfDoTt1M/c+Yb0d9LSsdUA0VSy4NDTDbpEGEluwsaWKJBIZsR6duo4lw/w==","mode":420,"size":1080},"auto.js":{"checkedAt":1794532096427,"integrity":"sha512-8Q3Im5cACiIFrMmxvLnJnA8SXOjAd1kh/R0UIDVnErDD1WUlJIDrNfaOcIB6rtjAXNhq/OdL1374JM/QcAJ1VQ==","mode":420,"size":36},"dist/browser.js":{"checkedAt":1794532125336,"integrity":"sha512-ChppUmE4/X176VbbOjGDo6ZvsvuRwA3yl/xuuQvyhmgL7CE2yNf9U7/6AD6zdt5Jxsmq+lVt6fPJebYL2IRElw==","mode":420,"size":41567},"hasSymbols.js":{"checkedAt":1794532125336,"integrity":"sha512-yndJiU0eHpuOnvoFb0KHooOj7wVCMxakiuj8R4tXjrAhRtUbdc864kaZTKYF9vt8QV4FP9XIYfRDJXR2zCILyw==","mode":420,"size":1618},"implementation.js":{"checkedAt":1794532125336,"integrity":"sha512-URqgwYcBtnpkBNds8Libfbh1/2iT5ODlli2bcfPzMqpU+IFwtyAM7EhPju3CGIfdZd6X0svqyrsR13AfAa2zpw==","mode":420,"size":1424},"test/implementation.js":{"checkedAt":1794532125336,"integrity":"sha512-uiCHe/SEYYoDohMqh/jKl19KTw6Lz7smVhzLuXLV92mNfqAyLG5K1X8HNZVbWvPB9V3QA0EKZ+YKcPf0qjnjmQ==","mode":420,"size":603},"index.js":{"checkedAt":1794532125336,"integrity":"sha512-rC1pMs4s/jSNCsQ0qdHux6+1E24EWiSrcA4PYjkEAqRAZXEtHdjk2fUdwA6el2PxSrMBaMCxgW2zNJmILEzi1g==","mode":420,"size":532},"test/index.js":{"checkedAt":1794532125336,"integrity":"sha512-UDStOq1MvOIHS2JwqF3dC0kJLUdAPyS7cLMjHJAaNGoeQWv/9iTnyOu4Tctw5mYzkHgDtG4rnrw5E4rkDrWg8A==","mode":420,"size":424},"test/native.js":{"checkedAt":1794532125337,"integrity":"sha512-7Os8OGvHREZMxQyQEjl3wgCRoVmR7cPkjyTZ2m2RgXTPon3vOqwY3NGkaGuYVBQIoC0g7GnmtqYugzvMZ1T8Ig==","mode":420,"size":1868},"polyfill.js":{"checkedAt":1794532125337,"integrity":"sha512-Icg8URfuNH9SKTXUbuwuI65hg8gJI1Rc0R/5cCsFHT6HViaRXlT+O+FJYSRO4PsBoz9PsETWlN31s+FqEtOdJQ==","mode":420,"size":1299},"test/ses-compat.js":{"checkedAt":1794532125337,"integrity":"sha512-tVuMdsrNbCrLqd8rccjBQIkp1AFwRYgW3EDGSinFBAt5YhFTwdc3ZqRbEedBF0Zd/zCapPQf5qgFXhOrXqwWXw==","mode":420,"size":220},"shim.js":{"checkedAt":1794532125337,"integrity":"sha512-BFMga0rS1YrX8f9o2HFPtSQePu3Rm6LTq6HPp0sRXI+E3CrtWEnfntIEnePNtsp/13OtMYPh5EImgXBYDxrJJg==","mode":420,"size":305},"test/shimmed.js":{"checkedAt":1794532125337,"integrity":"sha512-GDR02ghNngF/1I2LYb73bLYlcDcGBE/ZiI5JXnRntga9fBZVRqD7h4Nij0ZD81NRPj0T3TFQmtCpJbxr+9is8w==","mode":420,"size":1914},"test/tests.js":{"checkedAt":1794532125337,"integrity":"sha512-FgP5IFXCESpasFt8Q7pe1ZQa2K4sQwUa6Z0V9jEtZKt5xALcbNbOMjeznCmuFYGNRkw2ny1TFWkRtGRnefaQjg==","mode":420,"size":7853},"package.json":{"checkedAt":1794532125337,"integrity":"sha512-xG0YUui8g3+sYOXilwhpcKdkGDs64YjowCjNQH8WMTvcv7zu/BBAkw+8xl9JMb9t9Re8kfqigUTdtLSK+jcxcw==","mode":420,"size":2345},"CHANGELOG.md":{"checkedAt":1794532125338,"integrity":"sha512-d0Ec8YcKfPHEqJHF9a9ekTjexuDAHWNwND9iyzNHbgR/8a8i/fn5hHIZheOwv2ppJUFHDcRFQCIE4vdBf2CqMQ==","mode":420,"size":9715},"README.md":{"checkedAt":1794532125338,"integrity":"sha512-PxE+OE7emNI7MxYGZeYijnDW1exdFilF7s79+EFMI9CznkD7PxYRaVZ/2qevAC+tYR/ODvwp8E/EZZXXB601qQ==","mode":420,"size":3861},".github/FUNDING.yml":{"checkedAt":1794532125338,"integrity":"sha512-MPCFvnmocfQmEz+5mEzu1D/yb93NmIoVc+vFbsNBAhqT4g09qh6HEWdhGF5NaWE9eb7XvTBSqyu8gen6e0BnRA==","mode":420,"size":584}}}
@@ -0,0 +1,551 @@
'use strict';
var utils = require('../utils.js');
var utils$1 = require('@typescript-eslint/utils');
var astUtils = require('@typescript-eslint/utils/ast-utils');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
function getEmptyLineNums$1(lines) {
const emptyLines = lines.map((line, i) => ({
code: line.trim(),
num: i + 1
})).filter((line) => !line.code).map((line) => line.num);
return emptyLines;
}
function getCommentLineNums$1(comments) {
const lines = [];
comments.forEach((token) => {
const start = token.loc.start.line;
const end = token.loc.end.line;
lines.push(start, end);
});
return lines;
}
var _baseRule = utils.createRule({
name: "lines-around-comment",
package: "js",
meta: {
type: "layout",
docs: {
description: "Require empty lines around comments"
},
fixable: "whitespace",
schema: [
{
type: "object",
properties: {
beforeBlockComment: {
type: "boolean",
default: true
},
afterBlockComment: {
type: "boolean",
default: false
},
beforeLineComment: {
type: "boolean",
default: false
},
afterLineComment: {
type: "boolean",
default: false
},
allowBlockStart: {
type: "boolean",
default: false
},
allowBlockEnd: {
type: "boolean",
default: false
},
allowClassStart: {
type: "boolean"
},
allowClassEnd: {
type: "boolean"
},
allowObjectStart: {
type: "boolean"
},
allowObjectEnd: {
type: "boolean"
},
allowArrayStart: {
type: "boolean"
},
allowArrayEnd: {
type: "boolean"
},
ignorePattern: {
type: "string"
},
applyDefaultIgnorePatterns: {
type: "boolean"
},
afterHashbangComment: {
type: "boolean",
default: false
}
},
additionalProperties: false
}
],
messages: {
after: "Expected line after comment.",
before: "Expected line before comment."
}
},
create(context) {
const options = Object.assign({}, context.options[0]);
const ignorePattern = options.ignorePattern;
const defaultIgnoreRegExp = utils.COMMENTS_IGNORE_PATTERN;
const customIgnoreRegExp = ignorePattern && new RegExp(ignorePattern, "u");
const applyDefaultIgnorePatterns = options.applyDefaultIgnorePatterns !== false;
options.beforeBlockComment = typeof options.beforeBlockComment !== "undefined" ? options.beforeBlockComment : true;
const sourceCode = context.sourceCode;
const lines = sourceCode.lines;
const numLines = lines.length + 1;
const comments = sourceCode.getAllComments();
const commentLines = getCommentLineNums$1(comments);
const emptyLines = getEmptyLineNums$1(lines);
const commentAndEmptyLines = new Set(commentLines.concat(emptyLines));
function codeAroundComment(token) {
let currentToken = token;
do
currentToken = sourceCode.getTokenBefore(currentToken, { includeComments: true });
while (currentToken && utils.isCommentToken(currentToken));
if (currentToken && utils.isTokenOnSameLine(currentToken, token))
return true;
currentToken = token;
do
currentToken = sourceCode.getTokenAfter(currentToken, { includeComments: true });
while (currentToken && utils.isCommentToken(currentToken));
if (currentToken && utils.isTokenOnSameLine(token, currentToken))
return true;
return false;
}
function isParentNodeType(parent, nodeType) {
return parent.type === nodeType;
}
function getParentNodeOfToken(token) {
const node = sourceCode.getNodeByRangeIndex(token.range[0]);
if (node && node.type === "StaticBlock") {
const openingBrace = sourceCode.getFirstToken(node, { skip: 1 });
return openingBrace && token.range[0] >= openingBrace.range[0] ? node : null;
}
return node;
}
function isCommentAtParentStart(token, nodeType) {
const parent = getParentNodeOfToken(token);
if (parent && isParentNodeType(parent, nodeType)) {
let parentStartNodeOrToken = parent;
if (parent.type === "StaticBlock") {
parentStartNodeOrToken = sourceCode.getFirstToken(parent, { skip: 1 });
} else if (parent.type === "SwitchStatement") {
parentStartNodeOrToken = sourceCode.getTokenAfter(parent.discriminant, {
filter: utils.isOpeningBraceToken
});
}
return !!parentStartNodeOrToken && token.loc.start.line - parentStartNodeOrToken.loc.start.line === 1;
}
return false;
}
function isCommentAtParentEnd(token, nodeType) {
const parent = getParentNodeOfToken(token);
return !!parent && isParentNodeType(parent, nodeType) && parent.loc.end.line - token.loc.end.line === 1;
}
function isCommentAtBlockStart(token) {
return isCommentAtParentStart(token, "ClassBody") || isCommentAtParentStart(token, "BlockStatement") || isCommentAtParentStart(token, "StaticBlock") || isCommentAtParentStart(token, "SwitchCase") || isCommentAtParentStart(token, "SwitchStatement");
}
function isCommentAtBlockEnd(token) {
return isCommentAtParentEnd(token, "ClassBody") || isCommentAtParentEnd(token, "BlockStatement") || isCommentAtParentEnd(token, "StaticBlock") || isCommentAtParentEnd(token, "SwitchCase") || isCommentAtParentEnd(token, "SwitchStatement");
}
function isCommentAtClassStart(token) {
return isCommentAtParentStart(token, "ClassBody");
}
function isCommentAtClassEnd(token) {
return isCommentAtParentEnd(token, "ClassBody");
}
function isCommentAtObjectStart(token) {
return isCommentAtParentStart(token, "ObjectExpression") || isCommentAtParentStart(token, "ObjectPattern");
}
function isCommentAtObjectEnd(token) {
return isCommentAtParentEnd(token, "ObjectExpression") || isCommentAtParentEnd(token, "ObjectPattern");
}
function isCommentAtArrayStart(token) {
return isCommentAtParentStart(token, "ArrayExpression") || isCommentAtParentStart(token, "ArrayPattern");
}
function isCommentAtArrayEnd(token) {
return isCommentAtParentEnd(token, "ArrayExpression") || isCommentAtParentEnd(token, "ArrayPattern");
}
function checkForEmptyLine(token, opts) {
if (applyDefaultIgnorePatterns && defaultIgnoreRegExp.test(token.value))
return;
if (customIgnoreRegExp && customIgnoreRegExp.test(token.value))
return;
let after = opts.after;
let before = opts.before;
const prevLineNum = token.loc.start.line - 1;
const nextLineNum = token.loc.end.line + 1;
const commentIsNotAlone = codeAroundComment(token);
const blockStartAllowed = options.allowBlockStart && isCommentAtBlockStart(token) && !(options.allowClassStart === false && isCommentAtClassStart(token));
const blockEndAllowed = options.allowBlockEnd && isCommentAtBlockEnd(token) && !(options.allowClassEnd === false && isCommentAtClassEnd(token));
const classStartAllowed = options.allowClassStart && isCommentAtClassStart(token);
const classEndAllowed = options.allowClassEnd && isCommentAtClassEnd(token);
const objectStartAllowed = options.allowObjectStart && isCommentAtObjectStart(token);
const objectEndAllowed = options.allowObjectEnd && isCommentAtObjectEnd(token);
const arrayStartAllowed = options.allowArrayStart && isCommentAtArrayStart(token);
const arrayEndAllowed = options.allowArrayEnd && isCommentAtArrayEnd(token);
const exceptionStartAllowed = blockStartAllowed || classStartAllowed || objectStartAllowed || arrayStartAllowed;
const exceptionEndAllowed = blockEndAllowed || classEndAllowed || objectEndAllowed || arrayEndAllowed;
if (prevLineNum < 1)
before = false;
if (nextLineNum >= numLines)
after = false;
if (commentIsNotAlone)
return;
const previousTokenOrComment = sourceCode.getTokenBefore(token, { includeComments: true });
const nextTokenOrComment = sourceCode.getTokenAfter(token, { includeComments: true });
if (!exceptionStartAllowed && before && !commentAndEmptyLines.has(prevLineNum) && !(utils.isCommentToken(previousTokenOrComment) && utils.isTokenOnSameLine(previousTokenOrComment, token))) {
const lineStart = token.range[0] - token.loc.start.column;
const range = [lineStart, lineStart];
context.report({
node: token,
messageId: "before",
fix(fixer) {
return fixer.insertTextBeforeRange(range, "\n");
}
});
}
if (!exceptionEndAllowed && after && !commentAndEmptyLines.has(nextLineNum) && !(utils.isCommentToken(nextTokenOrComment) && utils.isTokenOnSameLine(token, nextTokenOrComment))) {
context.report({
node: token,
messageId: "after",
fix(fixer) {
return fixer.insertTextAfter(token, "\n");
}
});
}
}
return {
Program() {
comments.forEach((token) => {
if (token.type === "Line") {
if (options.beforeLineComment || options.afterLineComment) {
checkForEmptyLine(token, {
after: options.afterLineComment,
before: options.beforeLineComment
});
}
} else if (token.type === "Block") {
if (options.beforeBlockComment || options.afterBlockComment) {
checkForEmptyLine(token, {
after: options.afterBlockComment,
before: options.beforeBlockComment
});
}
} else if (token.type === "Shebang") {
if (options.afterHashbangComment) {
checkForEmptyLine(token, {
after: options.afterHashbangComment,
before: false
});
}
}
});
}
};
}
});
const baseRule = /* @__PURE__ */ utils.castRuleModule(_baseRule);
const COMMENTS_IGNORE_PATTERN = /^\s*(?:eslint|jshint\s+|jslint\s+|istanbul\s+|globals?\s+|exported\s+|jscs)/u;
function getEmptyLineNums(lines) {
const emptyLines = lines.map((line, i) => ({
code: line.trim(),
num: i + 1
})).filter((line) => !line.code).map((line) => line.num);
return emptyLines;
}
function getCommentLineNums(comments) {
const lines = [];
comments.forEach((token) => {
const start = token.loc.start.line;
const end = token.loc.end.line;
lines.push(start, end);
});
return lines;
}
var linesAroundComment = utils.createRule({
name: "lines-around-comment",
package: "ts",
meta: {
type: "layout",
docs: {
description: "Require empty lines around comments"
},
schema: [
{
type: "object",
properties: {
beforeBlockComment: {
type: "boolean",
default: true
},
afterBlockComment: {
type: "boolean",
default: false
},
beforeLineComment: {
type: "boolean",
default: false
},
afterLineComment: {
type: "boolean",
default: false
},
allowBlockStart: {
type: "boolean",
default: false
},
allowBlockEnd: {
type: "boolean",
default: false
},
allowClassStart: {
type: "boolean"
},
allowClassEnd: {
type: "boolean"
},
allowObjectStart: {
type: "boolean"
},
allowObjectEnd: {
type: "boolean"
},
allowArrayStart: {
type: "boolean"
},
allowArrayEnd: {
type: "boolean"
},
allowInterfaceStart: {
type: "boolean"
},
allowInterfaceEnd: {
type: "boolean"
},
allowTypeStart: {
type: "boolean"
},
allowTypeEnd: {
type: "boolean"
},
allowEnumStart: {
type: "boolean"
},
allowEnumEnd: {
type: "boolean"
},
allowModuleStart: {
type: "boolean"
},
allowModuleEnd: {
type: "boolean"
},
ignorePattern: {
type: "string"
},
applyDefaultIgnorePatterns: {
type: "boolean"
},
afterHashbangComment: {
type: "boolean"
}
},
additionalProperties: false
}
],
fixable: baseRule.meta.fixable,
hasSuggestions: baseRule.meta.hasSuggestions,
messages: baseRule.meta.messages
},
defaultOptions: [
{
beforeBlockComment: true
}
],
create(context, [_options]) {
const options = _options;
const defaultIgnoreRegExp = COMMENTS_IGNORE_PATTERN;
const customIgnoreRegExp = new RegExp(options.ignorePattern ?? "", "u");
const sourceCode = context.sourceCode;
const comments = sourceCode.getAllComments();
const lines = sourceCode.lines;
const commentLines = getCommentLineNums(comments);
const emptyLines = getEmptyLineNums(lines);
const commentAndEmptyLines = new Set(commentLines.concat(emptyLines));
function codeAroundComment(token) {
let currentToken = token;
do {
currentToken = sourceCode.getTokenBefore(currentToken, {
includeComments: true
});
} while (currentToken && astUtils.isCommentToken(currentToken));
if (currentToken && astUtils.isTokenOnSameLine(currentToken, token))
return true;
currentToken = token;
do {
currentToken = sourceCode.getTokenAfter(currentToken, {
includeComments: true
});
} while (currentToken && astUtils.isCommentToken(currentToken));
if (currentToken && astUtils.isTokenOnSameLine(token, currentToken))
return true;
return false;
}
function isParentNodeType(parent, nodeType) {
return parent.type === nodeType;
}
function getParentNodeOfToken(token) {
const node = sourceCode.getNodeByRangeIndex(token.range[0]);
return node;
}
function isCommentAtParentStart(token, nodeType) {
const parent = getParentNodeOfToken(token);
if (parent && isParentNodeType(parent, nodeType)) {
const parentStartNodeOrToken = parent;
return token.loc.start.line - parentStartNodeOrToken.loc.start.line === 1;
}
return false;
}
function isCommentAtParentEnd(token, nodeType) {
const parent = getParentNodeOfToken(token);
return !!parent && isParentNodeType(parent, nodeType) && parent.loc.end.line - token.loc.end.line === 1;
}
function isCommentAtInterfaceStart(token) {
return isCommentAtParentStart(token, utils$1.AST_NODE_TYPES.TSInterfaceBody);
}
function isCommentAtInterfaceEnd(token) {
return isCommentAtParentEnd(token, utils$1.AST_NODE_TYPES.TSInterfaceBody);
}
function isCommentAtTypeStart(token) {
return isCommentAtParentStart(token, utils$1.AST_NODE_TYPES.TSTypeLiteral);
}
function isCommentAtTypeEnd(token) {
return isCommentAtParentEnd(token, utils$1.AST_NODE_TYPES.TSTypeLiteral);
}
function isCommentAtEnumStart(token) {
return isCommentAtParentStart(token, utils$1.AST_NODE_TYPES.TSEnumBody) || isCommentAtParentStart(token, utils$1.AST_NODE_TYPES.TSEnumDeclaration);
}
function isCommentAtEnumEnd(token) {
return isCommentAtParentEnd(token, utils$1.AST_NODE_TYPES.TSEnumBody) || isCommentAtParentEnd(token, utils$1.AST_NODE_TYPES.TSEnumDeclaration);
}
function isCommentAtModuleStart(token) {
return isCommentAtParentStart(token, utils$1.AST_NODE_TYPES.TSModuleBlock);
}
function isCommentAtModuleEnd(token) {
return isCommentAtParentEnd(token, utils$1.AST_NODE_TYPES.TSModuleBlock);
}
function isCommentNearTSConstruct(token) {
return isCommentAtInterfaceStart(token) || isCommentAtInterfaceEnd(token) || isCommentAtTypeStart(token) || isCommentAtTypeEnd(token) || isCommentAtEnumStart(token) || isCommentAtEnumEnd(token) || isCommentAtModuleStart(token) || isCommentAtModuleEnd(token);
}
function checkForEmptyLine(token, { before, after }) {
if (!isCommentNearTSConstruct(token))
return;
if (options.applyDefaultIgnorePatterns !== false && defaultIgnoreRegExp.test(token.value)) {
return;
}
if (options.ignorePattern && customIgnoreRegExp.test(token.value))
return;
const prevLineNum = token.loc.start.line - 1;
const nextLineNum = token.loc.end.line + 1;
if (codeAroundComment(token))
return;
const interfaceStartAllowed = Boolean(options.allowInterfaceStart) && isCommentAtInterfaceStart(token);
const interfaceEndAllowed = Boolean(options.allowInterfaceEnd) && isCommentAtInterfaceEnd(token);
const typeStartAllowed = Boolean(options.allowTypeStart) && isCommentAtTypeStart(token);
const typeEndAllowed = Boolean(options.allowTypeEnd) && isCommentAtTypeEnd(token);
const enumStartAllowed = Boolean(options.allowEnumStart) && isCommentAtEnumStart(token);
const enumEndAllowed = Boolean(options.allowEnumEnd) && isCommentAtEnumEnd(token);
const moduleStartAllowed = Boolean(options.allowModuleStart) && isCommentAtModuleStart(token);
const moduleEndAllowed = Boolean(options.allowModuleEnd) && isCommentAtModuleEnd(token);
const exceptionStartAllowed = interfaceStartAllowed || typeStartAllowed || enumStartAllowed || moduleStartAllowed;
const exceptionEndAllowed = interfaceEndAllowed || typeEndAllowed || enumEndAllowed || moduleEndAllowed;
const previousTokenOrComment = sourceCode.getTokenBefore(token, {
includeComments: true
});
const nextTokenOrComment = sourceCode.getTokenAfter(token, {
includeComments: true
});
if (!exceptionStartAllowed && before && !commentAndEmptyLines.has(prevLineNum) && !(astUtils.isCommentToken(previousTokenOrComment) && astUtils.isTokenOnSameLine(previousTokenOrComment, token))) {
const lineStart = token.range[0] - token.loc.start.column;
const range = [lineStart, lineStart];
context.report({
node: token,
messageId: "before",
fix(fixer) {
return fixer.insertTextBeforeRange(range, "\n");
}
});
}
if (!exceptionEndAllowed && after && !commentAndEmptyLines.has(nextLineNum) && !(astUtils.isCommentToken(nextTokenOrComment) && astUtils.isTokenOnSameLine(token, nextTokenOrComment))) {
context.report({
node: token,
messageId: "after",
fix(fixer) {
return fixer.insertTextAfter(token, "\n");
}
});
}
}
const customReport = (descriptor) => {
if ("node" in descriptor) {
if (descriptor.node.type === utils$1.AST_TOKEN_TYPES.Line || descriptor.node.type === utils$1.AST_TOKEN_TYPES.Block) {
if (isCommentNearTSConstruct(descriptor.node))
return;
}
}
return context.report(descriptor);
};
const customContext = { report: customReport };
const proxiedContext = new Proxy(
customContext,
{
get(target, path, receiver) {
if (path !== "report")
return Reflect.get(context, path, receiver);
return Reflect.get(target, path, receiver);
}
}
);
const rules = baseRule.create(proxiedContext);
return {
Program(node) {
rules.Program(node);
comments.forEach((token) => {
if (token.type === utils$1.AST_TOKEN_TYPES.Line) {
if (options.beforeLineComment || options.afterLineComment) {
checkForEmptyLine(token, {
after: options.afterLineComment,
before: options.beforeLineComment
});
}
} else if (token.type === utils$1.AST_TOKEN_TYPES.Block) {
if (options.beforeBlockComment || options.afterBlockComment) {
checkForEmptyLine(token, {
after: options.afterBlockComment,
before: options.beforeBlockComment
});
}
}
});
}
};
}
});
module.exports = linesAroundComment;
@@ -0,0 +1,19 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
export function getOffset(element, reverse, orientation = 'horizontal') {
let rect = element.getBoundingClientRect();
if (reverse) {
return orientation === 'horizontal' ? rect.right : rect.bottom;
}
return orientation === 'horizontal' ? rect.left : rect.top;
}
@@ -0,0 +1,25 @@
import {createEventHandler as $93925083ecbb358c$export$48d1ea6320830260} from "./createEventHandler.module.js";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $46d819fcbaf35654$export$8f71654801c2f7cd(props) {
return {
keyboardProps: props.isDisabled ? {} : {
onKeyDown: (0, $93925083ecbb358c$export$48d1ea6320830260)(props.onKeyDown),
onKeyUp: (0, $93925083ecbb358c$export$48d1ea6320830260)(props.onKeyUp)
}
};
}
export {$46d819fcbaf35654$export$8f71654801c2f7cd as useKeyboard};
//# sourceMappingURL=useKeyboard.module.js.map
@@ -0,0 +1 @@
{"name":"router","version":"2.2.0","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532089830,"integrity":"sha512-8Tkms/9p2vJ8VbS922uykVHFX1FFOlj3VPcsn5l3AsOWtNeRux083pgSew9WV1ZkQvVy5rfreMgY0Aoufh2QJQ==","mode":420,"size":1128},"index.js":{"checkedAt":1794532089830,"integrity":"sha512-SGAsxcW/b6RcZopGyKXKBfk5NJ5vDwsM7t6VI3Cx4o7QOVDXij7wxGVfXWT+/itbFM4L5kqP3wMgSqfVb3wgcg==","mode":420,"size":15866},"lib/layer.js":{"checkedAt":1794532089830,"integrity":"sha512-8SjOjIh8hRfjy7C69AjZ5sj6pfwgjt/OCcP11HOn8986U6mytwj1KhibdwMh5H9v1sR8nemnAnM8wsvf2UXWJA==","mode":420,"size":4936},"lib/route.js":{"checkedAt":1794532089830,"integrity":"sha512-qlfhQVQsFm3RjSfzwcfz+2N80aSbk7ynvOBr1KdHYqdKwo6JM3ciQE+CNFVF+jHrPliIH2s0HjkdCcSoFk+Tjg==","mode":420,"size":4552},"package.json":{"checkedAt":1794532089830,"integrity":"sha512-rJc5fDd9T1cZUWnAVwWJT966Ul336oE42GqPEmUXDUc39fkuJyJyWs7yDD72Q9xdaVWTkTzlKHQHOSVReYJIBw==","mode":420,"size":1142},"HISTORY.md":{"checkedAt":1794532089830,"integrity":"sha512-YCIb5KTfhDI0OipOlF9CSEy0HcKuhYokZ1SppeZiG1q5gcMc2x/lRLulYZsskmVxU2scSEws9Tbkv3Lwd4fiBw==","mode":420,"size":6571},"README.md":{"checkedAt":1794532089830,"integrity":"sha512-EbzrB1XNy0GThucxiNSL9ftfmHXlbQKrID1+N44A84R9dRrMUtpVVCmtj8kpuEQ8iUEfzvgtTXxdqNlGmwf5Gw==","mode":420,"size":12656}}}
@@ -0,0 +1,43 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("eslint-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Object.isFrozen` method.",
category: "ES5",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-object-isfrozen.html",
},
fixable: null,
messages: {
forbidden: "ES5 '{{name}}' method is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"() {
const tracker = new ReferenceTracker(context.getScope())
for (const { node, path } of tracker.iterateGlobalReferences({
Object: {
isFrozen: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1,82 @@
{
"name": "commander",
"version": "14.0.2",
"description": "the complete solution for node.js command-line programs",
"keywords": [
"commander",
"command",
"option",
"parser",
"cli",
"argument",
"args",
"argv"
],
"author": "TJ Holowaychuk <tj@vision-media.ca>",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/tj/commander.js.git"
},
"scripts": {
"check": "npm run check:type && npm run check:lint && npm run check:format",
"check:format": "prettier --check .",
"check:lint": "eslint .",
"check:type": "npm run check:type:js && npm run check:type:ts",
"check:type:ts": "tsd && tsc -p tsconfig.ts.json",
"check:type:js": "tsc -p tsconfig.js.json",
"fix": "npm run fix:lint && npm run fix:format",
"fix:format": "prettier --write .",
"fix:lint": "eslint --fix .",
"test": "jest && npm run check:type:ts",
"test-all": "jest && npm run test-esm && npm run check",
"test-esm": "node ./tests/esm-imports-test.mjs"
},
"files": [
"index.js",
"lib/*.js",
"esm.mjs",
"typings/index.d.ts",
"typings/esm.d.mts",
"package-support.json"
],
"type": "commonjs",
"main": "./index.js",
"exports": {
".": {
"require": {
"types": "./typings/index.d.ts",
"default": "./index.js"
},
"import": {
"types": "./typings/esm.d.mts",
"default": "./esm.mjs"
},
"default": "./index.js"
},
"./esm.mjs": {
"types": "./typings/esm.d.mts",
"import": "./esm.mjs"
}
},
"devDependencies": {
"@eslint/js": "^9.4.0",
"@types/jest": "^30.0.0",
"@types/node": "^22.7.4",
"eslint": "^9.17.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-jest": "^29.0.1",
"globals": "^16.0.0",
"jest": "^30.0.3",
"prettier": "^3.2.5",
"ts-jest": "^29.0.3",
"tsd": "^0.33.0",
"typescript": "^5.0.4",
"typescript-eslint": "^8.12.2"
},
"types": "typings/index.d.ts",
"engines": {
"node": ">=20"
},
"support": true
}
@@ -0,0 +1,113 @@
{
"name": "unist-util-visit",
"version": "5.0.0",
"description": "unist utility to visit nodes",
"license": "MIT",
"keywords": [
"unist",
"unist-util",
"util",
"utility",
"remark",
"retext",
"rehype",
"mdast",
"hast",
"xast",
"nlcst",
"natural",
"language",
"markdown",
"html",
"xml",
"tree",
"ast",
"node",
"visit",
"walk"
],
"repository": "syntax-tree/unist-util-visit",
"bugs": "https://github.com/syntax-tree/unist-util-visit/issues",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
},
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"Eugene Sharygin <eush77@gmail.com>",
"Richard Gibson <richard.gibson@gmail.com>"
],
"sideEffects": false,
"type": "module",
"exports": "./index.js",
"files": [
"lib/",
"index.d.ts",
"index.js"
],
"dependencies": {
"@types/unist": "^3.0.0",
"unist-util-is": "^6.0.0",
"unist-util-visit-parents": "^6.0.0"
},
"devDependencies": {
"@types/mdast": "^4.0.0",
"@types/node": "^20.0.0",
"c8": "^8.0.0",
"mdast-util-from-markdown": "^1.0.0",
"mdast-util-gfm": "^2.0.0",
"micromark-extension-gfm": "^2.0.0",
"prettier": "^2.0.0",
"remark-cli": "^11.0.0",
"remark-preset-wooorm": "^9.0.0",
"tsd": "^0.28.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"xo": "^0.54.0"
},
"scripts": {
"prepack": "npm run build && npm run format",
"build": "tsc --build --clean && tsc --build && tsd && type-coverage",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"test-api": "node --conditions development test.js",
"test-coverage": "c8 --100 --reporter lcov npm run test-api",
"test": "npm run build && npm run format && npm run test-coverage"
},
"prettier": {
"bracketSpacing": false,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false
},
"remarkConfig": {
"plugins": [
"remark-preset-wooorm"
]
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
"#": "needed `any`s",
"ignoreFiles": [
"lib/index.d.ts"
],
"ignoreCatch": true,
"strict": true
},
"xo": {
"overrides": [
{
"files": [
"**/*.ts"
],
"rules": {
"import/no-extraneous-dependencies": "off"
}
}
],
"prettier": true
}
}
@@ -0,0 +1,28 @@
import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f} from "./CalendarDate.mjs";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $2b4dce13dd5a17fa$export$842a2cf37af977e1(amount, numerator) {
return amount - numerator * Math.floor(amount / numerator);
}
function $2b4dce13dd5a17fa$export$784d13d8ee351f07(date) {
if (date.era) return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(date.calendar, date.era, date.year, date.month, date.day);
else return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(date.calendar, date.year, date.month, date.day);
}
function $2b4dce13dd5a17fa$export$27fa0172ae2644b3(date) {
if (date.era) return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
else return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.year, date.month, date.day, date.hour, date.minute, date.second);
}
export {$2b4dce13dd5a17fa$export$842a2cf37af977e1 as mod, $2b4dce13dd5a17fa$export$784d13d8ee351f07 as copy, $2b4dce13dd5a17fa$export$27fa0172ae2644b3 as copyDateTime};
//# sourceMappingURL=utils.module.js.map
@@ -0,0 +1,48 @@
{
"name": "postcss-js",
"version": "4.1.0",
"description": "PostCSS for CSS-in-JS and styles in JS objects",
"keywords": [
"postcss",
"postcss-runner",
"js",
"inline",
"react",
"css",
"cssinjs"
],
"author": "Andrey Sitnik <andrey@sitnik.ru>",
"license": "MIT",
"repository": "postcss/postcss-js",
"engines": {
"node": "^12 || ^14 || >= 16"
},
"exports": {
".": {
"require": "./index.js",
"import": "./index.mjs"
},
"./package.json": "./package.json",
"./async": "./async.js",
"./objectifier": "./objectifier.js",
"./parser": "./parser.js",
"./process-result": "./process-result.js",
"./sync": "./sync.js"
},
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"peerDependencies": {
"postcss": "^8.4.21"
},
"dependencies": {
"camelcase-css": "^2.0.1"
}
}
@@ -0,0 +1,22 @@
var $817f925d289daf81$exports = require("./useTabListState.main.js");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useTabListState", () => $817f925d289daf81$exports.useTabListState);
/*
* 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.
*/
//# sourceMappingURL=main.js.map
@@ -0,0 +1,224 @@
'use strict';
var utils = require('../utils.js');
var utils$1 = require('@typescript-eslint/utils');
var astUtils = require('@typescript-eslint/utils/ast-utils');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
var _baseRule = utils.createRule({
name: "space-infix-ops",
package: "js",
meta: {
type: "layout",
docs: {
description: "Require spacing around infix operators"
},
fixable: "whitespace",
schema: [
{
type: "object",
properties: {
int32Hint: {
type: "boolean",
default: false
}
},
additionalProperties: false
}
],
messages: {
missingSpace: "Operator '{{operator}}' must be spaced."
}
},
create(context) {
const int32Hint = context.options[0] ? context.options[0].int32Hint === true : false;
const sourceCode = context.sourceCode;
function getFirstNonSpacedToken(left, right, op) {
const operator = sourceCode.getFirstTokenBetween(left, right, (token) => token.value === op);
const prev = sourceCode.getTokenBefore(operator);
const next = sourceCode.getTokenAfter(operator);
if (!sourceCode.isSpaceBetweenTokens(prev, operator) || !sourceCode.isSpaceBetweenTokens(operator, next))
return operator;
return null;
}
function report(mainNode, culpritToken) {
context.report({
node: mainNode,
loc: culpritToken.loc,
messageId: "missingSpace",
data: {
operator: culpritToken.value
},
fix(fixer) {
const previousToken = sourceCode.getTokenBefore(culpritToken);
const afterToken = sourceCode.getTokenAfter(culpritToken);
let fixString = "";
if (culpritToken.range[0] - previousToken.range[1] === 0)
fixString = " ";
fixString += culpritToken.value;
if (afterToken.range[0] - culpritToken.range[1] === 0)
fixString += " ";
return fixer.replaceText(culpritToken, fixString);
}
});
}
function checkBinary(node) {
const leftNode = "typeAnnotation" in node.left && node.left.typeAnnotation ? node.left.typeAnnotation : node.left;
const rightNode = node.right;
const operator = "operator" in node && node.operator ? node.operator : "=";
const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode, operator);
if (nonSpacedNode) {
if (!(int32Hint && sourceCode.getText(node).endsWith("|0")))
report(node, nonSpacedNode);
}
}
function checkConditional(node) {
const nonSpacedConsequentNode = getFirstNonSpacedToken(node.test, node.consequent, "?");
const nonSpacedAlternateNode = getFirstNonSpacedToken(node.consequent, node.alternate, ":");
if (nonSpacedConsequentNode)
report(node, nonSpacedConsequentNode);
if (nonSpacedAlternateNode)
report(node, nonSpacedAlternateNode);
}
function checkVar(node) {
const leftNode = node.id.typeAnnotation ? node.id.typeAnnotation : node.id;
const rightNode = node.init;
if (rightNode) {
const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode, "=");
if (nonSpacedNode)
report(node, nonSpacedNode);
}
}
return {
AssignmentExpression: checkBinary,
AssignmentPattern: checkBinary,
BinaryExpression: checkBinary,
LogicalExpression: checkBinary,
ConditionalExpression: checkConditional,
VariableDeclarator: checkVar,
// TODO: Stage 3: Overridden by ts version, can delete directly
PropertyDefinition(node) {
if (!node.value)
return;
const operatorToken = sourceCode.getTokenBefore(node.value, utils.isEqToken);
const leftToken = sourceCode.getTokenBefore(operatorToken);
const rightToken = sourceCode.getTokenAfter(operatorToken);
if (!sourceCode.isSpaceBetweenTokens(leftToken, operatorToken) || !sourceCode.isSpaceBetweenTokens(operatorToken, rightToken)) {
report(node, operatorToken);
}
}
};
}
});
const baseRule = /* @__PURE__ */ utils.castRuleModule(_baseRule);
const UNIONS = ["|", "&"];
var spaceInfixOps = utils.createRule({
name: "space-infix-ops",
package: "ts",
meta: {
type: "layout",
docs: {
description: "Require spacing around infix operators"
},
fixable: baseRule.meta.fixable,
hasSuggestions: baseRule.meta.hasSuggestions,
schema: baseRule.meta.schema,
messages: baseRule.meta.messages
},
defaultOptions: [
{
int32Hint: false
}
],
create(context) {
const rules = baseRule.create(context);
const sourceCode = context.sourceCode;
function report(node, operator) {
context.report({
node,
loc: operator.loc,
messageId: "missingSpace",
data: {
operator: operator.value
},
fix(fixer) {
const previousToken = sourceCode.getTokenBefore(operator);
const afterToken = sourceCode.getTokenAfter(operator);
let fixString = "";
if (operator.range[0] - previousToken.range[1] === 0)
fixString = " ";
fixString += operator.value;
if (afterToken.range[0] - operator.range[1] === 0)
fixString += " ";
return fixer.replaceText(operator, fixString);
}
});
}
function isSpaceChar(token) {
return token.type === utils$1.AST_TOKEN_TYPES.Punctuator && /^[=?:]$/.test(token.value);
}
function checkAndReportAssignmentSpace(node, leftNode, rightNode) {
if (!rightNode || !leftNode)
return;
const operator = sourceCode.getFirstTokenBetween(
leftNode,
rightNode,
isSpaceChar
);
const prev = sourceCode.getTokenBefore(operator);
const next = sourceCode.getTokenAfter(operator);
if (!sourceCode.isSpaceBetween(prev, operator) || !sourceCode.isSpaceBetween(operator, next)) {
report(node, operator);
}
}
function checkForEnumAssignmentSpace(node) {
checkAndReportAssignmentSpace(node, node.id, node.initializer);
}
function checkForPropertyDefinitionAssignmentSpace(node) {
const leftNode = node.optional && !node.typeAnnotation ? sourceCode.getTokenAfter(node.key) : node.typeAnnotation ?? node.key;
checkAndReportAssignmentSpace(node, leftNode, node.value);
}
function checkForTypeAnnotationSpace(typeAnnotation) {
const types = typeAnnotation.types;
types.forEach((type) => {
const skipFunctionParenthesis = type.type === utils$1.AST_NODE_TYPES.TSFunctionType ? astUtils.isNotOpeningParenToken : 0;
const operator = sourceCode.getTokenBefore(
type,
skipFunctionParenthesis
);
if (operator != null && UNIONS.includes(operator.value)) {
const prev = sourceCode.getTokenBefore(operator);
const next = sourceCode.getTokenAfter(operator);
if (!sourceCode.isSpaceBetween(prev, operator) || !sourceCode.isSpaceBetween(operator, next)) {
report(typeAnnotation, operator);
}
}
});
}
function checkForTypeAliasAssignment(node) {
checkAndReportAssignmentSpace(
node,
node.typeParameters ?? node.id,
node.typeAnnotation
);
}
function checkForTypeConditional(node) {
checkAndReportAssignmentSpace(node, node.extendsType, node.trueType);
checkAndReportAssignmentSpace(node, node.trueType, node.falseType);
}
return {
...rules,
TSEnumMember: checkForEnumAssignmentSpace,
PropertyDefinition: checkForPropertyDefinitionAssignmentSpace,
TSTypeAliasDeclaration: checkForTypeAliasAssignment,
TSUnionType: checkForTypeAnnotationSpace,
TSIntersectionType: checkForTypeAnnotationSpace,
TSConditionalType: checkForTypeConditional
};
}
});
module.exports = spaceInfixOps;
@@ -0,0 +1,4 @@
declare function dataViewByteOffset(value: DataView): number;
declare function dataViewByteOffset(value: unknown): never;
export = dataViewByteOffset;
@@ -0,0 +1,105 @@
const { parse, inspect } = require('../../lib/index.cjs');
test('name cut off', () => {
const source = `
/**
* @param {{includeWhiteSpace: (boolean|undefined),
* ignoreElementOrder: (boolean|undefined)}} [options] The options.
*/`.slice(1);
const tagSource = [
{
number: 1,
source: ' * @param {{includeWhiteSpace: (boolean|undefined),',
tokens: {
start: ' ',
delimiter: '*',
postDelimiter: ' ',
tag: '@param',
postTag: ' ',
type: '{{includeWhiteSpace: (boolean|undefined),',
postType: '',
name: '',
postName: '',
description: '',
end: '',
lineEnd: '',
},
},
{
number: 2,
source:
' * ignoreElementOrder: (boolean|undefined)}} [options] The options.',
tokens: {
start: ' ',
delimiter: '*',
postDelimiter: ' ',
tag: '',
postTag: '',
type: ' ignoreElementOrder: (boolean|undefined)}}',
postType: ' ',
name: '[options]',
postName: ' ',
description: 'The options.',
end: '',
lineEnd: '',
},
},
{
number: 3,
source: ' */',
tokens: {
start: ' ',
delimiter: '',
postDelimiter: '',
tag: '',
postTag: '',
type: '',
postType: '',
name: '',
postName: '',
description: '',
end: '*/',
lineEnd: '',
},
},
];
const parsed = parse(source);
// console.log(inspect(parsed[0]));
expect(parsed[0]).toMatchObject({
problems: [],
tags: [
{
tag: 'param',
type: '{includeWhiteSpace: (boolean|undefined),ignoreElementOrder: (boolean|undefined)}',
name: 'options',
optional: true,
description: 'The options.',
source: tagSource,
},
],
source: [
{
number: 0,
source: ' /**',
tokens: {
start: ' ',
delimiter: '/**',
postDelimiter: '',
tag: '',
postTag: '',
type: '',
postType: '',
name: '',
postName: '',
description: '',
end: '',
lineEnd: '',
},
},
...tagSource,
],
});
});
@@ -0,0 +1,5 @@
'use strict';
// http://262.ecma-international.org/5.1/#sec-9.9
module.exports = require('es-object-atoms/ToObject');
@@ -0,0 +1,48 @@
'use strict';
var $TypeError = require('es-errors/type');
var callBound = require('call-bound');
var forEach = require('../helpers/forEach');
var $charCodeAt = callBound('String.prototype.charCodeAt');
var $numberToString = callBound('Number.prototype.toString');
var $toLowerCase = callBound('String.prototype.toLowerCase');
var $strSlice = callBound('String.prototype.slice');
var $strSplit = callBound('String.prototype.split');
// https://262.ecma-international.org/6.0/#sec-quotejsonstring
var escapes = {
'\u0008': 'b',
'\u000C': 'f',
'\u000A': 'n',
'\u000D': 'r',
'\u0009': 't'
};
module.exports = function QuoteJSONString(value) {
if (typeof value !== 'string') {
throw new $TypeError('Assertion failed: `value` must be a String');
}
var product = '"';
if (value) {
forEach($strSplit(value, ''), function (C) {
if (C === '"' || C === '\\') {
product += '\u005C' + C;
} else if (C === '\u0008' || C === '\u000C' || C === '\u000A' || C === '\u000D' || C === '\u0009') {
var abbrev = escapes[C];
product += '\u005C' + abbrev;
} else {
var cCharCode = $charCodeAt(C, 0);
if (cCharCode < 0x20) {
product += '\u005Cu' + $toLowerCase($strSlice('0000' + $numberToString(cCharCode, 16), -4));
} else {
product += C;
}
}
});
}
product += '"';
return product;
};
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,eAAe,CAAC,iBAAiB,CAAC;AACtD","sources":["packages/@react-aria/breadcrumbs/intl/pt-BR.json"],"sourcesContent":["{\n \"breadcrumbs\": \"Caminho detalhado\"\n}\n"],"names":[],"version":3,"file":"pt-BR.module.js.map"}
@@ -0,0 +1,9 @@
{
"extends": "@ljharb/tsconfig",
"compilerOptions": {
// "target": "es2021",
},
"exclude": [
"coverage",
],
}
@@ -0,0 +1,14 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
const agent_1 = __importDefault(require("./agent"));
function createHttpProxyAgent(opts) {
return new agent_1.default(opts);
}
(function (createHttpProxyAgent) {
createHttpProxyAgent.HttpProxyAgent = agent_1.default;
createHttpProxyAgent.prototype = agent_1.default.prototype;
})(createHttpProxyAgent || (createHttpProxyAgent = {}));
module.exports = createHttpProxyAgent;
//# sourceMappingURL=index.js.map
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more