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,2 @@
export * from "./encrypted_private_key_info";
export * from "./private_key_info";
@@ -0,0 +1,4 @@
var dom = require('./dom')
exports.DOMImplementation = dom.DOMImplementation
exports.XMLSerializer = dom.XMLSerializer
exports.DOMParser = require('./dom-parser').DOMParser
@@ -0,0 +1,19 @@
# @babel/traverse
> The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes
See our website [@babel/traverse](https://babeljs.io/docs/babel-traverse) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20traverse%22+is%3Aopen) associated with this package.
## Install
Using npm:
```sh
npm install --save-dev @babel/traverse
```
or using yarn:
```sh
yarn add @babel/traverse --dev
```
@@ -0,0 +1,7 @@
export default (function (o, c) {
var proto = c.prototype;
proto.isLeapYear = function () {
return this.$y % 4 === 0 && this.$y % 100 !== 0 || this.$y % 400 === 0;
};
});
@@ -0,0 +1,13 @@
"use client";
// src/dropdown-context.ts
import { createContext } from "@heroui/react-utils";
var [DropdownProvider, useDropdownContext] = createContext({
name: "DropdownContext",
errorMessage: "useDropdownContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Dropdown />`"
});
export {
DropdownProvider,
useDropdownContext
};
@@ -0,0 +1,631 @@
/*!
* express
* Copyright(c) 2009-2013 TJ Holowaychuk
* Copyright(c) 2013 Roman Shtylman
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict';
/**
* Module dependencies.
* @private
*/
var finalhandler = require('finalhandler');
var debug = require('debug')('express:application');
var View = require('./view');
var http = require('node:http');
var methods = require('./utils').methods;
var compileETag = require('./utils').compileETag;
var compileQueryParser = require('./utils').compileQueryParser;
var compileTrust = require('./utils').compileTrust;
var resolve = require('node:path').resolve;
var once = require('once')
var Router = require('router');
/**
* Module variables.
* @private
*/
var slice = Array.prototype.slice;
var flatten = Array.prototype.flat;
/**
* Application prototype.
*/
var app = exports = module.exports = {};
/**
* Variable for trust proxy inheritance back-compat
* @private
*/
var trustProxyDefaultSymbol = '@@symbol:trust_proxy_default';
/**
* Initialize the server.
*
* - setup default configuration
* - setup default middleware
* - setup route reflection methods
*
* @private
*/
app.init = function init() {
var router = null;
this.cache = Object.create(null);
this.engines = Object.create(null);
this.settings = Object.create(null);
this.defaultConfiguration();
// Setup getting to lazily add base router
Object.defineProperty(this, 'router', {
configurable: true,
enumerable: true,
get: function getrouter() {
if (router === null) {
router = new Router({
caseSensitive: this.enabled('case sensitive routing'),
strict: this.enabled('strict routing')
});
}
return router;
}
});
};
/**
* Initialize application configuration.
* @private
*/
app.defaultConfiguration = function defaultConfiguration() {
var env = process.env.NODE_ENV || 'development';
// default settings
this.enable('x-powered-by');
this.set('etag', 'weak');
this.set('env', env);
this.set('query parser', 'simple')
this.set('subdomain offset', 2);
this.set('trust proxy', false);
// trust proxy inherit back-compat
Object.defineProperty(this.settings, trustProxyDefaultSymbol, {
configurable: true,
value: true
});
debug('booting in %s mode', env);
this.on('mount', function onmount(parent) {
// inherit trust proxy
if (this.settings[trustProxyDefaultSymbol] === true
&& typeof parent.settings['trust proxy fn'] === 'function') {
delete this.settings['trust proxy'];
delete this.settings['trust proxy fn'];
}
// inherit protos
Object.setPrototypeOf(this.request, parent.request)
Object.setPrototypeOf(this.response, parent.response)
Object.setPrototypeOf(this.engines, parent.engines)
Object.setPrototypeOf(this.settings, parent.settings)
});
// setup locals
this.locals = Object.create(null);
// top-most app is mounted at /
this.mountpath = '/';
// default locals
this.locals.settings = this.settings;
// default configuration
this.set('view', View);
this.set('views', resolve('views'));
this.set('jsonp callback name', 'callback');
if (env === 'production') {
this.enable('view cache');
}
};
/**
* Dispatch a req, res pair into the application. Starts pipeline processing.
*
* If no callback is provided, then default error handlers will respond
* in the event of an error bubbling through the stack.
*
* @private
*/
app.handle = function handle(req, res, callback) {
// final handler
var done = callback || finalhandler(req, res, {
env: this.get('env'),
onerror: logerror.bind(this)
});
// set powered by header
if (this.enabled('x-powered-by')) {
res.setHeader('X-Powered-By', 'Express');
}
// set circular references
req.res = res;
res.req = req;
// alter the prototypes
Object.setPrototypeOf(req, this.request)
Object.setPrototypeOf(res, this.response)
// setup locals
if (!res.locals) {
res.locals = Object.create(null);
}
this.router.handle(req, res, done);
};
/**
* Proxy `Router#use()` to add middleware to the app router.
* See Router#use() documentation for details.
*
* If the _fn_ parameter is an express app, then it will be
* mounted at the _route_ specified.
*
* @public
*/
app.use = function use(fn) {
var offset = 0;
var path = '/';
// default path to '/'
// disambiguate app.use([fn])
if (typeof fn !== 'function') {
var arg = fn;
while (Array.isArray(arg) && arg.length !== 0) {
arg = arg[0];
}
// first arg is the path
if (typeof arg !== 'function') {
offset = 1;
path = fn;
}
}
var fns = flatten.call(slice.call(arguments, offset), Infinity);
if (fns.length === 0) {
throw new TypeError('app.use() requires a middleware function')
}
// get router
var router = this.router;
fns.forEach(function (fn) {
// non-express app
if (!fn || !fn.handle || !fn.set) {
return router.use(path, fn);
}
debug('.use app under %s', path);
fn.mountpath = path;
fn.parent = this;
// restore .app property on req and res
router.use(path, function mounted_app(req, res, next) {
var orig = req.app;
fn.handle(req, res, function (err) {
Object.setPrototypeOf(req, orig.request)
Object.setPrototypeOf(res, orig.response)
next(err);
});
});
// mounted an app
fn.emit('mount', this);
}, this);
return this;
};
/**
* Proxy to the app `Router#route()`
* Returns a new `Route` instance for the _path_.
*
* Routes are isolated middleware stacks for specific paths.
* See the Route api docs for details.
*
* @public
*/
app.route = function route(path) {
return this.router.route(path);
};
/**
* Register the given template engine callback `fn`
* as `ext`.
*
* By default will `require()` the engine based on the
* file extension. For example if you try to render
* a "foo.ejs" file Express will invoke the following internally:
*
* app.engine('ejs', require('ejs').__express);
*
* For engines that do not provide `.__express` out of the box,
* or if you wish to "map" a different extension to the template engine
* you may use this method. For example mapping the EJS template engine to
* ".html" files:
*
* app.engine('html', require('ejs').renderFile);
*
* In this case EJS provides a `.renderFile()` method with
* the same signature that Express expects: `(path, options, callback)`,
* though note that it aliases this method as `ejs.__express` internally
* so if you're using ".ejs" extensions you don't need to do anything.
*
* Some template engines do not follow this convention, the
* [Consolidate.js](https://github.com/tj/consolidate.js)
* library was created to map all of node's popular template
* engines to follow this convention, thus allowing them to
* work seamlessly within Express.
*
* @param {String} ext
* @param {Function} fn
* @return {app} for chaining
* @public
*/
app.engine = function engine(ext, fn) {
if (typeof fn !== 'function') {
throw new Error('callback function required');
}
// get file extension
var extension = ext[0] !== '.'
? '.' + ext
: ext;
// store engine
this.engines[extension] = fn;
return this;
};
/**
* Proxy to `Router#param()` with one added api feature. The _name_ parameter
* can be an array of names.
*
* See the Router#param() docs for more details.
*
* @param {String|Array} name
* @param {Function} fn
* @return {app} for chaining
* @public
*/
app.param = function param(name, fn) {
if (Array.isArray(name)) {
for (var i = 0; i < name.length; i++) {
this.param(name[i], fn);
}
return this;
}
this.router.param(name, fn);
return this;
};
/**
* Assign `setting` to `val`, or return `setting`'s value.
*
* app.set('foo', 'bar');
* app.set('foo');
* // => "bar"
*
* Mounted servers inherit their parent server's settings.
*
* @param {String} setting
* @param {*} [val]
* @return {Server} for chaining
* @public
*/
app.set = function set(setting, val) {
if (arguments.length === 1) {
// app.get(setting)
return this.settings[setting];
}
debug('set "%s" to %o', setting, val);
// set value
this.settings[setting] = val;
// trigger matched settings
switch (setting) {
case 'etag':
this.set('etag fn', compileETag(val));
break;
case 'query parser':
this.set('query parser fn', compileQueryParser(val));
break;
case 'trust proxy':
this.set('trust proxy fn', compileTrust(val));
// trust proxy inherit back-compat
Object.defineProperty(this.settings, trustProxyDefaultSymbol, {
configurable: true,
value: false
});
break;
}
return this;
};
/**
* Return the app's absolute pathname
* based on the parent(s) that have
* mounted it.
*
* For example if the application was
* mounted as "/admin", which itself
* was mounted as "/blog" then the
* return value would be "/blog/admin".
*
* @return {String}
* @private
*/
app.path = function path() {
return this.parent
? this.parent.path() + this.mountpath
: '';
};
/**
* Check if `setting` is enabled (truthy).
*
* app.enabled('foo')
* // => false
*
* app.enable('foo')
* app.enabled('foo')
* // => true
*
* @param {String} setting
* @return {Boolean}
* @public
*/
app.enabled = function enabled(setting) {
return Boolean(this.set(setting));
};
/**
* Check if `setting` is disabled.
*
* app.disabled('foo')
* // => true
*
* app.enable('foo')
* app.disabled('foo')
* // => false
*
* @param {String} setting
* @return {Boolean}
* @public
*/
app.disabled = function disabled(setting) {
return !this.set(setting);
};
/**
* Enable `setting`.
*
* @param {String} setting
* @return {app} for chaining
* @public
*/
app.enable = function enable(setting) {
return this.set(setting, true);
};
/**
* Disable `setting`.
*
* @param {String} setting
* @return {app} for chaining
* @public
*/
app.disable = function disable(setting) {
return this.set(setting, false);
};
/**
* Delegate `.VERB(...)` calls to `router.VERB(...)`.
*/
methods.forEach(function (method) {
app[method] = function (path) {
if (method === 'get' && arguments.length === 1) {
// app.get(setting)
return this.set(path);
}
var route = this.route(path);
route[method].apply(route, slice.call(arguments, 1));
return this;
};
});
/**
* Special-cased "all" method, applying the given route `path`,
* middleware, and callback to _every_ HTTP method.
*
* @param {String} path
* @param {Function} ...
* @return {app} for chaining
* @public
*/
app.all = function all(path) {
var route = this.route(path);
var args = slice.call(arguments, 1);
for (var i = 0; i < methods.length; i++) {
route[methods[i]].apply(route, args);
}
return this;
};
/**
* Render the given view `name` name with `options`
* and a callback accepting an error and the
* rendered template string.
*
* Example:
*
* app.render('email', { name: 'Tobi' }, function(err, html){
* // ...
* })
*
* @param {String} name
* @param {Object|Function} options or fn
* @param {Function} callback
* @public
*/
app.render = function render(name, options, callback) {
var cache = this.cache;
var done = callback;
var engines = this.engines;
var opts = options;
var view;
// support callback function as second arg
if (typeof options === 'function') {
done = options;
opts = {};
}
// merge options
var renderOptions = { ...this.locals, ...opts._locals, ...opts };
// set .cache unless explicitly provided
if (renderOptions.cache == null) {
renderOptions.cache = this.enabled('view cache');
}
// primed cache
if (renderOptions.cache) {
view = cache[name];
}
// view
if (!view) {
var View = this.get('view');
view = new View(name, {
defaultEngine: this.get('view engine'),
root: this.get('views'),
engines: engines
});
if (!view.path) {
var dirs = Array.isArray(view.root) && view.root.length > 1
? 'directories "' + view.root.slice(0, -1).join('", "') + '" or "' + view.root[view.root.length - 1] + '"'
: 'directory "' + view.root + '"'
var err = new Error('Failed to lookup view "' + name + '" in views ' + dirs);
err.view = view;
return done(err);
}
// prime the cache
if (renderOptions.cache) {
cache[name] = view;
}
}
// render
tryRender(view, renderOptions, done);
};
/**
* Listen for connections.
*
* A node `http.Server` is returned, with this
* application (which is a `Function`) as its
* callback. If you wish to create both an HTTP
* and HTTPS server you may do so with the "http"
* and "https" modules as shown here:
*
* var http = require('node:http')
* , https = require('node:https')
* , express = require('express')
* , app = express();
*
* http.createServer(app).listen(80);
* https.createServer({ ... }, app).listen(443);
*
* @return {http.Server}
* @public
*/
app.listen = function listen() {
var server = http.createServer(this)
var args = Array.prototype.slice.call(arguments)
if (typeof args[args.length - 1] === 'function') {
var done = args[args.length - 1] = once(args[args.length - 1])
server.once('error', done)
}
return server.listen.apply(server, args)
}
/**
* Log error using console.error.
*
* @param {Error} err
* @private
*/
function logerror(err) {
/* istanbul ignore next */
if (this.get('env') !== 'test') console.error(err.stack || err.toString());
}
/**
* Try rendering a view.
* @private
*/
function tryRender(view, options, callback) {
try {
view.render(options, callback);
} catch (err) {
callback(err);
}
}
@@ -0,0 +1,27 @@
import { createProjectionNode } from './create-projection-node.mjs';
import { DocumentProjectionNode } from './DocumentProjectionNode.mjs';
const rootProjectionNode = {
current: undefined,
};
const HTMLProjectionNode = createProjectionNode({
measureScroll: (instance) => ({
x: instance.scrollLeft,
y: instance.scrollTop,
}),
defaultParent: () => {
if (!rootProjectionNode.current) {
const documentNode = new DocumentProjectionNode({});
documentNode.mount(window);
documentNode.setOptions({ layoutScroll: true });
rootProjectionNode.current = documentNode;
}
return rootProjectionNode.current;
},
resetTransform: (instance, value) => {
instance.style.transform = value !== undefined ? value : "none";
},
checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"),
});
export { HTMLProjectionNode, rootProjectionNode };
@@ -0,0 +1 @@
{"name":"vite-plugin-cp","version":"6.0.3","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532098963,"integrity":"sha512-v9ES9Q4Lj8EvQQPnE5WDjoATwyH6RP7qz5z7pyfiQGOh24FJIBZD6JKybS0niZOVgyQ6XOrAe1JyyGwTCxD3vg==","mode":420,"size":1067},"dist/index.js":{"checkedAt":1794532098963,"integrity":"sha512-aPXFzSbkCeR+macBz1lNX19b1IguUD2mCV2PePEvHppuDIKduy4a/puTmRd+jQM2Ls+sL2xJiK/Uu7uOiZzn9w==","mode":420,"size":3872},"package.json":{"checkedAt":1794532098963,"integrity":"sha512-obyxMUttQ2S1M6GGz2So0mjwrZ5Q8jJWnukZF79uUaJ7S6vLYVjX1fRanv0pcv/Y2bD6rb5prR9vholmMjBW1A==","mode":420,"size":1382},"README.md":{"checkedAt":1794532098964,"integrity":"sha512-ey6ioeKulTHBSXDOYcJQtrRhkuGjku28ZEYtdguIdhqKs2ZErx616BxDaUY+c4wPc0mP2GWQPn19msFG3HMGwQ==","mode":420,"size":2916},"dist/index.mjs":{"checkedAt":1794532098964,"integrity":"sha512-704lkf/0ABOg+B7SFTNxer2NtSCPzYF1J7UwptqbbaQufM1o57yRAoEzuP78D61Sm3RsiSzoPSWIo4n0VR3doA==","mode":420,"size":3697},"dist/index.d.ts":{"checkedAt":1794532098964,"integrity":"sha512-6ueLGoPJ43ft1quhmGywi+fjZZuLCqniNO99D10P18JQ/SYxIK6ZPYAicBa3nsDsYW939jeSqmUfuwx0hzIuFg==","mode":420,"size":1007},"dist/logger.d.ts":{"checkedAt":1794532098964,"integrity":"sha512-fGnR27z2nq5j6GcHWJA49WYCWIvrZRbEax5gdRgctFIC8a5uFtYawFpFAOp9usdpxDMdzLhFmCLip3gsdbDyPw==","mode":420,"size":107},"dist/typings.d.ts":{"checkedAt":1794532098964,"integrity":"sha512-Py2Xtocrl2TZraNJppKF2TkW15823yZmHy/AlWCZz/VQCHnX04tEJZo1LG0DSOyeRtghcX267QR7SmRpKix4mQ==","mode":420,"size":3231},"dist/util.d.ts":{"checkedAt":1794532098964,"integrity":"sha512-jAaI05Ta5pG1GmEHhEKqdNdWqbUqT29BBI4PFIxah3Nwy4g5+sJkiauI+FB3m6nQrVvCzUQd8a7QdZQaVC+rsg==","mode":420,"size":308}}}
@@ -0,0 +1,40 @@
/**
* @license
* Copyright (c) 2016, Contributors
* SPDX-License-Identifier: ISC
*/
// take an un-split argv string and tokenize it.
export function tokenizeArgString(argString) {
if (Array.isArray(argString)) {
return argString.map(e => typeof e !== 'string' ? e + '' : e);
}
argString = argString.trim();
let i = 0;
let prevC = null;
let c = null;
let opening = null;
const args = [];
for (let ii = 0; ii < argString.length; ii++) {
prevC = c;
c = argString.charAt(ii);
// split on spaces unless we're in quotes.
if (c === ' ' && !opening) {
if (!(prevC === ' ')) {
i++;
}
continue;
}
// don't split the string if we're in matching
// opening or closing single and double quotes.
if (c === opening) {
opening = null;
}
else if ((c === "'" || c === '"') && !opening) {
opening = c;
}
if (!args[i])
args[i] = '';
args[i] += c;
}
return args;
}
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isAnyAncestorBindingConstraintsWithName = isAnyAncestorBindingConstraintsWithName;
const isAnyAncestorBindingConstraints_1 = require("./isAnyAncestorBindingConstraints");
const isBindingConstraintsWithName_1 = require("./isBindingConstraintsWithName");
function isAnyAncestorBindingConstraintsWithName(name) {
return (0, isAnyAncestorBindingConstraints_1.isAnyAncestorBindingConstraints)((0, isBindingConstraintsWithName_1.isBindingConstraintsWithName)(name));
}
//# sourceMappingURL=isAnyAncestorBindingConstraintsWithName.js.map
@@ -0,0 +1,107 @@
var Stream = require('stream').Stream;
var util = require('util');
module.exports = DelayedStream;
function DelayedStream() {
this.source = null;
this.dataSize = 0;
this.maxDataSize = 1024 * 1024;
this.pauseStream = true;
this._maxDataSizeExceeded = false;
this._released = false;
this._bufferedEvents = [];
}
util.inherits(DelayedStream, Stream);
DelayedStream.create = function(source, options) {
var delayedStream = new this();
options = options || {};
for (var option in options) {
delayedStream[option] = options[option];
}
delayedStream.source = source;
var realEmit = source.emit;
source.emit = function() {
delayedStream._handleEmit(arguments);
return realEmit.apply(source, arguments);
};
source.on('error', function() {});
if (delayedStream.pauseStream) {
source.pause();
}
return delayedStream;
};
Object.defineProperty(DelayedStream.prototype, 'readable', {
configurable: true,
enumerable: true,
get: function() {
return this.source.readable;
}
});
DelayedStream.prototype.setEncoding = function() {
return this.source.setEncoding.apply(this.source, arguments);
};
DelayedStream.prototype.resume = function() {
if (!this._released) {
this.release();
}
this.source.resume();
};
DelayedStream.prototype.pause = function() {
this.source.pause();
};
DelayedStream.prototype.release = function() {
this._released = true;
this._bufferedEvents.forEach(function(args) {
this.emit.apply(this, args);
}.bind(this));
this._bufferedEvents = [];
};
DelayedStream.prototype.pipe = function() {
var r = Stream.prototype.pipe.apply(this, arguments);
this.resume();
return r;
};
DelayedStream.prototype._handleEmit = function(args) {
if (this._released) {
this.emit.apply(this, args);
return;
}
if (args[0] === 'data') {
this.dataSize += args[1].length;
this._checkIfMaxDataSizeExceeded();
}
this._bufferedEvents.push(args);
};
DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
if (this._maxDataSizeExceeded) {
return;
}
if (this.dataSize <= this.maxDataSize) {
return;
}
this._maxDataSizeExceeded = true;
var message =
'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
this.emit('error', new Error(message));
};
@@ -0,0 +1,16 @@
'use strict';
var $TypeError = require('es-errors/type');
var ToInt32 = require('../ToInt32');
// https://262.ecma-international.org/11.0/#sec-numeric-types-number-bitwiseNOT
module.exports = function NumberBitwiseNOT(x) {
if (typeof x !== 'number') {
throw new $TypeError('Assertion failed: `x` argument must be a Number');
}
var oldValue = ToInt32(x);
// Return the result of applying the bitwise operator op to lnum and rnum. The result is a signed 32-bit integer.
return ~oldValue;
};
@@ -0,0 +1,157 @@
//#region src/composable-filters.d.ts
type StringOrRegExp = string | RegExp;
type PluginModuleType = "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | (string & {});
type FilterExpressionKind = FilterExpression["kind"];
type FilterExpression = And | Or | Not | Id | ModuleType | Code | Query;
type TopLevelFilterExpression = Include | Exclude;
declare class And {
kind: "and";
args: FilterExpression[];
constructor(...args: FilterExpression[]);
}
declare class Or {
kind: "or";
args: FilterExpression[];
constructor(...args: FilterExpression[]);
}
declare class Not {
kind: "not";
expr: FilterExpression;
constructor(expr: FilterExpression);
}
interface QueryFilterObject {
[key: string]: StringOrRegExp | boolean;
}
interface IdParams {
cleanUrl?: boolean;
}
declare class Id {
kind: "id";
pattern: StringOrRegExp;
params: IdParams;
constructor(pattern: StringOrRegExp, params?: IdParams);
}
declare class ModuleType {
kind: "moduleType";
pattern: PluginModuleType;
constructor(pattern: PluginModuleType);
}
declare class Code {
kind: "code";
pattern: StringOrRegExp;
constructor(expr: StringOrRegExp);
}
declare class Query {
kind: "query";
key: string;
pattern: StringOrRegExp | boolean;
constructor(key: string, pattern: StringOrRegExp | boolean);
}
declare class Include {
kind: "include";
expr: FilterExpression;
constructor(expr: FilterExpression);
}
declare class Exclude {
kind: "exclude";
expr: FilterExpression;
constructor(expr: FilterExpression);
}
declare function and(...args: FilterExpression[]): And;
declare function or(...args: FilterExpression[]): Or;
declare function not(expr: FilterExpression): Not;
declare function id(pattern: StringOrRegExp, params?: IdParams): Id;
declare function moduleType(pattern: PluginModuleType): ModuleType;
declare function code(pattern: StringOrRegExp): Code;
declare function query(key: string, pattern: StringOrRegExp | boolean): Query;
declare function include(expr: FilterExpression): Include;
declare function exclude(expr: FilterExpression): Exclude;
/**
* convert a queryObject to FilterExpression like
* ```js
* and(query(k1, v1), query(k2, v2))
* ```
* @param queryFilterObject The query filter object needs to be matched.
* @returns a `And` FilterExpression
*/
declare function queries(queryFilter: QueryFilterObject): And;
declare function interpreter(exprs: TopLevelFilterExpression | TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType): boolean;
interface InterpreterCtx {
urlSearchParamsCache?: URLSearchParams;
}
declare function interpreterImpl(expr: TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, ctx?: InterpreterCtx): boolean;
declare function exprInterpreter(expr: FilterExpression, code?: string, id?: string, moduleType?: PluginModuleType, ctx?: InterpreterCtx): boolean;
//#endregion
//#region src/simple-filters.d.ts
/**
* Constructs a RegExp that matches the exact string specified.
*
* This is useful for plugin hook filters.
*
* @param str the string to match.
* @param flags flags for the RegExp.
*
* @example
* ```ts
* import { exactRegex } from '@rolldown/pluginutils';
* const plugin = {
* name: 'plugin',
* resolveId: {
* filter: { id: exactRegex('foo') },
* handler(id) {} // will only be called for `foo`
* }
* }
* ```
*/
declare function exactRegex(str: string, flags?: string): RegExp;
/**
* Constructs a RegExp that matches a value that has the specified prefix.
*
* This is useful for plugin hook filters.
*
* @param str the string to match.
* @param flags flags for the RegExp.
*
* @example
* ```ts
* import { prefixRegex } from '@rolldown/pluginutils';
* const plugin = {
* name: 'plugin',
* resolveId: {
* filter: { id: prefixRegex('foo') },
* handler(id) {} // will only be called for IDs starting with `foo`
* }
* }
* ```
*/
declare function prefixRegex(str: string, flags?: string): RegExp;
type WidenString<T> = T extends string ? string : T;
/**
* Converts a id filter to match with an id with a query.
*
* @param input the id filters to convert.
*
* @example
* ```ts
* import { makeIdFiltersToMatchWithQuery } from '@rolldown/pluginutils';
* const plugin = {
* name: 'plugin',
* transform: {
* filter: { id: makeIdFiltersToMatchWithQuery(['**' + '/*.js', /\.ts$/]) },
* // The handler will be called for IDs like:
* // - foo.js
* // - foo.js?foo
* // - foo.txt?foo.js
* // - foo.ts
* // - foo.ts?foo
* // - foo.txt?foo.ts
* handler(code, id) {}
* }
* }
* ```
*/
declare function makeIdFiltersToMatchWithQuery<T extends string | RegExp>(input: T): WidenString<T>;
declare function makeIdFiltersToMatchWithQuery<T extends string | RegExp>(input: readonly T[]): WidenString<T>[];
declare function makeIdFiltersToMatchWithQuery(input: string | RegExp | readonly (string | RegExp)[]): string | RegExp | (string | RegExp)[];
//#endregion
export { FilterExpression, FilterExpressionKind, QueryFilterObject, TopLevelFilterExpression, and, code, exactRegex, exclude, exprInterpreter, id, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query };
@@ -0,0 +1,13 @@
import { AsnArray } from "@peculiar/asn1-schema";
import { ContentInfo } from "@peculiar/asn1-cms";
/**
* ```asn1
* AuthenticatedSafe ::= SEQUENCE OF ContentInfo
* -- Data if unencrypted
* -- EncryptedData if password-encrypted
* -- EnvelopedData if public key-encrypted
* ```
*/
export declare class AuthenticatedSafe extends AsnArray<ContentInfo> {
constructor(items?: ContentInfo[]);
}
@@ -0,0 +1,86 @@
import { ModifyProfileParams, User, UserDetailSource } from '../types';
import { InstanceContext, NapCatCore } from '..';
export declare class NTQQUserApi {
context: InstanceContext;
core: NapCatCore;
constructor(context: InstanceContext, core: NapCatCore);
getCoreAndBaseInfo(uids: string[]): Promise<Map<string, import("../types").SimpleInfo>>;
getProfileLike(uid: string, start: number, count: number, type?: number): Promise<import("..").GeneralCallResult & {
info: {
userLikeInfos: Array<{
uid: string;
time: string;
favoriteInfo: {
userInfos: Array<import("../types").NTVoteInfo>;
total_count: number;
last_time: number;
today_count: number;
};
voteInfo: {
total_count: number;
new_count: number;
new_nearby_count: number;
last_visit_time: number;
userInfos: Array<import("../types").NTVoteInfo>;
};
}>;
friendMaxVotes: number;
start: number;
};
}>;
setLongNick(longNick: string): Promise<unknown>;
setSelfOnlineStatus(status: number, extStatus: number, batteryStatus: number): Promise<import("..").GeneralCallResult>;
setDiySelfOnlineStatus(faceId: string, wording: string, faceType: string): Promise<import("..").GeneralCallResult>;
getBuddyRecommendContactArkJson(uin: string, sencenID?: string): Promise<import("..").GeneralCallResult & {
arkMsg: string;
}>;
like(uid: string, count?: number): Promise<{
result: number;
errMsg: string;
succCounts: number;
}>;
setQQAvatar(filePath: string): Promise<{
result: import("..").GeneralCallResultStatus;
errMsg: string;
}>;
setGroupAvatar(gc: string, filePath: string): Promise<import("..").GeneralCallResult>;
fetchUserDetailInfo(uid: string, mode?: UserDetailSource): Promise<import("../types").UserDetailInfoListenerArg>;
getUserDetailInfo(uid: string, no_cache?: boolean): Promise<User>;
modifySelfProfile(param: ModifyProfileParams): Promise<import("..").GeneralCallResult>;
getCookies(domain: string): Promise<{
[key: string]: string;
}>;
getPSkey(domainList: string[]): Promise<import("..").GeneralCallResult & {
domainPskeyMap: Map<string, string>;
}>;
getRobotUinRange(): Promise<Array<unknown>>;
getQzoneCookies(): Promise<{
[key: string]: string;
}>;
getSKey(): Promise<string | undefined>;
getUidByUinV2(uin: string): Promise<string>;
getUinByUidV2(uid: string): Promise<string>;
getRecentContactListSnapShot(count: number): Promise<import("..").GeneralCallResult & {
info: {
errCode: number;
errMsg: string;
sortedContactList: Array<number>;
changedList: Array<{
remark: unknown;
peerName: unknown;
sendMemberName: unknown;
sendNickName: unknown;
peerUid: string;
peerUin: string;
msgTime: string;
chatType: import("../types").ChatType;
msgId: string;
}>;
};
}>;
getRecentContactListSyncLimit(count: number): Promise<unknown>;
getRecentContactListSync(): Promise<unknown>;
getRecentContactList(): Promise<unknown>;
getUserDetailInfoByUin(Uin: string): Promise<import("../types").UserDetailInfoByUin>;
forceFetchClientKey(): Promise<import("..").ForceFetchClientKeyRetType>;
}
@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = getExplicitRole;
var _ariaQuery = require("aria-query");
var _jsxAstUtils = require("jsx-ast-utils");
/**
* Returns an element's computed role, which is
*
* 1. The valid value of its explicit role attribute; or
* 2. The implicit value of its tag.
*/
function getExplicitRole(tag, attributes) {
var explicitRole = function toLowerCase(role) {
if (typeof role === 'string') {
return role.toLowerCase();
}
return null;
}((0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'role')));
if (_ariaQuery.roles.has(explicitRole)) {
return explicitRole;
}
return null;
}
module.exports = exports.default;
@@ -0,0 +1,88 @@
{
"name": "reselect",
"version": "5.1.1",
"description": "Selectors for Redux.",
"main": "./dist/cjs/reselect.cjs",
"module": "./dist/reselect.legacy-esm.js",
"types": "./dist/reselect.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/reselect.d.ts",
"import": "./dist/reselect.mjs",
"default": "./dist/cjs/reselect.cjs"
}
},
"files": [
"src",
"dist"
],
"sideEffects": false,
"bugs": {
"url": "https://github.com/reduxjs/reselect/issues"
},
"scripts": {
"build": "tsup",
"clean": "rimraf dist",
"format": "prettier --write \"{src,test}/**/*.{js,ts}\" \"docs/**/*.md\"",
"lint": "eslint src test",
"prepack": "yarn build",
"bench": "vitest --run bench --mode production",
"test": "node --expose-gc ./node_modules/vitest/dist/cli-wrapper.js --run && vitest --run --typecheck.only",
"test:watch": "node --expose-gc ./node_modules/vitest/dist/cli-wrapper.js --watch",
"test:cov": "vitest run --coverage",
"type-check": "vitest --run --typecheck.only",
"type-check:trace": "vitest --run --typecheck.only && tsc --noEmit -p typescript_test/tsconfig.json --generateTrace trace && npx @typescript/analyze-trace trace && rimraf trace",
"test:typescript": "tsc --noEmit -p typescript_test/tsconfig.json",
"docs:start": "yarn --cwd website start",
"docs:build": "yarn --cwd website build",
"docs:clear": "yarn --cwd website clear",
"docs:serve": "yarn --cwd website serve"
},
"keywords": [
"react",
"redux"
],
"authors": [
"Lee Bannard",
"Robert Binna",
"Martijn Faassen",
"Philip Spitzlinger"
],
"repository": {
"type": "git",
"url": "https://github.com/reduxjs/reselect.git"
},
"license": "MIT",
"devDependencies": {
"@reduxjs/toolkit": "^2.0.1",
"@testing-library/react": "^14.1.2",
"@types/lodash": "^4.14.175",
"@types/react": "^18.2.38",
"@types/react-dom": "^18.2.17",
"@types/shelljs": "^0.8.11",
"@typescript-eslint/eslint-plugin": "^6",
"@typescript-eslint/eslint-plugin-tslint": "^6",
"@typescript-eslint/parser": "^6",
"@typescript/analyze-trace": "^0.10.1",
"eslint": "^8.0.1",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-typescript": "0.14.0",
"jsdom": "^23.0.0",
"lodash": "^4.17.21",
"lodash.memoize": "^4.1.2",
"memoize-one": "^6.0.0",
"micro-memoize": "^4.0.9",
"netlify-plugin-cache": "^1.0.3",
"prettier": "^2.7.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^9.0.4",
"rimraf": "^3.0.2",
"shelljs": "^0.8.5",
"tsup": "^6.7.0",
"typescript": "^5.4.2",
"vitest": "^1.1.1"
},
"packageManager": "yarn@4.1.0"
}
@@ -0,0 +1 @@
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAEM,SAAS,0CAAU,OAAO,EAAE,OAAO,EAAE,cAAc,YAAY;IACpE,IAAI,OAAO,QAAQ,qBAAqB;IACxC,IAAI,SACF,OAAO,gBAAgB,eAAe,KAAK,KAAK,GAAG,KAAK,MAAM;IAEhE,OAAO,gBAAgB,eAAe,KAAK,IAAI,GAAG,KAAK,GAAG;AAC5D","sources":["packages/@react-aria/utils/src/getOffset.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\nexport function getOffset(element, reverse, orientation = 'horizontal') {\n let rect = element.getBoundingClientRect();\n if (reverse) {\n return orientation === 'horizontal' ? rect.right : rect.bottom;\n }\n return orientation === 'horizontal' ? rect.left : rect.top;\n}\n"],"names":[],"version":3,"file":"getOffset.main.js.map"}
@@ -0,0 +1,19 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.esnext_float16 = void 0;
const base_config_1 = require("./base-config");
const es2015_iterable_1 = require("./es2015.iterable");
const es2015_symbol_1 = require("./es2015.symbol");
exports.esnext_float16 = {
libs: [es2015_symbol_1.es2015_symbol, es2015_iterable_1.es2015_iterable],
variables: [
['Float16Array', base_config_1.TYPE_VALUE],
['Float16ArrayConstructor', base_config_1.TYPE],
['Math', base_config_1.TYPE],
['DataView', base_config_1.TYPE],
],
};
@@ -0,0 +1,69 @@
{
"name": "is-extglob",
"description": "Returns true if a string has an extglob.",
"version": "2.1.1",
"homepage": "https://github.com/jonschlinkert/is-extglob",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"repository": "jonschlinkert/is-extglob",
"bugs": {
"url": "https://github.com/jonschlinkert/is-extglob/issues"
},
"license": "MIT",
"files": [
"index.js"
],
"main": "index.js",
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "mocha"
},
"devDependencies": {
"gulp-format-md": "^0.1.10",
"mocha": "^3.0.2"
},
"keywords": [
"bash",
"braces",
"check",
"exec",
"expression",
"extglob",
"glob",
"globbing",
"globstar",
"is",
"match",
"matches",
"pattern",
"regex",
"regular",
"string",
"test"
],
"verb": {
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"plugins": [
"gulp-format-md"
],
"related": {
"list": [
"has-glob",
"is-glob",
"micromatch"
]
},
"reflinks": [
"verb",
"verb-generate-readme"
],
"lint": {
"reflinks": true
}
}
}
@@ -0,0 +1,21 @@
/**
* Normalize an identifier (as found in references, definitions).
*
* Collapses markdown whitespace, trim, and then lower- and uppercase.
*
* Some characters are considered “uppercase”, such as U+03F4 (`ϴ`), but if their
* lowercase counterpart (U+03B8 (`θ`)) is uppercased will result in a different
* uppercase character (U+0398 (`Θ`)).
* So, to get a canonical form, we perform both lower- and uppercase.
*
* Using uppercase last makes sure keys will never interact with default
* prototypal values (such as `constructor`): nothing in the prototype of
* `Object` is uppercase.
*
* @param {string} value
* Identifier to normalize.
* @returns {string}
* Normalized identifier.
*/
export function normalizeIdentifier(value: string): string;
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,41 @@
var $b2rU6$react = require("react");
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "UNSTABLE_PortalProvider", () => $d7347c25ab757295$export$db995ea7163b4b67);
$parcel$export(module.exports, "useUNSTABLE_PortalContext", () => $d7347c25ab757295$export$574e9b0fb070c3b0);
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $d7347c25ab757295$export$60d741e20e0aa309 = /*#__PURE__*/ (0, $b2rU6$react.createContext)({});
function $d7347c25ab757295$export$db995ea7163b4b67(props) {
let { getContainer: getContainer } = props;
let { getContainer: ctxGetContainer } = $d7347c25ab757295$export$574e9b0fb070c3b0();
return /*#__PURE__*/ (0, ($parcel$interopDefault($b2rU6$react))).createElement($d7347c25ab757295$export$60d741e20e0aa309.Provider, {
value: {
getContainer: getContainer === null ? undefined : getContainer !== null && getContainer !== void 0 ? getContainer : ctxGetContainer
}
}, props.children);
}
function $d7347c25ab757295$export$574e9b0fb070c3b0() {
var _useContext;
return (_useContext = (0, $b2rU6$react.useContext)($d7347c25ab757295$export$60d741e20e0aa309)) !== null && _useContext !== void 0 ? _useContext : {};
}
//# sourceMappingURL=PortalProvider.main.js.map
@@ -0,0 +1,22 @@
import constant from './constant.js';
import defineProperty from './_defineProperty.js';
import identity from './identity.js';
/**
* The base implementation of `setToString` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var baseSetToString = !defineProperty ? identity : function(func, string) {
return defineProperty(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': constant(string),
'writable': true
});
};
export default baseSetToString;
@@ -0,0 +1 @@
let e={data:""},t=t=>{if("object"==typeof window){let e=(t?t.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(t||document.head).appendChild(e),e.firstChild}return t||e},r=e=>{let r=t(e),l=r.data;return r.data="",l},l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/| +/g,n=/\n+/g,o=(e,t)=>{let r="",l="",a="";for(let n in e){let c=e[n];"@"==n[0]?"i"==n[1]?r=n+" "+c+";":l+="f"==n[1]?o(c,n):n+"{"+o(c,"k"==n[1]?"":t)+"}":"object"==typeof c?l+=o(c,t?t.replace(/([^,])+/g,e=>n.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):n):null!=c&&(n=/^--/.test(n)?n:n.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=o.p?o.p(n,c):n+":"+c+";")}return r+(t&&a?t+"{"+a+"}":a)+l},c={},s=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+s(e[r]);return t}return e},i=(e,t,r,i,p)=>{let u=s(e),d=c[u]||(c[u]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return"go"+r})(u));if(!c[d]){let t=u!==e?e:(e=>{let t,r,o=[{}];for(;t=l.exec(e.replace(a,""));)t[4]?o.shift():t[3]?(r=t[3].replace(n," ").trim(),o.unshift(o[0][r]=o[0][r]||{})):o[0][t[1]]=t[2].replace(n," ").trim();return o[0]})(e);c[d]=o(p?{["@keyframes "+d]:t}:t,r?"":"."+d)}let f=r&&c.g?c.g:null;return r&&(c.g=c[d]),((e,t,r,l)=>{l?t.data=t.data.replace(l,e):-1===t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e)})(c[d],t,i,f),d},p=(e,t,r)=>e.reduce((e,l,a)=>{let n=t[a];if(n&&n.call){let e=n(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;n=t?"."+t:e&&"object"==typeof e?e.props?"":o(e,""):!1===e?"":e}return e+l+(null==n?"":n)},"");function u(e){let r=this||{},l=e.call?e(r.p):e;return i(l.unshift?l.raw?p(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>Object.assign(e,t&&t.call?t(r.p):t),{}):l,t(r.target),r.g,r.o,r.k)}let d,f,g,b=u.bind({g:1}),h=u.bind({k:1});function m(e,t,r,l){o.p=t,d=e,f=r,g=l}function w(e,t){let r=this||{};return function(){let l=arguments;function a(n,o){let c=Object.assign({},n),s=c.className||a.className;r.p=Object.assign({theme:f&&f()},c),r.o=/ *go\d+/.test(s),c.className=u.apply(r,l)+(s?" "+s:""),t&&(c.ref=o);let i=e;return e[0]&&(i=c.as||e,delete c.as),g&&i[0]&&g(c),d(i,c)}return t?t(a):a}}export{u as css,r as extractCss,b as glob,h as keyframes,m as setup,w as styled};
@@ -0,0 +1 @@
{"version":3,"names":["_index","require","_t","getAssignmentIdentifiers","_getAssignmentIdentifiers","getBindingIdentifiers","_getBindingIdentifiers","getOuterBindingIdentifiers","_getOuterBindingIdentifiers","numericLiteral","unaryExpression","NORMAL_COMPLETION","BREAK_COMPLETION","NormalCompletion","path","type","BreakCompletion","getOpposite","key","getSibling","addCompletionRecords","records","context","push","_getCompletionRecords","completionRecordForSwitch","cases","lastNormalCompletions","i","length","casePath","caseCompletions","normalCompletions","breakCompletions","c","normalCompletionToBreak","completions","forEach","replaceBreakStatementInBreakCompletion","reachable","isBreakStatement","label","replaceWith","remove","getStatementListCompletion","paths","canHaveBreak","newContext","Object","assign","inCaseClause","isBlockStatement","shouldPopulateBreak","statementCompletions","every","some","isDeclaration","shouldPreserveBreak","pathCompletions","isVariableDeclaration","isEmptyStatement","isIfStatement","get","isDoExpression","isFor","isWhile","isLabeledStatement","isProgram","isFunction","isTryStatement","isCatchClause","isSwitchStatement","isSwitchCase","getCompletionRecords","map","r","NodePath","parentPath","parent","container","listKey","setContext","getPrevSibling","getNextSibling","getAllNextSiblings","_key","sibling","siblings","node","getAllPrevSiblings","parts","split","_getKey","call","_getPattern","Array","isArray","_","part","duplicates","getBindingIdentifierPaths","outerOnly","search","ids","create","id","shift","keys","isIdentifier","_ids","name","isExportDeclaration","declaration","isFunctionDeclaration","isFunctionExpression","child","getOuterBindingIdentifierPaths"],"sources":["../../src/path/family.ts"],"sourcesContent":["// This file contains methods responsible for dealing with/retrieving children or siblings.\n\nimport type TraversalContext from \"../context.ts\";\nimport NodePath from \"./index.ts\";\nimport {\n getAssignmentIdentifiers as _getAssignmentIdentifiers,\n getBindingIdentifiers as _getBindingIdentifiers,\n getOuterBindingIdentifiers as _getOuterBindingIdentifiers,\n numericLiteral,\n unaryExpression,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\nconst NORMAL_COMPLETION = 0;\nconst BREAK_COMPLETION = 1;\n\ntype Completion = {\n path: NodePath;\n type: 0 | 1;\n};\n\ntype CompletionContext = {\n // whether the current context allows `break` statement. When it allows, we have\n // to search all the statements for potential `break`\n canHaveBreak: boolean;\n // whether the statement is an immediate descendant of a switch case clause\n inCaseClause: boolean;\n // whether the `break` statement record should be populated to upper level\n // when a `break` statement is an immediate descendant of a block statement, e.g.\n // `{ break }`, it can influence the control flow in the upper levels.\n shouldPopulateBreak: boolean;\n // Whether the `break` statement should be preserved.\n shouldPreserveBreak: boolean;\n};\n\nfunction NormalCompletion(path: NodePath): Completion {\n return { type: NORMAL_COMPLETION, path };\n}\n\nfunction BreakCompletion(path: NodePath): Completion {\n return { type: BREAK_COMPLETION, path };\n}\n\nexport function getOpposite(this: NodePath): NodePath | null {\n if (this.key === \"left\") {\n return this.getSibling(\"right\");\n } else if (this.key === \"right\") {\n return this.getSibling(\"left\");\n }\n return null;\n}\n\nfunction addCompletionRecords(\n path: NodePath | null | undefined,\n records: Completion[],\n context: CompletionContext,\n): Completion[] {\n if (path) {\n records.push(..._getCompletionRecords(path, context));\n }\n return records;\n}\n\nfunction completionRecordForSwitch(\n cases: NodePath<t.SwitchCase>[],\n records: Completion[],\n context: CompletionContext,\n): Completion[] {\n // https://tc39.es/ecma262/#sec-runtime-semantics-caseblockevaluation\n let lastNormalCompletions: Completion[] = [];\n for (let i = 0; i < cases.length; i++) {\n const casePath = cases[i];\n const caseCompletions = _getCompletionRecords(casePath, context);\n const normalCompletions = [];\n const breakCompletions = [];\n for (const c of caseCompletions) {\n if (c.type === NORMAL_COMPLETION) {\n normalCompletions.push(c);\n }\n if (c.type === BREAK_COMPLETION) {\n breakCompletions.push(c);\n }\n }\n if (normalCompletions.length) {\n lastNormalCompletions = normalCompletions;\n }\n records.push(...breakCompletions);\n }\n records.push(...lastNormalCompletions);\n return records;\n}\n\nfunction normalCompletionToBreak(completions: Completion[]) {\n completions.forEach(c => {\n c.type = BREAK_COMPLETION;\n });\n}\n\n/**\n * Determine how we should handle the break statement for break completions\n *\n * @param {Completion[]} completions\n * @param {boolean} reachable Whether the break statement is reachableLine truncated
@@ -0,0 +1,31 @@
import baseSortedIndex from './_baseSortedIndex.js';
import eq from './eq.js';
/**
* This method is like `_.indexOf` except that it performs a binary
* search on a sorted `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.sortedIndexOf([4, 5, 5, 5, 6], 5);
* // => 1
*/
function sortedIndexOf(array, value) {
var length = array == null ? 0 : array.length;
if (length) {
var index = baseSortedIndex(array, value);
if (index < length && eq(array[index], value)) {
return index;
}
}
return -1;
}
export default sortedIndexOf;
@@ -0,0 +1,34 @@
import { type AuthenticationExtensionsAuthenticatorOutputs } from './decodeAuthenticatorExtensions.js';
import type { Uint8Array_ } from '../types/index.js';
/**
* Make sense of the authData buffer contained in an Attestation
*/
export declare function parseAuthenticatorData(authData: Uint8Array_): ParsedAuthenticatorData;
export type ParsedAuthenticatorData = {
rpIdHash: Uint8Array_;
flagsBuf: Uint8Array_;
flags: {
up: boolean;
uv: boolean;
be: boolean;
bs: boolean;
at: boolean;
ed: boolean;
flagsInt: number;
};
counter: number;
counterBuf: Uint8Array_;
aaguid?: Uint8Array_;
credentialID?: Uint8Array_;
credentialPublicKey?: Uint8Array_;
extensionsData?: AuthenticationExtensionsAuthenticatorOutputs;
extensionsDataBuffer?: Uint8Array_;
};
/**
* Make it possible to stub the return value during testing
* @ignore Don't include this in docs output
*/
export declare const _parseAuthenticatorDataInternals: {
stubThis: (value: ParsedAuthenticatorData) => ParsedAuthenticatorData;
};
//# sourceMappingURL=parseAuthenticatorData.d.ts.map
@@ -0,0 +1,6 @@
/**
* Supported react-aria i18n calendars.
*/
type SupportedCalendars = "buddhist" | "ethiopic" | "ethioaa" | "coptic" | "hebrew" | "indian" | "islamic-civil" | "islamic-tbla" | "islamic-umalqura" | "japanese" | "persian" | "roc" | "gregory";
export { SupportedCalendars };
@@ -0,0 +1 @@
module.exports={C:{"52":0.00297,"78":0.00297,"115":0.06237,"128":0.00297,"135":0.00297,"136":0.00297,"138":0.00297,"140":0.01188,"141":0.00297,"142":0.00891,"143":0.30888,"144":0.30591,"145":0.00297,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 127 129 130 131 132 133 134 137 139 146 147 3.5 3.6"},D:{"41":0.00297,"43":0.00297,"47":0.00594,"49":0.00297,"50":0.00297,"53":0.00594,"54":0.00297,"55":0.00297,"56":0.00297,"57":0.00297,"58":0.00297,"59":0.00297,"61":0.00594,"62":0.00297,"64":0.00594,"65":0.00594,"67":0.00297,"70":0.00297,"73":0.00297,"74":0.00297,"79":0.03564,"81":0.00297,"83":0.00297,"85":0.00297,"86":0.00297,"87":0.03267,"88":0.00297,"91":0.00594,"93":0.00297,"95":0.02376,"98":0.00891,"99":0.00297,"101":0.01188,"102":0.00891,"103":0.01188,"104":0.08316,"105":0.08019,"106":0.00594,"107":0.00297,"108":0.06237,"109":0.57024,"110":0.00297,"111":0.00891,"112":0.00297,"113":0.01188,"114":0.02673,"115":0.00297,"116":0.01485,"117":0.00297,"118":0.00297,"119":0.01782,"120":0.01188,"121":0.01485,"122":0.02376,"123":0.01485,"124":0.02673,"125":0.42471,"126":0.01782,"127":0.01485,"128":0.03564,"129":0.01782,"130":0.01485,"131":0.04158,"132":0.02673,"133":0.02376,"134":0.01782,"135":0.0297,"136":0.03267,"137":0.03564,"138":0.13959,"139":0.15147,"140":3.4155,"141":8.37837,"142":0.09504,"143":0.01188,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 42 44 45 46 48 51 52 60 63 66 68 69 71 72 75 76 77 78 80 84 89 90 92 94 96 97 100 144 145"},F:{"46":0.00297,"90":0.00297,"91":0.02079,"92":0.04158,"95":0.00594,"120":0.02079,"121":0.00891,"122":0.18117,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00297,"92":0.00297,"105":0.00297,"108":0.00891,"109":0.00891,"113":0.00297,"114":0.00594,"122":0.00297,"126":0.00594,"127":0.00297,"129":0.00297,"130":0.00297,"131":0.00594,"132":0.00297,"133":0.00297,"134":0.00594,"135":0.00594,"136":0.00594,"137":0.00594,"138":0.01188,"139":0.01782,"140":0.31779,"141":1.62162,"142":0.00594,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 106 107 110 111 112 115 116 117 118 119 120 121 123 124 125 128"},E:{"14":0.00297,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 26.2","13.1":0.00297,"14.1":0.00891,"15.4":0.00297,"15.5":0.00594,"15.6":0.04752,"16.0":0.00297,"16.1":0.01188,"16.2":0.00594,"16.3":0.01485,"16.4":0.00594,"16.5":0.00594,"16.6":0.0594,"17.0":0.00297,"17.1":0.05643,"17.2":0.00891,"17.3":0.00594,"17.4":0.01188,"17.5":0.02376,"17.6":0.04158,"18.0":0.00891,"18.1":0.02079,"18.2":0.00594,"18.3":0.0297,"18.4":0.01485,"18.5-18.6":0.10098,"26.0":0.27621,"26.1":0.00891},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00167,"5.0-5.1":0,"6.0-6.1":0.00666,"7.0-7.1":0.005,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01499,"10.0-10.2":0.00167,"10.3":0.02832,"11.0-11.2":0.4198,"11.3-11.4":0.01,"12.0-12.1":0.00333,"12.2-12.5":0.08163,"13.0-13.1":0,"13.2":0.00833,"13.3":0.00333,"13.4-13.7":0.01333,"14.0-14.4":0.02832,"14.5-14.8":0.02999,"15.0-15.1":0.02832,"15.2-15.3":0.02166,"15.4":0.02499,"15.5":0.02832,"15.6-15.8":0.36982,"16.0":0.04998,"16.1":0.09329,"16.2":0.04831,"16.3":0.08663,"16.4":0.02166,"16.5":0.03832,"16.6-16.7":0.49476,"17.0":0.03498,"17.1":0.05331,"17.2":0.03832,"17.3":0.05664,"17.4":0.09995,"17.5":0.17158,"17.6-17.7":0.43313,"18.0":0.09829,"18.1":0.20324,"18.2":0.10995,"18.3":0.35317,"18.4":0.18158,"18.5-18.6":9.25892,"26.0":1.14445,"26.1":0.04165},P:{"4":0.2098,"20":0.01049,"21":0.02098,"22":0.02098,"23":0.03147,"24":0.03147,"25":0.07343,"26":0.06294,"27":0.14686,"28":2.46509,"29":0.2098,"5.0-5.4":0.01049,_:"6.2-6.4 10.1 12.0 13.0 14.0 15.0 16.0 18.0","7.2-7.4":0.06294,"8.2":0.01049,"9.2":0.02098,"11.1-11.2":0.01049,"17.0":0.01049,"19.0":0.02098},I:{"0":0.02106,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},K:{"0":0.33036,_:"10 11 12 11.1 11.5 12.1"},A:{"8":0.00337,"11":0.04712,_:"6 7 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.22493},Q:{_:"14.9"},O:{"0":0.24602},H:{"0":0},L:{"0":58.87431}};
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_to_primitive.cjs",
"module": "../../esm/_to_primitive.js"
}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=buildMaybeClassElementMetadataFromMaybeClassElementMetadata.spec.d.ts.map
@@ -0,0 +1,17 @@
"use strict";
var ProxyInfo_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProxyInfo = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const target_1 = require("./target");
let ProxyInfo = ProxyInfo_1 = class ProxyInfo extends asn1_schema_1.AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, ProxyInfo_1.prototype);
}
};
exports.ProxyInfo = ProxyInfo;
exports.ProxyInfo = ProxyInfo = ProxyInfo_1 = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence, itemType: target_1.Targets })
], ProxyInfo);
@@ -0,0 +1,49 @@
import { createRule } from '../utils/index.js';
const findLastIndex = (array, predicate) => {
let i = array.length - 1;
while (i >= 0) {
if (predicate(array[i])) {
return i;
}
i--;
}
return -1;
};
function isNonExportStatement({ type }) {
return (type !== 'ExportDefaultDeclaration' &&
type !== 'ExportNamedDeclaration' &&
type !== 'ExportAllDeclaration');
}
export default createRule({
name: 'exports-last',
meta: {
type: 'suggestion',
docs: {
category: 'Style guide',
description: 'Ensure all exports appear after other statements.',
},
schema: [],
messages: {
end: 'Export statements should appear at the end of the file',
},
},
defaultOptions: [],
create(context) {
return {
Program({ body }) {
const lastNonExportStatementIndex = findLastIndex(body, isNonExportStatement);
if (lastNonExportStatementIndex !== -1) {
for (const node of body.slice(0, lastNonExportStatementIndex)) {
if (!isNonExportStatement(node)) {
context.report({
node,
messageId: 'end',
});
}
}
}
},
};
},
});
//# sourceMappingURL=exports-last.js.map
@@ -0,0 +1,171 @@
'use strict'
const fs = require('graceful-fs')
const path = require('path')
const mkdirsSync = require('../mkdirs').mkdirsSync
const utimesMillisSync = require('../util/utimes').utimesMillisSync
const stat = require('../util/stat')
function copySync (src, dest, opts) {
if (typeof opts === 'function') {
opts = { filter: opts }
}
opts = opts || {}
opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber
// Warn about using preserveTimestamps on 32-bit node
if (opts.preserveTimestamps && process.arch === 'ia32') {
process.emitWarning(
'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
'\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
'Warning', 'fs-extra-WARN0002'
)
}
const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)
stat.checkParentPathsSync(src, srcStat, dest, 'copy')
if (opts.filter && !opts.filter(src, dest)) return
const destParent = path.dirname(dest)
if (!fs.existsSync(destParent)) mkdirsSync(destParent)
return getStats(destStat, src, dest, opts)
}
function getStats (destStat, src, dest, opts) {
const statSync = opts.dereference ? fs.statSync : fs.lstatSync
const srcStat = statSync(src)
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)
else if (srcStat.isFile() ||
srcStat.isCharacterDevice() ||
srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
throw new Error(`Unknown file: ${src}`)
}
function onFile (srcStat, destStat, src, dest, opts) {
if (!destStat) return copyFile(srcStat, src, dest, opts)
return mayCopyFile(srcStat, src, dest, opts)
}
function mayCopyFile (srcStat, src, dest, opts) {
if (opts.overwrite) {
fs.unlinkSync(dest)
return copyFile(srcStat, src, dest, opts)
} else if (opts.errorOnExist) {
throw new Error(`'${dest}' already exists`)
}
}
function copyFile (srcStat, src, dest, opts) {
fs.copyFileSync(src, dest)
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)
return setDestMode(dest, srcStat.mode)
}
function handleTimestamps (srcMode, src, dest) {
// Make sure the file is writable before setting the timestamp
// otherwise open fails with EPERM when invoked with 'r+'
// (through utimes call)
if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)
return setDestTimestamps(src, dest)
}
function fileIsNotWritable (srcMode) {
return (srcMode & 0o200) === 0
}
function makeFileWritable (dest, srcMode) {
return setDestMode(dest, srcMode | 0o200)
}
function setDestMode (dest, srcMode) {
return fs.chmodSync(dest, srcMode)
}
function setDestTimestamps (src, dest) {
// The initial srcStat.atime cannot be trusted
// because it is modified by the read(2) system call
// (See https://nodejs.org/api/fs.html#fs_stat_time_values)
const updatedSrcStat = fs.statSync(src)
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
}
function onDir (srcStat, destStat, src, dest, opts) {
if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)
return copyDir(src, dest, opts)
}
function mkDirAndCopy (srcMode, src, dest, opts) {
fs.mkdirSync(dest)
copyDir(src, dest, opts)
return setDestMode(dest, srcMode)
}
function copyDir (src, dest, opts) {
const dir = fs.opendirSync(src)
try {
let dirent
while ((dirent = dir.readSync()) !== null) {
copyDirItem(dirent.name, src, dest, opts)
}
} finally {
dir.closeSync()
}
}
function copyDirItem (item, src, dest, opts) {
const srcItem = path.join(src, item)
const destItem = path.join(dest, item)
if (opts.filter && !opts.filter(srcItem, destItem)) return
const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)
return getStats(destStat, srcItem, destItem, opts)
}
function onLink (destStat, src, dest, opts) {
let resolvedSrc = fs.readlinkSync(src)
if (opts.dereference) {
resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
}
if (!destStat) {
return fs.symlinkSync(resolvedSrc, dest)
} else {
let resolvedDest
try {
resolvedDest = fs.readlinkSync(dest)
} catch (err) {
// dest exists and is a regular file or directory,
// Windows may throw UNKNOWN error. If dest already exists,
// fs throws error anyway, so no need to guard against it here.
if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)
throw err
}
if (opts.dereference) {
resolvedDest = path.resolve(process.cwd(), resolvedDest)
}
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
}
// prevent copy if src is a subdir of dest since unlinking
// dest in this case would result in removing src contents
// and therefore a broken symlink would be created.
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
}
return copyLink(resolvedSrc, dest)
}
}
function copyLink (resolvedSrc, dest) {
fs.unlinkSync(dest)
return fs.symlinkSync(resolvedSrc, dest)
}
module.exports = copySync
@@ -0,0 +1,13 @@
'use strict';
var implementation = require('./implementation');
module.exports = function getPolyfill() {
if (
Array.prototype.includes
&& Array(1).includes(undefined) // https://bugzilla.mozilla.org/show_bug.cgi?id=1767541
) {
return Array.prototype.includes;
}
return implementation;
};
@@ -0,0 +1,21 @@
const getOptions = require('./common/get-options.js')
const owner = require('./common/owner-sync.js')
const withOwnerSync = (path, fn, opts) => {
const options = getOptions(opts, {
copy: ['owner'],
})
const { uid, gid } = owner.validate(path, options.owner)
const result = fn({ uid, gid })
owner.update(path, uid, gid)
if (typeof result === 'string') {
owner.update(result, uid, gid)
}
return result
}
module.exports = withOwnerSync
@@ -0,0 +1 @@
{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IACtC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAWD;;GAEG;AACH,qBAAa,MAAO,YAAW,UAAU;IACvC,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;IACzB,MAAM,EAAE,gBAAgB,CAAA;gBAGtB,OAAO,EAAE,MAAM,EAAE,EACjB,EACE,OAAO,EACP,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAA0B,GAC3B,EAAE,cAAc;IAqBnB,GAAG,CAAC,GAAG,EAAE,MAAM;IAyCf,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;IAczB,eAAe,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;CAWlC"}
@@ -0,0 +1,13 @@
'use strict';
function inspectStream(stream) {
var streamType = stream.constructor.name;
// Avoid StreamStream
if (streamType === 'Stream') {
streamType = '';
}
return '<' + streamType + 'Stream>';
}
module.exports = inspectStream;
@@ -0,0 +1,57 @@
import { AriaSliderProps, AriaSliderThumbProps } from "@react-types/slider";
import { DOMAttributes, RefObject } from "@react-types/shared";
import { LabelHTMLAttributes, OutputHTMLAttributes, InputHTMLAttributes } from "react";
import { SliderState } from "@react-stately/slider";
export interface SliderAria {
/** Props for the label element. */
labelProps: LabelHTMLAttributes<HTMLLabelElement>;
/** Props for the root element of the slider component; groups slider inputs. */
groupProps: DOMAttributes;
/** Props for the track element. */
trackProps: DOMAttributes;
/** Props for the output element, displaying the value of the slider thumbs. */
outputProps: OutputHTMLAttributes<HTMLOutputElement>;
}
/**
* Provides the behavior and accessibility implementation for a slider component representing one or more values.
*
* @param props Props for the slider.
* @param state State for the slider, as returned by `useSliderState`.
* @param trackRef Ref for the "track" element. The width of this element provides the "length"
* of the track -- the span of one dimensional space that the slider thumb can be. It also
* accepts click and drag motions, so that the closest thumb will follow clicks and drags on
* the track.
*/
export function useSlider<T extends number | number[]>(props: AriaSliderProps<T>, state: SliderState, trackRef: RefObject<Element | null>): SliderAria;
export interface SliderThumbAria {
/** Props for the root thumb element; handles the dragging motion. */
thumbProps: DOMAttributes;
/** Props for the visually hidden range input element. */
inputProps: InputHTMLAttributes<HTMLInputElement>;
/** Props for the label element for this thumb (optional). */
labelProps: LabelHTMLAttributes<HTMLLabelElement>;
/** Whether this thumb is currently being dragged. */
isDragging: boolean;
/** Whether the thumb is currently focused. */
isFocused: boolean;
/** Whether the thumb is disabled. */
isDisabled: boolean;
}
export interface AriaSliderThumbOptions extends AriaSliderThumbProps {
/** A ref to the track element. */
trackRef: RefObject<Element | null>;
/** A ref to the thumb input element. */
inputRef: RefObject<HTMLInputElement | null>;
}
/**
* Provides behavior and accessibility for a thumb of a slider component.
*
* @param opts Options for this Slider thumb.
* @param state Slider state, created via `useSliderState`.
*/
export function useSliderThumb(opts: AriaSliderThumbOptions, state: SliderState): SliderThumbAria;
export type { AriaSliderProps } from '@react-types/slider';
export type { AriaSliderThumbProps } from '@react-types/slider';
export type { Orientation } from '@react-types/shared';
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,16 @@
var baseGetAllKeys = require('./_baseGetAllKeys'),
getSymbols = require('./_getSymbols'),
keys = require('./keys');
/**
* Creates an array of own enumerable property names and symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols);
}
module.exports = getAllKeys;
@@ -0,0 +1,49 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var curry = require('../utils/curry.js');
var isObject = require('../utils/isObject.js');
/**
* validates the configuration object and informs about deprecation
* @param {Object} config - the configuration object
* @return {Object} config - the validated configuration object
*/
function validateConfig(config) {
if (!config) errorHandler('configIsRequired');
if (!isObject.default(config)) errorHandler('configType');
if (config.urls) {
informAboutDeprecation();
return {
paths: {
vs: config.urls.monacoBase
}
};
}
return config;
}
/**
* logs deprecation message
*/
function informAboutDeprecation() {
console.warn(errorMessages.deprecation);
}
function throwError(errorMessages, type) {
throw new Error(errorMessages[type] || errorMessages["default"]);
}
var errorMessages = {
configIsRequired: 'the configuration object is required',
configType: 'the configuration object should be an object',
"default": 'an unknown error accured in `@monaco-editor/loader` package',
deprecation: "Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "
};
var errorHandler = curry.default(throwError)(errorMessages);
var validators = {
config: validateConfig
};
exports.default = validators;
exports.errorHandler = errorHandler;
exports.errorMessages = errorMessages;
@@ -0,0 +1,30 @@
/**
* @typedef {import('hast').Element} Element
* @typedef {import('mdast').Heading} Heading
* @typedef {import('../state.js').State} State
*/
// Make VS Code show references to the above types.
''
/**
* Turn an mdast `heading` node into hast.
*
* @param {State} state
* Info passed around.
* @param {Heading} node
* mdast node.
* @returns {Element}
* hast node.
*/
export function heading(state, node) {
/** @type {Element} */
const result = {
type: 'element',
tagName: 'h' + node.depth,
properties: {},
children: state.all(node)
}
state.patch(node, result)
return state.applyData(node, result)
}
@@ -0,0 +1,13 @@
import { NodeIQQNTWrapperSession } from '../wrapper';
import { NTEventWrapper } from './event';
/**
* 创建 Session 的双层代理
* 第一层:拦截 getXXXService 方法
* 第二层:拦截 Service 上的具体方法调用
*/
export declare function createSessionProxy(session: NodeIQQNTWrapperSession, eventWrapper: NTEventWrapper): NodeIQQNTWrapperSession;
/**
* 创建带有 EventWrapper 集成的 InstanceContext
* 这是推荐的使用方式,在创建 context 时自动代理 session
*/
export declare function createProxiedSession(session: NodeIQQNTWrapperSession, eventWrapper: NTEventWrapper): NodeIQQNTWrapperSession;
@@ -0,0 +1,43 @@
{
"name": "replace-ext",
"version": "1.0.1",
"description": "Replaces a file extension with another one",
"author": "Gulp Team <team@gulpjs.com> (http://gulpjs.com/)",
"contributors": [
"Eric Schoffstall <yo@contra.io>",
"Blaine Bublitz <blaine.bublitz@gmail.com>"
],
"repository": "gulpjs/replace-ext",
"license": "MIT",
"engines": {
"node": ">= 0.10"
},
"main": "index.js",
"files": [
"LICENSE",
"index.js"
],
"scripts": {
"lint": "eslint .",
"pretest": "npm run lint",
"test": "nyc mocha --async-only",
"cover": "nyc --reporter=lcov --reporter=text-summary npm test",
"azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"dependencies": {},
"devDependencies": {
"coveralls": "github:phated/node-coveralls#2.x",
"eslint": "^2.13.1",
"eslint-config-gulp": "^3.0.1",
"expect": "^1.20.2",
"mocha": "^3.0.0",
"nyc": "^10.3.2"
},
"keywords": [
"gulp",
"extensions",
"filepath",
"basename"
]
}
@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = getImplicitRoleForAside;
/**
* Returns the implicit role for an aside tag.
*/
function getImplicitRoleForAside() {
return 'complementary';
}
module.exports = exports.default;
@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Void = Void;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
/** `[JavaScript]` Creates a Void type */
function Void(options) {
return (0, type_1.CreateType)({ [index_1.Kind]: 'Void', type: 'void' }, options);
}
@@ -0,0 +1 @@
{"name":"update-browserslist-db","version":"1.1.4","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532117172,"integrity":"sha512-AQXscROXgmcs0oIrdR/B9FeBkOvaA8Q6P0k4fgmkcAPE2UlkkYNPgr+MBTc7p+1XQ7HpUOxHV8pBe2ARFeskqw==","mode":420,"size":1118},"check-npm-version.js":{"checkedAt":1794532117172,"integrity":"sha512-w1eT8zk68AarT0ydOnoyW1M5A9u7/c43oQH7BOP+FTEWH7Egd/lbggIHcA22h4HeORb/Uszh08aPweQ3VxrtFQ==","mode":420,"size":401},"cli.js":{"checkedAt":1794532117173,"integrity":"sha512-X/9JWPw9qJQS+4gVqd03nXFugk2RBZrV/inrxPQzFUByPtEvMXbk8D1R/WqpA+r7GLz0tKvrVH6UDFeTeIzE2w==","mode":493,"size":912},"index.js":{"checkedAt":1794532117173,"integrity":"sha512-cs7Py4th8Rbuw3OrMAJTKyKKm64TeJv9g/ibJJf91OMz06P0rW/j4fmqv5LxcT2kXpBMi0W1cuplAiQY2WpRdQ==","mode":420,"size":9870},"utils.js":{"checkedAt":1794532117173,"integrity":"sha512-wTf+DerIR+IddALcLYZuIXHrbHShV/JL1zls0cDNjFqYjts/WloDtLXQTHuDO4wFDl327AckgXPWHMOwnGA1bw==","mode":420,"size":712},"package.json":{"checkedAt":1794532117173,"integrity":"sha512-98W0m4Tdtj3skh8UAGb9CeiuHbGztWxWwlpu3cqxTz8DY3fu2Wppe1s0XfIl6pyXHp8LQoe8Blk5WtYVi7R42g==","mode":420,"size":916},"README.md":{"checkedAt":1794532117173,"integrity":"sha512-gcWLZb3ymAxHEA3W3DZnNGFUhc3/cw/8XJNbdPG1M+uQLwP41xWUSohNGwE/ExZd8/UheZOapVcEEX799RRlCQ==","mode":420,"size":787},"index.d.ts":{"checkedAt":1794532117174,"integrity":"sha512-3tMogE0i0XHiMn1ARlxYaM25QhYeZ0F/RyvqDBWCuyTkuBA3uUJLo+bEvwGu0pJDe1VuR98w9pz9MvhtOf82Cg==","mode":420,"size":134}}}
@@ -0,0 +1,344 @@
# markdown-table
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
Generate a markdown ([GFM][]) table.
## Contents
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`markdownTable(table[, options])`](#markdowntabletable-options)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Inspiration](#inspiration)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This is a simple package that takes table data and generates a [GitHub flavored
markdown (GFM)][gfm] table.
## When should I use this?
You can use this package when you want to generate the source code of a GFM
table from some data.
This is a simple solution in that it doesn’t handle escapes or HTML or any of
that.
For a complete but heavier solution, build an AST and serialize it with
[`mdast-util-to-markdown`][mdast-util-to-markdown] (with
[`mdast-util-gfm`][mdast-util-gfm]).
## Install
This package is [ESM only][esm].
In Node.js (version 14.14+, 16.0+), install with [npm][]:
```sh
npm install markdown-table
```
In Deno with [`esm.sh`][esmsh]:
```js
import {markdownTable} from 'https://esm.sh/markdown-table@3'
```
In browsers with [`esm.sh`][esmsh]:
```html
<script type="module">
import {markdownTable} from 'https://esm.sh/markdown-table@3?bundle'
</script>
```
## Use
Typical usage (defaults to align left):
```js
import {markdownTable} from 'markdown-table'
markdownTable([
['Branch', 'Commit'],
['main', '0123456789abcdef'],
['staging', 'fedcba9876543210']
])
```
Yields:
```markdown
| Branch | Commit |
| ------- | ---------------- |
| main | 0123456789abcdef |
| staging | fedcba9876543210 |
```
With align:
```js
markdownTable(
[
['Beep', 'No.', 'Boop'],
['beep', '1024', 'xyz'],
['boop', '3388450', 'tuv'],
['foo', '10106', 'qrstuv'],
['bar', '45', 'lmno']
],
{align: ['l', 'c', 'r']}
)
```
Yields:
```markdown
| Beep | No. | Boop |
| :--- | :-----: | -----: |
| beep | 1024 | xyz |
| boop | 3388450 | tuv |
| foo | 10106 | qrstuv |
| bar | 45 | lmno |
```
## API
This package exports the identifier `markdownTable`.
There is no default export.
### `markdownTable(table[, options])`
Generate a markdown table from table data (matrix of strings).
##### `options`
Configuration (optional).
###### `options.align`
One style for all columns, or styles for their respective columns (`string` or
`Array<string>`).
Each style is either `'l'` (left), `'r'` (right), or `'c'` (center).
Other values are treated as `''`, which doesn’t place the colon in the alignment
row but does align left.
*Only the lowercased first character is used, so `Right` is fine.*
###### `options.padding`
Whether to add a space of padding between delimiters and cells (`boolean`,
default: `true`).
When `true`, there is padding:
```markdown
| Alpha | B |
| ----- | ----- |
| C | Delta |
```
When `false`, there is no padding:
```markdown
|Alpha|B |
|-----|-----|
|C |Delta|
```
###### `options.delimiterStart`
Whether to begin each row with the delimiter (`boolean`, default: `true`).
> 👉 **Note**: please don’t use this: it could create fragile structures that
> aren’t understandable to some markdown parsers.
When `true`, there are starting delimiters:
```markdown
| Alpha | B |
| ----- | ----- |
| C | Delta |
```
When `false`, there are no starting delimiters:
```markdown
Alpha | B |
----- | ----- |
C | Delta |
```
###### `options.delimiterEnd`
Whether to end each row with the delimiter (`boolean`, default: `true`).
> 👉 **Note**: please don’t use this: it could create fragile structures that
> aren’t understandable to some markdown parsers.
When `true`, there are ending delimiters:
```markdown
| Alpha | B |
| ----- | ----- |
| C | Delta |
```
When `false`, there are no ending delimiters:
```markdown
| Alpha | B
| ----- | -----
| C | Delta
```
###### `options.alignDelimiters`
Whether to align the delimiters (`boolean`, default: `true`).
By default, they are aligned:
```markdown
| Alpha | B |
| ----- | ----- |
| C | Delta |
```
Pass `false` to make them staggered:
```markdown
| Alpha | B |
| - | - |
| C | Delta |
```
###### `options.stringLength`
Function to detect the length of table cell content (`Function`, default:
`s => s.length`).
This is used when aligning the delimiters (`|`) between table cells.
Full-width characters and emoji mess up delimiter alignment when viewing the
markdown source.
To fix this, you can pass this function, which receives the cell content and
returns its “visible” size.
Note that what is and isn’t visible depends on where the text is displayed.
Without such a function, the following:
```js
markdownTable([
['Alpha', 'Bravo'],
['中文', 'Charlie'],
['👩‍❤️‍👩', 'Delta']
])
```
Yields:
```markdown
| Alpha | Bravo |
| - | - |
| 中文 | Charlie |
| 👩‍❤️‍👩 | Delta |
```
With [`string-width`][string-width]:
```js
import stringWidth from 'string-width'
markdownTable(
[
['Alpha', 'Bravo'],
['中文', 'Charlie'],
['👩‍❤️‍👩', 'Delta']
],
{stringLength: stringWidth}
)
```
Yields:
```markdown
| Alpha | Bravo |
| ----- | ------- |
| 中文 | Charlie |
| 👩‍❤️‍👩 | Delta |
```
## Types
This package is fully typed with [TypeScript][].
It exports the additional type `Options`.
## Compatibility
This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 14.14+ and 16.0+.
It also works in Deno and modern browsers.
## Security
This package is safe.
## Inspiration
The original idea and basic implementation was inspired by James Halliday’s
[`text-table`][text-table] library.
## Contribute
Yes please!
See [How to Contribute to Open Source][contribute].
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://github.com/wooorm/markdown-table/workflows/main/badge.svg
[build]: https://github.com/wooorm/markdown-table/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/markdown-table.svg
[coverage]: https://codecov.io/github/wooorm/markdown-table
[downloads-badge]: https://img.shields.io/npm/dm/markdown-table.svg
[downloads]: https://www.npmjs.com/package/markdown-table
[size-badge]: https://img.shields.io/bundlephobia/minzip/markdown-table.svg
[size]: https://bundlephobia.com/result?p=markdown-table
[npm]: https://docs.npmjs.com/cli/install
[esmsh]: https://esm.sh
[license]: license
[author]: https://wooorm.com
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[typescript]: https://www.typescriptlang.org
[contribute]: https://opensource.guide/how-to-contribute/
[gfm]: https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables
[text-table]: https://github.com/substack/text-table
[string-width]: https://github.com/sindresorhus/string-width
[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown
[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm
@@ -0,0 +1,11 @@
'use strict';
function getUnsupported() {
try {
return require("eslint/use-at-your-own-risk");
} catch {
return {};
}
}
exports.getUnsupported = getUnsupported;
@@ -0,0 +1,24 @@
import OverloadYield from "./OverloadYield.js";
function _asyncGeneratorDelegate(t) {
var e = {},
n = !1;
function pump(e, r) {
return n = !0, r = new Promise(function (n) {
n(t[e](r));
}), {
done: !1,
value: new OverloadYield(r, 1)
};
}
return e["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function () {
return this;
}, e.next = function (t) {
return n ? (n = !1, t) : pump("next", t);
}, "function" == typeof t["throw"] && (e["throw"] = function (t) {
if (n) throw n = !1, t;
return pump("throw", t);
}), "function" == typeof t["return"] && (e["return"] = function (t) {
return n ? (n = !1, t) : pump("return", t);
}), e;
}
export { _asyncGeneratorDelegate as default };
@@ -0,0 +1,368 @@
'use strict'
let { dirname, relative, resolve, sep } = require('path')
let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')
let { pathToFileURL } = require('url')
let Input = require('./input')
let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator)
let pathAvailable = Boolean(dirname && resolve && relative && sep)
class MapGenerator {
constructor(stringify, root, opts, cssString) {
this.stringify = stringify
this.mapOpts = opts.map || {}
this.root = root
this.opts = opts
this.css = cssString
this.originalCSS = cssString
this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute
this.memoizedFileURLs = new Map()
this.memoizedPaths = new Map()
this.memoizedURLs = new Map()
}
addAnnotation() {
let content
if (this.isInline()) {
content =
'data:application/json;base64,' + this.toBase64(this.map.toString())
} else if (typeof this.mapOpts.annotation === 'string') {
content = this.mapOpts.annotation
} else if (typeof this.mapOpts.annotation === 'function') {
content = this.mapOpts.annotation(this.opts.to, this.root)
} else {
content = this.outputFile() + '.map'
}
let eol = '\n'
if (this.css.includes('\r\n')) eol = '\r\n'
this.css += eol + '/*# sourceMappingURL=' + content + ' */'
}
applyPrevMaps() {
for (let prev of this.previous()) {
let from = this.toUrl(this.path(prev.file))
let root = prev.root || dirname(prev.file)
let map
if (this.mapOpts.sourcesContent === false) {
map = new SourceMapConsumer(prev.text)
if (map.sourcesContent) {
map.sourcesContent = null
}
} else {
map = prev.consumer()
}
this.map.applySourceMap(map, from, this.toUrl(this.path(root)))
}
}
clearAnnotation() {
if (this.mapOpts.annotation === false) return
if (this.root) {
let node
for (let i = this.root.nodes.length - 1; i >= 0; i--) {
node = this.root.nodes[i]
if (node.type !== 'comment') continue
if (node.text.startsWith('# sourceMappingURL=')) {
this.root.removeChild(i)
}
}
} else if (this.css) {
this.css = this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm, '')
}
}
generate() {
this.clearAnnotation()
if (pathAvailable && sourceMapAvailable && this.isMap()) {
return this.generateMap()
} else {
let result = ''
this.stringify(this.root, i => {
result += i
})
return [result]
}
}
generateMap() {
if (this.root) {
this.generateString()
} else if (this.previous().length === 1) {
let prev = this.previous()[0].consumer()
prev.file = this.outputFile()
this.map = SourceMapGenerator.fromSourceMap(prev, {
ignoreInvalidMapping: true
})
} else {
this.map = new SourceMapGenerator({
file: this.outputFile(),
ignoreInvalidMapping: true
})
this.map.addMapping({
generated: { column: 0, line: 1 },
original: { column: 0, line: 1 },
source: this.opts.from
? this.toUrl(this.path(this.opts.from))
: '<no source>'
})
}
if (this.isSourcesContent()) this.setSourcesContent()
if (this.root && this.previous().length > 0) this.applyPrevMaps()
if (this.isAnnotation()) this.addAnnotation()
if (this.isInline()) {
return [this.css]
} else {
return [this.css, this.map]
}
}
generateString() {
this.css = ''
this.map = new SourceMapGenerator({
file: this.outputFile(),
ignoreInvalidMapping: true
})
let line = 1
let column = 1
let noSource = '<no source>'
let mapping = {
generated: { column: 0, line: 0 },
original: { column: 0, line: 0 },
source: ''
}
let last, lines
this.stringify(this.root, (str, node, type) => {
this.css += str
if (node && type !== 'end') {
mapping.generated.line = line
mapping.generated.column = column - 1
if (node.source && node.source.start) {
mapping.source = this.sourcePath(node)
mapping.original.line = node.source.start.line
mapping.original.column = node.source.start.column - 1
this.map.addMapping(mapping)
} else {
mapping.source = noSource
mapping.original.line = 1
mapping.original.column = 0
this.map.addMapping(mapping)
}
}
lines = str.match(/\n/g)
if (lines) {
line += lines.length
last = str.lastIndexOf('\n')
column = str.length - last
} else {
column += str.length
}
if (node && type !== 'start') {
let p = node.parent || { raws: {} }
let childless =
node.type === 'decl' || (node.type === 'atrule' && !node.nodes)
if (!childless || node !== p.last || p.raws.semicolon) {
if (node.source && node.source.end) {
mapping.source = this.sourcePath(node)
mapping.original.line = node.source.end.line
mapping.original.column = node.source.end.column - 1
mapping.generated.line = line
mapping.generated.column = column - 2
this.map.addMapping(mapping)
} else {
mapping.source = noSource
mapping.original.line = 1
mapping.original.column = 0
mapping.generated.line = line
mapping.generated.column = column - 1
this.map.addMapping(mapping)
}
}
}
})
}
isAnnotation() {
if (this.isInline()) {
return true
}
if (typeof this.mapOpts.annotation !== 'undefined') {
return this.mapOpts.annotation
}
if (this.previous().length) {
return this.previous().some(i => i.annotation)
}
return true
}
isInline() {
if (typeof this.mapOpts.inline !== 'undefined') {
return this.mapOpts.inline
}
let annotation = this.mapOpts.annotation
if (typeof annotation !== 'undefined' && annotation !== true) {
return false
}
if (this.previous().length) {
return this.previous().some(i => i.inline)
}
return true
}
isMap() {
if (typeof this.opts.map !== 'undefined') {
return !!this.opts.map
}
return this.previous().length > 0
}
isSourcesContent() {
if (typeof this.mapOpts.sourcesContent !== 'undefined') {
return this.mapOpts.sourcesContent
}
if (this.previous().length) {
return this.previous().some(i => i.withContent())
}
return true
}
outputFile() {
if (this.opts.to) {
return this.path(this.opts.to)
} else if (this.opts.from) {
return this.path(this.opts.from)
} else {
return 'to.css'
}
}
path(file) {
if (this.mapOpts.absolute) return file
if (file.charCodeAt(0) === 60 /* `<` */) return file
if (/^\w+:\/\//.test(file)) return file
let cached = this.memoizedPaths.get(file)
if (cached) return cached
let from = this.opts.to ? dirname(this.opts.to) : '.'
if (typeof this.mapOpts.annotation === 'string') {
from = dirname(resolve(from, this.mapOpts.annotation))
}
let path = relative(from, file)
this.memoizedPaths.set(file, path)
return path
}
previous() {
if (!this.previousMaps) {
this.previousMaps = []
if (this.root) {
this.root.walk(node => {
if (node.source && node.source.input.map) {
let map = node.source.input.map
if (!this.previousMaps.includes(map)) {
this.previousMaps.push(map)
}
}
})
} else {
let input = new Input(this.originalCSS, this.opts)
if (input.map) this.previousMaps.push(input.map)
}
}
return this.previousMaps
}
setSourcesContent() {
let already = {}
if (this.root) {
this.root.walk(node => {
if (node.source) {
let from = node.source.input.from
if (from && !already[from]) {
already[from] = true
let fromUrl = this.usesFileUrls
? this.toFileUrl(from)
: this.toUrl(this.path(from))
this.map.setSourceContent(fromUrl, node.source.input.css)
}
}
})
} else if (this.css) {
let from = this.opts.from
? this.toUrl(this.path(this.opts.from))
: '<no source>'
this.map.setSourceContent(from, this.css)
}
}
sourcePath(node) {
if (this.mapOpts.from) {
return this.toUrl(this.mapOpts.from)
} else if (this.usesFileUrls) {
return this.toFileUrl(node.source.input.from)
} else {
return this.toUrl(this.path(node.source.input.from))
}
}
toBase64(str) {
if (Buffer) {
return Buffer.from(str).toString('base64')
} else {
return window.btoa(unescape(encodeURIComponent(str)))
}
}
toFileUrl(path) {
let cached = this.memoizedFileURLs.get(path)
if (cached) return cached
if (pathToFileURL) {
let fileURL = pathToFileURL(path).toString()
this.memoizedFileURLs.set(path, fileURL)
return fileURL
} else {
throw new Error(
'`map.absolute` option is not available in this PostCSS build'
)
}
}
toUrl(path) {
let cached = this.memoizedURLs.get(path)
if (cached) return cached
if (sep === '\\') {
path = path.replace(/\\/g, '/')
}
let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent)
this.memoizedURLs.set(path, url)
return url
}
}
module.exports = MapGenerator
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var RowRole = {
relatedConcepts: [{
module: 'ARIA',
concept: {
name: 'row'
}
}, {
module: 'HTML',
concept: {
name: 'tr'
}
}],
type: 'structure'
};
var _default = RowRole;
exports.default = _default;
@@ -0,0 +1,18 @@
var baseConformsTo = require('./_baseConformsTo'),
keys = require('./keys');
/**
* The base implementation of `_.conforms` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property predicates to conform to.
* @returns {Function} Returns the new spec function.
*/
function baseConforms(source) {
var props = keys(source);
return function(object) {
return baseConformsTo(object, source, props);
};
}
module.exports = baseConforms;
@@ -0,0 +1,31 @@
# 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.1.0](https://github.com/ljharb/stop-iteration-iterator/compare/v1.0.0...v1.1.0) - 2024-12-13
### Commits
- [New] add types [`f0ee985`](https://github.com/ljharb/stop-iteration-iterator/commit/f0ee985afeccf2950e693757266c77baeaab50f5)
- [actions] split out node 10-20, and 20+ [`b49d910`](https://github.com/ljharb/stop-iteration-iterator/commit/b49d9101ff21b27e30ce6b2c52e121b36efaa7e8)
- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `npmignore`, `tape` [`2bdaff7`](https://github.com/ljharb/stop-iteration-iterator/commit/2bdaff787a45d4034c079bd308c4a9ba2b09950e)
- [types] clean up tsconfig [`c275b15`](https://github.com/ljharb/stop-iteration-iterator/commit/c275b15940ed12955e77bf2fd764ff507788637d)
- [meta] clean up changelog [`a3eeb9a`](https://github.com/ljharb/stop-iteration-iterator/commit/a3eeb9a763063e27a560f09d25b865f40e373154)
- [Robustness] use `es-errors` [`ca51cb8`](https://github.com/ljharb/stop-iteration-iterator/commit/ca51cb8d7ef259e4aa8e4a9289f0c187fc08d560)
- [Tests] replace `aud` with `npm audit` [`d4b8df0`](https://github.com/ljharb/stop-iteration-iterator/commit/d4b8df04328f133b65bec028c5f78715cd061357)
- [Deps] update `internal-slot` [`61ca626`](https://github.com/ljharb/stop-iteration-iterator/commit/61ca626be1bd5e9bb6051f70b32e3d49b8abcd6a)
- [Deps] update `internal-slot` [`cdabf84`](https://github.com/ljharb/stop-iteration-iterator/commit/cdabf8419d448faaacd1b5d87c839acb7a6eb899)
- [meta] add `sideEffects` flag [`a5f6cb6`](https://github.com/ljharb/stop-iteration-iterator/commit/a5f6cb6e9fa8859115e452c22d4ef90366dc4d0f)
- [Dev Deps] add missing peer dep [`6f6496e`](https://github.com/ljharb/stop-iteration-iterator/commit/6f6496ec5c47499f5e30b80268e2ce545a5469ba)
## v1.0.0 - 2023-01-12
### Commits
- Initial implementation, tests, readme [`43e8109`](https://github.com/ljharb/stop-iteration-iterator/commit/43e81099d2f2b63ff3a8a253ad13dd8279c9e2dc)
- Initial commit [`23929ce`](https://github.com/ljharb/stop-iteration-iterator/commit/23929ce525165bfe54f053284fd066dce8598486)
- npm init [`a9847ab`](https://github.com/ljharb/stop-iteration-iterator/commit/a9847ab637a7c223fb7478d47caf04e89ba283ff)
- Only apps should have lockfiles [`4e41f3f`](https://github.com/ljharb/stop-iteration-iterator/commit/4e41f3fbbaf8a1d32b12514d7296961e5df73e4b)
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from '../types.mjs';
import 'react';
declare const CheckLinearIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { CheckLinearIcon };
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/textfield/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport type {TextFieldAria} from './useTextField';\nexport {useTextField} from './useTextField';\nexport {useFormattedTextField} from './useFormattedTextField';\nexport type {AriaTextFieldOptions} from './useTextField';\nexport type {AriaTextFieldProps} from '@react-types/textfield';\n"],"names":[],"version":3,"file":"main.js.map"}
@@ -0,0 +1,38 @@
// Tibetan [bo]
import dayjs from '../index';
var locale = {
name: 'bo',
weekdays: 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'),
weekdaysShort: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
weekdaysMin: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
months: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
monthsShort: 'ཟླ་དང་པོ_ཟླ་གཉིས་པ_ཟླ་གསུམ་པ_ཟླ་བཞི་པ_ཟླ་ལྔ་པ_ཟླ་དྲུག་པ_ཟླ་བདུན་པ_ཟླ་བརྒྱད་པ_ཟླ་དགུ་པ_ཟླ་བཅུ་པ_ཟླ་བཅུ་གཅིག་པ_ཟླ་བཅུ་གཉིས་པ'.split('_'),
ordinal: function ordinal(n) {
return n;
},
formats: {
LT: 'A h:mm',
LTS: 'A h:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY, A h:mm',
LLLL: 'dddd, D MMMM YYYY, A h:mm'
},
relativeTime: {
future: '%s ལ་',
past: '%s སྔོན་ལ་',
s: 'ཏོག་ཙམ་',
m: 'སྐར་མ་གཅིག་',
mm: 'སྐར་མ་ %d',
h: 'ཆུ་ཚོད་གཅིག་',
hh: 'ཆུ་ཚོད་ %d',
d: 'ཉིན་གཅིག་',
dd: 'ཉིན་ %d',
M: 'ཟླ་བ་གཅིག་',
MM: 'ཟླ་བ་ %d',
y: 'ལོ་གཅིག་',
yy: 'ལོ་ %d'
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,21 @@
/**
* @import {Options, State} from 'mdast-util-to-markdown'
*/
/**
* @param {State} state
* @returns {Exclude<Options['fence'], null | undefined>}
*/
export function checkFence(state) {
const marker = state.options.fence || '`'
if (marker !== '`' && marker !== '~') {
throw new Error(
'Cannot serialize code with `' +
marker +
'` for `options.fence`, expected `` ` `` or `~`'
)
}
return marker
}
@@ -0,0 +1,92 @@
import {Rect as $60423f92c7f9ad87$export$c79fc6492f3af13d} from "./Rect.mjs";
import {Virtualizer as $38b9490c1cca8fc4$export$89be5a243e59c4b2} from "./Virtualizer.mjs";
import $3Fik3$react, {useState as $3Fik3$useState, useRef as $3Fik3$useRef, useMemo as $3Fik3$useMemo, useCallback as $3Fik3$useCallback} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $fc0b13b484ac1194$export$e5c5a5f917a5871c = typeof document !== 'undefined' ? (0, $3Fik3$react).useLayoutEffect : ()=>{};
function $fc0b13b484ac1194$export$1505db82fe357e65(opts) {
let [visibleRect, setVisibleRect] = (0, $3Fik3$useState)(new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)(0, 0, 0, 0));
let [isScrolling, setScrolling] = (0, $3Fik3$useState)(false);
let [invalidationContext, setInvalidationContext] = (0, $3Fik3$useState)({});
let visibleRectChanged = (0, $3Fik3$useRef)(false);
let [virtualizer] = (0, $3Fik3$useState)(()=>new (0, $38b9490c1cca8fc4$export$89be5a243e59c4b2)({
collection: opts.collection,
layout: opts.layout,
delegate: {
setVisibleRect (rect) {
setVisibleRect(rect);
visibleRectChanged.current = true;
},
// TODO: should changing these invalidate the entire cache?
renderView: opts.renderView,
invalidate: setInvalidationContext
}
}));
// onVisibleRectChange must be called from an effect, not during render.
$fc0b13b484ac1194$export$e5c5a5f917a5871c(()=>{
if (visibleRectChanged.current) {
visibleRectChanged.current = false;
opts.onVisibleRectChange(visibleRect);
}
});
let mergedInvalidationContext = (0, $3Fik3$useMemo)(()=>{
if (opts.layoutOptions != null) return {
...invalidationContext,
layoutOptions: opts.layoutOptions
};
return invalidationContext;
}, [
invalidationContext,
opts.layoutOptions
]);
let visibleViews = virtualizer.render({
layout: opts.layout,
collection: opts.collection,
persistedKeys: opts.persistedKeys,
layoutOptions: opts.layoutOptions,
visibleRect: visibleRect,
invalidationContext: mergedInvalidationContext,
isScrolling: isScrolling
});
let contentSize = virtualizer.contentSize;
let startScrolling = (0, $3Fik3$useCallback)(()=>{
setScrolling(true);
}, []);
let endScrolling = (0, $3Fik3$useCallback)(()=>{
setScrolling(false);
}, []);
let state = (0, $3Fik3$useMemo)(()=>({
virtualizer: virtualizer,
visibleViews: visibleViews,
setVisibleRect: setVisibleRect,
contentSize: contentSize,
isScrolling: isScrolling,
startScrolling: startScrolling,
endScrolling: endScrolling
}), [
virtualizer,
visibleViews,
setVisibleRect,
contentSize,
isScrolling,
startScrolling,
endScrolling
]);
return state;
}
export {$fc0b13b484ac1194$export$e5c5a5f917a5871c as useLayoutEffect, $fc0b13b484ac1194$export$1505db82fe357e65 as useVirtualizerState};
//# sourceMappingURL=useVirtualizerState.module.js.map
@@ -0,0 +1,11 @@
var equal = require('../');
console.dir([
equal(
{ a : [ 2, 3 ], b : [ 4 ] },
{ a : [ 2, 3 ], b : [ 4 ] }
),
equal(
{ x : 5, y : [6] },
{ x : 5, y : 6 }
)
]);
@@ -0,0 +1,279 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return expandTailwindAtRules;
}
});
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
const _quicklru = /*#__PURE__*/ _interop_require_default(require("@alloc/quick-lru"));
const _sharedState = /*#__PURE__*/ _interop_require_wildcard(require("./sharedState"));
const _generateRules = require("./generateRules");
const _log = /*#__PURE__*/ _interop_require_default(require("../util/log"));
const _cloneNodes = /*#__PURE__*/ _interop_require_default(require("../util/cloneNodes"));
const _defaultExtractor = require("./defaultExtractor");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function") return null;
var cacheBabelInterop = new WeakMap();
var cacheNodeInterop = new WeakMap();
return (_getRequireWildcardCache = function(nodeInterop) {
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interop_require_wildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;
}
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
return {
default: obj
};
}
var cache = _getRequireWildcardCache(nodeInterop);
if (cache && cache.has(obj)) {
return cache.get(obj);
}
var newObj = {};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for(var key in obj){
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
newObj.default = obj;
if (cache) {
cache.set(obj, newObj);
}
return newObj;
}
let env = _sharedState.env;
const builtInExtractors = {
DEFAULT: _defaultExtractor.defaultExtractor
};
const builtInTransformers = {
DEFAULT: (content)=>content,
svelte: (content)=>content.replace(/(?:^|\s)class:/g, " ")
};
function getExtractor(context, fileExtension) {
let extractors = context.tailwindConfig.content.extract;
return extractors[fileExtension] || extractors.DEFAULT || builtInExtractors[fileExtension] || builtInExtractors.DEFAULT(context);
}
function getTransformer(tailwindConfig, fileExtension) {
let transformers = tailwindConfig.content.transform;
return transformers[fileExtension] || transformers.DEFAULT || builtInTransformers[fileExtension] || builtInTransformers.DEFAULT;
}
let extractorCache = new WeakMap();
// Scans template contents for possible classes. This is a hot path on initial build but
// not too important for subsequent builds. The faster the better though — if we can speed
// up these regexes by 50% that could cut initial build time by like 20%.
function getClassCandidates(content, extractor, candidates, seen) {
if (!extractorCache.has(extractor)) {
extractorCache.set(extractor, new _quicklru.default({
maxSize: 25000
}));
}
for (let line of content.split("\n")){
line = line.trim();
if (seen.has(line)) {
continue;
}
seen.add(line);
if (extractorCache.get(extractor).has(line)) {
for (let match of extractorCache.get(extractor).get(line)){
candidates.add(match);
}
} else {
let extractorMatches = extractor(line).filter((s)=>s !== "!*");
let lineMatchesSet = new Set(extractorMatches);
for (let match of lineMatchesSet){
candidates.add(match);
}
extractorCache.get(extractor).set(line, lineMatchesSet);
}
}
}
/**
*
* @param {[import('./offsets.js').RuleOffset, import('postcss').Node][]} rules
* @param {*} context
*/ function buildStylesheet(rules, context) {
let sortedRules = context.offsets.sort(rules);
let returnValue = {
base: new Set(),
defaults: new Set(),
components: new Set(),
utilities: new Set(),
variants: new Set()
};
for (let [sort, rule] of sortedRules){
returnValue[sort.layer].add(rule);
}
return returnValue;
}
function expandTailwindAtRules(context) {
return async (root)=>{
let layerNodes = {
base: null,
components: null,
utilities: null,
variants: null
};
root.walkAtRules((rule)=>{
// Make sure this file contains Tailwind directives. If not, we can save
// a lot of work and bail early. Also we don't have to register our touch
// file as a dependency since the output of this CSS does not depend on
// the source of any templates. Think Vue <style> blocks for example.
if (rule.name === "tailwind") {
if (Object.keys(layerNodes).includes(rule.params)) {
layerNodes[rule.params] = rule;
}
}
});
if (Object.values(layerNodes).every((n)=>n === null)) {
return root;
}
var _context_candidates;
// ---
// Find potential rules in changed files
let candidates = new Set([
...(_context_candidates = context.candidates) !== null && _context_candidates !== void 0 ? _context_candidates : [],
_sharedState.NOT_ON_DEMAND
]);
let seen = new Set();
env.DEBUG && console.time("Reading changed files");
/** @type {[item: {file?: string, content?: string}, meta: {transformer: any, extractor: any}][]} */ let regexParserContent = [];
for (let item of context.changedContent){
let transformer = getTransformer(context.tailwindConfig, item.extension);
let extractor = getExtractor(context, item.extension);
regexParserContent.push([
item,
{
transformer,
extractor
}
]);
}
const BATCH_SIZE = 500;
for(let i = 0; i < regexParserContent.length; i += BATCH_SIZE){
let batch = regexParserContent.slice(i, i + BATCH_SIZE);
await Promise.all(batch.map(async ([{ file , content }, { transformer , extractor }])=>{
content = file ? await _fs.default.promises.readFile(file, "utf8") : content;
getClassCandidates(transformer(content), extractor, candidates, seen);
}));
}
env.DEBUG && console.timeEnd("Reading changed files");
// ---
// Generate the actual CSS
let classCacheCount = context.classCache.size;
env.DEBUG && console.time("Generate rules");
env.DEBUG && console.time("Sorting candidates");
let sortedCandidates = new Set([
...candidates
].sort((a, z)=>{
if (a === z) return 0;
if (a < z) return -1;
return 1;
}));
env.DEBUG && console.timeEnd("Sorting candidates");
(0, _generateRules.generateRules)(sortedCandidates, context);
env.DEBUG && console.timeEnd("Generate rules");
// We only ever add to the classCache, so if it didn't grow, there is nothing new.
env.DEBUG && console.time("Build stylesheet");
if (context.stylesheetCache === null || context.classCache.size !== classCacheCount) {
context.stylesheetCache = buildStylesheet([
...context.ruleCache
], context);
}
env.DEBUG && console.timeEnd("Build stylesheet");
let { defaults: defaultNodes , base: baseNodes , components: componentNodes , utilities: utilityNodes , variants: screenNodes } = context.stylesheetCache;
// ---
// Replace any Tailwind directives with generated CSS
if (layerNodes.base) {
layerNodes.base.before((0, _cloneNodes.default)([
...defaultNodes,
...baseNodes
], layerNodes.base.source, {
layer: "base"
}));
layerNodes.base.remove();
}
if (layerNodes.components) {
layerNodes.components.before((0, _cloneNodes.default)([
...componentNodes
], layerNodes.components.source, {
layer: "components"
}));
layerNodes.components.remove();
}
if (layerNodes.utilities) {
layerNodes.utilities.before((0, _cloneNodes.default)([
...utilityNodes
], layerNodes.utilities.source, {
layer: "utilities"
}));
layerNodes.utilities.remove();
}
// We do post-filtering to not alter the emitted order of the variants
const variantNodes = Array.from(screenNodes).filter((node)=>{
var _node_raws_tailwind;
const parentLayer = (_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.parentLayer;
if (parentLayer === "components") {
return layerNodes.components !== null;
}
if (parentLayer === "utilities") {
return layerNodes.utilities !== null;
}
return true;
});
if (layerNodes.variants) {
layerNodes.variants.before((0, _cloneNodes.default)(variantNodes, layerNodes.variants.source, {
layer: "variants"
}));
layerNodes.variants.remove();
} else if (variantNodes.length > 0) {
root.append((0, _cloneNodes.default)(variantNodes, root.source, {
layer: "variants"
}));
}
var _root_source_end;
// TODO: Why is the root node having no source location for `end` possible?
root.source.end = (_root_source_end = root.source.end) !== null && _root_source_end !== void 0 ? _root_source_end : root.source.start;
// If we've got a utility layer and no utilities are generated there's likely something wrong
const hasUtilityVariants = variantNodes.some((node)=>{
var _node_raws_tailwind;
return ((_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.parentLayer) === "utilities";
});
if (layerNodes.utilities && utilityNodes.size === 0 && !hasUtilityVariants) {
_log.default.warn("content-problems", [
"No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.",
"https://tailwindcss.com/docs/content-configuration"
]);
}
// ---
if (env.DEBUG) {
console.log("Potential classes: ", candidates.size);
console.log("Active contexts: ", _sharedState.contextSourcesMap.size);
}
// Clear the cache for the changed files
context.changedContent = [];
// Cleanup any leftover @layer atrules
root.walkAtRules("layer", (rule)=>{
if (Object.keys(layerNodes).includes(rule.params)) {
rule.remove();
}
});
};
}
@@ -0,0 +1,172 @@
import { AST_NODE_TYPES } from '@typescript-eslint/types';
import { ExportMap, recursivePatternCapture, createRule, getValue, } from '../utils/index.js';
const rootProgram = 'root';
const tsTypePrefix = 'type:';
function removeTypescriptFunctionOverloads(nodes) {
for (const node of nodes) {
const declType = node.type === AST_NODE_TYPES.ExportDefaultDeclaration
? node.declaration.type
: node.parent?.type;
if (declType === AST_NODE_TYPES.TSDeclareFunction) {
nodes.delete(node);
}
}
}
function isTypescriptNamespaceMerging(nodes) {
const types = new Set(Array.from(nodes, node => `${node.parent.type}`));
const noNamespaceNodes = [...nodes].filter(node => node.parent.type !== 'TSModuleDeclaration');
return (types.has('TSModuleDeclaration') &&
(types.size === 1 ||
(types.size === 2 &&
(types.has('FunctionDeclaration') || types.has('TSDeclareFunction'))) ||
(types.size === 3 &&
types.has('FunctionDeclaration') &&
types.has('TSDeclareFunction')) ||
(types.size === 2 &&
(types.has('ClassDeclaration') || types.has('TSEnumDeclaration')) &&
noNamespaceNodes.length === 1)));
}
function shouldSkipTypescriptNamespace(node, nodes) {
const types = new Set(Array.from(nodes, node => `${node.parent.type}`));
return (!isTypescriptNamespaceMerging(nodes) &&
node.parent.type === 'TSModuleDeclaration' &&
(types.has('TSEnumDeclaration') ||
types.has('ClassDeclaration') ||
types.has('FunctionDeclaration') ||
types.has('TSDeclareFunction')));
}
export default createRule({
name: 'export',
meta: {
type: 'problem',
docs: {
category: 'Helpful warnings',
description: 'Forbid any invalid exports, i.e. re-export of the same name.',
},
schema: [],
messages: {
noNamed: "No named exports found in module '{{module}}'.",
multiDefault: 'Multiple default exports.',
multiNamed: "Multiple exports of name '{{name}}'.",
},
},
defaultOptions: [],
create(context) {
const namespace = new Map([[rootProgram, new Map()]]);
function addNamed(name, node, parent, isType) {
if (!namespace.has(parent)) {
namespace.set(parent, new Map());
}
const named = namespace.get(parent);
const key = isType ? `${tsTypePrefix}${name}` : name;
let nodes = named.get(key);
if (nodes == null) {
nodes = new Set();
named.set(key, nodes);
}
nodes.add(node);
}
function getParent(node) {
if (node.parent?.type === 'TSModuleBlock') {
return node.parent.parent;
}
return rootProgram;
}
return {
ExportDefaultDeclaration(node) {
addNamed('default', node, getParent(node));
},
ExportSpecifier(node) {
addNamed(getValue(node.exported), node.exported, getParent(node.parent));
},
ExportNamedDeclaration(node) {
if (node.declaration == null) {
return;
}
const parent = getParent(node);
const isTypeVariableDecl = 'kind' in node.declaration &&
node.declaration.kind === 'type';
if ('id' in node.declaration && node.declaration.id != null) {
const id = node.declaration.id;
addNamed(id.name, id, parent, ['TSTypeAliasDeclaration', 'TSInterfaceDeclaration'].includes(node.declaration.type) || isTypeVariableDecl);
}
if ('declarations' in node.declaration &&
node.declaration.declarations != null) {
for (const declaration of node.declaration.declarations) {
recursivePatternCapture(declaration.id, v => {
addNamed(v.name, v, parent, isTypeVariableDecl);
});
}
}
},
ExportAllDeclaration(node) {
if (node.source == null) {
return;
}
if (node.exported && node.exported.name) {
return;
}
const remoteExports = ExportMap.get(node.source.value, context);
if (remoteExports == null) {
return;
}
if (remoteExports.errors.length > 0) {
remoteExports.reportErrors(context, node);
return;
}
const parent = getParent(node);
let any = false;
remoteExports.$forEach((_, name) => {
if (name !== 'default') {
any = true;
addNamed(name, node, parent);
}
});
if (!any) {
context.report({
node: node.source,
messageId: 'noNamed',
data: { module: node.source.value },
});
}
},
'Program:exit'() {
for (const [, named] of namespace) {
for (const [name, nodes] of named) {
if (nodes.size === 0) {
continue;
}
removeTypescriptFunctionOverloads(nodes);
if (nodes.size <= 1) {
continue;
}
if (isTypescriptNamespaceMerging(nodes)) {
continue;
}
for (const node of nodes) {
if (shouldSkipTypescriptNamespace(node, nodes)) {
continue;
}
if (name === 'default') {
context.report({
node,
messageId: 'multiDefault',
});
}
else {
context.report({
node,
messageId: 'multiNamed',
data: {
name: name.replace(tsTypePrefix, ''),
},
});
}
}
}
}
},
};
},
});
//# sourceMappingURL=export.js.map
@@ -0,0 +1 @@
{"version":3,"file":"ClassElementMetadataKind.d.ts","sourceRoot":"","sources":["../../../../src/metadata/models/ClassElementMetadataKind.ts"],"names":[],"mappings":"AAAA,oBAAY,wBAAwB;IAClC,iBAAiB,IAAI;IACrB,eAAe,IAAI;IACnB,SAAS,IAAI;CACd"}
@@ -0,0 +1 @@
{"version":3,"file":"isString.d.ts","sourceRoot":"","sources":["../../src/utils/isString.ts"],"names":[],"mappings":"yBAAgB,OAAO,OAAO,KAAG,KAAK,IAAI,MAAM;AAAhD,wBAA8E"}
@@ -0,0 +1,371 @@
import * as DevTools from '@internal/devtoolsExtension'
import type { Middleware, StoreEnhancer } from '@reduxjs/toolkit'
import { Tuple } from '@reduxjs/toolkit'
import type * as Redux from 'redux'
import { vi } from 'vitest'
vi.doMock('redux', async (importOriginal) => {
const redux = await importOriginal<typeof import('redux')>()
vi.spyOn(redux, 'applyMiddleware')
vi.spyOn(redux, 'combineReducers')
vi.spyOn(redux, 'compose')
vi.spyOn(redux, 'createStore')
return redux
})
describe('configureStore', async () => {
const composeWithDevToolsSpy = vi.spyOn(DevTools, 'composeWithDevTools')
const redux = await import('redux')
const { configureStore } = await import('@reduxjs/toolkit')
const reducer: Redux.Reducer = (state = {}, _action) => state
beforeEach(() => {
vi.clearAllMocks()
})
describe('given a function reducer', () => {
it('calls createStore with the reducer', () => {
configureStore({ reducer })
expect(configureStore({ reducer })).toBeInstanceOf(Object)
expect(redux.createStore).toHaveBeenCalledWith(
reducer,
undefined,
expect.any(Function),
)
expect(redux.applyMiddleware).toHaveBeenCalled()
if (process.env.TEST_DIST) {
expect(composeWithDevToolsSpy).not.toHaveBeenCalled()
} else {
expect(composeWithDevToolsSpy).toHaveBeenCalledTimes(2)
}
})
})
describe('given an object of reducers', () => {
it('calls createStore with the combined reducers', () => {
const reducer = {
reducer() {
return true
},
}
expect(configureStore({ reducer })).toBeInstanceOf(Object)
expect(redux.combineReducers).toHaveBeenCalledWith(reducer)
expect(redux.applyMiddleware).toHaveBeenCalled()
if (process.env.TEST_DIST) {
expect(composeWithDevToolsSpy).not.toHaveBeenCalled()
} else {
expect(composeWithDevToolsSpy).toHaveBeenCalledOnce()
}
expect(redux.createStore).toHaveBeenCalledWith(
expect.any(Function),
undefined,
expect.any(Function),
)
})
})
describe('given no reducer', () => {
it('throws', () => {
expect(configureStore).toThrow(
'`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers',
)
})
})
describe('given no middleware', () => {
it('calls createStore without any middleware', () => {
expect(
configureStore({ middleware: () => new Tuple(), reducer }),
).toBeInstanceOf(Object)
expect(redux.applyMiddleware).toHaveBeenCalledWith()
if (process.env.TEST_DIST) {
expect(composeWithDevToolsSpy).not.toHaveBeenCalled()
} else {
expect(composeWithDevToolsSpy).toHaveBeenCalledOnce()
}
expect(redux.createStore).toHaveBeenCalledWith(
reducer,
undefined,
expect.any(Function),
)
})
})
describe('given an array of middleware', () => {
it('throws an error requiring a callback', () => {
// @ts-expect-error
expect(() => configureStore({ middleware: [], reducer })).toThrow(
'`middleware` field must be a callback',
)
})
})
describe('given undefined middleware', () => {
it('calls createStore with default middleware', () => {
expect(configureStore({ middleware: undefined, reducer })).toBeInstanceOf(
Object,
)
expect(redux.applyMiddleware).toHaveBeenCalledWith(
expect.any(Function), // immutableCheck
expect.any(Function), // thunk
expect.any(Function), // serializableCheck
expect.any(Function), // actionCreatorCheck
)
if (process.env.TEST_DIST) {
expect(composeWithDevToolsSpy).not.toHaveBeenCalled()
} else {
expect(composeWithDevToolsSpy).toHaveBeenCalledOnce()
}
expect(redux.createStore).toHaveBeenCalledWith(
reducer,
undefined,
expect.any(Function),
)
})
})
describe('given any middleware', () => {
const exampleMiddleware: Middleware<any, any> = () => (next) => (action) =>
next(action)
it('throws an error by default if there are duplicate middleware', () => {
const makeStore = () => {
return configureStore({
reducer,
middleware: (gDM) =>
gDM().concat(exampleMiddleware, exampleMiddleware),
})
}
expect(makeStore).toThrowError(
'Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.',
)
})
it('does not throw a duplicate middleware error if duplicateMiddlewareCheck is disabled', () => {
const makeStore = () => {
return configureStore({
reducer,
middleware: (gDM) =>
gDM().concat(exampleMiddleware, exampleMiddleware),
duplicateMiddlewareCheck: false,
})
}
expect(makeStore).not.toThrowError()
})
})
describe('given a middleware creation function that returns undefined', () => {
it('throws an error', () => {
const invalidBuilder = vi.fn((getDefaultMiddleware) => undefined as any)
expect(() =>
configureStore({ middleware: invalidBuilder, reducer }),
).toThrow(
'when using a middleware builder function, an array of middleware must be returned',
)
})
})
describe('given a middleware creation function that returns an array with non-functions', () => {
it('throws an error', () => {
const invalidBuilder = vi.fn((getDefaultMiddleware) => [true] as any)
expect(() =>
configureStore({ middleware: invalidBuilder, reducer }),
).toThrow('each middleware provided to configureStore must be a function')
})
})
describe('given custom middleware', () => {
it('calls createStore with custom middleware and without default middleware', () => {
const thank: Redux.Middleware = (_store) => (next) => (action) =>
next(action)
expect(
configureStore({ middleware: () => new Tuple(thank), reducer }),
).toBeInstanceOf(Object)
expect(redux.applyMiddleware).toHaveBeenCalledWith(thank)
if (process.env.TEST_DIST) {
expect(composeWithDevToolsSpy).not.toHaveBeenCalled()
} else {
expect(composeWithDevToolsSpy).toHaveBeenCalledOnce()
}
expect(redux.createStore).toHaveBeenCalledWith(
reducer,
undefined,
expect.any(Function),
)
})
})
describe('middleware builder notation', () => {
it('calls builder, passes getDefaultMiddleware and uses returned middlewares', () => {
const thank = vi.fn(
((_store) => (next) => (action) => 'foobar') as Redux.Middleware,
)
const builder = vi.fn((getDefaultMiddleware) => {
expect(getDefaultMiddleware).toEqual(expect.any(Function))
expect(getDefaultMiddleware()).toEqual(expect.any(Array))
return new Tuple(thank)
})
const store = configureStore({ middleware: builder, reducer })
expect(builder).toHaveBeenCalled()
expect(store.dispatch({ type: 'test' })).toBe('foobar')
})
})
describe('with devTools disabled', () => {
it('calls createStore without devTools enhancer', () => {
expect(configureStore({ devTools: false, reducer })).toBeInstanceOf(
Object,
)
expect(redux.applyMiddleware).toHaveBeenCalled()
expect(redux.compose).toHaveBeenCalled()
expect(redux.createStore).toHaveBeenCalledWith(
reducer,
undefined,
expect.any(Function),
)
})
})
describe('with devTools options', () => {
it('calls createStore with devTools enhancer and option', () => {
const options = {
name: 'myApp',
trace: true,
}
expect(configureStore({ devTools: options, reducer })).toBeInstanceOf(
Object,
)
expect(redux.applyMiddleware).toHaveBeenCalled()
if (process.env.TEST_DIST) {
expect(composeWithDevToolsSpy).not.toHaveBeenCalled()
} else {
expect(composeWithDevToolsSpy).toHaveBeenCalledOnce()
expect(composeWithDevToolsSpy).toHaveBeenLastCalledWith(options)
}
expect(redux.createStore).toHaveBeenCalledWith(
reducer,
undefined,
expect.any(Function),
)
})
})
describe('given preloadedState', () => {
it('calls createStore with preloadedState', () => {
expect(configureStore({ reducer })).toBeInstanceOf(Object)
expect(redux.applyMiddleware).toHaveBeenCalled()
if (process.env.TEST_DIST) {
expect(composeWithDevToolsSpy).not.toHaveBeenCalled()
} else {
expect(composeWithDevToolsSpy).toHaveBeenCalledOnce()
}
expect(redux.createStore).toHaveBeenCalledWith(
reducer,
undefined,
expect.any(Function),
)
})
})
describe('given enhancers', () => {
let dummyEnhancerCalled = false
const dummyEnhancer: StoreEnhancer =
(createStore) => (reducer, preloadedState) => {
dummyEnhancerCalled = true
return createStore(reducer, preloadedState)
}
beforeEach(() => {
dummyEnhancerCalled = false
})
it('calls createStore with enhancers', () => {
expect(
configureStore({
enhancers: (gDE) => gDE().concat(dummyEnhancer),
reducer,
}),
).toBeInstanceOf(Object)
expect(redux.applyMiddleware).toHaveBeenCalled()
if (process.env.TEST_DIST) {
expect(composeWithDevToolsSpy).not.toHaveBeenCalled()
} else {
expect(composeWithDevToolsSpy).toHaveBeenCalledOnce()
}
expect(redux.createStore).toHaveBeenCalledWith(
reducer,
undefined,
expect.any(Function),
)
expect(dummyEnhancerCalled).toBe(true)
})
describe('invalid arguments', () => {
test('enhancers is not a callback', () => {
expect(() => configureStore({ reducer, enhancers: [] as any })).toThrow(
'`enhancers` field must be a callback',
)
})
test('callback fails to return array', () => {
expect(() =>
configureStore({ reducer, enhancers: (() => {}) as any }),
).toThrow('`enhancers` callback must return an array')
})
test('array contains non-function', () => {
expect(() =>
configureStore({ reducer, enhancers: (() => ['']) as any }),
).toThrow('each enhancer provided to configureStore must be a function')
})
})
const consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {})
beforeEach(() => {
consoleSpy.mockClear()
})
afterAll(() => {
consoleSpy.mockRestore()
})
it('warns if middleware enhancer is excluded from final array when middlewares are provided', () => {
const store = configureStore({
reducer,
enhancers: () => new Tuple(dummyEnhancer),
})
expect(dummyEnhancerCalled).toBe(true)
expect(consoleSpy).toHaveBeenCalledWith(
'middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`',
)
})
it("doesn't warn when middleware enhancer is excluded if no middlewares provided", () => {
const store = configureStore({
reducer,
middleware: () => new Tuple(),
enhancers: () => new Tuple(dummyEnhancer),
})
expect(dummyEnhancerCalled).toBe(true)
expect(consoleSpy).not.toHaveBeenCalled()
})
})
})
@@ -0,0 +1,21 @@
(The MIT License)
Copyright (c) Titus Wormer
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,313 @@
import { isJsonObject, typeofJsonValue } from "./json-typings";
import { base64decode } from "./base64";
import { LongType, ScalarType } from "./reflection-info";
import { PbLong, PbULong } from "./pb-long";
import { assert, assertFloat32, assertInt32, assertUInt32 } from "./assert";
import { reflectionLongConvert } from "./reflection-long-convert";
/**
* Reads proto3 messages in canonical JSON format using reflection information.
*
* https://developers.google.com/protocol-buffers/docs/proto3#json
*/
export class ReflectionJsonReader {
constructor(info) {
this.info = info;
}
prepare() {
var _a;
if (this.fMap === undefined) {
this.fMap = {};
const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : [];
for (const field of fieldsInput) {
this.fMap[field.name] = field;
this.fMap[field.jsonName] = field;
this.fMap[field.localName] = field;
}
}
}
// Cannot parse JSON <type of jsonValue> for <type name>#<fieldName>.
assert(condition, fieldName, jsonValue) {
if (!condition) {
let what = typeofJsonValue(jsonValue);
if (what == "number" || what == "boolean")
what = jsonValue.toString();
throw new Error(`Cannot parse JSON ${what} for ${this.info.typeName}#${fieldName}`);
}
}
/**
* Reads a message from canonical JSON format into the target message.
*
* Repeated fields are appended. Map entries are added, overwriting
* existing keys.
*
* If a message field is already present, it will be merged with the
* new data.
*/
read(input, message, options) {
this.prepare();
const oneofsHandled = [];
for (const [jsonKey, jsonValue] of Object.entries(input)) {
const field = this.fMap[jsonKey];
if (!field) {
if (!options.ignoreUnknownFields)
throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${jsonKey}`);
continue;
}
const localName = field.localName;
// handle oneof ADT
let target; // this will be the target for the field value, whether it is member of a oneof or not
if (field.oneof) {
if (jsonValue === null && (field.kind !== 'enum' || field.T()[0] !== 'google.protobuf.NullValue')) {
continue;
}
// since json objects are unordered by specification, it is not possible to take the last of multiple oneofs
if (oneofsHandled.includes(field.oneof))
throw new Error(`Multiple members of the oneof group "${field.oneof}" of ${this.info.typeName} are present in JSON.`);
oneofsHandled.push(field.oneof);
target = message[field.oneof] = {
oneofKind: localName
};
}
else {
target = message;
}
// we have handled oneof above. we just have read the value into `target`.
if (field.kind == 'map') {
if (jsonValue === null) {
continue;
}
// check input
this.assert(isJsonObject(jsonValue), field.name, jsonValue);
// our target to put map entries into
const fieldObj = target[localName];
// read entries
for (const [jsonObjKey, jsonObjValue] of Object.entries(jsonValue)) {
this.assert(jsonObjValue !== null, field.name + " map value", null);
// read value
let val;
switch (field.V.kind) {
case "message":
val = field.V.T().internalJsonRead(jsonObjValue, options);
break;
case "enum":
val = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields);
if (val === false)
continue;
break;
case "scalar":
val = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name);
break;
}
this.assert(val !== undefined, field.name + " map value", jsonObjValue);
// read key
let key = jsonObjKey;
if (field.K == ScalarType.BOOL)
key = key == "true" ? true : key == "false" ? false : key;
key = this.scalar(key, field.K, LongType.STRING, field.name).toString();
fieldObj[key] = val;
}
}
else if (field.repeat) {
if (jsonValue === null)
continue;
// check input
this.assert(Array.isArray(jsonValue), field.name, jsonValue);
// our target to put array entries into
const fieldArr = target[localName];
// read array entries
for (const jsonItem of jsonValue) {
this.assert(jsonItem !== null, field.name, null);
let val;
switch (field.kind) {
case "message":
val = field.T().internalJsonRead(jsonItem, options);
break;
case "enum":
val = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields);
if (val === false)
continue;
break;
case "scalar":
val = this.scalar(jsonItem, field.T, field.L, field.name);
break;
}
this.assert(val !== undefined, field.name, jsonValue);
fieldArr.push(val);
}
}
else {
switch (field.kind) {
case "message":
if (jsonValue === null && field.T().typeName != 'google.protobuf.Value') {
this.assert(field.oneof === undefined, field.name + " (oneof member)", null);
continue;
}
target[localName] = field.T().internalJsonRead(jsonValue, options, target[localName]);
break;
case "enum":
if (jsonValue === null)
continue;
let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields);
if (val === false)
continue;
target[localName] = val;
break;
case "scalar":
if (jsonValue === null)
continue;
target[localName] = this.scalar(jsonValue, field.T, field.L, field.name);
break;
}
}
}
}
/**
* Returns `false` for unrecognized string representations.
*
* google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`).
*/
enum(type, json, fieldName, ignoreUnknownFields) {
if (type[0] == 'google.protobuf.NullValue')
assert(json === null || json === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type[0]} only accepts null.`);
if (json === null)
// we require 0 to be default value for all enums
return 0;
switch (typeof json) {
case "number":
assert(Number.isInteger(json), `Unable to parse field ${this.info.typeName}#${fieldName}, enum can only be integral number, got ${json}.`);
return json;
case "string":
let localEnumName = json;
if (type[2] && json.substring(0, type[2].length) === type[2])
// lookup without the shared prefix
localEnumName = json.substring(type[2].length);
let enumNumber = type[1][localEnumName];
if (typeof enumNumber === 'undefined' && ignoreUnknownFields) {
return false;
}
assert(typeof enumNumber == "number", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type[0]} has no value for "${json}".`);
return enumNumber;
}
assert(false, `Unable to parse field ${this.info.typeName}#${fieldName}, cannot parse enum value from ${typeof json}".`);
}
scalar(json, type, longType, fieldName) {
let e;
try {
switch (type) {
// float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity".
// Either numbers or strings are accepted. Exponent notation is also accepted.
case ScalarType.DOUBLE:
case ScalarType.FLOAT:
if (json === null)
return .0;
if (json === "NaN")
return Number.NaN;
if (json === "Infinity")
return Number.POSITIVE_INFINITY;
if (json === "-Infinity")
return Number.NEGATIVE_INFINITY;
if (json === "") {
e = "empty string";
break;
}
if (typeof json == "string" && json.trim().length !== json.length) {
e = "extra whitespace";
break;
}
if (typeof json != "string" && typeof json != "number") {
break;
}
let float = Number(json);
if (Number.isNaN(float)) {
e = "not a number";
break;
}
if (!Number.isFinite(float)) {
// infinity and -infinity are handled by string representation above, so this is an error
e = "too large or small";
break;
}
if (type == ScalarType.FLOAT)
assertFloat32(float);
return float;
// int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted.
case ScalarType.INT32:
case ScalarType.FIXED32:
case ScalarType.SFIXED32:
case ScalarType.SINT32:
case ScalarType.UINT32:
if (json === null)
return 0;
let int32;
if (typeof json == "number")
int32 = json;
else if (json === "")
e = "empty string";
else if (typeof json == "string") {
if (json.trim().length !== json.length)
e = "extra whitespace";
else
int32 = Number(json);
}
if (int32 === undefined)
break;
if (type == ScalarType.UINT32)
assertUInt32(int32);
else
assertInt32(int32);
return int32;
// int64, fixed64, uint64: JSON value will be a decimal string. Either numbers or strings are accepted.
case ScalarType.INT64:
case ScalarType.SFIXED64:
case ScalarType.SINT64:
if (json === null)
return reflectionLongConvert(PbLong.ZERO, longType);
if (typeof json != "number" && typeof json != "string")
break;
return reflectionLongConvert(PbLong.from(json), longType);
case ScalarType.FIXED64:
case ScalarType.UINT64:
if (json === null)
return reflectionLongConvert(PbULong.ZERO, longType);
if (typeof json != "number" && typeof json != "string")
break;
return reflectionLongConvert(PbULong.from(json), longType);
// bool:
case ScalarType.BOOL:
if (json === null)
return false;
if (typeof json !== "boolean")
break;
return json;
// string:
case ScalarType.STRING:
if (json === null)
return "";
if (typeof json !== "string") {
e = "extra whitespace";
break;
}
try {
encodeURIComponent(json);
}
catch (e) {
e = "invalid UTF8";
break;
}
return json;
// bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings.
// Either standard or URL-safe base64 encoding with/without paddings are accepted.
case ScalarType.BYTES:
if (json === null || json === "")
return new Uint8Array(0);
if (typeof json !== 'string')
break;
return base64decode(json);
}
}
catch (error) {
e = error.message;
}
this.assert(false, fieldName + (e ? " - " + e : ""), json);
}
}
@@ -0,0 +1,14 @@
/**
* Extractor function for a JSXFragment type value node.
*
* Returns self-closing element with correct name.
*/
export default function extractValueFromJSXFragment(value) {
// eslint-disable-next-line global-require
const getValue = require('.').default;
if (value.children.length === 0) {
return '<></>';
}
return `<>${[].concat(value.children).map((x) => getValue(x)).join('')}</>`;
}
@@ -0,0 +1,44 @@
var $g7qpO$reactstatelyutils = require("@react-stately/utils");
var $g7qpO$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, "useToggleState", () => $d84f98b140466b44$export$8042c6c013fd5226);
/*
* 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 $d84f98b140466b44$export$8042c6c013fd5226(props = {}) {
let { isReadOnly: isReadOnly } = props;
// have to provide an empty function so useControlledState doesn't throw a fit
// can't use useControlledState's prop calling because we need the event object from the change
let [isSelected, setSelected] = (0, $g7qpO$reactstatelyutils.useControlledState)(props.isSelected, props.defaultSelected || false, props.onChange);
let [initialValue] = (0, $g7qpO$react.useState)(isSelected);
function updateSelected(value) {
if (!isReadOnly) setSelected(value);
}
function toggleState() {
if (!isReadOnly) setSelected(!isSelected);
}
var _props_defaultSelected;
return {
isSelected: isSelected,
defaultSelected: (_props_defaultSelected = props.defaultSelected) !== null && _props_defaultSelected !== void 0 ? _props_defaultSelected : initialValue,
setSelected: updateSelected,
toggle: toggleState
};
}
//# sourceMappingURL=useToggleState.main.js.map
@@ -0,0 +1,968 @@
/**
* This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for
* Node.js-specific performance measurements.
*
* Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/):
*
* * [High Resolution Time](https://www.w3.org/TR/hr-time-2)
* * [Performance Timeline](https://w3c.github.io/performance-timeline/)
* * [User Timing](https://www.w3.org/TR/user-timing/)
* * [Resource Timing](https://www.w3.org/TR/resource-timing-2/)
*
* ```js
* import { PerformanceObserver, performance } from 'node:perf_hooks';
*
* const obs = new PerformanceObserver((items) => {
* console.log(items.getEntries()[0].duration);
* performance.clearMarks();
* });
* obs.observe({ type: 'measure' });
* performance.measure('Start to Now');
*
* performance.mark('A');
* doSomeLongRunningProcess(() => {
* performance.measure('A to Now', 'A');
*
* performance.mark('B');
* performance.measure('A to B', 'A', 'B');
* });
* ```
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/perf_hooks.js)
*/
declare module "perf_hooks" {
import { AsyncResource } from "node:async_hooks";
type EntryType =
| "dns" // Node.js only
| "function" // Node.js only
| "gc" // Node.js only
| "http2" // Node.js only
| "http" // Node.js only
| "mark" // available on the Web
| "measure" // available on the Web
| "net" // Node.js only
| "node" // Node.js only
| "resource"; // available on the Web
interface NodeGCPerformanceDetail {
/**
* When `performanceEntry.entryType` is equal to 'gc', the `performance.kind` property identifies
* the type of garbage collection operation that occurred.
* See perf_hooks.constants for valid values.
*/
readonly kind: number;
/**
* When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
* property contains additional information about garbage collection operation.
* See perf_hooks.constants for valid values.
*/
readonly flags: number;
}
/**
* The constructor of this class is not exposed to users directly.
* @since v8.5.0
*/
class PerformanceEntry {
protected constructor();
/**
* The total number of milliseconds elapsed for this entry. This value will not
* be meaningful for all Performance Entry types.
* @since v8.5.0
*/
readonly duration: number;
/**
* The name of the performance entry.
* @since v8.5.0
*/
readonly name: string;
/**
* The high resolution millisecond timestamp marking the starting time of the
* Performance Entry.
* @since v8.5.0
*/
readonly startTime: number;
/**
* The type of the performance entry. It may be one of:
*
* * `'node'` (Node.js only)
* * `'mark'` (available on the Web)
* * `'measure'` (available on the Web)
* * `'gc'` (Node.js only)
* * `'function'` (Node.js only)
* * `'http2'` (Node.js only)
* * `'http'` (Node.js only)
* @since v8.5.0
*/
readonly entryType: EntryType;
toJSON(): any;
}
/**
* Exposes marks created via the `Performance.mark()` method.
* @since v18.2.0, v16.17.0
*/
class PerformanceMark extends PerformanceEntry {
readonly detail: any;
readonly duration: 0;
readonly entryType: "mark";
}
/**
* Exposes measures created via the `Performance.measure()` method.
*
* The constructor of this class is not exposed to users directly.
* @since v18.2.0, v16.17.0
*/
class PerformanceMeasure extends PerformanceEntry {
readonly detail: any;
readonly entryType: "measure";
}
interface UVMetrics {
/**
* Number of event loop iterations.
*/
readonly loopCount: number;
/**
* Number of events that have been processed by the event handler.
*/
readonly events: number;
/**
* Number of events that were waiting to be processed when the event provider was called.
*/
readonly eventsWaiting: number;
}
// TODO: PerformanceNodeEntry is missing
/**
* _This property is an extension by Node.js. It is not available in Web browsers._
*
* Provides timing details for Node.js itself. The constructor of this class
* is not exposed to users.
* @since v8.5.0
*/
class PerformanceNodeTiming extends PerformanceEntry {
readonly entryType: "node";
/**
* The high resolution millisecond timestamp at which the Node.js process
* completed bootstrapping. If bootstrapping has not yet finished, the property
* has the value of -1.
* @since v8.5.0
*/
readonly bootstrapComplete: number;
/**
* The high resolution millisecond timestamp at which the Node.js environment was
* initialized.
* @since v8.5.0
*/
readonly environment: number;
/**
* The high resolution millisecond timestamp of the amount of time the event loop
* has been idle within the event loop's event provider (e.g. `epoll_wait`). This
* does not take CPU usage into consideration. If the event loop has not yet
* started (e.g., in the first tick of the main script), the property has the
* value of 0.
* @since v14.10.0, v12.19.0
*/
readonly idleTime: number;
/**
* The high resolution millisecond timestamp at which the Node.js event loop
* exited. If the event loop has not yet exited, the property has the value of -1\.
* It can only have a value of not -1 in a handler of the `'exit'` event.
* @since v8.5.0
*/
readonly loopExit: number;
/**
* The high resolution millisecond timestamp at which the Node.js event loop
* started. If the event loop has not yet started (e.g., in the first tick of the
* main script), the property has the value of -1.
* @since v8.5.0
*/
readonly loopStart: number;
/**
* The high resolution millisecond timestamp at which the Node.js process was initialized.
* @since v8.5.0
*/
readonly nodeStart: number;
/**
* This is a wrapper to the `uv_metrics_info` function.
* It returns the current set of event loop metrics.
*
* It is recommended to use this property inside a function whose execution was
* scheduled using `setImmediate` to avoid collecting metrics before finishing all
* operations scheduled during the current loop iteration.
* @since v22.8.0, v20.18.0
*/
readonly uvMetricsInfo: UVMetrics;
/**
* The high resolution millisecond timestamp at which the V8 platform was
* initialized.
* @since v8.5.0
*/
readonly v8Start: number;
}
interface EventLoopUtilization {
idle: number;
active: number;
utilization: number;
}
/**
* @param utilization1 The result of a previous call to `eventLoopUtilization()`.
* @param utilization2 The result of a previous call to `eventLoopUtilization()` prior to `utilization1`.
*/
type EventLoopUtilityFunction = (
utilization1?: EventLoopUtilization,
utilization2?: EventLoopUtilization,
) => EventLoopUtilization;
interface MarkOptions {
/**
* Additional optional detail to include with the mark.
*/
detail?: unknown | undefined;
/**
* An optional timestamp to be used as the mark time.
* @default `performance.now()`
*/
startTime?: number | undefined;
}
interface MeasureOptions {
/**
* Additional optional detail to include with the mark.
*/
detail?: unknown;
/**
* Duration between start and end times.
*/
duration?: number | undefined;
/**
* Timestamp to be used as the end time, or a string identifying a previously recorded mark.
*/
end?: number | string | undefined;
/**
* Timestamp to be used as the start time, or a string identifying a previously recorded mark.
*/
start?: number | string | undefined;
}
interface TimerifyOptions {
/**
* A histogram object created using `perf_hooks.createHistogram()` that will record runtime
* durations in nanoseconds.
*/
histogram?: RecordableHistogram | undefined;
}
interface Performance {
/**
* If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline.
* If `name` is provided, removes only the named mark.
* @since v8.5.0
*/
clearMarks(name?: string): void;
/**
* If `name` is not provided, removes all `PerformanceMeasure` objects from the Performance Timeline.
* If `name` is provided, removes only the named measure.
* @since v16.7.0
*/
clearMeasures(name?: string): void;
/**
* If `name` is not provided, removes all `PerformanceResourceTiming` objects from the Resource Timeline.
* If `name` is provided, removes only the named resource.
* @since v18.2.0, v16.17.0
*/
clearResourceTimings(name?: string): void;
/**
* eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time.
* It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait).
* No other CPU idle time is taken into consideration.
*/
eventLoopUtilization: EventLoopUtilityFunction;
/**
* Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`.
* If you are only interested in performance entries of certain types or that have certain names, see
* `performance.getEntriesByType()` and `performance.getEntriesByName()`.
* @since v16.7.0
*/
getEntries(): PerformanceEntry[];
/**
* Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
* whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`.
* @param name
* @param type
* @since v16.7.0
*/
getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
/**
* Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
* whose `performanceEntry.entryType` is equal to `type`.
* @param type
* @since v16.7.0
*/
getEntriesByType(type: EntryType): PerformanceEntry[];
/**
* Creates a new `PerformanceMark` entry in the Performance Timeline.
* A `PerformanceMark` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'mark'`,
* and whose `performanceEntry.duration` is always `0`.
* Performance marks are used to mark specific significant moments in the Performance Timeline.
*
* The created `PerformanceMark` entry is put in the global Performance Timeline and can be queried with
* `performance.getEntries`, `performance.getEntriesByName`, and `performance.getEntriesByType`. When the observation is
* performed, the entries should be cleared from the global Performance Timeline manually with `performance.clearMarks`.
* @param name
*/
mark(name: string, options?: MarkOptions): PerformanceMark;
/**
* Creates a new `PerformanceResourceTiming` entry in the Resource Timeline.
* A `PerformanceResourceTiming` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'resource'`.
* Performance resources are used to mark moments in the Resource Timeline.
* @param timingInfo [Fetch Timing Info](https://fetch.spec.whatwg.org/#fetch-timing-info)
* @param requestedUrl The resource url
* @param initiatorType The initiator name, e.g: 'fetch'
* @param global
* @param cacheMode The cache mode must be an empty string ('') or 'local'
* @param bodyInfo [Fetch Response Body Info](https://fetch.spec.whatwg.org/#response-body-info)
* @param responseStatus The response's status code
* @param deliveryType The delivery type. Default: ''.
* @since v18.2.0, v16.17.0
*/
markResourceTiming(
timingInfo: object,
requestedUrl: string,
initiatorType: string,
global: object,
cacheMode: "" | "local",
bodyInfo: object,
responseStatus: number,
deliveryType?: string,
): PerformanceResourceTiming;
/**
* Creates a new PerformanceMeasure entry in the Performance Timeline.
* A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
* and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark.
*
* The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify
* any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist,
* then startMark is set to timeOrigin by default.
*
* The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp
* properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown.
* @param name
* @param startMark
* @param endMark
* @return The PerformanceMeasure entry that was created
*/
measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure;
measure(name: string, options: MeasureOptions): PerformanceMeasure;
/**
* _This property is an extension by Node.js. It is not available in Web browsers._
*
* An instance of the `PerformanceNodeTiming` class that provides performance metrics for specific Node.js operational milestones.
* @since v8.5.0
*/
readonly nodeTiming: PerformanceNodeTiming;
/**
* Returns the current high resolution millisecond timestamp, where 0 represents the start of the current `node` process.
* @since v8.5.0
*/
now(): number;
/**
* Sets the global performance resource timing buffer size to the specified number of "resource" type performance entry objects.
*
* By default the max buffer size is set to 250.
* @since v18.8.0
*/
setResourceTimingBufferSize(maxSize: number): void;
/**
* The [`timeOrigin`](https://w3c.github.io/hr-time/#dom-performance-timeorigin) specifies the high resolution millisecond timestamp
* at which the current `node` process began, measured in Unix time.
* @since v8.5.0
*/
readonly timeOrigin: number;
/**
* _This property is an extension by Node.js. It is not available in Web browsers._
*
* Wraps a function within a new function that measures the running time of the wrapped function.
* A `PerformanceObserver` must be subscribed to the `'function'` event type in order for the timing details to be accessed.
*
* ```js
* import {
* performance,
* PerformanceObserver,
* } from 'node:perf_hooks';
*
* function someFunction() {
* console.log('hello world');
* }
*
* const wrapped = performance.timerify(someFunction);
*
* const obs = new PerformanceObserver((list) => {
* console.log(list.getEntries()[0].duration);
*
* performance.clearMarks();
* performance.clearMeasures();
* obs.disconnect();
* });
* obs.observe({ entryTypes: ['function'] });
*
* // A performance timeline entry will be created
* wrapped();
* ```
*
* If the wrapped function returns a promise, a finally handler will be attached to the promise and the duration will be reported
* once the finally handler is invoked.
* @param fn
*/
timerify<T extends (...params: any[]) => any>(fn: T, options?: TimerifyOptions): T;
/**
* An object which is JSON representation of the performance object. It is similar to
* [`window.performance.toJSON`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/toJSON) in browsers.
* @since v16.1.0
*/
toJSON(): any;
}
class PerformanceObserverEntryList {
/**
* Returns a list of `PerformanceEntry` objects in chronological order
* with respect to `performanceEntry.startTime`.
*
* ```js
* import {
* performance,
* PerformanceObserver,
* } from 'node:perf_hooks';
*
* const obs = new PerformanceObserver((perfObserverList, observer) => {
* console.log(perfObserverList.getEntries());
*
* * [
* * PerformanceEntry {
* * name: 'test',
* * entryType: 'mark',
* * startTime: 81.465639,
* * duration: 0,
* * detail: null
* * },
* * PerformanceEntry {
* * name: 'meow',
* * entryType: 'mark',
* * startTime: 81.860064,
* * duration: 0,
* * detail: null
* * }
* * ]
*
* performance.clearMarks();
* performance.clearMeasures();
* observer.disconnect();
* });
* obs.observe({ type: 'mark' });
*
* performance.mark('test');
* performance.mark('meow');
* ```
* @since v8.5.0
*/
getEntries(): PerformanceEntry[];
/**
* Returns a list of `PerformanceEntry` objects in chronological order
* with respect to `performanceEntry.startTime` whose `performanceEntry.name` is
* equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`.
*
* ```js
* import {
* performance,
* PerformanceObserver,
* } from 'node:perf_hooks';
*
* const obs = new PerformanceObserver((perfObserverList, observer) => {
* console.log(perfObserverList.getEntriesByName('meow'));
*
* * [
* * PerformanceEntry {
* * name: 'meow',
* * entryType: 'mark',
* * startTime: 98.545991,
* * duration: 0,
* * detail: null
* * }
* * ]
*
* console.log(perfObserverList.getEntriesByName('nope')); // []
*
* console.log(perfObserverList.getEntriesByName('test', 'mark'));
*
* * [
* * PerformanceEntry {
* * name: 'test',
* * entryType: 'mark',
* * startTime: 63.518931,
* * duration: 0,
* * detail: null
* * }
* * ]
*
* console.log(perfObserverList.getEntriesByName('test', 'measure')); // []
*
* performance.clearMarks();
* performance.clearMeasures();
* observer.disconnect();
* });
* obs.observe({ entryTypes: ['mark', 'measure'] });
*
* performance.mark('test');
* performance.mark('meow');
* ```
* @since v8.5.0
*/
getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
/**
* Returns a list of `PerformanceEntry` objects in chronological order
* with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` is equal to `type`.
*
* ```js
* import {
* performance,
* PerformanceObserver,
* } from 'node:perf_hooks';
*
* const obs = new PerformanceObserver((perfObserverList, observer) => {
* console.log(perfObserverList.getEntriesByType('mark'));
*
* * [
* * PerformanceEntry {
* * name: 'test',
* * entryType: 'mark',
* * startTime: 55.897834,
* * duration: 0,
* * detail: null
* * },
* * PerformanceEntry {
* * name: 'meow',
* * entryType: 'mark',
* * startTime: 56.350146,
* * duration: 0,
* * detail: null
* * }
* * ]
*
* performance.clearMarks();
* performance.clearMeasures();
* observer.disconnect();
* });
* obs.observe({ type: 'mark' });
*
* performance.mark('test');
* performance.mark('meow');
* ```
* @since v8.5.0
*/
getEntriesByType(type: EntryType): PerformanceEntry[];
}
type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
/**
* @since v8.5.0
*/
class PerformanceObserver extends AsyncResource {
constructor(callback: PerformanceObserverCallback);
/**
* Disconnects the `PerformanceObserver` instance from all notifications.
* @since v8.5.0
*/
disconnect(): void;
/**
* Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes` or `options.type`:
*
* ```js
* import {
* performance,
* PerformanceObserver,
* } from 'node:perf_hooks';
*
* const obs = new PerformanceObserver((list, observer) => {
* // Called once asynchronously. `list` contains three items.
* });
* obs.observe({ type: 'mark' });
*
* for (let n = 0; n < 3; n++)
* performance.mark(`test${n}`);
* ```
* @since v8.5.0
*/
observe(
options:
| {
entryTypes: readonly EntryType[];
buffered?: boolean | undefined;
}
| {
type: EntryType;
buffered?: boolean | undefined;
},
): void;
/**
* @since v16.0.0
* @returns Current list of entries stored in the performance observer, emptying it out.
*/
takeRecords(): PerformanceEntry[];
}
/**
* Provides detailed network timing data regarding the loading of an application's resources.
*
* The constructor of this class is not exposed to users directly.
* @since v18.2.0, v16.17.0
*/
class PerformanceResourceTiming extends PerformanceEntry {
readonly entryType: "resource";
protected constructor();
/**
* The high resolution millisecond timestamp at immediately before dispatching the `fetch`
* request. If the resource is not intercepted by a worker the property will always return 0.
* @since v18.2.0, v16.17.0
*/
readonly workerStart: number;
/**
* The high resolution millisecond timestamp that represents the start time of the fetch which
* initiates the redirect.
* @since v18.2.0, v16.17.0
*/
readonly redirectStart: number;
/**
* The high resolution millisecond timestamp that will be created immediately after receiving
* the last byte of the response of the last redirect.
* @since v18.2.0, v16.17.0
*/
readonly redirectEnd: number;
/**
* The high resolution millisecond timestamp immediately before the Node.js starts to fetch the resource.
* @since v18.2.0, v16.17.0
*/
readonly fetchStart: number;
/**
* The high resolution millisecond timestamp immediately before the Node.js starts the domain name lookup
* for the resource.
* @since v18.2.0, v16.17.0
*/
readonly domainLookupStart: number;
/**
* The high resolution millisecond timestamp representing the time immediately after the Node.js finished
* the domain name lookup for the resource.
* @since v18.2.0, v16.17.0
*/
readonly domainLookupEnd: number;
/**
* The high resolution millisecond timestamp representing the time immediately before Node.js starts to
* establish the connection to the server to retrieve the resource.
* @since v18.2.0, v16.17.0
*/
readonly connectStart: number;
/**
* The high resolution millisecond timestamp representing the time immediately after Node.js finishes
* establishing the connection to the server to retrieve the resource.
* @since v18.2.0, v16.17.0
*/
readonly connectEnd: number;
/**
* The high resolution millisecond timestamp representing the time immediately before Node.js starts the
* handshake process to secure the current connection.
* @since v18.2.0, v16.17.0
*/
readonly secureConnectionStart: number;
/**
* The high resolution millisecond timestamp representing the time immediately before Node.js receives the
* first byte of the response from the server.
* @since v18.2.0, v16.17.0
*/
readonly requestStart: number;
/**
* The high resolution millisecond timestamp representing the time immediately after Node.js receives the
* last byte of the resource or immediately before the transport connection is closed, whichever comes first.
* @since v18.2.0, v16.17.0
*/
readonly responseEnd: number;
/**
* A number representing the size (in octets) of the fetched resource. The size includes the response header
* fields plus the response payload body.
* @since v18.2.0, v16.17.0
*/
readonly transferSize: number;
/**
* A number representing the size (in octets) received from the fetch (HTTP or cache), of the payload body, before
* removing any applied content-codings.
* @since v18.2.0, v16.17.0
*/
readonly encodedBodySize: number;
/**
* A number representing the size (in octets) received from the fetch (HTTP or cache), of the message body, after
* removing any applied content-codings.
* @since v18.2.0, v16.17.0
*/
readonly decodedBodySize: number;
/**
* Returns a `object` that is the JSON representation of the `PerformanceResourceTiming` object
* @since v18.2.0, v16.17.0
*/
toJSON(): any;
}
namespace constants {
const NODE_PERFORMANCE_GC_MAJOR: number;
const NODE_PERFORMANCE_GC_MINOR: number;
const NODE_PERFORMANCE_GC_INCREMENTAL: number;
const NODE_PERFORMANCE_GC_WEAKCB: number;
const NODE_PERFORMANCE_GC_FLAGS_NO: number;
const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number;
const NODE_PERFORMANCE_GC_FLAGS_FORCED: number;
const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number;
const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number;
const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
}
const performance: Performance;
interface EventLoopMonitorOptions {
/**
* The sampling rate in milliseconds.
* Must be greater than zero.
* @default 10
*/
resolution?: number | undefined;
}
interface Histogram {
/**
* The number of samples recorded by the histogram.
* @since v17.4.0, v16.14.0
*/
readonly count: number;
/**
* The number of samples recorded by the histogram.
* v17.4.0, v16.14.0
*/
readonly countBigInt: bigint;
/**
* The number of times the event loop delay exceeded the maximum 1 hour event
* loop delay threshold.
* @since v11.10.0
*/
readonly exceeds: number;
/**
* The number of times the event loop delay exceeded the maximum 1 hour event loop delay threshold.
* @since v17.4.0, v16.14.0
*/
readonly exceedsBigInt: bigint;
/**
* The maximum recorded event loop delay.
* @since v11.10.0
*/
readonly max: number;
/**
* The maximum recorded event loop delay.
* v17.4.0, v16.14.0
*/
readonly maxBigInt: number;
/**
* The mean of the recorded event loop delays.
* @since v11.10.0
*/
readonly mean: number;
/**
* The minimum recorded event loop delay.
* @since v11.10.0
*/
readonly min: number;
/**
* The minimum recorded event loop delay.
* v17.4.0, v16.14.0
*/
readonly minBigInt: bigint;
/**
* Returns the value at the given percentile.
* @since v11.10.0
* @param percentile A percentile value in the range (0, 100].
*/
percentile(percentile: number): number;
/**
* Returns the value at the given percentile.
* @since v17.4.0, v16.14.0
* @param percentile A percentile value in the range (0, 100].
*/
percentileBigInt(percentile: number): bigint;
/**
* Returns a `Map` object detailing the accumulated percentile distribution.
* @since v11.10.0
*/
readonly percentiles: Map<number, number>;
/**
* Returns a `Map` object detailing the accumulated percentile distribution.
* @since v17.4.0, v16.14.0
*/
readonly percentilesBigInt: Map<bigint, bigint>;
/**
* Resets the collected histogram data.
* @since v11.10.0
*/
reset(): void;
/**
* The standard deviation of the recorded event loop delays.
* @since v11.10.0
*/
readonly stddev: number;
}
interface IntervalHistogram extends Histogram {
/**
* Enables the update interval timer. Returns `true` if the timer was
* started, `false` if it was already started.
* @since v11.10.0
*/
enable(): boolean;
/**
* Disables the update interval timer. Returns `true` if the timer was
* stopped, `false` if it was already stopped.
* @since v11.10.0
*/
disable(): boolean;
}
interface RecordableHistogram extends Histogram {
/**
* @since v15.9.0, v14.18.0
* @param val The amount to record in the histogram.
*/
record(val: number | bigint): void;
/**
* Calculates the amount of time (in nanoseconds) that has passed since the
* previous call to `recordDelta()` and records that amount in the histogram.
* @since v15.9.0, v14.18.0
*/
recordDelta(): void;
/**
* Adds the values from `other` to this histogram.
* @since v17.4.0, v16.14.0
*/
add(other: RecordableHistogram): void;
}
/**
* _This property is an extension by Node.js. It is not available in Web browsers._
*
* Creates an `IntervalHistogram` object that samples and reports the event loop
* delay over time. The delays will be reported in nanoseconds.
*
* Using a timer to detect approximate event loop delay works because the
* execution of timers is tied specifically to the lifecycle of the libuv
* event loop. That is, a delay in the loop will cause a delay in the execution
* of the timer, and those delays are specifically what this API is intended to
* detect.
*
* ```js
* import { monitorEventLoopDelay } from 'node:perf_hooks';
* const h = monitorEventLoopDelay({ resolution: 20 });
* h.enable();
* // Do something.
* h.disable();
* console.log(h.min);
* console.log(h.max);
* console.log(h.mean);
* console.log(h.stddev);
* console.log(h.percentiles);
* console.log(h.percentile(50));
* console.log(h.percentile(99));
* ```
* @since v11.10.0
*/
function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram;
interface CreateHistogramOptions {
/**
* The minimum recordable value. Must be an integer value greater than 0.
* @default 1
*/
lowest?: number | bigint | undefined;
/**
* The maximum recordable value. Must be an integer value greater than min.
* @default Number.MAX_SAFE_INTEGER
*/
highest?: number | bigint | undefined;
/**
* The number of accuracy digits. Must be a number between 1 and 5.
* @default 3
*/
figures?: number | undefined;
}
/**
* Returns a `RecordableHistogram`.
* @since v15.9.0, v14.18.0
*/
function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
import {
performance as _performance,
PerformanceEntry as _PerformanceEntry,
PerformanceMark as _PerformanceMark,
PerformanceMeasure as _PerformanceMeasure,
PerformanceObserver as _PerformanceObserver,
PerformanceObserverEntryList as _PerformanceObserverEntryList,
PerformanceResourceTiming as _PerformanceResourceTiming,
} from "perf_hooks";
global {
/**
* `PerformanceEntry` is a global reference for `import { PerformanceEntry } from 'node:perf_hooks'`
* @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceentry
* @since v19.0.0
*/
var PerformanceEntry: typeof globalThis extends {
onmessage: any;
PerformanceEntry: infer T;
} ? T
: typeof _PerformanceEntry;
/**
* `PerformanceMark` is a global reference for `import { PerformanceMark } from 'node:perf_hooks'`
* @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performancemark
* @since v19.0.0
*/
var PerformanceMark: typeof globalThis extends {
onmessage: any;
PerformanceMark: infer T;
} ? T
: typeof _PerformanceMark;
/**
* `PerformanceMeasure` is a global reference for `import { PerformanceMeasure } from 'node:perf_hooks'`
* @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performancemeasure
* @since v19.0.0
*/
var PerformanceMeasure: typeof globalThis extends {
onmessage: any;
PerformanceMeasure: infer T;
} ? T
: typeof _PerformanceMeasure;
/**
* `PerformanceObserver` is a global reference for `import { PerformanceObserver } from 'node:perf_hooks'`
* @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceobserver
* @since v19.0.0
*/
var PerformanceObserver: typeof globalThis extends {
onmessage: any;
PerformanceObserver: infer T;
} ? T
: typeof _PerformanceObserver;
/**
* `PerformanceObserverEntryList` is a global reference for `import { PerformanceObserverEntryList } from 'node:perf_hooks'`
* @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceobserverentrylist
* @since v19.0.0
*/
var PerformanceObserverEntryList: typeof globalThis extends {
onmessage: any;
PerformanceObserverEntryList: infer T;
} ? T
: typeof _PerformanceObserverEntryList;
/**
* `PerformanceResourceTiming` is a global reference for `import { PerformanceResourceTiming } from 'node:perf_hooks'`
* @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceresourcetiming
* @since v19.0.0
*/
var PerformanceResourceTiming: typeof globalThis extends {
onmessage: any;
PerformanceResourceTiming: infer T;
} ? T
: typeof _PerformanceResourceTiming;
/**
* `performance` is a global reference for `import { performance } from 'node:perf_hooks'`
* @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performance
* @since v16.0.0
*/
var performance: typeof globalThis extends {
onmessage: any;
performance: infer T;
} ? T
: typeof _performance;
}
}
declare module "node:perf_hooks" {
export * from "perf_hooks";
}
@@ -0,0 +1,99 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { getSourceCode } = require("eslint-compat-utils")
const { definePatternSearchGenerator } = require("../utils")
const codePointEscapeSearchGenerator =
definePatternSearchGenerator(/\\u\{[0-9a-fA-F]+\}/gu)
/**
* Number to Hex
* @param {number} num number
* @returns {string} hex string
*/
function toHex(num) {
return `0000${num.toString(16).toUpperCase()}`.substr(-4)
}
module.exports = {
meta: {
docs: {
description: "disallow Unicode code point escape sequences.",
category: "ES2015",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-unicode-codepoint-escapes.html",
},
fixable: "code",
messages: {
forbidden:
"ES2015 Unicode code point escape sequences are forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
const sourceCode = getSourceCode(context)
/**
* find code point escape, and report
* @param {Node} node node
* @returns {void}
*/
function findAndReport(node) {
const text = sourceCode.getText(node)
for (const match of codePointEscapeSearchGenerator(text)) {
const start = match.index
const end = start + match[0].length
const range = [start + node.range[0], end + node.range[0]]
context.report({
node,
loc: {
start: sourceCode.getLocFromIndex(range[0]),
end: sourceCode.getLocFromIndex(range[1]),
},
messageId: "forbidden",
fix(fixer) {
const codePointStr = text.slice(start + 3, end - 1)
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint
let codePoint = Number(`0x${codePointStr}`)
let replacement = null
if (codePoint <= 0xffff) {
// BMP code point
replacement = toHex(codePoint)
} else {
// Astral code point; split in surrogate halves
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
codePoint -= 0x10000
const highSurrogate = (codePoint >> 10) + 0xd800
const lowSurrogate = (codePoint % 0x400) + 0xdc00
replacement = `${toHex(highSurrogate)}\\u${toHex(
lowSurrogate,
)}`
}
return fixer.replaceTextRange(
[range[0] + 2, range[1]],
replacement,
)
},
})
}
}
return {
Identifier(node) {
findAndReport(node)
},
Literal(node) {
if (typeof node.value === "string") {
findAndReport(node)
}
},
TemplateElement(node) {
findAndReport(node)
},
}
},
}
@@ -0,0 +1,31 @@
/**
* Creates an array with all falsey values removed. The values `false`, `null`,
* `0`, `""`, `undefined`, and `NaN` are falsey.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to compact.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.compact([0, 1, false, 2, '', 3]);
* // => [1, 2, 3]
*/
function compact(array) {
var index = -1,
length = array == null ? 0 : array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value) {
result[resIndex++] = value;
}
}
return result;
}
export default compact;
@@ -0,0 +1,17 @@
'use strict';
var RequireObjectCoercible = require('es-object-atoms/RequireObjectCoercible');
var callBound = require('call-bound');
var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
var $push = callBound('Array.prototype.push');
module.exports = function entries(O) {
var obj = RequireObjectCoercible(O);
var entrys = [];
for (var key in obj) {
if ($isEnumerable(obj, key)) { // checks own-ness as well
$push(entrys, [key, obj[key]]);
}
}
return entrys;
};
@@ -0,0 +1,23 @@
import addMonths from "./addMonths.mjs";
function monthDiff(a, b) {
const aTime = +a;
const bTime = +b;
if (aTime < bTime) {
return -monthDiff(b, a);
}
const wholeMonthDiff = (b.getFullYear() - a.getFullYear()) * 12 + (b.getMonth() - a.getMonth());
const anchor = +addMonths(new Date(aTime), wholeMonthDiff);
let anchor2;
let adjust;
if (bTime < anchor) {
anchor2 = +addMonths(new Date(aTime), wholeMonthDiff - 1);
adjust = (bTime - anchor) / (anchor - anchor2);
} else {
anchor2 = +addMonths(new Date(aTime), wholeMonthDiff + 1);
adjust = (bTime - anchor) / (anchor2 - anchor);
}
return -(wholeMonthDiff + adjust) || 0;
}
export {
monthDiff as m
};
@@ -0,0 +1,66 @@
"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/clsx.ts
var clsx_exports = {};
__export(clsx_exports, {
clsx: () => clsx
});
module.exports = __toCommonJS(clsx_exports);
function toVal(mix) {
var k, y, str = "";
if (typeof mix === "string" || typeof mix === "number") {
str += mix;
} else if (typeof mix === "object") {
if (Array.isArray(mix)) {
for (k = 0; k < mix.length; k++) {
if (mix[k]) {
if (y = toVal(mix[k])) {
str && (str += " ");
str += y;
}
}
}
} else {
for (k in mix) {
if (mix[k]) {
str && (str += " ");
str += k;
}
}
}
}
return str;
}
function clsx(...args) {
var i = 0, tmp, x, str = "";
while (i < args.length) {
if (tmp = args[i++]) {
if (x = toVal(tmp)) {
str && (str += " ");
str += x;
}
}
}
return str;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
clsx
});
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=proxies.int.spec.d.ts.map
@@ -0,0 +1,32 @@
'use strict';
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
module.exports = {
2: 'need dictionary', /* Z_NEED_DICT 2 */
1: 'stream end', /* Z_STREAM_END 1 */
0: '', /* Z_OK 0 */
'-1': 'file error', /* Z_ERRNO (-1) */
'-2': 'stream error', /* Z_STREAM_ERROR (-2) */
'-3': 'data error', /* Z_DATA_ERROR (-3) */
'-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */
'-5': 'buffer error', /* Z_BUF_ERROR (-5) */
'-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
};
@@ -0,0 +1,61 @@
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*/
"use strict"
const check = require("../util/check-restricted")
const visit = require("../util/visit-import")
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "disallow specified modules when loaded by `require`",
category: "Stylistic Issues",
recommended: false,
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-restricted-import.md",
},
fixable: null,
schema: [
{
type: "array",
items: {
anyOf: [
{ type: "string" },
{
type: "object",
properties: {
name: {
anyOf: [
{ type: "string" },
{
type: "array",
items: { type: "string" },
additionalItems: false,
},
],
},
message: { type: "string" },
},
additionalProperties: false,
required: ["name"],
},
],
},
additionalItems: false,
},
],
messages: {
restricted:
// eslint-disable-next-line @mysticatea/eslint-plugin/report-message-format
"'{{name}}' module is restricted from being used.{{customMessage}}",
},
},
create(context) {
const opts = { includeCore: true }
return visit(context, opts, targets => check(context, targets))
},
}
@@ -0,0 +1,8 @@
# `@peculiar/asn1-cms`
[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/PeculiarVentures/asn1-cms/master/packages/cms/LICENSE.md)
[![npm version](https://badge.fury.io/js/%40peculiar%2Fasn1-cms.svg)](https://badge.fury.io/js/%40peculiar%2Fasn1-cms)
[![NPM](https://nodei.co/npm/@peculiar/asn1-cms.png)](https://nodei.co/npm/@peculiar/asn1-cms/)
[RFC 5652](https://tools.ietf.org/html/rfc5652) Cryptographic Message Syntax (CMS)
@@ -0,0 +1 @@
{"version":3,"file":"DeactivationsService.d.ts","sourceRoot":"","sources":["../../../../src/binding/services/DeactivationsService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,aAAK,wBAAwB;IAC3B,QAAQ,aAAa;IACrB,SAAS,cAAc;CACxB;AAED,MAAM,WAAW,2BAA2B;IAC1C,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IAC7C,CAAC,wBAAwB,CAAC,SAAS,CAAC,EAAE,iBAAiB,CAAC;CACzD;AAED,qBAAa,oBAAqB,YAAW,SAAS,CAAC,oBAAoB,CAAC;;IAQ1E,OAAO;WAqBO,KAAK,CACjB,SAAS,EAAE,MAAM,oBAAoB,GAAG,SAAS,GAChD,oBAAoB;IAIhB,GAAG,CACR,YAAY,EAAE,mBAAmB,EACjC,QAAQ,EAAE,2BAA2B,GACpC,IAAI;IAIA,KAAK,IAAI,oBAAoB;IAS7B,GAAG,CACR,iBAAiB,EAAE,iBAAiB,GACnC,QAAQ,CAAC,mBAAmB,CAAC,GAAG,SAAS;IA2BrC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAO3C,oBAAoB,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI;CAMhE"}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=getServiceFromMaybeLazyServiceIdentifier.spec.d.ts.map
@@ -0,0 +1 @@
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAaM,SAAS,0CAAgB,GAAuF;IACrH,MAAM,SAAqC,CAAA,GAAA,aAAK,EAAK;IACrD,MAAM,aAAoD,CAAA,GAAA,aAAK,EAAE;IAEjE,MAAM,YAAY,CAAA,GAAA,kBAAU,EAC1B,CAAC;QACC,IAAI,OAAO,QAAQ,YAAY;YAC7B,MAAM,cAAc;YACpB,MAAM,aAAa,YAAY;YAC/B,OAAO;gBACL,IAAI,OAAO,eAAe,YACxB;qBAEA,YAAY;YAEhB;QACF,OAAO,IAAI,KAAK;YACd,IAAI,OAAO,GAAG;YACd,OAAO;gBACL,IAAI,OAAO,GAAG;YAChB;QACF;IACF,GACA;QAAC;KAAI;IAGP,OAAO,CAAA,GAAA,cAAM,EACX,IAAO,CAAA;YACL,IAAI,WAAU;gBACZ,OAAO,OAAO,OAAO;YACvB;YACA,IAAI,SAAQ,MAAO;gBACjB,OAAO,OAAO,GAAG;gBACjB,IAAI,WAAW,OAAO,EAAE;oBACtB,WAAW,OAAO;oBAClB,WAAW,OAAO,GAAG;gBACvB;gBAEA,IAAI,SAAS,MACX,WAAW,OAAO,GAAG,UAAU;YAEnC;QACF,CAAA,GACA;QAAC;KAAU;AAEf","sources":["packages/@react-aria/utils/src/useObjectRef.ts"],"sourcesContent":["/*\n * Copyright 2021 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 {MutableRefObject, useCallback, useMemo, useRef} from 'react';\n\n/**\n * Offers an object ref for a given callback ref or an object ref. Especially\n * helfpul when passing forwarded refs (created using `React.forwardRef`) to\n * React Aria hooks.\n *\n * @param ref The original ref intended to be used.\n * @returns An object ref that updates the given ref.\n * @see https://react.dev/reference/react/forwardRef\n */\nexport function useObjectRef<T>(ref?: ((instance: T | null) => (() => void) | void) | MutableRefObject<T | null> | null): MutableRefObject<T | null> {\n const objRef: MutableRefObject<T | null> = useRef<T>(null);\n const cleanupRef: MutableRefObject<(() => void) | void> = useRef(undefined);\n\n const refEffect = useCallback(\n (instance: T | null) => {\n if (typeof ref === 'function') {\n const refCallback = ref;\n const refCleanup = refCallback(instance);\n return () => {\n if (typeof refCleanup === 'function') {\n refCleanup();\n } else {\n refCallback(null);\n }\n };\n } else if (ref) {\n ref.current = instance;\n return () => {\n ref.current = null;\n };\n }\n },\n [ref]\n );\n\n return useMemo(\n () => ({\n get current() {\n return objRef.current;\n },\n set current(value) {\n objRef.current = value;\n if (cleanupRef.current) {\n cleanupRef.current();\n cleanupRef.current = undefined;\n }\n\n if (value != null) {\n cleanupRef.current = refEffect(value);\n }\n }\n }),\n [refEffect]\n );\n}\n"],"names":[],"version":3,"file":"useObjectRef.module.js.map"}
@@ -0,0 +1,275 @@
/**
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { IDisposable } from 'common/Types';
import { ParserState } from 'common/parser/Constants';
/** sequence params serialized to js arrays */
export type ParamsArray = (number | number[])[];
/** Params constructor type. */
export interface IParamsConstructor {
new(maxLength: number, maxSubParamsLength: number): IParams;
/** create params from ParamsArray */
fromArray(values: ParamsArray): IParams;
}
/** Interface of Params storage class. */
export interface IParams {
/** from ctor */
maxLength: number;
maxSubParamsLength: number;
/** param values and its length */
params: Int32Array;
length: number;
/** methods */
clone(): IParams;
toArray(): ParamsArray;
reset(): void;
addParam(value: number): void;
addSubParam(value: number): void;
hasSubParams(idx: number): boolean;
getSubParams(idx: number): Int32Array | null;
getSubParamsAll(): {[idx: number]: Int32Array};
}
/**
* Internal state of EscapeSequenceParser.
* Used as argument of the error handler to allow
* introspection at runtime on parse errors.
* Return it with altered values to recover from
* faulty states (not yet supported).
* Set `abort` to `true` to abort the current parsing.
*/
export interface IParsingState {
// position in parse string
position: number;
// actual character code
code: number;
// current parser state
currentState: ParserState;
// collect buffer with intermediate characters
collect: number;
// params buffer
params: IParams;
// should abort (default: false)
abort: boolean;
}
/**
* Command handler interfaces.
*/
/**
* CSI handler types.
* Note: `params` is borrowed.
*/
export type CsiHandlerType = (params: IParams) => boolean | Promise<boolean>;
export type CsiFallbackHandlerType = (ident: number, params: IParams) => void;
/**
* DCS handler types.
*/
export interface IDcsHandler {
/**
* Called when a DCS command starts.
* Prepare needed data structures here.
* Note: `params` is borrowed.
*/
hook(params: IParams): void;
/**
* Incoming payload chunk.
* Note: `params` is borrowed.
*/
put(data: Uint32Array, start: number, end: number): void;
/**
* End of DCS command. `success` indicates whether the
* command finished normally or got aborted, thus final
* execution of the command should depend on `success`.
* To save memory also cleanup data structures here.
*/
unhook(success: boolean): boolean | Promise<boolean>;
}
export type DcsFallbackHandlerType = (ident: number, action: 'HOOK' | 'PUT' | 'UNHOOK', payload?: any) => void;
/**
* ESC handler types.
*/
export type EscHandlerType = () => boolean | Promise<boolean>;
export type EscFallbackHandlerType = (identifier: number) => void;
/**
* EXECUTE handler types.
*/
export type ExecuteHandlerType = () => boolean;
export type ExecuteFallbackHandlerType = (ident: number) => void;
/**
* OSC handler types.
*/
export interface IOscHandler {
/**
* Announces start of this OSC command.
* Prepare needed data structures here.
*/
start(): void;
/**
* Incoming data chunk.
* Note: Data is borrowed.
*/
put(data: Uint32Array, start: number, end: number): void;
/**
* End of OSC command. `success` indicates whether the
* command finished normally or got aborted, thus final
* execution of the command should depend on `success`.
* To save memory also cleanup data structures here.
*/
end(success: boolean): boolean | Promise<boolean>;
}
export type OscFallbackHandlerType = (ident: number, action: 'START' | 'PUT' | 'END', payload?: any) => void;
/**
* PRINT handler types.
*/
export type PrintHandlerType = (data: Uint32Array, start: number, end: number) => void;
export type PrintFallbackHandlerType = PrintHandlerType;
/**
* EscapeSequenceParser interface.
*/
export interface IEscapeSequenceParser extends IDisposable {
/**
* Preceding grapheme-join-state.
* Used for joining grapheme clusters across calls to `print`.
* Also used by REP to check if repeating a character is allowed.
* It gets reset by the parser for any valid sequence besides text.
*/
precedingJoinState: number; // More specifically: UnicodeJoinProperties
/**
* Reset the parser to its initial state (handlers are kept).
*/
reset(): void;
/**
* Parse UTF32 codepoints in `data` up to `length`.
* @param data The data to parse.
*/
parse(data: Uint32Array, length: number, promiseResult?: boolean): void | Promise<boolean>;
/**
* Get string from numercial function identifier `ident`.
* Useful in fallback handlers which expose the low level
* numcerical function identifier for debugging purposes.
* Note: A full back translation to `IFunctionIdentifier`
* is not implemented.
*/
identToString(ident: number): string;
setPrintHandler(handler: PrintHandlerType): void;
clearPrintHandler(): void;
registerEscHandler(id: IFunctionIdentifier, handler: EscHandlerType): IDisposable;
clearEscHandler(id: IFunctionIdentifier): void;
setEscHandlerFallback(handler: EscFallbackHandlerType): void;
setExecuteHandler(flag: string, handler: ExecuteHandlerType): void;
clearExecuteHandler(flag: string): void;
setExecuteHandlerFallback(handler: ExecuteFallbackHandlerType): void;
registerCsiHandler(id: IFunctionIdentifier, handler: CsiHandlerType): IDisposable;
clearCsiHandler(id: IFunctionIdentifier): void;
setCsiHandlerFallback(callback: CsiFallbackHandlerType): void;
registerDcsHandler(id: IFunctionIdentifier, handler: IDcsHandler): IDisposable;
clearDcsHandler(id: IFunctionIdentifier): void;
setDcsHandlerFallback(handler: DcsFallbackHandlerType): void;
registerOscHandler(ident: number, handler: IOscHandler): IDisposable;
clearOscHandler(ident: number): void;
setOscHandlerFallback(handler: OscFallbackHandlerType): void;
setErrorHandler(handler: (state: IParsingState) => IParsingState): void;
clearErrorHandler(): void;
}
/**
* Subparser interfaces.
* The subparsers are instantiated in `EscapeSequenceParser` and
* called during `EscapeSequenceParser.parse`.
*/
export interface ISubParser<T, U> extends IDisposable {
reset(): void;
registerHandler(ident: number, handler: T): IDisposable;
clearHandler(ident: number): void;
setHandlerFallback(handler: U): void;
put(data: Uint32Array, start: number, end: number): void;
}
export interface IOscParser extends ISubParser<IOscHandler, OscFallbackHandlerType> {
start(): void;
end(success: boolean, promiseResult?: boolean): void | Promise<boolean>;
}
export interface IDcsParser extends ISubParser<IDcsHandler, DcsFallbackHandlerType> {
hook(ident: number, params: IParams): void;
unhook(success: boolean, promiseResult?: boolean): void | Promise<boolean>;
}
/**
* Interface to denote a specific ESC, CSI or DCS handler slot.
* The values are used to create an integer respresentation during handler
* regristation before passed to the subparsers as `ident`.
* The integer translation is made to allow a faster handler access
* in `EscapeSequenceParser.parse`.
*/
export interface IFunctionIdentifier {
prefix?: string;
intermediates?: string;
final: string;
}
export interface IHandlerCollection<T> {
[key: string]: T[];
}
/**
* Types for async parser support.
*/
// type of saved stack state in parser
export const enum ParserStackType {
NONE = 0,
FAIL,
RESET,
CSI,
ESC,
OSC,
DCS
}
// aggregate of resumable handler lists
export type ResumableHandlersType = CsiHandlerType[] | EscHandlerType[];
// saved stack state of the parser
export interface IParserStackState {
state: ParserStackType;
handlers: ResumableHandlersType;
handlerPos: number;
transition: number;
chunkPos: number;
}
// saved stack state of subparser (OSC and DCS)
export interface ISubParserStackState {
paused: boolean;
loopPosition: number;
fallThrough: boolean;
}
@@ -0,0 +1,5 @@
'use strict';
module.exports = function isPropertyKey(argument) {
return typeof argument === 'string' || typeof argument === 'symbol';
};
@@ -0,0 +1,25 @@
/**
Extracts the type of the last element of an array.
Use-case: Defining the return type of functions that extract the last element of an array, for example [`lodash.last`](https://lodash.com/docs/4.17.15#last).
@example
```
import {LastArrayElement} from 'type-fest';
declare function lastOf<V extends any[]>(array: V): LastArrayElement<V>;
const array = ['foo', 2];
typeof lastOf(array);
//=> number
```
@category Template Literals
*/
export type LastArrayElement<ValueType extends unknown[]> =
ValueType extends [infer ElementType]
? ElementType
: ValueType extends [infer _, ...infer Tail]
? LastArrayElement<Tail>
: never;
@@ -0,0 +1,357 @@
import { TokenType as tt} from "./parser/tokenizer/types";
import isAsyncOperation from "./util/isAsyncOperation";
export default class TokenProcessor {
__init() {this.resultCode = ""}
// Array mapping input token index to optional string index position in the
// output code.
__init2() {this.resultMappings = new Array(this.tokens.length)}
__init3() {this.tokenIndex = 0}
constructor(
code,
tokens,
isFlowEnabled,
disableESTransforms,
helperManager,
) {;this.code = code;this.tokens = tokens;this.isFlowEnabled = isFlowEnabled;this.disableESTransforms = disableESTransforms;this.helperManager = helperManager;TokenProcessor.prototype.__init.call(this);TokenProcessor.prototype.__init2.call(this);TokenProcessor.prototype.__init3.call(this);}
/**
* Snapshot the token state in a way that can be restored later, useful for
* things like lookahead.
*
* resultMappings do not need to be copied since in all use cases, they will
* be overwritten anyway after restore.
*/
snapshot() {
return {
resultCode: this.resultCode,
tokenIndex: this.tokenIndex,
};
}
restoreToSnapshot(snapshot) {
this.resultCode = snapshot.resultCode;
this.tokenIndex = snapshot.tokenIndex;
}
/**
* Remove and return the code generated since the snapshot, leaving the
* current token position in-place. Unlike most TokenProcessor operations,
* this operation can result in input/output line number mismatches because
* the removed code may contain newlines, so this operation should be used
* sparingly.
*/
dangerouslyGetAndRemoveCodeSinceSnapshot(snapshot) {
const result = this.resultCode.slice(snapshot.resultCode.length);
this.resultCode = snapshot.resultCode;
return result;
}
reset() {
this.resultCode = "";
this.resultMappings = new Array(this.tokens.length);
this.tokenIndex = 0;
}
matchesContextualAtIndex(index, contextualKeyword) {
return (
this.matches1AtIndex(index, tt.name) &&
this.tokens[index].contextualKeyword === contextualKeyword
);
}
identifierNameAtIndex(index) {
// TODO: We need to process escapes since technically you can have unicode escapes in variable
// names.
return this.identifierNameForToken(this.tokens[index]);
}
identifierNameAtRelativeIndex(relativeIndex) {
return this.identifierNameForToken(this.tokenAtRelativeIndex(relativeIndex));
}
identifierName() {
return this.identifierNameForToken(this.currentToken());
}
identifierNameForToken(token) {
return this.code.slice(token.start, token.end);
}
rawCodeForToken(token) {
return this.code.slice(token.start, token.end);
}
stringValueAtIndex(index) {
return this.stringValueForToken(this.tokens[index]);
}
stringValue() {
return this.stringValueForToken(this.currentToken());
}
stringValueForToken(token) {
// This is used to identify when two imports are the same and to resolve TypeScript enum keys.
// Ideally we'd process escapes within the strings, but for now we pretty much take the raw
// code.
return this.code.slice(token.start + 1, token.end - 1);
}
matches1AtIndex(index, t1) {
return this.tokens[index].type === t1;
}
matches2AtIndex(index, t1, t2) {
return this.tokens[index].type === t1 && this.tokens[index + 1].type === t2;
}
matches3AtIndex(index, t1, t2, t3) {
return (
this.tokens[index].type === t1 &&
this.tokens[index + 1].type === t2 &&
this.tokens[index + 2].type === t3
);
}
matches1(t1) {
return this.tokens[this.tokenIndex].type === t1;
}
matches2(t1, t2) {
return this.tokens[this.tokenIndex].type === t1 && this.tokens[this.tokenIndex + 1].type === t2;
}
matches3(t1, t2, t3) {
return (
this.tokens[this.tokenIndex].type === t1 &&
this.tokens[this.tokenIndex + 1].type === t2 &&
this.tokens[this.tokenIndex + 2].type === t3
);
}
matches4(t1, t2, t3, t4) {
return (
this.tokens[this.tokenIndex].type === t1 &&
this.tokens[this.tokenIndex + 1].type === t2 &&
this.tokens[this.tokenIndex + 2].type === t3 &&
this.tokens[this.tokenIndex + 3].type === t4
);
}
matches5(t1, t2, t3, t4, t5) {
return (
this.tokens[this.tokenIndex].type === t1 &&
this.tokens[this.tokenIndex + 1].type === t2 &&
this.tokens[this.tokenIndex + 2].type === t3 &&
this.tokens[this.tokenIndex + 3].type === t4 &&
this.tokens[this.tokenIndex + 4].type === t5
);
}
matchesContextual(contextualKeyword) {
return this.matchesContextualAtIndex(this.tokenIndex, contextualKeyword);
}
matchesContextIdAndLabel(type, contextId) {
return this.matches1(type) && this.currentToken().contextId === contextId;
}
previousWhitespaceAndComments() {
let whitespaceAndComments = this.code.slice(
this.tokenIndex > 0 ? this.tokens[this.tokenIndex - 1].end : 0,
this.tokenIndex < this.tokens.length ? this.tokens[this.tokenIndex].start : this.code.length,
);
if (this.isFlowEnabled) {
whitespaceAndComments = whitespaceAndComments.replace(/@flow/g, "");
}
return whitespaceAndComments;
}
replaceToken(newCode) {
this.resultCode += this.previousWhitespaceAndComments();
this.appendTokenPrefix();
this.resultMappings[this.tokenIndex] = this.resultCode.length;
this.resultCode += newCode;
this.appendTokenSuffix();
this.tokenIndex++;
}
replaceTokenTrimmingLeftWhitespace(newCode) {
this.resultCode += this.previousWhitespaceAndComments().replace(/[^\r\n]/g, "");
this.appendTokenPrefix();
this.resultMappings[this.tokenIndex] = this.resultCode.length;
this.resultCode += newCode;
this.appendTokenSuffix();
this.tokenIndex++;
}
removeInitialToken() {
this.replaceToken("");
}
removeToken() {
this.replaceTokenTrimmingLeftWhitespace("");
}
/**
* Remove all code until the next }, accounting for balanced braces.
*/
removeBalancedCode() {
let braceDepth = 0;
while (!this.isAtEnd()) {
if (this.matches1(tt.braceL)) {
braceDepth++;
} else if (this.matches1(tt.braceR)) {
if (braceDepth === 0) {
return;
}
braceDepth--;
}
this.removeToken();
}
}
copyExpectedToken(tokenType) {
if (this.tokens[this.tokenIndex].type !== tokenType) {
throw new Error(`Expected token ${tokenType}`);
}
this.copyToken();
}
copyToken() {
this.resultCode += this.previousWhitespaceAndComments();
this.appendTokenPrefix();
this.resultMappings[this.tokenIndex] = this.resultCode.length;
this.resultCode += this.code.slice(
this.tokens[this.tokenIndex].start,
this.tokens[this.tokenIndex].end,
);
this.appendTokenSuffix();
this.tokenIndex++;
}
copyTokenWithPrefix(prefix) {
this.resultCode += this.previousWhitespaceAndComments();
this.appendTokenPrefix();
this.resultCode += prefix;
this.resultMappings[this.tokenIndex] = this.resultCode.length;
this.resultCode += this.code.slice(
this.tokens[this.tokenIndex].start,
this.tokens[this.tokenIndex].end,
);
this.appendTokenSuffix();
this.tokenIndex++;
}
appendTokenPrefix() {
const token = this.currentToken();
if (token.numNullishCoalesceStarts || token.isOptionalChainStart) {
token.isAsyncOperation = isAsyncOperation(this);
}
if (this.disableESTransforms) {
return;
}
if (token.numNullishCoalesceStarts) {
for (let i = 0; i < token.numNullishCoalesceStarts; i++) {
if (token.isAsyncOperation) {
this.resultCode += "await ";
this.resultCode += this.helperManager.getHelperName("asyncNullishCoalesce");
} else {
this.resultCode += this.helperManager.getHelperName("nullishCoalesce");
}
this.resultCode += "(";
}
}
if (token.isOptionalChainStart) {
if (token.isAsyncOperation) {
this.resultCode += "await ";
}
if (this.tokenIndex > 0 && this.tokenAtRelativeIndex(-1).type === tt._delete) {
if (token.isAsyncOperation) {
this.resultCode += this.helperManager.getHelperName("asyncOptionalChainDelete");
} else {
this.resultCode += this.helperManager.getHelperName("optionalChainDelete");
}
} else if (token.isAsyncOperation) {
this.resultCode += this.helperManager.getHelperName("asyncOptionalChain");
} else {
this.resultCode += this.helperManager.getHelperName("optionalChain");
}
this.resultCode += "([";
}
}
appendTokenSuffix() {
const token = this.currentToken();
if (token.isOptionalChainEnd && !this.disableESTransforms) {
this.resultCode += "])";
}
if (token.numNullishCoalesceEnds && !this.disableESTransforms) {
for (let i = 0; i < token.numNullishCoalesceEnds; i++) {
this.resultCode += "))";
}
}
}
appendCode(code) {
this.resultCode += code;
}
currentToken() {
return this.tokens[this.tokenIndex];
}
currentTokenCode() {
const token = this.currentToken();
return this.code.slice(token.start, token.end);
}
tokenAtRelativeIndex(relativeIndex) {
return this.tokens[this.tokenIndex + relativeIndex];
}
currentIndex() {
return this.tokenIndex;
}
/**
* Move to the next token. Only suitable in preprocessing steps. When
* generating new code, you should use copyToken or removeToken.
*/
nextToken() {
if (this.tokenIndex === this.tokens.length) {
throw new Error("Unexpectedly reached end of input.");
}
this.tokenIndex++;
}
previousToken() {
this.tokenIndex--;
}
finish() {
if (this.tokenIndex !== this.tokens.length) {
throw new Error("Tried to finish processing tokens before reaching the end.");
}
this.resultCode += this.previousWhitespaceAndComments();
return {code: this.resultCode, mappings: this.resultMappings};
}
isAtEnd() {
return this.tokenIndex === this.tokens.length;
}
}
@@ -0,0 +1,237 @@
# fill-range [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/fill-range.svg?style=flat)](https://www.npmjs.com/package/fill-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![NPM total downloads](https://img.shields.io/npm/dt/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/fill-range.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/fill-range)
> Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save fill-range
```
## Usage
Expands numbers and letters, optionally using a `step` as the last argument. _(Numbers may be defined as JavaScript numbers or strings)_.
```js
const fill = require('fill-range');
// fill(from, to[, step, options]);
console.log(fill('1', '10')); //=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
console.log(fill('1', '10', { toRegex: true })); //=> [1-9]|10
```
**Params**
* `from`: **{String|Number}** the number or letter to start with
* `to`: **{String|Number}** the number or letter to end with
* `step`: **{String|Number|Object|Function}** Optionally pass a [step](#optionsstep) to use.
* `options`: **{Object|Function}**: See all available [options](#options)
## Examples
By default, an array of values is returned.
**Alphabetical ranges**
```js
console.log(fill('a', 'e')); //=> ['a', 'b', 'c', 'd', 'e']
console.log(fill('A', 'E')); //=> [ 'A', 'B', 'C', 'D', 'E' ]
```
**Numerical ranges**
Numbers can be defined as actual numbers or strings.
```js
console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ]
console.log(fill('1', '5')); //=> [ 1, 2, 3, 4, 5 ]
```
**Negative ranges**
Numbers can be defined as actual numbers or strings.
```js
console.log(fill('-5', '-1')); //=> [ '-5', '-4', '-3', '-2', '-1' ]
console.log(fill('-5', '5')); //=> [ '-5', '-4', '-3', '-2', '-1', '0', '1', '2', '3', '4', '5' ]
```
**Steps (increments)**
```js
// numerical ranges with increments
console.log(fill('0', '25', 4)); //=> [ '0', '4', '8', '12', '16', '20', '24' ]
console.log(fill('0', '25', 5)); //=> [ '0', '5', '10', '15', '20', '25' ]
console.log(fill('0', '25', 6)); //=> [ '0', '6', '12', '18', '24' ]
// alphabetical ranges with increments
console.log(fill('a', 'z', 4)); //=> [ 'a', 'e', 'i', 'm', 'q', 'u', 'y' ]
console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ]
console.log(fill('a', 'z', 6)); //=> [ 'a', 'g', 'm', 's', 'y' ]
```
## Options
### options.step
**Type**: `number` (formatted as a string or number)
**Default**: `undefined`
**Description**: The increment to use for the range. Can be used with letters or numbers.
**Example(s)**
```js
// numbers
console.log(fill('1', '10', 2)); //=> [ '1', '3', '5', '7', '9' ]
console.log(fill('1', '10', 3)); //=> [ '1', '4', '7', '10' ]
console.log(fill('1', '10', 4)); //=> [ '1', '5', '9' ]
// letters
console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ]
console.log(fill('a', 'z', 7)); //=> [ 'a', 'h', 'o', 'v' ]
console.log(fill('a', 'z', 9)); //=> [ 'a', 'j', 's' ]
```
### options.strictRanges
**Type**: `boolean`
**Default**: `false`
**Description**: By default, `null` is returned when an invalid range is passed. Enable this option to throw a `RangeError` on invalid ranges.
**Example(s)**
The following are all invalid:
```js
fill('1.1', '2'); // decimals not supported in ranges
fill('a', '2'); // incompatible range values
fill(1, 10, 'foo'); // invalid "step" argument
```
### options.stringify
**Type**: `boolean`
**Default**: `undefined`
**Description**: Cast all returned values to strings. By default, integers are returned as numbers.
**Example(s)**
```js
console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ]
console.log(fill(1, 5, { stringify: true })); //=> [ '1', '2', '3', '4', '5' ]
```
### options.toRegex
**Type**: `boolean`
**Default**: `undefined`
**Description**: Create a regex-compatible source string, instead of expanding values to an array.
**Example(s)**
```js
// alphabetical range
console.log(fill('a', 'e', { toRegex: true })); //=> '[a-e]'
// alphabetical with step
console.log(fill('a', 'z', 3, { toRegex: true })); //=> 'a|d|g|j|m|p|s|v|y'
// numerical range
console.log(fill('1', '100', { toRegex: true })); //=> '[1-9]|[1-9][0-9]|100'
// numerical range with zero padding
console.log(fill('000001', '100000', { toRegex: true }));
//=> '0{5}[1-9]|0{4}[1-9][0-9]|0{3}[1-9][0-9]{2}|0{2}[1-9][0-9]{3}|0[1-9][0-9]{4}|100000'
```
### options.transform
**Type**: `function`
**Default**: `undefined`
**Description**: Customize each value in the returned array (or [string](#optionstoRegex)). _(you can also pass this function as the last argument to `fill()`)_.
**Example(s)**
```js
// add zero padding
console.log(fill(1, 5, value => String(value).padStart(4, '0')));
//=> ['0001', '0002', '0003', '0004', '0005']
```
## About
<details>
<summary><strong>Contributing</strong></summary>
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
</details>
<details>
<summary><strong>Running Tests</strong></summary>
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
$ npm install && npm test
```
</details>
<details>
<summary><strong>Building docs</strong></summary>
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
To generate the readme, run the following command:
```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```
</details>
### Contributors
| **Commits** | **Contributor** |
| --- | --- |
| 116 | [jonschlinkert](https://github.com/jonschlinkert) |
| 4 | [paulmillr](https://github.com/paulmillr) |
| 2 | [realityking](https://github.com/realityking) |
| 2 | [bluelovers](https://github.com/bluelovers) |
| 1 | [edorivai](https://github.com/edorivai) |
| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
### Author
**Jon Schlinkert**
* [GitHub Profile](https://github.com/jonschlinkert)
* [Twitter Profile](https://twitter.com/jonschlinkert)
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
Please consider supporting me on Patreon, or [start your own Patreon page](https://patreon.com/invite/bxpbvm)!
<a href="https://www.patreon.com/jonschlinkert">
<img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" height="50">
</a>
### License
Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._
@@ -0,0 +1,19 @@
export {
gfmStrikethroughFromMarkdown,
gfmStrikethroughToMarkdown
} from './lib/index.js'
// Add custom data tracked to turn a syntax tree into markdown.
declare module 'mdast-util-to-markdown' {
interface ConstructNameMap {
/**
* Whole strikethrough.
*
* ```markdown
* > | ~~a~~
* ^^^^^
* ```
*/
strikethrough: 'strikethrough'
}
}
@@ -0,0 +1,451 @@
"use strict";
// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script.
module.exports = {
"437": "cp437",
"737": "cp737",
"775": "cp775",
"850": "cp850",
"852": "cp852",
"855": "cp855",
"856": "cp856",
"857": "cp857",
"858": "cp858",
"860": "cp860",
"861": "cp861",
"862": "cp862",
"863": "cp863",
"864": "cp864",
"865": "cp865",
"866": "cp866",
"869": "cp869",
"874": "windows874",
"922": "cp922",
"1046": "cp1046",
"1124": "cp1124",
"1125": "cp1125",
"1129": "cp1129",
"1133": "cp1133",
"1161": "cp1161",
"1162": "cp1162",
"1163": "cp1163",
"1250": "windows1250",
"1251": "windows1251",
"1252": "windows1252",
"1253": "windows1253",
"1254": "windows1254",
"1255": "windows1255",
"1256": "windows1256",
"1257": "windows1257",
"1258": "windows1258",
"28591": "iso88591",
"28592": "iso88592",
"28593": "iso88593",
"28594": "iso88594",
"28595": "iso88595",
"28596": "iso88596",
"28597": "iso88597",
"28598": "iso88598",
"28599": "iso88599",
"28600": "iso885910",
"28601": "iso885911",
"28603": "iso885913",
"28604": "iso885914",
"28605": "iso885915",
"28606": "iso885916",
"windows874": {
"type": "_sbcs",
"chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
},
"win874": "windows874",
"cp874": "windows874",
"windows1250": {
"type": "_sbcs",
"chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
},
"win1250": "windows1250",
"cp1250": "windows1250",
"windows1251": {
"type": "_sbcs",
"chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
},
"win1251": "windows1251",
"cp1251": "windows1251",
"windows1252": {
"type": "_sbcs",
"chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
},
"win1252": "windows1252",
"cp1252": "windows1252",
"windows1253": {
"type": "_sbcs",
"chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"
},
"win1253": "windows1253",
"cp1253": "windows1253",
"windows1254": {
"type": "_sbcs",
"chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
},
"win1254": "windows1254",
"cp1254": "windows1254",
"windows1255": {
"type": "_sbcs",
"chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"
},
"win1255": "windows1255",
"cp1255": "windows1255",
"windows1256": {
"type": "_sbcs",
"chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے"
},
"win1256": "windows1256",
"cp1256": "windows1256",
"windows1257": {
"type": "_sbcs",
"chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙"
},
"win1257": "windows1257",
"cp1257": "windows1257",
"windows1258": {
"type": "_sbcs",
"chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
},
"win1258": "windows1258",
"cp1258": "windows1258",
"iso88591": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
},
"cp28591": "iso88591",
"iso88592": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
},
"cp28592": "iso88592",
"iso88593": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙"
},
"cp28593": "iso88593",
"iso88594": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙"
},
"cp28594": "iso88594",
"iso88595": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ"
},
"cp28595": "iso88595",
"iso88596": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������"
},
"cp28596": "iso88596",
"iso88597": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"
},
"cp28597": "iso88597",
"iso88598": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"
},
"cp28598": "iso88598",
"iso88599": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
},
"cp28599": "iso88599",
"iso885910": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ"
},
"cp28600": "iso885910",
"iso885911": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
},
"cp28601": "iso885911",
"iso885913": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’"
},
"cp28603": "iso885913",
"iso885914": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ"
},
"cp28604": "iso885914",
"iso885915": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
},
"cp28605": "iso885915",
"iso885916": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ"
},
"cp28606": "iso885916",
"cp437": {
"type": "_sbcs",
"chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
},
"ibm437": "cp437",
"csibm437": "cp437",
"cp737": {
"type": "_sbcs",
"chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ "
},
"ibm737": "cp737",
"csibm737": "cp737",
"cp775": {
"type": "_sbcs",
"chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ "
},
"ibm775": "cp775",
"csibm775": "cp775",
"cp850": {
"type": "_sbcs",
"chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "
},
"ibm850": "cp850",
"csibm850": "cp850",
"cp852": {
"type": "_sbcs",
"chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ "
},
"ibm852": "cp852",
"csibm852": "cp852",
"cp855": {
"type": "_sbcs",
"chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ "
},
"ibm855": "cp855",
"csibm855": "cp855",
"cp856": {
"type": "_sbcs",
"chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ "
},
"ibm856": "cp856",
"csibm856": "cp856",
"cp857": {
"type": "_sbcs",
"chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ "
},
"ibm857": "cp857",
"csibm857": "cp857",
"cp858": {
"type": "_sbcs",
"chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "
},
"ibm858": "cp858",
"csibm858": "cp858",
"cp860": {
"type": "_sbcs",
"chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
},
"ibm860": "cp860",
"csibm860": "cp860",
"cp861": {
"type": "_sbcs",
"chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
},
"ibm861": "cp861",
"csibm861": "cp861",
"cp862": {
"type": "_sbcs",
"chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
},
"ibm862": "cp862",
"csibm862": "cp862",
"cp863": {
"type": "_sbcs",
"chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
},
"ibm863": "cp863",
"csibm863": "cp863",
"cp864": {
"type": "_sbcs",
"chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�"
},
"ibm864": "cp864",
"csibm864": "cp864",
"cp865": {
"type": "_sbcs",
"chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
},
"ibm865": "cp865",
"csibm865": "cp865",
"cp866": {
"type": "_sbcs",
"chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "
},
"ibm866": "cp866",
"csibm866": "cp866",
"cp869": {
"type": "_sbcs",
"chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ "
},
"ibm869": "cp869",
"csibm869": "cp869",
"cp922": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"
},
"ibm922": "cp922",
"csibm922": "cp922",
"cp1046": {
"type": "_sbcs",
"chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"
},
"ibm1046": "cp1046",
"csibm1046": "cp1046",
"cp1124": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"
},
"ibm1124": "cp1124",
"csibm1124": "cp1124",
"cp1125": {
"type": "_sbcs",
"chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "
},
"ibm1125": "cp1125",
"csibm1125": "cp1125",
"cp1129": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
},
"ibm1129": "cp1129",
"csibm1129": "cp1129",
"cp1133": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"
},
"ibm1133": "cp1133",
"csibm1133": "cp1133",
"cp1161": {
"type": "_sbcs",
"chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "
},
"ibm1161": "cp1161",
"csibm1161": "cp1161",
"cp1162": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
},
"ibm1162": "cp1162",
"csibm1162": "cp1162",
"cp1163": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
},
"ibm1163": "cp1163",
"csibm1163": "cp1163",
"maccroatian": {
"type": "_sbcs",
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"
},
"maccyrillic": {
"type": "_sbcs",
"chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
},
"macgreek": {
"type": "_sbcs",
"chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�"
},
"maciceland": {
"type": "_sbcs",
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
},
"macroman": {
"type": "_sbcs",
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
},
"macromania": {
"type": "_sbcs",
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
},
"macthai": {
"type": "_sbcs",
"chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����"
},
"macturkish": {
"type": "_sbcs",
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ"
},
"macukraine": {
"type": "_sbcs",
"chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
},
"koi8r": {
"type": "_sbcs",
"chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
},
"koi8u": {
"type": "_sbcs",
"chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
},
"koi8ru": {
"type": "_sbcs",
"chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
},
"koi8t": {
"type": "_sbcs",
"chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
},
"armscii8": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�"
},
"rk1048": {
"type": "_sbcs",
"chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
},
"tcvn": {
"type": "_sbcs",
"chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ"
},
"georgianacademy": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
},
"georgianps": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
},
"pt154": {
"type": "_sbcs",
"chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
},
"viscii": {
"type": "_sbcs",
"chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ"
},
"iso646cn": {
"type": "_sbcs",
"chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"
},
"iso646jp": {
"type": "_sbcs",
"chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"
},
"hproman8": {
"type": "_sbcs",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"
},
"macintosh": {
"type": "_sbcs",
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
},
"ascii": {
"type": "_sbcs",
"chars": "��������������������������������������������������������������������������������������������������������������������������������"
},
"tis620": {
"type": "_sbcs",
"chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
}
}
@@ -0,0 +1,118 @@
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "weekStartData", () => $4d88eff242b38a9e$export$7a5acbd77d414bd9);
/*
* 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.
*/ // Data from https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/weekData.json
// Locales starting on Sunday have been removed for compression.
const $4d88eff242b38a9e$export$7a5acbd77d414bd9 = {
'001': 1,
AD: 1,
AE: 6,
AF: 6,
AI: 1,
AL: 1,
AM: 1,
AN: 1,
AR: 1,
AT: 1,
AU: 1,
AX: 1,
AZ: 1,
BA: 1,
BE: 1,
BG: 1,
BH: 6,
BM: 1,
BN: 1,
BY: 1,
CH: 1,
CL: 1,
CM: 1,
CN: 1,
CR: 1,
CY: 1,
CZ: 1,
DE: 1,
DJ: 6,
DK: 1,
DZ: 6,
EC: 1,
EE: 1,
EG: 6,
ES: 1,
FI: 1,
FJ: 1,
FO: 1,
FR: 1,
GB: 1,
GE: 1,
GF: 1,
GP: 1,
GR: 1,
HR: 1,
HU: 1,
IE: 1,
IQ: 6,
IR: 6,
IS: 1,
IT: 1,
JO: 6,
KG: 1,
KW: 6,
KZ: 1,
LB: 1,
LI: 1,
LK: 1,
LT: 1,
LU: 1,
LV: 1,
LY: 6,
MC: 1,
MD: 1,
ME: 1,
MK: 1,
MN: 1,
MQ: 1,
MV: 5,
MY: 1,
NL: 1,
NO: 1,
NZ: 1,
OM: 6,
PL: 1,
QA: 6,
RE: 1,
RO: 1,
RS: 1,
RU: 1,
SD: 6,
SE: 1,
SI: 1,
SK: 1,
SM: 1,
SY: 6,
TJ: 1,
TM: 1,
TR: 1,
UA: 1,
UY: 1,
UZ: 1,
VA: 1,
VN: 1,
XK: 1
};
//# sourceMappingURL=weekStartData.main.js.map
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=SingleInjectionManagedClassElementMetadata.js.map
@@ -0,0 +1,150 @@
/**
* @fileoverview Rule to disallow whitespace before properties
* @author Kai Cataldo
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "no-whitespace-before-property",
url: "https://eslint.style/rules/no-whitespace-before-property",
},
},
],
},
type: "layout",
docs: {
description: "Disallow whitespace before properties",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-whitespace-before-property",
},
fixable: "whitespace",
schema: [],
messages: {
unexpectedWhitespace:
"Unexpected whitespace before property {{propName}}.",
},
},
create(context) {
const sourceCode = context.sourceCode;
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Reports whitespace before property token
* @param {ASTNode} node the node to report in the event of an error
* @param {Token} leftToken the left token
* @param {Token} rightToken the right token
* @returns {void}
* @private
*/
function reportError(node, leftToken, rightToken) {
context.report({
node,
messageId: "unexpectedWhitespace",
data: {
propName: sourceCode.getText(node.property),
},
fix(fixer) {
let replacementText = "";
if (
!node.computed &&
!node.optional &&
astUtils.isDecimalInteger(node.object)
) {
/*
* If the object is a number literal, fixing it to something like 5.toString() would cause a SyntaxError.
* Don't fix this case.
*/
return null;
}
// Don't fix if comments exist.
if (
sourceCode.commentsExistBetween(leftToken, rightToken)
) {
return null;
}
if (node.optional) {
replacementText = "?.";
} else if (!node.computed) {
replacementText = ".";
}
return fixer.replaceTextRange(
[leftToken.range[1], rightToken.range[0]],
replacementText,
);
},
});
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
MemberExpression(node) {
let rightToken;
let leftToken;
if (!astUtils.isTokenOnSameLine(node.object, node.property)) {
return;
}
if (node.computed) {
rightToken = sourceCode.getTokenBefore(
node.property,
astUtils.isOpeningBracketToken,
);
leftToken = sourceCode.getTokenBefore(
rightToken,
node.optional ? 1 : 0,
);
} else {
rightToken = sourceCode.getFirstToken(node.property);
leftToken = sourceCode.getTokenBefore(rightToken, 1);
}
if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken)) {
reportError(node, leftToken, rightToken);
}
},
};
},
};
@@ -0,0 +1,635 @@
import { Any } from '../any/index.mjs';
import { Function as FunctionType } from '../function/index.mjs';
import { Number } from '../number/index.mjs';
import { String } from '../string/index.mjs';
import { Unknown } from '../unknown/index.mjs';
import { TemplateLiteralToUnion } from '../template-literal/index.mjs';
import { PatternNumberExact, PatternStringExact } from '../patterns/index.mjs';
import { Kind, Hint } from '../symbols/index.mjs';
import { TypeBoxError } from '../error/index.mjs';
import { TypeGuard, ValueGuard } from '../guard/index.mjs';
export class ExtendsResolverError extends TypeBoxError {
}
export var ExtendsResult;
(function (ExtendsResult) {
ExtendsResult[ExtendsResult["Union"] = 0] = "Union";
ExtendsResult[ExtendsResult["True"] = 1] = "True";
ExtendsResult[ExtendsResult["False"] = 2] = "False";
})(ExtendsResult || (ExtendsResult = {}));
// ------------------------------------------------------------------
// IntoBooleanResult
// ------------------------------------------------------------------
// prettier-ignore
function IntoBooleanResult(result) {
return result === ExtendsResult.False ? result : ExtendsResult.True;
}
// ------------------------------------------------------------------
// Throw
// ------------------------------------------------------------------
// prettier-ignore
function Throw(message) {
throw new ExtendsResolverError(message);
}
// ------------------------------------------------------------------
// StructuralRight
// ------------------------------------------------------------------
// prettier-ignore
function IsStructuralRight(right) {
return (TypeGuard.IsNever(right) ||
TypeGuard.IsIntersect(right) ||
TypeGuard.IsUnion(right) ||
TypeGuard.IsUnknown(right) ||
TypeGuard.IsAny(right));
}
// prettier-ignore
function StructuralRight(left, right) {
return (TypeGuard.IsNever(right) ? FromNeverRight(left, right) :
TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) :
TypeGuard.IsUnion(right) ? FromUnionRight(left, right) :
TypeGuard.IsUnknown(right) ? FromUnknownRight(left, right) :
TypeGuard.IsAny(right) ? FromAnyRight(left, right) :
Throw('StructuralRight'));
}
// ------------------------------------------------------------------
// Any
// ------------------------------------------------------------------
// prettier-ignore
function FromAnyRight(left, right) {
return ExtendsResult.True;
}
// prettier-ignore
function FromAny(left, right) {
return (TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) :
(TypeGuard.IsUnion(right) && right.anyOf.some((schema) => TypeGuard.IsAny(schema) || TypeGuard.IsUnknown(schema))) ? ExtendsResult.True :
TypeGuard.IsUnion(right) ? ExtendsResult.Union :
TypeGuard.IsUnknown(right) ? ExtendsResult.True :
TypeGuard.IsAny(right) ? ExtendsResult.True :
ExtendsResult.Union);
}
// ------------------------------------------------------------------
// Array
// ------------------------------------------------------------------
// prettier-ignore
function FromArrayRight(left, right) {
return (TypeGuard.IsUnknown(left) ? ExtendsResult.False :
TypeGuard.IsAny(left) ? ExtendsResult.Union :
TypeGuard.IsNever(left) ? ExtendsResult.True :
ExtendsResult.False);
}
// prettier-ignore
function FromArray(left, right) {
return (TypeGuard.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True :
IsStructuralRight(right) ? StructuralRight(left, right) :
!TypeGuard.IsArray(right) ? ExtendsResult.False :
IntoBooleanResult(Visit(left.items, right.items)));
}
// ------------------------------------------------------------------
// AsyncIterator
// ------------------------------------------------------------------
// prettier-ignore
function FromAsyncIterator(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
!TypeGuard.IsAsyncIterator(right) ? ExtendsResult.False :
IntoBooleanResult(Visit(left.items, right.items)));
}
// ------------------------------------------------------------------
// BigInt
// ------------------------------------------------------------------
// prettier-ignore
function FromBigInt(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
TypeGuard.IsBigInt(right) ? ExtendsResult.True :
ExtendsResult.False);
}
// ------------------------------------------------------------------
// Boolean
// ------------------------------------------------------------------
// prettier-ignore
function FromBooleanRight(left, right) {
return (TypeGuard.IsLiteralBoolean(left) ? ExtendsResult.True :
TypeGuard.IsBoolean(left) ? ExtendsResult.True :
ExtendsResult.False);
}
// prettier-ignore
function FromBoolean(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
TypeGuard.IsBoolean(right) ? ExtendsResult.True :
ExtendsResult.False);
}
// ------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------
// prettier-ignore
function FromConstructor(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
!TypeGuard.IsConstructor(right) ? ExtendsResult.False :
left.parameters.length > right.parameters.length ? ExtendsResult.False :
(!left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True)) ? ExtendsResult.False :
IntoBooleanResult(Visit(left.returns, right.returns)));
}
// ------------------------------------------------------------------
// Date
// ------------------------------------------------------------------
// prettier-ignore
function FromDate(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
TypeGuard.IsDate(right) ? ExtendsResult.True :
ExtendsResult.False);
}
// ------------------------------------------------------------------
// Function
// ------------------------------------------------------------------
// prettier-ignore
function FromFunction(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
!TypeGuard.IsFunction(right) ? ExtendsResult.False :
left.parameters.length > right.parameters.length ? ExtendsResult.False :
(!left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True)) ? ExtendsResult.False :
IntoBooleanResult(Visit(left.returns, right.returns)));
}
// ------------------------------------------------------------------
// Integer
// ------------------------------------------------------------------
// prettier-ignore
function FromIntegerRight(left, right) {
return (TypeGuard.IsLiteral(left) && ValueGuard.IsNumber(left.const) ? ExtendsResult.True :
TypeGuard.IsNumber(left) || TypeGuard.IsInteger(left) ? ExtendsResult.True :
ExtendsResult.False);
}
// prettier-ignore
function FromInteger(left, right) {
return (TypeGuard.IsInteger(right) || TypeGuard.IsNumber(right) ? ExtendsResult.True :
IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
ExtendsResult.False);
}
// ------------------------------------------------------------------
// Intersect
// ------------------------------------------------------------------
// prettier-ignore
function FromIntersectRight(left, right) {
return right.allOf.every((schema) => Visit(left, schema) === ExtendsResult.True)
? ExtendsResult.True
: ExtendsResult.False;
}
// prettier-ignore
function FromIntersect(left, right) {
return left.allOf.some((schema) => Visit(schema, right) === ExtendsResult.True)
? ExtendsResult.True
: ExtendsResult.False;
}
// ------------------------------------------------------------------
// Iterator
// ------------------------------------------------------------------
// prettier-ignore
function FromIterator(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
!TypeGuard.IsIterator(right) ? ExtendsResult.False :
IntoBooleanResult(Visit(left.items, right.items)));
}
// ------------------------------------------------------------------
// Literal
// ------------------------------------------------------------------
// prettier-ignore
function FromLiteral(left, right) {
return (TypeGuard.IsLiteral(right) && right.const === left.const ? ExtendsResult.True :
IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
TypeGuard.IsString(right) ? FromStringRight(left, right) :
TypeGuard.IsNumber(right) ? FromNumberRight(left, right) :
TypeGuard.IsInteger(right) ? FromIntegerRight(left, right) :
TypeGuard.IsBoolean(right) ? FromBooleanRight(left, right) :
ExtendsResult.False);
}
// ------------------------------------------------------------------
// Never
// ------------------------------------------------------------------
// prettier-ignore
function FromNeverRight(left, right) {
return ExtendsResult.False;
}
// prettier-ignore
function FromNever(left, right) {
return ExtendsResult.True;
}
// ------------------------------------------------------------------
// Not
// ------------------------------------------------------------------
// prettier-ignore
function UnwrapTNot(schema) {
let [current, depth] = [schema, 0];
while (true) {
if (!TypeGuard.IsNot(current))
break;
current = current.not;
depth += 1;
}
return depth % 2 === 0 ? current : Unknown();
}
// prettier-ignore
function FromNot(left, right) {
// TypeScript has no concept of negated types, and attempts to correctly check the negated
// type at runtime would put TypeBox at odds with TypeScripts ability to statically infer
// the type. Instead we unwrap to either unknown or T and continue evaluating.
// prettier-ignore
return (TypeGuard.IsNot(left) ? Visit(UnwrapTNot(left), right) :
TypeGuard.IsNot(right) ? Visit(left, UnwrapTNot(right)) :
Throw('Invalid fallthrough for Not'));
}
// ------------------------------------------------------------------
// Null
// ------------------------------------------------------------------
// prettier-ignore
function FromNull(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
TypeGuard.IsNull(right) ? ExtendsResult.True :
ExtendsResult.False);
}
// ------------------------------------------------------------------
// Number
// ------------------------------------------------------------------
// prettier-ignore
function FromNumberRight(left, right) {
return (TypeGuard.IsLiteralNumber(left) ? ExtendsResult.True :
TypeGuard.IsNumber(left) || TypeGuard.IsInteger(left) ? ExtendsResult.True :
ExtendsResult.False);
}
// prettier-ignore
function FromNumber(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
TypeGuard.IsInteger(right) || TypeGuard.IsNumber(right) ? ExtendsResult.True :
ExtendsResult.False);
}
// ------------------------------------------------------------------
// Object
// ------------------------------------------------------------------
// prettier-ignore
function IsObjectPropertyCount(schema, count) {
return Object.getOwnPropertyNames(schema.properties).length === count;
}
// prettier-ignore
function IsObjectStringLike(schema) {
return IsObjectArrayLike(schema);
}
// prettier-ignore
function IsObjectSymbolLike(schema) {
return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'description' in schema.properties && TypeGuard.IsUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && ((TypeGuard.IsString(schema.properties.description.anyOf[0]) &&
TypeGuard.IsUndefined(schema.properties.description.anyOf[1])) || (TypeGuard.IsString(schema.properties.description.anyOf[1]) &&
TypeGuard.IsUndefined(schema.properties.description.anyOf[0]))));
}
// prettier-ignore
function IsObjectNumberLike(schema) {
return IsObjectPropertyCount(schema, 0);
}
// prettier-ignore
function IsObjectBooleanLike(schema) {
return IsObjectPropertyCount(schema, 0);
}
// prettier-ignore
function IsObjectBigIntLike(schema) {
return IsObjectPropertyCount(schema, 0);
}
// prettier-ignore
function IsObjectDateLike(schema) {
return IsObjectPropertyCount(schema, 0);
}
// prettier-ignore
function IsObjectUint8ArrayLike(schema) {
return IsObjectArrayLike(schema);
}
// prettier-ignore
function IsObjectFunctionLike(schema) {
const length = Number();
return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === ExtendsResult.True);
}
// prettier-ignore
function IsObjectConstructorLike(schema) {
return IsObjectPropertyCount(schema, 0);
}
// prettier-ignore
function IsObjectArrayLike(schema) {
const length = Number();
return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === ExtendsResult.True);
}
// prettier-ignore
function IsObjectPromiseLike(schema) {
const then = FunctionType([Any()], Any());
return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'then' in schema.properties && IntoBooleanResult(Visit(schema.properties['then'], then)) === ExtendsResult.True);
}
// ------------------------------------------------------------------
// Property
// ------------------------------------------------------------------
// prettier-ignore
function Property(left, right) {
return (Visit(left, right) === ExtendsResult.False ? ExtendsResult.False :
TypeGuard.IsOptional(left) && !TypeGuard.IsOptional(right) ? ExtendsResult.False :
ExtendsResult.True);
}
// prettier-ignore
function FromObjectRight(left, right) {
return (TypeGuard.IsUnknown(left) ? ExtendsResult.False :
TypeGuard.IsAny(left) ? ExtendsResult.Union : (TypeGuard.IsNever(left) ||
(TypeGuard.IsLiteralString(left) && IsObjectStringLike(right)) ||
(TypeGuard.IsLiteralNumber(left) && IsObjectNumberLike(right)) ||
(TypeGuard.IsLiteralBoolean(left) && IsObjectBooleanLike(right)) ||
(TypeGuard.IsSymbol(left) && IsObjectSymbolLike(right)) ||
(TypeGuard.IsBigInt(left) && IsObjectBigIntLike(right)) ||
(TypeGuard.IsString(left) && IsObjectStringLike(right)) ||
(TypeGuard.IsSymbol(left) && IsObjectSymbolLike(right)) ||
(TypeGuard.IsNumber(left) && IsObjectNumberLike(right)) ||
(TypeGuard.IsInteger(left) && IsObjectNumberLike(right)) ||
(TypeGuard.IsBoolean(left) && IsObjectBooleanLike(right)) ||
(TypeGuard.IsUint8Array(left) && IsObjectUint8ArrayLike(right)) ||
(TypeGuard.IsDate(left) && IsObjectDateLike(right)) ||
(TypeGuard.IsConstructor(left) && IsObjectConstructorLike(right)) ||
(TypeGuard.IsFunction(left) && IsObjectFunctionLike(right))) ? ExtendsResult.True :
(TypeGuard.IsRecord(left) && TypeGuard.IsString(RecordKey(left))) ? (() => {
// When expressing a Record with literal key values, the Record is converted into a Object with
// the Hint assigned as `Record`. This is used to invert the extends logic.
return right[Hint] === 'Record' ? ExtendsResult.True : ExtendsResult.False;
})() :
(TypeGuard.IsRecord(left) && TypeGuard.IsNumber(RecordKey(left))) ? (() => {
return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False;
})() :
ExtendsResult.False);
}
// prettier-ignore
function FromObject(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
!TypeGuard.IsObject(right) ? ExtendsResult.False :
(() => {
for (const key of Object.getOwnPropertyNames(right.properties)) {
if (!(key in left.properties) && !TypeGuard.IsOptional(right.properties[key])) {
return ExtendsResult.False;
}
if (TypeGuard.IsOptional(right.properties[key])) {
return ExtendsResult.True;
}
if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) {
return ExtendsResult.False;
}
}
return ExtendsResult.True;
})());
}
// ------------------------------------------------------------------
// Promise
// ------------------------------------------------------------------
// prettier-ignore
function FromPromise(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) && IsObjectPromiseLike(right) ? ExtendsResult.True :
!TypeGuard.IsPromise(right) ? ExtendsResult.False :
IntoBooleanResult(Visit(left.item, right.item)));
}
// ------------------------------------------------------------------
// Record
// ------------------------------------------------------------------
// prettier-ignore
function RecordKey(schema) {
return (PatternNumberExact in schema.patternProperties ? Number() :
PatternStringExact in schema.patternProperties ? String() :
Throw('Unknown record key pattern'));
}
// prettier-ignore
function RecordValue(schema) {
return (PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] :
PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] :
Throw('Unable to get record value schema'));
}
// prettier-ignore
function FromRecordRight(left, right) {
const [Key, Value] = [RecordKey(right), RecordValue(right)];
return ((TypeGuard.IsLiteralString(left) && TypeGuard.IsNumber(Key) && IntoBooleanResult(Visit(left, Value)) === ExtendsResult.True) ? ExtendsResult.True :
TypeGuard.IsUint8Array(left) && TypeGuard.IsNumber(Key) ? Visit(left, Value) :
TypeGuard.IsString(left) && TypeGuard.IsNumber(Key) ? Visit(left, Value) :
TypeGuard.IsArray(left) && TypeGuard.IsNumber(Key) ? Visit(left, Value) :
TypeGuard.IsObject(left) ? (() => {
for (const key of Object.getOwnPropertyNames(left.properties)) {
if (Property(Value, left.properties[key]) === ExtendsResult.False) {
return ExtendsResult.False;
}
}
return ExtendsResult.True;
})() :
ExtendsResult.False);
}
// prettier-ignore
function FromRecord(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
!TypeGuard.IsRecord(right) ? ExtendsResult.False :
Visit(RecordValue(left), RecordValue(right)));
}
// ------------------------------------------------------------------
// RegExp
// ------------------------------------------------------------------
// prettier-ignore
function FromRegExp(left, right) {
// Note: RegExp types evaluate as strings, not RegExp objects.
// Here we remap either into string and continue evaluating.
const L = TypeGuard.IsRegExp(left) ? String() : left;
const R = TypeGuard.IsRegExp(right) ? String() : right;
return Visit(L, R);
}
// ------------------------------------------------------------------
// String
// ------------------------------------------------------------------
// prettier-ignore
function FromStringRight(left, right) {
return (TypeGuard.IsLiteral(left) && ValueGuard.IsString(left.const) ? ExtendsResult.True :
TypeGuard.IsString(left) ? ExtendsResult.True :
ExtendsResult.False);
}
// prettier-ignore
function FromString(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
TypeGuard.IsString(right) ? ExtendsResult.True :
ExtendsResult.False);
}
// ------------------------------------------------------------------
// Symbol
// ------------------------------------------------------------------
// prettier-ignore
function FromSymbol(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
TypeGuard.IsSymbol(right) ? ExtendsResult.True :
ExtendsResult.False);
}
// ------------------------------------------------------------------
// TemplateLiteral
// ------------------------------------------------------------------
// prettier-ignore
function FromTemplateLiteral(left, right) {
// TemplateLiteral types are resolved to either unions for finite expressions or string
// for infinite expressions. Here we call to TemplateLiteralResolver to resolve for
// either type and continue evaluating.
return (TypeGuard.IsTemplateLiteral(left) ? Visit(TemplateLiteralToUnion(left), right) :
TypeGuard.IsTemplateLiteral(right) ? Visit(left, TemplateLiteralToUnion(right)) :
Throw('Invalid fallthrough for TemplateLiteral'));
}
// ------------------------------------------------------------------
// Tuple
// ------------------------------------------------------------------
// prettier-ignore
function IsArrayOfTuple(left, right) {
return (TypeGuard.IsArray(right) &&
left.items !== undefined &&
left.items.every((schema) => Visit(schema, right.items) === ExtendsResult.True));
}
// prettier-ignore
function FromTupleRight(left, right) {
return (TypeGuard.IsNever(left) ? ExtendsResult.True :
TypeGuard.IsUnknown(left) ? ExtendsResult.False :
TypeGuard.IsAny(left) ? ExtendsResult.Union :
ExtendsResult.False);
}
// prettier-ignore
function FromTuple(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True :
TypeGuard.IsArray(right) && IsArrayOfTuple(left, right) ? ExtendsResult.True :
!TypeGuard.IsTuple(right) ? ExtendsResult.False :
(ValueGuard.IsUndefined(left.items) && !ValueGuard.IsUndefined(right.items)) || (!ValueGuard.IsUndefined(left.items) && ValueGuard.IsUndefined(right.items)) ? ExtendsResult.False :
(ValueGuard.IsUndefined(left.items) && !ValueGuard.IsUndefined(right.items)) ? ExtendsResult.True :
left.items.every((schema, index) => Visit(schema, right.items[index]) === ExtendsResult.True) ? ExtendsResult.True :
ExtendsResult.False);
}
// ------------------------------------------------------------------
// Uint8Array
// ------------------------------------------------------------------
// prettier-ignore
function FromUint8Array(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
TypeGuard.IsUint8Array(right) ? ExtendsResult.True :
ExtendsResult.False);
}
// ------------------------------------------------------------------
// Undefined
// ------------------------------------------------------------------
// prettier-ignore
function FromUndefined(left, right) {
return (IsStructuralRight(right) ? StructuralRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
TypeGuard.IsVoid(right) ? FromVoidRight(left, right) :
TypeGuard.IsUndefined(right) ? ExtendsResult.True :
ExtendsResult.False);
}
// ------------------------------------------------------------------
// Union
// ------------------------------------------------------------------
// prettier-ignore
function FromUnionRight(left, right) {
return right.anyOf.some((schema) => Visit(left, schema) === ExtendsResult.True)
? ExtendsResult.True
: ExtendsResult.False;
}
// prettier-ignore
function FromUnion(left, right) {
return left.anyOf.every((schema) => Visit(schema, right) === ExtendsResult.True)
? ExtendsResult.True
: ExtendsResult.False;
}
// ------------------------------------------------------------------
// Unknown
// ------------------------------------------------------------------
// prettier-ignore
function FromUnknownRight(left, right) {
return ExtendsResult.True;
}
// prettier-ignore
function FromUnknown(left, right) {
return (TypeGuard.IsNever(right) ? FromNeverRight(left, right) :
TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) :
TypeGuard.IsUnion(right) ? FromUnionRight(left, right) :
TypeGuard.IsAny(right) ? FromAnyRight(left, right) :
TypeGuard.IsString(right) ? FromStringRight(left, right) :
TypeGuard.IsNumber(right) ? FromNumberRight(left, right) :
TypeGuard.IsInteger(right) ? FromIntegerRight(left, right) :
TypeGuard.IsBoolean(right) ? FromBooleanRight(left, right) :
TypeGuard.IsArray(right) ? FromArrayRight(left, right) :
TypeGuard.IsTuple(right) ? FromTupleRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
TypeGuard.IsUnknown(right) ? ExtendsResult.True :
ExtendsResult.False);
}
// ------------------------------------------------------------------
// Void
// ------------------------------------------------------------------
// prettier-ignore
function FromVoidRight(left, right) {
return (TypeGuard.IsUndefined(left) ? ExtendsResult.True :
TypeGuard.IsUndefined(left) ? ExtendsResult.True :
ExtendsResult.False);
}
// prettier-ignore
function FromVoid(left, right) {
return (TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) :
TypeGuard.IsUnion(right) ? FromUnionRight(left, right) :
TypeGuard.IsUnknown(right) ? FromUnknownRight(left, right) :
TypeGuard.IsAny(right) ? FromAnyRight(left, right) :
TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
TypeGuard.IsVoid(right) ? ExtendsResult.True :
ExtendsResult.False);
}
// prettier-ignore
function Visit(left, right) {
return (
// resolvable
(TypeGuard.IsTemplateLiteral(left) || TypeGuard.IsTemplateLiteral(right)) ? FromTemplateLiteral(left, right) :
(TypeGuard.IsRegExp(left) || TypeGuard.IsRegExp(right)) ? FromRegExp(left, right) :
(TypeGuard.IsNot(left) || TypeGuard.IsNot(right)) ? FromNot(left, right) :
// standard
TypeGuard.IsAny(left) ? FromAny(left, right) :
TypeGuard.IsArray(left) ? FromArray(left, right) :
TypeGuard.IsBigInt(left) ? FromBigInt(left, right) :
TypeGuard.IsBoolean(left) ? FromBoolean(left, right) :
TypeGuard.IsAsyncIterator(left) ? FromAsyncIterator(left, right) :
TypeGuard.IsConstructor(left) ? FromConstructor(left, right) :
TypeGuard.IsDate(left) ? FromDate(left, right) :
TypeGuard.IsFunction(left) ? FromFunction(left, right) :
TypeGuard.IsInteger(left) ? FromInteger(left, right) :
TypeGuard.IsIntersect(left) ? FromIntersect(left, right) :
TypeGuard.IsIterator(left) ? FromIterator(left, right) :
TypeGuard.IsLiteral(left) ? FromLiteral(left, right) :
TypeGuard.IsNever(left) ? FromNever(left, right) :
TypeGuard.IsNull(left) ? FromNull(left, right) :
TypeGuard.IsNumber(left) ? FromNumber(left, right) :
TypeGuard.IsObject(left) ? FromObject(left, right) :
TypeGuard.IsRecord(left) ? FromRecord(left, right) :
TypeGuard.IsString(left) ? FromString(left, right) :
TypeGuard.IsSymbol(left) ? FromSymbol(left, right) :
TypeGuard.IsTuple(left) ? FromTuple(left, right) :
TypeGuard.IsPromise(left) ? FromPromise(left, right) :
TypeGuard.IsUint8Array(left) ? FromUint8Array(left, right) :
TypeGuard.IsUndefined(left) ? FromUndefined(left, right) :
TypeGuard.IsUnion(left) ? FromUnion(left, right) :
TypeGuard.IsUnknown(left) ? FromUnknown(left, right) :
TypeGuard.IsVoid(left) ? FromVoid(left, right) :
Throw(`Unknown left type operand '${left[Kind]}'`));
}
export function ExtendsCheck(left, right) {
return Visit(left, right);
}
@@ -0,0 +1 @@
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/menu/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useMenuTrigger} from './useMenuTrigger';\nexport {useMenu} from './useMenu';\nexport {useMenuItem} from './useMenuItem';\nexport {useMenuSection} from './useMenuSection';\nexport {useSubmenuTrigger} from './useSubmenuTrigger';\n\nexport type {AriaMenuProps} from '@react-types/menu';\nexport type {AriaMenuTriggerProps, MenuTriggerAria} from './useMenuTrigger';\nexport type {AriaMenuOptions, MenuAria} from './useMenu';\nexport type {AriaMenuItemProps, MenuItemAria} from './useMenuItem';\nexport type {AriaMenuSectionProps, MenuSectionAria} from './useMenuSection';\nexport type {AriaSubmenuTriggerProps, SubmenuTriggerAria} from './useSubmenuTrigger';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,330 @@
var $ee0bdf4faa47f2a8$exports = require("./utils.main.js");
var $a1189052f36475e8$exports = require("./useTypeSelect.main.js");
var $bT8Bh$reactdom = require("react-dom");
var $bT8Bh$react = require("react");
var $bT8Bh$reactariafocus = require("@react-aria/focus");
var $bT8Bh$reactariautils = require("@react-aria/utils");
var $bT8Bh$reactariainteractions = require("@react-aria/interactions");
var $bT8Bh$reactariai18n = require("@react-aria/i18n");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useSelectableCollection", () => $b6837c2f80a3c32f$export$d6daf82dcd84e87c);
/*
* 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 $b6837c2f80a3c32f$export$d6daf82dcd84e87c(options) {
let { selectionManager: manager, keyboardDelegate: delegate, ref: ref, autoFocus: autoFocus = false, shouldFocusWrap: shouldFocusWrap = false, disallowEmptySelection: disallowEmptySelection = false, disallowSelectAll: disallowSelectAll = false, selectOnFocus: selectOnFocus = manager.selectionBehavior === 'replace', disallowTypeAhead: disallowTypeAhead = false, shouldUseVirtualFocus: shouldUseVirtualFocus, allowsTabNavigation: allowsTabNavigation = false, isVirtualized: isVirtualized, scrollRef: // If no scrollRef is provided, assume the collection ref is the scrollable region
scrollRef = ref, linkBehavior: linkBehavior = 'action' } = options;
let { direction: direction } = (0, $bT8Bh$reactariai18n.useLocale)();
let router = (0, $bT8Bh$reactariautils.useRouter)();
let onKeyDown = (e)=>{
var _ref_current;
// Prevent option + tab from doing anything since it doesn't move focus to the cells, only buttons/checkboxes
if (e.altKey && e.key === 'Tab') e.preventDefault();
// Keyboard events bubble through portals. Don't handle keyboard events
// for elements outside the collection (e.g. menus).
if (!((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(e.target))) return;
const navigateToKey = (key, childFocus)=>{
if (key != null) {
if (manager.isLink(key) && linkBehavior === 'selection' && selectOnFocus && !(0, $ee0bdf4faa47f2a8$exports.isNonContiguousSelectionModifier)(e)) {
var _scrollRef_current;
// Set focused key and re-render synchronously to bring item into view if needed.
(0, $bT8Bh$reactdom.flushSync)(()=>{
manager.setFocusedKey(key, childFocus);
});
let item = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.querySelector(`[data-key="${CSS.escape(key.toString())}"]`);
let itemProps = manager.getItemProps(key);
if (item) router.open(item, e, itemProps.href, itemProps.routerOptions);
return;
}
manager.setFocusedKey(key, childFocus);
if (manager.isLink(key) && linkBehavior === 'override') return;
if (e.shiftKey && manager.selectionMode === 'multiple') manager.extendSelection(key);
else if (selectOnFocus && !(0, $ee0bdf4faa47f2a8$exports.isNonContiguousSelectionModifier)(e)) manager.replaceSelection(key);
}
};
switch(e.key){
case 'ArrowDown':
if (delegate.getKeyBelow) {
var _delegate_getKeyBelow, _delegate_getFirstKey, _delegate_getFirstKey1;
let nextKey = manager.focusedKey != null ? (_delegate_getKeyBelow = delegate.getKeyBelow) === null || _delegate_getKeyBelow === void 0 ? void 0 : _delegate_getKeyBelow.call(delegate, manager.focusedKey) : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate);
if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getFirstKey1 = delegate.getFirstKey) === null || _delegate_getFirstKey1 === void 0 ? void 0 : _delegate_getFirstKey1.call(delegate, manager.focusedKey);
if (nextKey != null) {
e.preventDefault();
navigateToKey(nextKey);
}
}
break;
case 'ArrowUp':
if (delegate.getKeyAbove) {
var _delegate_getKeyAbove, _delegate_getLastKey, _delegate_getLastKey1;
let nextKey = manager.focusedKey != null ? (_delegate_getKeyAbove = delegate.getKeyAbove) === null || _delegate_getKeyAbove === void 0 ? void 0 : _delegate_getKeyAbove.call(delegate, manager.focusedKey) : (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate);
if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getLastKey1 = delegate.getLastKey) === null || _delegate_getLastKey1 === void 0 ? void 0 : _delegate_getLastKey1.call(delegate, manager.focusedKey);
if (nextKey != null) {
e.preventDefault();
navigateToKey(nextKey);
}
}
break;
case 'ArrowLeft':
if (delegate.getKeyLeftOf) {
var _delegate_getKeyLeftOf, _delegate_getFirstKey2, _delegate_getLastKey2;
let nextKey = manager.focusedKey != null ? (_delegate_getKeyLeftOf = delegate.getKeyLeftOf) === null || _delegate_getKeyLeftOf === void 0 ? void 0 : _delegate_getKeyLeftOf.call(delegate, manager.focusedKey) : null;
if (nextKey == null && shouldFocusWrap) nextKey = direction === 'rtl' ? (_delegate_getFirstKey2 = delegate.getFirstKey) === null || _delegate_getFirstKey2 === void 0 ? void 0 : _delegate_getFirstKey2.call(delegate, manager.focusedKey) : (_delegate_getLastKey2 = delegate.getLastKey) === null || _delegate_getLastKey2 === void 0 ? void 0 : _delegate_getLastKey2.call(delegate, manager.focusedKey);
if (nextKey != null) {
e.preventDefault();
navigateToKey(nextKey, direction === 'rtl' ? 'first' : 'last');
}
}
break;
case 'ArrowRight':
if (delegate.getKeyRightOf) {
var _delegate_getKeyRightOf, _delegate_getLastKey3, _delegate_getFirstKey3;
let nextKey = manager.focusedKey != null ? (_delegate_getKeyRightOf = delegate.getKeyRightOf) === null || _delegate_getKeyRightOf === void 0 ? void 0 : _delegate_getKeyRightOf.call(delegate, manager.focusedKey) : null;
if (nextKey == null && shouldFocusWrap) nextKey = direction === 'rtl' ? (_delegate_getLastKey3 = delegate.getLastKey) === null || _delegate_getLastKey3 === void 0 ? void 0 : _delegate_getLastKey3.call(delegate, manager.focusedKey) : (_delegate_getFirstKey3 = delegate.getFirstKey) === null || _delegate_getFirstKey3 === void 0 ? void 0 : _delegate_getFirstKey3.call(delegate, manager.focusedKey);
if (nextKey != null) {
e.preventDefault();
navigateToKey(nextKey, direction === 'rtl' ? 'last' : 'first');
}
}
break;
case 'Home':
if (delegate.getFirstKey) {
e.preventDefault();
let firstKey = delegate.getFirstKey(manager.focusedKey, (0, $ee0bdf4faa47f2a8$exports.isCtrlKeyPressed)(e));
manager.setFocusedKey(firstKey);
if (firstKey != null) {
if ((0, $ee0bdf4faa47f2a8$exports.isCtrlKeyPressed)(e) && e.shiftKey && manager.selectionMode === 'multiple') manager.extendSelection(firstKey);
else if (selectOnFocus) manager.replaceSelection(firstKey);
}
}
break;
case 'End':
if (delegate.getLastKey) {
e.preventDefault();
let lastKey = delegate.getLastKey(manager.focusedKey, (0, $ee0bdf4faa47f2a8$exports.isCtrlKeyPressed)(e));
manager.setFocusedKey(lastKey);
if (lastKey != null) {
if ((0, $ee0bdf4faa47f2a8$exports.isCtrlKeyPressed)(e) && e.shiftKey && manager.selectionMode === 'multiple') manager.extendSelection(lastKey);
else if (selectOnFocus) manager.replaceSelection(lastKey);
}
}
break;
case 'PageDown':
if (delegate.getKeyPageBelow && manager.focusedKey != null) {
let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
if (nextKey != null) {
e.preventDefault();
navigateToKey(nextKey);
}
}
break;
case 'PageUp':
if (delegate.getKeyPageAbove && manager.focusedKey != null) {
let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
if (nextKey != null) {
e.preventDefault();
navigateToKey(nextKey);
}
}
break;
case 'a':
if ((0, $ee0bdf4faa47f2a8$exports.isCtrlKeyPressed)(e) && manager.selectionMode === 'multiple' && disallowSelectAll !== true) {
e.preventDefault();
manager.selectAll();
}
break;
case 'Escape':
if (!disallowEmptySelection && manager.selectedKeys.size !== 0) {
e.stopPropagation();
e.preventDefault();
manager.clearSelection();
}
break;
case 'Tab':
if (!allowsTabNavigation) {
// There may be elements that are "tabbable" inside a collection (e.g. in a grid cell).
// However, collections should be treated as a single tab stop, with arrow key navigation internally.
// We don't control the rendering of these, so we can't override the tabIndex to prevent tabbing.
// Instead, we handle the Tab key, and move focus manually to the first/last tabbable element
// in the collection, so that the browser default behavior will apply starting from that element
// rather than the currently focused one.
if (e.shiftKey) ref.current.focus();
else {
let walker = (0, $bT8Bh$reactariafocus.getFocusableTreeWalker)(ref.current, {
tabbable: true
});
let next = undefined;
let last;
do {
last = walker.lastChild();
if (last) next = last;
}while (last);
if (next && !next.contains(document.activeElement)) (0, $bT8Bh$reactariautils.focusWithoutScrolling)(next);
}
break;
}
}
};
// Store the scroll position so we can restore it later.
/// TODO: should this happen all the time??
let scrollPos = (0, $bT8Bh$react.useRef)({
top: 0,
left: 0
});
(0, $bT8Bh$reactariautils.useEvent)(scrollRef, 'scroll', isVirtualized ? undefined : ()=>{
var _scrollRef_current, _scrollRef_current1;
var _scrollRef_current_scrollTop, _scrollRef_current_scrollLeft;
scrollPos.current = {
top: (_scrollRef_current_scrollTop = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.scrollTop) !== null && _scrollRef_current_scrollTop !== void 0 ? _scrollRef_current_scrollTop : 0,
left: (_scrollRef_current_scrollLeft = (_scrollRef_current1 = scrollRef.current) === null || _scrollRef_current1 === void 0 ? void 0 : _scrollRef_current1.scrollLeft) !== null && _scrollRef_current_scrollLeft !== void 0 ? _scrollRef_current_scrollLeft : 0
};
});
let onFocus = (e)=>{
if (manager.isFocused) {
// If a focus event bubbled through a portal, reset focus state.
if (!e.currentTarget.contains(e.target)) manager.setFocused(false);
return;
}
// Focus events can bubble through portals. Ignore these events.
if (!e.currentTarget.contains(e.target)) return;
manager.setFocused(true);
if (manager.focusedKey == null) {
var _delegate_getLastKey, _delegate_getFirstKey;
let navigateToFirstKey = (key)=>{
if (key != null) {
manager.setFocusedKey(key);
if (selectOnFocus) manager.replaceSelection(key);
}
};
// If the user hasn't yet interacted with the collection, there will be no focusedKey set.
// Attempt to detect whether the user is tabbing forward or backward into the collection
// and either focus the first or last item accordingly.
let relatedTarget = e.relatedTarget;
var _manager_lastSelectedKey, _manager_firstSelectedKey;
if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToFirstKey((_manager_lastSelectedKey = manager.lastSelectedKey) !== null && _manager_lastSelectedKey !== void 0 ? _manager_lastSelectedKey : (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate));
else navigateToFirstKey((_manager_firstSelectedKey = manager.firstSelectedKey) !== null && _manager_firstSelectedKey !== void 0 ? _manager_firstSelectedKey : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate));
} else if (!isVirtualized && scrollRef.current) {
// Restore the scroll position to what it was before.
scrollRef.current.scrollTop = scrollPos.current.top;
scrollRef.current.scrollLeft = scrollPos.current.left;
}
if (manager.focusedKey != null && scrollRef.current) {
// Refocus and scroll the focused item into view if it exists within the scrollable region.
let element = scrollRef.current.querySelector(`[data-key="${CSS.escape(manager.focusedKey.toString())}"]`);
if (element) {
// This prevents a flash of focus on the first/last element in the collection, or the collection itself.
if (!element.contains(document.activeElement)) (0, $bT8Bh$reactariautils.focusWithoutScrolling)(element);
let modality = (0, $bT8Bh$reactariainteractions.getInteractionModality)();
if (modality === 'keyboard') (0, $bT8Bh$reactariautils.scrollIntoViewport)(element, {
containingElement: ref.current
});
}
}
};
let onBlur = (e)=>{
// Don't set blurred and then focused again if moving focus within the collection.
if (!e.currentTarget.contains(e.relatedTarget)) manager.setFocused(false);
};
const autoFocusRef = (0, $bT8Bh$react.useRef)(autoFocus);
(0, $bT8Bh$react.useEffect)(()=>{
if (autoFocusRef.current) {
var _delegate_getFirstKey, _delegate_getLastKey;
let focusedKey = null;
var _delegate_getFirstKey1;
// Check focus strategy to determine which item to focus
if (autoFocus === 'first') focusedKey = (_delegate_getFirstKey1 = (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate)) !== null && _delegate_getFirstKey1 !== void 0 ? _delegate_getFirstKey1 : null;
var _delegate_getLastKey1;
if (autoFocus === 'last') focusedKey = (_delegate_getLastKey1 = (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate)) !== null && _delegate_getLastKey1 !== void 0 ? _delegate_getLastKey1 : null;
// If there are any selected keys, make the first one the new focus target
let selectedKeys = manager.selectedKeys;
if (selectedKeys.size) {
for (let key of selectedKeys)if (manager.canSelectItem(key)) {
focusedKey = key;
break;
}
}
manager.setFocused(true);
manager.setFocusedKey(focusedKey);
// If no default focus key is selected, focus the collection itself.
if (focusedKey == null && !shouldUseVirtualFocus && ref.current) (0, $bT8Bh$reactariafocus.focusSafely)(ref.current);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
// Scroll the focused element into view when the focusedKey changes.
let lastFocusedKey = (0, $bT8Bh$react.useRef)(manager.focusedKey);
(0, $bT8Bh$react.useEffect)(()=>{
if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || autoFocusRef.current) && scrollRef.current && ref.current) {
let modality = (0, $bT8Bh$reactariainteractions.getInteractionModality)();
let element = ref.current.querySelector(`[data-key="${CSS.escape(manager.focusedKey.toString())}"]`);
if (!element) // If item element wasn't found, return early (don't update autoFocusRef and lastFocusedKey).
// The collection may initially be empty (e.g. virtualizer), so wait until the element exists.
return;
if (modality === 'keyboard' || autoFocusRef.current) {
(0, $bT8Bh$reactariautils.scrollIntoView)(scrollRef.current, element);
// Avoid scroll in iOS VO, since it may cause overlay to close (i.e. RAC submenu)
if (modality !== 'virtual') (0, $bT8Bh$reactariautils.scrollIntoViewport)(element, {
containingElement: ref.current
});
}
}
// If the focused key becomes null (e.g. the last item is deleted), focus the whole collection.
if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null && ref.current) (0, $bT8Bh$reactariafocus.focusSafely)(ref.current);
lastFocusedKey.current = manager.focusedKey;
autoFocusRef.current = false;
});
// Intercept FocusScope restoration since virtualized collections can reuse DOM nodes.
(0, $bT8Bh$reactariautils.useEvent)(ref, 'react-aria-focus-scope-restore', (e)=>{
e.preventDefault();
manager.setFocused(true);
});
let handlers = {
onKeyDown: onKeyDown,
onFocus: onFocus,
onBlur: onBlur,
onMouseDown (e) {
// Ignore events that bubbled through portals.
if (scrollRef.current === e.target) // Prevent focus going to the collection when clicking on the scrollbar.
e.preventDefault();
}
};
let { typeSelectProps: typeSelectProps } = (0, $a1189052f36475e8$exports.useTypeSelect)({
keyboardDelegate: delegate,
selectionManager: manager
});
if (!disallowTypeAhead) handlers = (0, $bT8Bh$reactariautils.mergeProps)(typeSelectProps, handlers);
// If nothing is focused within the collection, make the collection itself tabbable.
// This will be marshalled to either the first or last item depending on where focus came from.
// If using virtual focus, don't set a tabIndex at all so that VoiceOver on iOS 14 doesn't try
// to move real DOM focus to the element anyway.
let tabIndex = undefined;
if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
return {
collectionProps: {
...handlers,
tabIndex: tabIndex
}
};
}
//# sourceMappingURL=useSelectableCollection.main.js.map
@@ -0,0 +1,43 @@
import baseToString from './_baseToString.js';
import castSlice from './_castSlice.js';
import charsStartIndex from './_charsStartIndex.js';
import stringToArray from './_stringToArray.js';
import toString from './toString.js';
/** Used to match leading whitespace. */
var reTrimStart = /^\s+/;
/**
* Removes leading whitespace or specified characters from `string`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to trim.
* @param {string} [chars=whitespace] The characters to trim.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {string} Returns the trimmed string.
* @example
*
* _.trimStart(' abc ');
* // => 'abc '
*
* _.trimStart('-_-abc-_-', '_-');
* // => 'abc-_-'
*/
function trimStart(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return string.replace(reTrimStart, '');
}
if (!string || !(chars = baseToString(chars))) {
return string;
}
var strSymbols = stringToArray(string),
start = charsStartIndex(strSymbols, stringToArray(chars));
return castSlice(strSymbols, start).join('');
}
export default trimStart;
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,cAAc,CAAC;IAC1E,qBAAqB,CAAC,iDAA2C,CAAC;IAClE,UAAU,CAAC,IAAI,CAAC;IAChB,eAAe,CAAC,2BAAqB,CAAC;IACtC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,sBAAmB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,iBAAc,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,kBAAe,CAAC;QAAA,GAAG,CAAC,CAAC;IAClO,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC;AACnD","sources":["packages/@react-aria/grid/intl/et-EE.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} pole valitud.\",\n \"longPressToSelect\": \"Valikurežiimi sisenemiseks vajutage pikalt.\",\n \"select\": \"Vali\",\n \"selectedAll\": \"Kõik üksused valitud.\",\n \"selectedCount\": \"{count, plural, =0 {Üksusi pole valitud} one {# üksus valitud} other {# üksust valitud}}.\",\n \"selectedItem\": \"{item} valitud.\"\n}\n"],"names":[],"version":3,"file":"et-EE.module.js.map"}
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more