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,26 @@
'use strict';
const { MESSAGE } = require('triple-beam');
class Printf {
constructor(templateFn) {
this.template = templateFn;
}
transform(info) {
info[MESSAGE] = this.template(info);
return info;
}
}
/*
* function printf (templateFn)
* Returns a new instance of the printf Format that creates an
* intermediate prototype to store the template string-based formatter
* function.
*/
module.exports = opts => new Printf(opts);
module.exports.Printf
= module.exports.Format
= Printf;
@@ -0,0 +1,194 @@
var is = require('type-is')
var Busboy = require('busboy')
var extend = require('xtend')
var appendField = require('append-field')
var Counter = require('./counter')
var MulterError = require('./multer-error')
var FileAppender = require('./file-appender')
var removeUploadedFiles = require('./remove-uploaded-files')
function drainStream (stream) {
stream.on('readable', () => {
while (stream.read() !== null) {}
})
}
function makeMiddleware (setup) {
return function multerMiddleware (req, res, next) {
if (!is(req, ['multipart'])) return next()
var options = setup()
var limits = options.limits
var storage = options.storage
var fileFilter = options.fileFilter
var fileStrategy = options.fileStrategy
var preservePath = options.preservePath
req.body = Object.create(null)
req.on('error', function (err) {
abortWithError(err)
})
var busboy
try {
busboy = Busboy({ headers: req.headers, limits: limits, preservePath: preservePath })
} catch (err) {
return next(err)
}
var appender = new FileAppender(fileStrategy, req)
var isDone = false
var readFinished = false
var errorOccured = false
var pendingWrites = new Counter()
var uploadedFiles = []
function done (err) {
if (isDone) return
isDone = true
req.unpipe(busboy)
drainStream(req)
req.resume()
setImmediate(() => {
busboy.removeAllListeners()
})
next(err)
}
function indicateDone () {
if (readFinished && pendingWrites.isZero() && !errorOccured) done()
}
function abortWithError (uploadError) {
if (errorOccured) return
errorOccured = true
pendingWrites.onceZero(function () {
function remove (file, cb) {
storage._removeFile(req, file, cb)
}
removeUploadedFiles(uploadedFiles, remove, function (err, storageErrors) {
if (err) return done(err)
uploadError.storageErrors = storageErrors
done(uploadError)
})
})
}
function abortWithCode (code, optionalField) {
abortWithError(new MulterError(code, optionalField))
}
// handle text field data
busboy.on('field', function (fieldname, value, { nameTruncated, valueTruncated }) {
if (fieldname == null) return abortWithCode('MISSING_FIELD_NAME')
if (nameTruncated) return abortWithCode('LIMIT_FIELD_KEY')
if (valueTruncated) return abortWithCode('LIMIT_FIELD_VALUE', fieldname)
// Work around bug in Busboy (https://github.com/mscdex/busboy/issues/6)
if (limits && Object.prototype.hasOwnProperty.call(limits, 'fieldNameSize')) {
if (fieldname.length > limits.fieldNameSize) return abortWithCode('LIMIT_FIELD_KEY')
}
appendField(req.body, fieldname, value)
})
// handle files
busboy.on('file', function (fieldname, fileStream, { filename, encoding, mimeType }) {
var pendingWritesIncremented = false
fileStream.on('error', function (err) {
if (pendingWritesIncremented) {
pendingWrites.decrement()
}
abortWithError(err)
})
if (fieldname == null) return abortWithCode('MISSING_FIELD_NAME')
// don't attach to the files object, if there is no file
if (!filename) return fileStream.resume()
// Work around bug in Busboy (https://github.com/mscdex/busboy/issues/6)
if (limits && Object.prototype.hasOwnProperty.call(limits, 'fieldNameSize')) {
if (fieldname.length > limits.fieldNameSize) return abortWithCode('LIMIT_FIELD_KEY')
}
var file = {
fieldname: fieldname,
originalname: filename,
encoding: encoding,
mimetype: mimeType
}
var placeholder = appender.insertPlaceholder(file)
fileFilter(req, file, function (err, includeFile) {
if (err) {
appender.removePlaceholder(placeholder)
return abortWithError(err)
}
if (!includeFile) {
appender.removePlaceholder(placeholder)
return fileStream.resume()
}
var aborting = false
pendingWritesIncremented = true
pendingWrites.increment()
Object.defineProperty(file, 'stream', {
configurable: true,
enumerable: false,
value: fileStream
})
fileStream.on('limit', function () {
aborting = true
abortWithCode('LIMIT_FILE_SIZE', fieldname)
})
storage._handleFile(req, file, function (err, info) {
if (aborting) {
appender.removePlaceholder(placeholder)
uploadedFiles.push(extend(file, info))
return pendingWrites.decrement()
}
if (err) {
appender.removePlaceholder(placeholder)
pendingWrites.decrement()
return abortWithError(err)
}
var fileInfo = extend(file, info)
appender.replacePlaceholder(placeholder, fileInfo)
uploadedFiles.push(fileInfo)
pendingWrites.decrement()
indicateDone()
})
})
})
busboy.on('error', function (err) { abortWithError(err) })
busboy.on('partsLimit', function () { abortWithCode('LIMIT_PART_COUNT') })
busboy.on('filesLimit', function () { abortWithCode('LIMIT_FILE_COUNT') })
busboy.on('fieldsLimit', function () { abortWithCode('LIMIT_FIELD_COUNT') })
busboy.on('close', function () {
readFinished = true
indicateDone()
})
req.pipe(busboy)
}
}
module.exports = makeMiddleware
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,UAAU,CAAC,MAAM,CAAC;IACpC,aAAa,CAAC,UAAU,CAAC;IACzB,YAAY,CAAC,eAAe,CAAC;IAC7B,aAAa,CAAC,SAAS,CAAC;IACxB,cAAc,CAAC,UAAU,CAAC;IAC1B,iBAAiB,CAAC,OAAS,CAAC,iBAAiB,EAAE,KAAK,UAAU,CAAC,mBAAmB,CAAC;IACnF,kBAAkB,CAAC,OAAS,CAAC,iBAAiB,EAAE,KAAK,UAAU,CAAC,oBAAoB,CAAC;IACrF,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,OAAO,CAAC;IAC9C,sBAAsB,CAAC,6BAA6B,CAAC;AACvD","sources":["packages/@react-aria/table/intl/en-US.json"],"sourcesContent":["{\n \"select\": \"Select\",\n \"selectAll\": \"Select All\",\n \"sortable\": \"sortable column\",\n \"ascending\": \"ascending\",\n \"descending\": \"descending\",\n \"ascendingSort\": \"sorted by column {columnName} in ascending order\",\n \"descendingSort\": \"sorted by column {columnName} in descending order\",\n \"columnSize\": \"{value} pixels\",\n \"resizerDescription\": \"Press Enter to start resizing\"\n}\n"],"names":[],"version":3,"file":"en-US.module.js.map"}
@@ -0,0 +1,6 @@
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
};
}
export { _interopRequireDefault as default };
@@ -0,0 +1,69 @@
{
"name": "axobject-query",
"version": "4.1.0",
"description": "Programmatic access to information about the AXObject Model",
"main": "lib/index.js",
"files": [
"lib"
],
"scripts": {
"build": "rimraf lib && babel src --out-dir lib",
"flow": "flow",
"lint": "eslint --ext=js,mjs .",
"lint:fix": "npm run lint -- --fix",
"prepublishOnly": "npm run build",
"pretest": "npm run lint:fix && npm run flow",
"test": "npm run tests-only",
"build:tests": "npm run build && rimraf __tests-built__ && BABEL_ENV=test babel __tests__ --out-dir __tests-built__",
"tests-built": "nyc tape '__tests-built__/**/*.js'",
"tests-only": "nyc tape -r @babel/register '__tests__/**/*.js'",
"prepack": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/A11yance/axobject-query.git"
},
"keywords": [
"accessibility"
],
"author": "Jesse Beach <splendidnoise@gmail.com>",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/A11yance/axobject-query/issues"
},
"homepage": "https://github.com/A11yance/axobject-query#readme",
"devDependencies": {
"@babel/cli": "^7.19.3",
"@babel/core": "^7.19.6",
"@babel/eslint-parser": "^7.19.1",
"@babel/plugin-transform-react-jsx": "^7.24.7",
"@babel/preset-env": "^7.19.4",
"@babel/preset-flow": "^7.18.6",
"@babel/register": "^7.24.6",
"babel-plugin-module-resolver": "^5.0.2",
"deep-equal-json": "^1.0.0",
"encoding": "^0.1.13",
"eslint": "^8.26.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.26.0",
"expect": "^29.2.1",
"flow-bin": "^0.190.1",
"flow-typed": "^3.8.0",
"mock-property": "^1.0.3",
"nyc": "^10.3.2",
"object-inspect": "^1.13.2",
"object.values": "^1.2.0",
"rimraf": "^3.0.2",
"tape": "^5.8.1"
},
"browserslist": [
">0.2%",
"not dead",
"not op_mini all",
"ie 11"
],
"engines": {
"node": ">= 0.4"
}
}
@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReceiveBuffer = void 0;
class ReceiveBuffer {
constructor(size = 4096) {
this.buffer = Buffer.allocUnsafe(size);
this.offset = 0;
this.originalSize = size;
}
get length() {
return this.offset;
}
append(data) {
if (!Buffer.isBuffer(data)) {
throw new Error('Attempted to append a non-buffer instance to ReceiveBuffer.');
}
if (this.offset + data.length >= this.buffer.length) {
const tmp = this.buffer;
this.buffer = Buffer.allocUnsafe(Math.max(this.buffer.length + this.originalSize, this.buffer.length + data.length));
tmp.copy(this.buffer);
}
data.copy(this.buffer, this.offset);
return (this.offset += data.length);
}
peek(length) {
if (length > this.offset) {
throw new Error('Attempted to read beyond the bounds of the managed internal data.');
}
return this.buffer.slice(0, length);
}
get(length) {
if (length > this.offset) {
throw new Error('Attempted to read beyond the bounds of the managed internal data.');
}
const value = Buffer.allocUnsafe(length);
this.buffer.slice(0, length).copy(value);
this.buffer.copyWithin(0, length, length + this.offset - length);
this.offset -= length;
return value;
}
}
exports.ReceiveBuffer = ReceiveBuffer;
//# sourceMappingURL=receivebuffer.js.map
@@ -0,0 +1,85 @@
/*
Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import Variable from "./variable.js";
/**
* @constructor Definition
*/
class Definition {
constructor(type, name, node, parent, index, kind) {
/**
* @member {string} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...).
*/
this.type = type;
/**
* @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence.
*/
this.name = name;
/**
* @member {espree.Node} Definition#node - the enclosing node of the identifier.
*/
this.node = node;
/**
* @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier.
*/
this.parent = parent;
/**
* @member {number?} Definition#index - the index in the declaration statement.
*/
this.index = index;
/**
* @member {string?} Definition#kind - the kind of the declaration statement.
*/
this.kind = kind;
}
}
/**
* @constructor ParameterDefinition
*/
class ParameterDefinition extends Definition {
constructor(name, node, index, rest) {
super(Variable.Parameter, name, node, null, index, null);
/**
* Whether the parameter definition is a part of a rest parameter.
* @member {boolean} ParameterDefinition#rest
*/
this.rest = rest;
}
}
export {
ParameterDefinition,
Definition
};
/* vim: set sw=4 ts=4 et tw=80 : */
@@ -0,0 +1,18 @@
"use client";
import { useConstant } from '../../utils/use-constant.mjs';
import { useUnmountEffect } from '../../utils/use-unmount-effect.mjs';
import { createScopedWaapiAnimate } from '../animators/waapi/animate-style.mjs';
function useAnimateMini() {
const scope = useConstant(() => ({
current: null, // Will be hydrated by React
animations: [],
}));
const animate = useConstant(() => createScopedWaapiAnimate(scope));
useUnmountEffect(() => {
scope.animations.forEach((animation) => animation.stop());
});
return [scope, animate];
}
export { useAnimateMini };
@@ -0,0 +1,128 @@
/**
* @file ttf转svg
* @author mengke01(kekee000@gmail.com)
*
* references:
* http://www.w3.org/TR/SVG11/fonts.html
*/
import string from '../common/string';
import utilString from './util/string';
import TTFReader from './ttfreader';
import contours2svg from './util/contours2svg';
import unicode2xml from './util/unicode2xml';
import error from './error';
import config from './data/default';
// svg font id
const SVG_FONT_ID = config.fontId;
// xml 模板
/* eslint-disable no-multi-spaces */
const XML_TPL = ''
+ '<?xml version="1.0" standalone="no"?>'
+ '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >'
+ '<svg xmlns="http://www.w3.org/2000/svg">'
+ '<metadata>${metadata}</metadata>'
+ '<defs><font id="${id}" horiz-adv-x="${advanceWidth}">'
+ '<font-face font-family="${fontFamily}" font-weight="${fontWeight}" font-stretch="normal"'
+ ' units-per-em="${unitsPerEm}" panose-1="${panose}" ascent="${ascent}" descent="${descent}"'
+ ' x-height="${xHeight}" bbox="${bbox}" underline-thickness="${underlineThickness}"'
+ ' underline-position="${underlinePosition}" unicode-range="${unicodeRange}" />'
+ '<missing-glyph horiz-adv-x="${missing.advanceWidth}" ${missing.d} />'
+ '${glyphList}'
+ '</font></defs>'
+ '</svg>';
/* eslint-enable no-multi-spaces */
// glyph 模板
const GLYPH_TPL = '<glyph glyph-name="${name}" unicode="${unicode}" d="${d}" />';
/**
* ttf数据结构转svg
*
* @param {ttfObject} ttf ttfObject对象
* @param {Object} options 选项
* @param {string} options.metadata 字体相关的信息
* @return {string} svg字符串
*/
function ttfobject2svg(ttf, options) {
const OS2 = ttf['OS/2'];
// 用来填充xml的数据
const xmlObject = {
id: ttf.name.uniqueSubFamily || SVG_FONT_ID,
metadata: string.encodeHTML(options.metadata || ''),
advanceWidth: ttf.hhea.advanceWidthMax,
fontFamily: ttf.name.fontFamily,
fontWeight: OS2.usWeightClass,
unitsPerEm: ttf.head.unitsPerEm,
panose: [
OS2.bFamilyType, OS2.bSerifStyle, OS2.bWeight, OS2.bProportion, OS2.bContrast,
OS2.bStrokeVariation, OS2.bArmStyle, OS2.bLetterform, OS2.bMidline, OS2.bXHeight
].join(' '),
ascent: ttf.hhea.ascent,
descent: ttf.hhea.descent,
xHeight: OS2.bXHeight,
bbox: [ttf.head.xMin, ttf.head.yMin, ttf.head.xMax, ttf.head.yMax].join(' '),
underlineThickness: ttf.post.underlineThickness,
underlinePosition: ttf.post.underlinePosition,
unicodeRange: 'U+' + string.pad(OS2.usFirstCharIndex.toString(16), 4)
+ '-' + string.pad(OS2.usLastCharIndex.toString(16), 4)
};
// glyf 第一个为missing glyph
xmlObject.missing = {};
xmlObject.missing.advanceWidth = ttf.glyf[0].advanceWidth || 0;
xmlObject.missing.d = ttf.glyf[0].contours && ttf.glyf[0].contours.length
? 'd="' + contours2svg(ttf.glyf[0].contours) + '"'
: '';
// glyf 信息
let glyphList = '';
for (let i = 1, l = ttf.glyf.length; i < l; i++) {
const glyf = ttf.glyf[i];
// 筛选简单字形,并且有轮廓,有编码
if (!glyf.compound && glyf.contours && glyf.unicode && glyf.unicode.length) {
const glyfObject = {
name: utilString.escape(glyf.name),
unicode: unicode2xml(glyf.unicode),
d: contours2svg(glyf.contours)
};
glyphList += string.format(GLYPH_TPL, glyfObject);
}
}
xmlObject.glyphList = glyphList;
return string.format(XML_TPL, xmlObject);
}
/**
* ttf格式转换成svg字体格式
*
* @param {ArrayBuffer|ttfObject} ttfBuffer ttf缓冲数组或者ttfObject对象
* @param {Object} options 选项
* @param {Object} options.metadata 字体相关的信息
*
* @return {string} svg字符串
*/
export default function ttf2svg(ttfBuffer, options = {}) {
// 读取ttf二进制流
if (ttfBuffer instanceof ArrayBuffer) {
const reader = new TTFReader();
const ttfObject = reader.read(ttfBuffer);
reader.dispose();
return ttfobject2svg(ttfObject, options);
}
// 读取ttfObject
else if (ttfBuffer.version && ttfBuffer.glyf) {
return ttfobject2svg(ttfBuffer, options);
}
error.raise(10109);
}
@@ -0,0 +1,20 @@
import baseFindIndex from './_baseFindIndex.js';
import baseIsNaN from './_baseIsNaN.js';
import strictIndexOf from './_strictIndexOf.js';
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
return value === value
? strictIndexOf(array, value, fromIndex)
: baseFindIndex(array, baseIsNaN, fromIndex);
}
export default baseIndexOf;
@@ -0,0 +1 @@
{"name":"import-fresh","version":"3.3.1","requiresBuild":false,"files":{"license":{"checkedAt":1794532093291,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"index.js":{"checkedAt":1794532093363,"integrity":"sha512-KJ2Rw6GEpyTF8PkXDXoaNK4cbCkiW+kW7jymR2wSByKXHQhcUaulQZDG9j05v95E7nnqlbdRBYyMuCwtytqY4w==","mode":420,"size":1109},"package.json":{"checkedAt":1794532093363,"integrity":"sha512-IYmE21hXBuD+kDs7rP4J2HV3xOZuLqncz3c7ijujO/IZ6P3XgKF9tGP8RI/LxQNUqaPeBxn4Uap7t5iyeH6n5Q==","mode":420,"size":890},"readme.md":{"checkedAt":1794532093363,"integrity":"sha512-psC4DvhKSmHkgTEKQAjguwoSWUXrSZ+ZQlBJlO31wDOw5uQ27dL+KnjkjSrXwbCL5X3TLvjofcu7fCDXOM5r/A==","mode":420,"size":1145},"index.d.ts":{"checkedAt":1794532093363,"integrity":"sha512-7QJsjGcsRoPknC7ZlAJ3TX0VVXYAHI8SH/9tynHGD39IUvRo2PS5oOUAPg0Sm1nd1+JWDdOs2jK5K4iK9EjqHg==","mode":420,"size":432}}}
@@ -0,0 +1 @@
{"version":3,"file":"bugs.int.spec.d.ts","sourceRoot":"","sources":["../../../../src/test/bugs/bugs.int.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
'use strict';
var $RangeError = require('es-errors/range');
var ToIntegerOrInfinity = require('./ToIntegerOrInfinity');
var MAX_SAFE_INTEGER = require('math-intrinsics/constants/maxSafeInteger');
// https://262.ecma-international.org/15.0/#sec-toindex
module.exports = function ToIndex(value) {
if (typeof value === 'undefined') {
return 0;
}
var integer = ToIntegerOrInfinity(value);
if (integer < 0 || integer >= MAX_SAFE_INTEGER) {
throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1');
}
return integer;
};
@@ -0,0 +1,51 @@
var baseTimes = require('./_baseTimes'),
castFunction = require('./_castFunction'),
toInteger = require('./toInteger');
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* Invokes the iteratee `n` times, returning an array of the results of
* each invocation. The iteratee is invoked with one argument; (index).
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the array of results.
* @example
*
* _.times(3, String);
* // => ['0', '1', '2']
*
* _.times(4, _.constant(0));
* // => [0, 0, 0, 0]
*/
function times(n, iteratee) {
n = toInteger(n);
if (n < 1 || n > MAX_SAFE_INTEGER) {
return [];
}
var index = MAX_ARRAY_LENGTH,
length = nativeMin(n, MAX_ARRAY_LENGTH);
iteratee = castFunction(iteratee);
n -= MAX_ARRAY_LENGTH;
var result = baseTimes(length, iteratee);
while (++index < n) {
iteratee(index);
}
return result;
}
module.exports = times;
@@ -0,0 +1,23 @@
/**
* @fileoverview Shared utilities for error messages.
* @author Josh Goldberg
*/
"use strict";
/**
* Converts a value to a string that may be printed in errors.
* @param {any} value The invalid value.
* @param {number} indentation How many spaces to indent
* @returns {string} The value, stringified.
*/
function stringifyValueForError(value, indentation) {
return value
? JSON.stringify(value, null, 4).replace(
/\n/gu,
`\n${" ".repeat(indentation)}`,
)
: `${value}`;
}
module.exports = { stringifyValueForError };
@@ -0,0 +1,15 @@
import isObject from './isObject.js';
/**
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` if suitable for strict
* equality comparisons, else `false`.
*/
function isStrictComparable(value) {
return value === value && !isObject(value);
}
export default isStrictComparable;
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.schemaStorage = void 0;
const schema_1 = require("./schema");
exports.schemaStorage = new schema_1.AsnSchemaStorage();
@@ -0,0 +1 @@
!function(a,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],i):(a="undefined"!=typeof globalThis?globalThis:a||self).dayjs_locale_gd=i(a.dayjs)}(this,(function(a){"use strict";function i(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var n=i(a),e={name:"gd",weekdays:"Didòmhnaich_Diluain_Dimàirt_Diciadain_Diardaoin_Dihaoine_Disathairne".split("_"),months:"Am Faoilleach_An Gearran_Am Màrt_An Giblean_An Cèitean_An t-Ògmhios_An t-Iuchar_An Lùnastal_An t-Sultain_An Dàmhair_An t-Samhain_An Dùbhlachd".split("_"),weekStart:1,weekdaysShort:"Did_Dil_Dim_Dic_Dia_Dih_Dis".split("_"),monthsShort:"Faoi_Gear_Màrt_Gibl_Cèit_Ògmh_Iuch_Lùn_Sult_Dàmh_Samh_Dùbh".split("_"),weekdaysMin:"Dò_Lu_Mà_Ci_Ar_Ha_Sa".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"}};return n.default.locale(e,null,!0),e}));
@@ -0,0 +1,269 @@
# IANA Language Tags for JavaScript #
[![Build Status](https://travis-ci.org/mattcg/language-tags.png?branch=master)](https://travis-ci.org/mattcg/language-tags)
[![Coverage Status](https://coveralls.io/repos/mattcg/language-tags/badge.png)](https://coveralls.io/r/mattcg/language-tags)
Based on [BCP 47](https://www.rfc-editor.org/info/bcp47) ([RFC 5646](https://www.rfc-editor.org/rfc/rfc5646.html)) and the latest [IANA language subtag registry](http://www.iana.org/assignments/language-subtag-registry).
This project will be updated as the standards change.
## JSON data ##
See the [language-subtag-registry](https://github.com/mattcg/language-subtag-registry) project for the underlying JSON data.
## API ##
```js
var tags = require('language-tags')
```
Note that all lookups and checks for tags and subtags are case insensitive. For formatting according to common conventions, see `tag.format`.
### tags(tag) ###
Check whether a hyphen-separated tag is valid and well-formed. Always returns a `Tag`, which can be checked using the `valid` method.
### tags.check(tag) ###
Shortcut for `tags(tag).valid()`. Return `true` if the tag is valid, `false` otherwise. For meaningful error output see `tag.errors()`.
### tags.subtags(subtag), tags.subtags(subtags) ###
Look up one or more subtags. Returns an array of `Subtag` objects. Returns an empty array if all of the subtags are non-existent.
Calling `tags.subtags('mt')` will return an array with two `Subtag` objects: one for Malta (the 'region' type subtag) and one for Maltese (the 'language' type subtag).
```
> tags.subtags('mt');
[Subtag, Subtag]
> tags.subtags('bumblebee');
[]
```
To get or check a single subtag by type use `tags.language(subtag)`, `tags.region(subtag)` or `tags.type(subtag, type)`.
### tags.filter(subtags) ###
The opposite of `tags.subtags(subtags)`. Returns an array of codes that are not registered subtags, otherwise returns an empty array.
```
> tags.filter(['en', 'Aargh']);
['Aargh']
```
### tags.search(description, [all]) ###
Search for tags and subtags by description. Supports either a RegExp object or a string for `description`. Returns an array of `Subtag` and `Tag` objects or an empty array if no results were found.
Note that `Tag` objects in the results represent 'grandfathered' or 'redundant' tags. These are excluded by default. Set the `all` parameter to `true` to include them.
Search is case-insensitive if `description` is a string.
### tags.languages(macrolanguage) ###
Returns an array of `Subtag` objects representing all the 'language' type subtags belonging to the given 'macrolanguage' type subtag.
Throws an error if `macrolanguage` is not a macrolanguage.
```
> tags.languages('zh');
[Subtag, Subtag...]
> tags.languages('en');
Error: 'en' is not a valid macrolanguage.
```
### tags.language(subtag) ###
Convenience method to get a single 'language' type subtag. Can be used to validate an input value as a language subtag. Returns a `Subtag` object or `null`.
```
> tags.language('en');
Subtag
> tags.language('us');
null
```
### tags.region(subtag) ###
As above, but with 'region' type subtags.
```
> tags.region('mt');
Subtag
> tags.region('en');
null
```
### tags.type(subtag, type) ###
Get a subtag by type. Returns the subtag matching `type` as a `Subtag` object otherwise returns `null`.
A `type` consists of one of the following strings: 'language', 'extlang', 'script', 'region' or 'variant'. To get a 'grandfathered' or 'redundant' type tag use `tags(tag)`.
```
> tags.type('zh', 'macrolanguage');
Subtag
> tags.type('zh', 'script');
null
```
### tags.date() ###
Returns the file date for the underlying data, as a string.
```
> tags.date();
'2004-06-28'
```
### Subtag ###
#### subtag.type() ####
Get the subtag type (either 'language', 'extlang', 'script', 'region' or 'variant'). See [RFC 5646 section 2.2](http://tools.ietf.org/html/rfc5646#section-2.2) for type definitions.
#### subtag.descriptions() ####
Returns an array of description strings (a subtag may have more than one description).
```
> tags.language('ro').descriptions();
['Romanian', 'Moldavian', 'Moldovan']
```
#### subtag.preferred() ####
Returns a preferred subtag as a `Subtag` object if the subtag is deprecated. For example, `ro` is preferred over deprecated `mo`.
```
> tags.language('mo').preferred();
Subtag
```
#### subtag.script() ####
For subtags of type 'language' or 'extlang', returns a `Subtag` object representing the language's default script. See [RFC 5646 section 3.1.9](http://tools.ietf.org/html/rfc5646#section-3.1.9) for a definition of 'Suppress-Script'.
#### subtag.scope() ####
Returns the subtag scope as a string, or `null` if the subtag has no scope.
Tip: if the subtag represents a macrolanguage, you can use `tags.languages(macrolanguage)` to get a list of all the macrolanguage's individual languages.
```
> tags.language('zh').scope();
'macrolanguage'
> tags.language('nah').scope();
'collection'
```
#### subtag.deprecated() ####
Returns a date string reflecting the deprecation date if the subtag is deprecated, otherwise returns `null`.
```
> tags.language('ja').deprecated();
'2008-11-22'
```
#### subtag.added() ####
Returns a date string reflecting the date the subtag was added to the registry.
```
> tags.language('ja').added();
'2005-10-16'
```
#### subtag.comments() ####
Returns an array of comments, if any, otherwise returns an empty array.
```
> tags.language('nmf').comments();
['see ntx']
```
#### subtag.format() ####
Return the subtag code formatted according to the case conventions defined in [RFC 5646 section 2.1.1](http://tools.ietf.org/html/rfc5646#section-2.1.1).
- language codes are made lowercase ('mn' for Mongolian)
- script codes are made lowercase with the initial letter capitalized ('Cyrl' for Cyrillic)
- country codes are capitalized ('MN' for Mongolia)
### Tag ###
#### tag.preferred() ####
If the tag is listed as 'deprecated' or 'redundant' it might have a preferred value. This method returns a `Tag` object if so.
```
> tags('zh-cmn-Hant').preferred();
Tag
```
#### tag.type() ####
Returns `grandfathered` if the tag is grandfathered, `redundant` if the tag is redundant, and `tag` if neither. For a definition of grandfathered and redundant tags, see [RFC 5646 section 2.2.8](http://tools.ietf.org/html/rfc5646#section-2.2.8).
#### tag.subtags() ####
Returns an array of subtags making up the tag, as `Subtag` objects.
#### tag.language(), tag.region(), tag.script() ####
Shortcuts for `tag.find('language')`, `tag.find('region')` and `tag.find('script')`.
#### tag.find(type) ####
Find a subtag of the given type from those making up the tag.
#### tag.valid() ####
Returns `true` if the tag is valid, `false` otherwise.
#### tag.errors() ####
Returns an array of `Error` objects if the tag is invalid. The `message` property of each is readable and helpful enough for UI output. The `code` property can be checked against the `Tag.ERR_*` constants. Each error will also have either a `subtag` or `tag` property with the code of the offending tag.
#### tag.format() ####
Format a tag according to the case conventions defined in [RFC 5646 section 2.1.1](http://tools.ietf.org/html/rfc5646#section-2.1.1).
```
> tags('en-gb').format();
'en-GB'
```
#### tag.deprecated() ####
For grandfathered or redundant tags, returns a date string reflecting the deprecation date if the tag is deprecated.
```
> tags('zh-cmn-Hant').deprecated();
'2009-07-29'
```
#### tag.added() ####
For grandfathered or redundant tags, returns a date string reflecting the date the tag was added to the registry.
#### tag.descriptions() ####
Returns an array of tag descriptions for grandfathered or redundant tags, otherwise returns an empty array.
## Resources ##
- [Python version by the Flanders Heritage Agency](https://github.com/OnroerendErfgoed/language-tags)
- [Language Subtag Lookup tool by Richard Ishida](http://rishida.net/utils/subtags/)
- [W3C Internationalization Checker](http://validator.w3.org/i18n-checker/)
- [RFC 5646](http://tools.ietf.org/html/rfc5646)
## Credits and collaboration ##
Copyright (c) 2013, [Matthew Caruana Galizia](http://twitter.com/mcaruanagalizia).
The software part of this project is licensed under an [MIT licence](http://mattcg.mit-license.org/).
Comments, feedback and suggestions are welcome. Please feel free to raise an issue or pull request. Enjoy.
@@ -0,0 +1,89 @@
import { importDeclaration, ExportMap, createRule } from '../utils/index.js';
export default createRule({
name: 'no-named-as-default-member',
meta: {
type: 'suggestion',
docs: {
category: 'Helpful warnings',
description: 'Forbid use of exported name as property of default export.',
},
schema: [],
messages: {
member: "Caution: `{{objectName}}` also has a named export `{{propName}}`. Check if you meant to write `import {{{propName}}} from '{{sourcePath}}'` instead.",
},
},
defaultOptions: [],
create(context) {
const fileImports = new Map();
const allPropertyLookups = new Map();
function storePropertyLookup(objectName, propName, node) {
const lookups = allPropertyLookups.get(objectName) || [];
lookups.push({ node, propName });
allPropertyLookups.set(objectName, lookups);
}
return {
ImportDefaultSpecifier(node) {
const declaration = importDeclaration(context, node);
const exportMap = ExportMap.get(declaration.source.value, context);
if (exportMap == null) {
return;
}
if (exportMap.errors.length > 0) {
exportMap.reportErrors(context, declaration);
return;
}
fileImports.set(node.local.name, {
exportMap,
sourcePath: declaration.source.value,
});
},
MemberExpression(node) {
if ('name' in node.object && 'name' in node.property) {
storePropertyLookup(node.object.name, node.property.name, node);
}
},
VariableDeclarator(node) {
const isDestructure = node.id.type === 'ObjectPattern' && node.init?.type === 'Identifier';
if (!isDestructure ||
!node.init ||
!('name' in node.init) ||
!('properties' in node.id)) {
return;
}
const objectName = node.init.name;
for (const prop of node.id.properties) {
if (!('key' in prop) || !('name' in prop.key)) {
continue;
}
storePropertyLookup(objectName, prop.key.name, prop.key);
}
},
'Program:exit'() {
for (const [objectName, lookups] of allPropertyLookups.entries()) {
const fileImport = fileImports.get(objectName);
if (fileImport == null) {
continue;
}
for (const { propName, node } of lookups) {
if (propName === 'default') {
continue;
}
if (!fileImport.exportMap.namespace.has(propName)) {
continue;
}
context.report({
node,
messageId: 'member',
data: {
objectName,
propName,
sourcePath: fileImport.sourcePath,
},
});
}
}
},
};
},
});
//# sourceMappingURL=no-named-as-default-member.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L M G N O P","1028":"W X","1540":"Q H R S T U V"},C:{"1":"0 1 2 3 4 5 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"xC","164":"6 7 8 9 TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB 0C 1C","1540":"mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B"},D:{"1":"0 1 2 3 4 5 Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","292":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC","1028":"W X","1540":"CC DC EC FC GC HC IC JC KC LC Q H R S T U V"},E:{"1":"G 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","292":"J ZB K D E F A B C 2C ZC 3C 4C 5C 6C aC NC","1540":"L M OC 7C","3076":"8C"},F:{"1":"0 1 2 3 4 5 JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C FD GD HD ID NC uC JD OC","292":"6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B","1028":"HC IC","1540":"1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC"},G:{"1":"dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","292":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD","1540":"WD XD YD ZD aD bD","3076":"cD"},H:{"2":"hD"},I:{"1":"I","292":"TC J iD jD kD lD vC mD nD"},J:{"292":"D A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB xD QC RC SC yD","292":"J oD pD qD rD sD","1540":"aC tD uD vD wD"},Q:{"1540":"zD"},R:{"1":"0D"},S:{"1":"2D","1540":"1D"}},B:5,C:"CSS Logical Properties",D:true};
@@ -0,0 +1,547 @@
"use client";
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/menu.tsx
var menu_exports = {};
__export(menu_exports, {
default: () => menu_default
});
module.exports = __toCommonJS(menu_exports);
var import_system4 = require("@heroui/system");
var import_theme4 = require("@heroui/theme");
// src/use-menu.ts
var import_system = require("@heroui/system");
var import_menu = require("@react-aria/menu");
var import_theme = require("@heroui/theme");
var import_tree = require("@react-stately/tree");
var import_react_utils = require("@heroui/react-utils");
var import_react = require("react");
var import_shared_utils = require("@heroui/shared-utils");
function useMenu(props) {
var _a;
const globalContext = (0, import_system.useProviderContext)();
const {
as,
ref,
variant,
color,
children,
disableAnimation = (_a = globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _a : false,
onAction,
closeOnSelect,
itemClasses,
className,
state: propState,
topContent,
bottomContent,
hideEmptyContent = false,
hideSelectedIcon = false,
emptyContent = "No items.",
menuProps: userMenuProps,
onClose,
classNames,
...otherProps
} = props;
const Component = as || "ul";
const domRef = (0, import_react_utils.useDOMRef)(ref);
const shouldFilterDOMProps = typeof Component === "string";
const innerState = (0, import_tree.useTreeState)({ ...otherProps, ...userMenuProps, children });
const state = propState || innerState;
const { menuProps } = (0, import_menu.useMenu)({ ...otherProps, ...userMenuProps, onAction }, state, domRef);
const slots = (0, import_react.useMemo)(() => (0, import_theme.menu)({ className }), [className]);
const baseStyles = (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.base, className);
const getBaseProps = (props2 = {}) => {
return {
ref: domRef,
"data-slot": "base",
className: slots.base({ class: baseStyles }),
...(0, import_react_utils.filterDOMProps)(otherProps, {
enabled: shouldFilterDOMProps
}),
...props2
};
};
const getListProps = (props2 = {}) => {
return {
"data-slot": "list",
className: slots.list({ class: classNames == null ? void 0 : classNames.list }),
...menuProps,
...props2
};
};
const getEmptyContentProps = (props2 = {}) => {
return {
children: emptyContent,
className: slots.emptyContent({ class: classNames == null ? void 0 : classNames.emptyContent }),
...props2
};
};
return {
Component,
state,
variant,
color,
disableAnimation,
onClose,
topContent,
bottomContent,
closeOnSelect,
className,
itemClasses,
getBaseProps,
getListProps,
hideEmptyContent,
hideSelectedIcon,
getEmptyContentProps
};
}
// src/menu-section.tsx
var import_theme3 = require("@heroui/theme");
var import_menu3 = require("@react-aria/menu");
var import_react4 = require("react");
var import_system3 = require("@heroui/system");
var import_utils2 = require("@react-aria/utils");
var import_shared_utils3 = require("@heroui/shared-utils");
var import_divider = require("@heroui/divider");
// src/menu-item.tsx
var import_react3 = require("react");
// src/use-menu-item.ts
var import_react2 = require("react");
var import_theme2 = require("@heroui/theme");
var import_system2 = require("@heroui/system");
var import_focus = require("@react-aria/focus");
var import_shared_utils2 = require("@heroui/shared-utils");
var import_menu2 = require("@react-aria/menu");
var import_interactions = require("@react-aria/interactions");
var import_utils = require("@react-aria/utils");
var import_use_is_mobile = require("@heroui/use-is-mobile");
var import_react_utils2 = require("@heroui/react-utils");
function useMenuItem(originalProps) {
var _a, _b;
const globalContext = (0, import_system2.useProviderContext)();
const [props, variantProps] = (0, import_system2.mapPropsVariants)(originalProps, import_theme2.menuItem.variantKeys);
const {
as,
item,
state,
shortcut,
description,
startContent,
endContent,
isVirtualized,
selectedIcon,
className,
classNames,
onAction,
autoFocus,
onPress,
onPressStart,
onPressUp,
onPressEnd,
onPressChange,
onHoverStart: hoverStartProp,
onHoverChange,
onHoverEnd,
hideSelectedIcon = false,
isReadOnly = false,
closeOnSelect,
onClose,
onClick: deprecatedOnClick,
...otherProps
} = props;
const disableAnimation = (_b = (_a = originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;
const domRef = (0, import_react2.useRef)(null);
const Component = as || ((otherProps == null ? void 0 : otherProps.href) ? "a" : "li");
const shouldFilterDOMProps = typeof Component === "string";
const { rendered, key } = item;
const isDisabledProp = state.disabledKeys.has(key) || originalProps.isDisabled;
const isSelectable = state.selectionManager.selectionMode !== "none";
const isMobile = (0, import_use_is_mobile.useIsMobile)();
const { isFocusVisible, focusProps } = (0, import_focus.useFocusRing)({
autoFocus
});
if (deprecatedOnClick && typeof deprecatedOnClick === "function") {
(0, import_shared_utils2.warn)(
"onClick is deprecated, please use onPress instead. See: https://github.com/heroui-inc/heroui/issues/4292",
"MenuItem"
);
}
const handlePress = (0, import_react2.useCallback)(
(e) => {
deprecatedOnClick == null ? void 0 : deprecatedOnClick(e);
onPress == null ? void 0 : onPress(e);
},
[deprecatedOnClick, onPress]
);
const {
isPressed,
isFocused,
isSelected,
isDisabled,
menuItemProps,
labelProps,
descriptionProps,
keyboardShortcutProps
} = (0, import_menu2.useMenuItem)(
{
key,
onClose,
isDisabled: isDisabledProp,
onPress: handlePress,
onPressStart,
onPressUp,
onPressEnd,
onPressChange,
"aria-label": props["aria-label"],
closeOnSelect,
isVirtualized,
onAction
},
state,
domRef
);
let { hoverProps, isHovered } = (0, import_interactions.useHover)({
isDisabled,
onHoverStart(e) {
if (!(0, import_interactions.isFocusVisible)()) {
state.selectionManager.setFocused(true);
state.selectionManager.setFocusedKey(key);
}
hoverStartProp == null ? void 0 : hoverStartProp(e);
},
onHoverChange,
onHoverEnd
});
let itemProps = menuItemProps;
const slots = (0, import_react2.useMemo)(
() => (0, import_theme2.menuItem)({
...variantProps,
isDisabled,
disableAnimation,
hasTitleTextChild: typeof rendered === "string",
hasDescriptionTextChild: typeof description === "string"
}),
[(0, import_shared_utils2.objectToDeps)(variantProps), isDisabled, disableAnimation, rendered, description]
);
const baseStyles = (0, import_shared_utils2.clsx)(classNames == null ? void 0 : classNames.base, className);
if (isReadOnly) {
itemProps = (0, import_shared_utils2.removeEvents)(itemProps);
}
const getItemProps = (props2 = {}) => ({
ref: domRef,
...(0, import_utils.mergeProps)(
isReadOnly ? {} : focusProps,
(0, import_react_utils2.filterDOMProps)(otherProps, {
enabled: shouldFilterDOMProps
}),
itemProps,
hoverProps,
props2
),
"data-focus": (0, import_shared_utils2.dataAttr)(isFocused),
"data-selectable": (0, import_shared_utils2.dataAttr)(isSelectable),
"data-hover": (0, import_shared_utils2.dataAttr)(isMobile ? isHovered || isPressed : isHovered),
"data-disabled": (0, import_shared_utils2.dataAttr)(isDisabled),
"data-selected": (0, import_shared_utils2.dataAttr)(isSelected),
"data-pressed": (0, import_shared_utils2.dataAttr)(isPressed),
"data-focus-visible": (0, import_shared_utils2.dataAttr)(isFocusVisible),
className: slots.base({ class: (0, import_shared_utils2.clsx)(baseStyles, props2.className) })
});
const getLabelProps = (props2 = {}) => ({
...(0, import_utils.mergeProps)(labelProps, props2),
className: slots.title({ class: classNames == null ? void 0 : classNames.title })
});
const getDescriptionProps = (props2 = {}) => ({
...(0, import_utils.mergeProps)(descriptionProps, props2),
className: slots.description({ class: classNames == null ? void 0 : classNames.description })
});
const getKeyboardShortcutProps = (props2 = {}) => ({
...(0, import_utils.mergeProps)(keyboardShortcutProps, props2),
className: slots.shortcut({ class: classNames == null ? void 0 : classNames.shortcut })
});
const getSelectedIconProps = (0, import_react2.useCallback)(
(props2 = {}) => {
return {
"aria-hidden": (0, import_shared_utils2.dataAttr)(true),
"data-disabled": (0, import_shared_utils2.dataAttr)(isDisabled),
className: slots.selectedIcon({ class: classNames == null ? void 0 : classNames.selectedIcon }),
...props2
};
},
[isDisabled, slots, classNames]
);
return {
Component,
domRef,
slots,
classNames,
isSelectable,
isSelected,
isDisabled,
rendered,
shortcut,
description,
startContent,
endContent,
selectedIcon,
disableAnimation,
getItemProps,
getLabelProps,
hideSelectedIcon,
getDescriptionProps,
getKeyboardShortcutProps,
getSelectedIconProps
};
}
// src/menu-selected-icon.tsx
var import_jsx_runtime = require("react/jsx-runtime");
function MenuSelectedIcon(props) {
const { isSelected, disableAnimation, ...otherProps } = props;
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"svg",
{
"aria-hidden": "true",
"data-selected": isSelected,
role: "presentation",
viewBox: "0 0 17 18",
...otherProps,
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"polyline",
{
fill: "none",
points: "1 9 7 14 15 4",
stroke: "currentColor",
strokeDasharray: 22,
strokeDashoffset: isSelected ? 44 : 66,
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: 1.5,
style: !disableAnimation ? {
transition: "stroke-dashoffset 200ms ease"
} : {}
}
)
}
);
}
// src/menu-item.tsx
var import_jsx_runtime2 = require("react/jsx-runtime");
var MenuItem = (props) => {
const {
Component,
slots,
classNames,
rendered,
shortcut,
description,
isSelectable,
isSelected,
isDisabled,
selectedIcon,
startContent,
endContent,
disableAnimation,
hideSelectedIcon,
getItemProps,
getLabelProps,
getDescriptionProps,
getKeyboardShortcutProps,
getSelectedIconProps
} = useMenuItem(props);
const selectedContent = (0, import_react3.useMemo)(() => {
const defaultIcon = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MenuSelectedIcon, { disableAnimation, isSelected });
if (typeof selectedIcon === "function") {
return selectedIcon({ icon: defaultIcon, isSelected, isDisabled });
}
if (selectedIcon)
return selectedIcon;
return defaultIcon;
}, [selectedIcon, isSelected, isDisabled, disableAnimation]);
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Component, { ...getItemProps(), children: [
startContent,
description ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { ...getLabelProps(), children: rendered }),
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { ...getDescriptionProps(), children: description })
] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { ...getLabelProps(), children: rendered }),
shortcut && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("kbd", { ...getKeyboardShortcutProps(), children: shortcut }),
isSelectable && !hideSelectedIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { ...getSelectedIconProps(), children: selectedContent }),
endContent
] });
};
MenuItem.displayName = "HeroUI.MenuItem";
var menu_item_default = MenuItem;
// src/menu-section.tsx
var import_jsx_runtime3 = require("react/jsx-runtime");
var MenuSection = (0, import_system3.forwardRef)(
({
item,
state,
as,
variant,
color,
disableAnimation,
onAction,
closeOnSelect,
className,
classNames,
showDivider = false,
hideSelectedIcon,
dividerProps = {},
itemClasses,
title,
...otherProps
}, _) => {
const Component = as || "li";
const slots = (0, import_react4.useMemo)(() => (0, import_theme3.menuSection)(), []);
const baseStyles = (0, import_shared_utils3.clsx)(classNames == null ? void 0 : classNames.base, className);
const dividerStyles = (0, import_shared_utils3.clsx)(classNames == null ? void 0 : classNames.divider, dividerProps == null ? void 0 : dividerProps.className);
const { itemProps, headingProps, groupProps } = (0, import_menu3.useMenuSection)({
heading: item.rendered,
"aria-label": item["aria-label"]
});
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
Component,
{
"data-slot": "base",
...(0, import_utils2.mergeProps)(itemProps, otherProps),
className: slots.base({ class: baseStyles }),
children: [
item.rendered && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
"span",
{
...headingProps,
className: slots.heading({ class: classNames == null ? void 0 : classNames.heading }),
"data-slot": "heading",
children: item.rendered
}
),
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
"ul",
{
...groupProps,
className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
"data-has-title": !!item.rendered,
"data-slot": "group",
children: [
[...item.childNodes].map((node) => {
const { key: nodeKey, props: nodeProps } = node;
let menuItem2 = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
menu_item_default,
{
classNames: itemClasses,
closeOnSelect,
color,
disableAnimation,
hideSelectedIcon,
item: node,
state,
variant,
onAction,
...nodeProps
},
nodeKey
);
if (node.wrapper) {
menuItem2 = node.wrapper(menuItem2);
}
return menuItem2;
}),
showDivider && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
import_divider.Divider,
{
as: "li",
className: slots.divider({
class: dividerStyles
}),
...dividerProps
}
)
]
}
)
]
}
);
}
);
MenuSection.displayName = "HeroUI.MenuSection";
var menu_section_default = MenuSection;
// src/menu.tsx
var import_jsx_runtime4 = require("react/jsx-runtime");
var Menu = (0, import_system4.forwardRef)(function Menu2(props, ref) {
const {
Component,
state,
closeOnSelect,
color,
disableAnimation,
hideSelectedIcon,
hideEmptyContent,
variant,
onClose,
topContent,
bottomContent,
itemClasses,
getBaseProps,
getListProps,
getEmptyContentProps
} = useMenu({ ...props, ref });
const content = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Component, { ...getListProps(), children: [
!state.collection.size && !hideEmptyContent && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { ...getEmptyContentProps() }) }),
[...state.collection].map((item) => {
const itemProps = {
closeOnSelect,
color,
disableAnimation,
item,
state,
variant,
onClose,
hideSelectedIcon,
...item.props
};
const mergedItemClasses = (0, import_theme4.mergeClasses)(itemClasses, itemProps == null ? void 0 : itemProps.classNames);
if (item.type === "section") {
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(menu_section_default, { ...itemProps, itemClasses: mergedItemClasses }, item.key);
}
let menuItem2 = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(menu_item_default, { ...itemProps, classNames: mergedItemClasses }, item.key);
if (item.wrapper) {
menuItem2 = item.wrapper(menuItem2);
}
return menuItem2;
})
] });
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { ...getBaseProps(), children: [
topContent,
content,
bottomContent
] });
});
var menu_default = Menu;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {});
@@ -0,0 +1,99 @@
{
"name": "set-function-name",
"version": "2.0.2",
"description": "Set a function's name property",
"main": "index.js",
"types": "./index.d.ts",
"directories": {
"test": "test"
},
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"prelint": "evalmd README.md",
"lint": "eslint --ext=js,mjs .",
"postlint": "tsc -p .",
"pretest": "npm run lint",
"tests-only": "tape 'test/**/*.js'",
"test": "npm run tests-only",
"posttest": "aud --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/ljharb/set-function-name.git"
},
"keywords": [
"set",
"assign",
"function",
"name",
"function.name"
],
"author": "Jordan Harband <ljharb@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/ljharb/set-function-name/issues"
},
"homepage": "https://github.com/ljharb/set-function-name#readme",
"devDependencies": {
"@ljharb/eslint-config": "^21.1.0",
"@types/call-bind": "^1.0.5",
"@types/define-properties": "^1.1.5",
"@types/es-value-fixtures": "^1.4.4",
"@types/for-each": "^0.3.3",
"@types/function.prototype.name": "^1.1.3",
"@types/functions-have-names": "^1.2.2",
"@types/has-property-descriptors": "^1.0.3",
"@types/make-arrow-function": "^1.2.2",
"@types/make-async-function": "^1.0.2",
"@types/make-async-generator-function": "^1.0.3",
"@types/make-generator-function": "^2.0.3",
"@types/object-inspect": "^1.8.4",
"@types/tape": "^5.6.4",
"aud": "^2.0.4",
"auto-changelog": "^2.4.0",
"es-value-fixtures": "^1.4.2",
"eslint": "=8.8.0",
"evalmd": "^0.0.19",
"for-each": "^0.3.3",
"function.prototype.name": "^1.1.6",
"in-publish": "^2.0.1",
"make-arrow-function": "^1.2.0",
"make-async-function": "^1.0.0",
"make-async-generator-function": "^1.0.0",
"make-generator-function": "^2.0.0",
"npmignore": "^0.3.1",
"object-inspect": "^1.13.1",
"safe-publish-latest": "^2.0.0",
"tape": "^5.7.5",
"typescript": "next"
},
"dependencies": {
"define-data-property": "^1.1.4",
"es-errors": "^1.3.0",
"functions-have-names": "^1.2.3",
"has-property-descriptors": "^1.0.2"
},
"engines": {
"node": ">= 0.4"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows",
"test",
"!*.d.ts",
"!*.d.ts.map"
]
}
}
@@ -0,0 +1,5 @@
export { TRANSITION_DEFAULTS, TRANSITION_EASINGS, TRANSITION_VARIANTS, TransitionConfig, TransitionEndConfig, TransitionProperties, Variants } from './transition-utils.js';
export { ResizablePanel, ResizablePanelProps } from './resizable-panel.js';
import 'framer-motion';
import 'react';
import '@heroui/system';
@@ -0,0 +1 @@
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8CAAsB;AACtB,8CAAsB;AACtB,8CAAsB;AACtB,oDAA4B;AAC5B,kDAAgC;AAEhC,2CAAkE;AAElE,kFAAwD;AAExD,MAAM,KAAK,GAAG,eAAW,CAAC,yBAAyB,CAAC,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAqB,eAAgB,SAAQ,kBAAK;IAIjD,YAAY,KAAsC;QACjD,IAAI,IAA4B,CAAC;QACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC9B,IAAI,GAAG,aAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxB;aAAM;YACN,IAAI,GAAG,KAAK,CAAC;SACb;QACD,IAAI,CAAC,IAAI,EAAE;YACV,MAAM,IAAI,KAAK,CACd,8DAA8D,CAC9D,CAAC;SACF;QACD,KAAK,CAAC,2CAA2C,EAAE,IAAI,CAAC,CAAC;QACzD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,MAAM,KAAK,qBAAgC,IAAI,CAAE,CAAC;QAElD,wDAAwD;QACxD,uBAAuB;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/D,+DAA+D;QAC/D,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC;QAC1C,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YACnC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SACtC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC9B,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;SACzC;QAED,sCAAsC;QACtC,sEAAsE;QACtE,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,eAAe,IAAI,KAAK,CAAC,EAAE;YACpD,KAAK,CAAC,aAAa,GAAG,CAAC,UAAU,CAAC,CAAC;SACnC;QAED,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC7B,kEAAkE;YAClE,8DAA8D;YAC9D,iEAAiE;YACjE,8BAA8B;YAC9B,OAAO,KAAK,CAAC,IAAI,CAAC;YAClB,OAAO,KAAK,CAAC,QAAQ,CAAC;SACtB;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACG,QAAQ,CACb,GAAkB,EAClB,IAAoB;;YAEpB,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;YAEpC,kDAAkD;YAClD,IAAI,MAAkB,CAAC;YACvB,IAAI,WAAW,EAAE;gBAChB,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA8B,CAAC,CAAC;aACrD;iBAAM;gBACN,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA2B,CAAC,CAAC;aAClD;YAED,MAAM,OAAO,qBAA6B,KAAK,CAAC,OAAO,CAAE,CAAC;YAC1D,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAC7C,IAAI,OAAO,GAAG,WAAW,QAAQ,eAAe,CAAC;YAEjD,wDAAwD;YACxD,IAAI,KAAK,CAAC,IAAI,EAAE;gBACf,OAAO,CAAC,qBAAqB,CAAC,GAAG,SAAS,MAAM,CAAC,IAAI,CACpD,KAAK,CAAC,IAAI,CACV,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;aACvB;YAED,iDAAiD;YACjD,0CAA0C;YAC1C,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;YAC1C,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE;gBACzC,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;aACnB;YACD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;YAEpB,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC;YAC7B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;gBACxC,OAAO,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;aAC3C;YAED,MAAM,oBAAoB,GAAG,8BAAkB,CAAC,MAAM,CAAC,CAAC;YAExD,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,MAAM,CAAC,CAAC;YAE/B,MAAM,EACL,UAAU,EACV,QAAQ,EACR,GAAG,MAAM,oBAAoB,CAAC;YAE/B,IAAI,UAAU,KAAK,GAAG,EAAE;gBACvB,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;gBAE3B,IAAI,IAAI,CAAC,cAAc,EAAE;oBACxB,sDAAsD;oBACtD,8CAA8C;oBAC9C,KAAK,CAAC,oCAAoC,CAAC,CAAC;oBAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC;oBAChD,OAAO,aAAG,CAAC,OAAO,iCACd,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,KACjD,MAAM;wBACN,UAAU,IACT,CAAC;iBACH;gBAED,OAAO,MAAM,CAAC;aACd;YAED,oEAAoE;YACpE,kEAAkE;YAClE,iEAAiE;YACjE,qBAAqB;YAErB,iEAAiE;YACjE,0DAA0D;YAC1D,oEAAoE;YACpE,mBAAmB;YACnB,EAAE;YACF,4CAA4C;YAC5C,MAAM,CAAC,OAAO,EAAE,CAAC;YAEjB,MAAM,UAAU,GAAG,IAAI,aAAG,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;YACvD,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC;YAE3B,oEAAoE;YACpE,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAa,EAAE,EAAE;gBACpC,KAAK,CAAC,2CAA2C,CAAC,CAAC;gBACnD,gBAAM,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;gBAEpC,gEAAgE;gBAChE,8DAA8D;gBAC9D,YAAY;gBACZ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACjB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACd,CAAC,CAAC,CAAC;YAEH,OAAO,UAAU,CAAC;QACnB,CAAC;KAAA;CACD;AA3JD,kCA2JC;AAED,SAAS,MAAM,CAAC,MAAkC;IACjD,MAAM,CAAC,MAAM,EAAE,CAAC;AACjB,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,MAAe;IACnD,OAAO,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,OAAO,CAAC,QAAwB;IACxC,OAAO,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC3E,CAAC;AAED,SAAS,IAAI,CACZ,GAAM,EACN,GAAG,IAAO;IAIV,MAAM,GAAG,GAAG,EAEX,CAAC;IACF,IAAI,GAAqB,CAAC;IAC1B,KAAK,GAAG,IAAI,GAAG,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACxB,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;SACpB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=resolveScoped.spec.d.ts.map
@@ -0,0 +1,46 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
/**
* Merge two visitors.
* This function modifies `visitor1` directly to merge.
* @param {Visitor} visitor1 The visitor which is assigned.
* @param {Visitor} visitor2 The visitor which is assigning.
* @returns {Visitor} `visitor1`.
*/
module.exports = function mergeVisitorsInPlace(visitor1, visitor2) {
for (const key of Object.keys(visitor2)) {
const handler1 = visitor1[key]
const handler2 = visitor2[key]
if (typeof handler1 === "function") {
if (handler1._handlers) {
handler1._handlers.push(handler2)
} else {
const handlers = [handler1, handler2]
visitor1[key] = Object.assign(dispatch.bind(null, handlers), {
_handlers: handlers,
})
}
} else {
visitor1[key] = handler2
}
}
return visitor1
}
/**
* Dispatch all given functions with a node.
* @param {function[]} handlers The function list to call.
* @param {Node} node The AST node to be handled.
* @returns {void}
*/
function dispatch(handlers, node) {
for (const h of handlers) {
h(node)
}
}
@@ -0,0 +1,102 @@
import { Composer } from './compose/composer.js';
import { Document } from './doc/Document.js';
import { prettifyError, YAMLParseError } from './errors.js';
import { warn } from './log.js';
import { isDocument } from './nodes/identity.js';
import { LineCounter } from './parse/line-counter.js';
import { Parser } from './parse/parser.js';
function parseOptions(options) {
const prettyErrors = options.prettyErrors !== false;
const lineCounter = options.lineCounter || (prettyErrors && new LineCounter()) || null;
return { lineCounter, prettyErrors };
}
/**
* Parse the input as a stream of YAML documents.
*
* Documents should be separated from each other by `...` or `---` marker lines.
*
* @returns If an empty `docs` array is returned, it will be of type
* EmptyStream and contain additional stream information. In
* TypeScript, you should use `'empty' in docs` as a type guard for it.
*/
function parseAllDocuments(source, options = {}) {
const { lineCounter, prettyErrors } = parseOptions(options);
const parser = new Parser(lineCounter?.addNewLine);
const composer = new Composer(options);
const docs = Array.from(composer.compose(parser.parse(source)));
if (prettyErrors && lineCounter)
for (const doc of docs) {
doc.errors.forEach(prettifyError(source, lineCounter));
doc.warnings.forEach(prettifyError(source, lineCounter));
}
if (docs.length > 0)
return docs;
return Object.assign([], { empty: true }, composer.streamInfo());
}
/** Parse an input string into a single YAML.Document */
function parseDocument(source, options = {}) {
const { lineCounter, prettyErrors } = parseOptions(options);
const parser = new Parser(lineCounter?.addNewLine);
const composer = new Composer(options);
// `doc` is always set by compose.end(true) at the very latest
let doc = null;
for (const _doc of composer.compose(parser.parse(source), true, source.length)) {
if (!doc)
doc = _doc;
else if (doc.options.logLevel !== 'silent') {
doc.errors.push(new YAMLParseError(_doc.range.slice(0, 2), 'MULTIPLE_DOCS', 'Source contains multiple documents; please use YAML.parseAllDocuments()'));
break;
}
}
if (prettyErrors && lineCounter) {
doc.errors.forEach(prettifyError(source, lineCounter));
doc.warnings.forEach(prettifyError(source, lineCounter));
}
return doc;
}
function parse(src, reviver, options) {
let _reviver = undefined;
if (typeof reviver === 'function') {
_reviver = reviver;
}
else if (options === undefined && reviver && typeof reviver === 'object') {
options = reviver;
}
const doc = parseDocument(src, options);
if (!doc)
return null;
doc.warnings.forEach(warning => warn(doc.options.logLevel, warning));
if (doc.errors.length > 0) {
if (doc.options.logLevel !== 'silent')
throw doc.errors[0];
else
doc.errors = [];
}
return doc.toJS(Object.assign({ reviver: _reviver }, options));
}
function stringify(value, replacer, options) {
let _replacer = null;
if (typeof replacer === 'function' || Array.isArray(replacer)) {
_replacer = replacer;
}
else if (options === undefined && replacer) {
options = replacer;
}
if (typeof options === 'string')
options = options.length;
if (typeof options === 'number') {
const indent = Math.round(options);
options = indent < 1 ? undefined : indent > 8 ? { indent: 8 } : { indent };
}
if (value === undefined) {
const { keepUndefined } = options ?? replacer ?? {};
if (!keepUndefined)
return undefined;
}
if (isDocument(value) && !_replacer)
return value.toString(options);
return new Document(value, _replacer, options).toString(options);
}
export { parse, parseAllDocuments, parseDocument, stringify };
@@ -0,0 +1,16 @@
1.0.2 / 2015-10-07
==================
* use try/catch when checking `localStorage` (#3, @kumavis)
1.0.1 / 2014-11-25
==================
* browser: use `console.warn()` for deprecation calls
* browser: more jsdocs
1.0.0 / 2014-04-30
==================
* initial commit
@@ -0,0 +1 @@
{"version":3,"file":"BindingFluentSyntaxImplementation.spec.d.ts","sourceRoot":"","sources":["../../../../src/binding/models/BindingFluentSyntaxImplementation.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
import getSideChannelList from 'side-channel-list';
import getSideChannelMap from 'side-channel-map';
import getSideChannelWeakMap from 'side-channel-weakmap';
declare namespace getSideChannel {
type Channel<K, V> =
| getSideChannelList.Channel<K, V>
| ReturnType<Exclude<typeof getSideChannelMap<K, V>, false>>
| ReturnType<Exclude<typeof getSideChannelWeakMap<K, V>, false>>;
}
declare function getSideChannel<K, V>(): getSideChannel.Channel<K, V>;
export = getSideChannel;
@@ -0,0 +1 @@
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAuCD,MAAM,0CAAoB;AAMnB,SAAS,0CAAa,KAAqB;IAChD,IAAI,cACF,UAAU,oBACV,gBAAgB,kBAChB,cAAc,eACd,WAAW,aACX,YAAY,mEACZ,wBAAwB,EACzB,GAAG;IAEJ,MAAM,UAAU,CAAA,GAAA,aAAK,EAA6C;IAClE,IAAI,qBAAC,iBAAiB,wBAAE,oBAAoB,EAAC,GAAG,CAAA,GAAA,yBAAiB;IAEjE,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAO,EAAE;oBAC1B;QACA,cAAa,CAAC;YACZ,EAAE,mBAAmB;YACrB,IAAI,EAAE,WAAW,KAAK,WAAW,EAAE,WAAW,KAAK,SAAS;gBAC1D,IAAI,kBACF,iBAAiB;oBACf,GAAG,CAAC;oBACJ,MAAM;gBACR;gBAGF,QAAQ,OAAO,GAAG,WAAW;oBAC3B,iEAAiE;oBACjE,EAAE,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,iBAAiB;wBAAC,SAAS;oBAAI;oBACvE,IAAI,aACF,YAAY;wBACV,GAAG,CAAC;wBACJ,MAAM;oBACR;oBAEF,QAAQ,OAAO,GAAG;gBACpB,GAAG;gBAEH,2EAA2E;gBAC3E,IAAI,EAAE,WAAW,KAAK,SAAS;oBAC7B,IAAI,gBAAgB,CAAA;wBAClB,EAAE,cAAc;oBAClB;oBAEA,kBAAkB,EAAE,MAAM,EAAE,eAAe,eAAe;wBAAC,MAAM;oBAAI;oBACrE,kBAAkB,QAAQ,aAAa;wBACrC,+EAA+E;wBAC/E,wEAAwE;wBACxE,WAAW;4BACT,qBAAqB,EAAE,MAAM,EAAE,eAAe;wBAChD,GAAG;oBACL,GAAG;wBAAC,MAAM;oBAAI;gBAChB;YACF;QACF;QACA,YAAW,CAAC;YACV,IAAI,QAAQ,OAAO,EACjB,aAAa,QAAQ,OAAO;YAG9B,IAAI,kBAAmB,CAAA,EAAE,WAAW,KAAK,WAAW,EAAE,WAAW,KAAK,OAAM,GAC1E,eAAe;gBACb,GAAG,CAAC;gBACJ,MAAM;YACR;QAEJ;IACF;IAEA,IAAI,mBAAmB,CAAA,GAAA,qBAAa,EAAE,eAAe,CAAC,aAAa,2BAA2B;IAE9F,OAAO;QACL,gBAAgB,CAAA,GAAA,iBAAS,EAAE,YAAY;IACzC;AACF","sources":["packages/@react-aria/interactions/src/useLongPress.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, LongPressEvent} from '@react-types/shared';\nimport {mergeProps, useDescription, useGlobalListeners} from '@react-aria/utils';\nimport {usePress} from './usePress';\nimport {useRef} from 'react';\n\nexport interface LongPressProps {\n /** Whether long press events should be disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a long press interaction starts. */\n onLongPressStart?: (e: LongPressEvent) => void,\n /**\n * Handler that is called when a long press interaction ends, either\n * over the target or when the pointer leaves the target.\n */\n onLongPressEnd?: (e: LongPressEvent) => void,\n /**\n * Handler that is called when the threshold time is met while\n * the press is over the target.\n */\n onLongPress?: (e: LongPressEvent) => void,\n /**\n * The amount of time in milliseconds to wait before triggering a long press.\n * @default 500ms\n */\n threshold?: number,\n /**\n * A description for assistive techology users indicating that a long press\n * action is available, e.g. \"Long press to open menu\".\n */\n accessibilityDescription?: string\n}\n\nexport interface LongPressResult {\n /** Props to spread on the target element. */\n longPressProps: DOMAttributes\n}\n\nconst DEFAULT_THRESHOLD = 500;\n\n/**\n * Handles long press interactions across mouse and touch devices. Supports a customizable time threshold,\n * accessibility description, and normalizes behavior across browsers and devices.\n */\nexport function useLongPress(props: LongPressProps): LongPressResult {\n let {\n isDisabled,\n onLongPressStart,\n onLongPressEnd,\n onLongPress,\n threshold = DEFAULT_THRESHOLD,\n accessibilityDescription\n } = props;\n\n const timeRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n let {addGlobalListener, removeGlobalListener} = useGlobalListeners();\n\n let {pressProps} = usePress({\n isDisabled,\n onPressStart(e) {\n e.continuePropagation();\n if (e.pointerType === 'mouse' || e.pointerType === 'touch') {\n if (onLongPressStart) {\n onLongPressStart({\n ...e,\n type: 'longpressstart'\n });\n }\n\n timeRef.current = setTimeout(() => {\n // Prevent other usePress handlers from also handling this event.\n e.target.dispatchEvent(new PointerEvent('pointercancel', {bubbles: true}));\n if (onLongPress) {\n onLongPress({\n ...e,\n type: 'longpress'\n });\n }\n timeRef.current = undefined;\n }, threshold);\n\n // Prevent context menu, which may be opened on long press on touch devices\n if (e.pointerType === 'touch') {\n let onContextMenu = e => {\n e.preventDefault();\n };\n\n addGlobalListener(e.target, 'contextmenu', onContextMenu, {once: true});\n addGlobalListener(window, 'pointerup', () => {\n //Line truncated
@@ -0,0 +1 @@
"use strict";const e=require("module"),s=new Set(["assert/strict","node:assert/strict","diagnostics_channel","node:diagnostics_channel","dns/promises","node:dns/promises","fs/promises","node:fs/promises","inspector/promises","node:inspector/promises","path/posix","node:path/posix","path/win32","node:path/win32","readline/promises","node:readline/promises","node:sea","stream/consumers","node:stream/consumers","stream/promises","node:stream/promises","stream/web","node:stream/web","node:test/reporters","test/mock_loader","node:test/mock_loader","node:test","timers/promises","node:timers/promises","util/types","node:util/types","wasi","node:wasi"].concat(e.builtinModules,e.builtinModules.map(e=>"node:"+e)));module.exports=(e,o)=>s.has(e);
@@ -0,0 +1,134 @@
// call it on itself so we can test the export val for basic stuff
module.exports = colorSupport({ alwaysReturn: true }, colorSupport)
function hasNone (obj, options) {
obj.level = 0
obj.hasBasic = false
obj.has256 = false
obj.has16m = false
if (!options.alwaysReturn) {
return false
}
return obj
}
function hasBasic (obj) {
obj.hasBasic = true
obj.has256 = false
obj.has16m = false
obj.level = 1
return obj
}
function has256 (obj) {
obj.hasBasic = true
obj.has256 = true
obj.has16m = false
obj.level = 2
return obj
}
function has16m (obj) {
obj.hasBasic = true
obj.has256 = true
obj.has16m = true
obj.level = 3
return obj
}
function colorSupport (options, obj) {
options = options || {}
obj = obj || {}
// if just requesting a specific level, then return that.
if (typeof options.level === 'number') {
switch (options.level) {
case 0:
return hasNone(obj, options)
case 1:
return hasBasic(obj)
case 2:
return has256(obj)
case 3:
return has16m(obj)
}
}
obj.level = 0
obj.hasBasic = false
obj.has256 = false
obj.has16m = false
if (typeof process === 'undefined' ||
!process ||
!process.stdout ||
!process.env ||
!process.platform) {
return hasNone(obj, options)
}
var env = options.env || process.env
var stream = options.stream || process.stdout
var term = options.term || env.TERM || ''
var platform = options.platform || process.platform
if (!options.ignoreTTY && !stream.isTTY) {
return hasNone(obj, options)
}
if (!options.ignoreDumb && term === 'dumb' && !env.COLORTERM) {
return hasNone(obj, options)
}
if (platform === 'win32') {
return hasBasic(obj)
}
if (env.TMUX) {
return has256(obj)
}
if (!options.ignoreCI && (env.CI || env.TEAMCITY_VERSION)) {
if (env.TRAVIS) {
return has256(obj)
} else {
return hasNone(obj, options)
}
}
// TODO: add more term programs
switch (env.TERM_PROGRAM) {
case 'iTerm.app':
var ver = env.TERM_PROGRAM_VERSION || '0.'
if (/^[0-2]\./.test(ver)) {
return has256(obj)
} else {
return has16m(obj)
}
case 'HyperTerm':
case 'Hyper':
return has16m(obj)
case 'MacTerm':
return has16m(obj)
case 'Apple_Terminal':
return has256(obj)
}
if (/^xterm-256/.test(term)) {
return has256(obj)
}
if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(term)) {
return hasBasic(obj)
}
if (env.COLORTERM) {
return hasBasic(obj)
}
return hasNone(obj, options)
}
@@ -0,0 +1,6 @@
/**
* @param {string} value
* @returns {string | false}
*/
export function decodeNamedCharacterReference(value: string): string | false;
//# sourceMappingURL=index.dom.d.ts.map
@@ -0,0 +1,925 @@
# expect-type
[![CI](https://github.com/mmkal/expect-type/actions/workflows/ci.yml/badge.svg)](https://github.com/mmkal/expect-type/actions/workflows/ci.yml)
![npm](https://img.shields.io/npm/dt/expect-type)
[![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/mmkal)](https://x.com/mmkalmmkal)
Compile-time tests for types. Useful to make sure types don't regress into being overly permissive as changes go in over time.
Similar to `expect`, but with type-awareness. Gives you access to several type-matchers that let you make assertions about the form of a reference or generic type parameter.
```ts
import {expectTypeOf} from 'expect-type'
import {foo, bar} from '../foo'
// make sure `foo` has type {a: number}
expectTypeOf(foo).toEqualTypeOf<{a: number}>()
// make sure `bar` is a function taking a string:
expectTypeOf(bar).parameter(0).toBeString()
expectTypeOf(bar).returns.not.toBeAny()
```
It can be used in your existing test files (and is actually [built in to vitest](https://vitest.dev/guide/testing-types)). Or it can be used in any other type-checked file you'd like - it's built into existing tooling with no dependencies. No extra build step, cli tool, IDE extension, or lint plugin is needed. Just import the function and start writing tests. Failures will be at compile time - they'll appear in your IDE and when you run `tsc`.
See below for lots more examples.
## Contents
<!-- codegen:start {preset: markdownTOC, minDepth: 2, maxDepth: 5} -->
- [Contents](#contents)
- [Installation and usage](#installation-and-usage)
- [Documentation](#documentation)
- [Features](#features)
- [Why is my assertion failing?](#why-is-my-assertion-failing)
- [Why is `.toMatchTypeOf` deprecated?](#why-is-tomatchtypeof-deprecated)
- [Internal type helpers](#internal-type-helpers)
- [Error messages](#error-messages)
- [Concrete "expected" objects vs type arguments](#concrete-expected-objects-vs-type-arguments)
- [Overloaded functions](#overloaded-functions)
- [Within test frameworks](#within-test-frameworks)
- [Vitest](#vitest)
- [Jest & `eslint-plugin-jest`](#jest--eslint-plugin-jest)
- [Limitations](#limitations)
- [Similar projects](#similar-projects)
- [Comparison](#comparison)
- [TypeScript backwards-compatibility](#typescript-backwards-compatibility)
- [Contributing](#contributing)
- [Documentation of limitations through tests](#documentation-of-limitations-through-tests)
<!-- codegen:end -->
## Installation and usage
```cli
npm install expect-type --save-dev
```
```typescript
import {expectTypeOf} from 'expect-type'
```
## Documentation
The `expectTypeOf` method takes a single argument or a generic type parameter. Neither it nor the functions chained off its return value have any meaningful runtime behaviour. The assertions you write will be _compile-time_ errors if they don't hold true.
### Features
<!-- codegen:start {preset: markdownFromTests, source: test/usage.test.ts} -->
Check an object's type with `.toEqualTypeOf`:
```typescript
expectTypeOf({a: 1}).toEqualTypeOf<{a: number}>()
```
`.toEqualTypeOf` can check that two concrete objects have equivalent types (note: when these assertions _fail_, the error messages can be less informative vs the generic type argument syntax above - see [error messages docs](#error-messages)):
```typescript
expectTypeOf({a: 1}).toEqualTypeOf({a: 1})
```
`.toEqualTypeOf` succeeds for objects with different values, but the same type:
```typescript
expectTypeOf({a: 1}).toEqualTypeOf({a: 2})
```
`.toEqualTypeOf` fails on excess properties:
```typescript
// @ts-expect-error
expectTypeOf({a: 1, b: 1}).toEqualTypeOf<{a: number}>()
```
To allow for extra properties on an object type, use `.toMatchObjectType`. This is a strict check, but only on the subset of keys that are in the expected type:
```typescript
expectTypeOf({a: 1, b: 1}).toMatchObjectType<{a: number}>()
```
`.toMatchObjectType` can check partial matches on deeply nested objects:
```typescript
const user = {
email: 'a@b.com',
name: 'John Doe',
address: {street: '123 2nd St', city: 'New York', zip: '10001', state: 'NY', country: 'USA'},
}
expectTypeOf(user).toMatchObjectType<{name: string; address: {city: string}}>()
```
To check that a type extends another type, use `.toExtend`:
```typescript
expectTypeOf('some string').toExtend<string | boolean>()
// @ts-expect-error
expectTypeOf({a: 1}).toExtend<{b: number}>()
```
`.toExtend` can be used with object types, but `.toMatchObjectType` is usually a better choice when dealing with objects, since it's stricter:
```typescript
expectTypeOf({a: 1, b: 2}).toExtend<{a: number}>() // avoid this
expectTypeOf({a: 1, b: 2}).toMatchObjectType<{a: number}>() // prefer this
```
`.toEqualTypeOf`, `.toMatchObjectType`, and `.toExtend` all fail on missing properties:
```typescript
// @ts-expect-error
expectTypeOf({a: 1}).toEqualTypeOf<{a: number; b: number}>()
// @ts-expect-error
expectTypeOf({a: 1}).toMatchObjectType<{a: number; b: number}>()
// @ts-expect-error
expectTypeOf({a: 1}).toExtend<{a: number; b: number}>()
```
Another example of the difference between `.toExtend`, `.toMatchObjectType`, and `.toEqualTypeOf`. `.toExtend` can be used for "is-a" relationships:
```typescript
type Fruit = {type: 'Fruit'; edible: boolean}
type Apple = {type: 'Fruit'; name: 'Apple'; edible: true}
expectTypeOf<Apple>().toExtend<Fruit>()
// @ts-expect-error - the `editable` property isn't an exact match. In `Apple`, it's `true`, which extends `boolean`, but they're not identical.
expectTypeOf<Apple>().toMatchObjectType<Fruit>()
// @ts-expect-error - Apple is not an identical type to Fruit, it's a subtype
expectTypeOf<Apple>().toEqualTypeOf<Fruit>()
// @ts-expect-error - Apple is a Fruit, but not vice versa
expectTypeOf<Fruit>().toExtend<Apple>()
```
Assertions can be inverted with `.not`:
```typescript
expectTypeOf({a: 1}).not.toExtend<{b: 1}>()
expectTypeOf({a: 1}).not.toMatchObjectType<{b: 1}>()
```
`.not` can be easier than relying on `// @ts-expect-error`:
```typescript
type Fruit = {type: 'Fruit'; edible: boolean}
type Apple = {type: 'Fruit'; name: 'Apple'; edible: true}
expectTypeOf<Apple>().toExtend<Fruit>()
expectTypeOf<Fruit>().not.toExtend<Apple>()
expectTypeOf<Apple>().not.toEqualTypeOf<Fruit>()
```
Catch any/unknown/never types:
```typescript
expectTypeOf<unknown>().toBeUnknown()
expectTypeOf<any>().toBeAny()
expectTypeOf<never>().toBeNever()
// @ts-expect-error
expectTypeOf<never>().toBeNumber()
```
`.toEqualTypeOf` distinguishes between deeply-nested `any` and `unknown` properties:
```typescript
expectTypeOf<{deeply: {nested: any}}>().not.toEqualTypeOf<{deeply: {nested: unknown}}>()
```
You can test for basic JavaScript types:
```typescript
expectTypeOf(() => 1).toBeFunction()
expectTypeOf({}).toBeObject()
expectTypeOf([]).toBeArray()
expectTypeOf('').toBeString()
expectTypeOf(1).toBeNumber()
expectTypeOf(true).toBeBoolean()
expectTypeOf(() => {}).returns.toBeVoid()
expectTypeOf(Promise.resolve(123)).resolves.toBeNumber()
expectTypeOf(Symbol(1)).toBeSymbol()
expectTypeOf(1n).toBeBigInt()
```
`.toBe...` methods allow for types that extend the expected type:
```typescript
expectTypeOf<number>().toBeNumber()
expectTypeOf<1>().toBeNumber()
expectTypeOf<any[]>().toBeArray()
expectTypeOf<number[]>().toBeArray()
expectTypeOf<string>().toBeString()
expectTypeOf<'foo'>().toBeString()
expectTypeOf<boolean>().toBeBoolean()
expectTypeOf<true>().toBeBoolean()
expectTypeOf<bigint>().toBeBigInt()
expectTypeOf<0n>().toBeBigInt()
```
`.toBe...` methods protect against `any`:
```typescript
const goodIntParser = (s: string) => Number.parseInt(s, 10)
const badIntParser = (s: string) => JSON.parse(s) // uh-oh - works at runtime if the input is a number, but return 'any'
expectTypeOf(goodIntParser).returns.toBeNumber()
// @ts-expect-error - if you write a test like this, `.toBeNumber()` will let you know your implementation returns `any`.
expectTypeOf(badIntParser).returns.toBeNumber()
```
Nullable types:
```typescript
expectTypeOf(undefined).toBeUndefined()
expectTypeOf(undefined).toBeNullable()
expectTypeOf(undefined).not.toBeNull()
expectTypeOf(null).toBeNull()
expectTypeOf(null).toBeNullable()
expectTypeOf(null).not.toBeUndefined()
expectTypeOf<1 | undefined>().toBeNullable()
expectTypeOf<1 | null>().toBeNullable()
expectTypeOf<1 | undefined | null>().toBeNullable()
```
More `.not` examples:
```typescript
expectTypeOf(1).not.toBeUnknown()
expectTypeOf(1).not.toBeAny()
expectTypeOf(1).not.toBeNever()
expectTypeOf(1).not.toBeNull()
expectTypeOf(1).not.toBeUndefined()
expectTypeOf(1).not.toBeNullable()
expectTypeOf(1).not.toBeBigInt()
```
Detect assignability of unioned types:
```typescript
expectTypeOf<number>().toExtend<string | number>()
expectTypeOf<string | number>().not.toExtend<number>()
```
Use `.extract` and `.exclude` to narrow down complex union types:
```typescript
type ResponsiveProp<T> = T | T[] | {xs?: T; sm?: T; md?: T}
const getResponsiveProp = <T>(_props: T): ResponsiveProp<T> => ({})
type CSSProperties = {margin?: string; padding?: string}
const cssProperties: CSSProperties = {margin: '1px', padding: '2px'}
expectTypeOf(getResponsiveProp(cssProperties))
.exclude<unknown[]>()
.exclude<{xs?: unknown}>()
.toEqualTypeOf<CSSProperties>()
expectTypeOf(getResponsiveProp(cssProperties))
.extract<unknown[]>()
.toEqualTypeOf<CSSProperties[]>()
expectTypeOf(getResponsiveProp(cssProperties))
.extract<{xs?: any}>()
.toEqualTypeOf<{xs?: CSSProperties; sm?: CSSProperties; md?: CSSProperties}>()
expectTypeOf<ResponsiveProp<number>>().exclude<number | number[]>().toHaveProperty('sm')
expectTypeOf<ResponsiveProp<number>>().exclude<number | number[]>().not.toHaveProperty('xxl')
```
`.extract` and `.exclude` return never if no types remain after exclusion:
```typescript
type Person = {name: string; age: number}
type Customer = Person & {customerId: string}
type Employee = Person & {employeeId: string}
expectTypeOf<Customer | Employee>().extract<{foo: string}>().toBeNever()
expectTypeOf<Customer | Employee>().exclude<{name: string}>().toBeNever()
```
Use `.pick` to pick a set of properties from an object:
```typescript
type Person = {name: string; age: number}
expectTypeOf<Person>().pick<'name'>().toEqualTypeOf<{name: string}>()
```
Use `.omit` to remove a set of properties from an object:
```typescript
type Person = {name: string; age: number}
expectTypeOf<Person>().omit<'name'>().toEqualTypeOf<{age: number}>()
```
Make assertions about object properties:
```typescript
const obj = {a: 1, b: ''}
// check that properties exist (or don't) with `.toHaveProperty`
expectTypeOf(obj).toHaveProperty('a')
expectTypeOf(obj).not.toHaveProperty('c')
// check types of properties
expectTypeOf(obj).toHaveProperty('a').toBeNumber()
expectTypeOf(obj).toHaveProperty('b').toBeString()
expectTypeOf(obj).toHaveProperty('a').not.toBeString()
```
`.toEqualTypeOf` can be used to distinguish between functions:
```typescript
type NoParam = () => void
type HasParam = (s: string) => void
expectTypeOf<NoParam>().not.toEqualTypeOf<HasParam>()
```
But often it's preferable to use `.parameters` or `.returns` for more specific function assertions:
```typescript
type NoParam = () => void
type HasParam = (s: string) => void
expectTypeOf<NoParam>().parameters.toEqualTypeOf<[]>()
expectTypeOf<NoParam>().returns.toBeVoid()
expectTypeOf<HasParam>().parameters.toEqualTypeOf<[string]>()
expectTypeOf<HasParam>().returns.toBeVoid()
```
Up to ten overloads will produce union types for `.parameters` and `.returns`:
```typescript
type Factorize = {
(input: number): number[]
(input: bigint): bigint[]
}
expectTypeOf<Factorize>().parameters.not.toEqualTypeOf<[number]>()
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[number] | [bigint]>()
expectTypeOf<Factorize>().returns.toEqualTypeOf<number[] | bigint[]>()
expectTypeOf<Factorize>().parameter(0).toEqualTypeOf<number | bigint>()
```
Note that these aren't exactly like TypeScript's built-in Parameters<...> and ReturnType<...>:
The TypeScript builtins simply choose a single overload (see the [Overloaded functions](#overloaded-functions) section for more information)
```typescript
type Factorize = {
(input: number): number[]
(input: bigint): bigint[]
}
// overload using `number` is ignored!
expectTypeOf<Parameters<Factorize>>().toEqualTypeOf<[bigint]>()
expectTypeOf<ReturnType<Factorize>>().toEqualTypeOf<bigint[]>()
```
More examples of ways to work with functions - parameters using `.parameter(n)` or `.parameters`, and return values using `.returns`:
```typescript
const f = (a: number) => [a, a]
expectTypeOf(f).toBeFunction()
expectTypeOf(f).toBeCallableWith(1)
expectTypeOf(f).not.toBeAny()
expectTypeOf(f).returns.not.toBeAny()
expectTypeOf(f).returns.toEqualTypeOf([1, 2])
expectTypeOf(f).returns.toEqualTypeOf([1, 2, 3])
expectTypeOf(f).parameter(0).not.toEqualTypeOf('1')
expectTypeOf(f).parameter(0).toEqualTypeOf(1)
expectTypeOf(1).parameter(0).toBeNever()
const twoArgFunc = (a: number, b: string) => ({a, b})
expectTypeOf(twoArgFunc).parameters.toEqualTypeOf<[number, string]>()
```
`.toBeCallableWith` allows for overloads. You can also use it to narrow down the return type for given input parameters.:
```typescript
type Factorize = {
(input: number): number[]
(input: bigint): bigint[]
}
expectTypeOf<Factorize>().toBeCallableWith(6)
expectTypeOf<Factorize>().toBeCallableWith(6n)
```
`.toBeCallableWith` returns a type that can be used to narrow down the return type for given input parameters.:
```typescript
type Factorize = {
(input: number): number[]
(input: bigint): bigint[]
}
expectTypeOf<Factorize>().toBeCallableWith(6).returns.toEqualTypeOf<number[]>()
expectTypeOf<Factorize>().toBeCallableWith(6n).returns.toEqualTypeOf<bigint[]>()
```
`.toBeCallableWith` can be used to narrow down the parameters of a function:
```typescript
type Delete = {
(path: string): void
(paths: string[], options?: {force: boolean}): void
}
expectTypeOf<Delete>().toBeCallableWith('abc').parameters.toEqualTypeOf<[string]>()
expectTypeOf<Delete>()
.toBeCallableWith(['abc', 'def'], {force: true})
.parameters.toEqualTypeOf<[string[], {force: boolean}?]>()
expectTypeOf<Delete>().toBeCallableWith('abc').parameter(0).toBeString()
expectTypeOf<Delete>().toBeCallableWith('abc').parameter(1).toBeUndefined()
expectTypeOf<Delete>()
.toBeCallableWith(['abc', 'def', 'ghi'])
.parameter(0)
.toEqualTypeOf<string[]>()
expectTypeOf<Delete>()
.toBeCallableWith(['abc', 'def', 'ghi'])
.parameter(1)
.toEqualTypeOf<{force: boolean} | undefined>()
```
You can't use `.toBeCallableWith` with `.not` - you need to use ts-expect-error::
```typescript
const f = (a: number) => [a, a]
// @ts-expect-error
expectTypeOf(f).toBeCallableWith('foo')
```
Use `.map` to transform types:
This can be useful for generic functions or complex types which you can't access via `.toBeCallableWith`, `.toHaveProperty` etc. The callback function isn't called at runtime, which can make this a useful way to get complex inferred types without worrying about running code.
```typescript
const capitalize = <S extends string>(input: S) =>
(input.slice(0, 1).toUpperCase() + input.slice(1)) as Capitalize<S>
expectTypeOf(capitalize)
.map(fn => fn('hello world'))
.toEqualTypeOf<'Hello world'>()
```
You can also check type guards & type assertions:
```typescript
const assertNumber = (v: any): asserts v is number => {
if (typeof v !== 'number') {
throw new TypeError('Nope !')
}
}
expectTypeOf(assertNumber).asserts.toBeNumber()
const isString = (v: any): v is string => typeof v === 'string'
expectTypeOf(isString).guards.toBeString()
const isBigInt = (value: any): value is bigint => typeof value === 'bigint'
expectTypeOf(isBigInt).guards.toBeBigInt()
```
Assert on constructor parameters:
```typescript
expectTypeOf(Date).toBeConstructibleWith('1970')
expectTypeOf(Date).toBeConstructibleWith(0)
expectTypeOf(Date).toBeConstructibleWith(new Date())
expectTypeOf(Date).toBeConstructibleWith()
expectTypeOf(Date).constructorParameters.toEqualTypeOf<
| []
| [value: string | number]
| [value: string | number | Date]
| [
year: number,
monthIndex: number,
date?: number | undefined,
hours?: number | undefined,
minutes?: number | undefined,
seconds?: number | undefined,
ms?: number | undefined,
]
>()
```
Constructor overloads:
```typescript
class DBConnection {
constructor()
constructor(connectionString: string)
constructor(options: {host: string; port: number})
constructor(..._: unknown[]) {}
}
expectTypeOf(DBConnection).toBeConstructibleWith()
expectTypeOf(DBConnection).toBeConstructibleWith('localhost')
expectTypeOf(DBConnection).toBeConstructibleWith({host: 'localhost', port: 1234})
// @ts-expect-error - as when calling `new DBConnection(...)` you can't actually use the `(...args: unknown[])` overlaod, it's purely for the implementation.
expectTypeOf(DBConnection).toBeConstructibleWith(1, 2)
```
Check function `this` parameters:
```typescript
function greet(this: {name: string}, message: string) {
return `Hello ${this.name}, here's your message: ${message}`
}
expectTypeOf(greet).thisParameter.toEqualTypeOf<{name: string}>()
```
Distinguish between functions with different `this` parameters:
```typescript
function greetFormal(this: {title: string; name: string}, message: string) {
return `Dear ${this.title} ${this.name}, here's your message: ${message}`
}
function greetCasual(this: {name: string}, message: string) {
return `Hi ${this.name}, here's your message: ${message}`
}
expectTypeOf(greetFormal).not.toEqualTypeOf(greetCasual)
```
Class instance types:
```typescript
expectTypeOf(Date).instance.toHaveProperty('toISOString')
```
Promise resolution types can be checked with `.resolves`:
```typescript
const asyncFunc = async () => 123
expectTypeOf(asyncFunc).returns.resolves.toBeNumber()
```
Array items can be checked with `.items`:
```typescript
expectTypeOf([1, 2, 3]).items.toBeNumber()
expectTypeOf([1, 2, 3]).items.not.toBeString()
```
You can also compare arrays directly:
```typescript
expectTypeOf<any[]>().not.toEqualTypeOf<number[]>()
```
Check that functions never return:
```typescript
const thrower = () => {
throw new Error('oh no')
}
expectTypeOf(thrower).returns.toBeNever()
```
Generics can be used rather than references:
```typescript
expectTypeOf<{a: string}>().not.toEqualTypeOf<{a: number}>()
```
Distinguish between missing/null/optional properties:
```typescript
expectTypeOf<{a?: number}>().not.toEqualTypeOf<{}>()
expectTypeOf<{a?: number}>().not.toEqualTypeOf<{a: number}>()
expectTypeOf<{a?: number}>().not.toEqualTypeOf<{a: number | undefined}>()
expectTypeOf<{a?: number | null}>().not.toEqualTypeOf<{a: number | null}>()
expectTypeOf<{a: {b?: number}}>().not.toEqualTypeOf<{a: {}}>()
```
Detect the difference between regular and `readonly` properties:
```typescript
type A1 = {readonly a: string; b: string}
type E1 = {a: string; b: string}
expectTypeOf<A1>().toExtend<E1>()
expectTypeOf<A1>().not.toEqualTypeOf<E1>()
type A2 = {a: string; b: {readonly c: string}}
type E2 = {a: string; b: {c: string}}
expectTypeOf<A2>().toExtend<E2>()
expectTypeOf<A2>().not.toEqualTypeOf<E2>()
```
Distinguish between classes with different constructors:
```typescript
class A {
value: number
constructor(a: 1) {
this.value = a
}
}
class B {
value: number
constructor(b: 2) {
this.value = b
}
}
expectTypeOf<typeof A>().not.toEqualTypeOf<typeof B>()
class C {
value: number
constructor(c: 1) {
this.value = c
}
}
expectTypeOf<typeof A>().toEqualTypeOf<typeof C>()
```
Known limitation: Intersection types can cause issues with `toEqualTypeOf`:
```typescript
// @ts-expect-error the following line doesn't compile, even though the types are arguably the same.
// See https://github.com/mmkal/expect-type/pull/21
expectTypeOf<{a: 1} & {b: 2}>().toEqualTypeOf<{a: 1; b: 2}>()
```
To workaround for simple cases, you can use a mapped type:
```typescript
type Simplify<T> = {[K in keyof T]: T[K]}
expectTypeOf<Simplify<{a: 1} & {b: 2}>>().toEqualTypeOf<{a: 1; b: 2}>()
```
But this won't work if the nesting is deeper in the type. For these situations, you can use the `.branded` helper. Note that this comes at a performance cost, and can cause the compiler to 'give up' if used with excessively deep types, so use sparingly. This helper is under `.branded` because it deeply transforms the Actual and Expected types into a pseudo-AST:
```typescript
// @ts-expect-error
expectTypeOf<{a: {b: 1} & {c: 1}}>().toEqualTypeOf<{a: {b: 1; c: 1}}>()
expectTypeOf<{a: {b: 1} & {c: 1}}>().branded.toEqualTypeOf<{a: {b: 1; c: 1}}>()
```
Be careful with `.branded` for very deep or complex types, though. If possible you should find a way to simplify your test to avoid needing to use it:
```typescript
// This *should* result in an error, but the "branding" mechanism produces too large a type and TypeScript just gives up! https://github.com/microsoft/TypeScript/issues/50670
expectTypeOf<() => () => () => () => 1>().branded.toEqualTypeOf<() => () => () => () => 2>()
// @ts-expect-error the non-branded implementation catches the error as expected.
expectTypeOf<() => () => () => () => 1>().toEqualTypeOf<() => () => () => () => 2>()
```
So, if you have an extremely deep type that ALSO has an intersection in it, you're out of luck and this library won't be able to test your type properly:
```typescript
// @ts-expect-error this fails, but it should succeed.
expectTypeOf<() => () => () => () => {a: 1} & {b: 2}>().toEqualTypeOf<
() => () => () => () => {a: 1; b: 2}
>()
// this succeeds, but it should fail.
expectTypeOf<() => () => () => () => {a: 1} & {b: 2}>().branded.toEqualTypeOf<
() => () => () => () => {a: 1; c: 2}
>()
```
Another limitation: passing `this` references to `expectTypeOf` results in errors.:
```typescript
class B {
b = 'b'
foo() {
// @ts-expect-error
expectTypeOf(this).toEqualTypeOf(this)
}
}
// Instead of the above, try something like this:
expectTypeOf(B).instance.toEqualTypeOf<{b: string; foo: () => void}>()
```
<!-- codegen:end -->
Overloads limitation for TypeScript <5.3: Due to a [TypeScript bug fixed in 5.3](https://github.com/microsoft/TypeScript/issues/28867), overloaded functions which include an overload resembling `(...args: unknown[]) => unknown` will exclude `unknown[]` from `.parameters` and exclude `unknown` from `.returns`:
```typescript
type Factorize = {
(...args: unknown[]): unknown
(input: number): number[]
(input: bigint): bigint[]
}
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[number] | [bigint]>()
expectTypeOf<Factorize>().returns.toEqualTypeOf<number[] | bigint[]>()
```
This overload, however, allows any input and returns an unknown output anyway, so it's not very useful. If you are worried about this for some reason, you'll have to update TypeScript to 5.3+.
### Why is my assertion failing?
For complex types, an assertion might fail when it should if the `Actual` type contains a deeply-nested intersection type but the `Expected` doesn't. In these cases you can use `.branded` as described above:
```typescript
// @ts-expect-error this unfortunately fails - a TypeScript limitation prevents making this pass without a big perf hit
expectTypeOf<{a: {b: 1} & {c: 1}}>().toEqualTypeOf<{a: {b: 1; c: 1}}>()
expectTypeOf<{a: {b: 1} & {c: 1}}>().branded.toEqualTypeOf<{a: {b: 1; c: 1}}>()
```
### Why is `.toMatchTypeOf` deprecated?
The `.toMatchTypeOf` method is deprecated in favour of `.toMatchObjectType` (when strictly checking against an object type with a subset of keys), or `.toExtend` (when checking for "is-a" relationships). There are no foreseeable plans to remove `.toMatchTypeOf`, but there's no reason to continue using it - `.toMatchObjectType` is stricter, and `.toExtend` is identical.
### Internal type helpers
🚧 This library also exports some helper types for performing boolean operations on types, checking extension/equality in various ways, branding types, and checking for various special types like `never`, `any`, `unknown`. Use at your own risk! Nothing is stopping you from using these beyond this warning:
>All internal types that are not documented here are _not_ part of the supported API surface, and may be renamed, modified, or removed, without warning or documentation in release notes.
For a dedicated internal type library, feel free to look at the [source code](./src/index.ts) for inspiration - or better, use a library like [type-fest](https://npmjs.com/package/type-fest).
### Error messages
When types don't match, `.toEqualTypeOf` and `.toMatchTypeOf` use a special helper type to produce error messages that are as actionable as possible. But there's a bit of a nuance to understanding them. Since the assertions are written "fluently", the failure should be on the "expected" type, not the "actual" type (`expect<Actual>().toEqualTypeOf<Expected>()`). This means that type errors can be a little confusing - so this library produces a `MismatchInfo` type to try to make explicit what the expectation is. For example:
```ts
expectTypeOf({a: 1}).toEqualTypeOf<{a: string}>()
```
Is an assertion that will fail, since `{a: 1}` has type `{a: number}` and not `{a: string}`. The error message in this case will read something like this:
```
test/test.ts:999:999 - error TS2344: Type '{ a: string; }' does not satisfy the constraint '{ a: \\"Expected: string, Actual: number\\"; }'.
Types of property 'a' are incompatible.
Type 'string' is not assignable to type '\\"Expected: string, Actual: number\\"'.
999 expectTypeOf({a: 1}).toEqualTypeOf<{a: string}>()
```
Note that the type constraint reported is a human-readable messaging specifying both the "expected" and "actual" types. Rather than taking the sentence `Types of property 'a' are incompatible // Type 'string' is not assignable to type "Expected: string, Actual: number"` literally - just look at the property name (`'a'`) and the message: `Expected: string, Actual: number`. This will tell you what's wrong, in most cases. Extremely complex types will, of course, be more effort to debug, and may require some experimentation. Please [raise an issue](https://github.com/mmkal/expect-type) if the error messages are misleading.
The `toBe...` methods (like `toBeString`, `toBeNumber`, `toBeVoid`, etc.) fail by resolving to a non-callable type when the `Actual` type under test doesn't match up. For example, the failure for an assertion like `expectTypeOf(1).toBeString()` will look something like this:
```
test/test.ts:999:999 - error TS2349: This expression is not callable.
Type 'ExpectString<number>' has no call signatures.
999 expectTypeOf(1).toBeString()
~~~~~~~~~~
```
The `This expression is not callable` part isn't all that helpful - the meaningful error is the next line, `Type 'ExpectString<number> has no call signatures`. This essentially means you passed a number but asserted it should be a string.
If TypeScript added support for ["throw" types](https://github.com/microsoft/TypeScript/pull/40468) these error messages could be improved. Until then they will take a certain amount of squinting.
#### Concrete "expected" objects vs type arguments
Error messages for an assertion like this:
```ts
expectTypeOf({a: 1}).toEqualTypeOf({a: ''})
```
Will be less helpful than for an assertion like this:
```ts
expectTypeOf({a: 1}).toEqualTypeOf<{a: string}>()
```
This is because the TypeScript compiler needs to infer the type argument for the `.toEqualTypeOf({a: ''})` style and this library can only mark it as a failure by comparing it against a generic `Mismatch` type. So, where possible, use a type argument rather than a concrete type for `.toEqualTypeOf` and `toMatchTypeOf`. If it's much more convenient to compare two concrete types, you can use `typeof`:
```ts
const one = valueFromFunctionOne({some: {complex: inputs}})
const two = valueFromFunctionTwo({some: {other: inputs}})
expectTypeOf(one).toEqualTypeof<typeof two>()
```
### Overloaded functions
Due to a TypeScript [design limitation](https://github.com/microsoft/TypeScript/issues/32164#issuecomment-506810756), the native TypeScript `Parameters<...>` and `ReturnType<...>` helpers only return types from one variant of an overloaded function. This limitation doesn't apply to expect-type, since it is not used to author TypeScript code, only to assert on existing types. So, we use a workaround for this TypeScript behaviour to assert on _all_ overloads as a union (actually, not necessarily _all_ - we cap out at 10 overloads).
### Within test frameworks
### Vitest
`expectTypeOf` is built in to [vitest](https://vitest.dev/guide/testing-types), so you can import `expectTypeOf` from the vitest library directly if you prefer. Note that there is no set release cadence, at time of writing, so vitest may not always be using the very latest version.
```ts
import {expectTypeOf} from 'vitest'
import {mount} from './mount.js'
test('my types work properly', () => {
expectTypeOf(mount).toBeFunction()
expectTypeOf(mount).parameter(0).toEqualTypeOf<{name: string}>()
expectTypeOf(mount({name: 42})).toBeString()
})
```
#### Jest & `eslint-plugin-jest`
If you're using Jest along with `eslint-plugin-jest`, and you put assertions inside `test(...)` definitions, you may get warnings from the [`jest/expect-expect`](https://github.com/jest-community/eslint-plugin-jest/blob/master/docs/rules/expect-expect.md) rule, complaining that "Test has no assertions" for tests that only use `expectTypeOf()`.
To remove this warning, configure the ESLint rule to consider `expectTypeOf` as an assertion:
```json
"rules": {
// ...
"jest/expect-expect": [
"warn",
{
"assertFunctionNames": [
"expect", "expectTypeOf"
]
}
],
// ...
}
```
### Limitations
A summary of some of the limitations of this library. Some of these are documented more fully elsewhere.
1. Intersection types can result in failures when the expected and actual types are not identically defined, even when they are effectively identical. See [Why is my assertion failing](#why-is-my-assertion-failing) for details. TL;DR: use `.brand` in these cases - and accept the performance hit that it comes with.
1. `toBeCallableWith` will likely fail if you try to use it with a generic function or an overload. See [this issue](https://github.com/mmkal/expect-type/issues/50) for an example and how to work around it.
1. (For now) overloaded functions might trip up the `.parameter` and `.parameters` helpers. This matches how the built-in TypeScript helper `Parameters<...>` works. This may be improved in the future though ([see related issue](https://github.com/mmkal/expect-type/issues/30)).
1. `expectTypeOf(this).toEqualTypeOf(this)` inside class methods does not work.
## Similar projects
Other projects with similar goals:
- [`tsd`](https://github.com/SamVerschueren/tsd) is a CLI that runs the TypeScript type checker over assertions
- [`ts-expect`](https://github.com/TypeStrong/ts-expect) exports several generic helper types to perform type assertions
- [`dtslint`](https://github.com/Microsoft/dtslint) does type checks via comment directives and tslint
- [`type-plus`](https://github.com/unional/type-plus) comes with various type and runtime TypeScript assertions
- [`static-type-assert`](https://github.com/ksxnodemodules/static-type-assert) type assertion functions
### Comparison
The key differences in this project are:
- a fluent, jest-inspired API, making the difference between `actual` and `expected` clear. This is helpful with complex types and assertions.
- inverting assertions intuitively and easily via `expectTypeOf(...).not`
- checks generics properly and strictly ([tsd doesn't](https://github.com/SamVerschueren/tsd/issues/142))
- first-class support for:
- `any` (as well as `unknown` and `never`) (see issues outstanding at time of writing in tsd for [never](https://github.com/SamVerschueren/tsd/issues/78) and [any](https://github.com/SamVerschueren/tsd/issues/82)).
- This can be especially useful in combination with `not`, to protect against functions returning too-permissive types. For example, `const parseFile = (filename: string) => JSON.parse(readFileSync(filename).toString())` returns `any`, which could lead to errors. After giving it a proper return-type, you can add a test for this with `expect(parseFile).returns.not.toBeAny()`
- object properties
- function parameters
- function return values
- constructor parameters
- class instances
- array item values
- nullable types
- assertions on types "matching" rather than exact type equality, for "is-a" relationships e.g. `expectTypeOf(square).toExtend<Shape>()`
- built into existing tooling. No extra build step, cli tool, IDE extension, or lint plugin is needed. Just import the function and start writing tests. Failures will be at compile time - they'll appear in your IDE and when you run `tsc`.
- small implementation with no dependencies. [Take a look!](./src/index.ts) (tsd, for comparison, is [2.6MB](https://bundlephobia.com/result?p=tsd@0.13.1) because it ships a patched version of TypeScript).
## TypeScript backwards-compatibility
There is a CI job called `test-types` that checks whether the tests still pass with certain older TypeScript versions. To check the supported TypeScript versions, [refer to the job definition](./.github/workflows/ci.yml).
## Contributing
In most cases, it's worth checking existing issues or creating one to discuss a new feature or a bug fix before opening a pull request.
Once you're ready to make a pull request: clone the repo, and install pnpm if you don't have it already with `npm install --global pnpm`. Lockfiles for `npm` and `yarn` are gitignored.
If you're adding a feature, you should write a self-contained usage example in the form of a test, in [test/usage.test.ts](./test/usage.test.ts). This file is used to populate the bulk of this readme using [eslint-plugin-codegen](https://npmjs.com/package/eslint-plugin-codegen), and to generate an ["errors" test file](./test/errors.test.ts), which captures the error messages that are emitted for failing assertions by the TypeScript compiler. So, the test name should be written as a human-readable sentence explaining the usage example. Have a look at the existing tests for an idea of the style.
After adding the tests, run `npm run lint -- --fix` to update the readme, and `npm test -- --updateSnapshot` to update the errors test. The generated documentation and tests should be pushed to the same branch as the source code, and submitted as a pull request. CI will test that the docs and tests are up to date if you forget to run these commands.
### Documentation of limitations through tests
Limitations of the library are documented through tests in `usage.test.ts`. This means that if a future TypeScript version (or library version) fixes the limitation, the test will start failing, and it will be automatically removed from the documentation once it no longer applies.
@@ -0,0 +1,41 @@
// Arabic (Kuwait) [ar-kw]
import dayjs from '../index';
var locale = {
name: 'ar-kw',
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
ordinal: function ordinal(n) {
return n;
},
formats: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
meridiem: function meridiem(hour) {
return hour > 12 ? 'م' : 'ص';
},
relativeTime: {
future: 'في %s',
past: 'منذ %s',
s: 'ثوان',
m: 'دقيقة',
mm: '%d دقائق',
h: 'ساعة',
hh: '%d ساعات',
d: 'يوم',
dd: '%d أيام',
M: 'شهر',
MM: '%d أشهر',
y: 'سنة',
yy: '%d سنوات'
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1 @@
{"version":3,"file":"isNoAncestorBindingConstraints.d.ts","sourceRoot":"","sources":["../../../../src/binding/calculations/isNoAncestorBindingConstraints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAIvD,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,CAAC,WAAW,EAAE,kBAAkB,KAAK,OAAO,GACtD,CAAC,WAAW,EAAE,kBAAkB,KAAK,OAAO,CAQ9C"}
@@ -0,0 +1,4 @@
import { URIRegExps } from "./uri";
export declare function buildExps(isIRI: boolean): URIRegExps;
declare const _default: URIRegExps;
export default _default;
@@ -0,0 +1,392 @@
'use strict';
var test = require('tape');
var v = require('es-value-fixtures');
var forEach = require('for-each');
var inspect = require('object-inspect');
var hasOwn = require('hasown');
var hasPropertyDescriptors = require('has-property-descriptors')();
var getOwnPropertyDescriptors = require('object.getownpropertydescriptors');
var ownKeys = require('reflect.ownkeys');
var defineDataProperty = require('../');
test('defineDataProperty', function (t) {
t.test('argument validation', function (st) {
forEach(v.primitives, function (nonObject) {
st['throws'](
// @ts-expect-error
function () { defineDataProperty(nonObject, 'key', 'value'); },
TypeError,
'throws on non-object input: ' + inspect(nonObject)
);
});
forEach(v.nonPropertyKeys, function (nonPropertyKey) {
st['throws'](
// @ts-expect-error
function () { defineDataProperty({}, nonPropertyKey, 'value'); },
TypeError,
'throws on non-PropertyKey input: ' + inspect(nonPropertyKey)
);
});
forEach(v.nonBooleans, function (nonBoolean) {
if (nonBoolean !== null) {
st['throws'](
// @ts-expect-error
function () { defineDataProperty({}, 'key', 'value', nonBoolean); },
TypeError,
'throws on non-boolean nonEnumerable: ' + inspect(nonBoolean)
);
st['throws'](
// @ts-expect-error
function () { defineDataProperty({}, 'key', 'value', false, nonBoolean); },
TypeError,
'throws on non-boolean nonWritable: ' + inspect(nonBoolean)
);
st['throws'](
// @ts-expect-error
function () { defineDataProperty({}, 'key', 'value', false, false, nonBoolean); },
TypeError,
'throws on non-boolean nonConfigurable: ' + inspect(nonBoolean)
);
}
});
st.end();
});
t.test('normal data property', function (st) {
/** @type {Record<PropertyKey, string>} */
var obj = { existing: 'existing property' };
st.ok(hasOwn(obj, 'existing'), 'has initial own property');
st.equal(obj.existing, 'existing property', 'has expected initial value');
var res = defineDataProperty(obj, 'added', 'added property');
st.equal(res, void undefined, 'returns `undefined`');
st.ok(hasOwn(obj, 'added'), 'has expected own property');
st.equal(obj.added, 'added property', 'has expected value');
defineDataProperty(obj, 'existing', 'new value');
st.ok(hasOwn(obj, 'existing'), 'still has expected own property');
st.equal(obj.existing, 'new value', 'has new expected value');
defineDataProperty(obj, 'explicit1', 'new value', false);
st.ok(hasOwn(obj, 'explicit1'), 'has expected own property (explicit enumerable)');
st.equal(obj.explicit1, 'new value', 'has new expected value (explicit enumerable)');
defineDataProperty(obj, 'explicit2', 'new value', false, false);
st.ok(hasOwn(obj, 'explicit2'), 'has expected own property (explicit writable)');
st.equal(obj.explicit2, 'new value', 'has new expected value (explicit writable)');
defineDataProperty(obj, 'explicit3', 'new value', false, false, false);
st.ok(hasOwn(obj, 'explicit3'), 'has expected own property (explicit configurable)');
st.equal(obj.explicit3, 'new value', 'has new expected value (explicit configurable)');
st.end();
});
t.test('loose mode', { skip: !hasPropertyDescriptors }, function (st) {
var obj = { existing: 'existing property' };
defineDataProperty(obj, 'added', 'added value 1', true, null, null, true);
st.deepEqual(
getOwnPropertyDescriptors(obj),
{
existing: {
configurable: true,
enumerable: true,
value: 'existing property',
writable: true
},
added: {
configurable: true,
enumerable: !hasPropertyDescriptors,
value: 'added value 1',
writable: true
}
},
'in loose mode, obj still adds property 1'
);
defineDataProperty(obj, 'added', 'added value 2', false, true, null, true);
st.deepEqual(
getOwnPropertyDescriptors(obj),
{
existing: {
configurable: true,
enumerable: true,
value: 'existing property',
writable: true
},
added: {
configurable: true,
enumerable: true,
value: 'added value 2',
writable: !hasPropertyDescriptors
}
},
'in loose mode, obj still adds property 2'
);
defineDataProperty(obj, 'added', 'added value 3', false, false, true, true);
st.deepEqual(
getOwnPropertyDescriptors(obj),
{
existing: {
configurable: true,
enumerable: true,
value: 'existing property',
writable: true
},
added: {
configurable: !hasPropertyDescriptors,
enumerable: true,
value: 'added value 3',
writable: true
}
},
'in loose mode, obj still adds property 3'
);
st.end();
});
t.test('non-normal data property, ES3', { skip: hasPropertyDescriptors }, function (st) {
/** @type {Record<PropertyKey, string>} */
var obj = { existing: 'existing property' };
st['throws'](
function () { defineDataProperty(obj, 'added', 'added value', true); },
SyntaxError,
'nonEnumerable throws a Syntax Error'
);
st['throws'](
function () { defineDataProperty(obj, 'added', 'added value', false, true); },
SyntaxError,
'nonWritable throws a Syntax Error'
);
st['throws'](
function () { defineDataProperty(obj, 'added', 'added value', false, false, true); },
SyntaxError,
'nonWritable throws a Syntax Error'
);
st.deepEqual(
ownKeys(obj),
['existing'],
'obj still has expected keys'
);
st.equal(obj.existing, 'existing property', 'obj still has expected values');
st.end();
});
t.test('new non-normal data property, ES5+', { skip: !hasPropertyDescriptors }, function (st) {
/** @type {Record<PropertyKey, string>} */
var obj = { existing: 'existing property' };
defineDataProperty(obj, 'nonEnum', null, true);
defineDataProperty(obj, 'nonWrit', null, false, true);
defineDataProperty(obj, 'nonConf', null, false, false, true);
st.deepEqual(
getOwnPropertyDescriptors(obj),
{
existing: {
configurable: true,
enumerable: true,
value: 'existing property',
writable: true
},
nonEnum: {
configurable: true,
enumerable: false,
value: null,
writable: true
},
nonWrit: {
configurable: true,
enumerable: true,
value: null,
writable: false
},
nonConf: {
configurable: false,
enumerable: true,
value: null,
writable: true
}
},
'obj has expected property descriptors'
);
st.end();
});
t.test('existing non-normal data property, ES5+', { skip: !hasPropertyDescriptors }, function (st) {
// test case changing an existing non-normal property
/** @type {Record<string, null | string>} */
var obj = {};
Object.defineProperty(obj, 'nonEnum', { configurable: true, enumerable: false, value: null, writable: true });
Object.defineProperty(obj, 'nonWrit', { configurable: true, enumerable: true, value: null, writable: false });
Object.defineProperty(obj, 'nonConf', { configurable: false, enumerable: true, value: null, writable: true });
st.deepEqual(
getOwnPropertyDescriptors(obj),
{
nonEnum: {
configurable: true,
enumerable: false,
value: null,
writable: true
},
nonWrit: {
configurable: true,
enumerable: true,
value: null,
writable: false
},
nonConf: {
configurable: false,
enumerable: true,
value: null,
writable: true
}
},
'obj initially has expected property descriptors'
);
defineDataProperty(obj, 'nonEnum', 'new value', false);
defineDataProperty(obj, 'nonWrit', 'new value', false, false);
st['throws'](
function () { defineDataProperty(obj, 'nonConf', 'new value', false, false, false); },
TypeError,
'can not alter a nonconfigurable property'
);
st.deepEqual(
getOwnPropertyDescriptors(obj),
{
nonEnum: {
configurable: true,
enumerable: true,
value: 'new value',
writable: true
},
nonWrit: {
configurable: true,
enumerable: true,
value: 'new value',
writable: true
},
nonConf: {
configurable: false,
enumerable: true,
value: null,
writable: true
}
},
'obj ends up with expected property descriptors'
);
st.end();
});
t.test('frozen object, ES5+', { skip: !hasPropertyDescriptors }, function (st) {
var frozen = Object.freeze({ existing: true });
st['throws'](
function () { defineDataProperty(frozen, 'existing', 'new value'); },
TypeError,
'frozen object can not modify an existing property'
);
st['throws'](
function () { defineDataProperty(frozen, 'new', 'new property'); },
TypeError,
'frozen object can not add a new property'
);
st.end();
});
t.test('sealed object, ES5+', { skip: !hasPropertyDescriptors }, function (st) {
var sealed = Object.seal({ existing: true });
st.deepEqual(
Object.getOwnPropertyDescriptor(sealed, 'existing'),
{
configurable: false,
enumerable: true,
value: true,
writable: true
},
'existing value on sealed object has expected descriptor'
);
defineDataProperty(sealed, 'existing', 'new value');
st.deepEqual(
Object.getOwnPropertyDescriptor(sealed, 'existing'),
{
configurable: false,
enumerable: true,
value: 'new value',
writable: true
},
'existing value on sealed object has changed descriptor'
);
st['throws'](
function () { defineDataProperty(sealed, 'new', 'new property'); },
TypeError,
'sealed object can not add a new property'
);
st.end();
});
t.test('nonextensible object, ES5+', { skip: !hasPropertyDescriptors }, function (st) {
var nonExt = Object.preventExtensions({ existing: true });
st.deepEqual(
Object.getOwnPropertyDescriptor(nonExt, 'existing'),
{
configurable: true,
enumerable: true,
value: true,
writable: true
},
'existing value on non-extensible object has expected descriptor'
);
defineDataProperty(nonExt, 'existing', 'new value', true);
st.deepEqual(
Object.getOwnPropertyDescriptor(nonExt, 'existing'),
{
configurable: true,
enumerable: false,
value: 'new value',
writable: true
},
'existing value on non-extensible object has changed descriptor'
);
st['throws'](
function () { defineDataProperty(nonExt, 'new', 'new property'); },
TypeError,
'non-extensible object can not add a new property'
);
st.end();
});
t.end();
});
@@ -0,0 +1,110 @@
'use strict';
import utils from '../utils.js';
/**
* Create an Error with the specified message, config, error code, request and response.
*
* @param {string} message The error message.
* @param {string} [code] The error code (for example, 'ECONNABORTED').
* @param {Object} [config] The config.
* @param {Object} [request] The request.
* @param {Object} [response] The response.
*
* @returns {Error} The created error.
*/
function AxiosError(message, code, config, request, response) {
Error.call(this);
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = (new Error()).stack;
}
this.message = message;
this.name = 'AxiosError';
code && (this.code = code);
config && (this.config = config);
request && (this.request = request);
if (response) {
this.response = response;
this.status = response.status ? response.status : null;
}
}
utils.inherits(AxiosError, Error, {
toJSON: function toJSON() {
return {
// Standard
message: this.message,
name: this.name,
// Microsoft
description: this.description,
number: this.number,
// Mozilla
fileName: this.fileName,
lineNumber: this.lineNumber,
columnNumber: this.columnNumber,
stack: this.stack,
// Axios
config: utils.toJSONObject(this.config),
code: this.code,
status: this.status
};
}
});
const prototype = AxiosError.prototype;
const descriptors = {};
[
'ERR_BAD_OPTION_VALUE',
'ERR_BAD_OPTION',
'ECONNABORTED',
'ETIMEDOUT',
'ERR_NETWORK',
'ERR_FR_TOO_MANY_REDIRECTS',
'ERR_DEPRECATED',
'ERR_BAD_RESPONSE',
'ERR_BAD_REQUEST',
'ERR_CANCELED',
'ERR_NOT_SUPPORT',
'ERR_INVALID_URL'
// eslint-disable-next-line func-names
].forEach(code => {
descriptors[code] = {value: code};
});
Object.defineProperties(AxiosError, descriptors);
Object.defineProperty(prototype, 'isAxiosError', {value: true});
// eslint-disable-next-line func-names
AxiosError.from = (error, code, config, request, response, customProps) => {
const axiosError = Object.create(prototype);
utils.toFlatObject(error, axiosError, function filter(obj) {
return obj !== Error.prototype;
}, prop => {
return prop !== 'isAxiosError';
});
const msg = error && error.message ? error.message : 'Error';
// Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
const errCode = code == null && error ? error.code : code;
AxiosError.call(axiosError, msg, errCode, config, request, response);
// Chain the original error on the standard field; non-enumerable to avoid JSON noise
if (error && axiosError.cause == null) {
Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
}
axiosError.name = (error && error.name) || 'Error';
customProps && Object.assign(axiosError, customProps);
return axiosError;
};
export default AxiosError;
@@ -0,0 +1,101 @@
import type { ThunkDispatch } from '@reduxjs/toolkit'
import type { MaybePromise, UnwrapPromise } from './tsHelpers'
export interface BaseQueryApi {
signal: AbortSignal
abort: (reason?: string) => void
dispatch: ThunkDispatch<any, any, any>
getState: () => unknown
extra: unknown
endpoint: string
type: 'query' | 'mutation'
/**
* Only available for queries: indicates if a query has been forced,
* i.e. it would have been fetched even if there would already be a cache entry
* (this does not mean that there is already a cache entry though!)
*
* This can be used to for example add a `Cache-Control: no-cache` header for
* invalidated queries.
*/
forced?: boolean
/**
* Only available for queries: the cache key that was used to store the query result
*/
queryCacheKey?: string
}
export type QueryReturnValue<T = unknown, E = unknown, M = unknown> =
| {
error: E
data?: undefined
meta?: M
}
| {
error?: undefined
data: T
meta?: M
}
export type BaseQueryFn<
Args = any,
Result = unknown,
Error = unknown,
DefinitionExtraOptions = {},
Meta = {},
> = (
args: Args,
api: BaseQueryApi,
extraOptions: DefinitionExtraOptions,
) => MaybePromise<QueryReturnValue<Result, Error, Meta>>
export type BaseQueryEnhancer<
AdditionalArgs = unknown,
AdditionalDefinitionExtraOptions = unknown,
Config = void,
> = <BaseQuery extends BaseQueryFn>(
baseQuery: BaseQuery,
config: Config,
) => BaseQueryFn<
BaseQueryArg<BaseQuery> & AdditionalArgs,
BaseQueryResult<BaseQuery>,
BaseQueryError<BaseQuery>,
BaseQueryExtraOptions<BaseQuery> & AdditionalDefinitionExtraOptions,
NonNullable<BaseQueryMeta<BaseQuery>>
>
/**
* @public
*/
export type BaseQueryResult<BaseQuery extends BaseQueryFn> =
UnwrapPromise<ReturnType<BaseQuery>> extends infer Unwrapped
? Unwrapped extends { data: any }
? Unwrapped['data']
: never
: never
/**
* @public
*/
export type BaseQueryMeta<BaseQuery extends BaseQueryFn> = UnwrapPromise<
ReturnType<BaseQuery>
>['meta']
/**
* @public
*/
export type BaseQueryError<BaseQuery extends BaseQueryFn> = Exclude<
UnwrapPromise<ReturnType<BaseQuery>>,
{ error?: undefined }
>['error']
/**
* @public
*/
export type BaseQueryArg<T extends (arg: any, ...args: any[]) => any> =
T extends (arg: infer A, ...args: any[]) => any ? A : any
/**
* @public
*/
export type BaseQueryExtraOptions<BaseQuery extends BaseQueryFn> =
Parameters<BaseQuery>[2]
@@ -0,0 +1,2 @@
export { ZipHandler, type ILocalFileHeader } from './ZipHandler.js';
export { GzipHandler } from './GzipHandler.js';
@@ -0,0 +1,100 @@
/**
* @fileoverview Require all forwardRef components include a ref parameter
*/
'use strict';
const isParenthesized = require('../util/ast').isParenthesized;
const docsUrl = require('../util/docsUrl');
const report = require('../util/report');
const getMessageData = require('../util/message');
// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------
/**
* @param {ASTNode} node
* @returns {boolean} If the node represents the identifier `forwardRef`.
*/
function isForwardRefIdentifier(node) {
return node.type === 'Identifier' && node.name === 'forwardRef';
}
/**
* @param {ASTNode} node
* @returns {boolean} If the node represents a function call `forwardRef()` or `React.forwardRef()`.
*/
function isForwardRefCall(node) {
return (
node.type === 'CallExpression'
&& (
isForwardRefIdentifier(node.callee)
|| (node.callee.type === 'MemberExpression' && isForwardRefIdentifier(node.callee.property))
)
);
}
const messages = {
missingRefParameter: 'forwardRef is used with this component but no ref parameter is set',
addRefParameter: 'Add a ref parameter',
removeForwardRef: 'Remove forwardRef wrapper',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Require all forwardRef components include a ref parameter',
category: 'Possible Errors',
recommended: false,
url: docsUrl('forward-ref-uses-ref'),
},
messages,
schema: [],
type: 'suggestion',
hasSuggestions: true,
},
create(context) {
const sourceCode = context.getSourceCode();
return {
'FunctionExpression, ArrowFunctionExpression'(node) {
if (!isForwardRefCall(node.parent)) {
return;
}
if (node.params.length === 1) {
report(context, messages.missingRefParameter, 'missingRefParameter', {
node,
suggest: [
Object.assign(
getMessageData('addRefParameter', messages.addRefParameter),
{
fix(fixer) {
const param = node.params[0];
// If using shorthand arrow function syntax, add parentheses around the new parameter pair
const shouldAddParentheses = node.type === 'ArrowFunctionExpression' && !isParenthesized(context, param);
return [].concat(
shouldAddParentheses ? fixer.insertTextBefore(param, '(') : [],
fixer.insertTextAfter(param, `, ref${shouldAddParentheses ? ')' : ''}`)
);
},
}
),
Object.assign(
getMessageData('removeForwardRef', messages.removeForwardRef),
{
fix(fixer) {
return fixer.replaceText(node.parent, sourceCode.getText(node));
},
}
),
],
});
}
},
};
},
};
@@ -0,0 +1,698 @@
// THIS FILE IS AUTO GENERATED
import type { IconType } from '../lib/index'
export declare const IoIosAddCircleOutline: IconType;
export declare const IoIosAddCircle: IconType;
export declare const IoIosAdd: IconType;
export declare const IoIosAirplane: IconType;
export declare const IoIosAlarm: IconType;
export declare const IoIosAlbums: IconType;
export declare const IoIosAlert: IconType;
export declare const IoIosAmericanFootball: IconType;
export declare const IoIosAnalytics: IconType;
export declare const IoIosAperture: IconType;
export declare const IoIosApps: IconType;
export declare const IoIosAppstore: IconType;
export declare const IoIosArchive: IconType;
export declare const IoIosArrowBack: IconType;
export declare const IoIosArrowDown: IconType;
export declare const IoIosArrowDropdownCircle: IconType;
export declare const IoIosArrowDropdown: IconType;
export declare const IoIosArrowDropleftCircle: IconType;
export declare const IoIosArrowDropleft: IconType;
export declare const IoIosArrowDroprightCircle: IconType;
export declare const IoIosArrowDropright: IconType;
export declare const IoIosArrowDropupCircle: IconType;
export declare const IoIosArrowDropup: IconType;
export declare const IoIosArrowForward: IconType;
export declare const IoIosArrowRoundBack: IconType;
export declare const IoIosArrowRoundDown: IconType;
export declare const IoIosArrowRoundForward: IconType;
export declare const IoIosArrowRoundUp: IconType;
export declare const IoIosArrowUp: IconType;
export declare const IoIosAt: IconType;
export declare const IoIosAttach: IconType;
export declare const IoIosBackspace: IconType;
export declare const IoIosBarcode: IconType;
export declare const IoIosBaseball: IconType;
export declare const IoIosBasket: IconType;
export declare const IoIosBasketball: IconType;
export declare const IoIosBatteryCharging: IconType;
export declare const IoIosBatteryDead: IconType;
export declare const IoIosBatteryFull: IconType;
export declare const IoIosBeaker: IconType;
export declare const IoIosBed: IconType;
export declare const IoIosBeer: IconType;
export declare const IoIosBicycle: IconType;
export declare const IoIosBluetooth: IconType;
export declare const IoIosBoat: IconType;
export declare const IoIosBody: IconType;
export declare const IoIosBonfire: IconType;
export declare const IoIosBook: IconType;
export declare const IoIosBookmark: IconType;
export declare const IoIosBookmarks: IconType;
export declare const IoIosBowtie: IconType;
export declare const IoIosBriefcase: IconType;
export declare const IoIosBrowsers: IconType;
export declare const IoIosBrush: IconType;
export declare const IoIosBug: IconType;
export declare const IoIosBuild: IconType;
export declare const IoIosBulb: IconType;
export declare const IoIosBus: IconType;
export declare const IoIosBusiness: IconType;
export declare const IoIosCafe: IconType;
export declare const IoIosCalculator: IconType;
export declare const IoIosCalendar: IconType;
export declare const IoIosCall: IconType;
export declare const IoIosCamera: IconType;
export declare const IoIosCar: IconType;
export declare const IoIosCard: IconType;
export declare const IoIosCart: IconType;
export declare const IoIosCash: IconType;
export declare const IoIosCellular: IconType;
export declare const IoIosChatboxes: IconType;
export declare const IoIosChatbubbles: IconType;
export declare const IoIosCheckboxOutline: IconType;
export declare const IoIosCheckbox: IconType;
export declare const IoIosCheckmarkCircleOutline: IconType;
export declare const IoIosCheckmarkCircle: IconType;
export declare const IoIosCheckmark: IconType;
export declare const IoIosClipboard: IconType;
export declare const IoIosClock: IconType;
export declare const IoIosCloseCircleOutline: IconType;
export declare const IoIosCloseCircle: IconType;
export declare const IoIosClose: IconType;
export declare const IoIosCloudCircle: IconType;
export declare const IoIosCloudDone: IconType;
export declare const IoIosCloudDownload: IconType;
export declare const IoIosCloudOutline: IconType;
export declare const IoIosCloudUpload: IconType;
export declare const IoIosCloud: IconType;
export declare const IoIosCloudyNight: IconType;
export declare const IoIosCloudy: IconType;
export declare const IoIosCodeDownload: IconType;
export declare const IoIosCodeWorking: IconType;
export declare const IoIosCode: IconType;
export declare const IoIosCog: IconType;
export declare const IoIosColorFill: IconType;
export declare const IoIosColorFilter: IconType;
export declare const IoIosColorPalette: IconType;
export declare const IoIosColorWand: IconType;
export declare const IoIosCompass: IconType;
export declare const IoIosConstruct: IconType;
export declare const IoIosContact: IconType;
export declare const IoIosContacts: IconType;
export declare const IoIosContract: IconType;
export declare const IoIosContrast: IconType;
export declare const IoIosCopy: IconType;
export declare const IoIosCreate: IconType;
export declare const IoIosCrop: IconType;
export declare const IoIosCube: IconType;
export declare const IoIosCut: IconType;
export declare const IoIosDesktop: IconType;
export declare const IoIosDisc: IconType;
export declare const IoIosDocument: IconType;
export declare const IoIosDoneAll: IconType;
export declare const IoIosDownload: IconType;
export declare const IoIosEasel: IconType;
export declare const IoIosEgg: IconType;
export declare const IoIosExit: IconType;
export declare const IoIosExpand: IconType;
export declare const IoIosEyeOff: IconType;
export declare const IoIosEye: IconType;
export declare const IoIosFastforward: IconType;
export declare const IoIosFemale: IconType;
export declare const IoIosFiling: IconType;
export declare const IoIosFilm: IconType;
export declare const IoIosFingerPrint: IconType;
export declare const IoIosFitness: IconType;
export declare const IoIosFlag: IconType;
export declare const IoIosFlame: IconType;
export declare const IoIosFlashOff: IconType;
export declare const IoIosFlash: IconType;
export declare const IoIosFlashlight: IconType;
export declare const IoIosFlask: IconType;
export declare const IoIosFlower: IconType;
export declare const IoIosFolderOpen: IconType;
export declare const IoIosFolder: IconType;
export declare const IoIosFootball: IconType;
export declare const IoIosFunnel: IconType;
export declare const IoIosGift: IconType;
export declare const IoIosGitBranch: IconType;
export declare const IoIosGitCommit: IconType;
export declare const IoIosGitCompare: IconType;
export declare const IoIosGitMerge: IconType;
export declare const IoIosGitNetwork: IconType;
export declare const IoIosGitPullRequest: IconType;
export declare const IoIosGlasses: IconType;
export declare const IoIosGlobe: IconType;
export declare const IoIosGrid: IconType;
export declare const IoIosHammer: IconType;
export declare const IoIosHand: IconType;
export declare const IoIosHappy: IconType;
export declare const IoIosHeadset: IconType;
export declare const IoIosHeartDislike: IconType;
export declare const IoIosHeartEmpty: IconType;
export declare const IoIosHeartHalf: IconType;
export declare const IoIosHeart: IconType;
export declare const IoIosHelpBuoy: IconType;
export declare const IoIosHelpCircleOutline: IconType;
export declare const IoIosHelpCircle: IconType;
export declare const IoIosHelp: IconType;
export declare const IoIosHome: IconType;
export declare const IoIosHourglass: IconType;
export declare const IoIosIceCream: IconType;
export declare const IoIosImage: IconType;
export declare const IoIosImages: IconType;
export declare const IoIosInfinite: IconType;
export declare const IoIosInformationCircleOutline: IconType;
export declare const IoIosInformationCircle: IconType;
export declare const IoIosInformation: IconType;
export declare const IoIosJet: IconType;
export declare const IoIosJournal: IconType;
export declare const IoIosKey: IconType;
export declare const IoIosKeypad: IconType;
export declare const IoIosLaptop: IconType;
export declare const IoIosLeaf: IconType;
export declare const IoIosLink: IconType;
export declare const IoIosListBox: IconType;
export declare const IoIosList: IconType;
export declare const IoIosLocate: IconType;
export declare const IoIosLock: IconType;
export declare const IoIosLogIn: IconType;
export declare const IoIosLogOut: IconType;
export declare const IoIosMagnet: IconType;
export declare const IoIosMailOpen: IconType;
export declare const IoIosMailUnread: IconType;
export declare const IoIosMail: IconType;
export declare const IoIosMale: IconType;
export declare const IoIosMan: IconType;
export declare const IoIosMap: IconType;
export declare const IoIosMedal: IconType;
export declare const IoIosMedical: IconType;
export declare const IoIosMedkit: IconType;
export declare const IoIosMegaphone: IconType;
export declare const IoIosMenu: IconType;
export declare const IoIosMicOff: IconType;
export declare const IoIosMic: IconType;
export declare const IoIosMicrophone: IconType;
export declare const IoIosMoon: IconType;
export declare const IoIosMore: IconType;
export declare const IoIosMove: IconType;
export declare const IoIosMusicalNote: IconType;
export declare const IoIosMusicalNotes: IconType;
export declare const IoIosNavigate: IconType;
export declare const IoIosNotificationsOff: IconType;
export declare const IoIosNotificationsOutline: IconType;
export declare const IoIosNotifications: IconType;
export declare const IoIosNuclear: IconType;
export declare const IoIosNutrition: IconType;
export declare const IoIosOpen: IconType;
export declare const IoIosOptions: IconType;
export declare const IoIosOutlet: IconType;
export declare const IoIosPaperPlane: IconType;
export declare const IoIosPaper: IconType;
export declare const IoIosPartlySunny: IconType;
export declare const IoIosPause: IconType;
export declare const IoIosPaw: IconType;
export declare const IoIosPeople: IconType;
export declare const IoIosPersonAdd: IconType;
export declare const IoIosPerson: IconType;
export declare const IoIosPhoneLandscape: IconType;
export declare const IoIosPhonePortrait: IconType;
export declare const IoIosPhotos: IconType;
export declare const IoIosPie: IconType;
export declare const IoIosPin: IconType;
export declare const IoIosPint: IconType;
export declare const IoIosPizza: IconType;
export declare const IoIosPlanet: IconType;
export declare const IoIosPlayCircle: IconType;
export declare const IoIosPlay: IconType;
export declare const IoIosPodium: IconType;
export declare const IoIosPower: IconType;
export declare const IoIosPricetag: IconType;
export declare const IoIosPricetags: IconType;
export declare const IoIosPrint: IconType;
export declare const IoIosPulse: IconType;
export declare const IoIosQrScanner: IconType;
export declare const IoIosQuote: IconType;
export declare const IoIosRadioButtonOff: IconType;
export declare const IoIosRadioButtonOn: IconType;
export declare const IoIosRadio: IconType;
export declare const IoIosRainy: IconType;
export declare const IoIosRecording: IconType;
export declare const IoIosRedo: IconType;
export declare const IoIosRefreshCircle: IconType;
export declare const IoIosRefresh: IconType;
export declare const IoIosRemoveCircleOutline: IconType;
export declare const IoIosRemoveCircle: IconType;
export declare const IoIosRemove: IconType;
export declare const IoIosReorder: IconType;
export declare const IoIosRepeat: IconType;
export declare const IoIosResize: IconType;
export declare const IoIosRestaurant: IconType;
export declare const IoIosReturnLeft: IconType;
export declare const IoIosReturnRight: IconType;
export declare const IoIosReverseCamera: IconType;
export declare const IoIosRewind: IconType;
export declare const IoIosRibbon: IconType;
export declare const IoIosRocket: IconType;
export declare const IoIosRose: IconType;
export declare const IoIosSad: IconType;
export declare const IoIosSave: IconType;
export declare const IoIosSchool: IconType;
export declare const IoIosSearch: IconType;
export declare const IoIosSend: IconType;
export declare const IoIosSettings: IconType;
export declare const IoIosShareAlt: IconType;
export declare const IoIosShare: IconType;
export declare const IoIosShirt: IconType;
export declare const IoIosShuffle: IconType;
export declare const IoIosSkipBackward: IconType;
export declare const IoIosSkipForward: IconType;
export declare const IoIosSnow: IconType;
export declare const IoIosSpeedometer: IconType;
export declare const IoIosSquareOutline: IconType;
export declare const IoIosSquare: IconType;
export declare const IoIosStarHalf: IconType;
export declare const IoIosStarOutline: IconType;
export declare const IoIosStar: IconType;
export declare const IoIosStats: IconType;
export declare const IoIosStopwatch: IconType;
export declare const IoIosSubway: IconType;
export declare const IoIosSunny: IconType;
export declare const IoIosSwap: IconType;
export declare const IoIosSwitch: IconType;
export declare const IoIosSync: IconType;
export declare const IoIosTabletLandscape: IconType;
export declare const IoIosTabletPortrait: IconType;
export declare const IoIosTennisball: IconType;
export declare const IoIosText: IconType;
export declare const IoIosThermometer: IconType;
export declare const IoIosThumbsDown: IconType;
export declare const IoIosThumbsUp: IconType;
export declare const IoIosThunderstorm: IconType;
export declare const IoIosTime: IconType;
export declare const IoIosTimer: IconType;
export declare const IoIosToday: IconType;
export declare const IoIosTrain: IconType;
export declare const IoIosTransgender: IconType;
export declare const IoIosTrash: IconType;
export declare const IoIosTrendingDown: IconType;
export declare const IoIosTrendingUp: IconType;
export declare const IoIosTrophy: IconType;
export declare const IoIosTv: IconType;
export declare const IoIosUmbrella: IconType;
export declare const IoIosUndo: IconType;
export declare const IoIosUnlock: IconType;
export declare const IoIosVideocam: IconType;
export declare const IoIosVolumeHigh: IconType;
export declare const IoIosVolumeLow: IconType;
export declare const IoIosVolumeMute: IconType;
export declare const IoIosVolumeOff: IconType;
export declare const IoIosWalk: IconType;
export declare const IoIosWallet: IconType;
export declare const IoIosWarning: IconType;
export declare const IoIosWatch: IconType;
export declare const IoIosWater: IconType;
export declare const IoIosWifi: IconType;
export declare const IoIosWine: IconType;
export declare const IoIosWoman: IconType;
export declare const IoLogoAndroid: IconType;
export declare const IoLogoAngular: IconType;
export declare const IoLogoApple: IconType;
export declare const IoLogoBitbucket: IconType;
export declare const IoLogoBitcoin: IconType;
export declare const IoLogoBuffer: IconType;
export declare const IoLogoChrome: IconType;
export declare const IoLogoClosedCaptioning: IconType;
export declare const IoLogoCodepen: IconType;
export declare const IoLogoCss3: IconType;
export declare const IoLogoDesignernews: IconType;
export declare const IoLogoDribbble: IconType;
export declare const IoLogoDropbox: IconType;
export declare const IoLogoEuro: IconType;
export declare const IoLogoFacebook: IconType;
export declare const IoLogoFlickr: IconType;
export declare const IoLogoFoursquare: IconType;
export declare const IoLogoFreebsdDevil: IconType;
export declare const IoLogoGameControllerA: IconType;
export declare const IoLogoGameControllerB: IconType;
export declare const IoLogoGithub: IconType;
export declare const IoLogoGoogle: IconType;
export declare const IoLogoGoogleplus: IconType;
export declare const IoLogoHackernews: IconType;
export declare const IoLogoHtml5: IconType;
export declare const IoLogoInstagram: IconType;
export declare const IoLogoIonic: IconType;
export declare const IoLogoIonitron: IconType;
export declare const IoLogoJavascript: IconType;
export declare const IoLogoLinkedin: IconType;
export declare const IoLogoMarkdown: IconType;
export declare const IoLogoModelS: IconType;
export declare const IoLogoNoSmoking: IconType;
export declare const IoLogoNodejs: IconType;
export declare const IoLogoNpm: IconType;
export declare const IoLogoOctocat: IconType;
export declare const IoLogoPinterest: IconType;
export declare const IoLogoPlaystation: IconType;
export declare const IoLogoPolymer: IconType;
export declare const IoLogoPython: IconType;
export declare const IoLogoReddit: IconType;
export declare const IoLogoRss: IconType;
export declare const IoLogoSass: IconType;
export declare const IoLogoSkype: IconType;
export declare const IoLogoSlack: IconType;
export declare const IoLogoSnapchat: IconType;
export declare const IoLogoSteam: IconType;
export declare const IoLogoTumblr: IconType;
export declare const IoLogoTux: IconType;
export declare const IoLogoTwitch: IconType;
export declare const IoLogoTwitter: IconType;
export declare const IoLogoUsd: IconType;
export declare const IoLogoVimeo: IconType;
export declare const IoLogoVk: IconType;
export declare const IoLogoWhatsapp: IconType;
export declare const IoLogoWindows: IconType;
export declare const IoLogoWordpress: IconType;
export declare const IoLogoXbox: IconType;
export declare const IoLogoXing: IconType;
export declare const IoLogoYahoo: IconType;
export declare const IoLogoYen: IconType;
export declare const IoLogoYoutube: IconType;
export declare const IoMdAddCircleOutline: IconType;
export declare const IoMdAddCircle: IconType;
export declare const IoMdAdd: IconType;
export declare const IoMdAirplane: IconType;
export declare const IoMdAlarm: IconType;
export declare const IoMdAlbums: IconType;
export declare const IoMdAlert: IconType;
export declare const IoMdAmericanFootball: IconType;
export declare const IoMdAnalytics: IconType;
export declare const IoMdAperture: IconType;
export declare const IoMdApps: IconType;
export declare const IoMdAppstore: IconType;
export declare const IoMdArchive: IconType;
export declare const IoMdArrowBack: IconType;
export declare const IoMdArrowDown: IconType;
export declare const IoMdArrowDropdownCircle: IconType;
export declare const IoMdArrowDropdown: IconType;
export declare const IoMdArrowDropleftCircle: IconType;
export declare const IoMdArrowDropleft: IconType;
export declare const IoMdArrowDroprightCircle: IconType;
export declare const IoMdArrowDropright: IconType;
export declare const IoMdArrowDropupCircle: IconType;
export declare const IoMdArrowDropup: IconType;
export declare const IoMdArrowForward: IconType;
export declare const IoMdArrowRoundBack: IconType;
export declare const IoMdArrowRoundDown: IconType;
export declare const IoMdArrowRoundForward: IconType;
export declare const IoMdArrowRoundUp: IconType;
export declare const IoMdArrowUp: IconType;
export declare const IoMdAt: IconType;
export declare const IoMdAttach: IconType;
export declare const IoMdBackspace: IconType;
export declare const IoMdBarcode: IconType;
export declare const IoMdBaseball: IconType;
export declare const IoMdBasket: IconType;
export declare const IoMdBasketball: IconType;
export declare const IoMdBatteryCharging: IconType;
export declare const IoMdBatteryDead: IconType;
export declare const IoMdBatteryFull: IconType;
export declare const IoMdBeaker: IconType;
export declare const IoMdBed: IconType;
export declare const IoMdBeer: IconType;
export declare const IoMdBicycle: IconType;
export declare const IoMdBluetooth: IconType;
export declare const IoMdBoat: IconType;
export declare const IoMdBody: IconType;
export declare const IoMdBonfire: IconType;
export declare const IoMdBook: IconType;
export declare const IoMdBookmark: IconType;
export declare const IoMdBookmarks: IconType;
export declare const IoMdBowtie: IconType;
export declare const IoMdBriefcase: IconType;
export declare const IoMdBrowsers: IconType;
export declare const IoMdBrush: IconType;
export declare const IoMdBug: IconType;
export declare const IoMdBuild: IconType;
export declare const IoMdBulb: IconType;
export declare const IoMdBus: IconType;
export declare const IoMdBusiness: IconType;
export declare const IoMdCafe: IconType;
export declare const IoMdCalculator: IconType;
export declare const IoMdCalendar: IconType;
export declare const IoMdCall: IconType;
export declare const IoMdCamera: IconType;
export declare const IoMdCar: IconType;
export declare const IoMdCard: IconType;
export declare const IoMdCart: IconType;
export declare const IoMdCash: IconType;
export declare const IoMdCellular: IconType;
export declare const IoMdChatboxes: IconType;
export declare const IoMdChatbubbles: IconType;
export declare const IoMdCheckboxOutline: IconType;
export declare const IoMdCheckbox: IconType;
export declare const IoMdCheckmarkCircleOutline: IconType;
export declare const IoMdCheckmarkCircle: IconType;
export declare const IoMdCheckmark: IconType;
export declare const IoMdClipboard: IconType;
export declare const IoMdClock: IconType;
export declare const IoMdCloseCircleOutline: IconType;
export declare const IoMdCloseCircle: IconType;
export declare const IoMdClose: IconType;
export declare const IoMdCloudCircle: IconType;
export declare const IoMdCloudDone: IconType;
export declare const IoMdCloudDownload: IconType;
export declare const IoMdCloudOutline: IconType;
export declare const IoMdCloudUpload: IconType;
export declare const IoMdCloud: IconType;
export declare const IoMdCloudyNight: IconType;
export declare const IoMdCloudy: IconType;
export declare const IoMdCodeDownload: IconType;
export declare const IoMdCodeWorking: IconType;
export declare const IoMdCode: IconType;
export declare const IoMdCog: IconType;
export declare const IoMdColorFill: IconType;
export declare const IoMdColorFilter: IconType;
export declare const IoMdColorPalette: IconType;
export declare const IoMdColorWand: IconType;
export declare const IoMdCompass: IconType;
export declare const IoMdConstruct: IconType;
export declare const IoMdContact: IconType;
export declare const IoMdContacts: IconType;
export declare const IoMdContract: IconType;
export declare const IoMdContrast: IconType;
export declare const IoMdCopy: IconType;
export declare const IoMdCreate: IconType;
export declare const IoMdCrop: IconType;
export declare const IoMdCube: IconType;
export declare const IoMdCut: IconType;
export declare const IoMdDesktop: IconType;
export declare const IoMdDisc: IconType;
export declare const IoMdDocument: IconType;
export declare const IoMdDoneAll: IconType;
export declare const IoMdDownload: IconType;
export declare const IoMdEasel: IconType;
export declare const IoMdEgg: IconType;
export declare const IoMdExit: IconType;
export declare const IoMdExpand: IconType;
export declare const IoMdEyeOff: IconType;
export declare const IoMdEye: IconType;
export declare const IoMdFastforward: IconType;
export declare const IoMdFemale: IconType;
export declare const IoMdFiling: IconType;
export declare const IoMdFilm: IconType;
export declare const IoMdFingerPrint: IconType;
export declare const IoMdFitness: IconType;
export declare const IoMdFlag: IconType;
export declare const IoMdFlame: IconType;
export declare const IoMdFlashOff: IconType;
export declare const IoMdFlash: IconType;
export declare const IoMdFlashlight: IconType;
export declare const IoMdFlask: IconType;
export declare const IoMdFlower: IconType;
export declare const IoMdFolderOpen: IconType;
export declare const IoMdFolder: IconType;
export declare const IoMdFootball: IconType;
export declare const IoMdFunnel: IconType;
export declare const IoMdGift: IconType;
export declare const IoMdGitBranch: IconType;
export declare const IoMdGitCommit: IconType;
export declare const IoMdGitCompare: IconType;
export declare const IoMdGitMerge: IconType;
export declare const IoMdGitNetwork: IconType;
export declare const IoMdGitPullRequest: IconType;
export declare const IoMdGlasses: IconType;
export declare const IoMdGlobe: IconType;
export declare const IoMdGrid: IconType;
export declare const IoMdHammer: IconType;
export declare const IoMdHand: IconType;
export declare const IoMdHappy: IconType;
export declare const IoMdHeadset: IconType;
export declare const IoMdHeartDislike: IconType;
export declare const IoMdHeartEmpty: IconType;
export declare const IoMdHeartHalf: IconType;
export declare const IoMdHeart: IconType;
export declare const IoMdHelpBuoy: IconType;
export declare const IoMdHelpCircleOutline: IconType;
export declare const IoMdHelpCircle: IconType;
export declare const IoMdHelp: IconType;
export declare const IoMdHome: IconType;
export declare const IoMdHourglass: IconType;
export declare const IoMdIceCream: IconType;
export declare const IoMdImage: IconType;
export declare const IoMdImages: IconType;
export declare const IoMdInfinite: IconType;
export declare const IoMdInformationCircleOutline: IconType;
export declare const IoMdInformationCircle: IconType;
export declare const IoMdInformation: IconType;
export declare const IoMdJet: IconType;
export declare const IoMdJournal: IconType;
export declare const IoMdKey: IconType;
export declare const IoMdKeypad: IconType;
export declare const IoMdLaptop: IconType;
export declare const IoMdLeaf: IconType;
export declare const IoMdLink: IconType;
export declare const IoMdListBox: IconType;
export declare const IoMdList: IconType;
export declare const IoMdLocate: IconType;
export declare const IoMdLock: IconType;
export declare const IoMdLogIn: IconType;
export declare const IoMdLogOut: IconType;
export declare const IoMdMagnet: IconType;
export declare const IoMdMailOpen: IconType;
export declare const IoMdMailUnread: IconType;
export declare const IoMdMail: IconType;
export declare const IoMdMale: IconType;
export declare const IoMdMan: IconType;
export declare const IoMdMap: IconType;
export declare const IoMdMedal: IconType;
export declare const IoMdMedical: IconType;
export declare const IoMdMedkit: IconType;
export declare const IoMdMegaphone: IconType;
export declare const IoMdMenu: IconType;
export declare const IoMdMicOff: IconType;
export declare const IoMdMic: IconType;
export declare const IoMdMicrophone: IconType;
export declare const IoMdMoon: IconType;
export declare const IoMdMore: IconType;
export declare const IoMdMove: IconType;
export declare const IoMdMusicalNote: IconType;
export declare const IoMdMusicalNotes: IconType;
export declare const IoMdNavigate: IconType;
export declare const IoMdNotificationsOff: IconType;
export declare const IoMdNotificationsOutline: IconType;
export declare const IoMdNotifications: IconType;
export declare const IoMdNuclear: IconType;
export declare const IoMdNutrition: IconType;
export declare const IoMdOpen: IconType;
export declare const IoMdOptions: IconType;
export declare const IoMdOutlet: IconType;
export declare const IoMdPaperPlane: IconType;
export declare const IoMdPaper: IconType;
export declare const IoMdPartlySunny: IconType;
export declare const IoMdPause: IconType;
export declare const IoMdPaw: IconType;
export declare const IoMdPeople: IconType;
export declare const IoMdPersonAdd: IconType;
export declare const IoMdPerson: IconType;
export declare const IoMdPhoneLandscape: IconType;
export declare const IoMdPhonePortrait: IconType;
export declare const IoMdPhotos: IconType;
export declare const IoMdPie: IconType;
export declare const IoMdPin: IconType;
export declare const IoMdPint: IconType;
export declare const IoMdPizza: IconType;
export declare const IoMdPlanet: IconType;
export declare const IoMdPlayCircle: IconType;
export declare const IoMdPlay: IconType;
export declare const IoMdPodium: IconType;
export declare const IoMdPower: IconType;
export declare const IoMdPricetag: IconType;
export declare const IoMdPricetags: IconType;
export declare const IoMdPrint: IconType;
export declare const IoMdPulse: IconType;
export declare const IoMdQrScanner: IconType;
export declare const IoMdQuote: IconType;
export declare const IoMdRadioButtonOff: IconType;
export declare const IoMdRadioButtonOn: IconType;
export declare const IoMdRadio: IconType;
export declare const IoMdRainy: IconType;
export declare const IoMdRecording: IconType;
export declare const IoMdRedo: IconType;
export declare const IoMdRefreshCircle: IconType;
export declare const IoMdRefresh: IconType;
export declare const IoMdRemoveCircleOutline: IconType;
export declare const IoMdRemoveCircle: IconType;
export declare const IoMdRemove: IconType;
export declare const IoMdReorder: IconType;
export declare const IoMdRepeat: IconType;
export declare const IoMdResize: IconType;
export declare const IoMdRestaurant: IconType;
export declare const IoMdReturnLeft: IconType;
export declare const IoMdReturnRight: IconType;
export declare const IoMdReverseCamera: IconType;
export declare const IoMdRewind: IconType;
export declare const IoMdRibbon: IconType;
export declare const IoMdRocket: IconType;
export declare const IoMdRose: IconType;
export declare const IoMdSad: IconType;
export declare const IoMdSave: IconType;
export declare const IoMdSchool: IconType;
export declare const IoMdSearch: IconType;
export declare const IoMdSend: IconType;
export declare const IoMdSettings: IconType;
export declare const IoMdShareAlt: IconType;
export declare const IoMdShare: IconType;
export declare const IoMdShirt: IconType;
export declare const IoMdShuffle: IconType;
export declare const IoMdSkipBackward: IconType;
export declare const IoMdSkipForward: IconType;
export declare const IoMdSnow: IconType;
export declare const IoMdSpeedometer: IconType;
export declare const IoMdSquareOutline: IconType;
export declare const IoMdSquare: IconType;
export declare const IoMdStarHalf: IconType;
export declare const IoMdStarOutline: IconType;
export declare const IoMdStar: IconType;
export declare const IoMdStats: IconType;
export declare const IoMdStopwatch: IconType;
export declare const IoMdSubway: IconType;
export declare const IoMdSunny: IconType;
export declare const IoMdSwap: IconType;
export declare const IoMdSwitch: IconType;
export declare const IoMdSync: IconType;
export declare const IoMdTabletLandscape: IconType;
export declare const IoMdTabletPortrait: IconType;
export declare const IoMdTennisball: IconType;
export declare const IoMdText: IconType;
export declare const IoMdThermometer: IconType;
export declare const IoMdThumbsDown: IconType;
export declare const IoMdThumbsUp: IconType;
export declare const IoMdThunderstorm: IconType;
export declare const IoMdTime: IconType;
export declare const IoMdTimer: IconType;
export declare const IoMdToday: IconType;
export declare const IoMdTrain: IconType;
export declare const IoMdTransgender: IconType;
export declare const IoMdTrash: IconType;
export declare const IoMdTrendingDown: IconType;
export declare const IoMdTrendingUp: IconType;
export declare const IoMdTrophy: IconType;
export declare const IoMdTv: IconType;
export declare const IoMdUmbrella: IconType;
export declare const IoMdUndo: IconType;
export declare const IoMdUnlock: IconType;
export declare const IoMdVideocam: IconType;
export declare const IoMdVolumeHigh: IconType;
export declare const IoMdVolumeLow: IconType;
export declare const IoMdVolumeMute: IconType;
export declare const IoMdVolumeOff: IconType;
export declare const IoMdWalk: IconType;
export declare const IoMdWallet: IconType;
export declare const IoMdWarning: IconType;
export declare const IoMdWatch: IconType;
export declare const IoMdWater: IconType;
export declare const IoMdWifi: IconType;
export declare const IoMdWine: IconType;
export declare const IoMdWoman: IconType;
@@ -0,0 +1,8 @@
"use client";
import {
popover_trigger_default
} from "./chunk-ACZHGCS5.mjs";
import "./chunk-CGIRYUEE.mjs";
export {
popover_trigger_default as default
};
@@ -0,0 +1,292 @@
// src/set-array.ts
var SetArray = class {
constructor() {
this._indexes = { __proto__: null };
this.array = [];
}
};
function cast(set) {
return set;
}
function get(setarr, key) {
return cast(setarr)._indexes[key];
}
function put(setarr, key) {
const index = get(setarr, key);
if (index !== void 0) return index;
const { array, _indexes: indexes } = cast(setarr);
const length = array.push(key);
return indexes[key] = length - 1;
}
function remove(setarr, key) {
const index = get(setarr, key);
if (index === void 0) return;
const { array, _indexes: indexes } = cast(setarr);
for (let i = index + 1; i < array.length; i++) {
const k = array[i];
array[i - 1] = k;
indexes[k]--;
}
indexes[key] = void 0;
array.pop();
}
// src/gen-mapping.ts
import {
encode
} from "@jridgewell/sourcemap-codec";
import { TraceMap, decodedMappings } from "@jridgewell/trace-mapping";
// src/sourcemap-segment.ts
var COLUMN = 0;
var SOURCES_INDEX = 1;
var SOURCE_LINE = 2;
var SOURCE_COLUMN = 3;
var NAMES_INDEX = 4;
// src/gen-mapping.ts
var NO_NAME = -1;
var GenMapping = class {
constructor({ file, sourceRoot } = {}) {
this._names = new SetArray();
this._sources = new SetArray();
this._sourcesContent = [];
this._mappings = [];
this.file = file;
this.sourceRoot = sourceRoot;
this._ignoreList = new SetArray();
}
};
function cast2(map) {
return map;
}
function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
return addSegmentInternal(
false,
map,
genLine,
genColumn,
source,
sourceLine,
sourceColumn,
name,
content
);
}
function addMapping(map, mapping) {
return addMappingInternal(false, map, mapping);
}
var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
return addSegmentInternal(
true,
map,
genLine,
genColumn,
source,
sourceLine,
sourceColumn,
name,
content
);
};
var maybeAddMapping = (map, mapping) => {
return addMappingInternal(true, map, mapping);
};
function setSourceContent(map, source, content) {
const {
_sources: sources,
_sourcesContent: sourcesContent
// _originalScopes: originalScopes,
} = cast2(map);
const index = put(sources, source);
sourcesContent[index] = content;
}
function setIgnore(map, source, ignore = true) {
const {
_sources: sources,
_sourcesContent: sourcesContent,
_ignoreList: ignoreList
// _originalScopes: originalScopes,
} = cast2(map);
const index = put(sources, source);
if (index === sourcesContent.length) sourcesContent[index] = null;
if (ignore) put(ignoreList, index);
else remove(ignoreList, index);
}
function toDecodedMap(map) {
const {
_mappings: mappings,
_sources: sources,
_sourcesContent: sourcesContent,
_names: names,
_ignoreList: ignoreList
// _originalScopes: originalScopes,
// _generatedRanges: generatedRanges,
} = cast2(map);
removeEmptyFinalLines(mappings);
return {
version: 3,
file: map.file || void 0,
names: names.array,
sourceRoot: map.sourceRoot || void 0,
sources: sources.array,
sourcesContent,
mappings,
// originalScopes,
// generatedRanges,
ignoreList: ignoreList.array
};
}
function toEncodedMap(map) {
const decoded = toDecodedMap(map);
return Object.assign({}, decoded, {
// originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)),
// generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]),
mappings: encode(decoded.mappings)
});
}
function fromMap(input) {
const map = new TraceMap(input);
const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });
putAll(cast2(gen)._names, map.names);
putAll(cast2(gen)._sources, map.sources);
cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null);
cast2(gen)._mappings = decodedMappings(map);
if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList);
return gen;
}
function allMappings(map) {
const out = [];
const { _mappings: mappings, _sources: sources, _names: names } = cast2(map);
for (let i = 0; i < mappings.length; i++) {
const line = mappings[i];
for (let j = 0; j < line.length; j++) {
const seg = line[j];
const generated = { line: i + 1, column: seg[COLUMN] };
let source = void 0;
let original = void 0;
let name = void 0;
if (seg.length !== 1) {
source = sources.array[seg[SOURCES_INDEX]];
original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };
if (seg.length === 5) name = names.array[seg[NAMES_INDEX]];
}
out.push({ generated, source, original, name });
}
}
return out;
}
function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
const {
_mappings: mappings,
_sources: sources,
_sourcesContent: sourcesContent,
_names: names
// _originalScopes: originalScopes,
} = cast2(map);
const line = getIndex(mappings, genLine);
const index = getColumnIndex(line, genColumn);
if (!source) {
if (skipable && skipSourceless(line, index)) return;
return insert(line, index, [genColumn]);
}
assert(sourceLine);
assert(sourceColumn);
const sourcesIndex = put(sources, source);
const namesIndex = name ? put(names, name) : NO_NAME;
if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;
if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
return;
}
return insert(
line,
index,
name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn]
);
}
function assert(_val) {
}
function getIndex(arr, index) {
for (let i = arr.length; i <= index; i++) {
arr[i] = [];
}
return arr[index];
}
function getColumnIndex(line, genColumn) {
let index = line.length;
for (let i = index - 1; i >= 0; index = i--) {
const current = line[i];
if (genColumn >= current[COLUMN]) break;
}
return index;
}
function insert(array, index, value) {
for (let i = array.length; i > index; i--) {
array[i] = array[i - 1];
}
array[index] = value;
}
function removeEmptyFinalLines(mappings) {
const { length } = mappings;
let len = length;
for (let i = len - 1; i >= 0; len = i, i--) {
if (mappings[i].length > 0) break;
}
if (len < length) mappings.length = len;
}
function putAll(setarr, array) {
for (let i = 0; i < array.length; i++) put(setarr, array[i]);
}
function skipSourceless(line, index) {
if (index === 0) return true;
const prev = line[index - 1];
return prev.length === 1;
}
function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
if (index === 0) return false;
const prev = line[index - 1];
if (prev.length === 1) return false;
return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);
}
function addMappingInternal(skipable, map, mapping) {
const { generated, source, original, name, content } = mapping;
if (!source) {
return addSegmentInternal(
skipable,
map,
generated.line - 1,
generated.column,
null,
null,
null,
null,
null
);
}
assert(original);
return addSegmentInternal(
skipable,
map,
generated.line - 1,
generated.column,
source,
original.line - 1,
original.column,
name,
content
);
}
export {
GenMapping,
addMapping,
addSegment,
allMappings,
fromMap,
maybeAddMapping,
maybeAddSegment,
setIgnore,
setSourceContent,
toDecodedMap,
toEncodedMap
};
//# sourceMappingURL=gen-mapping.mjs.map
@@ -0,0 +1,25 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jasmine Tests",
"program": "${workspaceFolder}/node_modules/jasmine/bin/jasmine.js",
"args": [
"${workspaceFolder}/spec/attr_spec.js"
],
"internalConsoleOptions": "openOnSessionStart"
},{
"type": "node",
"request": "launch",
"name": "Jasmine Tests current test file",
"program": "${workspaceFolder}/node_modules/jasmine/bin/jasmine.js",
"args": [
"${file}"
],
"internalConsoleOptions": "openOnSessionStart"
}
]
}
@@ -0,0 +1,28 @@
function _class_apply_descriptor_update(receiver, descriptor) {
if (descriptor.set) {
if (!descriptor.get) throw new TypeError("attempted to read set only private field");
if (!("__destrWrapper" in descriptor)) {
descriptor.__destrWrapper = {
set value(v) {
descriptor.set.call(receiver, v);
},
get value() {
return descriptor.get.call(receiver);
}
};
}
return descriptor.__destrWrapper;
} else {
if (!descriptor.writable) {
// This should only throw in strict mode, but class bodies are
// always strict and private fields can only be used inside
// class bodies.
throw new TypeError("attempted to set read only private field");
}
return descriptor;
}
}
export { _class_apply_descriptor_update as _ };
@@ -0,0 +1,464 @@
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ } = require("@eslint-community/eslint-utils")
const {
checkUnsupportedBuiltins,
messages,
} = require("../../util/check-unsupported-builtins")
const enumeratePropertyNames = require("../../util/enumerate-property-names")
const getConfiguredNodeVersion = require("../../util/get-configured-node-version")
/** @type {Record<'globals' | 'modules', import('../../unsupported-features/types.js').SupportVersionTraceMap>} */
const traceMap = {
globals: {
// Core js builtins
AggregateError: {
[READ]: { supported: ["15.0.0"] },
},
Array: {
[READ]: { supported: ["0.10.0"] },
from: { [READ]: { supported: ["4.0.0"] } },
isArray: { [READ]: { supported: ["0.10.0"] } },
length: { [READ]: { supported: ["0.10.0"] } },
of: { [READ]: { supported: ["4.0.0"] } },
toLocaleString: { [READ]: { supported: ["0.10.0"] } },
},
ArrayBuffer: {
[READ]: { supported: ["0.10.0"] },
isView: { [READ]: { supported: ["4.0.0"] } },
},
Atomics: {
[READ]: { supported: ["8.10.0"] },
add: { [READ]: { supported: ["8.10.0"] } },
and: { [READ]: { supported: ["8.10.0"] } },
compareExchange: { [READ]: { supported: ["8.10.0"] } },
exchange: { [READ]: { supported: ["8.10.0"] } },
isLockFree: { [READ]: { supported: ["8.10.0"] } },
load: { [READ]: { supported: ["8.10.0"] } },
notify: { [READ]: { supported: ["8.10.0"] } },
or: { [READ]: { supported: ["8.10.0"] } },
store: { [READ]: { supported: ["8.10.0"] } },
sub: { [READ]: { supported: ["8.10.0"] } },
wait: { [READ]: { supported: ["8.10.0"] } },
waitAsync: { [READ]: { supported: ["16.0.0"] } },
xor: { [READ]: { supported: ["8.10.0"] } },
},
BigInt: {
[READ]: { supported: ["10.4.0"] },
asIntN: { [READ]: { supported: ["10.4.0"] } },
asUintN: { [READ]: { supported: ["10.4.0"] } },
},
BigInt64Array: {
[READ]: { supported: ["10.4.0"] },
BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } },
from: { [READ]: { supported: ["4.0.0"] } },
name: { [READ]: { supported: ["0.10.0"] } },
of: { [READ]: { supported: ["4.0.0"] } },
},
BigUint64Array: {
[READ]: { supported: ["10.4.0"] },
BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } },
from: { [READ]: { supported: ["4.0.0"] } },
name: { [READ]: { supported: ["0.10.0"] } },
of: { [READ]: { supported: ["4.0.0"] } },
},
Boolean: {
[READ]: { supported: ["0.10.0"] },
},
DataView: {
[READ]: { supported: ["0.10.0"] },
},
Date: {
[READ]: { supported: ["0.10.0"] },
UTC: { [READ]: { supported: ["0.10.0"] } },
now: { [READ]: { supported: ["0.10.0"] } },
parse: { [READ]: { supported: ["0.10.0"] } },
toLocaleDateString: { [READ]: { supported: ["0.10.0"] } },
toLocaleString: { [READ]: { supported: ["0.10.0"] } },
toLocaleTimeString: { [READ]: { supported: ["0.10.0"] } },
},
Error: {
[READ]: { supported: ["0.10.0"] },
cause: { [READ]: { supported: ["16.9.0"] } },
},
EvalError: {
[READ]: { supported: ["0.10.0"] },
},
FinalizationRegistry: {
[READ]: { supported: ["14.6.0"] },
},
Float32Array: {
[READ]: { supported: ["0.10.0"] },
BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } },
from: { [READ]: { supported: ["4.0.0"] } },
name: { [READ]: { supported: ["0.10.0"] } },
of: { [READ]: { supported: ["4.0.0"] } },
},
Float64Array: {
[READ]: { supported: ["0.10.0"] },
BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } },
from: { [READ]: { supported: ["4.0.0"] } },
name: { [READ]: { supported: ["0.10.0"] } },
of: { [READ]: { supported: ["4.0.0"] } },
},
Function: {
[READ]: { supported: ["0.10.0"] },
length: { [READ]: { supported: ["0.10.0"] } },
name: { [READ]: { supported: ["0.10.0"] } },
},
Infinity: {
[READ]: { supported: ["0.10.0"] },
},
Int16Array: {
[READ]: { supported: ["0.10.0"] },
BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } },
from: { [READ]: { supported: ["4.0.0"] } },
name: { [READ]: { supported: ["0.10.0"] } },
of: { [READ]: { supported: ["4.0.0"] } },
},
Int32Array: {
[READ]: { supported: ["0.10.0"] },
BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } },
from: { [READ]: { supported: ["4.0.0"] } },
name: { [READ]: { supported: ["0.10.0"] } },
of: { [READ]: { supported: ["4.0.0"] } },
},
Int8Array: {
[READ]: { supported: ["0.10.0"] },
BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } },
from: { [READ]: { supported: ["4.0.0"] } },
name: { [READ]: { supported: ["0.10.0"] } },
of: { [READ]: { supported: ["4.0.0"] } },
},
Intl: {
[READ]: { supported: ["0.12.0"] },
Collator: { [READ]: { supported: ["0.12.0"] } },
DateTimeFormat: { [READ]: { supported: ["0.12.0"] } },
DisplayNames: { [READ]: { supported: ["14.0.0"] } },
ListFormat: { [READ]: { supported: ["12.0.0"] } },
Locale: { [READ]: { supported: ["12.0.0"] } },
NumberFormat: { [READ]: { supported: ["0.12.0"] } },
PluralRules: { [READ]: { supported: ["10.0.0"] } },
RelativeTimeFormat: { [READ]: { supported: ["12.0.0"] } },
Segmenter: { [READ]: { supported: ["16.0.0"] } },
Segments: { [READ]: { supported: ["16.0.0"] } },
getCanonicalLocales: { [READ]: { supported: ["7.0.0"] } },
supportedValuesOf: { [READ]: { supported: ["18.0.0"] } },
},
JSON: {
[READ]: { supported: ["0.10.0"] },
parse: { [READ]: { supported: ["0.10.0"] } },
stringify: { [READ]: { supported: ["0.10.0"] } },
},
Map: {
[READ]: { supported: ["0.12.0"] },
groupBy: { [READ]: { supported: ["21.0.0"] } },
},
Math: {
[READ]: { supported: ["0.10.0"] },
E: { [READ]: { supported: ["0.10.0"] } },
LN10: { [READ]: { supported: ["0.10.0"] } },
LN2: { [READ]: { supported: ["0.10.0"] } },
LOG10E: { [READ]: { supported: ["0.10.0"] } },
LOG2E: { [READ]: { supported: ["0.10.0"] } },
PI: { [READ]: { supported: ["0.10.0"] } },
SQRT1_2: { [READ]: { supported: ["0.10.0"] } },
SQRT2: { [READ]: { supported: ["0.10.0"] } },
abs: { [READ]: { supported: ["0.10.0"] } },
acos: { [READ]: { supported: ["0.10.0"] } },
acosh: { [READ]: { supported: ["0.12.0"] } },
asin: { [READ]: { supported: ["0.10.0"] } },
asinh: { [READ]: { supported: ["0.12.0"] } },
atan: { [READ]: { supported: ["0.10.0"] } },
atan2: { [READ]: { supported: ["0.10.0"] } },
atanh: { [READ]: { supported: ["0.12.0"] } },
cbrt: { [READ]: { supported: ["0.12.0"] } },
ceil: { [READ]: { supported: ["0.10.0"] } },
clz32: { [READ]: { supported: ["0.12.0"] } },
cos: { [READ]: { supported: ["0.10.0"] } },
cosh: { [READ]: { supported: ["0.12.0"] } },
exp: { [READ]: { supported: ["0.10.0"] } },
expm1: { [READ]: { supported: ["0.12.0"] } },
floor: { [READ]: { supported: ["0.10.0"] } },
fround: { [READ]: { supported: ["0.12.0"] } },
hypot: { [READ]: { supported: ["0.12.0"] } },
imul: { [READ]: { supported: ["0.12.0"] } },
log: { [READ]: { supported: ["0.10.0"] } },
log10: { [READ]: { supported: ["0.12.0"] } },
log1p: { [READ]: { supported: ["0.12.0"] } },
log2: { [READ]: { supported: ["0.12.0"] } },
max: { [READ]: { supported: ["0.10.0"] } },
min: { [READ]: { supported: ["0.10.0"] } },
pow: { [READ]: { supported: ["0.10.0"] } },
random: { [READ]: { supported: ["0.10.0"] } },
round: { [READ]: { supported: ["0.10.0"] } },
sign: { [READ]: { supported: ["0.12.0"] } },
sin: { [READ]: { supported: ["0.10.0"] } },
sinh: { [READ]: { supported: ["0.12.0"] } },
sqrt: { [READ]: { supported: ["0.10.0"] } },
tan: { [READ]: { supported: ["0.10.0"] } },
tanh: { [READ]: { supported: ["0.12.0"] } },
trunc: { [READ]: { supported: ["0.12.0"] } },
},
NaN: {
[READ]: { supported: ["0.10.0"] },
},
Number: {
// [READ]: { supported: [ "0.10.0" ] },
EPSILON: { [READ]: { supported: ["0.12.0"] } },
MAX_SAFE_INTEGER: { [READ]: { supported: ["0.12.0"] } },
MAX_VALUE: { [READ]: { supported: ["0.10.0"] } },
MIN_SAFE_INTEGER: { [READ]: { supported: ["0.12.0"] } },
MIN_VALUE: { [READ]: { supported: ["0.10.0"] } },
NEGATIVE_INFINITY: { [READ]: { supported: ["0.10.0"] } },
NaN: { [READ]: { supported: ["0.10.0"] } },
POSITIVE_INFINITY: { [READ]: { supported: ["0.10.0"] } },
isFinite: { [READ]: { supported: ["0.10.0"] } },
isInteger: { [READ]: { supported: ["0.12.0"] } },
isNaN: { [READ]: { supported: ["0.10.0"] } },
isSafeInteger: { [READ]: { supported: ["0.12.0"] } },
parseFloat: { [READ]: { supported: ["0.12.0"] } },
parseInt: { [READ]: { supported: ["0.12.0"] } },
toLocaleString: { [READ]: { supported: ["0.10.0"] } },
},
Object: {
// [READ]: { supported: [ "0.10.0" ] },
assign: { [READ]: { supported: ["4.0.0"] } },
create: { [READ]: { supported: ["0.10.0"] } },
defineGetter: { [READ]: { supported: ["0.10.0"] } },
defineProperties: { [READ]: { supported: ["0.10.0"] } },
defineProperty: { [READ]: { supported: ["0.10.0"] } },
defineSetter: { [READ]: { supported: ["0.10.0"] } },
entries: { [READ]: { supported: ["7.0.0"] } },
freeze: { [READ]: { supported: ["0.10.0"] } },
fromEntries: { [READ]: { supported: ["12.0.0"] } },
getOwnPropertyDescriptor: { [READ]: { supported: ["0.10.0"] } },
getOwnPropertyDescriptors: { [READ]: { supported: ["7.0.0"] } },
getOwnPropertyNames: { [READ]: { supported: ["0.10.0"] } },
getOwnPropertySymbols: { [READ]: { supported: ["0.12.0"] } },
getPrototypeOf: { [READ]: { supported: ["0.10.0"] } },
groupBy: { [READ]: { supported: ["21.0.0"] } },
hasOwn: { [READ]: { supported: ["16.9.0"] } },
is: { [READ]: { supported: ["0.10.0"] } },
isExtensible: { [READ]: { supported: ["0.10.0"] } },
isFrozen: { [READ]: { supported: ["0.10.0"] } },
isSealed: { [READ]: { supported: ["0.10.0"] } },
keys: { [READ]: { supported: ["0.10.0"] } },
lookupGetter: { [READ]: { supported: ["0.10.0"] } },
lookupSetter: { [READ]: { supported: ["0.10.0"] } },
preventExtensions: { [READ]: { supported: ["0.10.0"] } },
proto: { [READ]: { supported: ["0.10.0"] } },
seal: { [READ]: { supported: ["0.10.0"] } },
setPrototypeOf: { [READ]: { supported: ["0.12.0"] } },
values: { [READ]: { supported: ["7.0.0"] } },
},
Promise: {
[READ]: { supported: ["0.12.0"] },
all: { [READ]: { supported: ["0.12.0"] } },
allSettled: { [READ]: { supported: ["12.9.0"] } },
any: { [READ]: { supported: ["15.0.0"] } },
race: { [READ]: { supported: ["0.12.0"] } },
reject: { [READ]: { supported: ["0.12.0"] } },
resolve: { [READ]: { supported: ["0.12.0"] } },
},
Proxy: {
[READ]: { supported: ["6.0.0"] },
revocable: { [READ]: { supported: ["6.0.0"] } },
},
RangeError: {
[READ]: { supported: ["0.10.0"] },
},
ReferenceError: {
[READ]: { supported: ["0.10.0"] },
},
Reflect: {
[READ]: { supported: ["6.0.0"] },
apply: { [READ]: { supported: ["6.0.0"] } },
construct: { [READ]: { supported: ["6.0.0"] } },
defineProperty: { [READ]: { supported: ["6.0.0"] } },
deleteProperty: { [READ]: { supported: ["6.0.0"] } },
get: { [READ]: { supported: ["6.0.0"] } },
getOwnPropertyDescriptor: { [READ]: { supported: ["6.0.0"] } },
getPrototypeOf: { [READ]: { supported: ["6.0.0"] } },
has: { [READ]: { supported: ["6.0.0"] } },
isExtensible: { [READ]: { supported: ["6.0.0"] } },
ownKeys: { [READ]: { supported: ["6.0.0"] } },
preventExtensions: { [READ]: { supported: ["6.0.0"] } },
set: { [READ]: { supported: ["6.0.0"] } },
setPrototypeOf: { [READ]: { supported: ["6.0.0"] } },
},
RegExp: {
[READ]: { supported: ["0.10.0"] },
dotAll: { [READ]: { supported: ["8.10.0"] } },
hasIndices: { [READ]: { supported: ["16.0.0"] } },
input: { [READ]: { supported: ["0.10.0"] } },
lastIndex: { [READ]: { supported: ["0.10.0"] } },
lastMatch: { [READ]: { supported: ["0.10.0"] } },
lastParen: { [READ]: { supported: ["0.10.0"] } },
leftContext: { [READ]: { supported: ["0.10.0"] } },
n: { [READ]: { supported: ["0.10.0"] } },
rightContext: { [READ]: { supported: ["0.10.0"] } },
},
Set: {
[READ]: { supported: ["0.12.0"] },
},
SharedArrayBuffer: {
[READ]: { supported: ["8.10.0"] },
},
String: {
[READ]: { supported: ["0.10.0"] },
fromCharCode: { [READ]: { supported: ["0.10.0"] } },
fromCodePoint: { [READ]: { supported: ["4.0.0"] } },
length: { [READ]: { supported: ["0.10.0"] } },
localeCompare: { [READ]: { supported: ["0.10.0"] } },
raw: { [READ]: { supported: ["4.0.0"] } },
toLocaleLowerCase: { [READ]: { supported: ["0.10.0"] } },
toLocaleUpperCase: { [READ]: { supported: ["0.10.0"] } },
},
Symbol: {
[READ]: { supported: ["0.12.0"] },
asyncIterator: { [READ]: { supported: ["10.0.0"] } },
for: { [READ]: { supported: ["0.12.0"] } },
hasInstance: { [READ]: { supported: ["6.5.0"] } },
isConcatSpreadable: { [READ]: { supported: ["6.0.0"] } },
iterator: { [READ]: { supported: ["0.12.0"] } },
keyFor: { [READ]: { supported: ["0.12.0"] } },
match: { [READ]: { supported: ["6.0.0"] } },
matchAll: { [READ]: { supported: ["12.0.0"] } },
replace: { [READ]: { supported: ["6.0.0"] } },
search: { [READ]: { supported: ["6.0.0"] } },
species: { [READ]: { supported: ["6.5.0"] } },
split: { [READ]: { supported: ["6.0.0"] } },
toPrimitive: { [READ]: { supported: ["6.0.0"] } },
toStringTag: { [READ]: { supported: ["6.0.0"] } },
unscopables: { [READ]: { supported: ["0.12.0"] } },
},
SyntaxError: {
[READ]: { supported: ["0.10.0"] },
},
TypeError: {
[READ]: { supported: ["0.10.0"] },
},
URIError: {
[READ]: { supported: ["0.10.0"] },
},
Uint16Array: {
[READ]: { supported: ["0.10.0"] },
BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } },
from: { [READ]: { supported: ["4.0.0"] } },
name: { [READ]: { supported: ["0.10.0"] } },
of: { [READ]: { supported: ["4.0.0"] } },
},
Uint32Array: {
[READ]: { supported: ["0.10.0"] },
BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } },
from: { [READ]: { supported: ["4.0.0"] } },
name: { [READ]: { supported: ["0.10.0"] } },
of: { [READ]: { supported: ["4.0.0"] } },
},
Uint8Array: {
[READ]: { supported: ["0.10.0"] },
BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } },
from: { [READ]: { supported: ["4.0.0"] } },
name: { [READ]: { supported: ["0.10.0"] } },
of: { [READ]: { supported: ["4.0.0"] } },
},
Uint8ClampedArray: {
[READ]: { supported: ["0.10.0"] },
BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } },
from: { [READ]: { supported: ["4.0.0"] } },
name: { [READ]: { supported: ["0.10.0"] } },
of: { [READ]: { supported: ["4.0.0"] } },
},
WeakMap: {
[READ]: { supported: ["0.12.0"] },
},
WeakRef: {
[READ]: { supported: ["14.6.0"] },
},
WeakSet: {
[READ]: { supported: ["0.12.0"] },
},
decodeURI: {
[READ]: { supported: ["0.10.0"] },
},
decodeURIComponent: {
[READ]: { supported: ["0.10.0"] },
},
encodeURI: {
[READ]: { supported: ["0.10.0"] },
},
encodeURIComponent: {
[READ]: { supported: ["0.10.0"] },
},
escape: {
[READ]: { supported: ["0.10.0"] },
},
eval: {
[READ]: { supported: ["0.10.0"] },
},
globalThis: {
[READ]: { supported: ["12.0.0"] },
},
isFinite: {
[READ]: { supported: ["0.10.0"] },
},
isNaN: {
[READ]: { supported: ["0.10.0"] },
},
parseFloat: {
[READ]: { supported: ["0.10.0"] },
},
parseInt: {
[READ]: { supported: ["0.10.0"] },
},
unescape: {
[READ]: { supported: ["0.10.0"] },
},
},
modules: {},
}
/** @type {import('../rule-module').RuleModule} */
module.exports = {
meta: {
docs: {
description:
"disallow unsupported ECMAScript built-ins on the specified version",
recommended: true,
url: "https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-unsupported-features/es-builtins.md",
},
type: "problem",
fixable: null,
schema: [
{
type: "object",
properties: {
version: getConfiguredNodeVersion.schema,
ignores: {
type: "array",
items: {
enum: Array.from(
enumeratePropertyNames(traceMap.globals)
),
},
uniqueItems: true,
},
},
additionalProperties: false,
},
],
messages,
},
create(context) {
return {
"Program:exit"() {
checkUnsupportedBuiltins(context, traceMap)
},
}
},
}
@@ -0,0 +1,18 @@
/**
* This method returns `true`.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {boolean} Returns `true`.
* @example
*
* _.times(2, _.stubTrue);
* // => [true, true]
*/
function stubTrue() {
return true;
}
export default stubTrue;
@@ -0,0 +1,43 @@
// TypeScript Version: 3.2
/// <reference types="node" lib="esnext" />
import * as fs from 'fs';
import { Readable } from 'stream';
declare namespace readdir {
interface EntryInfo {
path: string;
fullPath: string;
basename: string;
stats?: fs.Stats;
dirent?: fs.Dirent;
}
interface ReaddirpOptions {
root?: string;
fileFilter?: string | string[] | ((entry: EntryInfo) => boolean);
directoryFilter?: string | string[] | ((entry: EntryInfo) => boolean);
type?: 'files' | 'directories' | 'files_directories' | 'all';
lstat?: boolean;
depth?: number;
alwaysStat?: boolean;
}
interface ReaddirpStream extends Readable, AsyncIterable<EntryInfo> {
read(): EntryInfo;
[Symbol.asyncIterator](): AsyncIterableIterator<EntryInfo>;
}
function promise(
root: string,
options?: ReaddirpOptions
): Promise<EntryInfo[]>;
}
declare function readdir(
root: string,
options?: readdir.ReaddirpOptions
): readdir.ReaddirpStream;
export = readdir;
@@ -0,0 +1,84 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var callBound = require('call-bound');
var inspect = require('object-inspect');
var getSideChannelMap = require('side-channel-map');
var $TypeError = require('es-errors/type');
var $WeakMap = GetIntrinsic('%WeakMap%', true);
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */
var $weakMapGet = callBound('WeakMap.prototype.get', true);
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */
var $weakMapSet = callBound('WeakMap.prototype.set', true);
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
var $weakMapHas = callBound('WeakMap.prototype.has', true);
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
var $weakMapDelete = callBound('WeakMap.prototype.delete', true);
/** @type {import('.')} */
module.exports = $WeakMap
? /** @type {Exclude<import('.'), false>} */ function getSideChannelWeakMap() {
/** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */
/** @typedef {Parameters<Channel['get']>[0]} K */
/** @typedef {Parameters<Channel['set']>[1]} V */
/** @type {WeakMap<K & object, V> | undefined} */ var $wm;
/** @type {Channel | undefined} */ var $m;
/** @type {Channel} */
var channel = {
assert: function (key) {
if (!channel.has(key)) {
throw new $TypeError('Side channel does not contain ' + inspect(key));
}
},
'delete': function (key) {
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
if ($wm) {
return $weakMapDelete($wm, key);
}
} else if (getSideChannelMap) {
if ($m) {
return $m['delete'](key);
}
}
return false;
},
get: function (key) {
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
if ($wm) {
return $weakMapGet($wm, key);
}
}
return $m && $m.get(key);
},
has: function (key) {
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
if ($wm) {
return $weakMapHas($wm, key);
}
}
return !!$m && $m.has(key);
},
set: function (key, value) {
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
if (!$wm) {
$wm = new $WeakMap();
}
$weakMapSet($wm, key, value);
} else if (getSideChannelMap) {
if (!$m) {
$m = getSideChannelMap();
}
// eslint-disable-next-line no-extra-parens
/** @type {NonNullable<typeof $m>} */ ($m).set(key, value);
}
}
};
// @ts-expect-error TODO: figure out why this is erroring
return channel;
}
: getSideChannelMap;
@@ -0,0 +1,14 @@
import baseForOwn from './_baseForOwn.js';
import createBaseEach from './_createBaseEach.js';
/**
* The base implementation of `_.forEach` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
*/
var baseEach = createBaseEach(baseForOwn);
export default baseEach;
@@ -0,0 +1,75 @@
'use strict';
var isGlob = require('is-glob');
var pathPosixDirname = require('path').posix.dirname;
var isWin32 = require('os').platform() === 'win32';
var slash = '/';
var backslash = /\\/g;
var escaped = /\\([!*?|[\](){}])/g;
/**
* @param {string} str
* @param {Object} opts
* @param {boolean} [opts.flipBackslashes=true]
*/
module.exports = function globParent(str, opts) {
var options = Object.assign({ flipBackslashes: true }, opts);
// flip windows path separators
if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
str = str.replace(backslash, slash);
}
// special case for strings ending in enclosure containing path separator
if (isEnclosure(str)) {
str += slash;
}
// preserves full path in case of trailing path separator
str += 'a';
// remove path parts that are globby
do {
str = pathPosixDirname(str);
} while (isGlobby(str));
// remove escape chars and return result
return str.replace(escaped, '$1');
};
function isEnclosure(str) {
var lastChar = str.slice(-1);
var enclosureStart;
switch (lastChar) {
case '}':
enclosureStart = '{';
break;
case ']':
enclosureStart = '[';
break;
default:
return false;
}
var foundIndex = str.indexOf(enclosureStart);
if (foundIndex < 0) {
return false;
}
return str.slice(foundIndex + 1, -1).includes(slash);
}
function isGlobby(str) {
if (/\([^()]+$/.test(str)) {
return true;
}
if (str[0] === '{' || str[0] === '[') {
return true;
}
if (/[^\\][{[]/.test(str)) {
return true;
}
return isGlob(str);
}
@@ -0,0 +1,32 @@
import { hex } from './hex.mjs';
import { hsla } from './hsla.mjs';
import { rgba } from './rgba.mjs';
const color = {
test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),
parse: (v) => {
if (rgba.test(v)) {
return rgba.parse(v);
}
else if (hsla.test(v)) {
return hsla.parse(v);
}
else {
return hex.parse(v);
}
},
transform: (v) => {
return typeof v === "string"
? v
: v.hasOwnProperty("red")
? rgba.transform(v)
: hsla.transform(v);
},
getAnimatableNone: (v) => {
const parsed = color.parse(v);
parsed.alpha = 0;
return color.transform(parsed);
},
};
export { color };
@@ -0,0 +1,39 @@
var baseMerge = require('./_baseMerge'),
createAssigner = require('./_createAssigner');
/**
* This method is like `_.assign` except that it recursively merges own and
* inherited enumerable string keyed properties of source objects into the
* destination object. Source properties that resolve to `undefined` are
* skipped if a destination value exists. Array and plain object properties
* are merged recursively. Other objects and value types are overridden by
* assignment. Source objects are applied from left to right. Subsequent
* sources overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 0.5.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @example
*
* var object = {
* 'a': [{ 'b': 2 }, { 'd': 4 }]
* };
*
* var other = {
* 'a': [{ 'c': 3 }, { 'e': 5 }]
* };
*
* _.merge(object, other);
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
*/
var merge = createAssigner(function(object, source, srcIndex) {
baseMerge(object, source, srcIndex);
});
module.exports = merge;
@@ -0,0 +1,115 @@
'use strict';
var utils = require('../utils.js');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
var _baseRule = utils.createRule({
name: "object-property-newline",
package: "js",
meta: {
type: "layout",
docs: {
description: "Enforce placing object properties on separate lines"
},
schema: [
{
type: "object",
properties: {
allowAllPropertiesOnSameLine: {
type: "boolean",
default: false
},
allowMultiplePropertiesPerLine: {
// Deprecated
type: "boolean",
default: false
}
},
additionalProperties: false
}
],
fixable: "whitespace",
messages: {
propertiesOnNewlineAll: "Object properties must go on a new line if they aren't all on the same line.",
propertiesOnNewline: "Object properties must go on a new line."
}
},
create(context) {
const allowSameLine = context.options[0] && (context.options[0].allowAllPropertiesOnSameLine || context.options[0].allowMultiplePropertiesPerLine);
const messageId = allowSameLine ? "propertiesOnNewlineAll" : "propertiesOnNewline";
const sourceCode = context.sourceCode;
return {
ObjectExpression(node) {
if (allowSameLine) {
if (node.properties.length > 1) {
const firstTokenOfFirstProperty = sourceCode.getFirstToken(node.properties[0]);
const lastTokenOfLastProperty = sourceCode.getLastToken(node.properties[node.properties.length - 1]);
if (firstTokenOfFirstProperty.loc.end.line === lastTokenOfLastProperty.loc.start.line) {
return;
}
}
}
for (let i = 1; i < node.properties.length; i++) {
const lastTokenOfPreviousProperty = sourceCode.getLastToken(node.properties[i - 1]);
const firstTokenOfCurrentProperty = sourceCode.getFirstToken(node.properties[i]);
if (lastTokenOfPreviousProperty.loc.end.line === firstTokenOfCurrentProperty.loc.start.line) {
context.report({
node,
loc: firstTokenOfCurrentProperty.loc,
messageId,
fix(fixer) {
const comma = sourceCode.getTokenBefore(firstTokenOfCurrentProperty);
const rangeAfterComma = [comma.range[1], firstTokenOfCurrentProperty.range[0]];
if (sourceCode.text.slice(rangeAfterComma[0], rangeAfterComma[1]).trim())
return null;
return fixer.replaceTextRange(rangeAfterComma, "\n");
}
});
}
}
}
};
}
});
const baseRule = /* @__PURE__ */ utils.castRuleModule(_baseRule);
var objectPropertyNewline = utils.createRule({
name: "object-property-newline",
package: "ts",
meta: {
...baseRule.meta,
docs: {
description: "Enforce placing object properties on separate lines"
}
},
defaultOptions: [
{
allowAllPropertiesOnSameLine: false,
allowMultiplePropertiesPerLine: false
}
],
create(context) {
const rules = baseRule.create(context);
return {
...rules,
TSTypeLiteral(node) {
return rules.ObjectExpression({
...node,
// @ts-expect-error only used to get token and loc
properties: node.members
});
},
TSInterfaceBody(node) {
return rules.ObjectExpression({
...node,
// @ts-expect-error only used to get token and loc
properties: node.body
});
}
};
}
});
module.exports = objectPropertyNewline;
@@ -0,0 +1,6 @@
module.exports = {
"longPressMessage": `Langt trykk eller trykk Alt + PilNed for \xe5 \xe5pne menyen`
};
//# sourceMappingURL=nb-NO.main.js.map
@@ -0,0 +1 @@
{"name":"p-limit","version":"3.1.0","requiresBuild":false,"files":{"license":{"checkedAt":1794532093291,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"index.js":{"checkedAt":1794532094597,"integrity":"sha512-grQNU/RjlCWXAwVCvjcCpgpypPkLHuM/3qaGeJ5asdjp7mw7MexluEdrhGNEMyx1AtHuboFb5Mo46IG36yz10A==","mode":420,"size":1521},"package.json":{"checkedAt":1794532094597,"integrity":"sha512-TkeOSu4VQ1JqAxYDixCg46Re3kWWxWwO1lE2evHopQWeZaDjcQauxtMqhycxfBOE5j41YDOHVoe3LokFJPQuZg==","mode":420,"size":928},"readme.md":{"checkedAt":1794532094597,"integrity":"sha512-ySNHxpk4UvAYy3wTd9o7uAiO5F94356guIaOI9eqjtS7FJVdFbWSCXfrSD4M/xwUaKTvEXjM+kCygDydAyccig==","mode":420,"size":2770},"index.d.ts":{"checkedAt":1794532094597,"integrity":"sha512-GiMp1tXEKyfYlRgbqJ+ozQ9JkUu4kNSNNF/+6uRXDNV2lXs/VxysaLc8HUZc1KAIc7PhpRxmfsm9pWgpLoToWw==","mode":420,"size":1418}}}
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA+BA;;;;;GAKG;AACH,qCAHW,MAAM,YACN,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,UAuV9C;6BAxXyB,aAAa"}
@@ -0,0 +1 @@
exports._default = require("./react-textarea-autosize.browser.development.cjs.js").default;
@@ -0,0 +1,73 @@
# which-boxed-primitive <sup>[![Version Badge][2]][1]</sup>
[![dependency status][5]][6]
[![dev dependency status][7]][8]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][11]][1]
Which kind of boxed JS primitive is this? This module works cross-realm/iframe, does not depend on `instanceof` or mutable properties, and works despite ES6 Symbol.toStringTag.
## Example
```js
var whichBoxedPrimitive = require('which-boxed-primitive');
var assert = require('assert');
// unboxed primitives return `null`
// boxed primitives return the builtin constructor name
assert.equal(whichBoxedPrimitive(undefined), null);
assert.equal(whichBoxedPrimitive(null), null);
assert.equal(whichBoxedPrimitive(false), null);
assert.equal(whichBoxedPrimitive(true), null);
assert.equal(whichBoxedPrimitive(new Boolean(false)), 'Boolean');
assert.equal(whichBoxedPrimitive(new Boolean(true)), 'Boolean');
assert.equal(whichBoxedPrimitive(42), null);
assert.equal(whichBoxedPrimitive(NaN), null);
assert.equal(whichBoxedPrimitive(Infinity), null);
assert.equal(whichBoxedPrimitive(new Number(42)), 'Number');
assert.equal(whichBoxedPrimitive(new Number(NaN)), 'Number');
assert.equal(whichBoxedPrimitive(new Number(Infinity)), 'Number');
assert.equal(whichBoxedPrimitive(''), null);
assert.equal(whichBoxedPrimitive('foo'), null);
assert.equal(whichBoxedPrimitive(new String('')), 'String');
assert.equal(whichBoxedPrimitive(new String('foo')), 'String');
assert.equal(whichBoxedPrimitive(Symbol()), null);
assert.equal(whichBoxedPrimitive(Object(Symbol()), 'Symbol');
assert.equal(whichBoxedPrimitive(42n), null);
assert.equal(whichBoxedPrimitive(Object(42n), 'BigInt');
// non-boxed-primitive objects return `undefined`
assert.equal(whichBoxedPrimitive([]), undefined);
assert.equal(whichBoxedPrimitive({}), undefined);
assert.equal(whichBoxedPrimitive(/a/g), undefined);
assert.equal(whichBoxedPrimitive(new RegExp('a', 'g')), undefined);
assert.equal(whichBoxedPrimitive(new Date()), undefined);
assert.equal(whichBoxedPrimitive(function () {}), undefined);
assert.equal(whichBoxedPrimitive(function* () {}), undefined);
assert.equal(whichBoxedPrimitive(x => x * x), undefined);
assert.equal(whichBoxedPrimitive([]), undefined);
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[1]: https://npmjs.org/package/which-boxed-primitive
[2]: https://versionbadg.es/inspect-js/which-boxed-primitive.svg
[5]: https://david-dm.org/inspect-js/which-boxed-primitive.svg
[6]: https://david-dm.org/inspect-js/which-boxed-primitive
[7]: https://david-dm.org/inspect-js/which-boxed-primitive/dev-status.svg
[8]: https://david-dm.org/inspect-js/which-boxed-primitive#info=devDependencies
[11]: https://nodei.co/npm/which-boxed-primitive.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/which-boxed-primitive.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/which-boxed-primitive.svg
[downloads-url]: https://npm-stat.com/charts.html?package=which-boxed-primitive
@@ -0,0 +1,139 @@
# proxy-addr
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Node.js Version][node-image]][node-url]
[![Build Status][ci-image]][ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]
Determine address of proxied request
## Install
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```sh
$ npm install proxy-addr
```
## API
```js
var proxyaddr = require('proxy-addr')
```
### proxyaddr(req, trust)
Return the address of the request, using the given `trust` parameter.
The `trust` argument is a function that returns `true` if you trust
the address, `false` if you don't. The closest untrusted address is
returned.
```js
proxyaddr(req, function (addr) { return addr === '127.0.0.1' })
proxyaddr(req, function (addr, i) { return i < 1 })
```
The `trust` arugment may also be a single IP address string or an
array of trusted addresses, as plain IP addresses, CIDR-formatted
strings, or IP/netmask strings.
```js
proxyaddr(req, '127.0.0.1')
proxyaddr(req, ['127.0.0.0/8', '10.0.0.0/8'])
proxyaddr(req, ['127.0.0.0/255.0.0.0', '192.168.0.0/255.255.0.0'])
```
This module also supports IPv6. Your IPv6 addresses will be normalized
automatically (i.e. `fe80::00ed:1` equals `fe80:0:0:0:0:0:ed:1`).
```js
proxyaddr(req, '::1')
proxyaddr(req, ['::1/128', 'fe80::/10'])
```
This module will automatically work with IPv4-mapped IPv6 addresses
as well to support node.js in IPv6-only mode. This means that you do
not have to specify both `::ffff:a00:1` and `10.0.0.1`.
As a convenience, this module also takes certain pre-defined names
in addition to IP addresses, which expand into IP addresses:
```js
proxyaddr(req, 'loopback')
proxyaddr(req, ['loopback', 'fc00:ac:1ab5:fff::1/64'])
```
* `loopback`: IPv4 and IPv6 loopback addresses (like `::1` and
`127.0.0.1`).
* `linklocal`: IPv4 and IPv6 link-local addresses (like
`fe80::1:1:1:1` and `169.254.0.1`).
* `uniquelocal`: IPv4 private addresses and IPv6 unique-local
addresses (like `fc00:ac:1ab5:fff::1` and `192.168.0.1`).
When `trust` is specified as a function, it will be called for each
address to determine if it is a trusted address. The function is
given two arguments: `addr` and `i`, where `addr` is a string of
the address to check and `i` is a number that represents the distance
from the socket address.
### proxyaddr.all(req, [trust])
Return all the addresses of the request, optionally stopping at the
first untrusted. This array is ordered from closest to furthest
(i.e. `arr[0] === req.connection.remoteAddress`).
```js
proxyaddr.all(req)
```
The optional `trust` argument takes the same arguments as `trust`
does in `proxyaddr(req, trust)`.
```js
proxyaddr.all(req, 'loopback')
```
### proxyaddr.compile(val)
Compiles argument `val` into a `trust` function. This function takes
the same arguments as `trust` does in `proxyaddr(req, trust)` and
returns a function suitable for `proxyaddr(req, trust)`.
```js
var trust = proxyaddr.compile('loopback')
var addr = proxyaddr(req, trust)
```
This function is meant to be optimized for use against every request.
It is recommend to compile a trust function up-front for the trusted
configuration and pass that to `proxyaddr(req, trust)` for each request.
## Testing
```sh
$ npm test
```
## Benchmarks
```sh
$ npm run-script bench
```
## License
[MIT](LICENSE)
[ci-image]: https://badgen.net/github/checks/jshttp/proxy-addr/master?label=ci
[ci-url]: https://github.com/jshttp/proxy-addr/actions?query=workflow%3Aci
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/proxy-addr/master
[coveralls-url]: https://coveralls.io/r/jshttp/proxy-addr?branch=master
[node-image]: https://badgen.net/npm/node/proxy-addr
[node-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/proxy-addr
[npm-url]: https://npmjs.org/package/proxy-addr
[npm-version-image]: https://badgen.net/npm/v/proxy-addr
@@ -0,0 +1,169 @@
/**
* @fileoverview Rule to disallow unnecessary labels
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow unnecessary labels",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/no-extra-label",
},
schema: [],
fixable: "code",
messages: {
unexpected: "This label '{{name}}' is unnecessary.",
},
},
create(context) {
const sourceCode = context.sourceCode;
let scopeInfo = null;
/**
* Creates a new scope with a breakable statement.
* @param {ASTNode} node A node to create. This is a BreakableStatement.
* @returns {void}
*/
function enterBreakableStatement(node) {
scopeInfo = {
label:
node.parent.type === "LabeledStatement"
? node.parent.label
: null,
breakable: true,
upper: scopeInfo,
};
}
/**
* Removes the top scope of the stack.
* @returns {void}
*/
function exitBreakableStatement() {
scopeInfo = scopeInfo.upper;
}
/**
* Creates a new scope with a labeled statement.
*
* This ignores it if the body is a breakable statement.
* In this case it's handled in the `enterBreakableStatement` function.
* @param {ASTNode} node A node to create. This is a LabeledStatement.
* @returns {void}
*/
function enterLabeledStatement(node) {
if (!astUtils.isBreakableStatement(node.body)) {
scopeInfo = {
label: node.label,
breakable: false,
upper: scopeInfo,
};
}
}
/**
* Removes the top scope of the stack.
*
* This ignores it if the body is a breakable statement.
* In this case it's handled in the `exitBreakableStatement` function.
* @param {ASTNode} node A node. This is a LabeledStatement.
* @returns {void}
*/
function exitLabeledStatement(node) {
if (!astUtils.isBreakableStatement(node.body)) {
scopeInfo = scopeInfo.upper;
}
}
/**
* Reports a given control node if it's unnecessary.
* @param {ASTNode} node A node. This is a BreakStatement or a
* ContinueStatement.
* @returns {void}
*/
function reportIfUnnecessary(node) {
if (!node.label) {
return;
}
const labelNode = node.label;
for (let info = scopeInfo; info !== null; info = info.upper) {
if (
info.breakable ||
(info.label && info.label.name === labelNode.name)
) {
if (
info.breakable &&
info.label &&
info.label.name === labelNode.name
) {
context.report({
node: labelNode,
messageId: "unexpected",
data: labelNode,
fix(fixer) {
const breakOrContinueToken =
sourceCode.getFirstToken(node);
if (
sourceCode.commentsExistBetween(
breakOrContinueToken,
labelNode,
)
) {
return null;
}
return fixer.removeRange([
breakOrContinueToken.range[1],
labelNode.range[1],
]);
},
});
}
return;
}
}
}
return {
WhileStatement: enterBreakableStatement,
"WhileStatement:exit": exitBreakableStatement,
DoWhileStatement: enterBreakableStatement,
"DoWhileStatement:exit": exitBreakableStatement,
ForStatement: enterBreakableStatement,
"ForStatement:exit": exitBreakableStatement,
ForInStatement: enterBreakableStatement,
"ForInStatement:exit": exitBreakableStatement,
ForOfStatement: enterBreakableStatement,
"ForOfStatement:exit": exitBreakableStatement,
SwitchStatement: enterBreakableStatement,
"SwitchStatement:exit": exitBreakableStatement,
LabeledStatement: enterLabeledStatement,
"LabeledStatement:exit": exitLabeledStatement,
BreakStatement: reportIfUnnecessary,
ContinueStatement: reportIfUnnecessary,
};
},
};
@@ -0,0 +1,41 @@
'use strict'
const { describe, it } = require('mocha')
const assert = require('assert')
const gyp = require('../lib/node-gyp')
describe('options', function () {
it('options in environment', () => {
// `npm test` dumps a ton of npm_config_* variables in the environment.
Object.keys(process.env)
.filter((key) => /^npm_config_/.test(key))
.forEach((key) => { delete process.env[key] })
// in some platforms, certain keys are stubborn and cannot be removed
const keys = Object.keys(process.env)
.filter((key) => /^npm_config_/.test(key))
.map((key) => key.substring('npm_config_'.length))
.concat('argv', 'x')
// Zero-length keys should get filtered out.
process.env.npm_config_ = '42'
// Other keys should get added.
process.env.npm_config_x = '42'
// Except loglevel.
process.env.npm_config_loglevel = 'debug'
const g = gyp()
g.parseArgv(['rebuild']) // Also sets opts.argv.
assert.deepStrictEqual(Object.keys(g.opts).sort(), keys.sort())
})
it('options with spaces in environment', () => {
process.env.npm_config_force_process_config = 'true'
const g = gyp()
g.parseArgv(['rebuild']) // Also sets opts.argv.
assert.strictEqual(g.opts['force-process-config'], 'true')
})
})
@@ -0,0 +1,43 @@
/* eslint no-restricted-syntax: 0, no-with: 0, strict: 0 */
var test = require('tape');
var shimUnscopables = require('../');
test('`with` statement', { skip: typeof Symbol !== 'function' || !Symbol.unscopables }, function (t) {
// @ts-expect-error this variable is declared in case unscopables doesn't work
var entries;
// @ts-expect-error this variable is declared in case unscopables doesn't work
var concat;
// @ts-expect-error `with` unsupported
with ([]) {
t.equal(concat, Array.prototype.concat, 'concat is dynamically bound');
t.notEqual(entries, Array.prototype.entries, 'entries is not dynamically bound');
}
/** @type {Record<PropertyKey, unknown>} */
var obj = {
foo: 1,
bar: 2
};
// @ts-expect-error this variable is declared in case unscopables doesn't work
var foo;
// @ts-expect-error this variable is declared in case unscopables doesn't work
var bar;
obj[Symbol.unscopables] = { foo: true };
// @ts-expect-error `with` unsupported
with (obj) {
t.equal(foo, undefined);
t.equal(bar, obj.bar);
}
shimUnscopables('concat');
// @ts-expect-error `with` unsupported
with ([]) {
t.notEqual(concat, Array.prototype.concat, 'concat is no longer dynamically bound');
t.notEqual(entries, Array.prototype.entries, 'entries is still not dynamically bound');
}
t.end();
});
@@ -0,0 +1,42 @@
import baseIndexOf from './_baseIndexOf.js';
import toInteger from './toInteger.js';
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Gets the index at which the first occurrence of `value` is found in `array`
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. If `fromIndex` is negative, it's used as the
* offset from the end of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.indexOf([1, 2, 1, 2], 2);
* // => 1
*
* // Search from the `fromIndex`.
* _.indexOf([1, 2, 1, 2], 2, 2);
* // => 3
*/
function indexOf(array, value, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseIndexOf(array, value, index);
}
export default indexOf;
@@ -0,0 +1,20 @@
'use strict';
var result = require('./')();
var test = {
__proto__: null,
foo: {}
};
/** @type {import('./accessor')} */
module.exports = function hasAccessor() {
/* eslint no-proto: 0 */
return result
&& !('toString' in test)
// eslint-disable-next-line no-extra-parens
&& /** @type {{ __proto__?: typeof Object.prototype }} */ ({}).__proto__ === Object.prototype
// eslint-disable-next-line no-extra-parens
&& /** @type {ReadonlyArray<never> & { __proto__?: typeof Array.prototype }} */ (
[]).__proto__ === Array.prototype;
};
@@ -0,0 +1 @@
{"version":3,"file":"forward-ref-uses-ref.d.ts","sourceRoot":"","sources":["forward-ref-uses-ref.js"],"names":[],"mappings":"wBA2CW,OAAO,QAAQ,EAAE,IAAI,CAAC,UAAU"}
@@ -0,0 +1,21 @@
import {useButton as $701a24aa0da5b062$export$ea18c227d4417cc3} from "./useButton.mjs";
import {useToggleButton as $55f54f7887471b58$export$51e84d46ca0bc451} from "./useToggleButton.mjs";
import {useToggleButtonGroup as $4547d1bf40011fdf$export$dd5580ae642f110f, useToggleButtonGroupItem as $4547d1bf40011fdf$export$bc53712daae3d6e6} from "./useToggleButtonGroup.mjs";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
export {$701a24aa0da5b062$export$ea18c227d4417cc3 as useButton, $55f54f7887471b58$export$51e84d46ca0bc451 as useToggleButton, $4547d1bf40011fdf$export$dd5580ae642f110f as useToggleButtonGroup, $4547d1bf40011fdf$export$bc53712daae3d6e6 as useToggleButtonGroupItem};
//# sourceMappingURL=module.js.map
@@ -0,0 +1,8 @@
"use client";
import {
tooltip_default
} from "./chunk-6LIX6LVT.mjs";
import "./chunk-JXI6O2DW.mjs";
export {
tooltip_default as default
};
@@ -0,0 +1,56 @@
{
"name": "ansi-styles",
"version": "4.3.0",
"description": "ANSI escape codes for styling strings in the terminal",
"license": "MIT",
"repository": "chalk/ansi-styles",
"funding": "https://github.com/chalk/ansi-styles?sponsor=1",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd",
"screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"cli",
"string",
"tty",
"escape",
"formatting",
"rgb",
"256",
"shell",
"xterm",
"log",
"logging",
"command-line",
"text"
],
"dependencies": {
"color-convert": "^2.0.1"
},
"devDependencies": {
"@types/color-convert": "^1.9.0",
"ava": "^2.3.0",
"svg-term-cli": "^2.1.1",
"tsd": "^0.11.0",
"xo": "^0.25.3"
}
}
@@ -0,0 +1,35 @@
'use strict';
var callBound = require('call-bound');
var $TypeError = require('es-errors/type');
var isInteger = require('math-intrinsics/isInteger');
var $charAt = callBound('String.prototype.charAt');
// https://262.ecma-international.org/6.0/#sec-splitmatch
module.exports = function SplitMatch(S, q, R) {
if (typeof S !== 'string') {
throw new $TypeError('Assertion failed: `S` must be a String');
}
if (!isInteger(q)) {
throw new $TypeError('Assertion failed: `q` must be an integer');
}
if (typeof R !== 'string') {
throw new $TypeError('Assertion failed: `R` must be a String');
}
var r = R.length;
var s = S.length;
if (q + r > s) {
return false;
}
for (var i = 0; i < r; i += 1) {
if ($charAt(S, q + i) !== $charAt(R, i)) {
return false;
}
}
return q + r;
};
@@ -0,0 +1,139 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.deepmerge = factory());
}(this, function () { 'use strict';
var isMergeableObject = function isMergeableObject(value) {
return isNonNullObject(value)
&& !isSpecial(value)
};
function isNonNullObject(value) {
return !!value && typeof value === 'object'
}
function isSpecial(value) {
var stringValue = Object.prototype.toString.call(value);
return stringValue === '[object RegExp]'
|| stringValue === '[object Date]'
|| isReactElement(value)
}
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
function isReactElement(value) {
return value.$$typeof === REACT_ELEMENT_TYPE
}
function emptyTarget(val) {
return Array.isArray(val) ? [] : {}
}
function cloneUnlessOtherwiseSpecified(value, options) {
return (options.clone !== false && options.isMergeableObject(value))
? deepmerge(emptyTarget(value), value, options)
: value
}
function defaultArrayMerge(target, source, options) {
return target.concat(source).map(function(element) {
return cloneUnlessOtherwiseSpecified(element, options)
})
}
function getMergeFunction(key, options) {
if (!options.customMerge) {
return deepmerge
}
var customMerge = options.customMerge(key);
return typeof customMerge === 'function' ? customMerge : deepmerge
}
function getEnumerableOwnPropertySymbols(target) {
return Object.getOwnPropertySymbols
? Object.getOwnPropertySymbols(target).filter(function(symbol) {
return Object.propertyIsEnumerable.call(target, symbol)
})
: []
}
function getKeys(target) {
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
}
function propertyIsOnObject(object, property) {
try {
return property in object
} catch(_) {
return false
}
}
// Protects from prototype poisoning and unexpected merging up the prototype chain.
function propertyIsUnsafe(target, key) {
return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
}
function mergeObject(target, source, options) {
var destination = {};
if (options.isMergeableObject(target)) {
getKeys(target).forEach(function(key) {
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
});
}
getKeys(source).forEach(function(key) {
if (propertyIsUnsafe(target, key)) {
return
}
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
} else {
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
}
});
return destination
}
function deepmerge(target, source, options) {
options = options || {};
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
// implementations can use it. The caller may not replace it.
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
var sourceIsArray = Array.isArray(source);
var targetIsArray = Array.isArray(target);
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
if (!sourceAndTargetTypesMatch) {
return cloneUnlessOtherwiseSpecified(source, options)
} else if (sourceIsArray) {
return options.arrayMerge(target, source, options)
} else {
return mergeObject(target, source, options)
}
}
deepmerge.all = function deepmergeAll(array, options) {
if (!Array.isArray(array)) {
throw new Error('first argument should be an array')
}
return array.reduce(function(prev, next) {
return deepmerge(prev, next, options)
}, {})
};
var deepmerge_1 = deepmerge;
return deepmerge_1;
}));
@@ -0,0 +1,149 @@
/**
* @fileoverview Define common types for input completion.
* @author Toru Nagashima <https://github.com/mysticatea>
*/
/** @type {any} */
export default {};
/** @typedef {boolean | "off" | "readable" | "readonly" | "writable" | "writeable"} GlobalConf */
/** @typedef {0 | 1 | 2 | "off" | "warn" | "error"} SeverityConf */
/** @typedef {SeverityConf | [SeverityConf, ...any[]]} RuleConf */
/**
* @typedef {Object} EcmaFeatures
* @property {boolean} [globalReturn] Enabling `return` statements at the top-level.
* @property {boolean} [jsx] Enabling JSX syntax.
* @property {boolean} [impliedStrict] Enabling strict mode always.
*/
/**
* @typedef {Object} ParserOptions
* @property {EcmaFeatures} [ecmaFeatures] The optional features.
* @property {3|5|6|7|8|9|10|11|12|2015|2016|2017|2018|2019|2020|2021} [ecmaVersion] The ECMAScript version (or revision number).
* @property {"script"|"module"} [sourceType] The source code type.
*/
/**
* @typedef {Object} ConfigData
* @property {Record<string, boolean>} [env] The environment settings.
* @property {string | string[]} [extends] The path to other config files or the package name of shareable configs.
* @property {Record<string, GlobalConf>} [globals] The global variable settings.
* @property {string | string[]} [ignorePatterns] The glob patterns that ignore to lint.
* @property {boolean} [noInlineConfig] The flag that disables directive comments.
* @property {OverrideConfigData[]} [overrides] The override settings per kind of files.
* @property {string} [parser] The path to a parser or the package name of a parser.
* @property {ParserOptions} [parserOptions] The parser options.
* @property {string[]} [plugins] The plugin specifiers.
* @property {string} [processor] The processor specifier.
* @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments.
* @property {boolean} [root] The root flag.
* @property {Record<string, RuleConf>} [rules] The rule settings.
* @property {Object} [settings] The shared settings.
*/
/**
* @typedef {Object} OverrideConfigData
* @property {Record<string, boolean>} [env] The environment settings.
* @property {string | string[]} [excludedFiles] The glob pattarns for excluded files.
* @property {string | string[]} [extends] The path to other config files or the package name of shareable configs.
* @property {string | string[]} files The glob patterns for target files.
* @property {Record<string, GlobalConf>} [globals] The global variable settings.
* @property {boolean} [noInlineConfig] The flag that disables directive comments.
* @property {OverrideConfigData[]} [overrides] The override settings per kind of files.
* @property {string} [parser] The path to a parser or the package name of a parser.
* @property {ParserOptions} [parserOptions] The parser options.
* @property {string[]} [plugins] The plugin specifiers.
* @property {string} [processor] The processor specifier.
* @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments.
* @property {Record<string, RuleConf>} [rules] The rule settings.
* @property {Object} [settings] The shared settings.
*/
/**
* @typedef {Object} ParseResult
* @property {Object} ast The AST.
* @property {ScopeManager} [scopeManager] The scope manager of the AST.
* @property {Record<string, any>} [services] The services that the parser provides.
* @property {Record<string, string[]>} [visitorKeys] The visitor keys of the AST.
*/
/**
* @typedef {Object} Parser
* @property {(text:string, options:ParserOptions) => Object} parse The definition of global variables.
* @property {(text:string, options:ParserOptions) => ParseResult} [parseForESLint] The parser options that will be enabled under this environment.
*/
/**
* @typedef {Object} Environment
* @property {Record<string, GlobalConf>} [globals] The definition of global variables.
* @property {ParserOptions} [parserOptions] The parser options that will be enabled under this environment.
*/
/**
* @typedef {Object} LintMessage
* @property {number} column The 1-based column number.
* @property {number} [endColumn] The 1-based column number of the end location.
* @property {number} [endLine] The 1-based line number of the end location.
* @property {boolean} fatal If `true` then this is a fatal error.
* @property {{range:[number,number], text:string}} [fix] Information for autofix.
* @property {number} line The 1-based line number.
* @property {string} message The error message.
* @property {string|null} ruleId The ID of the rule which makes this message.
* @property {0|1|2} severity The severity of this message.
* @property {Array<{desc?: string, messageId?: string, fix: {range: [number, number], text: string}}>} [suggestions] Information for suggestions.
*/
/**
* @typedef {Object} SuggestionResult
* @property {string} desc A short description.
* @property {string} [messageId] Id referencing a message for the description.
* @property {{ text: string, range: number[] }} fix fix result info
*/
/**
* @typedef {Object} Processor
* @property {(text:string, filename:string) => Array<string | { text:string, filename:string }>} [preprocess] The function to extract code blocks.
* @property {(messagesList:LintMessage[][], filename:string) => LintMessage[]} [postprocess] The function to merge messages.
* @property {boolean} [supportsAutofix] If `true` then it means the processor supports autofix.
*/
/**
* @typedef {Object} RuleMetaDocs
* @property {string} category The category of the rule.
* @property {string} description The description of the rule.
* @property {boolean} recommended If `true` then the rule is included in `eslint:recommended` preset.
* @property {string} url The URL of the rule documentation.
*/
/**
* @typedef {Object} RuleMeta
* @property {boolean} [deprecated] If `true` then the rule has been deprecated.
* @property {RuleMetaDocs} docs The document information of the rule.
* @property {"code"|"whitespace"} [fixable] The autofix type.
* @property {Record<string,string>} [messages] The messages the rule reports.
* @property {string[]} [replacedBy] The IDs of the alternative rules.
* @property {Array|Object} schema The option schema of the rule.
* @property {"problem"|"suggestion"|"layout"} type The rule type.
*/
/**
* @typedef {Object} Rule
* @property {Function} create The factory of the rule.
* @property {RuleMeta} meta The meta data of the rule.
*/
/**
* @typedef {Object} Plugin
* @property {Record<string, ConfigData>} [configs] The definition of plugin configs.
* @property {Record<string, Environment>} [environments] The definition of plugin environments.
* @property {Record<string, Processor>} [processors] The definition of plugin processors.
* @property {Record<string, Function | Rule>} [rules] The definition of plugin rules.
*/
/**
* Information of deprecated rules.
* @typedef {Object} DeprecatedRuleInfo
* @property {string} ruleId The rule ID.
* @property {string[]} replacedBy The rule IDs that replace this deprecated rule.
*/
@@ -0,0 +1,143 @@
flf2a$ 1 1 9 0 40 0 8256 0
#
# benjamin.flf // Version 02 // 2001-06-04
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# This font is based on article <5m7lhtg5vj1esom25btrdugng0mseqisqv@4ax.com>
# from the newsgroup de.alt.rec.ascii-art and its follow-ups.
#
# The most current version of this font should be available here:
# http://www.cgarbs.de/stuff/benjamin.flf.gz
#
#-[WhoIsWho]------------------------------------------------------------------
#
# Font creators:
# >> Benjamin Weiland <benjamin.weiland@uloc.de>
# >> Markus Gebhard <ukgh@rz.uni-karlsruhe.de>
# >> Christian Garbs <mitch@cgarbs.de>
#
# .flf file maintainer:
# Christian Garbs <mitch@cgarbs.de>
#
#-[History]-------------------------------------------------------------------
#
# 2001-06-04::Version 02
# * added the comments you're reading now
# * changed download location to www.cgarbs.de
# * added 0-9, &, German umlauts + ess-zed
# * changed X
#
# 2001-06-03::Version 01
# * available characters: A-Z, a-z, @, *
#
#-[Commercial]----------------------------------------------------------------
#
# _ __,"\\ _. _ de.alt.rec.ascii-art
# /\\ /\\ _.--/ `. ,' ( "_//" __| |__ _ _ _ __ _ ___ __ _
# ,''\," ,""\,"=='( \.'\\_,( _`-'=-' / _` / _` | '_/ _` |___/ _` |
# ' u-u `=' u-u |l''|l `" |m' |m -bf- \__,_\__,_|_| \__,_| \__,_|
#
#-[TheEnd]--------------------------------------------------------------------
#
$@@
!@@
"@@
#@@
S@@
%@@
&@@
'@@
(@@
)@@
x@@
+@@
,@@
-@@
.@@
/@@
(\)@@
'|@@
^/_@@
-}@@
+|@@
;"@@
(o@@
"/@@
{}@@
")@@
:@@
;@@
<@@
=@@
>@@
?@@
(a)@@
/-\@@
|3@@
(@@
|)@@
[-@@
|=@@
[,@@
|-|@@
|@@
.]@@
|<@@
|_@@
|\/|@@
|\|@@
()@@
|'@@
()_@@
|2@@
_\"@@
"|"@@
|_|@@
\/@@
\/\/@@
><@@
`/@@
"/_@@
[@@
\@@
]@@
^@@
_@@
`@@
/-\@@
|3@@
(@@
|)@@
[-@@
|=@@
[,@@
|-|@@
|@@
.]@@
|<@@
|_@@
|\/|@@
|\|@@
()@@
|'@@
()_@@
|2@@
_\"@@
"|"@@
|_|@@
\/@@
\/\/@@
`/.@@
`/@@
"/_@@
{@@
|@@
}@@
~@@
'/-\'@@
'()'@@
'|_|'@@
'/-\'@@
'()'@@
i_i@@
/3@@
@@ -0,0 +1,41 @@
"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/colors/green.ts
var green_exports = {};
__export(green_exports, {
green: () => green
});
module.exports = __toCommonJS(green_exports);
var green = {
50: "#e8faf0",
100: "#d1f4e0",
200: "#a2e9c1",
300: "#74dfa2",
400: "#45d483",
500: "#17c964",
600: "#12a150",
700: "#0e793c",
800: "#095028",
900: "#052814"
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
green
});
@@ -0,0 +1,133 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
test("array min", async () => {
try {
await z.array(z.string()).min(4).parseAsync([]);
} catch (err) {
expect((err as z.ZodError).issues[0].message).toEqual("Array must contain at least 4 element(s)");
}
});
test("array max", async () => {
try {
await z.array(z.string()).max(2).parseAsync(["asdf", "asdf", "asdf"]);
} catch (err) {
expect((err as z.ZodError).issues[0].message).toEqual("Array must contain at most 2 element(s)");
}
});
test("array length", async () => {
try {
await z.array(z.string()).length(2).parseAsync(["asdf", "asdf", "asdf"]);
} catch (err) {
expect((err as z.ZodError).issues[0].message).toEqual("Array must contain exactly 2 element(s)");
}
try {
await z.array(z.string()).length(2).parseAsync(["asdf"]);
} catch (err) {
expect((err as z.ZodError).issues[0].message).toEqual("Array must contain exactly 2 element(s)");
}
});
test("string length", async () => {
try {
await z.string().length(4).parseAsync("asd");
} catch (err) {
expect((err as z.ZodError).issues[0].message).toEqual("String must contain exactly 4 character(s)");
}
try {
await z.string().length(4).parseAsync("asdaa");
} catch (err) {
expect((err as z.ZodError).issues[0].message).toEqual("String must contain exactly 4 character(s)");
}
});
test("string min", async () => {
try {
await z.string().min(4).parseAsync("asd");
} catch (err) {
expect((err as z.ZodError).issues[0].message).toEqual("String must contain at least 4 character(s)");
}
});
test("string max", async () => {
try {
await z.string().max(4).parseAsync("aasdfsdfsd");
} catch (err) {
expect((err as z.ZodError).issues[0].message).toEqual("String must contain at most 4 character(s)");
}
});
test("number min", async () => {
try {
await z.number().gte(3).parseAsync(2);
} catch (err) {
expect((err as z.ZodError).issues[0].message).toEqual("Number must be greater than or equal to 3");
}
});
test("number max", async () => {
try {
await z.number().lte(3).parseAsync(4);
} catch (err) {
expect((err as z.ZodError).issues[0].message).toEqual("Number must be less than or equal to 3");
}
});
test("number nonnegative", async () => {
try {
await z.number().nonnegative().parseAsync(-1);
} catch (err) {
expect((err as z.ZodError).issues[0].message).toEqual("Number must be greater than or equal to 0");
}
});
test("number nonpositive", async () => {
try {
await z.number().nonpositive().parseAsync(1);
} catch (err) {
expect((err as z.ZodError).issues[0].message).toEqual("Number must be less than or equal to 0");
}
});
test("number negative", async () => {
try {
await z.number().negative().parseAsync(1);
} catch (err) {
expect((err as z.ZodError).issues[0].message).toEqual("Number must be less than 0");
}
});
test("number positive", async () => {
try {
await z.number().positive().parseAsync(-1);
} catch (err) {
expect((err as z.ZodError).issues[0].message).toEqual("Number must be greater than 0");
}
});
test("instantiation", () => {
z.string().min(5);
z.string().max(5);
z.string().length(5);
z.string().email();
z.string().url();
z.string().uuid();
z.string().min(5, { message: "Must be 5 or more characters long" });
z.string().max(5, { message: "Must be 5 or fewer characters long" });
z.string().length(5, { message: "Must be exactly 5 characters long" });
z.string().email({ message: "Invalid email address." });
z.string().url({ message: "Invalid url" });
z.string().uuid({ message: "Invalid UUID" });
});
test("int", async () => {
const int = z.number().int();
int.parse(4);
expect(() => int.parse(3.5)).toThrow();
});
@@ -0,0 +1,17 @@
/**
* @file mine types
* @author junmer
*/
/* eslint-env node */
module.exports = exports = {
'.*': 'application/octet-stream',
'ttf': 'application/font-sfnt',
'otf': 'application/font-sfnt',
'woff': 'application/font-woff',
'woff2': 'application/font-woff2',
'eot': 'application/octet-stream',
'svg': 'image/svg+xml',
'svgz': 'image/svg+xml'
};
@@ -0,0 +1,53 @@
import { ChatType, Peer } from '../types';
import { NodeIKernelRecentContactListener } from '../listeners/NodeIKernelRecentContactListener';
import { GeneralCallResult } from '../services/common';
import { FSABRecentContactParams } from '../types/contact';
export interface NodeIKernelRecentContactService {
setGuildDisplayStatus(...args: unknown[]): unknown;
setContactListTop(...args: unknown[]): unknown;
updateRecentContactExtBufForUI(...args: unknown[]): unknown;
upsertRecentContactManually(...args: unknown[]): unknown;
enterOrExitMsgList(...args: unknown[]): unknown;
getRecentContactListSnapShot(count: number): Promise<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: ChatType;
msgId: string;
}>;
};
}>;
clearMsgUnreadCount(...args: unknown[]): unknown;
getRecentContactListSyncLimit(count: number): unknown;
jumpToSpecifyRecentContact(...args: unknown[]): unknown;
fetchAndSubscribeABatchOfRecentContact(params: FSABRecentContactParams): unknown;
addRecentContact(peer: Peer): unknown;
deleteRecentContacts(peer: Peer): unknown;
getContacts(peers: Peer[]): Promise<unknown>;
setThirdPartyBusinessInfos(...args: unknown[]): unknown;
updateGameMsgConfigs(...args: unknown[]): unknown;
removeKernelRecentContactListener(listenerid: number): unknown;
addKernelRecentContactListener(listener: NodeIKernelRecentContactListener): void;
clearRecentContactsByChatType(...args: unknown[]): unknown;
upInsertModule(...args: unknown[]): unknown;
jumpToSpecifyRecentContactVer2(...args: unknown[]): unknown;
deleteRecentContactsVer2(...args: unknown[]): unknown;
getRecentContactList(): Promise<unknown>;
getMsgUnreadCount(): unknown;
clearRecentContacts(): unknown;
getServiceAssistantRecentContactInfos(): unknown;
getRecentContactInfos(): unknown;
getUnreadDetailsInfos(): unknown;
cleanAllModule(): unknown;
setAllGameMsgRead(): unknown;
getRecentContactListSync(): unknown;
}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('unescape', require('../unescape'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,7 @@
"use client";
import {
Item
} from "../chunk-3MION23H.mjs";
export {
Item as BaseItem
};
@@ -0,0 +1 @@
{"version":3,"file":"tsconfig-loader.test.js","sourceRoot":"","sources":["../../src/__tests__/tsconfig-loader.test.ts"],"names":[],"mappings":";;AAAA,sDAI4B;AAC5B,6BAA4B;AAE5B,QAAQ,CAAC,iBAAiB,EAAE;IAC1B,EAAE,CAAC,6BAA6B,EAAE;QAChC,IAAM,MAAM,GAAG,IAAA,gCAAc,EAAC;YAC5B,GAAG,EAAE,UAAU;YACf,MAAM,EAAE,UAAC,CAAS,IAAK,OAAA,SAAS,EAAT,CAAS;YAChC,QAAQ,EAAE,UAAC,GAAW;gBACpB,OAAO;oBACL,YAAY,EAAE,UAAG,GAAG,mBAAgB;oBACpC,OAAO,EAAE,IAAI;oBACb,KAAK,EAAE,EAAE;iBACV,CAAC;YACJ,CAAC;SACF,CAAC,CAAC;QAEH,+DAA+D;QAC/D,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qEAAqE,EAAE;QACxE,IAAM,MAAM,GAAG,IAAA,gCAAc,EAAC;YAC5B,GAAG,EAAE,UAAU;YACf,MAAM,EAAE,UAAC,CAAS,IAAK,OAAA,SAAS,EAAT,CAAS;YAChC,QAAQ,EAAE,UAAC,CAAS;gBAClB,OAAO;oBACL,YAAY,EAAE,SAAS;oBACvB,OAAO,EAAE,IAAI;oBACb,KAAK,EAAE,EAAE;iBACV,CAAC;YACJ,CAAC;SACF,CAAC,CAAC;QAEH,2CAA2C;QAC3C,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,aAAa,EAAE,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE;QAC7C,IAAM,MAAM,GAAG,IAAA,gCAAc,EAAC;YAC5B,GAAG,EAAE,UAAU;YACf,MAAM,EAAE,UAAC,GAAW;gBAClB,OAAA,GAAG,KAAK,iBAAiB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;YAAlD,CAAkD;YACpD,QAAQ,EAAE,UAAC,GAAW,EAAE,QAAgB;gBACtC,IAAI,GAAG,KAAK,UAAU,IAAI,QAAQ,KAAK,UAAU,EAAE;oBACjD,OAAO;wBACL,YAAY,EAAE,wBAAwB;wBACtC,OAAO,EAAE,IAAI;wBACb,KAAK,EAAE,EAAE;qBACV,CAAC;iBACH;gBAED,OAAO;oBACL,YAAY,EAAE,SAAS;oBACvB,OAAO,EAAE,IAAI;oBACb,KAAK,EAAE,EAAE;iBACV,CAAC;YACJ,CAAC;SACF,CAAC,CAAC;QAEH,+DAA+D;QAC/D,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE;QAC7C,IAAM,MAAM,GAAG,IAAA,gCAAc,EAAC;YAC5B,GAAG,EAAE,UAAU;YACf,MAAM,EAAE,UAAC,GAAW;gBAClB,OAAA,GAAG,KAAK,iBAAiB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS;YAAtD,CAAsD;YACxD,QAAQ,EAAE,UAAC,EAAU,EAAE,EAAU,EAAE,OAAe;gBAChD,OAAO;oBACL,YAAY,EAAE,SAAS;oBACvB,OAAO,SAAA;oBACP,KAAK,EAAE,EAAE;iBACV,CAAC;YACJ,CAAC;SACF,CAAC,CAAC;QAEH,gDAAgD;QAChD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE;QAC5D,IAAM,MAAM,GAAG,IAAA,gCAAc,EAAC;YAC5B,GAAG,EAAE,UAAU;YACf,MAAM,EAAE,UAAC,CAAS;gBAChB,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,QAAQ,EAAE,UAAC,EAAU,EAAE,EAAU,EAAE,OAAe;gBAChD,OAAO;oBACL,YAAY,EAAE,SAAS;oBACvB,OAAO,SAAA;oBACP,KAAK,EAAE,EAAE;iBACV,CAAC;YACJ,CAAC;SACF,CAAC,CAAC;QAEH,2CAA2C;QAC3C,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,iBAAiB,EAAE;IAC1B,EAAE,CAAC,4CAA4C,EAAE;QAC/C,IAAM,cAAc,GAAG,IAAA,WAAI,EAAC,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QAC9D,IAAM,GAAG,GAAG,IAAA,iCAAe,EACzB,IAAA,WAAI,EAAC,OAAO,EAAE,MAAM,CAAC,EACrB,UAAC,IAAI,IAAK,OAAA,IAAI,KAAK,cAAc,EAAvB,CAAuB,CAClC,CAAC;QACF,qCAAqC;QACrC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE;QAC7C,IAAM,cAAc,GAAG,IAAA,WAAI,EAAC,OAAO,EAAE,eAAe,CAAC,CAAC;QACtD,IAAM,GAAG,GAAG,IAAA,iCAAe,EACzB,IAAA,WAAI,EAAC,OAAO,EAAE,MAAM,CAAC,EACrB,UAAC,IAAI,IAAK,OAAA,IAAI,KAAK,cAAc,EAAvB,CAAuB,CAClC,CAAC;QACF,qCAAqC;QACrC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE;QAClD,IAAM,GAAG,GAAG,IAAA,iCAAe,EAAC,IAAA,WAAI,EAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAM,OAAA,KAAK,EAAL,CAAK,CAAC,CAAC;QACzE,gCAAgC;QAChC,MAAM,CAAC,GAAG,CAAC,CAAC,aAAa,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,YAAY,EAAE;IACrB,EAAE,CAAC,sBAAsB,EAAE;QACzB,IAAM,MAAM,GAAG,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC;QACvD,IAAM,GAAG,GAAG,IAAA,8BAAY,EACtB,0BAA0B,EAC1B,UAAC,IAAI,IAAK,OAAA,IAAI,KAAK,0BAA0B,EAAnC,CAAmC,EAC7C,UAAC,CAAC,IAAK,OAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAtB,CAAsB,CAC9B,CAAC;QACF,iCAAiC;QACjC,MAAM,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE;QACvC,IAAM,MAAM,GAAG,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC;QACvD,IAAM,GAAG,GAAG,IAAA,8BAAY,EACtB,0BAA0B,EAC1B,UAAC,IAAI,IAAK,OAAA,IAAI,KAAK,0BAA0B,EAAnC,CAAmC,EAC7C,UAAC,CAAC,IAAK,OAAA,yHAKH,EALG,CAKH,CACL,CAAC;QACF,iCAAiC;QACjC,MAAM,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE;QAC9C,IAAM,MAAM,GAAG,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC;QACvD,IAAM,GAAG,GAAG,IAAA,8BAAY,EACtB,0BAA0B,EAC1B,UAAC,IAAI,IAAK,OAAA,IAAI,KAAK,0BAA0B,EAAnC,CAAmC,EAC7C,UAAC,CAAC,IAAK,OAAA,kGAIH,EAJG,CAIH,CACL,CAAC;QACF,iCAAiC;QACjC,MAAM,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+EAA+E,EAAE;QAClF,MAAM,CAAC;YACL,OAAA,IAAA,8BAAY,EACV,0BAA0B,EAC1B,UAAC,IAAI,IAAK,OAAA,IAAI,KAAK,0BAA0B,EAAnC,CAAmC,EAC7C,UAAC,CAAC,IAAK,OAAA,oDAEH,EAFG,CAEH,CACL;QAND,CAMC,CACF,CAAC,YAAY,CACZ,2EAA2E,CAC5E,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oEAAoE,EAAE;QACvE,IAAM,WAAW,GAAG;YAClB,OAAO,EAAE,qBAAqB;YAC9B,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE;SAChE,CAAC;QACF,IAAM,eAAe,GAAG,IAAA,WAAI,EAAC,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QAC/D,IAAM,UAAU,GAAG;YACjB,eAAe,EAAE;gBACf,OAAO,EAAE,MAAM;gBACf,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE;gBACxB,MAAM,EAAE,IAAI;aACb;SACF,CAALine truncated
@@ -0,0 +1,11 @@
import { ConstantValueBinding } from './ConstantValueBinding';
import { DynamicValueBinding } from './DynamicValueBinding';
import { Factory } from './Factory';
import { FactoryBinding } from './FactoryBinding';
import { InstanceBinding } from './InstanceBinding';
import { Provider } from './Provider';
import { ProviderBinding } from './ProviderBinding';
import { ResolvedValueBinding } from './ResolvedValueBinding';
import { ServiceRedirectionBinding } from './ServiceRedirectionBinding';
export type Binding<TActivated = any> = ConstantValueBinding<TActivated> | DynamicValueBinding<TActivated> | (TActivated extends Factory<unknown> ? FactoryBinding<TActivated> : never) | InstanceBinding<TActivated> | (TActivated extends Provider<unknown> ? ProviderBinding<TActivated> : never) | ResolvedValueBinding<TActivated> | ServiceRedirectionBinding<TActivated>;
//# sourceMappingURL=Binding.d.ts.map
@@ -0,0 +1,71 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = cargo;
var _queue = require('./internal/queue.js');
var _queue2 = _interopRequireDefault(_queue);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Creates a `cargoQueue` object with the specified payload. Tasks added to the
* cargoQueue will be processed together (up to the `payload` limit) in `concurrency` parallel workers.
* If the all `workers` are in progress, the task is queued until one becomes available. Once
* a `worker` has completed some tasks, each callback of those tasks is
* called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)
* for how `cargo` and `queue` work.
*
* While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers
* at a time, and [`cargo`]{@link module:ControlFlow.cargo} passes an array of tasks to a single worker,
* the cargoQueue passes an array of tasks to multiple parallel workers.
*
* @name cargoQueue
* @static
* @memberOf module:ControlFlow
* @method
* @see [async.queue]{@link module:ControlFlow.queue}
* @see [async.cargo]{@link module:ControlFLow.cargo}
* @category Control Flow
* @param {AsyncFunction} worker - An asynchronous function for processing an array
* of queued tasks. Invoked with `(tasks, callback)`.
* @param {number} [concurrency=1] - An `integer` for determining how many
* `worker` functions should be run in parallel. If omitted, the concurrency
* defaults to `1`. If the concurrency is `0`, an error is thrown.
* @param {number} [payload=Infinity] - An optional `integer` for determining
* how many tasks should be processed per round; if omitted, the default is
* unlimited.
* @returns {module:ControlFlow.QueueObject} A cargoQueue object to manage the tasks. Callbacks can
* attached as certain properties to listen for specific events during the
* lifecycle of the cargoQueue and inner queue.
* @example
*
* // create a cargoQueue object with payload 2 and concurrency 2
* var cargoQueue = async.cargoQueue(function(tasks, callback) {
* for (var i=0; i<tasks.length; i++) {
* console.log('hello ' + tasks[i].name);
* }
* callback();
* }, 2, 2);
*
* // add some items
* cargoQueue.push({name: 'foo'}, function(err) {
* console.log('finished processing foo');
* });
* cargoQueue.push({name: 'bar'}, function(err) {
* console.log('finished processing bar');
* });
* cargoQueue.push({name: 'baz'}, function(err) {
* console.log('finished processing baz');
* });
* cargoQueue.push({name: 'boo'}, function(err) {
* console.log('finished processing boo');
* });
*/
function cargo(worker, concurrency, payload) {
return (0, _queue2.default)(worker, concurrency, payload);
}
module.exports = exports.default;
@@ -0,0 +1,70 @@
'use strict';
var node_buffer = require('buffer');
var Scalar = require('../../nodes/Scalar.js');
var stringifyString = require('../../stringify/stringifyString.js');
const binary = {
identify: value => value instanceof Uint8Array, // Buffer inherits from Uint8Array
default: false,
tag: 'tag:yaml.org,2002:binary',
/**
* Returns a Buffer in node and an Uint8Array in browsers
*
* To use the resulting buffer as an image, you'll want to do something like:
*
* const blob = new Blob([buffer], { type: 'image/jpeg' })
* document.querySelector('#photo').src = URL.createObjectURL(blob)
*/
resolve(src, onError) {
if (typeof node_buffer.Buffer === 'function') {
return node_buffer.Buffer.from(src, 'base64');
}
else if (typeof atob === 'function') {
// On IE 11, atob() can't handle newlines
const str = atob(src.replace(/[\n\r]/g, ''));
const buffer = new Uint8Array(str.length);
for (let i = 0; i < str.length; ++i)
buffer[i] = str.charCodeAt(i);
return buffer;
}
else {
onError('This environment does not support reading binary tags; either Buffer or atob is required');
return src;
}
},
stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
if (!value)
return '';
const buf = value; // checked earlier by binary.identify()
let str;
if (typeof node_buffer.Buffer === 'function') {
str =
buf instanceof node_buffer.Buffer
? buf.toString('base64')
: node_buffer.Buffer.from(buf.buffer).toString('base64');
}
else if (typeof btoa === 'function') {
let s = '';
for (let i = 0; i < buf.length; ++i)
s += String.fromCharCode(buf[i]);
str = btoa(s);
}
else {
throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
}
type ?? (type = Scalar.Scalar.BLOCK_LITERAL);
if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
const n = Math.ceil(str.length / lineWidth);
const lines = new Array(n);
for (let i = 0, o = 0; i < n; ++i, o += lineWidth) {
lines[i] = str.substr(o, lineWidth);
}
str = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? '\n' : ' ');
}
return stringifyString.stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);
}
};
exports.binary = binary;
@@ -0,0 +1 @@
{"name":"which-boxed-primitive","version":"1.1.1","requiresBuild":false,"files":{".editorconfig":{"checkedAt":1794532097590,"integrity":"sha512-gD3iQtgC7ZgFS97pyZqR0FPjMNyRAfat8dipbSL28iiJ6B1MP5dDeDYeEnP5sYMTz8whQIk3E5vltk2kcyJJEQ==","mode":420,"size":286},".eslintrc":{"checkedAt":1794532097590,"integrity":"sha512-4+yheARSL/pPQeg25245ejEKIOgmGjgRW2fotkREQVMDnQQZj7Rw9FvimX0senKxW9R3GgLHQbPLwHLqbvQy6Q==","mode":420,"size":43},".nycrc":{"checkedAt":1794532097590,"integrity":"sha512-42sgwWzusJB1Dzhl78jX/Zg65Oi0HDDMOGXS/Uklv1kCYn4fHtRsD/JFPwdu+d40vome9XdUspzRWEQAcTGEeQ==","mode":420,"size":216},"LICENSE":{"checkedAt":1794532089199,"integrity":"sha512-d2fjYr50p8QKjqC0qhH5nWv3sgAsKHHicw91kVzLPCZ54cpPIRw8zJk+nn45Y6q/yJ/T/xdxK77zBLuAvFgmVg==","mode":420,"size":1071},"index.js":{"checkedAt":1794532097590,"integrity":"sha512-VlrQk46YR+n4QZewuR40SJy3sjk8XtC4fBgtiVdyte8M0OeFLkbjXEbf6Bu6/QIP5zC3YzRItMTByQigMOM57w==","mode":420,"size":718},"test/index.js":{"checkedAt":1794532097590,"integrity":"sha512-Pbx06c7xObIHH6DqOuYWtpJwIuephlu49/t44dAKo0whs7AikuhN6G9iQpWf934Rj28NpfS3njc7eaKNa7a7Cg==","mode":420,"size":1226},"package.json":{"checkedAt":1794532097590,"integrity":"sha512-S9x+i5FGGIt5lBYuc3OLkciEU3T6b+z9uwQS5X+MsuHfYHkYB8w4bgJS87pr8XMeHwiFuUDASKRmorQCx+eNYA==","mode":420,"size":2264},"tsconfig.json":{"checkedAt":1794532097590,"integrity":"sha512-G5TL2bnT395BqGez+9xQ1y3SLgDH02BmKrcCPi2ZqYX4R9bnh5r/5OndAzu60nrsK4zZ2iGgHtH1RKQ1ridK5g==","mode":420,"size":114},"CHANGELOG.md":{"checkedAt":1794532097590,"integrity":"sha512-awP0bU6eWerPuvDqu+TjvqT9DA67I2J6jEO2kbfPX3hrQGbBP0aUWrrqwcuzx5AakoLJ7zLmq0cS1uyUqAempA==","mode":420,"size":9120},"README.md":{"checkedAt":1794532097591,"integrity":"sha512-TYlyU0zYQx6miacyQen+weIeVPktq75CZbXdK3uW7hiKFuIHYvfr3sRocXQlyfPeryPfwvuGFtqtDg9/q6pGBA==","mode":420,"size":3071},"index.d.ts":{"checkedAt":1794532097591,"integrity":"sha512-KBpg7aNQsvTSCXnSYOenT3UoU9MsjrNqsjb5SQoTSntdoG6GDWUgs+gXPskR/OyzFVSUMgL592YUCZ0P/3WZeQ==","mode":420,"size":557},".github/FUNDING.yml":{"checkedAt":1794532097591,"integrity":"sha512-AJ+wal/E0eavh+t/SeOKagmlq3H5rdiUMxtvCH9TrfKzvoDP+OcbkuKCa3sLibQN0O/N263lVXN+jc27L4fs5A==","mode":420,"size":592}}}
@@ -0,0 +1 @@
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA8DM,SAAS,0CAAc,KAA4B,EAAE,KAAmB,EAAE,GAAkC;IACjH,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IACrD,mFAAmF;IACnF,IAAI,oBAAoB,MAAM,iBAAiB,IAAI;IACnD,IAAI,eAAe,MAAM,YAAY,IAAK,CAAA,sBAAsB,YAAY,WAAW,UAAS;IAChG,IAAI,sBAAsB,YAAY,iBAAiB,UACrD,8FAA8F;IAC9F,8FAA8F;IAC9F,oCAAoC;IACpC,eAAe;IAGjB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;QAClC,GAAG,KAAK;aACR;QACA,kBAAkB,MAAM,gBAAgB;QACxC,YAAY,MAAM,UAAU;QAC5B,cAAc,MAAM,YAAY;sBAChC;IACF;IAEA,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;QACtC,eAAe,MAAM,OAAO;QAC5B,cAAc,MAAM,MAAM;QAC1B,qBAAqB,MAAM,aAAa;IAC1C;IAEA,mDAAmD;IACnD,IAAI,KAAK,CAAA,GAAA,YAAI,EAAE,MAAM,EAAE;IACvB,CAAA,GAAA,yCAAO,EAAE,GAAG,CAAC,OAAO;YAClB;QACA,uBAAuB,MAAM,qBAAqB;QAClD,uBAAuB,MAAM,qBAAqB;QAClD,oBAAoB,MAAM,kBAAkB;QAC5C,eAAe,MAAM,aAAa;QAClC,UAAU,MAAM,QAAQ;sBACxB;IACF;IAEA,IAAI,cAAC,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;QACtC,GAAG,KAAK;YACR;QACA,6CAA6C;QAC7C,6CAA6C;QAC7C,kBAAkB;IACpB;IAEA,OAAO;oBACL;QACA,cAAc,CAAA,GAAA,iBAAS,EAAE,UAAU,kBAAkB,MAAM,gBAAgB,CAAC,aAAa,KAAK,aAAa;YACzG,wBAAwB;QAC1B,IAAI,CAAC,GAAG;YACN,MAAM;YACN,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,UAAU;QACtC;IACF;AACF","sources":["packages/@react-aria/listbox/src/useListBox.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaListBoxProps} from '@react-types/listbox';\nimport {DOMAttributes, KeyboardDelegate, LayoutDelegate, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useId} from '@react-aria/utils';\nimport {listData} from './utils';\nimport {ListState} from '@react-stately/list';\nimport {useFocusWithin} from '@react-aria/interactions';\nimport {useLabel} from '@react-aria/label';\nimport {useSelectableList} from '@react-aria/selection';\n\nexport interface ListBoxAria {\n /** Props for the listbox element. */\n listBoxProps: DOMAttributes,\n /** Props for the listbox's visual label element (if any). */\n labelProps: DOMAttributes\n}\n\nexport interface AriaListBoxOptions<T> extends Omit<AriaListBoxProps<T>, 'children'> {\n /** Whether the listbox uses virtual scrolling. */\n isVirtualized?: boolean,\n\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate,\n\n /**\n * A delegate object that provides layout information for items in the collection.\n * By default this uses the DOM, but this can be overridden to implement things like\n * virtualized scrolling.\n */\n layoutDelegate?: LayoutDelegate,\n\n /**\n * Whether the listbox items should use virtual focus instead of being focused directly.\n */\n shouldUseVirtualFocus?: boolean,\n\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean,\n\n /** Whether options should be focused when the user hovers over them. */\n shouldFocusOnHover?: boolean,\n\n /**\n * The behavior of links in the collection.\n * - 'action': link behaves like onAction.\n * - 'selection': link follows selection interactions (e.g. if URL drives selection).\n * - 'override': links override all other interactions (link items are not selectable).\n * @default 'override'\n */\n linkBehavior?: 'action' | 'selection' | 'override'\n}\n\n/**\n * Provides the behavior and accessibility implementation for a listbox component.\n * A listbox displays a list of options and allows a user to select one or more of them.\n * @param props - Props for the listbox.\n * @param state - State for the listbox, as returned by `useListState`.\n */\nexport function useListBox<T>(props: AriaListBoxOptions<T>, state: ListState<T>, ref: RefObject<HTMLElement | null>): ListBoxAria {\n let domProps = filterDOMProps(props, {labelable: true});\n // Use props instead of state here. We don't want this to change due to long press.\n let selectionBehavior = props.selectionBehavior || 'toggle';\n let linkBehavior = props.linkBehavior || (selectionBehavior === 'replace' ? 'action' : 'override');\n if (selectionBehavior === 'toggle' && linkBehavior === 'action') {\n // linkBehavior=\"action\" does not work with selectionBehavior=\"toggle\" because there is no way\n // to initiate selection (checkboxes are not allowed inside a listbox). Link items will not be\n // selectable in this configuration.\n linkBehavior = 'override';\n }\n\n let {listProps} = useLine truncated
@@ -0,0 +1,52 @@
import { type TSchema, SchemaOptions } from '../schema/index';
import { type Assert } from '../helpers/index';
import { type TComputed } from '../computed/index';
import { type TNever } from '../never/index';
import { type TArray } from '../array/index';
import { type TIntersect } from '../intersect/index';
import { type TMappedResult, type TMappedKey } from '../mapped/index';
import { type TObject, type TProperties } from '../object/index';
import { type TUnion } from '../union/index';
import { type TRecursive } from '../recursive/index';
import { type TRef } from '../ref/index';
import { type TTuple } from '../tuple/index';
import { type TIntersectEvaluated } from '../intersect/index';
import { type TUnionEvaluated } from '../union/index';
import { type TIndexPropertyKeys } from './indexed-property-keys';
import { type TIndexFromMappedKey } from './indexed-from-mapped-key';
import { type TIndexFromMappedResult } from './indexed-from-mapped-result';
type TFromRest<Types extends TSchema[], Key extends PropertyKey, Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromRest<Right, Key, [...Result, Assert<TIndexFromPropertyKey<Left, Key>, TSchema>]> : Result);
type TFromIntersectRest<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TNever ? TFromIntersectRest<Right, [...Result]> : TFromIntersectRest<Right, [...Result, Left]> : Result);
type TFromIntersect<Types extends TSchema[], Key extends PropertyKey> = (TIntersectEvaluated<TFromIntersectRest<TFromRest<Types, Key>>>);
type TFromUnionRest<Types extends TSchema[], Result extends TSchema[] = []> = Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TNever ? [] : TFromUnionRest<Right, [Left, ...Result]> : Result;
type TFromUnion<Types extends TSchema[], Key extends PropertyKey> = (TUnionEvaluated<TFromUnionRest<TFromRest<Types, Key>>>);
type TFromTuple<Types extends TSchema[], Key extends PropertyKey> = (Key extends keyof Types ? Types[Key] : Key extends '[number]' ? TUnionEvaluated<Types> : TNever);
type TFromArray<Type extends TSchema, Key extends PropertyKey> = (Key extends '[number]' ? Type : TNever);
type AssertPropertyKey<T> = Assert<T, string | number>;
type TFromProperty<Properties extends TProperties, Key extends PropertyKey> = (Key extends keyof Properties ? Properties[Key] : `${AssertPropertyKey<Key>}` extends `${AssertPropertyKey<keyof Properties>}` ? Properties[AssertPropertyKey<Key>] : TNever);
export type TIndexFromPropertyKey<Type extends TSchema, Key extends PropertyKey> = (Type extends TRecursive<infer Type extends TSchema> ? TIndexFromPropertyKey<Type, Key> : Type extends TIntersect<infer Types extends TSchema[]> ? TFromIntersect<Types, Key> : Type extends TUnion<infer Types extends TSchema[]> ? TFromUnion<Types, Key> : Type extends TTuple<infer Types extends TSchema[]> ? TFromTuple<Types, Key> : Type extends TArray<infer Type extends TSchema> ? TFromArray<Type, Key> : Type extends TObject<infer Properties extends TProperties> ? TFromProperty<Properties, Key> : TNever);
export declare function IndexFromPropertyKey<Type extends TSchema, Key extends PropertyKey>(type: Type, propertyKey: Key): TIndexFromPropertyKey<Type, Key>;
export type TIndexFromPropertyKeys<Type extends TSchema, PropertyKeys extends PropertyKey[], Result extends TSchema[] = []> = (PropertyKeys extends [infer Left extends PropertyKey, ...infer Right extends PropertyKey[]] ? TIndexFromPropertyKeys<Type, Right, [...Result, Assert<TIndexFromPropertyKey<Type, Left>, TSchema>]> : Result);
export declare function IndexFromPropertyKeys<Type extends TSchema, PropertyKeys extends PropertyKey[]>(type: Type, propertyKeys: [...PropertyKeys]): TIndexFromPropertyKeys<Type, PropertyKeys>;
type FromSchema<Type extends TSchema, PropertyKeys extends PropertyKey[]> = (TUnionEvaluated<TIndexFromPropertyKeys<Type, PropertyKeys>>);
declare function FromSchema<Type extends TSchema, PropertyKeys extends PropertyKey[]>(type: Type, propertyKeys: [...PropertyKeys]): FromSchema<Type, PropertyKeys>;
export type TIndexFromComputed<Type extends TSchema, Key extends TSchema> = (TComputed<'Index', [Type, Key]>);
export declare function IndexFromComputed<Type extends TSchema, Key extends TSchema>(type: Type, key: Key): TIndexFromComputed<Type, Key>;
export type TIndex<Type extends TSchema, PropertyKeys extends PropertyKey[]> = (FromSchema<Type, PropertyKeys>);
/** `[Json]` Returns an Indexed property type for the given keys */
export declare function Index<Type extends TRef, Key extends TSchema>(type: Type, key: Key, options?: SchemaOptions): TIndexFromComputed<Type, Key>;
/** `[Json]` Returns an Indexed property type for the given keys */
export declare function Index<Type extends TSchema, Key extends TRef>(type: Type, key: Key, options?: SchemaOptions): TIndexFromComputed<Type, Key>;
/** `[Json]` Returns an Indexed property type for the given keys */
export declare function Index<Type extends TRef, Key extends TRef>(type: Type, key: Key, options?: SchemaOptions): TIndexFromComputed<Type, Key>;
/** `[Json]` Returns an Indexed property type for the given keys */
export declare function Index<Type extends TSchema, MappedResult extends TMappedResult>(type: Type, mappedResult: MappedResult, options?: SchemaOptions): TIndexFromMappedResult<Type, MappedResult>;
/** `[Json]` Returns an Indexed property type for the given keys */
export declare function Index<Type extends TSchema, MappedResult extends TMappedResult>(type: Type, mappedResult: MappedResult, options?: SchemaOptions): TIndexFromMappedResult<Type, MappedResult>;
/** `[Json]` Returns an Indexed property type for the given keys */
export declare function Index<Type extends TSchema, MappedKey extends TMappedKey>(type: Type, mappedKey: MappedKey, options?: SchemaOptions): TIndexFromMappedKey<Type, MappedKey>;
/** `[Json]` Returns an Indexed property type for the given keys */
export declare function Index<Type extends TSchema, Key extends TSchema, PropertyKeys extends PropertyKey[] = TIndexPropertyKeys<Key>>(T: Type, K: Key, options?: SchemaOptions): TIndex<Type, PropertyKeys>;
/** `[Json]` Returns an Indexed property type for the given keys */
export declare function Index<Type extends TSchema, PropertyKeys extends PropertyKey[]>(type: Type, propertyKeys: readonly [...PropertyKeys], options?: SchemaOptions): TIndex<Type, PropertyKeys>;
export {};
@@ -0,0 +1,38 @@
/**
* @fileoverview Define the abstract class about cursors which manipulate another cursor.
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const Cursor = require("./cursor");
//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------
/**
* The abstract class about cursors which manipulate another cursor.
*/
module.exports = class DecorativeCursor extends Cursor {
/**
* Initializes this cursor.
* @param {Cursor} cursor The cursor to be decorated.
*/
constructor(cursor) {
super();
this.cursor = cursor;
}
/** @inheritdoc */
moveNext() {
const retv = this.cursor.moveNext();
this.current = this.cursor.current;
return retv;
}
};
@@ -0,0 +1,388 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
/// string
const stringSchema = z.string();
test("string async parse", async () => {
const goodData = "XXX";
const badData = 12;
const goodResult = await stringSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await stringSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// number
const numberSchema = z.number();
test("number async parse", async () => {
const goodData = 1234.2353;
const badData = "1234";
const goodResult = await numberSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await numberSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// bigInt
const bigIntSchema = z.bigint();
test("bigInt async parse", async () => {
const goodData = BigInt(145);
const badData = 134;
const goodResult = await bigIntSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await bigIntSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// boolean
const booleanSchema = z.boolean();
test("boolean async parse", async () => {
const goodData = true;
const badData = 1;
const goodResult = await booleanSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await booleanSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// date
const dateSchema = z.date();
test("date async parse", async () => {
const goodData = new Date();
const badData = new Date().toISOString();
const goodResult = await dateSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await dateSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// undefined
const undefinedSchema = z.undefined();
test("undefined async parse", async () => {
const goodData = undefined;
const badData = "XXX";
const goodResult = await undefinedSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(undefined);
const badResult = await undefinedSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// null
const nullSchema = z.null();
test("null async parse", async () => {
const goodData = null;
const badData = undefined;
const goodResult = await nullSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await nullSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// any
const anySchema = z.any();
test("any async parse", async () => {
const goodData = [{}];
// const badData = 'XXX';
const goodResult = await anySchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
// const badResult = await anySchema.safeParseAsync(badData);
// expect(badResult.success).toBe(false);
// if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// unknown
const unknownSchema = z.unknown();
test("unknown async parse", async () => {
const goodData = ["asdf", 124, () => {}];
// const badData = 'XXX';
const goodResult = await unknownSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
// const badResult = await unknownSchema.safeParseAsync(badData);
// expect(badResult.success).toBe(false);
// if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// void
const voidSchema = z.void();
test("void async parse", async () => {
const goodData = undefined;
const badData = 0;
const goodResult = await voidSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await voidSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// array
const arraySchema = z.array(z.string());
test("array async parse", async () => {
const goodData = ["XXX"];
const badData = "XXX";
const goodResult = await arraySchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await arraySchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// object
const objectSchema = z.object({ string: z.string() });
test("object async parse", async () => {
const goodData = { string: "XXX" };
const badData = { string: 12 };
const goodResult = await objectSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await objectSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// union
const unionSchema = z.union([z.string(), z.undefined()]);
test("union async parse", async () => {
const goodData = undefined;
const badData = null;
const goodResult = await unionSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await unionSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// record
const recordSchema = z.record(z.object({}));
test("record async parse", async () => {
const goodData = { adsf: {}, asdf: {} };
const badData = [{}];
const goodResult = await recordSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await recordSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// function
const functionSchema = z.function();
test("function async parse", async () => {
const goodData = () => {};
const badData = "XXX";
const goodResult = await functionSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(typeof goodResult.data).toEqual("function");
const badResult = await functionSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// literal
const literalSchema = z.literal("asdf");
test("literal async parse", async () => {
const goodData = "asdf";
const badData = "asdff";
const goodResult = await literalSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await literalSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// enum
const enumSchema = z.enum(["fish", "whale"]);
test("enum async parse", async () => {
const goodData = "whale";
const badData = "leopard";
const goodResult = await enumSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await enumSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// nativeEnum
enum nativeEnumTest {
asdf = "qwer",
}
// @ts-ignore
const nativeEnumSchema = z.nativeEnum(nativeEnumTest);
test("nativeEnum async parse", async () => {
const goodData = nativeEnumTest.asdf;
const badData = "asdf";
const goodResult = await nativeEnumSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await nativeEnumSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// promise
const promiseSchema = z.promise(z.number());
test("promise async parse good", async () => {
const goodData = Promise.resolve(123);
const goodResult = await promiseSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) {
expect(goodResult.data).toBeInstanceOf(Promise);
const data = await goodResult.data;
expect(data).toEqual(123);
// expect(goodResult.data).resolves.toEqual(124);
// return goodResult.data;
} else {
throw new Error("success should be true");
}
});
test("promise async parse bad", async () => {
const badData = Promise.resolve("XXX");
const badResult = await promiseSchema.safeParseAsync(badData);
expect(badResult.success).toBe(true);
if (badResult.success) {
await expect(badResult.data).rejects.toBeInstanceOf(z.ZodError);
} else {
throw new Error("success should be true");
}
});
test("async validation non-empty strings", async () => {
const base = z.object({
hello: z.string().refine((x) => x && x.length > 0),
foo: z.string().refine((x) => x && x.length > 0),
});
const testval = { hello: "", foo: "" };
const result1 = base.safeParse(testval);
const result2 = base.safeParseAsync(testval);
const r1 = result1;
await result2.then((r2) => {
if (r1.success === false && r2.success === false) expect(r1.error.issues.length).toBe(r2.error.issues.length); // <--- r1 has length 2, r2 has length 1
});
});
test("async validation multiple errors 1", async () => {
const base = z.object({
hello: z.string(),
foo: z.number(),
});
const testval = { hello: 3, foo: "hello" };
const result1 = base.safeParse(testval);
const result2 = base.safeParseAsync(testval);
const r1 = result1;
await result2.then((r2) => {
if (r1.success === false && r2.success === false) expect(r2.error.issues.length).toBe(r1.error.issues.length);
});
});
test("async validation multiple errors 2", async () => {
const base = (is_async?: boolean) =>
z.object({
hello: z.string(),
foo: z.object({
bar: z.number().refine(is_async ? async () => false : () => false),
}),
});
const testval = { hello: 3, foo: { bar: 4 } };
const result1 = base().safeParse(testval);
const result2 = base(true).safeParseAsync(testval);
const r1 = result1;
await result2.then((r2) => {
if (r1.success === false && r2.success === false) expect(r2.error.issues.length).toBe(r1.error.issues.length);
});
});
test("ensure early async failure prevents follow-up refinement checks", async () => {
let count = 0;
const base = z.object({
hello: z.string(),
foo: z
.number()
.refine(async () => {
count++;
return true;
})
.refine(async () => {
count++;
return true;
}, "Good"),
});
const testval = { hello: "bye", foo: 3 };
const result = await base.safeParseAsync(testval);
if (result.success === false) {
expect(result.error.issues.length).toBe(1);
expect(count).toBe(1);
}
// await result.then((r) => {
// if (r.success === false) expect(r.error.issues.length).toBe(1);
// expect(count).toBe(2);
// });
});
@@ -0,0 +1,255 @@
/**
* @author Raphael Pigulla
* See LICENSE file in root directory for full license.
*/
"use strict"
// This list is generated using:
// `require("module").builtinModules`
//
// This was last updated using Node v13.8.0.
const BUILTIN_MODULES = [
"_http_agent",
"_http_client",
"_http_common",
"_http_incoming",
"_http_outgoing",
"_http_server",
"_stream_duplex",
"_stream_passthrough",
"_stream_readable",
"_stream_transform",
"_stream_wrap",
"_stream_writable",
"_tls_common",
"_tls_wrap",
"assert",
"async_hooks",
"buffer",
"child_process",
"cluster",
"console",
"constants",
"crypto",
"dgram",
"dns",
"domain",
"events",
"fs",
"http",
"http2",
"https",
"inspector",
"module",
"net",
"os",
"path",
"perf_hooks",
"process",
"punycode",
"querystring",
"readline",
"repl",
"stream",
"string_decoder",
"sys",
"timers",
"tls",
"trace_events",
"tty",
"url",
"util",
"v8",
"vm",
"worker_threads",
"zlib",
]
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"disallow `require` calls to be mixed with regular variable declarations",
category: "Stylistic Issues",
recommended: false,
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-mixed-requires.md",
},
fixable: null,
schema: [
{
oneOf: [
{
type: "boolean",
},
{
type: "object",
properties: {
grouping: {
type: "boolean",
},
allowCall: {
type: "boolean",
},
},
additionalProperties: false,
},
],
},
],
messages: {
noMixRequire: "Do not mix 'require' and other declarations.",
noMixCoreModuleFileComputed:
"Do not mix core, module, file and computed requires.",
},
},
create(context) {
const options = context.options[0]
let grouping = false
let allowCall = false
if (typeof options === "object") {
grouping = options.grouping
allowCall = options.allowCall
} else {
grouping = Boolean(options)
}
const DECL_REQUIRE = "require"
const DECL_UNINITIALIZED = "uninitialized"
const DECL_OTHER = "other"
const REQ_CORE = "core"
const REQ_FILE = "file"
const REQ_MODULE = "module"
const REQ_COMPUTED = "computed"
/**
* Determines the type of a declaration statement.
* @param {ASTNode} initExpression The init node of the VariableDeclarator.
* @returns {string} The type of declaration represented by the expression.
*/
function getDeclarationType(initExpression) {
if (!initExpression) {
// "var x;"
return DECL_UNINITIALIZED
}
if (
initExpression.type === "CallExpression" &&
initExpression.callee.type === "Identifier" &&
initExpression.callee.name === "require"
) {
// "var x = require('util');"
return DECL_REQUIRE
}
if (
allowCall &&
initExpression.type === "CallExpression" &&
initExpression.callee.type === "CallExpression"
) {
// "var x = require('diagnose')('sub-module');"
return getDeclarationType(initExpression.callee)
}
if (initExpression.type === "MemberExpression") {
// "var x = require('glob').Glob;"
return getDeclarationType(initExpression.object)
}
// "var x = 42;"
return DECL_OTHER
}
/**
* Determines the type of module that is loaded via require.
* @param {ASTNode} initExpression The init node of the VariableDeclarator.
* @returns {string} The module type.
*/
function inferModuleType(initExpression) {
if (initExpression.type === "MemberExpression") {
// "var x = require('glob').Glob;"
return inferModuleType(initExpression.object)
}
if (initExpression.arguments.length === 0) {
// "var x = require();"
return REQ_COMPUTED
}
const arg = initExpression.arguments[0]
if (arg.type !== "Literal" || typeof arg.value !== "string") {
// "var x = require(42);"
return REQ_COMPUTED
}
if (BUILTIN_MODULES.indexOf(arg.value) !== -1) {
// "var fs = require('fs');"
return REQ_CORE
}
if (/^\.{0,2}\//u.test(arg.value)) {
// "var utils = require('./utils');"
return REQ_FILE
}
// "var async = require('async');"
return REQ_MODULE
}
/**
* Check if the list of variable declarations is mixed, i.e. whether it
* contains both require and other declarations.
* @param {ASTNode} declarations The list of VariableDeclarators.
* @returns {boolean} True if the declarations are mixed, false if not.
*/
function isMixed(declarations) {
const contains = {}
for (const declaration of declarations) {
const type = getDeclarationType(declaration.init)
contains[type] = true
}
return Boolean(
contains[DECL_REQUIRE] &&
(contains[DECL_UNINITIALIZED] || contains[DECL_OTHER])
)
}
/**
* Check if all require declarations in the given list are of the same
* type.
* @param {ASTNode} declarations The list of VariableDeclarators.
* @returns {boolean} True if the declarations are grouped, false if not.
*/
function isGrouped(declarations) {
const found = {}
for (const declaration of declarations) {
if (getDeclarationType(declaration.init) === DECL_REQUIRE) {
found[inferModuleType(declaration.init)] = true
}
}
return Object.keys(found).length <= 1
}
return {
VariableDeclaration(node) {
if (isMixed(node.declarations)) {
context.report({
node,
messageId: "noMixRequire",
})
} else if (grouping && !isGrouped(node.declarations)) {
context.report({
node,
messageId: "noMixCoreModuleFileComputed",
})
}
},
}
},
}
@@ -0,0 +1,7 @@
'use strict';
try {
module.exports = require('bindings')('addon.node').convert;
} catch (err) {
module.exports = require('../jssrc/index.js');
}
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more