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

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

No files matched your search

@@ -0,0 +1,2 @@
var convert = require('./convert');
module.exports = convert(require('../number'));
@@ -0,0 +1,57 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getPropValue;
exports.getLiteralPropValue = getLiteralPropValue;
var _values = require('./values');
var _values2 = _interopRequireDefault(_values);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var extractValue = function extractValue(attribute, extractor) {
if (attribute && attribute.type === 'JSXAttribute') {
if (attribute.value === null) {
// Null valued attributes imply truthiness.
// For example: <div aria-hidden />
// See: https://facebook.github.io/react/docs/jsx-in-depth.html#boolean-attributes
return true;
}
return extractor(attribute.value);
}
return undefined;
};
/**
* Returns the value of a given attribute.
* Different types of attributes have their associated
* values in different properties on the object.
*
* This function should return the most *closely* associated
* value with the intention of the JSX.
*
* @param attribute - The JSXAttribute collected by AST parser.
*/
function getPropValue(attribute) {
return extractValue(attribute, _values2.default);
}
/**
* Returns the value of a given attribute.
* Different types of attributes have their associated
* values in different properties on the object.
*
* This function should return a value only if we can extract
* a literal value from its attribute (i.e. values that have generic
* types in JavaScript - strings, numbers, booleans, etc.)
*
* @param attribute - The JSXAttribute collected by AST parser.
*/
function getLiteralPropValue(attribute) {
return extractValue(attribute, _values.getLiteralValue);
}
@@ -0,0 +1 @@
{"name":"@heroui/avatar","version":"2.2.7","requiresBuild":false,"files":{"dist/avatar-group-context.js":{"checkedAt":1794532107170,"integrity":"sha512-YQxLNxnHKI1QoA10mkkZZNAYTzUpvJXE7m6/co6kglCMmDsdT0v5BSbPLxPtqpEnBgDSx/kbUAq8QWC7tRGwng==","mode":420,"size":1429},"dist/avatar-group.js":{"checkedAt":1794532107170,"integrity":"sha512-OdzI4+cf0OEnZFCCki/dZX8a0lweuRLZaT4I5hrFU05DHKpSSv0LKQ+xNpgpOjmjkzN2v9y9o2oagABr9s8tog==","mode":420,"size":12038},"dist/avatar-icon.js":{"checkedAt":1794532107170,"integrity":"sha512-6+wCJRna2lU0pWlcbRdaTZxCaL/SkWz96WZL2NPr/obBT8H1aPb54u4+cK16nOV0k64Uj82kqfJLz7xa+KLeag==","mode":420,"size":2259},"dist/avatar.js":{"checkedAt":1794532107170,"integrity":"sha512-eceRsOR4Jpy97jwH3+fl3270/TS5mIQWPY9FYR5MbSLvBhs2BFYmTtNBIUL+AwhiOtP1hoZALRJb9xwURQIlnQ==","mode":420,"size":8823},"dist/index.js":{"checkedAt":1794532107170,"integrity":"sha512-/0Wp5IeF+vpkR8q68xYh+v/XRRsAtuHxzB9iRlpgzdrnRqHzXxhgp7JDXFJ0SdCOvZHLgiRTcxQSLSoLC/KJvA==","mode":420,"size":12405},"dist/use-avatar-group.js":{"checkedAt":1794532107171,"integrity":"sha512-Oanci8ZoeLl1IxTrqdxzLiuiSfTJ5MMKzA/62T5wt04lW3o5T+DU9+RLY63XZKTKGbrxVbjnaPa8dsE7ylQUqg==","mode":420,"size":3379},"dist/use-avatar.js":{"checkedAt":1794532107171,"integrity":"sha512-OLwvPy1NtMw/V0k5stBmVOUE8rnObRGISvcvIv6/rRheNO47BuKxc4zQ68RkTXir25musNblO82GIVah5kGsuw==","mode":420,"size":5966},"package.json":{"checkedAt":1794532107171,"integrity":"sha512-j7TG/djGj0whgK9x0gi21LvI4YIOlS5U7ephOsP0CjGTa1xhPXE8tIaq3ZVWYN3w47V06+Qq3pD9phzmDmXhZg==","mode":420,"size":1579},"README.md":{"checkedAt":1794532107171,"integrity":"sha512-FVQfAbS/6+CaP1PQ4GfCpNLSnYJi49RzC7onbHhOLgW3a89d2c2mN3ZF09hfU/a5aV9eCfoBj089+cgRwseYFw==","mode":420,"size":586},"dist/avatar-group-context.mjs":{"checkedAt":1794532107171,"integrity":"sha512-tUkb4ZDX39eYW0f+qnuOQxHyUgvasgdaX5Fp1X/d2iCA43Tq2SgRU+G9PEd4fuOf16C02HNPuwWc5kA3SDrNgg==","mode":420,"size":160},"dist/avatar-group.mjs":{"checkedAt":1794532107171,"integrity":"sha512-0Ra0R8hjZNlM7gUhDrcCUJvwINWeRYZENV208vhoMyCfC7KQ9sDzukEVR4XZV6Yeecw0jJr3hx9imSniit+uCw==","mode":420,"size":278},"dist/avatar-icon.mjs":{"checkedAt":1794532107171,"integrity":"sha512-mthYvNugXDMA/6KRaqd/o4vDqa26LIpMxWr3NbTMqsB25pSG+Pa7ENlEQx9/veiWe8p3BQL2eR2HkZkxKm415w==","mode":420,"size":92},"dist/avatar.mjs":{"checkedAt":1794532107171,"integrity":"sha512-74bdSvmWXK0oFZGFIT5B5syqfnHxcOxpYe09KxP98dG8DKDEn3E18ADI8oxXXlmvekle+MmkF3xzccPIoTEeaQ==","mode":420,"size":204},"dist/chunk-25E6VDTZ.mjs":{"checkedAt":1794532107171,"integrity":"sha512-698sbFl41Os8p+PrviHDARhA51+vRVWHfr+rji5w3T8hgkjbBycwneAC4vlPfiqw/7OqbiJ5xDww6cDOCSug+w==","mode":420,"size":1153},"dist/chunk-JUJ53SJZ.mjs":{"checkedAt":1794532107172,"integrity":"sha512-AuCYeNjizqjQGcp+j+C/+Ee3/QMkYK14jdzzoY/5AP9pKJZUTyCpHwAoAdVl5sBR2zck+dUxNA9rVDn1tVRl5w==","mode":420,"size":276},"dist/chunk-LTC67JRI.mjs":{"checkedAt":1794532107172,"integrity":"sha512-+MYN8z3MlHCLr0Bah7gyD4oOAgLv2h7m8JXvMzDRal80NI9ijKq7JVS6xGme5AeHin1628h8ndHfQSZp5evBHg==","mode":420,"size":4308},"dist/chunk-NB7VH5TP.mjs":{"checkedAt":1794532107172,"integrity":"sha512-rXTPmc+gLiSA4dyOCZbNt1SQepMWJ3lTCMqtTJ08T96yk+Wp542BRDndhabtIwKbB1SuAnNa5SdUUXYP6icrCw==","mode":420,"size":1004},"dist/chunk-QH65JCLF.mjs":{"checkedAt":1794532107172,"integrity":"sha512-V13tBJZmFR4caKamt+Cx+HmlFffDe8bNPHkcAez3SSJ1ym9APinLwqq6DWphKhTm3xhi4Ei7Bq7etAYWbjLRJw==","mode":420,"size":2129},"dist/chunk-SXMLSBOY.mjs":{"checkedAt":1794532107172,"integrity":"sha512-93/vBVJzjaXDqfBbZzOlLDoth2tJfoLzJAbHQBc9SYvxAU7Up2wvqRri3hNnl5KHZG05iV6UL9vu6y5/MDIJ9A==","mode":420,"size":1610},"dist/index.mjs":{"checkedAt":1794532107172,"integrity":"sha512-A7YxEkCUR230sLje5f9VefBT+0AzPvw2R/oa2b3Qxt8vAlo0kwol2MUH9G0EUr88X4W49kdKowo55pLFScPLHg==","mode":420,"size":554},"dist/use-avatar-group.mjs":{"checkedAt":1794532107172,"integrity":"sha512-dwU3ZoZNO8F8IugaeLBUAfodWuN4JSzg0RGh6r0jeI84JpgzLwlVR6gltJb5aLl17OOId+7RQpR2EHFjpY+05Q==","mode":420,"size":100},"dist/use-avatar.mjs":{"checkedAt":1794532107173,"integrity":"sha512-7G9yAKUhYcV+AqNLByQQ67lJeejkqLrY9rm0Tzl5I/w6+jBkxSe8974nM/WTDfiaArh3sJ8A9ffoyDX//SQx7g==","mode":420,"size":121},"dist/avatar-group-context.d.ts":{"checkedAt":1794532107173,"integrity":"sha512-t5fGvC0HuYoTthK9t7FAeWpkuJB42XPQRh0AlyOMnHF6RYuayFSsMbqUJ3puV0AXrj6ZgppDLdJRE7nF2cGRuw==","mode":420,"size":417},"dist/avatar-group.d.ts":{"checkedAt":1794532107173,"integrity":"sha512-Hp0RGT3ojx4ZhDq4aMk6q3ClBHq+4wqfp+9Q4qEtmWKOF2dhr9NQb1n8M2ZB9ldlPolOp9ufMHRBk9xSXMrudQ==","mode":420,"size":479},"dist/avatar-icon.d.ts":{"checkedAt":1794532107173,"integrity":"sha512-w2tXRvYCAIPPOeengeSh0mhWNUU+KcsgO1SN/hyQk1UD68Q4zAVw4LhiSle6fTGBZqsKgO5wqkYTAWFgxhQYxg==","mode":420,"size":144},"dist/avatar.d.ts":{"checkedAt":1794532107173,"integrity":"sha512-qHzRdme2HM3uBF7k4bJcgzQ4HXq0cMrKKXcdhtOJmbwyeTAXViJusJWDTT4eBMPJf5y6OFe8obcpCbHtq26KmQ==","mode":420,"size":391},"dist/index.d.ts":{"checkedAt":1794532107173,"integrity":"sha512-PPbrP7yIJyGUNnW+Jp2tPULdh3fv3tzOsq+VpQyPPPih3WY8r6jPWn0qRAgrfNiQZaoQzH5mA63SzpShpLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"resolve-gitignore.d.ts","sourceRoot":"","sources":["resolve-gitignore.js"],"names":[],"mappings":"AAiCA,+CAFa,MAAM,EAAE,CAyBpB"}
@@ -0,0 +1 @@
{"mappings":";AAeA;IACE,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,8CAA8C;IAC9C,UAAU,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IACrC,iDAAiD;IACjD,QAAQ,CAAC,UAAU,EAAE,GAAG,GAAG,IAAI,CAAC;IAChC,+EAA+E;IAC/E,QAAQ,CAAC,kBAAkB,EAAE,aAAa,GAAG,IAAI,CAAC;IAClD,8GAA8G;IAC9G,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;CAC5D;AAED,qCAAsC,SAAQ,UAAU;IACtD,qDAAqD;IACrD,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAC1C,oDAAoD;IACpD,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC;IAC1B,+CAA+C;IAC/C,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,CAAA;CACtC;AAED,uCAAwC,SAAQ,UAAU;IACxD,+DAA+D;IAC/D,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,iDA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CAiBzB;IAED,IAAI,gBAAgB,IAAI,GAAG,GAAG,IAAI,CAUjC;IAED,IAAI,eAAe,IAAI,GAAG,GAAG,IAAI,CAUhC;IAED,IAAI,YAAY,IAAI,GAAG,CAAC,GAAG,CAAC,CAE3B;IAED,IAAI,gBAAgB,IAAI,gBAAgB,CAEvC;IAED;;OAEG;IACH,eAAe,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI;IAmGjC;;OAEG;IACH,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI;IAiC/B;;OAEG;IACH,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI;IAiBhC;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI;IA2C1C;;OAEG;IACH,SAAS,IAAI,IAAI;IAMjB;;OAEG;IACH,cAAc,IAAI,IAAI;IAMtB;;OAEG;IACH,eAAe,IAAI,IAAI;IAQvB,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,UAAU,GAAG,cAAc,GAAG,YAAY,GAAG,IAAI;IAmBtE;;OAEG;IACH,gBAAgB,CAAC,SAAS,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,OAAO;IA0B9C,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO;IAahC,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO;IAI7B,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO;IAIzB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG;IAI3B,cAAc,CAAC,UAAU,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,GAAG,gBAAgB;CAMxE","sources":["packages/@react-stately/selection/src/packages/@react-stately/selection/src/types.ts","packages/@react-stately/selection/src/packages/@react-stately/selection/src/Selection.ts","packages/@react-stately/selection/src/packages/@react-stately/selection/src/useMultipleSelectionState.ts","packages/@react-stately/selection/src/packages/@reacLine truncated
@@ -0,0 +1,21 @@
/**
* @deprecated The `node:constants` module is deprecated. When requiring access to constants
* relevant to specific Node.js builtin modules, developers should instead refer
* to the `constants` property exposed by the relevant module. For instance,
* `require('node:fs').constants` and `require('node:os').constants`.
*/
declare module "constants" {
const constants:
& typeof import("node:os").constants.dlopen
& typeof import("node:os").constants.errno
& typeof import("node:os").constants.priority
& typeof import("node:os").constants.signals
& typeof import("node:fs").constants
& typeof import("node:crypto").constants;
export = constants;
}
declare module "node:constants" {
import constants = require("constants");
export = constants;
}
@@ -0,0 +1,66 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ErrorKind = void 0;
var ErrorKind;
(function (ErrorKind) {
/** Argument is unclosed (e.g. `{0`) */
ErrorKind[ErrorKind["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE";
/** Argument is empty (e.g. `{}`). */
ErrorKind[ErrorKind["EMPTY_ARGUMENT"] = 2] = "EMPTY_ARGUMENT";
/** Argument is malformed (e.g. `{foo!}``) */
ErrorKind[ErrorKind["MALFORMED_ARGUMENT"] = 3] = "MALFORMED_ARGUMENT";
/** Expect an argument type (e.g. `{foo,}`) */
ErrorKind[ErrorKind["EXPECT_ARGUMENT_TYPE"] = 4] = "EXPECT_ARGUMENT_TYPE";
/** Unsupported argument type (e.g. `{foo,foo}`) */
ErrorKind[ErrorKind["INVALID_ARGUMENT_TYPE"] = 5] = "INVALID_ARGUMENT_TYPE";
/** Expect an argument style (e.g. `{foo, number, }`) */
ErrorKind[ErrorKind["EXPECT_ARGUMENT_STYLE"] = 6] = "EXPECT_ARGUMENT_STYLE";
/** The number skeleton is invalid. */
ErrorKind[ErrorKind["INVALID_NUMBER_SKELETON"] = 7] = "INVALID_NUMBER_SKELETON";
/** The date time skeleton is invalid. */
ErrorKind[ErrorKind["INVALID_DATE_TIME_SKELETON"] = 8] = "INVALID_DATE_TIME_SKELETON";
/** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */
ErrorKind[ErrorKind["EXPECT_NUMBER_SKELETON"] = 9] = "EXPECT_NUMBER_SKELETON";
/** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */
ErrorKind[ErrorKind["EXPECT_DATE_TIME_SKELETON"] = 10] = "EXPECT_DATE_TIME_SKELETON";
/** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */
ErrorKind[ErrorKind["UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"] = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE";
/** Missing select argument options (e.g. `{foo, select}`) */
ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_OPTIONS"] = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS";
/** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */
ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"] = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE";
/** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */
ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"] = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE";
/** Expecting a selector in `select` argument (e.g `{foo, select}`) */
ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR"] = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR";
/** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */
ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR"] = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR";
/** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */
ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"] = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT";
/**
* Expecting a message fragment after the `plural` or `selectordinal` selector
* (e.g. `{foo, plural, one}`)
*/
ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"] = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT";
/** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */
ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_SELECTOR"] = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR";
/**
* Duplicate selectors in `plural` or `selectordinal` argument.
* (e.g. {foo, plural, one {#} one {#}})
*/
ErrorKind[ErrorKind["DUPLICATE_PLURAL_ARGUMENT_SELECTOR"] = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR";
/** Duplicate selectors in `select` argument.
* (e.g. {foo, select, apple {apple} apple {apple}})
*/
ErrorKind[ErrorKind["DUPLICATE_SELECT_ARGUMENT_SELECTOR"] = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR";
/** Plural or select argument option must have `other` clause. */
ErrorKind[ErrorKind["MISSING_OTHER_CLAUSE"] = 22] = "MISSING_OTHER_CLAUSE";
/** The tag is malformed. (e.g. `<bold!>foo</bold!>) */
ErrorKind[ErrorKind["INVALID_TAG"] = 23] = "INVALID_TAG";
/** The tag name is invalid. (e.g. `<123>foo</123>`) */
ErrorKind[ErrorKind["INVALID_TAG_NAME"] = 25] = "INVALID_TAG_NAME";
/** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */
ErrorKind[ErrorKind["UNMATCHED_CLOSING_TAG"] = 26] = "UNMATCHED_CLOSING_TAG";
/** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */
ErrorKind[ErrorKind["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG";
})(ErrorKind || (exports.ErrorKind = ErrorKind = {}));
@@ -0,0 +1,288 @@
{
"name": "file-type",
"version": "21.1.0",
"description": "Detect the file type of a file, stream, or data",
"license": "MIT",
"repository": "sindresorhus/file-type",
"funding": "https://github.com/sindresorhus/file-type?sponsor=1",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": {
".": {
"node": {
"types": "./index.d.ts",
"import": "./index.js",
"module-sync": "./index.js"
},
"default": {
"types": "./core.d.ts",
"import": "./core.js",
"module-sync": "./core.js"
}
},
"./core": {
"types": "./core.d.ts",
"default": "./core.js"
},
"./node": {
"types": "./index.d.ts",
"default": "./index.js"
}
},
"sideEffects": false,
"engines": {
"node": ">=20"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts",
"core.js",
"core.d.ts",
"supported.js",
"util.js"
],
"keywords": [
"mime",
"file",
"type",
"magic",
"archive",
"image",
"img",
"pic",
"picture",
"flash",
"photo",
"video",
"detect",
"check",
"is",
"exif",
"elf",
"macho",
"exe",
"binary",
"buffer",
"uint8array",
"jpg",
"png",
"apng",
"gif",
"webp",
"flif",
"xcf",
"cr2",
"cr3",
"orf",
"arw",
"dng",
"nef",
"rw2",
"raf",
"tif",
"bmp",
"icns",
"jxr",
"psd",
"indd",
"zip",
"tar",
"rar",
"gz",
"bz2",
"7z",
"dmg",
"mp4",
"mid",
"mkv",
"webm",
"mov",
"avi",
"mpg",
"mp2",
"mp3",
"m4a",
"ogg",
"opus",
"flac",
"wav",
"amr",
"pdf",
"epub",
"mobi",
"swf",
"rtf",
"woff",
"woff2",
"eot",
"ttf",
"otf",
"ttc",
"ico",
"flv",
"ps",
"xz",
"sqlite",
"xpi",
"cab",
"deb",
"ar",
"rpm",
"Z",
"lz",
"cfb",
"mxf",
"mts",
"wasm",
"webassembly",
"blend",
"bpg",
"docx",
"pptx",
"xlsx",
"3gp",
"j2c",
"jp2",
"jpm",
"jpx",
"mj2",
"aif",
"odt",
"ods",
"odp",
"xml",
"heic",
"ics",
"glb",
"pcap",
"dsf",
"lnk",
"alias",
"voc",
"ac3",
"3g2",
"m4b",
"m4p",
"m4v",
"f4a",
"f4b",
"f4p",
"f4v",
"mie",
"qcp",
"asf",
"ogv",
"ogm",
"oga",
"spx",
"ogx",
"ape",
"wv",
"cur",
"nes",
"crx",
"ktx",
"dcm",
"mpc",
"arrow",
"shp",
"aac",
"mp1",
"it",
"s3m",
"xm",
"skp",
"avif",
"eps",
"lzh",
"pgp",
"asar",
"stl",
"chm",
"3mf",
"zst",
"jxl",
"vcf",
"jls",
"pst",
"dwg",
"parquet",
"class",
"arj",
"cpio",
"ace",
"avro",
"icc",
"fbx",
"vsdx",
"vtt",
"apk",
"drc",
"lz4",
"potx",
"xltx",
"dotx",
"xltm",
"ots",
"odg",
"otg",
"otp",
"ott",
"xlsm",
"docm",
"dotm",
"potm",
"pptm",
"jar",
"rm",
"ppsm",
"ppsx",
"tar.gz",
"reg",
"dat"
],
"dependencies": {
"@tokenizer/inflate": "^0.3.1",
"strtok3": "^10.3.1",
"token-types": "^6.0.0",
"uint8array-extras": "^1.4.0"
},
"devDependencies": {
"@tokenizer/token": "^0.3.0",
"@types/node": "^22.15.21",
"ava": "^6.3.0",
"commonmark": "^0.31.2",
"get-stream": "^9.0.1",
"noop-stream": "^1.0.0",
"tsd": "^0.32.0",
"xo": "^0.60.0"
},
"xo": {
"envs": [
"node",
"browser"
],
"ignores": [
"fixture"
],
"rules": {
"no-inner-declarations": "warn",
"no-await-in-loop": "warn",
"no-bitwise": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"unicorn/text-encoding-identifier-case": "off",
"unicorn/switch-case-braces": "off",
"unicorn/prefer-top-level-await": "off"
}
},
"ava": {
"serial": true
}
}
@@ -0,0 +1,51 @@
/**
* @fileoverview Rule to enforce `default` clauses in `switch` statements to be last
* @author Milos Djermanovic
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"Enforce `default` clauses in `switch` statements to be last",
recommended: false,
url: "https://eslint.org/docs/latest/rules/default-case-last",
},
schema: [],
messages: {
notLast: "Default clause should be the last clause.",
},
},
create(context) {
return {
SwitchStatement(node) {
const cases = node.cases,
indexOfDefault = cases.findIndex(c => c.test === null);
if (
indexOfDefault !== -1 &&
indexOfDefault !== cases.length - 1
) {
const defaultClause = cases[indexOfDefault];
context.report({
node: defaultClause,
messageId: "notLast",
});
}
},
};
},
};
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('hasIn', require('../hasIn'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1 @@
{"version":3,"file":"SubplanParams.js","sourceRoot":"","sources":["../../../../src/planning/models/SubplanParams.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
{"version":3,"file":"BindingFluentSyntaxImplementation.d.ts","sourceRoot":"","sources":["../../../../src/binding/models/BindingFluentSyntaxImplementation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,iBAAiB,EAElB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,OAAO,EACP,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EAEZ,WAAW,EAKX,mBAAmB,EACnB,OAAO,EAIP,YAAY,EACZ,WAAW,EACX,QAAQ,EAER,iBAAiB,EAMjB,aAAa,EAEd,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AA0BxD,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAOpF,qBAAa,gCAAgC,CAAC,CAAC,CAC7C,YAAW,kBAAkB,CAAC,CAAC,CAAC;;gBAIpB,OAAO,EAAE,QAAQ,CAAC,aAAa,CAAC,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;IAInE,aAAa,IAAI,iBAAiB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AAY,GAAG,kBAAkB,CAAC,CAAC,CAAC;IAI9D,oBAAoB,CACzB,GAAG,EAAE,WAAW,EAChB,QAAQ,EAAE,OAAO,GAChB,kBAAkB,CAAC,CAAC,CAAC;CAGzB;AAED,qBAAa,oCAAoC,CAAC,CAAC,CACjD,SAAQ,kCAAkC,CAAC,CAAC,CAC5C,YAAW,sBAAsB,CAAC,CAAC,CAAC;;gBAIxB,OAAO,EAAE,QAAQ,CAAC,aAAa,CAAC,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;IAMnE,YAAY,CACjB,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC/B,oBAAoB,CAAC,CAAC,CAAC;IAInB,cAAc,CACnB,YAAY,EAAE,mBAAmB,CAAC,CAAC,CAAC,GACnC,oBAAoB,CAAC,CAAC,CAAC;CAG3B;AAED,qBAAa,sCAAsC,CAAC,CAAC,CACnD,SAAQ,oCAAoC,CAAC,CAAC,CAC9C,YAAW,wBAAwB,CAAC,CAAC,CAAC;;gBAI1B,OAAO,EAAE,QAAQ,CAAC,aAAa,CAAC,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;IAMnE,cAAc,IAAI,sBAAsB,CAAC,CAAC,CAAC;IAI3C,gBAAgB,IAAI,sBAAsB,CAAC,CAAC,CAAC;IAI7C,gBAAgB,IAAI,sBAAsB,CAAC,CAAC,CAAC;CAGrD"}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 9 N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB","2":"xC TC J ZB K D E F A MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC 0C 1C","33":"B C L M G"},D:{"1":"0 1 2 3 4 5 bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB"},E:{"2":"J ZB K D E F A B C L M G 2C ZC 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED"},F:{"1":"0 1 2 3 4 5 6 7 8 9 O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C G N FD GD HD ID NC uC JD OC"},G:{"2":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"2":"hD"},I:{"1":"I mD nD","2":"TC J iD jD kD lD vC"},J:{"1":"A","2":"D"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"2":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:2,C:"Vibration API",D:true};
@@ -0,0 +1,168 @@
import { createSelectorCreator, lruMemoize } from '@reduxjs/toolkit'
import {
buildCreateApi,
coreModule,
reactHooksModule,
} from '@reduxjs/toolkit/query/react'
import { render, screen, waitFor } from '@testing-library/react'
import { delay } from 'msw'
import * as React from 'react'
import type { ReactReduxContextValue } from 'react-redux'
import {
Provider,
createDispatchHook,
createSelectorHook,
createStoreHook,
} from 'react-redux'
import { setupApiStore, useRenderCounter } from '../../tests/utils/helpers'
const MyContext = React.createContext<ReactReduxContextValue | null>(null)
describe('buildCreateApi', () => {
test('Works with all hooks provided', async () => {
const customCreateApi = buildCreateApi(
coreModule(),
reactHooksModule({
hooks: {
useDispatch: createDispatchHook(MyContext),
useSelector: createSelectorHook(MyContext),
useStore: createStoreHook(MyContext),
},
}),
)
const api = customCreateApi({
baseQuery: async (arg: any) => {
await delay(150)
return {
data: arg?.body ? { ...arg.body } : {},
}
},
endpoints: (build) => ({
getUser: build.query<{ name: string }, number>({
query: () => ({
body: { name: 'Timmy' },
}),
}),
}),
})
let getRenderCount: () => number = () => 0
const storeRef = setupApiStore(api, {}, { withoutTestLifecycles: true })
// Copy of 'useQuery hook basic render count assumptions' from `buildHooks.test.tsx`
function User() {
const { isFetching } = api.endpoints.getUser.useQuery(1)
getRenderCount = useRenderCounter()
return (
<div>
<div data-testid="isFetching">{String(isFetching)}</div>
</div>
)
}
function Wrapper({ children }: any) {
return (
<Provider store={storeRef.store} context={MyContext}>
{children}
</Provider>
)
}
render(<User />, { wrapper: Wrapper })
// By the time this runs, the initial render will happen, and the query
// will start immediately running by the time we can expect this
expect(getRenderCount()).toBe(2)
await waitFor(() =>
expect(screen.getByTestId('isFetching').textContent).toBe('false'),
)
expect(getRenderCount()).toBe(3)
})
test("Throws an error if you don't provide all hooks", async () => {
const callBuildCreateApi = () => {
const customCreateApi = buildCreateApi(
coreModule(),
reactHooksModule({
// @ts-ignore
hooks: {
useDispatch: createDispatchHook(MyContext),
useSelector: createSelectorHook(MyContext),
},
}),
)
}
expect(callBuildCreateApi).toThrowErrorMatchingInlineSnapshot(
`
[Error: When using custom hooks for context, all 3 hooks need to be provided: useDispatch, useSelector, useStore.
Hook useStore was either not provided or not a function.]
`,
)
})
test('allows passing createSelector instance', async () => {
const memoize = vi.fn(lruMemoize)
const createSelector = createSelectorCreator(memoize)
const createApi = buildCreateApi(
coreModule({ createSelector }),
reactHooksModule({ createSelector }),
)
const api = createApi({
baseQuery: async (arg: any) => {
await delay(150)
return {
data: arg?.body ? { ...arg.body } : {},
}
},
endpoints: (build) => ({
getUser: build.query<{ name: string }, number>({
query: () => ({
body: { name: 'Timmy' },
}),
}),
}),
})
const storeRef = setupApiStore(api, {}, { withoutTestLifecycles: true })
await storeRef.store.dispatch(api.endpoints.getUser.initiate(1))
const selectUser = api.endpoints.getUser.select(1)
expect(selectUser(storeRef.store.getState()).data).toEqual({
name: 'Timmy',
})
expect(memoize).toHaveBeenCalledTimes(4)
memoize.mockClear()
function User() {
const { isFetching } = api.endpoints.getUser.useQuery(1)
return (
<div>
<div data-testid="isFetching">{String(isFetching)}</div>
</div>
)
}
function Wrapper({ children }: any) {
return <Provider store={storeRef.store}>{children}</Provider>
}
render(<User />, { wrapper: Wrapper })
await waitFor(() =>
expect(screen.getByTestId('isFetching').textContent).toBe('false'),
)
// select() + selectFromResult
expect(memoize).toHaveBeenCalledTimes(8)
})
})
@@ -0,0 +1,3 @@
export * from "./declarations/src/index.js";
export { default } from "./declarations/src/index.js";
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlLWlzb21vcnBoaWMtbGF5b3V0LWVmZmVjdC5janMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4vZGVjbGFyYXRpb25zL3NyYy9pbmRleC5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=
@@ -0,0 +1,47 @@
// Copyright 2013 Google Inc. All Rights Reserved.
//
// Licensed 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 CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Functions for normalizing fonts. Since the WOFF 2.0 decoder creates font
// files in normalized form, the WOFF 2.0 conversion is guaranteed to be
// lossless (in a bitwise sense) only for normalized font files.
#ifndef WOFF2_NORMALIZE_H_
#define WOFF2_NORMALIZE_H_
namespace woff2 {
struct Font;
struct FontCollection;
// Changes the offset fields of the table headers so that the data for the
// tables will be written in order of increasing tag values, without any gaps
// other than the 4-byte padding.
bool NormalizeOffsets(Font* font);
// Changes the checksum fields of the table headers and the checksum field of
// the head table so that it matches the current data.
bool FixChecksums(Font* font);
// Parses each of the glyphs in the font and writes them again to the glyf
// table in normalized form, as defined by the StoreGlyph() function. Changes
// the loca table accordigly.
bool NormalizeGlyphs(Font* font);
// Performs all of the normalization steps above.
bool NormalizeFont(Font* font);
bool NormalizeFontCollection(FontCollection* font_collection);
} // namespace woff2
#endif // WOFF2_NORMALIZE_H_
@@ -0,0 +1,278 @@
import * as core from "./core.js";
import type * as errors from "./errors.js";
import type * as schemas from "./schemas.js";
import * as util from "./util.js";
export interface $ZodCheckDef {
check: string;
error?: errors.$ZodErrorMap<never> | undefined;
/** If true, no later checks will be executed if this check fails. Default `false`. */
abort?: boolean | undefined;
/** If provided, this check will only be executed if the function returns `true`. Defaults to `payload => z.util.isAborted(payload)`. */
when?: ((payload: schemas.ParsePayload) => boolean) | undefined;
}
export interface $ZodCheckInternals<T> {
def: $ZodCheckDef;
/** The set of issues this check might throw. */
issc?: errors.$ZodIssueBase;
check(payload: schemas.ParsePayload<T>): util.MaybeAsync<void>;
onattach: ((schema: schemas.$ZodType) => void)[];
}
export interface $ZodCheck<in T = never> {
_zod: $ZodCheckInternals<T>;
}
export declare const $ZodCheck: core.$constructor<$ZodCheck<any>>;
export interface $ZodCheckLessThanDef extends $ZodCheckDef {
check: "less_than";
value: util.Numeric;
inclusive: boolean;
}
export interface $ZodCheckLessThanInternals<T extends util.Numeric = util.Numeric> extends $ZodCheckInternals<T> {
def: $ZodCheckLessThanDef;
issc: errors.$ZodIssueTooBig<T>;
}
export interface $ZodCheckLessThan<T extends util.Numeric = util.Numeric> extends $ZodCheck<T> {
_zod: $ZodCheckLessThanInternals<T>;
}
export declare const $ZodCheckLessThan: core.$constructor<$ZodCheckLessThan>;
export interface $ZodCheckGreaterThanDef extends $ZodCheckDef {
check: "greater_than";
value: util.Numeric;
inclusive: boolean;
}
export interface $ZodCheckGreaterThanInternals<T extends util.Numeric = util.Numeric> extends $ZodCheckInternals<T> {
def: $ZodCheckGreaterThanDef;
issc: errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckGreaterThan<T extends util.Numeric = util.Numeric> extends $ZodCheck<T> {
_zod: $ZodCheckGreaterThanInternals<T>;
}
export declare const $ZodCheckGreaterThan: core.$constructor<$ZodCheckGreaterThan>;
export interface $ZodCheckMultipleOfDef<T extends number | bigint = number | bigint> extends $ZodCheckDef {
check: "multiple_of";
value: T;
}
export interface $ZodCheckMultipleOfInternals<T extends number | bigint = number | bigint> extends $ZodCheckInternals<T> {
def: $ZodCheckMultipleOfDef<T>;
issc: errors.$ZodIssueNotMultipleOf;
}
export interface $ZodCheckMultipleOf<T extends number | bigint = number | bigint> extends $ZodCheck<T> {
_zod: $ZodCheckMultipleOfInternals<T>;
}
export declare const $ZodCheckMultipleOf: core.$constructor<$ZodCheckMultipleOf<number | bigint>>;
export type $ZodNumberFormats = "int32" | "uint32" | "float32" | "float64" | "safeint";
export interface $ZodCheckNumberFormatDef extends $ZodCheckDef {
check: "number_format";
format: $ZodNumberFormats;
}
export interface $ZodCheckNumberFormatInternals extends $ZodCheckInternals<number> {
def: $ZodCheckNumberFormatDef;
issc: errors.$ZodIssueInvalidType | errors.$ZodIssueTooBig<"number"> | errors.$ZodIssueTooSmall<"number">;
}
export interface $ZodCheckNumberFormat extends $ZodCheck<number> {
_zod: $ZodCheckNumberFormatInternals;
}
export declare const $ZodCheckNumberFormat: core.$constructor<$ZodCheckNumberFormat>;
export type $ZodBigIntFormats = "int64" | "uint64";
export interface $ZodCheckBigIntFormatDef extends $ZodCheckDef {
check: "bigint_format";
format: $ZodBigIntFormats | undefined;
}
export interface $ZodCheckBigIntFormatInternals extends $ZodCheckInternals<bigint> {
def: $ZodCheckBigIntFormatDef;
issc: errors.$ZodIssueTooBig<"bigint"> | errors.$ZodIssueTooSmall<"bigint">;
}
export interface $ZodCheckBigIntFormat extends $ZodCheck<bigint> {
_zod: $ZodCheckBigIntFormatInternals;
}
export declare const $ZodCheckBigIntFormat: core.$constructor<$ZodCheckBigIntFormat>;
export interface $ZodCheckMaxSizeDef extends $ZodCheckDef {
check: "max_size";
maximum: number;
}
export interface $ZodCheckMaxSizeInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {
def: $ZodCheckMaxSizeDef;
issc: errors.$ZodIssueTooBig<T>;
}
export interface $ZodCheckMaxSize<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {
_zod: $ZodCheckMaxSizeInternals<T>;
}
export declare const $ZodCheckMaxSize: core.$constructor<$ZodCheckMaxSize>;
export interface $ZodCheckMinSizeDef extends $ZodCheckDef {
check: "min_size";
minimum: number;
}
export interface $ZodCheckMinSizeInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {
def: $ZodCheckMinSizeDef;
issc: errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckMinSize<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {
_zod: $ZodCheckMinSizeInternals<T>;
}
export declare const $ZodCheckMinSize: core.$constructor<$ZodCheckMinSize>;
export interface $ZodCheckSizeEqualsDef extends $ZodCheckDef {
check: "size_equals";
size: number;
}
export interface $ZodCheckSizeEqualsInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {
def: $ZodCheckSizeEqualsDef;
issc: errors.$ZodIssueTooBig<T> | errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckSizeEquals<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {
_zod: $ZodCheckSizeEqualsInternals<T>;
}
export declare const $ZodCheckSizeEquals: core.$constructor<$ZodCheckSizeEquals>;
export interface $ZodCheckMaxLengthDef extends $ZodCheckDef {
check: "max_length";
maximum: number;
}
export interface $ZodCheckMaxLengthInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {
def: $ZodCheckMaxLengthDef;
issc: errors.$ZodIssueTooBig<T>;
}
export interface $ZodCheckMaxLength<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {
_zod: $ZodCheckMaxLengthInternals<T>;
}
export declare const $ZodCheckMaxLength: core.$constructor<$ZodCheckMaxLength>;
export interface $ZodCheckMinLengthDef extends $ZodCheckDef {
check: "min_length";
minimum: number;
}
export interface $ZodCheckMinLengthInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {
def: $ZodCheckMinLengthDef;
issc: errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckMinLength<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {
_zod: $ZodCheckMinLengthInternals<T>;
}
export declare const $ZodCheckMinLength: core.$constructor<$ZodCheckMinLength>;
export interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {
check: "length_equals";
length: number;
}
export interface $ZodCheckLengthEqualsInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {
def: $ZodCheckLengthEqualsDef;
issc: errors.$ZodIssueTooBig<T> | errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckLengthEquals<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {
_zod: $ZodCheckLengthEqualsInternals<T>;
}
export declare const $ZodCheckLengthEquals: core.$constructor<$ZodCheckLengthEquals>;
export type $ZodStringFormats = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
export interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {
check: "string_format";
format: Format;
pattern?: RegExp | undefined;
}
export interface $ZodCheckStringFormatInternals extends $ZodCheckInternals<string> {
def: $ZodCheckStringFormatDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckStringFormat extends $ZodCheck<string> {
_zod: $ZodCheckStringFormatInternals;
}
export declare const $ZodCheckStringFormat: core.$constructor<$ZodCheckStringFormat>;
export interface $ZodCheckRegexDef extends $ZodCheckStringFormatDef {
format: "regex";
pattern: RegExp;
}
export interface $ZodCheckRegexInternals extends $ZodCheckInternals<string> {
def: $ZodCheckRegexDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckRegex extends $ZodCheck<string> {
_zod: $ZodCheckRegexInternals;
}
export declare const $ZodCheckRegex: core.$constructor<$ZodCheckRegex>;
export interface $ZodCheckLowerCaseDef extends $ZodCheckStringFormatDef<"lowercase"> {
}
export interface $ZodCheckLowerCaseInternals extends $ZodCheckInternals<string> {
def: $ZodCheckLowerCaseDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckLowerCase extends $ZodCheck<string> {
_zod: $ZodCheckLowerCaseInternals;
}
export declare const $ZodCheckLowerCase: core.$constructor<$ZodCheckLowerCase>;
export interface $ZodCheckUpperCaseDef extends $ZodCheckStringFormatDef<"uppercase"> {
}
export interface $ZodCheckUpperCaseInternals extends $ZodCheckInternals<string> {
def: $ZodCheckUpperCaseDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckUpperCase extends $ZodCheck<string> {
_zod: $ZodCheckUpperCaseInternals;
}
export declare const $ZodCheckUpperCase: core.$constructor<$ZodCheckUpperCase>;
export interface $ZodCheckIncludesDef extends $ZodCheckStringFormatDef<"includes"> {
includes: string;
position?: number | undefined;
}
export interface $ZodCheckIncludesInternals extends $ZodCheckInternals<string> {
def: $ZodCheckIncludesDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckIncludes extends $ZodCheck<string> {
_zod: $ZodCheckIncludesInternals;
}
export declare const $ZodCheckIncludes: core.$constructor<$ZodCheckIncludes>;
export interface $ZodCheckStartsWithDef extends $ZodCheckStringFormatDef<"starts_with"> {
prefix: string;
}
export interface $ZodCheckStartsWithInternals extends $ZodCheckInternals<string> {
def: $ZodCheckStartsWithDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckStartsWith extends $ZodCheck<string> {
_zod: $ZodCheckStartsWithInternals;
}
export declare const $ZodCheckStartsWith: core.$constructor<$ZodCheckStartsWith>;
export interface $ZodCheckEndsWithDef extends $ZodCheckStringFormatDef<"ends_with"> {
suffix: string;
}
export interface $ZodCheckEndsWithInternals extends $ZodCheckInternals<string> {
def: $ZodCheckEndsWithDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckEndsWith extends $ZodCheckInternals<string> {
_zod: $ZodCheckEndsWithInternals;
}
export declare const $ZodCheckEndsWith: core.$constructor<$ZodCheckEndsWith>;
export interface $ZodCheckPropertyDef extends $ZodCheckDef {
check: "property";
property: string;
schema: schemas.$ZodType;
}
export interface $ZodCheckPropertyInternals<T extends object = object> extends $ZodCheckInternals<T> {
def: $ZodCheckPropertyDef;
issc: errors.$ZodIssue;
}
export interface $ZodCheckProperty<T extends object = object> extends $ZodCheck<T> {
_zod: $ZodCheckPropertyInternals<T>;
}
export declare const $ZodCheckProperty: core.$constructor<$ZodCheckProperty>;
export interface $ZodCheckMimeTypeDef extends $ZodCheckDef {
check: "mime_type";
mime: util.MimeTypes[];
}
export interface $ZodCheckMimeTypeInternals<T extends File = File> extends $ZodCheckInternals<T> {
def: $ZodCheckMimeTypeDef;
issc: errors.$ZodIssueInvalidValue;
}
export interface $ZodCheckMimeType<T extends File = File> extends $ZodCheck<T> {
_zod: $ZodCheckMimeTypeInternals<T>;
}
export declare const $ZodCheckMimeType: core.$constructor<$ZodCheckMimeType>;
export interface $ZodCheckOverwriteDef<T = unknown> extends $ZodCheckDef {
check: "overwrite";
tx(value: T): T;
}
export interface $ZodCheckOverwriteInternals<T = unknown> extends $ZodCheckInternals<T> {
def: $ZodCheckOverwriteDef<T>;
issc: never;
}
export interface $ZodCheckOverwrite<T = unknown> extends $ZodCheck<T> {
_zod: $ZodCheckOverwriteInternals<T>;
}
export declare const $ZodCheckOverwrite: core.$constructor<$ZodCheckOverwrite>;
export type $ZodChecks = $ZodCheckLessThan | $ZodCheckGreaterThan | $ZodCheckMultipleOf | $ZodCheckNumberFormat | $ZodCheckBigIntFormat | $ZodCheckMaxSize | $ZodCheckMinSize | $ZodCheckSizeEquals | $ZodCheckMaxLength | $ZodCheckMinLength | $ZodCheckLengthEquals | $ZodCheckStringFormat | $ZodCheckProperty | $ZodCheckMimeType | $ZodCheckOverwrite;
export type $ZodStringFormatChecks = $ZodCheckRegex | $ZodCheckLowerCase | $ZodCheckUpperCase | $ZodCheckIncludes | $ZodCheckStartsWith | $ZodCheckEndsWith | schemas.$ZodStringFormatTypes;
@@ -0,0 +1,250 @@
/*!
* type-is
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module dependencies.
* @private
*/
var contentType = require('content-type')
var mime = require('mime-types')
var typer = require('media-typer')
/**
* Module exports.
* @public
*/
module.exports = typeofrequest
module.exports.is = typeis
module.exports.hasBody = hasbody
module.exports.normalize = normalize
module.exports.match = mimeMatch
/**
* Compare a `value` content-type with `types`.
* Each `type` can be an extension like `html`,
* a special shortcut like `multipart` or `urlencoded`,
* or a mime type.
*
* If no types match, `false` is returned.
* Otherwise, the first `type` that matches is returned.
*
* @param {String} value
* @param {Array} types
* @public
*/
function typeis (value, types_) {
var i
var types = types_
// remove parameters and normalize
var val = tryNormalizeType(value)
// no type or invalid
if (!val) {
return false
}
// support flattened arguments
if (types && !Array.isArray(types)) {
types = new Array(arguments.length - 1)
for (i = 0; i < types.length; i++) {
types[i] = arguments[i + 1]
}
}
// no types, return the content type
if (!types || !types.length) {
return val
}
var type
for (i = 0; i < types.length; i++) {
if (mimeMatch(normalize(type = types[i]), val)) {
return type[0] === '+' || type.indexOf('*') !== -1
? val
: type
}
}
// no matches
return false
}
/**
* Check if a request has a request body.
* A request with a body __must__ either have `transfer-encoding`
* or `content-length` headers set.
* http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3
*
* @param {Object} request
* @return {Boolean}
* @public
*/
function hasbody (req) {
return req.headers['transfer-encoding'] !== undefined ||
!isNaN(req.headers['content-length'])
}
/**
* Check if the incoming request contains the "Content-Type"
* header field, and it contains any of the give mime `type`s.
* If there is no request body, `null` is returned.
* If there is no content type, `false` is returned.
* Otherwise, it returns the first `type` that matches.
*
* Examples:
*
* // With Content-Type: text/html; charset=utf-8
* this.is('html'); // => 'html'
* this.is('text/html'); // => 'text/html'
* this.is('text/*', 'application/json'); // => 'text/html'
*
* // When Content-Type is application/json
* this.is('json', 'urlencoded'); // => 'json'
* this.is('application/json'); // => 'application/json'
* this.is('html', 'application/*'); // => 'application/json'
*
* this.is('html'); // => false
*
* @param {Object} req
* @param {(String|Array)} types...
* @return {(String|false|null)}
* @public
*/
function typeofrequest (req, types_) {
// no body
if (!hasbody(req)) return null
// support flattened arguments
var types = arguments.length > 2
? Array.prototype.slice.call(arguments, 1)
: types_
// request content type
var value = req.headers['content-type']
return typeis(value, types)
}
/**
* Normalize a mime type.
* If it's a shorthand, expand it to a valid mime type.
*
* In general, you probably want:
*
* var type = is(req, ['urlencoded', 'json', 'multipart']);
*
* Then use the appropriate body parsers.
* These three are the most common request body types
* and are thus ensured to work.
*
* @param {String} type
* @return {String|false|null}
* @public
*/
function normalize (type) {
if (typeof type !== 'string') {
// invalid type
return false
}
switch (type) {
case 'urlencoded':
return 'application/x-www-form-urlencoded'
case 'multipart':
return 'multipart/*'
}
if (type[0] === '+') {
// "+json" -> "*/*+json" expando
return '*/*' + type
}
return type.indexOf('/') === -1
? mime.lookup(type)
: type
}
/**
* Check if `expected` mime type
* matches `actual` mime type with
* wildcard and +suffix support.
*
* @param {String} expected
* @param {String} actual
* @return {Boolean}
* @public
*/
function mimeMatch (expected, actual) {
// invalid type
if (expected === false) {
return false
}
// split types
var actualParts = actual.split('/')
var expectedParts = expected.split('/')
// invalid format
if (actualParts.length !== 2 || expectedParts.length !== 2) {
return false
}
// validate type
if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) {
return false
}
// validate suffix wildcard
if (expectedParts[1].slice(0, 2) === '*+') {
return expectedParts[1].length <= actualParts[1].length + 1 &&
expectedParts[1].slice(1) === actualParts[1].slice(1 - expectedParts[1].length)
}
// validate subtype
if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) {
return false
}
return true
}
/**
* Normalize a type and remove parameters.
*
* @param {string} value
* @return {(string|null)}
* @private
*/
function normalizeType (value) {
// Parse the type
var type = contentType.parse(value).type
return typer.test(type) ? type : null
}
/**
* Try to normalize a type and remove parameters.
*
* @param {string} value
* @return {(string|null)}
* @private
*/
function tryNormalizeType (value) {
try {
return value ? normalizeType(value) : null
} catch (err) {
return null
}
}
@@ -0,0 +1,3 @@
declare const EvalError: EvalErrorConstructor;
export = EvalError;
@@ -0,0 +1 @@
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,IAAkB;IAC1C,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EA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CAAC,MAAM,KAAK,QAAQ,IAAI,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACvM,CAAC;AAGD,MAAM,iBAAiB,MAAc,EAAE,MAAW;IACjD,MAAM,GAAG,GAAG,MAAa,CAAC;IAC1B,IAAI,MAAM,EAAE;QACX,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;YACzB,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;SACvB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}
@@ -0,0 +1,739 @@
flf2a$ 7 6 15 -1 24
stacey.flf (FIGlet font)
Figlet conversion by Kent Nassen, kentn@cyberspace.org, 11/24/94
From: davidstacey@BIX.com (davidstacey on BIX)
Newsgroups: alt.ascii-art
Subject: ASCII Font
Date: 16 Feb 94 04:20:45 GMT
Organization: Delphi Internet Services Corporation
Lines: 41
Message-ID: <davidstacey.761372445@BIX.com>
NNTP-Posting-Host: bix.com
Summary: Cool Ascii Font
Keywords: Ascii,Font
Status: RO
Presenting another fine colly!!
A font, use it for your adds etc.
Just don't be so lame and give the credz to the one who has earned them!!
Whirlwind Of Dutch Dreams!!!!!
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
____@
7 7@
| |@
!__!@
____@
7__7@
@@
___ ___@
7 7 7 7@
!/ !/ @
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
___@
7 7@
!/ @
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
___@
7 7@
!/ @@
@
@
@
@
@
@
@@
@
@
@
@
____@
7__7@
@@
@
@
@
@
@
@
@@
_______@
7 7@
| 7 |@
| | |@
| ! |@
!_____!@
@@
_____@
7 7@
!_ |@
7 |@
| |@
!__!@
@@
_______@
7 7@
!___ !@
| ___|@
| 7@
!_____!@
@@
_______@
7 7@
|___ !@
|__ |@
| |@
!_____!@
@@
_______@
7 7 7@
| ! |@
!___ |@
7 |@
!__!@
@@
_______@
7 ___7@
| 7@
!___ |@
7 |@
!_____!@
@@
_______@
7 7@
| ___!@
| 7@
| - |@
!_____!@
@@
_______@
7 7@
!___ |@
7 |@
| |@
!__!@
@@
_______@
7 _ 7@
!_ _!@
| |@
| - |@
!_____!@
@@
_______@
7 7@
| - |@
!___ |@
7 |@
!_____!@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
_______@
7 7@
!__! |@
!__!@
____@
7__7@
@@
@
@
@
@
@
@
@@
_______@
7 _ 7@
| _ |@
| 7 |@
| | |@
!__!__!@
@@
_______@
7 _ 7@
| __|@
| _ |@
| 7 |@
!_____!@
@@
_______@
7 7@
| ___!@
| 7___@
| 7@
!_____!@
@@
_____ @
7 \ @
| 7 |@
| | |@
| ! |@
!_____!@
@@
_______@
7 7@
| ___!@
| __|_@
| 7@
!_____!@
@@
_______@
7 7@
| ___!@
| __| @
| 7 @
!__! @
@@
_______@
7 7@
| __!@
| ! 7@
| |@
!_____!@
@@
_______@
7 7 7@
| ! |@
| |@
| 7 |@
!__!__!@
@@
____@
7 7@
| |@
| |@
| |@
!__!@
@@
____@
7 7@
___| |@
7 ! |@
| |@
!_____!@
@@
_______@
7 7 7@
| __!@
| |@
| 7 |@
!__!__!@
@@
____ @
7 7 @
| | @
| !___@
| 7@
!_____!@
@@
__________@
7 7@
| _ _ |@
| 7 7 |@
| | | |@
!__!__!__!@
@@
_______@
7 7@
| _ |@
| 7 |@
| | |@
!__!__!@
@@
_______@
7 7@
| 7 |@
| | |@
| ! |@
!_____!@
@@
_______@
7 7@
| - |@
| ___!@
| 7 @
!__! @
@@
_______ @
7 7 @
| 7 | @
| | | @
| ! |_ @
!_______!@
@@
_______@
7 _ 7@
| _|@
| _ \ @
| 7 |@
!__!__!@
@@
_______@
7 7@
| ___!@
!__ 7@
7 |@
!_____!@
@@
________@
7 7@
!__ __!@
7 7 @
| | @
!__! @
@@
_______@
7 7 7@
| | |@
| | |@
| ! |@
!_____!@
@@
___ ___@
7 V 7@
| | |@
| ! |@
| |@
!_____!@
@@
___ __ ___@
7 V V 7@
| | | |@
| ! ! |@
| |@
!________!@
@@
_______@
7 7 7@
!_ _!@
| |@
| 7 |@
!__!__!@
@@
_______@
7 7 7@
| ! |@
!_ _!@
7 7 @
!___! @
@@
_______@
7 7@
!___ |@
| __!@
| 7@
!_____!@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
___@
7 7@
\!@
@
@
@
@@
_______@
7 _ 7@
| _ |@
| 7 |@
| | |@
!__!__!@
@@
_______@
7 _ 7@
| __|@
| _ |@
| 7 |@
!_____!@
@@
_______@
7 7@
| ___!@
| 7___@
| 7@
!_____!@
@@
_____ @
7 \ @
| 7 |@
| | |@
| ! |@
!_____!@
@@
_______@
7 7@
| ___!@
| __|_@
| 7@
!_____!@
@@
_______@
7 7@
| ___!@
| __| @
| 7 @
!__! @
@@
_______@
7 7@
| __!@
| ! 7@
| |@
!_____!@
@@
_______@
7 7 7@
| ! |@
| |@
| 7 |@
!__!__!@
@@
____@
7 7@
| |@
| |@
| |@
!__!@
@@
____@
7 7@
___| |@
7 ! |@
| |@
!_____!@
@@
_______@
7 7 7@
| __!@
| |@
| 7 |@
!__!__!@
@@
____ @
7 7 @
| | @
| !___@
| 7@
!_____!@
@@
__________@
7 7@
| _ _ |@
| 7 7 |@
| | | |@
!__!__!__!@
@@
_______@
7 7@
| _ |@
| 7 |@
| | |@
!__!__!@
@@
_______@
7 7@
| 7 |@
| | |@
| ! |@
!_____!@
@@
_______@
7 7@
| - |@
| ___!@
| 7 @
!__! @
@@
_______ @
7 7 @
| 7 | @
| | | @
| ! |_ @
!_______!@
@@
_______@
7 _ 7@
| _|@
| _ \ @
| 7 |@
!__!__!@
@@
_______@
7 7@
| ___!@
!__ 7@
7 |@
!_____!@
@@
________@
7 7@
!__ __!@
7 7 @
| | @
!__! @
@@
_______@
7 7 7@
| | |@
| | |@
| ! |@
!_____!@
@@
___ ___@
7 V 7@
| | |@
| ! |@
| |@
!_____!@
@@
___ __ ___@
7 V V 7@
| | | |@
| ! ! |@
| |@
!________!@
@@
_______@
7 7 7@
!_ _!@
| |@
| 7 |@
!__!__!@
@@
_______@
7 7 7@
| ! |@
!_ _!@
7 7 @
!___! @
@@
_______@
7 7@
!___ |@
| __!@
| 7@
!_____!@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@@ -0,0 +1,23 @@
'use strict';
var $TypeError = require('es-errors/type');
var inspect = require('object-inspect');
var isPropertyKey = require('../helpers/isPropertyKey');
// var ToObject = require('./ToObject');
// https://262.ecma-international.org/6.0/#sec-getv
module.exports = function GetV(V, P) {
// 7.3.2.1
if (!isPropertyKey(P)) {
throw new $TypeError('Assertion failed: P is not a Property Key, got ' + inspect(P));
}
// 7.3.2.2-3
// var O = ToObject(V);
// 7.3.2.4
return V[P];
};
@@ -0,0 +1,30 @@
/**
* @file cvt表
* @author mengke01(kekee000@gmail.com)
*
* @reference: https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6cvt.html
*/
import table from './table';
export default table.create(
'cvt',
[],
{
read(reader, ttf) {
const length = ttf.tables.cvt.length;
return reader.readBytes(this.offset, length);
},
write(writer, ttf) {
if (ttf.cvt) {
writer.writeBytes(ttf.cvt, ttf.cvt.length);
}
},
size(ttf) {
return ttf.cvt ? ttf.cvt.length : 0;
}
}
);
@@ -0,0 +1,174 @@
#!/usr/bin/env node
// Standalone semver comparison program.
// Exits successfully and prints matching version(s) if
// any supplied version is valid and passes all tests.
var argv = process.argv.slice(2)
var versions = []
var range = []
var inc = null
var version = require('../package.json').version
var loose = false
var includePrerelease = false
var coerce = false
var rtl = false
var identifier
var semver = require('../semver')
var reverse = false
var options = {}
main()
function main () {
if (!argv.length) return help()
while (argv.length) {
var a = argv.shift()
var indexOfEqualSign = a.indexOf('=')
if (indexOfEqualSign !== -1) {
a = a.slice(0, indexOfEqualSign)
argv.unshift(a.slice(indexOfEqualSign + 1))
}
switch (a) {
case '-rv': case '-rev': case '--rev': case '--reverse':
reverse = true
break
case '-l': case '--loose':
loose = true
break
case '-p': case '--include-prerelease':
includePrerelease = true
break
case '-v': case '--version':
versions.push(argv.shift())
break
case '-i': case '--inc': case '--increment':
switch (argv[0]) {
case 'major': case 'minor': case 'patch': case 'prerelease':
case 'premajor': case 'preminor': case 'prepatch':
inc = argv.shift()
break
default:
inc = 'patch'
break
}
break
case '--preid':
identifier = argv.shift()
break
case '-r': case '--range':
range.push(argv.shift())
break
case '-c': case '--coerce':
coerce = true
break
case '--rtl':
rtl = true
break
case '--ltr':
rtl = false
break
case '-h': case '--help': case '-?':
return help()
default:
versions.push(a)
break
}
}
var options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl }
versions = versions.map(function (v) {
return coerce ? (semver.coerce(v, options) || { version: v }).version : v
}).filter(function (v) {
return semver.valid(v)
})
if (!versions.length) return fail()
if (inc && (versions.length !== 1 || range.length)) { return failInc() }
for (var i = 0, l = range.length; i < l; i++) {
versions = versions.filter(function (v) {
return semver.satisfies(v, range[i], options)
})
if (!versions.length) return fail()
}
return success(versions)
}
function failInc () {
console.error('--inc can only be used on a single version with no range')
fail()
}
function fail () { process.exit(1) }
function success () {
var compare = reverse ? 'rcompare' : 'compare'
versions.sort(function (a, b) {
return semver[compare](a, b, options)
}).map(function (v) {
return semver.clean(v, options)
}).map(function (v) {
return inc ? semver.inc(v, inc, options, identifier) : v
}).forEach(function (v, i, _) { console.log(v) })
}
function help () {
console.log(['SemVer ' + version,
'',
'A JavaScript implementation of the https://semver.org/ specification',
'Copyright Isaac Z. Schlueter',
'',
'Usage: semver [options] <version> [<version> [...]]',
'Prints valid versions sorted by SemVer precedence',
'',
'Options:',
'-r --range <range>',
' Print versions that match the specified range.',
'',
'-i --increment [<level>]',
' Increment a version by the specified level. Level can',
' be one of: major, minor, patch, premajor, preminor,',
" prepatch, or prerelease. Default level is 'patch'.",
' Only one version may be specified.',
'',
'--preid <identifier>',
' Identifier to be used to prefix premajor, preminor,',
' prepatch or prerelease version increments.',
'',
'-l --loose',
' Interpret versions and ranges loosely',
'',
'-p --include-prerelease',
' Always include prerelease versions in range matching',
'',
'-c --coerce',
' Coerce a string into SemVer if possible',
' (does not imply --loose)',
'',
'--rtl',
' Coerce version strings right to left',
'',
'--ltr',
' Coerce version strings left to right (default)',
'',
'Program exits successfully if any valid version satisfies',
'all supplied ranges, and prints all satisfying versions.',
'',
'If no satisfying versions are found, then exits failure.',
'',
'Versions are printed in ascending order, so supplying',
'multiple versions to the utility will just sort them.'
].join('\n'))
}
@@ -0,0 +1,16 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "clearCache", {
enumerable: true,
get: function get() {
return _cache.clearCache;
}
});
exports["default"] = void 0;
var _useRequest = _interopRequireDefault(require("./src/useRequest"));
var _cache = require("./src/utils/cache");
var _default = exports["default"] = _useRequest["default"];
@@ -0,0 +1,226 @@
/**
* @file svgs2ttf
* @author junmer
*/
/* eslint-env node */
var isSvg = require('is-svg');
var through = require('through2');
var path = require('path');
var replaceExt = require('replace-ext');
var ab2b = require('b3b').ab2b;
var _ = require('lodash');
var bufferToVinyl = require('buffer-to-vinyl');
var TTFWriter = require('fonteditor-core').TTFWriter;
var TTF = require('fonteditor-core').TTF;
var svg2ttfobject = require('fonteditor-core').svg2ttfobject;
var getEmptyttfObject = require('fonteditor-core/lib/ttf/getEmptyttfObject').default;
/**
* SvgFont
*
* @constructor
* @param {string} name filename
* @param {Object} opts opts
*/
function SvgFont(name, opts) {
this.opts = _.extend(
{
adjust: {
leftSideBearing: 0,
rightSideBearing: 0,
ajdustToEmBox: true,
ajdustToEmPadding: 0
},
name: {
fontFamily: name,
fontSubFamily: name,
uniqueSubFamily: name,
postScriptName: name
}
},
opts
);
// empty ttfobj
var ttfobj = getEmptyttfObject();
// for save name
ttfobj.post.format = 2;
// new TTF
this.ttf = new TTF(ttfobj);
// set name
this.ttf.setName(this.opts.name);
// unicode start
this.startCode = opts.startCode || 0xe001;
}
/**
* add svg
*
* @param {string} name svg basename
* @param {buffer} contents svg contents
*/
SvgFont.prototype.add = function (name, contents) {
var ttfObj = svg2ttfobject(
contents.toString('utf-8'),
{
combinePath: true
}
);
var glyf = ttfObj.glyf[0];
glyf.name = path.basename(name, '.svg');
if (!Array.isArray(glyf.unicode)) {
glyf.unicode = [this.startCode++];
}
this.ttf.addGlyf(glyf);
};
/**
* compile ttf contents
*
*/
SvgFont.prototype.compile = function () {
if (this.opts.adjust) {
this.ttf.adjustGlyfPos(null, this.opts.adjust);
this.ttf.adjustGlyf(null, this.opts.adjust);
}
this.contents = ab2b(
new TTFWriter(
this.opts
)
.write(
this.ttf.ttf
)
);
};
/**
* svgs2ttf fontmin plugin
*
* @param {string} file filename
* @param {Object} opts opts
* @param {string} opts.fontName font name
* @return {Object} stream.Transform instance
* @api public
*/
module.exports = function (file, opts) {
if (!file) {
throw new Error('Missing file option for fontmin-svg2ttf');
}
opts = _.extend({hinting: true}, opts);
var firstFile;
var fileName;
var svgFont;
if (typeof file === 'string') {
// fix file ext
file = replaceExt(file, '.ttf');
// set file name
fileName = file;
}
else if (typeof file.path === 'string') {
fileName = path.basename(file.path);
firstFile = bufferToVinyl.file(null, fileName);
}
else {
throw new Error('Missing path in file options for fontmin-svg2ttf');
}
function bufferContents(file, enc, cb) {
// ignore empty files
if (file.isNull()) {
cb();
return;
}
// check stream
if (file.isStream()) {
this.emit('error', new Error('Streaming not supported'));
cb();
return;
}
// check svg
if (!isSvg(file.contents)) {
cb();
return;
}
// set first file if not already set
if (!firstFile) {
firstFile = file;
}
// construct SvgFont instance
if (!svgFont) {
var fontName = opts.fontName || path.basename(fileName, '.ttf');
svgFont = new SvgFont(fontName, opts);
}
// add file to SvgFont instance
svgFont.add(file.relative, file.contents);
cb();
}
function endStream(cb) {
// no files passed in, no file goes out
if (!firstFile || !svgFont) {
cb();
return;
}
var joinedFile;
// if file opt was a file path
// clone everything from the first file
if (typeof file === 'string') {
joinedFile = firstFile.clone({
contents: false
});
joinedFile.path = path.join(firstFile.base, file);
}
else {
joinedFile = firstFile;
}
// complie svgfont
svgFont.compile();
// set contents
joinedFile.contents = svgFont.contents;
joinedFile.ttfObject = svgFont.ttf.ttf;
this.push(joinedFile);
cb();
}
return through.obj(bufferContents, endStream);
};
@@ -0,0 +1 @@
{"version":3,"file":"consistent-type-specifier-style.js","sourceRoot":"","sources":["../../src/rules/consistent-type-specifier-style.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAExD,SAAS,OAAO,CAAC,KAAqB;IACpC,OAAO,KAAK,CAAC,IAAI,KAAK,YAAY,IAAI,KAAK,CAAC,KAAK,KAAK,GAAG,CAAA;AAC3D,CAAC;AAED,SAAS,gBAAgB,CACvB,KAAyB,EACzB,KAAyB,EACzB,UAAyC,EACzC,UAAsC;IAEtC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QAEnC,MAAM,KAAK,GAAG,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC,CAAA;QACjD,IAAI,KAAK,I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UAAU;6BAC3B;4BACD,GAAG,CAAC,KAAK;gCACP,MAAM,KAAK,GAAuB,EAAE,CAAA;gCAIpC,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oCAI/B,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,CAAC,CAAA;oCAC1D,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAA;oCAS5D,MAAM,UAAU,GAAG,UAAU,CAAC,aAAa,CACzC,eAAe,CAAC,eAAe,CAAC,MAALine truncated
@@ -0,0 +1,14 @@
import { noop } from 'motion-utils';
import { attachToAnimation } from './attach-animation.mjs';
import { attachToFunction } from './attach-function.mjs';
function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) {
if (!container)
return noop;
const optionsWithDefaults = { axis, container, ...options };
return typeof onScroll === "function"
? attachToFunction(onScroll, optionsWithDefaults)
: attachToAnimation(onScroll, optionsWithDefaults);
}
export { scroll };
@@ -0,0 +1,30 @@
import { GetPacketStatusDepends } from '../../action/packet/GetPacketStatus';
import { Static } from '@sinclair/typebox';
declare const PayloadSchema: import("@sinclair/typebox").TObject<{
character: import("@sinclair/typebox").TString;
group_id: import("@sinclair/typebox").TString;
text: import("@sinclair/typebox").TString;
}>;
type PayloadType = Static<typeof PayloadSchema>;
declare const ReturnSchema: import("@sinclair/typebox").TString;
type ReturnType = Static<typeof ReturnSchema>;
export declare class GetAiRecord extends GetPacketStatusDepends<PayloadType, ReturnType> {
actionName: "get_ai_record";
payloadSchema: import("@sinclair/typebox").TObject<{
character: import("@sinclair/typebox").TString;
group_id: import("@sinclair/typebox").TString;
text: import("@sinclair/typebox").TString;
}>;
returnSchema: import("@sinclair/typebox").TString;
actionSummary: string;
actionDescription: string;
actionTags: string[];
payloadExample: {
character: string;
group_id: string;
text: string;
};
returnExample: string;
_handle(payload: PayloadType): Promise<string>;
}
export {};
@@ -0,0 +1,19 @@
/*!
* normalize-path <https://github.com/jonschlinkert/normalize-path>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
var removeTrailingSeparator = require('remove-trailing-separator');
module.exports = function normalizePath(str, stripTrailing) {
if (typeof str !== 'string') {
throw new TypeError('expected a string');
}
str = str.replace(/[\\\/]+/g, '/');
if (stripTrailing !== false) {
str = removeTrailingSeparator(str);
}
return str;
};
@@ -0,0 +1,8 @@
import type { TSESTree } from '@typescript-eslint/types';
import type { ScopeManager } from '../ScopeManager';
import type { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
export declare class ClassFieldInitializerScope extends ScopeBase<ScopeType.classFieldInitializer, TSESTree.Expression, Scope> {
constructor(scopeManager: ScopeManager, upperScope: ClassFieldInitializerScope['upper'], block: ClassFieldInitializerScope['block']);
}
@@ -0,0 +1,167 @@
"use client";
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/use-dropdown.ts
var use_dropdown_exports = {};
__export(use_dropdown_exports, {
useDropdown: () => useDropdown
});
module.exports = __toCommonJS(use_dropdown_exports);
var import_system = require("@heroui/system");
var import_menu = require("@react-stately/menu");
var import_menu2 = require("@react-aria/menu");
var import_theme = require("@heroui/theme");
var import_shared_utils = require("@heroui/shared-utils");
var import_react_utils = require("@heroui/react-utils");
var import_aria_utils = require("@heroui/aria-utils");
var import_react = require("react");
var import_utils = require("@react-aria/utils");
var getMenuItem = (props, key) => {
if (props) {
const mergedChildren = Array.isArray(props.children) ? props.children : [...(props == null ? void 0 : props.items) || []];
if (mergedChildren && mergedChildren.length) {
const item = mergedChildren.find((item2) => {
if (item2 && item2.key === key) {
return item2;
}
}) || {};
return item;
}
}
return null;
};
var getCloseOnSelect = (props, key, item) => {
const mergedItem = item || getMenuItem(props, key);
if (mergedItem && mergedItem.props && "closeOnSelect" in mergedItem.props) {
return mergedItem.props.closeOnSelect;
}
return props == null ? void 0 : props.closeOnSelect;
};
function useDropdown(props) {
var _a;
const globalContext = (0, import_system.useProviderContext)();
const {
as,
triggerRef: triggerRefProp,
isOpen,
defaultOpen,
onOpenChange,
isDisabled,
type = "menu",
trigger = "press",
placement = "bottom",
closeOnSelect = true,
shouldBlockScroll = true,
classNames: classNamesProp,
disableAnimation = (_a = globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _a : false,
onClose,
className,
...otherProps
} = props;
const Component = as || "div";
const triggerRef = (0, import_react.useRef)(null);
const menuTriggerRef = triggerRefProp || triggerRef;
const menuRef = (0, import_react.useRef)(null);
const popoverRef = (0, import_react.useRef)(null);
const state = (0, import_menu.useMenuTriggerState)({
trigger,
isOpen,
defaultOpen,
onOpenChange: (isOpen2) => {
onOpenChange == null ? void 0 : onOpenChange(isOpen2);
if (!isOpen2) {
onClose == null ? void 0 : onClose();
}
}
});
const { menuTriggerProps, menuProps } = (0, import_menu2.useMenuTrigger)(
{ type, trigger, isDisabled },
state,
menuTriggerRef
);
const classNames = (0, import_react.useMemo)(
() => (0, import_theme.dropdown)({
className
}),
[className]
);
const onMenuAction = (menuCloseOnSelect) => {
if (menuCloseOnSelect !== void 0 && !menuCloseOnSelect) {
return;
}
if (closeOnSelect) {
state.close();
}
};
const getPopoverProps = (props2 = {}) => {
const popoverProps = (0, import_utils.mergeProps)(otherProps, props2);
return {
state,
placement,
ref: popoverRef,
disableAnimation,
shouldBlockScroll,
scrollRef: menuRef,
triggerRef: menuTriggerRef,
...popoverProps,
classNames: {
...classNamesProp,
...props2.classNames,
content: (0, import_shared_utils.clsx)(classNames, classNamesProp == null ? void 0 : classNamesProp.content, props2.className)
},
shouldCloseOnInteractOutside: (popoverProps == null ? void 0 : popoverProps.shouldCloseOnInteractOutside) ? popoverProps.shouldCloseOnInteractOutside : (element) => (0, import_aria_utils.ariaShouldCloseOnInteractOutside)(element, triggerRef, state)
};
};
const getMenuTriggerProps = (originalProps = {}) => {
const { onPress, onPressStart, ...otherMenuTriggerProps } = menuTriggerProps;
return (0, import_utils.mergeProps)(otherMenuTriggerProps, { isDisabled }, originalProps);
};
const getMenuProps = (props2, _ref = null) => {
return {
ref: (0, import_react_utils.mergeRefs)(_ref, menuRef),
menuProps,
closeOnSelect,
...(0, import_utils.mergeProps)(props2, {
onAction: (key, item) => {
const closeOnSelect2 = getCloseOnSelect(props2, key, item);
onMenuAction(closeOnSelect2);
},
onClose: state.close
})
};
};
return {
Component,
menuRef,
menuProps,
classNames,
closeOnSelect,
onClose: state.close,
autoFocus: state.focusStrategy || true,
disableAnimation,
getPopoverProps,
getMenuProps,
getMenuTriggerProps
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
useDropdown
});
@@ -0,0 +1,431 @@
/**
* @file svg格式转ttfObject格式
* @author mengke01(kekee000@gmail.com)
*/
import string from '../common/string';
import DOMParser from '../common/DOMParser';
import path2contours from './svg/path2contours';
import svgnode2contours from './svg/svgnode2contours';
import {computePathBox} from '../graphics/computeBoundingBox';
import pathsUtil from '../graphics/pathsUtil';
import glyfAdjust from './util/glyfAdjust';
import error from './error';
import getEmptyttfObject from './getEmptyttfObject';
import reduceGlyf from './util/reduceGlyf';
/**
* 加载xml字符串
*
* @param {string} xml xml字符串
* @return {Document}
*/
function loadXML(xml) {
if (DOMParser) {
try {
const domParser = new DOMParser();
const xmlDoc = domParser.parseFromString(xml, 'text/xml');
return xmlDoc;
}
catch (exp) {
error.raise(10103);
}
}
error.raise(10004);
}
/**
* 对xml文本进行处理
*
* @param {string} svg svg文本
* @return {string} 处理后文本
*/
function resolveSVG(svg) {
// 去除xmlns,防止xmlns导致svg解析错误
svg = svg.replace(/\s+xmlns(?::[\w-]+)?=("|')[^"']*\1/g, ' ')
.replace(/<defs[>\s][\s\S]+?\/defs>/g, (text) => {
if (text.indexOf('</font>') >= 0) {
return text;
}
return '';
})
.replace(/<use[>\s][\s\S]+?\/use>/g, '');
return svg;
}
/**
* 获取空的ttf格式对象
*
* @return {Object} ttfObject对象
*/
function getEmptyTTF() {
const ttf = getEmptyttfObject();
ttf.head.unitsPerEm = 0; // 去除unitsPerEm以便于重新计算
ttf.from = 'svgfont';
return ttf;
}
/**
* 获取空的对象,用来作为ttf的容器
*
* @return {Object} ttfObject对象
*/
function getEmptyObject() {
return {
'from': 'svg',
'OS/2': {},
'name': {},
'hhea': {},
'head': {},
'post': {},
'glyf': []
};
}
/**
* 根据边界获取unitsPerEm
*
* @param {number} xMin x最小值
* @param {number} xMax x最大值
* @param {number} yMin y最小值
* @param {number} yMax y最大值
* @return {number}
*/
function getUnitsPerEm(xMin, xMax, yMin, yMax) {
const seed = Math.ceil(Math.min(yMax - yMin, xMax - xMin));
if (!seed) {
return 1024;
}
if (seed <= 128) {
return seed;
}
// 获取合适的unitsPerEm
let unitsPerEm = 128;
while (unitsPerEm < 16384) {
if (seed <= 1.2 * unitsPerEm) {
return unitsPerEm;
}
unitsPerEm <<= 1;
}
return 1024;
}
/**
* 对ttfObject进行处理,去除小数
*
* @param {Object} ttf ttfObject
* @return {Object} ttfObject
*/
function resolve(ttf) {
// 如果是svg格式字体,则去小数
// 由于svg格式导入时候会出现字形重复问题,这里进行优化
if (ttf.from === 'svgfont' && ttf.head.unitsPerEm > 128) {
ttf.glyf.forEach((g) => {
if (g.contours) {
glyfAdjust(g);
reduceGlyf(g);
}
});
}
// 否则重新计算字形大小,缩放到1024的em
else {
let xMin = 16384;
let xMax = -16384;
let yMin = 16384;
let yMax = -16384;
ttf.glyf.forEach((g) => {
if (g.contours) {
const bound = computePathBox(...g.contours);
if (bound) {
xMin = Math.min(xMin, bound.x);
xMax = Math.max(xMax, bound.x + bound.width);
yMin = Math.min(yMin, bound.y);
yMax = Math.max(yMax, bound.y + bound.height);
}
}
});
const unitsPerEm = getUnitsPerEm(xMin, xMax, yMin, yMax);
const scale = 1024 / unitsPerEm;
ttf.glyf.forEach((g) => {
glyfAdjust(g, scale, scale);
reduceGlyf(g);
});
ttf.head.unitsPerEm = 1024;
}
return ttf;
}
/**
* 解析字体信息相关节点
*
* @param {Document} xmlDoc XML文档对象
* @param {Object} ttf ttf对象
* @return {Object} ttf对象
*/
function parseFont(xmlDoc, ttf) {
const metaNode = xmlDoc.getElementsByTagName('metadata')[0];
const fontNode = xmlDoc.getElementsByTagName('font')[0];
const fontFaceNode = xmlDoc.getElementsByTagName('font-face')[0];
if (metaNode && metaNode.textContent) {
ttf.metadata = string.decodeHTML(metaNode.textContent.trim());
}
// 解析font,如果有font节点说明是svg格式字体文件
if (fontNode) {
ttf.id = fontNode.getAttribute('id') || '';
ttf.hhea.advanceWidthMax = +(fontNode.getAttribute('horiz-adv-x') || 0);
ttf.from = 'svgfont';
}
if (fontFaceNode) {
const OS2 = ttf['OS/2'];
ttf.name.fontFamily = fontFaceNode.getAttribute('font-family') || '';
OS2.usWeightClass = +(fontFaceNode.getAttribute('font-weight') || 0);
ttf.head.unitsPerEm = +(fontFaceNode.getAttribute('units-per-em') || 0);
// 解析panose, eg: 2 0 6 3 0 0 0 0 0 0
const panose = (fontFaceNode.getAttribute('panose-1') || '').split(' ');
[
'bFamilyType', 'bSerifStyle', 'bWeight', 'bProportion', 'bContrast',
'bStrokeVariation', 'bArmStyle', 'bLetterform', 'bMidline', 'bXHeight'
].forEach((name, i) => {
OS2[name] = +(panose[i] || 0);
});
ttf.hhea.ascent = +(fontFaceNode.getAttribute('ascent') || 0);
ttf.hhea.descent = +(fontFaceNode.getAttribute('descent') || 0);
OS2.bXHeight = +(fontFaceNode.getAttribute('x-height') || 0);
// 解析bounding
const box = (fontFaceNode.getAttribute('bbox') || '').split(' ');
['xMin', 'yMin', 'xMax', 'yMax'].forEach((name, i) => {
ttf.head[name] = +(box[i] || '');
});
ttf.post.underlineThickness = +(fontFaceNode.getAttribute('underline-thickness') || 0);
ttf.post.underlinePosition = +(fontFaceNode.getAttribute('underline-position') || 0);
// unicode range
const unicodeRange = fontFaceNode.getAttribute('unicode-range');
if (unicodeRange) {
unicodeRange.replace(/u\+([0-9A-Z]+)(-[0-9A-Z]+)?/i, ($0, a, b) => {
OS2.usFirstCharIndex = Number('0x' + a);
OS2.usLastCharIndex = b ? Number('0x' + b.slice(1)) : 0xFFFFFFFF;
});
}
}
return ttf;
}
/**
* 解析字体信息相关节点
*
* @param {Document} xmlDoc XML文档对象
* @param {Object} ttf ttf对象
* @return {Object} ttf对象
*/
function parseGlyf(xmlDoc, ttf) {
const missingNode = xmlDoc.getElementsByTagName('missing-glyph')[0];
// 解析glyf
let d;
let unicode;
if (missingNode) {
const missing = {
name: '.notdef'
};
if (missingNode.getAttribute('horiz-adv-x')) {
missing.advanceWidth = +missingNode.getAttribute('horiz-adv-x');
}
if ((d = missingNode.getAttribute('d'))) {
missing.contours = path2contours(d);
}
// 去除默认的空字形
if (ttf.glyf[0] && ttf.glyf[0].name === '.notdef') {
ttf.glyf.splice(0, 1);
}
ttf.glyf.unshift(missing);
}
const glyfNodes = xmlDoc.getElementsByTagName('glyph');
if (glyfNodes.length) {
for (let i = 0, l = glyfNodes.length; i < l; i++) {
const node = glyfNodes[i];
const glyf = {
name: node.getAttribute('glyph-name') || node.getAttribute('name') || ''
};
if (node.getAttribute('horiz-adv-x')) {
glyf.advanceWidth = +node.getAttribute('horiz-adv-x');
}
if ((unicode = node.getAttribute('unicode'))) {
const nextUnicode = [];
let totalCodePoints = 0;
for (let ui = 0; ui < unicode.length; ui++) {
const ucp = unicode.codePointAt(ui);
nextUnicode.push(ucp);
ui = ucp > 0xffff ? ui + 1 : ui;
totalCodePoints += 1;
}
if (totalCodePoints === 1) {
// TTF can't handle ligatures
glyf.unicode = nextUnicode;
if ((d = node.getAttribute('d'))) {
glyf.contours = path2contours(d);
}
ttf.glyf.push(glyf);
}
}
}
}
return ttf;
}
/**
* 解析字体信息相关节点
*
* @param {Document} xmlDoc XML文档对象
* @param {Object} ttf ttf对象
*/
function parsePath(xmlDoc, ttf) {
// 单个path组成一个glfy字形
let contours;
let glyf;
let node;
const pathNodes = xmlDoc.getElementsByTagName('path');
if (pathNodes.length) {
for (let i = 0, l = pathNodes.length; i < l; i++) {
node = pathNodes[i];
glyf = {
name: node.getAttribute('name') || ''
};
contours = svgnode2contours([node]);
glyf.contours = contours;
ttf.glyf.push(glyf);
}
}
// 其他svg指令组成一个glyf字形
contours = svgnode2contours(
Array.prototype.slice.call(xmlDoc.getElementsByTagName('*')).filter((node) => node.tagName !== 'path')
);
if (contours) {
glyf = {
name: ''
};
glyf.contours = contours;
ttf.glyf.push(glyf);
}
}
/**
* 解析xml文档
*
* @param {Document} xmlDoc XML文档对象
* @param {Object} options 导入选项
*
* @return {Object} 解析后对象
*/
function parseXML(xmlDoc, options) {
if (!xmlDoc.getElementsByTagName('svg').length) {
error.raise(10106);
}
let ttf;
// 如果是svg字体格式,则解析glyf,否则解析path
if (xmlDoc.getElementsByTagName('font')[0]) {
ttf = getEmptyTTF();
parseFont(xmlDoc, ttf);
parseGlyf(xmlDoc, ttf);
}
else {
ttf = getEmptyObject();
parsePath(xmlDoc, ttf);
}
if (!ttf.glyf.length) {
error.raise(10201);
}
if (ttf.from === 'svg') {
const glyf = ttf.glyf;
let i;
let l;
// 合并导入的字形为单个字形
if (options.combinePath) {
const combined = [];
for (i = 0, l = glyf.length; i < l; i++) {
const contours = glyf[i].contours;
for (let index = 0, length = contours.length; index < length; index++) {
combined.push(contours[index]);
}
}
glyf[0].contours = combined;
glyf.splice(1);
}
// 对字形进行反转
for (i = 0, l = glyf.length; i < l; i++) {
// 这里为了使ai等工具里面的字形方便导入,对svg做了反向处理
glyf[i].contours = pathsUtil.flip(glyf[i].contours);
}
}
return ttf;
}
/**
* svg格式转ttfObject格式
*
* @param {string|Document} svg svg格式
* @param {Object=} options 导入选项
* @param {boolean} options.combinePath 是否合并成单个字形,仅限于普通svg导入
* @return {Object} ttfObject
*/
export default function svg2ttfObject(svg, options = {combinePath: false}) {
let xmlDoc = svg;
if (typeof svg === 'string') {
svg = resolveSVG(svg);
xmlDoc = loadXML(svg);
}
const ttf = parseXML(xmlDoc, options);
return resolve(ttf);
}
@@ -0,0 +1,23 @@
'use strict'
const { createFile, createFileSync } = require('./file')
const { createLink, createLinkSync } = require('./link')
const { createSymlink, createSymlinkSync } = require('./symlink')
module.exports = {
// file
createFile,
createFileSync,
ensureFile: createFile,
ensureFileSync: createFileSync,
// link
createLink,
createLinkSync,
ensureLink: createLink,
ensureLinkSync: createLinkSync,
// symlink
createSymlink,
createSymlinkSync,
ensureSymlink: createSymlink,
ensureSymlinkSync: createSymlinkSync
}
@@ -0,0 +1,162 @@
import { describe, it, expect } from "vitest";
import { Tokenizer } from "./index.js";
import type { Callbacks } from "./Tokenizer.js";
function tokenize(data: string, options = {}) {
const log: unknown[][] = [];
const tokenizer = new Tokenizer(
options,
new Proxy(
{},
{
get(_, property) {
return (...values: unknown[]) =>
log.push([property, ...values]);
},
},
) as Callbacks,
);
tokenizer.write(data);
tokenizer.end();
return log;
}
describe("Tokenizer", () => {
describe("should support self-closing special tags", () => {
it("for self-closing script tag", () => {
expect(tokenize("<script /><div></div>")).toMatchSnapshot();
});
it("for self-closing style tag", () => {
expect(tokenize("<style /><div></div>")).toMatchSnapshot();
});
it("for self-closing title tag", () => {
expect(tokenize("<title /><div></div>")).toMatchSnapshot();
});
it("for self-closing textarea tag", () => {
expect(tokenize("<textarea /><div></div>")).toMatchSnapshot();
});
it("for self-closing xmp tag", () => {
expect(tokenize("<xmp /><div></div>")).toMatchSnapshot();
});
});
describe("should support standard special tags", () => {
it("for normal script tag", () => {
expect(tokenize("<script></script><div></div>")).toMatchSnapshot();
});
it("for normal style tag", () => {
expect(tokenize("<style></style><div></div>")).toMatchSnapshot();
});
it("for normal sitle tag", () => {
expect(tokenize("<title></title><div></div>")).toMatchSnapshot();
});
it("for normal textarea tag", () => {
expect(
tokenize("<textarea></textarea><div></div>"),
).toMatchSnapshot();
});
it("for normal xmp tag", () => {
expect(tokenize("<xmp></xmp><div></div>")).toMatchSnapshot();
});
});
describe("should treat html inside special tags as text", () => {
it("for div inside script tag", () => {
expect(tokenize("<script><div></div></script>")).toMatchSnapshot();
});
it("for div inside style tag", () => {
expect(tokenize("<style><div></div></style>")).toMatchSnapshot();
});
it("for div inside title tag", () => {
expect(tokenize("<title><div></div></title>")).toMatchSnapshot();
});
it("for div inside textarea tag", () => {
expect(
tokenize("<textarea><div></div></textarea>"),
).toMatchSnapshot();
});
it("for div inside xmp tag", () => {
expect(tokenize("<xmp><div></div></xmp>")).toMatchSnapshot();
});
});
describe("should correctly mark attributes", () => {
it("for no value attribute", () => {
expect(tokenize("<div aaaaaaa >")).toMatchSnapshot();
});
it("for no quotes attribute", () => {
expect(tokenize("<div aaa=aaa >")).toMatchSnapshot();
});
it("for single quotes attribute", () => {
expect(tokenize("<div aaa='a' >")).toMatchSnapshot();
});
it("for double quotes attribute", () => {
expect(tokenize('<div aaa="a" >')).toMatchSnapshot();
});
});
describe("should not break after special tag followed by an entity", () => {
it("for normal special tag", () => {
expect(tokenize("<style>a{}</style>&apos;<br/>")).toMatchSnapshot();
});
it("for self-closing special tag", () => {
expect(tokenize("<style />&apos;<br/>")).toMatchSnapshot();
});
});
describe("should handle entities", () => {
it("for XML entities", () =>
expect(
tokenize("&amp;&gt;&amp&lt;&uuml;&#x61;&#x62&#99;&#100&#101", {
xmlMode: true,
}),
).toMatchSnapshot());
it("for entities in attributes (#276)", () =>
expect(
tokenize(
'<img src="?&image_uri=1&&image;=2&image=3"/>?&image_uri=1&&image;=2&image=3',
),
).toMatchSnapshot());
it("for trailing legacy entity", () =>
expect(tokenize("&timesbar;&timesbar")).toMatchSnapshot());
it("for multi-byte entities", () =>
expect(tokenize("&NotGreaterFullEqual;")).toMatchSnapshot());
});
it("should not lose data when pausing", () => {
const log: unknown[][] = [];
const tokenizer = new Tokenizer(
{},
new Proxy(
{},
{
get(_, property) {
return (...values: unknown[]) => {
if (property === "ontext") {
tokenizer.pause();
}
log.push([property, ...values]);
};
},
},
) as Callbacks,
);
tokenizer.write("&am");
tokenizer.write("p; it up!");
tokenizer.resume();
tokenizer.resume();
// Tokenizer shouldn't be paused
expect(tokenizer).toHaveProperty("running", true);
tokenizer.end();
expect(log).toMatchSnapshot();
});
});
@@ -0,0 +1,262 @@
'use strict';
var test = require('tape');
var inspect = require('object-inspect');
var SaferBuffer = require('safer-buffer').Buffer;
var forEach = require('for-each');
var v = require('es-value-fixtures');
var utils = require('../lib/utils');
test('merge()', function (t) {
t.deepEqual(utils.merge(null, true), [null, true], 'merges true into null');
t.deepEqual(utils.merge(null, [42]), [null, 42], 'merges null into an array');
t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key');
var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } });
t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array');
var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } });
t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array');
var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' });
t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array');
var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] });
t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] });
var noOptionsNonObjectSource = utils.merge({ foo: 'baz' }, 'bar');
t.deepEqual(noOptionsNonObjectSource, { foo: 'baz', bar: true });
var func = function f() {};
t.deepEqual(
utils.merge(func, { foo: 'bar' }),
[func, { foo: 'bar' }],
'functions can not be merged into'
);
func.bar = 'baz';
t.deepEqual(
utils.merge({ foo: 'bar' }, func),
{ foo: 'bar', bar: 'baz' },
'functions can be merge sources'
);
t.test(
'avoids invoking array setters unnecessarily',
{ skip: typeof Object.defineProperty !== 'function' },
function (st) {
var setCount = 0;
var getCount = 0;
var observed = [];
Object.defineProperty(observed, 0, {
get: function () {
getCount += 1;
return { bar: 'baz' };
},
set: function () { setCount += 1; }
});
utils.merge(observed, [null]);
st.equal(setCount, 0);
st.equal(getCount, 1);
observed[0] = observed[0]; // eslint-disable-line no-self-assign
st.equal(setCount, 1);
st.equal(getCount, 2);
st.end();
}
);
t.end();
});
test('assign()', function (t) {
var target = { a: 1, b: 2 };
var source = { b: 3, c: 4 };
var result = utils.assign(target, source);
t.equal(result, target, 'returns the target');
t.deepEqual(target, { a: 1, b: 3, c: 4 }, 'target and source are merged');
t.deepEqual(source, { b: 3, c: 4 }, 'source is untouched');
t.end();
});
test('combine()', function (t) {
t.test('both arrays', function (st) {
var a = [1];
var b = [2];
var combined = utils.combine(a, b);
st.deepEqual(a, [1], 'a is not mutated');
st.deepEqual(b, [2], 'b is not mutated');
st.notEqual(a, combined, 'a !== combined');
st.notEqual(b, combined, 'b !== combined');
st.deepEqual(combined, [1, 2], 'combined is a + b');
st.end();
});
t.test('one array, one non-array', function (st) {
var aN = 1;
var a = [aN];
var bN = 2;
var b = [bN];
var combinedAnB = utils.combine(aN, b);
st.deepEqual(b, [bN], 'b is not mutated');
st.notEqual(aN, combinedAnB, 'aN + b !== aN');
st.notEqual(a, combinedAnB, 'aN + b !== a');
st.notEqual(bN, combinedAnB, 'aN + b !== bN');
st.notEqual(b, combinedAnB, 'aN + b !== b');
st.deepEqual([1, 2], combinedAnB, 'first argument is array-wrapped when not an array');
var combinedABn = utils.combine(a, bN);
st.deepEqual(a, [aN], 'a is not mutated');
st.notEqual(aN, combinedABn, 'a + bN !== aN');
st.notEqual(a, combinedABn, 'a + bN !== a');
st.notEqual(bN, combinedABn, 'a + bN !== bN');
st.notEqual(b, combinedABn, 'a + bN !== b');
st.deepEqual([1, 2], combinedABn, 'second argument is array-wrapped when not an array');
st.end();
});
t.test('neither is an array', function (st) {
var combined = utils.combine(1, 2);
st.notEqual(1, combined, '1 + 2 !== 1');
st.notEqual(2, combined, '1 + 2 !== 2');
st.deepEqual([1, 2], combined, 'both arguments are array-wrapped when not an array');
st.end();
});
t.end();
});
test('decode', function (t) {
t.equal(
utils.decode('a+b'),
'a b',
'decodes + to space'
);
t.equal(
utils.decode('name%2Eobj'),
'name.obj',
'decodes a string'
);
t.equal(
utils.decode('name%2Eobj%2Efoo', null, 'iso-8859-1'),
'name.obj.foo',
'decodes a string in iso-8859-1'
);
t.end();
});
test('encode', function (t) {
forEach(v.nullPrimitives, function (nullish) {
t['throws'](
function () { utils.encode(nullish); },
TypeError,
inspect(nullish) + ' is not a string'
);
});
t.equal(utils.encode(''), '', 'empty string returns itself');
t.deepEqual(utils.encode([]), [], 'empty array returns itself');
t.deepEqual(utils.encode({ length: 0 }), { length: 0 }, 'empty arraylike returns itself');
t.test('symbols', { skip: !v.hasSymbols }, function (st) {
st.equal(utils.encode(Symbol('x')), 'Symbol%28x%29', 'symbol is encoded');
st.end();
});
t.equal(
utils.encode('(abc)'),
'%28abc%29',
'encodes parentheses'
);
t.equal(
utils.encode({ toString: function () { return '(abc)'; } }),
'%28abc%29',
'toStrings and encodes parentheses'
);
t.equal(
utils.encode('abc 123 💩', null, 'iso-8859-1'),
'abc%20123%20%26%2355357%3B%26%2356489%3B',
'encodes in iso-8859-1'
);
var longString = '';
var expectedString = '';
for (var i = 0; i < 1500; i++) {
longString += ' ';
expectedString += '%20';
}
t.equal(
utils.encode(longString),
expectedString,
'encodes a long string'
);
t.equal(
utils.encode('\x28\x29'),
'%28%29',
'encodes parens normally'
);
t.equal(
utils.encode('\x28\x29', null, null, null, 'RFC1738'),
'()',
'does not encode parens in RFC1738'
);
// todo RFC1738 format
t.equal(
utils.encode('Āက豈'),
'%C4%80%E1%80%80%EF%A4%80',
'encodes multibyte chars'
);
t.equal(
utils.encode('\uD83D \uDCA9'),
'%F0%9F%90%A0%F0%BA%90%80',
'encodes lone surrogates'
);
t.end();
});
test('isBuffer()', function (t) {
forEach([null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], function () {}, /a/g], function (x) {
t.equal(utils.isBuffer(x), false, inspect(x) + ' is not a buffer');
});
var fakeBuffer = { constructor: Buffer };
t.equal(utils.isBuffer(fakeBuffer), false, 'fake buffer is not a buffer');
var saferBuffer = SaferBuffer.from('abc');
t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer');
var buffer = Buffer.from && Buffer.alloc ? Buffer.from('abc') : new Buffer('abc');
t.equal(utils.isBuffer(buffer), true, 'real Buffer instance is a buffer');
t.end();
});
test('isRegExp()', function (t) {
t.equal(utils.isRegExp(/a/g), true, 'RegExp is a RegExp');
t.equal(utils.isRegExp(new RegExp('a', 'g')), true, 'new RegExp is a RegExp');
t.equal(utils.isRegExp(new Date()), false, 'Date is not a RegExp');
forEach(v.primitives, function (primitive) {
t.equal(utils.isRegExp(primitive), false, inspect(primitive) + ' is not a RegExp');
});
t.end();
});
@@ -0,0 +1,827 @@
export default `flf2a$ 8 6 15 -1 9
nancyj-underlined.flf
named after the login of a woman who asked me to make her a
sig. this is the font that came out of it. this is my first
attempt at a figlet font, so leave me alone.
vampyr@acs.bu.edu
$$ @
$$ @
$$ @
$$ @
$$ @
$$ @
ooo@
$$ @@
dP @
88 @
88 @
dP @
@
oo @
ooo@
@@
dP dP @
dP dP @
@
@
@
@
oooooo@
@@
@
dP dP @
8888888 @
88 88 @
8888888 @
dP dP @
oooooooo@
@@
# # @
.d8888P' @
Y8#oo#o. @
# #88 @
\`88888P' @
# # @
ooooooooo@
@@
d8P dP @
8 8 d8' @
Y8P d8' @
d8' d8P @
d8' 8 8 @
88 Y8P @
ooooooooooo@
@@
d88b @
8\`'8 @
d8b @
d8P\`8b @
d8' \`8bP @
\`888P'\`YP @
ooooooooooo@
@@
d8 @
88 @
.P @
@
@
@
ooo@
@@
a88P @
d8' @
88 @
88 @
Y8. @
Y88b @
oooooo@
@@
Y88o @
\`8b @
88 @
88 @
.8P @
d88Y @
oooooo@
@@
dP @
8b. 88 .d8 @
\`8b88d8' @
.8P88Y8. @
8P' 88 \`Y8 @
dP @
ooooooooooo@
@@
@
dP @
88 @
88888888 @
88 @
dP @
ooooooooo@
@@
@
@
@
@
dP @
88 @
~.P~@
@@
@
@
@
88888888 @
@
@
ooooooooo@
@@
@
@
@
@
dP @
88 @
ooo@
@@
d8' @
d8' @
d8' @
d8' @
d8' @
88 @
ooooooooo@
@@
a8888a @
d8' ..8b @
88 .P 88 @
88 d' 88 @
Y8'' .8P @
Y8888P @
ooooooooo@
@@
d88 @
88 @
88 @
88 @
88 @
d88P @
ooooo@
@@
d8888b. @
\`88 @
.aaadP' @
88' @
88. @
Y88888P @
oooooooo@
@@
d8888b. @
\`88 @
aaad8' @
\`88 @
.88 @
d88888P @
oooooooo@
@@
dP dP @
88 88 @
88aaa88 @
88 @
88 @
dP @
oooooooo@
@@
888888P @
88' @
88baaa. @
\`88 @
88 @
d88888P @
oooooooo@
@@
.d8888P @
88' @
88baaa. @
88\` \`88 @
8b. .d8 @
\`Y888P' @
oooooooo@
@@
d88888P @
d8' @
d8' @
d8' @
d8' @
d8' @
oooooooo@
@@
.d888b. @
Y8' \`8P @
d8bad8b @
88\` \`88 @
8b. .88 @
Y88888P @
oooooooo@
@@
.d888b. @
Y8' \`88 @
\`8bad88 @
\`88 @
d. .88 @
\`8888P @
oooooooo@
@@
dP @
88 @
@
@
dP @
88 @
ooo@
@@
dP @
88 @
@
@
dP @
88 @
~.P~@
@@
d8 @
d8' @
d8' @
Y8. @
Y8. @
Y8 @
oooooo@
@@
@
@
aaaaaaaa @
@
88888888 @
@
ooooooooo@
@@
8b @
\`8b @
\`8b @
.8P @
.8P @
8P @
ooooo@
@@
.d8888ba @
\`8' \`8b @
.d8' @
d8P' @
"" @
oo @
oooooooooo@
@@
a88888b. @
d8' \`88 @
88 d8P 88 @
88 Yo8b88 @
Y8. @
Y88888P' @
oooooooooo@
@@
.d888888 @
d8' 88 @
88aaaaa88a @
88 88 @
88 88 @
88 88 @
ooooooooooo@
@@
888888ba @
88 \`8b @
a88aaaa8P' @
88 \`8b. @
88 .88 @
88888888P @
ooooooooooo@
@@
a88888b. @
d8' \`88 @
88 @
88 @
Y8. .88 @
Y88888P' @
oooooooooo@
@@
888888ba @
88 \`8b @
88 88 @
88 88 @
88 .8P @
8888888P @
oooooooooo@
@@
88888888b @
88 @
a88aaaa @
88 @
88 @
88888888P @
ooooooooooo@
@@
88888888b @
88 @
a88aaaa @
88 @
88 @
dP @
ooooooooooo@
@@
.88888. @
d8' \`88 @
88 @
88 YP88 @
Y8. .88 @
\`88888' @
oooooooooo@
@@
dP dP @
88 88 @
88aaaaa88a @
88 88 @
88 88 @
dP dP @
ooooooooooo@
@@
dP @
88 @
88 @
88 @
88 @
dP @
ooo@
@@
dP @
88 @
88 @
88 @
88. .d8P @
\`Y8888' @
oooooooooo@
@@
dP dP @
88 .d8' @
88aaa8P' @
88 \`8b. @
88 88 @
dP dP @
oooooooooo@
@@
dP @
88 @
88 @
88 @
88 @
88888888P @
oooooooooo@
@@
8888ba.88ba @
88 \`8b \`8b @
88 88 88 @
88 88 88 @
88 88 88 @
dP dP dP @
ooooooooooooo@
@@
888888ba @
88 \`8b @
88 88 @
88 88 @
88 88 @
dP dP @
oooooooooo@
@@
.88888. @
d8' \`8b @
88 88 @
88 88 @
Y8. .8P @
\`8888P' @
oooooooooo@
@@
888888ba @
88 \`8b @
a88aaaa8P' @
88 @
88 @
dP @
ooooooooooo@
@@
.88888. @
d8' \`8b @
88 88 @
88 db 88 @
Y8. Y88P @
\`8888PY8b @
ooooooooooo@
@@
888888ba @
88 \`8b @
a88aaaa8P' @
88 \`8b. @
88 88 @
dP dP @
ooooooooooo@
@@
.d88888b @
88. "' @
\`Y88888b. @
\`8b @
d8' .8P @
Y88888P @
oooooooooo@
@@
d888888P @
88 @
88 @
88 @
88 @
dP @
ooooooooo@
@@
dP dP @
88 88 @
88 88 @
88 88 @
Y8. .8P @
\`Y88888P' @
oooooooooo@
@@
dP dP @
88 88 @
88 .8P @
88 d8' @
88 .d8P @
888888' @
oooooooooo@
@@
dP dP dP @
88 88 88 @
88 .8P .8P @
88 d8' d8' @
88.d8P8.d8P @
8888' Y88' @
ooooooooooooo@
@@
dP dP @
Y8. .8P @
Y8aa8P @
d8' \`8b @
88 88 @
dP dP @
ooooooooo@
@@
dP dP @
Y8. .8P @
Y8aa8P @
88 @
88 @
dP @
ooooooooo@
@@
d8888888P @
.d8' @
.d8' @
.d8' @
d8' @
Y8888888P @
oooooooooo@
@@
8888P @
88 @
88 @
88 @
88 @
88888 @
oooooo@
@@
Yb @
\`Yb @
\`Yb @
\`Yb @
\`Yb @
88 @
oooooooo@
@@
d8888 @
88 @
88 @
88 @
88 @
88888 @
oooooo@
@@
db @
d8'\`8b @
\`" "' @
@
@
@
ooooooooo@
@@
@
@
@
@
@
@
vvvvvvvvvvv @
""""""""""" @@
dP @
88 @
Y. @
@
@
@
ooo@
@@
@
@
.d8888b. @
88' \`88 @
88. .88 @
\`88888P8 @
ooooooooo@
@@
dP @
88 @
88d888b. @
88' \`88 @
88. .88 @
88Y8888' @
ooooooooo@
@@
@
@
.d8888b. @
88' \`"" @
88. ... @
\`88888P' @
ooooooooo@
@@
dP @
88 @
.d888b88 @
88' \`88 @
88. .88 @
\`88888P8 @
ooooooooo@
@@
@
@
.d8888b. @
88ooood8 @
88. ... @
\`88888P' @
ooooooooo@
@@
.8888b @
88 " @
88aaa @
88 @
88 @
dP @
ooooooo@
@@
@
@
.d8888b. @
88' \`88 @
88. .88 @
\`8888P88 @
o~~~~.88~@
d8888P @@
dP @
88 @
88d888b. @
88' \`88 @
88 88 @
dP dP @
ooooooooo@
@@
oo @
@
dP @
88 @
88 @
dP @
ooo@
@@
oo @
@
dP @
88 @
88 @
88 @
88~@
dP @@
dP @
88 @
88 .dP @
88888" @
88 \`8b. @
dP \`YP @
ooooooooo@
@@
dP @
88 @
88 @
88 @
88 @
dP @
ooo@
@@
@
@
88d8b.d8b. @
88'\`88'\`88 @
88 88 88 @
dP dP dP @
ooooooooooo@
@@
@
@
88d888b. @
88' \`88 @
88 88 @
dP dP @
ooooooooo@
@@
@
@
.d8888b. @
88' \`88 @
88. .88 @
\`88888P' @
ooooooooo@
@@
@
@
88d888b. @
88' \`88 @
88. .88 @
88Y888P' @
~88~oooooo@
dP @@
@
@
.d8888b. @
88' \`88 @
88. .88 @
\`8888P88 @
ooooo~88~@
dP @@
@
@
88d888b. @
88' \`88 @
88 @
dP @
ooooooooo@
@@
@
@
.d8888b. @
Y8ooooo. @
88 @
\`88888P' @
ooooooooo@
@@
dP @
88 @
d8888P @
88 @
88 @
dP @
ooooooo@
@@
@
@
dP dP @
88 88 @
88. .88 @
\`88888P' @
ooooooooo@
@@
@
@
dP .dP @
88 d8' @
88 .88' @
8888P' @
ooooooooo@
@@
@
@
dP dP dP @
88 88 88 @
88.88b.88' @
8888P Y8P @
ooooooooooo@
@@
@
@
dP. .dP @
\`8bd8' @
.d88b. @
dP' \`dP @
ooooooooo@
@@
@
@
dP dP @
88 88 @
88. .88 @
\`8888P88 @
o~~~~.88~@
d8888P @@
@
@
d888888b @
.d8P' @
.Y8P @
d888888P @
ooooooooo@
@@
.d88P @
8: @
.oY8. @
d8 @
8: @
\`Y88b @
oooooooo@
@@
dP @
88 @
"' @
dP @
88 @
"' @
ooo@
@@
d88b. @
:8 @
.8Yo. @
8b @
:8 @
Y88P' @
oooooooo@
@@
.oo. .d @
dP" "d8P @
@
@
@
@
oooooooooo@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,728 @@
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
// src/query/react/rtkqImports.ts
import { buildCreateApi, coreModule, copyWithStructuralSharing, setupListeners, QueryStatus, skipToken } from "@reduxjs/toolkit/query";
// src/query/react/module.ts
import { formatProdErrorMessage as _formatProdErrorMessage3 } from "@reduxjs/toolkit";
import { batch as rrBatch, useDispatch as rrUseDispatch, useSelector as rrUseSelector, useStore as rrUseStore } from "react-redux";
import { createSelector as _createSelector } from "reselect";
// src/query/utils/capitalize.ts
function capitalize(str) {
return str.replace(str[0], str[0].toUpperCase());
}
// src/query/utils/countObjectKeys.ts
function countObjectKeys(obj) {
let count = 0;
for (const _key in obj) {
count++;
}
return count;
}
// src/query/endpointDefinitions.ts
var ENDPOINT_QUERY = "query" /* query */;
var ENDPOINT_MUTATION = "mutation" /* mutation */;
var ENDPOINT_INFINITEQUERY = "infinitequery" /* infinitequery */;
function isQueryDefinition(e) {
return e.type === ENDPOINT_QUERY;
}
function isMutationDefinition(e) {
return e.type === ENDPOINT_MUTATION;
}
function isInfiniteQueryDefinition(e) {
return e.type === ENDPOINT_INFINITEQUERY;
}
// src/query/tsHelpers.ts
function safeAssign(target, ...args) {
return Object.assign(target, ...args);
}
// src/query/react/buildHooks.ts
import { formatProdErrorMessage as _formatProdErrorMessage, formatProdErrorMessage as _formatProdErrorMessage2 } from "@reduxjs/toolkit";
// src/query/react/reactImports.ts
import { useEffect, useRef, useMemo, useContext, useCallback, useDebugValue, useLayoutEffect, useState } from "react";
// src/query/react/reactReduxImports.ts
import { shallowEqual, Provider, ReactReduxContext } from "react-redux";
// src/query/react/constants.ts
var UNINITIALIZED_VALUE = Symbol();
// src/query/react/useSerializedStableValue.ts
function useStableQueryArgs(queryArgs) {
const cache = useRef(queryArgs);
const copy = useMemo(() => copyWithStructuralSharing(cache.current, queryArgs), [queryArgs]);
useEffect(() => {
if (cache.current !== copy) {
cache.current = copy;
}
}, [copy]);
return copy;
}
// src/query/react/useShallowStableValue.ts
function useShallowStableValue(value) {
const cache = useRef(value);
useEffect(() => {
if (!shallowEqual(cache.current, value)) {
cache.current = value;
}
}, [value]);
return shallowEqual(cache.current, value) ? cache.current : value;
}
// src/query/react/buildHooks.ts
var canUseDOM = () => !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
var isDOM = /* @__PURE__ */ canUseDOM();
var isRunningInReactNative = () => typeof navigator !== "undefined" && navigator.product === "ReactNative";
var isReactNative = /* @__PURE__ */ isRunningInReactNative();
var getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? useLayoutEffect : useEffect;
var useIsomorphicLayoutEffect = /* @__PURE__ */ getUseIsomorphicLayoutEffect();
var noPendingQueryStateSelector = (selected) => {
if (selected.isUninitialized) {
return __spreadProps(__spreadValues({}, selected), {
isUninitialized: false,
isFetching: true,
isLoading: selected.data !== void 0 ? false : true,
// This is the one place where we still have to use `QueryStatus` as an enum,
// since it's the only reference in the React package and not in the core.
status: QueryStatus.pending
});
}
return selected;
};
function pick(obj, ...keys) {
const ret = {};
keys.forEach((key) => {
ret[key] = obj[key];
});
return ret;
}
var COMMON_HOOK_DEBUG_FIELDS = ["data", "status", "isLoading", "isSuccess", "isError", "error"];
function buildHooks({
api,
moduleOptions: {
batch,
hooks: {
useDispatch,
useSelector,
useStore
},
unstable__sideEffectsInRender,
createSelector
},
serializeQueryArgs,
context
}) {
const usePossiblyImmediateEffect = unstable__sideEffectsInRender ? (cb) => cb() : useEffect;
const unsubscribePromiseRef = (ref) => {
var _a, _b;
return (_b = (_a = ref.current) == null ? void 0 : _a.unsubscribe) == null ? void 0 : _b.call(_a);
};
const endpointDefinitions = context.endpointDefinitions;
return {
buildQueryHooks,
buildInfiniteQueryHooks,
buildMutationHook,
usePrefetch
};
function queryStatePreSelector(currentState, lastResult, queryArgs) {
if ((lastResult == null ? void 0 : lastResult.endpointName) && currentState.isUninitialized) {
const {
endpointName
} = lastResult;
const endpointDefinition = endpointDefinitions[endpointName];
if (queryArgs !== skipToken && serializeQueryArgs({
queryArgs: lastResult.originalArgs,
endpointDefinition,
endpointName
}) === serializeQueryArgs({
queryArgs,
endpointDefinition,
endpointName
})) lastResult = void 0;
}
let data = currentState.isSuccess ? currentState.data : lastResult == null ? void 0 : lastResult.data;
if (data === void 0) data = currentState.data;
const hasData = data !== void 0;
const isFetching = currentState.isLoading;
const isLoading = (!lastResult || lastResult.isLoading || lastResult.isUninitialized) && !hasData && isFetching;
const isSuccess = currentState.isSuccess || hasData && (isFetching && !(lastResult == null ? void 0 : lastResult.isError) || currentState.isUninitialized);
return __spreadProps(__spreadValues({}, currentState), {
data,
currentData: currentState.data,
isFetching,
isLoading,
isSuccess
});
}
function infiniteQueryStatePreSelector(currentState, lastResult, queryArgs) {
if ((lastResult == null ? void 0 : lastResult.endpointName) && currentState.isUninitialized) {
const {
endpointName
} = lastResult;
const endpointDefinition = endpointDefinitions[endpointName];
if (queryArgs !== skipToken && serializeQueryArgs({
queryArgs: lastResult.originalArgs,
endpointDefinition,
endpointName
}) === serializeQueryArgs({
queryArgs,
endpointDefinition,
endpointName
})) lastResult = void 0;
}
let data = currentState.isSuccess ? currentState.data : lastResult == null ? void 0 : lastResult.data;
if (data === void 0) data = currentState.data;
const hasData = data !== void 0;
const isFetching = currentState.isLoading;
const isLoading = (!lastResult || lastResult.isLoading || lastResult.isUninitialized) && !hasData && isFetching;
const isSuccess = currentState.isSuccess || isFetching && hasData;
return __spreadProps(__spreadValues({}, currentState), {
data,
currentData: currentState.data,
isFetching,
isLoading,
isSuccess
});
}
function usePrefetch(endpointName, defaultOptions) {
const dispatch = useDispatch();
const stableDefaultOptions = useShallowStableValue(defaultOptions);
return useCallback((arg, options) => dispatch(api.util.prefetch(endpointName, arg, __spreadValues(__spreadValues({}, stableDefaultOptions), options))), [endpointName, dispatch, stableDefaultOptions]);
}
function useQuerySubscriptionCommonImpl(endpointName, arg, _a = {}) {
var _b = _a, {
refetchOnReconnect,
refetchOnFocus,
refetchOnMountOrArgChange,
skip = false,
pollingInterval = 0,
skipPollingIfUnfocused = false
} = _b, rest = __objRest(_b, [
"refetchOnReconnect",
"refetchOnFocus",
"refetchOnMountOrArgChange",
"skip",
"pollingInterval",
"skipPollingIfUnfocused"
]);
const {
initiate
} = api.endpoints[endpointName];
const dispatch = useDispatch();
const subscriptionSelectorsRef = useRef(void 0);
if (!subscriptionSelectorsRef.current) {
const returnedValue = dispatch(api.internalActions.internal_getRTKQSubscriptions());
if (process.env.NODE_ENV !== "production") {
if (typeof returnedValue !== "object" || typeof (returnedValue == null ? void 0 : returnedValue.type) === "string") {
throw new Error(process.env.NODE_ENV === "production" ? _formatProdErrorMessage(37) : `Warning: Middleware for RTK-Query API at reducerPath "${api.reducerPath}" has not been added to the store.
You must add the middleware for RTK-Query to function correctly!`);
}
}
subscriptionSelectorsRef.current = returnedValue;
}
const stableArg = useStableQueryArgs(skip ? skipToken : arg);
const stableSubscriptionOptions = useShallowStableValue({
refetchOnReconnect,
refetchOnFocus,
pollingInterval,
skipPollingIfUnfocused
});
const initialPageParam = rest.initialPageParam;
const stableInitialPageParam = useShallowStableValue(initialPageParam);
const promiseRef = useRef(void 0);
let {
queryCacheKey,
requestId
} = promiseRef.current || {};
let currentRenderHasSubscription = false;
if (queryCacheKey && requestId) {
currentRenderHasSubscription = subscriptionSelectorsRef.current.isRequestSubscribed(queryCacheKey, requestId);
}
const subscriptionRemoved = !currentRenderHasSubscription && promiseRef.current !== void 0;
usePossiblyImmediateEffect(() => {
if (subscriptionRemoved) {
promiseRef.current = void 0;
}
}, [subscriptionRemoved]);
usePossiblyImmediateEffect(() => {
var _a2;
const lastPromise = promiseRef.current;
if (typeof process !== "undefined" && process.env.NODE_ENV === "removeMeOnCompilation") {
console.log(subscriptionRemoved);
}
if (stableArg === skipToken) {
lastPromise == null ? void 0 : lastPromise.unsubscribe();
promiseRef.current = void 0;
return;
}
const lastSubscriptionOptions = (_a2 = promiseRef.current) == null ? void 0 : _a2.subscriptionOptions;
if (!lastPromise || lastPromise.arg !== stableArg) {
lastPromise == null ? void 0 : lastPromise.unsubscribe();
const promise = dispatch(initiate(stableArg, __spreadValues({
subscriptionOptions: stableSubscriptionOptions,
forceRefetch: refetchOnMountOrArgChange
}, isInfiniteQueryDefinition(endpointDefinitions[endpointName]) ? {
initialPageParam: stableInitialPageParam
} : {})));
promiseRef.current = promise;
} else if (stableSubscriptionOptions !== lastSubscriptionOptions) {
lastPromise.updateSubscriptionOptions(stableSubscriptionOptions);
}
}, [dispatch, initiate, refetchOnMountOrArgChange, stableArg, stableSubscriptionOptions, subscriptionRemoved, stableInitialPageParam, endpointName]);
return [promiseRef, dispatch, initiate, stableSubscriptionOptions];
}
function buildUseQueryState(endpointName, preSelector) {
const useQueryState = (arg, {
skip = false,
selectFromResult
} = {}) => {
const {
select
} = api.endpoints[endpointName];
const stableArg = useStableQueryArgs(skip ? skipToken : arg);
const lastValue = useRef(void 0);
const selectDefaultResult = useMemo(() => (
// Normally ts-ignores are bad and should be avoided, but we're
// already casting this selector to be `Selector<any>` anyway,
// so the inconsistencies don't matter here
// @ts-ignore
createSelector([
// @ts-ignore
select(stableArg),
(_, lastResult) => lastResult,
(_) => stableArg
], preSelector, {
memoizeOptions: {
resultEqualityCheck: shallowEqual
}
})
), [select, stableArg]);
const querySelector = useMemo(() => selectFromResult ? createSelector([selectDefaultResult], selectFromResult, {
devModeChecks: {
identityFunctionCheck: "never"
}
}) : selectDefaultResult, [selectDefaultResult, selectFromResult]);
const currentState = useSelector((state) => querySelector(state, lastValue.current), shallowEqual);
const store = useStore();
const newLastValue = selectDefaultResult(store.getState(), lastValue.current);
useIsomorphicLayoutEffect(() => {
lastValue.current = newLastValue;
}, [newLastValue]);
return currentState;
};
return useQueryState;
}
function usePromiseRefUnsubscribeOnUnmount(promiseRef) {
useEffect(() => {
return () => {
unsubscribePromiseRef(promiseRef);
promiseRef.current = void 0;
};
}, [promiseRef]);
}
function refetchOrErrorIfUnmounted(promiseRef) {
if (!promiseRef.current) throw new Error(process.env.NODE_ENV === "production" ? _formatProdErrorMessage2(38) : "Cannot refetch a query that has not been started yet.");
return promiseRef.current.refetch();
}
function buildQueryHooks(endpointName) {
const useQuerySubscription = (arg, options = {}) => {
const [promiseRef] = useQuerySubscriptionCommonImpl(endpointName, arg, options);
usePromiseRefUnsubscribeOnUnmount(promiseRef);
return useMemo(() => ({
/**
* A method to manually refetch data for the query
*/
refetch: () => refetchOrErrorIfUnmounted(promiseRef)
}), [promiseRef]);
};
const useLazyQuerySubscription = ({
refetchOnReconnect,
refetchOnFocus,
pollingInterval = 0,
skipPollingIfUnfocused = false
} = {}) => {
const {
initiate
} = api.endpoints[endpointName];
const dispatch = useDispatch();
const [arg, setArg] = useState(UNINITIALIZED_VALUE);
const promiseRef = useRef(void 0);
const stableSubscriptionOptions = useShallowStableValue({
refetchOnReconnect,
refetchOnFocus,
pollingInterval,
skipPollingIfUnfocused
});
usePossiblyImmediateEffect(() => {
var _a, _b;
const lastSubscriptionOptions = (_a = promiseRef.current) == null ? void 0 : _a.subscriptionOptions;
if (stableSubscriptionOptions !== lastSubscriptionOptions) {
(_b = promiseRef.current) == null ? void 0 : _b.updateSubscriptionOptions(stableSubscriptionOptions);
}
}, [stableSubscriptionOptions]);
const subscriptionOptionsRef = useRef(stableSubscriptionOptions);
usePossiblyImmediateEffect(() => {
subscriptionOptionsRef.current = stableSubscriptionOptions;
}, [stableSubscriptionOptions]);
const trigger = useCallback(function(arg2, preferCacheValue = false) {
let promise;
batch(() => {
unsubscribePromiseRef(promiseRef);
promiseRef.current = promise = dispatch(initiate(arg2, {
subscriptionOptions: subscriptionOptionsRef.current,
forceRefetch: !preferCacheValue
}));
setArg(arg2);
});
return promise;
}, [dispatch, initiate]);
const reset = useCallback(() => {
var _a, _b;
if ((_a = promiseRef.current) == null ? void 0 : _a.queryCacheKey) {
dispatch(api.internalActions.removeQueryResult({
queryCacheKey: (_b = promiseRef.current) == null ? void 0 : _b.queryCacheKey
}));
}
}, [dispatch]);
useEffect(() => {
return () => {
unsubscribePromiseRef(promiseRef);
};
}, []);
useEffect(() => {
if (arg !== UNINITIALIZED_VALUE && !promiseRef.current) {
trigger(arg, true);
}
}, [arg, trigger]);
return useMemo(() => [trigger, arg, {
reset
}], [trigger, arg, reset]);
};
const useQueryState = buildUseQueryState(endpointName, queryStatePreSelector);
return {
useQueryState,
useQuerySubscription,
useLazyQuerySubscription,
useLazyQuery(options) {
const [trigger, arg, {
reset
}] = useLazyQuerySubscription(options);
const queryStateResults = useQueryState(arg, __spreadProps(__spreadValues({}, options), {
skip: arg === UNINITIALIZED_VALUE
}));
const info = useMemo(() => ({
lastArg: arg
}), [arg]);
return useMemo(() => [trigger, __spreadProps(__spreadValues({}, queryStateResults), {
reset
}), info], [trigger, queryStateResults, reset, info]);
},
useQuery(arg, options) {
const querySubscriptionResults = useQuerySubscription(arg, options);
const queryStateResults = useQueryState(arg, __spreadValues({
selectFromResult: arg === skipToken || (options == null ? void 0 : options.skip) ? void 0 : noPendingQueryStateSelector
}, options));
const debugValue = pick(queryStateResults, ...COMMON_HOOK_DEBUG_FIELDS);
useDebugValue(debugValue);
return useMemo(() => __spreadValues(__spreadValues({}, queryStateResults), querySubscriptionResults), [queryStateResults, querySubscriptionResults]);
}
};
}
function buildInfiniteQueryHooks(endpointName) {
const useInfiniteQuerySubscription = (arg, options = {}) => {
const [promiseRef, dispatch, initiate, stableSubscriptionOptions] = useQuerySubscriptionCommonImpl(endpointName, arg, options);
const subscriptionOptionsRef = useRef(stableSubscriptionOptions);
usePossiblyImmediateEffect(() => {
subscriptionOptionsRef.current = stableSubscriptionOptions;
}, [stableSubscriptionOptions]);
const trigger = useCallback(function(arg2, direction) {
let promise;
batch(() => {
unsubscribePromiseRef(promiseRef);
promiseRef.current = promise = dispatch(initiate(arg2, {
subscriptionOptions: subscriptionOptionsRef.current,
direction
}));
});
return promise;
}, [promiseRef, dispatch, initiate]);
usePromiseRefUnsubscribeOnUnmount(promiseRef);
const stableArg = useStableQueryArgs(options.skip ? skipToken : arg);
const refetch = useCallback(() => refetchOrErrorIfUnmounted(promiseRef), [promiseRef]);
return useMemo(() => {
const fetchNextPage = () => {
return trigger(stableArg, "forward");
};
const fetchPreviousPage = () => {
return trigger(stableArg, "backward");
};
return {
trigger,
/**
* A method to manually refetch data for the query
*/
refetch,
fetchNextPage,
fetchPreviousPage
};
}, [refetch, trigger, stableArg]);
};
const useInfiniteQueryState = buildUseQueryState(endpointName, infiniteQueryStatePreSelector);
return {
useInfiniteQueryState,
useInfiniteQuerySubscription,
useInfiniteQuery(arg, options) {
const {
refetch,
fetchNextPage,
fetchPreviousPage
} = useInfiniteQuerySubscription(arg, options);
const queryStateResults = useInfiniteQueryState(arg, __spreadValues({
selectFromResult: arg === skipToken || (options == null ? void 0 : options.skip) ? void 0 : noPendingQueryStateSelector
}, options));
const debugValue = pick(queryStateResults, ...COMMON_HOOK_DEBUG_FIELDS, "hasNextPage", "hasPreviousPage");
useDebugValue(debugValue);
return useMemo(() => __spreadProps(__spreadValues({}, queryStateResults), {
fetchNextPage,
fetchPreviousPage,
refetch
}), [queryStateResults, fetchNextPage, fetchPreviousPage, refetch]);
}
};
}
function buildMutationHook(name) {
return ({
selectFromResult,
fixedCacheKey
} = {}) => {
const {
select,
initiate
} = api.endpoints[name];
const dispatch = useDispatch();
const [promise, setPromise] = useState();
useEffect(() => () => {
if (!(promise == null ? void 0 : promise.arg.fixedCacheKey)) {
promise == null ? void 0 : promise.reset();
}
}, [promise]);
const triggerMutation = useCallback(function(arg) {
const promise2 = dispatch(initiate(arg, {
fixedCacheKey
}));
setPromise(promise2);
return promise2;
}, [dispatch, initiate, fixedCacheKey]);
const {
requestId
} = promise || {};
const selectDefaultResult = useMemo(() => select({
fixedCacheKey,
requestId: promise == null ? void 0 : promise.requestId
}), [fixedCacheKey, promise, select]);
const mutationSelector = useMemo(() => selectFromResult ? createSelector([selectDefaultResult], selectFromResult) : selectDefaultResult, [selectFromResult, selectDefaultResult]);
const currentState = useSelector(mutationSelector, shallowEqual);
const originalArgs = fixedCacheKey == null ? promise == null ? void 0 : promise.arg.originalArgs : void 0;
const reset = useCallback(() => {
batch(() => {
if (promise) {
setPromise(void 0);
}
if (fixedCacheKey) {
dispatch(api.internalActions.removeMutationResult({
requestId,
fixedCacheKey
}));
}
});
}, [dispatch, fixedCacheKey, promise, requestId]);
const debugValue = pick(currentState, ...COMMON_HOOK_DEBUG_FIELDS, "endpointName");
useDebugValue(debugValue);
const finalState = useMemo(() => __spreadProps(__spreadValues({}, currentState), {
originalArgs,
reset
}), [currentState, originalArgs, reset]);
return useMemo(() => [triggerMutation, finalState], [triggerMutation, finalState]);
};
}
}
// src/query/react/module.ts
var reactHooksModuleName = /* @__PURE__ */ Symbol();
var reactHooksModule = (_a = {}) => {
var _b = _a, {
batch = rrBatch,
hooks = {
useDispatch: rrUseDispatch,
useSelector: rrUseSelector,
useStore: rrUseStore
},
createSelector = _createSelector,
unstable__sideEffectsInRender = false
} = _b, rest = __objRest(_b, [
"batch",
"hooks",
"createSelector",
"unstable__sideEffectsInRender"
]);
if (process.env.NODE_ENV !== "production") {
const hookNames = ["useDispatch", "useSelector", "useStore"];
let warned = false;
for (const hookName of hookNames) {
if (countObjectKeys(rest) > 0) {
if (rest[hookName]) {
if (!warned) {
console.warn("As of RTK 2.0, the hooks now need to be specified as one object, provided under a `hooks` key:\n`reactHooksModule({ hooks: { useDispatch, useSelector, useStore } })`");
warned = true;
}
}
hooks[hookName] = rest[hookName];
}
if (typeof hooks[hookName] !== "function") {
throw new Error(process.env.NODE_ENV === "production" ? _formatProdErrorMessage3(36) : `When using custom hooks for context, all ${hookNames.length} hooks need to be provided: ${hookNames.join(", ")}.
Hook ${hookName} was either not provided or not a function.`);
}
}
}
return {
name: reactHooksModuleName,
init(api, {
serializeQueryArgs
}, context) {
const anyApi = api;
const {
buildQueryHooks,
buildInfiniteQueryHooks,
buildMutationHook,
usePrefetch
} = buildHooks({
api,
moduleOptions: {
batch,
hooks,
unstable__sideEffectsInRender,
createSelector
},
serializeQueryArgs,
context
});
safeAssign(anyApi, {
usePrefetch
});
safeAssign(context, {
batch
});
return {
injectEndpoint(endpointName, definition) {
if (isQueryDefinition(definition)) {
const {
useQuery,
useLazyQuery,
useLazyQuerySubscription,
useQueryState,
useQuerySubscription
} = buildQueryHooks(endpointName);
safeAssign(anyApi.endpoints[endpointName], {
useQuery,
useLazyQuery,
useLazyQuerySubscription,
useQueryState,
useQuerySubscription
});
api[`use${capitalize(endpointName)}Query`] = useQuery;
api[`useLazy${capitalize(endpointName)}Query`] = useLazyQuery;
}
if (isMutationDefinition(definition)) {
const useMutation = buildMutationHook(endpointName);
safeAssign(anyApi.endpoints[endpointName], {
useMutation
});
api[`use${capitalize(endpointName)}Mutation`] = useMutation;
} else if (isInfiniteQueryDefinition(definition)) {
const {
useInfiniteQuery,
useInfiniteQuerySubscription,
useInfiniteQueryState
} = buildInfiniteQueryHooks(endpointName);
safeAssign(anyApi.endpoints[endpointName], {
useInfiniteQuery,
useInfiniteQuerySubscription,
useInfiniteQueryState
});
api[`use${capitalize(endpointName)}InfiniteQuery`] = useInfiniteQuery;
}
}
};
}
};
};
// src/query/react/index.ts
export * from "@reduxjs/toolkit/query";
// src/query/react/ApiProvider.tsx
import { configureStore, formatProdErrorMessage as _formatProdErrorMessage4 } from "@reduxjs/toolkit";
import * as React from "react";
function ApiProvider(props) {
const context = props.context || ReactReduxContext;
const existingContext = useContext(context);
if (existingContext) {
throw new Error(process.env.NODE_ENV === "production" ? _formatProdErrorMessage4(35) : "Existing Redux context detected. If you already have a store set up, please use the traditional Redux setup.");
}
const [store] = React.useState(() => configureStore({
reducer: {
[props.api.reducerPath]: props.api.reducer
},
middleware: (gDM) => gDM().concat(props.api.middleware)
}));
useEffect(() => props.setupListeners === false ? void 0 : setupListeners(store.dispatch, props.setupListeners), [props.setupListeners, store.dispatch]);
return /* @__PURE__ */ React.createElement(Provider, { store, context }, props.children);
}
// src/query/react/index.ts
var createApi = /* @__PURE__ */ buildCreateApi(coreModule(), reactHooksModule());
export {
ApiProvider,
UNINITIALIZED_VALUE,
createApi,
reactHooksModule,
reactHooksModuleName
};
//# sourceMappingURL=rtk-query-react.legacy-esm.js.map
@@ -0,0 +1,36 @@
import * as _heroui_system from '@heroui/system';
import { HTMLHeroUIProps } from '@heroui/system';
import { ReactNode } from 'react';
import { GridNode } from '@react-types/grid';
import { ValuesType } from './use-table.js';
import '@react-types/table';
import '@heroui/theme';
import '@react-stately/virtualizer';
import '@react-types/shared';
import '@react-stately/table';
import '@react-aria/table';
import '@heroui/react-utils';
import '@heroui/checkbox';
type SortIconProps = {
"aria-hidden"?: boolean;
"data-direction"?: "ascending" | "descending";
"data-visible"?: boolean | "true" | "false";
className?: string;
};
interface TableColumnHeaderProps<T = object> extends HTMLHeroUIProps<"th"> {
slots: ValuesType["slots"];
state: ValuesType["state"];
classNames?: ValuesType["classNames"];
/**
* Custom Icon to be displayed in the table header - overrides the default chevron one
*/
sortIcon?: ReactNode | ((props: SortIconProps) => ReactNode);
/**
* The table node to render.
*/
node: GridNode<T>;
}
declare const TableColumnHeader: _heroui_system.InternalForwardRefRenderFunction<"th", TableColumnHeaderProps<object>, never>;
export { type SortIconProps, type TableColumnHeaderProps, TableColumnHeader as default };
@@ -0,0 +1,159 @@
# etag
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]
Create simple HTTP ETags
This module generates HTTP ETags (as defined in RFC 7232) for use in
HTTP responses.
## Installation
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 etag
```
## API
<!-- eslint-disable no-unused-vars -->
```js
var etag = require('etag')
```
### etag(entity, [options])
Generate a strong ETag for the given entity. This should be the complete
body of the entity. Strings, `Buffer`s, and `fs.Stats` are accepted. By
default, a strong ETag is generated except for `fs.Stats`, which will
generate a weak ETag (this can be overwritten by `options.weak`).
<!-- eslint-disable no-undef -->
```js
res.setHeader('ETag', etag(body))
```
#### Options
`etag` accepts these properties in the options object.
##### weak
Specifies if the generated ETag will include the weak validator mark (that
is, the leading `W/`). The actual entity tag is the same. The default value
is `false`, unless the `entity` is `fs.Stats`, in which case it is `true`.
## Testing
```sh
$ npm test
```
## Benchmark
```bash
$ npm run-script bench
> etag@1.8.1 bench nodejs-etag
> node benchmark/index.js
http_parser@2.7.0
node@6.11.1
v8@5.1.281.103
uv@1.11.0
zlib@1.2.11
ares@1.10.1-DEV
icu@58.2
modules@48
openssl@1.0.2k
> node benchmark/body0-100b.js
100B body
4 tests completed.
buffer - strong x 258,647 ops/sec ±1.07% (180 runs sampled)
buffer - weak x 263,812 ops/sec ±0.61% (184 runs sampled)
string - strong x 259,955 ops/sec ±1.19% (185 runs sampled)
string - weak x 264,356 ops/sec ±1.09% (184 runs sampled)
> node benchmark/body1-1kb.js
1KB body
4 tests completed.
buffer - strong x 189,018 ops/sec ±1.12% (182 runs sampled)
buffer - weak x 190,586 ops/sec ±0.81% (186 runs sampled)
string - strong x 144,272 ops/sec ±0.96% (188 runs sampled)
string - weak x 145,380 ops/sec ±1.43% (187 runs sampled)
> node benchmark/body2-5kb.js
5KB body
4 tests completed.
buffer - strong x 92,435 ops/sec ±0.42% (188 runs sampled)
buffer - weak x 92,373 ops/sec ±0.58% (189 runs sampled)
string - strong x 48,850 ops/sec ±0.56% (186 runs sampled)
string - weak x 49,380 ops/sec ±0.56% (190 runs sampled)
> node benchmark/body3-10kb.js
10KB body
4 tests completed.
buffer - strong x 55,989 ops/sec ±0.93% (188 runs sampled)
buffer - weak x 56,148 ops/sec ±0.55% (190 runs sampled)
string - strong x 27,345 ops/sec ±0.43% (188 runs sampled)
string - weak x 27,496 ops/sec ±0.45% (190 runs sampled)
> node benchmark/body4-100kb.js
100KB body
4 tests completed.
buffer - strong x 7,083 ops/sec ±0.22% (190 runs sampled)
buffer - weak x 7,115 ops/sec ±0.26% (191 runs sampled)
string - strong x 3,068 ops/sec ±0.34% (190 runs sampled)
string - weak x 3,096 ops/sec ±0.35% (190 runs sampled)
> node benchmark/stats.js
stat
4 tests completed.
real - strong x 871,642 ops/sec ±0.34% (189 runs sampled)
real - weak x 867,613 ops/sec ±0.39% (190 runs sampled)
fake - strong x 401,051 ops/sec ±0.40% (189 runs sampled)
fake - weak x 400,100 ops/sec ±0.47% (188 runs sampled)
```
## License
[MIT](LICENSE)
[npm-image]: https://img.shields.io/npm/v/etag.svg
[npm-url]: https://npmjs.org/package/etag
[node-version-image]: https://img.shields.io/node/v/etag.svg
[node-version-url]: https://nodejs.org/en/download/
[travis-image]: https://img.shields.io/travis/jshttp/etag/master.svg
[travis-url]: https://travis-ci.org/jshttp/etag
[coveralls-image]: https://img.shields.io/coveralls/jshttp/etag/master.svg
[coveralls-url]: https://coveralls.io/r/jshttp/etag?branch=master
[downloads-image]: https://img.shields.io/npm/dm/etag.svg
[downloads-url]: https://npmjs.org/package/etag
@@ -0,0 +1 @@
{"name":"cookie","version":"0.7.2","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532115198,"integrity":"sha512-Scr4piRfVq7q+vQQBTpyWGusX5lDBTzo+GtrnyDcyNnVU8Xu2mkHXKKVHU+knl9ox1PB8G3VVpgjBzU0eBh8EA==","mode":420,"size":1175},"index.js":{"checkedAt":1794532124705,"integrity":"sha512-KcazrSz6djTAdcK0a28mNZgjpovLsOPXDBd/WZeQ8RvM2kSkKoaA/HpfqfBH+HJjWQy8A/UycIWq1E2K0cbphg==","mode":420,"size":8166},"package.json":{"checkedAt":1794532124705,"integrity":"sha512-70iOFeGN3PDivaHS3gV5/V8w660RGIS8gPq/IJ0OeiOb2SrzxVO6r7CfLY2Szp3dL1mAWIUgJirmXFCJLoP4Ng==","mode":420,"size":1092},"README.md":{"checkedAt":1794532124706,"integrity":"sha512-j2+giYjKvB2Q9lI9PKLQnoliKuy/LpVOZyQaB29D09sOyjuxayjNAlnoUTBWMfjcQimaeKpADOBiOskLfFbCGA==","mode":420,"size":11769},"SECURITY.md":{"checkedAt":1794532124706,"integrity":"sha512-WqBYt4zqvYsMm5RTAjcGyRbnJ3xILs02Ic49o2I3Avv1QBFNLpBDAf8wvzbDjFr10plAAh88Ctm8Jn1NKGFoHA==","mode":420,"size":1180}}}
@@ -0,0 +1,205 @@
import * as proto from '../../../packet/transformer/proto';
import { OidbPacket, PacketTransformer } from '../../../packet/transformer/base';
import { IndexNode } from '../../../packet/transformer/proto';
declare class DownloadGroupVideo extends PacketTransformer<typeof proto.NTV2RichMediaResp> {
build(groupUin: number, node: any): OidbPacket;
parse(data: Buffer): import("napcat-protobuf").any {
common: import("napcat-protobuf").MessageProtoFieldType<() => {
RequestId: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
Command: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
}, false, false>;
retCode: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
message: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
}, false, false>;
upload: import("napcat-protobuf").MessageProtoFieldType<() => {
uKey: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, true, false>;
uKeyTtlSecond: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
ipv4s: import("napcat-protobuf").MessageProtoFieldType<() => {
outIP: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
outPort: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
inIP: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
inPort: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
ipType: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
}, false, true>;
ipv6s: import("napcat-protobuf").MessageProtoFieldType<() => {
outIP: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
outPort: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
inIP: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
inPort: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
ipType: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
}, false, true>;
msgSeq: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT64, false, false>;
msgInfo: import("napcat-protobuf").MessageProtoFieldType<() => {
MsgInfoBody: import("napcat-protobuf").MessageProtoFieldType<() => {
Index: import("napcat-protobuf").MessageProtoFieldType<() => {
Info: import("napcat-protobuf").MessageProtoFieldType<() => {
FileSize: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
FileHash: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
FileSha1: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
FileName: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
Type: import("napcat-protobuf").MessageProtoFieldType<() => {
Type: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
PicFormat: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
VideoFormat: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
VoiceFormat: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
}, false, false>;
Width: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
Height: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
Time: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
Original: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
}, false, false>;
FileUuid: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
StoreId: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
UploadTime: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
Ttl: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
SubType: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
}, false, false>;
Picture: import("napcat-protobuf").MessageProtoFieldType<() => {
UrlPath: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
Ext: import("napcat-protobuf").MessageProtoFieldType<() => {
OriginalParameter: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
BigParameter: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
ThumbParameter: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
}, false, false>;
Domain: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
}, false, false>;
Video: import("napcat-protobuf").MessageProtoFieldType<() => {}, false, false>;
Audio: import("napcat-protobuf").MessageProtoFieldType<() => {}, false, false>;
FileExist: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BOOL, false, false>;
HashSum: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
}, false, true>;
ExtBizInfo: import("napcat-protobuf").MessageProtoFieldType<() => {
Pic: import("napcat-protobuf").MessageProtoFieldType<() => {
BizType: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
TextSummary: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
BytesPbReserveC2c: import("napcat-protobuf").MessageProtoFieldType<() => {
subType: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
field3: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
field4: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
field8: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
field10: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
field12: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
field18: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
field19: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
field20: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
}, false, false>;
BytesPbReserveTroop: import("napcat-protobuf").MessageProtoFieldType<() => {
subType: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
field3: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
field4: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
field9: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
field10: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
field12: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
field18: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
field19: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
field21: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
}, false, false>;
FromScene: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
ToScene: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
OldFileId: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
}, false, false>;
Video: import("napcat-protobuf").MessageProtoFieldType<() => {
FromScene: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
ToScene: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
BytesPbReserve: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
}, false, false>;
Ptt: import("napcat-protobuf").MessageProtoFieldType<() => {
SrcUin: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT64, false, false>;
PttScene: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
PttType: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
ChangeVoice: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
Waveform: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
AutoConvertText: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
BytesReserve: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
BytesPbReserve: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
BytesGeneralFlags: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
}, false, false>;
BusiType: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
}, false, false>;
}, false, false>;
ext: import("napcat-protobuf").MessageProtoFieldType<() => {
subType: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
extType: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
extValue: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
}, false, true>;
compatQMsg: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
subFileInfos: import("napcat-protobuf").MessageProtoFieldType<() => {
subType: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
uKey: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
uKeyTtlSecond: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
ipv4s: import("napcat-protobuf").MessageProtoFieldType<() => {
outIP: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
outPort: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
inIP: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
inPort: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
ipType: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
}, false, true>;
ipv6s: import("napcat-protobuf").MessageProtoFieldType<() => {
outIP: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
outPort: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
inIP: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
inPort: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
ipType: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
}, false, true>;
}, false, true>;
}, false, false>;
download: import("napcat-protobuf").MessageProtoFieldType<() => {
rKeyParam: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
rKeyTtlSecond: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
info: import("napcat-protobuf").MessageProtoFieldType<() => {
domain: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
urlPath: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
httpsPort: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
ipv4s: import("napcat-protobuf").MessageProtoFieldType<() => {
outIP: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
outPort: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
inIP: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
inPort: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
ipType: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
}, false, true>;
ipv6s: import("napcat-protobuf").MessageProtoFieldType<() => {
outIP: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
outPort: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
inIP: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
inPort: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
ipType: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
}, false, true>;
picUrlExtInfo: import("napcat-protobuf").MessageProtoFieldType<() => {
OriginalParameter: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
BigParameter: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
ThumbParameter: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
}, false, false>;
videoExtInfo: import("napcat-protobuf").MessageProtoFieldType<() => {
VideoCodecFormat: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
}, false, false>;
}, false, false>;
rKeyCreateTime: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
}, false, false>;
downloadRKey: import("napcat-protobuf").MessageProtoFieldType<() => {
rKeys: import("napcat-protobuf").MessageProtoFieldType<() => {
rkey: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
rkeyTtlSec: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT64, false, false>;
storeId: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
rkeyCreateTime: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, true, false>;
type: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, true, false>;
}, false, true>;
}, false, false>;
delete: import("napcat-protobuf").MessageProtoFieldType<() => {}, false, false>;
uploadCompleted: import("napcat-protobuf").MessageProtoFieldType<() => {
msgSeq: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT64, false, false>;
}, false, false>;
msgInfoAuth: import("napcat-protobuf").MessageProtoFieldType<() => {
authCode: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT32, false, false>;
msg: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, false, false>;
resultTime: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT64, false, false>;
}, false, false>;
uploadKeyRenewal: import("napcat-protobuf").MessageProtoFieldType<() => {
ukey: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.STRING, false, false>;
ukeyTtlSec: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.UINT64, false, false>;
}, false, false>;
downloadSafe: import("napcat-protobuf").MessageProtoFieldType<() => {}, false, false>;
extension: import("napcat-protobuf").ScalarProtoFieldType<import("napcat-protobuf").ScalarType.BYTES, true, false>;
}>;
}
declare const _default: DownloadGroupVideo;
export default _default;
@@ -0,0 +1,94 @@
import * as core from "./core.js";
import * as errors from "./errors.js";
import type * as schemas from "./schemas.js";
import * as util from "./util.js";
export type $ZodErrorClass = { new (issues: errors.$ZodIssue[]): errors.$ZodError };
/////////// METHODS ///////////
export type $Parse = <T extends schemas.$ZodType>(
schema: T,
value: unknown,
_ctx?: schemas.ParseContext<errors.$ZodIssue>,
_params?: { callee?: util.AnyFunc; Err?: $ZodErrorClass }
) => core.output<T>;
export const _parse: (_Err: $ZodErrorClass) => $Parse = (_Err) => (schema, value, _ctx, _params) => {
const ctx: schemas.ParseContextInternal = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
const result = schema._zod.run({ value, issues: [] }, ctx);
if (result instanceof Promise) {
throw new core.$ZodAsyncError();
}
if (result.issues.length) {
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));
util.captureStackTrace(e, _params?.callee);
throw e;
}
return result.value as core.output<typeof schema>;
};
export const parse: $Parse = /* @__PURE__*/ _parse(errors.$ZodRealError);
export type $ParseAsync = <T extends schemas.$ZodType>(
schema: T,
value: unknown,
_ctx?: schemas.ParseContext<errors.$ZodIssue>,
_params?: { callee?: util.AnyFunc; Err?: $ZodErrorClass }
) => Promise<core.output<T>>;
export const _parseAsync: (_Err: $ZodErrorClass) => $ParseAsync = (_Err) => async (schema, value, _ctx, params) => {
const ctx: schemas.ParseContextInternal = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
let result = schema._zod.run({ value, issues: [] }, ctx);
if (result instanceof Promise) result = await result;
if (result.issues.length) {
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));
util.captureStackTrace(e, params?.callee);
throw e;
}
return result.value as core.output<typeof schema>;
};
export const parseAsync: $ParseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);
export type $SafeParse = <T extends schemas.$ZodType>(
schema: T,
value: unknown,
_ctx?: schemas.ParseContext<errors.$ZodIssue>
) => util.SafeParseResult<core.output<T>>;
export const _safeParse: (_Err: $ZodErrorClass) => $SafeParse = (_Err) => (schema, value, _ctx) => {
const ctx: schemas.ParseContextInternal = _ctx ? { ..._ctx, async: false } : { async: false };
const result = schema._zod.run({ value, issues: [] }, ctx);
if (result instanceof Promise) {
throw new core.$ZodAsyncError();
}
return result.issues.length
? {
success: false,
error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
}
: ({ success: true, data: result.value } as any);
};
export const safeParse: $SafeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);
export type $SafeParseAsync = <T extends schemas.$ZodType>(
schema: T,
value: unknown,
_ctx?: schemas.ParseContext<errors.$ZodIssue>
) => Promise<util.SafeParseResult<core.output<T>>>;
export const _safeParseAsync: (_Err: $ZodErrorClass) => $SafeParseAsync = (_Err) => async (schema, value, _ctx) => {
const ctx: schemas.ParseContextInternal = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
let result = schema._zod.run({ value, issues: [] }, ctx);
if (result instanceof Promise) result = await result;
return result.issues.length
? {
success: false,
error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
}
: ({ success: true, data: result.value } as any);
};
export const safeParseAsync: $SafeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);
@@ -0,0 +1,72 @@
{
"name": "comma-separated-tokens",
"version": "2.0.3",
"description": "Parse and stringify comma-separated tokens",
"license": "MIT",
"keywords": [
"dom",
"html",
"comma",
"separated",
"tokens",
"parse",
"stringify"
],
"repository": "wooorm/comma-separated-tokens",
"bugs": "https://github.com/wooorm/comma-separated-tokens/issues",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
},
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"sideEffects": false,
"type": "module",
"main": "index.js",
"types": "index.d.ts",
"files": [
"index.d.ts",
"index.js"
],
"devDependencies": {
"@types/node": "^18.0.0",
"c8": "^7.0.0",
"prettier": "^2.0.0",
"remark-cli": "^11.0.0",
"remark-preset-wooorm": "^9.0.0",
"type-coverage": "^2.0.0",
"typescript": "^4.0.0",
"xo": "^0.52.0"
},
"scripts": {
"prepack": "npm run build && npm run format",
"build": "tsc --build --clean && tsc --build && type-coverage",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"test-api": "node --conditions development test.js",
"test-coverage": "c8 --check-coverage --100 --reporter lcov npm run test-api",
"test": "npm run build && npm run format && npm run test-coverage"
},
"prettier": {
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": false,
"semi": false,
"trailingComma": "none"
},
"xo": {
"prettier": true
},
"remarkConfig": {
"plugins": [
"preset-wooorm"
]
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
"strict": true
}
}
@@ -0,0 +1,3 @@
# @react-types/calendar
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.
@@ -0,0 +1,134 @@
<p align="center">
<a href="https://rollupjs.org/"><img src="https://rollupjs.org/rollup-logo.svg" width="150" /></a>
</p>
<p align="center">
<a href="https://www.npmjs.com/package/rollup">
<img src="https://img.shields.io/npm/v/rollup.svg" alt="npm version" >
</a>
<a href="https://nodejs.org/en/about/previous-releases">
<img src="https://img.shields.io/node/v/rollup.svg" alt="node compatibility">
</a>
<a href="https://packagephobia.now.sh/result?p=rollup">
<img src="https://packagephobia.now.sh/badge?p=rollup" alt="install size" >
</a>
<a href="https://codecov.io/gh/rollup/rollup">
<img src="https://codecov.io/gh/rollup/rollup/graph/badge.svg" alt="code coverage" >
</a>
<a href="#backers" alt="sponsors on Open Collective">
<img src="https://opencollective.com/rollup/backers/badge.svg" alt="backers" >
</a>
<a href="#sponsors" alt="Sponsors on Open Collective">
<img src="https://opencollective.com/rollup/sponsors/badge.svg" alt="sponsors" >
</a>
<a href="https://github.com/rollup/rollup/blob/master/LICENSE.md">
<img src="https://img.shields.io/npm/l/rollup.svg" alt="license">
</a>
<a href='https://is.gd/rollup_chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge'>
<img src='https://img.shields.io/discord/466787075518365708?color=778cd1&label=chat' alt='Join the chat at https://is.gd/rollup_chat'>
</a>
</p>
<h1 align="center">Rollup</h1>
## Overview
Rollup is a module bundler for JavaScript which compiles small pieces of code into something larger and more complex, such as a library or application. It uses the standardized ES module format for code, instead of previous idiosyncratic solutions such as CommonJS and AMD. ES modules let you freely and seamlessly combine the most useful individual functions from your favorite libraries. Rollup can optimize ES modules for faster native loading in modern browsers, or output a legacy module format allowing ES module workflows today.
## Quick Start Guide
Install with `npm install --global rollup`. Rollup can be used either through a [command line interface](https://rollupjs.org/command-line-interface/) with an optional configuration file or else through its [JavaScript API](https://rollupjs.org/javascript-api/). Run `rollup --help` to see the available options and parameters. The starter project templates, [rollup-starter-lib](https://github.com/rollup/rollup-starter-lib) and [rollup-starter-app](https://github.com/rollup/rollup-starter-app), demonstrate common configuration options, and more detailed instructions are available throughout the [user guide](https://rollupjs.org/introduction/).
### Commands
These commands assume the entry point to your application is named main.js, and that you'd like all imports compiled into a single file named bundle.js.
For browsers:
```bash
# compile to a <script> containing a self-executing function
rollup main.js --format iife --name "myBundle" --file bundle.js
```
For Node.js:
```bash
# compile to a CommonJS module
rollup main.js --format cjs --file bundle.js
```
For both browsers and Node.js:
```bash
# UMD format requires a bundle name
rollup main.js --format umd --name "myBundle" --file bundle.js
```
## Why
Developing software is usually easier if you break your project into smaller separate pieces, since that often removes unexpected interactions and dramatically reduces the complexity of the problems you'll need to solve, and simply writing smaller projects in the first place [isn't necessarily the answer](https://medium.com/@Rich_Harris/small-modules-it-s-not-quite-that-simple-3ca532d65de4). Unfortunately, JavaScript has not historically included this capability as a core feature in the language.
This finally changed with ES modules support in JavaScript, which provides a syntax for importing and exporting functions and data so they can be shared between separate scripts. Most browsers and Node.js support ES modules. However, Node.js releases before 12.17 support ES modules only behind the `--experimental-modules` flag, and older browsers like Internet Explorer do not support ES modules at all. Rollup allows you to write your code using ES modules, and run your application even in environments that do not support ES modules natively. For environments that support them, Rollup can output optimized ES modules; for environments that don't, Rollup can compile your code to other formats such as CommonJS modules, AMD modules, and IIFE-style scripts. This means that you get to _write future-proof code_, and you also get the tremendous benefits of...
## Tree Shaking
In addition to enabling the use of ES modules, Rollup also statically analyzes and optimizes the code you are importing, and will exclude anything that isn't actually used. This allows you to build on top of existing tools and modules without adding extra dependencies or bloating the size of your project.
For example, with CommonJS, the _entire tool or library must be imported_.
```js
// import the entire utils object with CommonJS
var utils = require('node:utils');
var query = 'Rollup';
// use the ajax method of the utils object
utils.ajax('https://api.example.com?search=' + query).then(handleResponse);
```
But with ES modules, instead of importing the whole `utils` object, we can just import the one `ajax` function we need:
```js
// import the ajax function with an ES import statement
import { ajax } from 'node:utils';
var query = 'Rollup';
// call the ajax function
ajax('https://api.example.com?search=' + query).then(handleResponse);
```
Because Rollup includes the bare minimum, it results in lighter, faster, and less complicated libraries and applications. Since this approach is based on explicit `import` and `export` statements, it is vastly more effective than simply running an automated minifier to detect unused variables in the compiled output code.
## Compatibility
### Importing CommonJS
Rollup can import existing CommonJS modules [through a plugin](https://github.com/rollup/plugins/tree/master/packages/commonjs).
### Publishing ES Modules
To make sure your ES modules are immediately usable by tools that work with CommonJS such as Node.js and webpack, you can use Rollup to compile to UMD or CommonJS format, and then point to that compiled version with the `main` property in your `package.json` file. If your `package.json` file also has a `module` field, ES-module-aware tools like Rollup and [webpack](https://webpack.js.org/) will [import the ES module version](https://github.com/rollup/rollup/wiki/pkg.module) directly.
## Contributors
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. <a href="https://github.com/rollup/rollup/graphs/contributors"><img src="https://opencollective.com/rollup/contributors.svg?width=890" /></a>. If you want to contribute yourself, head over to the [contribution guidelines](CONTRIBUTING.md).
## Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/rollup#backer)]
<a href="https://opencollective.com/rollup#backers" target="_blank"><img src="https://opencollective.com/rollup/backers.svg?width=890"></a>
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/rollup#sponsor)]
<a href="https://opencollective.com/rollup/sponsor/0/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/0/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/1/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/1/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/2/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/2/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/3/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/3/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/4/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/4/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/5/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/5/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/6/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/6/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/7/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/7/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/8/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/8/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/9/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/9/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/10/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/10/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/11/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/11/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/12/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/12/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/13/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/13/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/14/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/14/avatar.svg"></a>
## Special Sponsor
<a href="https://www.tngtech.com/en/index.html" target="_blank"><img src="https://avatars.githubusercontent.com/u/432256?s=200&v=4" alt="TNG Logo"/></a>
TNG has been supporting the work of [Lukas Taegert-Atkinson](https://github.com/lukastaegert) on Rollup since 2017.
## License
[MIT](https://github.com/rollup/rollup/blob/master/LICENSE.md)
@@ -0,0 +1,25 @@
// src/moon-filled.tsx
import { jsx } from "react/jsx-runtime";
var MoonFilledIcon = (props) => /* @__PURE__ */ jsx(
"svg",
{
"aria-hidden": "true",
focusable: "false",
height: "1em",
role: "presentation",
viewBox: "0 0 24 24",
width: "1em",
...props,
children: /* @__PURE__ */ jsx(
"path",
{
d: "M21.53 15.93c-.16-.27-.61-.69-1.73-.49a8.46 8.46 0 01-1.88.13 8.409 8.409 0 01-5.91-2.82 8.068 8.068 0 01-1.44-8.66c.44-1.01.13-1.54-.09-1.76s-.77-.55-1.83-.11a10.318 10.318 0 00-6.32 10.21 10.475 10.475 0 007.04 8.99 10 10 0 002.89.55c.16.01.32.02.48.02a10.5 10.5 0 008.47-4.27c.67-.93.49-1.519.32-1.79z",
fill: "currentColor"
}
)
}
);
export {
MoonFilledIcon
};
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isScope;
var _index = require("./generated/index.js");
function isScope(node, parent) {
if ((0, _index.isBlockStatement)(node) && ((0, _index.isFunction)(parent) || (0, _index.isCatchClause)(parent))) {
return false;
}
if ((0, _index.isPattern)(node) && ((0, _index.isFunction)(parent) || (0, _index.isCatchClause)(parent))) {
return true;
}
return (0, _index.isScopable)(node);
}
//# sourceMappingURL=isScope.js.map
@@ -0,0 +1,162 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {DOMAttributes, RefObject} from '@react-types/shared';
import {isElementInChildOfActiveScope} from '@react-aria/focus';
import {useEffect} from 'react';
import {useFocusWithin, useInteractOutside} from '@react-aria/interactions';
export interface AriaOverlayProps {
/** Whether the overlay is currently open. */
isOpen?: boolean,
/** Handler that is called when the overlay should close. */
onClose?: () => void,
/**
* Whether to close the overlay when the user interacts outside it.
* @default false
*/
isDismissable?: boolean,
/** Whether the overlay should close when focus is lost or moves outside it. */
shouldCloseOnBlur?: boolean,
/**
* Whether pressing the escape key to close the overlay should be disabled.
* @default false
*/
isKeyboardDismissDisabled?: boolean,
/**
* When user interacts with the argument element outside of the overlay ref,
* return true if onClose should be called. This gives you a chance to filter
* out interaction with elements that should not dismiss the overlay.
* By default, onClose will always be called on interaction outside the overlay ref.
*/
shouldCloseOnInteractOutside?: (element: Element) => boolean
}
export interface OverlayAria {
/** Props to apply to the overlay container element. */
overlayProps: DOMAttributes,
/** Props to apply to the underlay element, if any. */
underlayProps: DOMAttributes
}
const visibleOverlays: RefObject<Element | null>[] = [];
/**
* Provides the behavior for overlays such as dialogs, popovers, and menus.
* Hides the overlay when the user interacts outside it, when the Escape key is pressed,
* or optionally, on blur. Only the top-most overlay will close at once.
*/
export function useOverlay(props: AriaOverlayProps, ref: RefObject<Element | null>): OverlayAria {
let {
onClose,
shouldCloseOnBlur,
isOpen,
isDismissable = false,
isKeyboardDismissDisabled = false,
shouldCloseOnInteractOutside
} = props;
// Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.
useEffect(() => {
if (isOpen && !visibleOverlays.includes(ref)) {
visibleOverlays.push(ref);
return () => {
let index = visibleOverlays.indexOf(ref);
if (index >= 0) {
visibleOverlays.splice(index, 1);
}
};
}
}, [isOpen, ref]);
// Only hide the overlay when it is the topmost visible overlay in the stack
let onHide = () => {
if (visibleOverlays[visibleOverlays.length - 1] === ref && onClose) {
onClose();
}
};
let onInteractOutsideStart = (e: PointerEvent) => {
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target as Element)) {
if (visibleOverlays[visibleOverlays.length - 1] === ref) {
e.stopPropagation();
e.preventDefault();
}
}
};
let onInteractOutside = (e: PointerEvent) => {
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target as Element)) {
if (visibleOverlays[visibleOverlays.length - 1] === ref) {
e.stopPropagation();
e.preventDefault();
}
onHide();
}
};
// Handle the escape key
let onKeyDown = (e) => {
if (e.key === 'Escape' && !isKeyboardDismissDisabled && !e.nativeEvent.isComposing) {
e.stopPropagation();
e.preventDefault();
onHide();
}
};
// Handle clicking outside the overlay to close it
useInteractOutside({ref, onInteractOutside: isDismissable && isOpen ? onInteractOutside : undefined, onInteractOutsideStart});
let {focusWithinProps} = useFocusWithin({
isDisabled: !shouldCloseOnBlur,
onBlurWithin: (e) => {
// Do not close if relatedTarget is null, which means focus is lost to the body.
// That can happen when switching tabs, or due to a VoiceOver/Chrome bug with Control+Option+Arrow navigation.
// Clicking on the body to close the overlay should already be handled by useInteractOutside.
// https://github.com/adobe/react-spectrum/issues/4130
// https://github.com/adobe/react-spectrum/issues/4922
//
// If focus is moving into a child focus scope (e.g. menu inside a dialog),
// do not close the outer overlay. At this point, the active scope should
// still be the outer overlay, since blur events run before focus.
if (!e.relatedTarget || isElementInChildOfActiveScope(e.relatedTarget)) {
return;
}
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.relatedTarget as Element)) {
onClose?.();
}
}
});
let onPointerDownUnderlay = e => {
// fixes a firefox issue that starts text selection https://bugzilla.mozilla.org/show_bug.cgi?id=1675846
if (e.target === e.currentTarget) {
e.preventDefault();
}
};
return {
overlayProps: {
onKeyDown,
...focusWithinProps
},
underlayProps: {
onPointerDown: onPointerDownUnderlay
}
};
}
@@ -0,0 +1,153 @@
# character-entities-html4
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
Map of named character references from HTML 4.
## Contents
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`characterEntitiesHtml4`](#characterentitieshtml4)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This is a map of named character references in HTML 4 to the characters they
represent.
## When should I use this?
Maybe when you’re writing an HTML parser or minifier, but otherwise probably
never!
Even then, it might be better to use [`parse-entities`][parse-entities] or
[`stringify-entities`][stringify-entities].
## Install
This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:
```sh
npm install character-entities-html4
```
In Deno with [Skypack][]:
```js
import {characterEntitiesHtml4} from 'https://cdn.skypack.dev/character-entities-html4@2?dts'
```
In browsers with [Skypack][]:
```html
<script type="module">
import {characterEntitiesHtml4} from 'https://cdn.skypack.dev/character-entities-html4@2?min'
</script>
```
## Use
```js
import {characterEntitiesHtml4} from 'character-entities-html4'
console.log(characterEntitiesHtml4.AElig) // => 'Æ'
console.log(characterEntitiesHtml4.aelig) // => 'æ'
console.log(characterEntitiesHtml4.amp) // => '&'
console.log(characterEntitiesHtml4.apos) // => undefined
```
## API
This package exports the following identifiers: `characterEntitiesHtml4`.
There is no default export.
### `characterEntitiesHtml4`
Map of case sensitive named character references from HTML 4.
See [`w3.org`][html] for more info.
## Types
This package is fully typed with [TypeScript][].
## Compatibility
This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
It also works in Deno and modern browsers.
## Security
This package is safe.
## Related
* [`parse-entities`](https://github.com/wooorm/parse-entities)
— parse (decode) character references
* [`stringify-entities`](https://github.com/wooorm/stringify-entities)
— serialize (encode) character references
* [`character-entities`](https://github.com/wooorm/character-entities)
— info on character entities
* [`character-entities-invalid`](https://github.com/wooorm/character-entities-invalid)
— info on invalid numeric character references
* [`character-entities-legacy`](https://github.com/wooorm/character-entities-legacy)
— info on legacy named character references
## Contribute
Yes please!
See [How to Contribute to Open Source][contribute].
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://github.com/wooorm/character-entities-html4/workflows/main/badge.svg
[build]: https://github.com/wooorm/character-entities-html4/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/character-entities-html4.svg
[coverage]: https://codecov.io/github/wooorm/character-entities-html4
[downloads-badge]: https://img.shields.io/npm/dm/character-entities-html4.svg
[downloads]: https://www.npmjs.com/package/character-entities-html4
[size-badge]: https://img.shields.io/bundlephobia/minzip/character-entities-html4.svg
[size]: https://bundlephobia.com/result?p=character-entities-html4
[npm]: https://docs.npmjs.com/cli/install
[skypack]: https://www.skypack.dev
[license]: license
[author]: https://wooorm.com
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[typescript]: https://www.typescriptlang.org
[contribute]: https://opensource.guide/how-to-contribute/
[parse-entities]: https://github.com/wooorm/parse-entities
[stringify-entities]: https://github.com/wooorm/stringify-entities
[html]: https://www.w3.org/TR/html4/sgml/entities.html
@@ -0,0 +1,49 @@
import { Selection } from '@react-types/shared';
/**
* Part of this code is taken from @chakra-ui/system ❤️
*/
type As<Props = any> = React.ElementType<Props>;
type DOMElements = keyof JSX.IntrinsicElements;
type CapitalizedDOMElements = Capitalize<DOMElements>;
interface DOMElement extends Element, HTMLOrSVGElement {
}
type DataAttributes = {
[dataAttr: string]: any;
};
type DOMAttributes<T = DOMElement> = React.AriaAttributes & React.DOMAttributes<T> & DataAttributes & {
id?: string;
role?: React.AriaRole;
tabIndex?: number;
style?: React.CSSProperties;
};
type OmitCommonProps<Target, OmitAdditionalProps extends keyof any = never> = Omit<Target, "transition" | "as" | "color" | OmitAdditionalProps>;
type RightJoinProps<SourceProps extends object = {}, OverrideProps extends object = {}> = OmitCommonProps<SourceProps, keyof OverrideProps> & OverrideProps;
type MergeWithAs<ComponentProps extends object, AsProps extends object, AdditionalProps extends object = {}, AsComponent extends As = As> = (RightJoinProps<ComponentProps, AdditionalProps> | RightJoinProps<AsProps, AdditionalProps>) & {
as?: AsComponent;
};
type InternalForwardRefRenderFunction<Component extends As, Props extends object = {}, OmitKeys extends keyof any = never> = {
<AsComponent extends As = Component>(props: MergeWithAs<React.ComponentPropsWithoutRef<Component>, Omit<React.ComponentPropsWithoutRef<AsComponent>, OmitKeys>, Props, AsComponent>): React.ReactElement | null;
readonly $$typeof: symbol;
defaultProps?: Partial<Props> | undefined;
propTypes?: React.WeakValidationMap<Props> | undefined;
displayName?: string | undefined;
};
/**
* Extract the props of a React element or component
*/
type PropsOf<T extends As> = React.ComponentPropsWithoutRef<T> & {
as?: As;
};
type Merge<M, N> = N extends Record<string, unknown> ? M : Omit<M, keyof N> & N;
type HTMLHeroUIProps<T extends As = "div", OmitKeys extends keyof any = never> = Omit<PropsOf<T>, "ref" | "color" | "slot" | "size" | "defaultChecked" | "defaultValue" | OmitKeys> & {
as?: As;
};
type PropGetter<P = Record<string, unknown>, R = DOMAttributes> = (props?: Merge<DOMAttributes, P>, ref?: React.Ref<any>) => R & React.RefAttributes<any>;
type SharedSelection = Selection & {
anchorKey?: string;
currentKey?: string;
};
export { As, CapitalizedDOMElements, DOMAttributes, DOMElement, DOMElements, HTMLHeroUIProps, InternalForwardRefRenderFunction, Merge, MergeWithAs, OmitCommonProps, PropGetter, PropsOf, RightJoinProps, SharedSelection };
@@ -0,0 +1,2 @@
import type { Coordinates, ClientRect } from '../../types';
export declare function getRectDelta(rect1: ClientRect | null, rect2: ClientRect | null): Coordinates;
@@ -0,0 +1,5 @@
function eachAxis(callback) {
return [callback("x"), callback("y")];
}
export { eachAxis };
@@ -0,0 +1,30 @@
import { AlgorithmIdentifier } from "@peculiar/asn1-x509";
/**
* ```asn1
* TrailerField ::= INTEGER { trailerFieldBC(1) }
* ```
*/
export type TrailerField = number;
/**
* ```asn1
* RSASSA-PSS-params ::= SEQUENCE {
* hashAlgorithm [0] HashAlgorithm DEFAULT sha1,
* maskGenAlgorithm [1] MaskGenAlgorithm DEFAULT mgf1SHA1,
* saltLength [2] INTEGER DEFAULT 20,
* trailerField [3] TrailerField DEFAULT trailerFieldBC
* }
* ```
*/
export declare class RsaSaPssParams {
hashAlgorithm: AlgorithmIdentifier;
maskGenAlgorithm: AlgorithmIdentifier;
saltLength: number;
trailerField: TrailerField;
constructor(params?: Partial<RsaSaPssParams>);
}
/**
* ```asn1
* { OID id-RSASSA-PSS PARAMETERS RSASSA-PSS-params }
* ```
*/
export declare const RSASSA_PSS: AlgorithmIdentifier;
@@ -0,0 +1,60 @@
import { OneBotAction } from '../../action/OneBotAction';
import { Static } from '@sinclair/typebox';
declare const PayloadSchema: import("@sinclair/typebox").TObject<{
no_cache: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TString]>>;
}>;
type PayloadType = Static<typeof PayloadSchema>;
declare const ReturnSchema: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
birthday_year: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
birthday_month: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
birthday_day: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
phone_num: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
email: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
category_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
user_id: import("@sinclair/typebox").TNumber;
nickname: import("@sinclair/typebox").TString;
remark: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
sex: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
level: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
age: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
qid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
login_days: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
categoryName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
categoryId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
}>>;
type ReturnType = Static<typeof ReturnSchema>;
export default class GetFriendList extends OneBotAction<PayloadType, ReturnType> {
actionName: "get_friend_list";
payloadSchema: import("@sinclair/typebox").TObject<{
no_cache: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TString]>>;
}>;
returnSchema: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
birthday_year: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
birthday_month: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
birthday_day: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
phone_num: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
email: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
category_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
user_id: import("@sinclair/typebox").TNumber;
nickname: import("@sinclair/typebox").TString;
remark: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
sex: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
level: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
age: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
qid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
login_days: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
categoryName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
categoryId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
}>>;
actionSummary: string;
actionDescription: string;
actionTags: string[];
payloadExample: {};
returnExample: {
user_id: number;
nickname: string;
remark: string;
}[];
_handle(_payload: PayloadType): Promise<import("index").OB11User[]>;
}
export {};
@@ -0,0 +1,355 @@
# Form-Data [![NPM Module](https://img.shields.io/npm/v/form-data.svg)](https://www.npmjs.com/package/form-data) [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data)
A library to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications.
The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].
[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface
[![Linux Build](https://img.shields.io/travis/form-data/form-data/v4.0.4.svg?label=linux:6.x-12.x)](https://travis-ci.org/form-data/form-data)
[![MacOS Build](https://img.shields.io/travis/form-data/form-data/v4.0.4.svg?label=macos:6.x-12.x)](https://travis-ci.org/form-data/form-data)
[![Windows Build](https://img.shields.io/travis/form-data/form-data/v4.0.4.svg?label=windows:6.x-12.x)](https://travis-ci.org/form-data/form-data)
[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/v4.0.4.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master)
[![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data)
## Install
```
npm install --save form-data
```
## Usage
In this example we are constructing a form with 3 fields that contain a string,
a buffer and a file stream.
``` javascript
var FormData = require('form-data');
var fs = require('fs');
var form = new FormData();
form.append('my_field', 'my value');
form.append('my_buffer', new Buffer(10));
form.append('my_file', fs.createReadStream('/foo/bar.jpg'));
```
Also you can use http-response stream:
``` javascript
var FormData = require('form-data');
var http = require('http');
var form = new FormData();
http.request('http://nodejs.org/images/logo.png', function (response) {
form.append('my_field', 'my value');
form.append('my_buffer', new Buffer(10));
form.append('my_logo', response);
});
```
Or @mikeal's [request](https://github.com/request/request) stream:
``` javascript
var FormData = require('form-data');
var request = require('request');
var form = new FormData();
form.append('my_field', 'my value');
form.append('my_buffer', new Buffer(10));
form.append('my_logo', request('http://nodejs.org/images/logo.png'));
```
In order to submit this form to a web application, call ```submit(url, [callback])``` method:
``` javascript
form.submit('http://example.org/', function (err, res) {
// res – response object (http.IncomingMessage) //
res.resume();
});
```
For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.
### Custom options
You can provide custom options, such as `maxDataSize`:
``` javascript
var FormData = require('form-data');
var form = new FormData({ maxDataSize: 20971520 });
form.append('my_field', 'my value');
form.append('my_buffer', /* something big */);
```
List of available options could be found in [combined-stream](https://github.com/felixge/node-combined-stream/blob/master/lib/combined_stream.js#L7-L15)
### Alternative submission methods
You can use node's http client interface:
``` javascript
var http = require('http');
var request = http.request({
method: 'post',
host: 'example.org',
path: '/upload',
headers: form.getHeaders()
});
form.pipe(request);
request.on('response', function (res) {
console.log(res.statusCode);
});
```
Or if you would prefer the `'Content-Length'` header to be set for you:
``` javascript
form.submit('example.org/upload', function (err, res) {
console.log(res.statusCode);
});
```
To use custom headers and pre-known length in parts:
``` javascript
var CRLF = '\r\n';
var form = new FormData();
var options = {
header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,
knownLength: 1
};
form.append('my_buffer', buffer, options);
form.submit('http://example.com/', function (err, res) {
if (err) throw err;
console.log('Done');
});
```
Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually:
``` javascript
someModule.stream(function (err, stdout, stderr) {
if (err) throw err;
var form = new FormData();
form.append('file', stdout, {
filename: 'unicycle.jpg', // ... or:
filepath: 'photos/toys/unicycle.jpg',
contentType: 'image/jpeg',
knownLength: 19806
});
form.submit('http://example.com/', function (err, res) {
if (err) throw err;
console.log('Done');
});
});
```
The `filepath` property overrides `filename` and may contain a relative path. This is typically used when uploading [multiple files from a directory](https://wicg.github.io/entries-api/#dom-htmlinputelement-webkitdirectory).
For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:
``` javascript
form.submit({
host: 'example.com',
path: '/probably.php?extra=params',
auth: 'username:password'
}, function (err, res) {
console.log(res.statusCode);
});
```
In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`:
``` javascript
form.submit({
host: 'example.com',
path: '/surelynot.php',
headers: { 'x-test-header': 'test-header-value' }
}, function (err, res) {
console.log(res.statusCode);
});
```
### Methods
- [_Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] )](https://github.com/form-data/form-data#void-append-string-field-mixed-value--mixed-options-).
- [_Headers_ getHeaders( [**Headers** _userHeaders_] )](https://github.com/form-data/form-data#array-getheaders-array-userheaders-)
- [_String_ getBoundary()](https://github.com/form-data/form-data#string-getboundary)
- [_Void_ setBoundary()](https://github.com/form-data/form-data#void-setboundary)
- [_Buffer_ getBuffer()](https://github.com/form-data/form-data#buffer-getbuffer)
- [_Integer_ getLengthSync()](https://github.com/form-data/form-data#integer-getlengthsync)
- [_Integer_ getLength( **function** _callback_ )](https://github.com/form-data/form-data#integer-getlength-function-callback-)
- [_Boolean_ hasKnownLength()](https://github.com/form-data/form-data#boolean-hasknownlength)
- [_Request_ submit( _params_, **function** _callback_ )](https://github.com/form-data/form-data#request-submit-params-function-callback-)
- [_String_ toString()](https://github.com/form-data/form-data#string-tostring)
#### _Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] )
Append data to the form. You can submit about any format (string, integer, boolean, buffer, etc.). However, Arrays are not supported and need to be turned into strings by the user.
```javascript
var form = new FormData();
form.append('my_string', 'my value');
form.append('my_integer', 1);
form.append('my_boolean', true);
form.append('my_buffer', new Buffer(10));
form.append('my_array_as_json', JSON.stringify(['bird', 'cute']));
```
You may provide a string for options, or an object.
```javascript
// Set filename by providing a string for options
form.append('my_file', fs.createReadStream('/foo/bar.jpg'), 'bar.jpg');
// provide an object.
form.append('my_file', fs.createReadStream('/foo/bar.jpg'), { filename: 'bar.jpg', contentType: 'image/jpeg', knownLength: 19806 });
```
#### _Headers_ getHeaders( [**Headers** _userHeaders_] )
This method adds the correct `content-type` header to the provided array of `userHeaders`.
#### _String_ getBoundary()
Return the boundary of the formData. By default, the boundary consists of 26 `-` followed by 24 numbers
for example:
```javascript
--------------------------515890814546601021194782
```
#### _Void_ setBoundary(String _boundary_)
Set the boundary string, overriding the default behavior described above.
_Note: The boundary must be unique and may not appear in the data._
#### _Buffer_ getBuffer()
Return the full formdata request package, as a Buffer. You can insert this Buffer in e.g. Axios to send multipart data.
```javascript
var form = new FormData();
form.append('my_buffer', Buffer.from([0x4a,0x42,0x20,0x52,0x6f,0x63,0x6b,0x73]));
form.append('my_file', fs.readFileSync('/foo/bar.jpg'));
axios.post('https://example.com/path/to/api', form.getBuffer(), form.getHeaders());
```
**Note:** Because the output is of type Buffer, you can only append types that are accepted by Buffer: *string, Buffer, ArrayBuffer, Array, or Array-like Object*. A ReadStream for example will result in an error.
#### _Integer_ getLengthSync()
Same as `getLength` but synchronous.
_Note: getLengthSync __doesn't__ calculate streams length._
#### _Integer_ getLength(**function** _callback_ )
Returns the `Content-Length` async. The callback is used to handle errors and continue once the length has been calculated
```javascript
this.getLength(function (err, length) {
if (err) {
this._error(err);
return;
}
// add content length
request.setHeader('Content-Length', length);
...
}.bind(this));
```
#### _Boolean_ hasKnownLength()
Checks if the length of added values is known.
#### _Request_ submit(_params_, **function** _callback_ )
Submit the form to a web application.
```javascript
var form = new FormData();
form.append('my_string', 'Hello World');
form.submit('http://example.com/', function (err, res) {
// res – response object (http.IncomingMessage) //
res.resume();
} );
```
#### _String_ toString()
Returns the form data as a string. Don't use this if you are sending files or buffers, use `getBuffer()` instead.
### Integration with other libraries
#### Request
Form submission using [request](https://github.com/request/request):
```javascript
var formData = {
my_field: 'my_value',
my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),
};
request.post({url:'http://service.com/upload', formData: formData}, function (err, httpResponse, body) {
if (err) {
return console.error('upload failed:', err);
}
console.log('Upload successful! Server responded with:', body);
});
```
For more details see [request readme](https://github.com/request/request#multipartform-data-multipart-form-uploads).
#### node-fetch
You can also submit a form using [node-fetch](https://github.com/bitinn/node-fetch):
```javascript
var form = new FormData();
form.append('a', 1);
fetch('http://example.com', { method: 'POST', body: form })
.then(function (res) {
return res.json();
}).then(function (json) {
console.log(json);
});
```
#### axios
In Node.js you can post a file using [axios](https://github.com/axios/axios):
```javascript
const form = new FormData();
const stream = fs.createReadStream(PATH_TO_FILE);
form.append('image', stream);
// In Node.js environment you need to set boundary in the header field 'Content-Type' by calling method `getHeaders`
const formHeaders = form.getHeaders();
axios.post('http://example.com', form, {
headers: {
...formHeaders,
},
})
.then(response => response)
.catch(error => error)
```
## Notes
- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.
- ```getLength(cb)``` will send an error as first parameter of callback if stream length cannot be calculated (e.g. send in custom streams w/o using ```knownLength```).
- ```submit``` will not add `content-length` if form length is unknown or not calculable.
- Starting version `2.x` FormData has dropped support for `node@0.10.x`.
- Starting version `3.x` FormData has dropped support for `node@4.x`.
## License
Form-Data is released under the [MIT](License) license.
@@ -0,0 +1,11 @@
/**
* Pipe
* Compose other transformers to run linearily
* pipe(min(20), max(40))
* @param {...functions} transformers
* @return {function}
*/
const combineFunctions = (a, b) => (v) => b(a(v));
const pipe = (...transformers) => transformers.reduce(combineFunctions);
export { pipe };
@@ -0,0 +1,22 @@
/**
* Checks if `value` is `null`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `null`, else `false`.
* @example
*
* _.isNull(null);
* // => true
*
* _.isNull(void 0);
* // => false
*/
function isNull(value) {
return value === null;
}
module.exports = isNull;
@@ -0,0 +1,14 @@
import type { SchemaOptions } from '../schema/index.mjs';
import type { TProperties } from '../object/index.mjs';
import { Assert } from '../helpers/index.mjs';
import { type TMappedResult, type TMappedKey } from '../mapped/index.mjs';
import { type TIntrinsic, type IntrinsicMode } from './intrinsic.mjs';
import { type TLiteral, type TLiteralValue } from '../literal/index.mjs';
type TMappedIntrinsicPropertyKey<K extends PropertyKey, M extends IntrinsicMode> = {
[_ in K]: TIntrinsic<TLiteral<Assert<K, TLiteralValue>>, M>;
};
type TMappedIntrinsicPropertyKeys<K extends PropertyKey[], M extends IntrinsicMode, Acc extends TProperties = {}> = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TMappedIntrinsicPropertyKeys<R, M, Acc & TMappedIntrinsicPropertyKey<L, M>> : Acc);
type TMappedIntrinsicProperties<K extends TMappedKey, M extends IntrinsicMode> = (TMappedIntrinsicPropertyKeys<K['keys'], M>);
export type TIntrinsicFromMappedKey<K extends TMappedKey, M extends IntrinsicMode, P extends TProperties = TMappedIntrinsicProperties<K, M>> = (TMappedResult<P>);
export declare function IntrinsicFromMappedKey<K extends TMappedKey, M extends IntrinsicMode, P extends TProperties = TMappedIntrinsicProperties<K, M>>(T: K, M: M, options: SchemaOptions): TMappedResult<P>;
export {};
@@ -0,0 +1,43 @@
'use strict';
var keys = require('object-keys');
module.exports = function hasSymbols() {
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
if (typeof Symbol.iterator === 'symbol') { return true; }
var obj = {};
var sym = Symbol('test');
var symObj = Object(sym);
if (typeof sym === 'string') { return false; }
if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
/*
* temp disabled per https://github.com/ljharb/object.assign/issues/17
* if (sym instanceof Symbol) { return false; }
* temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
* if (!(symObj instanceof Symbol)) { return false; }
*/
var symVal = 42;
obj[sym] = symVal;
for (sym in obj) { return false; } // eslint-disable-line no-unreachable-loop
if (keys(obj).length !== 0) { return false; }
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
var syms = Object.getOwnPropertySymbols(obj);
if (syms.length !== 1 || syms[0] !== sym) { return false; }
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
if (typeof Object.getOwnPropertyDescriptor === 'function') {
var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
}
return true;
};
@@ -0,0 +1 @@
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/config/flat/react.ts"],"names":[],"mappings":"AASA,eAAe;IACb,QAAQ,EAAE;QACR,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;KACvD;IACD,eAAe,EAAE;QACf,aAAa,EAAE;YACb,YAAY,EAAE;gBACZ,GAAG,EAAE,IAAI;aACV;SACF;KACF;CAC6B,CAAA"}
@@ -0,0 +1,28 @@
import { DOMAttributes } from "@react-types/shared";
import { JSX, JSXElementConstructor, ReactNode } from "react";
export interface VisuallyHiddenProps extends DOMAttributes {
/** The content to visually hide. */
children?: ReactNode;
/**
* The element type for the container.
* @default 'div'
*/
elementType?: string | JSXElementConstructor<any>;
/** Whether the element should become visible on focus, for example skip links. */
isFocusable?: boolean;
}
export interface VisuallyHiddenAria {
visuallyHiddenProps: DOMAttributes;
}
/**
* Provides props for an element that hides its children visually
* but keeps content visible to assistive technology.
*/
export function useVisuallyHidden(props?: VisuallyHiddenProps): VisuallyHiddenAria;
/**
* VisuallyHidden hides its children visually, while keeping content visible
* to screen readers.
*/
export function VisuallyHidden(props: VisuallyHiddenProps): JSX.Element;
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,52 @@
import type { AnyNode } from "domhandler";
export interface DomSerializerOptions {
/**
* Print an empty attribute's value.
*
* @default xmlMode
* @example With <code>emptyAttrs: false</code>: <code>&lt;input checked&gt;</code>
* @example With <code>emptyAttrs: true</code>: <code>&lt;input checked=""&gt;</code>
*/
emptyAttrs?: boolean;
/**
* Print self-closing tags for tags without contents.
*
* @default xmlMode
* @example With <code>selfClosingTags: false</code>: <code>&lt;foo&gt;&lt;/foo&gt;</code>
* @example With <code>selfClosingTags: true</code>: <code>&lt;foo /&gt;</code>
*/
selfClosingTags?: boolean;
/**
* Treat the input as an XML document; enables the `emptyAttrs` and `selfClosingTags` options.
*
* If the value is `"foreign"`, it will try to correct mixed-case attribute names.
*
* @default false
*/
xmlMode?: boolean | "foreign";
/**
* Encode characters that are either reserved in HTML or XML.
*
* If `xmlMode` is `true` or the value not `'utf8'`, characters outside of the utf8 range will be encoded as well.
*
* @default `decodeEntities`
*/
encodeEntities?: boolean | "utf8";
/**
* Option inherited from parsing; will be used as the default value for `encodeEntities`.
*
* @default true
*/
decodeEntities?: boolean;
}
/**
* Renders a DOM node or an array of DOM nodes to a string.
*
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
*
* @param node Node to be rendered.
* @param options Changes serialization behavior
*/
export declare function render(node: AnyNode | ArrayLike<AnyNode>, options?: DomSerializerOptions): string;
export default render;
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,12 @@
import type { TSESTree } from '@typescript-eslint/types';
import { DefinitionBase } from './DefinitionBase';
import { DefinitionType } from './DefinitionType';
export declare class ParameterDefinition extends DefinitionBase<DefinitionType.Parameter, TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSDeclareFunction | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignature, null, TSESTree.BindingName> {
/**
* Whether the parameter definition is a part of a rest parameter.
*/
readonly isTypeDefinition = false;
readonly isVariableDefinition = true;
readonly rest: boolean;
constructor(name: TSESTree.BindingName, node: ParameterDefinition['node'], rest: boolean);
}
@@ -0,0 +1 @@
{"version":3,"sources":["util.js"],"names":["Object","defineProperty","exports","value","rewireSpecs","rewireSource","seedTokens","seedSpec","seedBlock","splitLines","splitSpace","splitCR","hasCR","isSpace","source","test","matches","match","slice","length","split","block","assign","description","tags","problems","spec","tag","name","type","optional","tokens","start","delimiter","postDelimiter","postTag","postName","postType","end","lineEnd","reduce","acc","line","set","number","Map","map","get"],"mappings":"AAAA;;AACAA,MAAM,CAACC,cAAP,CAAsBC,OAAtB,EAA+B,YAA/B,EAA6C;AAAEC,EAAAA,KAAK,EAAE;AAAT,CAA7C;AACAD,OAAO,CAACE,WAAR,GAAsBF,OAAO,CAACG,YAAR,GAAuBH,OAAO,CAACI,UAAR,GAAqBJ,OAAO,CAACK,QAAR,GAAmBL,OAAO,CAACM,SAAR,GAAoBN,OAAO,CAACO,UAAR,GAAqBP,OAAO,CAACQ,UAAR,GAAqBR,OAAO,CAACS,OAAR,GAAkBT,OAAO,CAACU,KAAR,GAAgBV,OAAO,CAACW,OAAR,GAAkB,KAAK,CAA5M;;AACA,SAASA,OAAT,CAAiBC,MAAjB,EAAyB;AACrB,SAAO,QAAQC,IAAR,CAAaD,MAAb,CAAP;AACH;;AACDZ,OAAO,CAACW,OAAR,GAAkBA,OAAlB;;AACA,SAASD,KAAT,CAAeE,MAAf,EAAuB;AACnB,SAAO,MAAMC,IAAN,CAAWD,MAAX,CAAP;AACH;;AACDZ,OAAO,CAACU,KAAR,GAAgBA,KAAhB;;AACA,SAASD,OAAT,CAAiBG,MAAjB,EAAyB;AACrB,QA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AK,MAAMnB,IAAX,IAAmBL,KAAK,CAACG,IAAzB,EAA+B;AAC3BE,IAAAA,IAAI,CAACZ,MAAL,GAAcY,IAAI,CAACZ,MAAL,CAAYgC,GAAZ,CAAiBJ,IAAD,IAAU5B,MAAM,CAACiC,GAAP,CAAWL,IAAI,CAACE,MAAhB,CAA1B,CAAd;AACH;;AACD,SAAOvB,KAAP;AACH;;AACDnB,OAAO,CAACG,YAAR,GAAuBA,YAAvB;AACA;AACA;AACA;AACA;AACA;;AACA,SAASD,WAAT,CAAqBiB,KAArB,EAA4B;AACxB,QAAMP,MAAM,GAAGO,KAAK,CAACG,IAAN,CAAWgB,MAAX,CAAkB,CAACC,GAAD,EAAMf,IAAN,KAAeA,IAAI,CAACZ,MAAL,CAAY0B,MAAZ,CAAmB,CAACC,GAAD,EAAMC,IAAN,KAAeD,GAAG,CAACE,GAAJ,CAAQD,IAAI,CAACE,MAAb,EAAqBF,IAArB,CAAlC,EAA8DD,GAA9D,CAAjC,EAAqG,IAAII,GAAJ,EAArG,CAAf;AACAxB,EAAAA,KAAK,CAACP,MAAN,GAAeO,KAAK,CAACP,MAAN,CAAagC,GAAb,CAAkBJ,IAAD,IAAU5B,MAAM,CAACiC,GAAP,CAAWL,IAAI,CAACE,MAAhB,KAA2BF,IAAtD,CAAf;AACA,SAAOrB,KAAP;AACH;;AACDnB,OAAO,CAACE,WAAR,GAAsBA,WAAtB","sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.rewireSpecs = exports.rewireSource = exports.seedTokens = exports.seedSpec = exports.seedBlock = exports.splitLines = exports.splitSpace = exports.splitCR = exports.hasCR = exports.isSpace = void 0;\nfunction isSpace(source) {\n return /^\\s+$/.test(source);\n}\nexports.isSpace = isSpace;\nfunction hasCR(source) {\n return /\\r$/.test(source);\n}\nexports.hasCR = hasCR;\nfunction splitCR(source) {\n const matches = source.match(/\\r+$/);\n return matches == null\n ? ['', source]\n : [source.slice(-matches[0].length), source.slice(0, -matches[0].length)];\n}\nexports.splitCR = splitCR;\nfunction splitSpace(source) {\n const matches = source.match(/^\\s+/);\n return matches == null\n ? ['', source]\n : [source.slice(0, matches[0].length), source.slice(matches[0].length)];\n}\nexports.splitSpace = splitSpace;\nfunction splitLines(source) {\n Line truncated
@@ -0,0 +1,30 @@
/**
* @typedef {import('hast').Element} Element
* @typedef {import('mdast').Delete} Delete
* @typedef {import('../state.js').State} State
*/
// Make VS Code show references to the above types.
''
/**
* Turn an mdast `delete` node into hast.
*
* @param {State} state
* Info passed around.
* @param {Delete} node
* mdast node.
* @returns {Element}
* hast node.
*/
export function strikethrough(state, node) {
/** @type {Element} */
const result = {
type: 'element',
tagName: 'del',
properties: {},
children: state.all(node)
}
state.patch(node, result)
return state.applyData(node, result)
}
@@ -0,0 +1,38 @@
{
"name": "@react-stately/list",
"version": "3.11.1",
"description": "Spectrum UI components in React",
"license": "Apache-2.0",
"main": "dist/main.js",
"module": "dist/module.js",
"exports": {
"types": "./dist/types.d.ts",
"import": "./dist/import.mjs",
"require": "./dist/main.js"
},
"types": "dist/types.d.ts",
"source": "src/index.ts",
"files": [
"dist",
"src"
],
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/adobe/react-spectrum"
},
"dependencies": {
"@react-stately/collections": "^3.12.0",
"@react-stately/selection": "^3.18.0",
"@react-stately/utils": "^3.10.5",
"@react-types/shared": "^3.26.0",
"@swc/helpers": "^0.5.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
},
"publishConfig": {
"access": "public"
},
"gitHead": "71f0ef23053f9e03ee7e97df736e8b083e006849"
}
@@ -0,0 +1 @@
{"version":3,"file":"updateSetMetadataWithList.spec.d.ts","sourceRoot":"","sources":["../../../../src/reflectMetadata/utils/updateSetMetadataWithList.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
import { __decorate } from "tslib";
import { AsnType, AsnTypeTypes, AsnProp } from "@peculiar/asn1-schema";
import { GeneralName } from "@peculiar/asn1-x509";
import { V2Form } from "./v2_form";
let AttCertIssuer = class AttCertIssuer {
constructor(params = {}) {
Object.assign(this, params);
}
};
__decorate([
AsnProp({ type: GeneralName, repeated: "sequence" })
], AttCertIssuer.prototype, "v1Form", void 0);
__decorate([
AsnProp({ type: V2Form, context: 0, implicit: true })
], AttCertIssuer.prototype, "v2Form", void 0);
AttCertIssuer = __decorate([
AsnType({ type: AsnTypeTypes.Choice })
], AttCertIssuer);
export { AttCertIssuer };
@@ -0,0 +1 @@
{"name":"@rollup/rollup-linux-x64-gnu","version":"4.53.2","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532090094,"integrity":"sha512-qPfek4fHSrxd7mgEWz6HHRZ0OrzJ309FR1luUGPQuIVBE5rytTm4oxpF3egLTLyRRxUbOpnf8togI+lqRpkQHQ==","mode":420,"size":480},"README.md":{"checkedAt":1794532090094,"integrity":"sha512-JfylgMnN67sEVrDeTJWU9LPg41B+KsNLLvXH2JHHaqBNw6qpjnfNng//L52tyyS6mexyHlfUW7zF2U1HdfL0gw==","mode":420,"size":95},"rollup.linux-x64-gnu.node":{"checkedAt":1794532090099,"integrity":"sha512-x3ytbeNpLZhPG6Se6CUrll2LLJrBNzQDSturOLMZlyFWYOqmkrlkKcQZff/rEPaRd07AArGcTARm433oMJeWGA==","mode":420,"size":2200024}}}
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,6FAAgB,CAAC;IAC5E,qBAAqB,CAAC,6IAAsB,CAAC;IAC7C,UAAU,CAAC,gBAAE,CAAC;IACd,eAAe,CAAC,mGAAe,CAAC;IAChC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,kFAAY,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,0FAAa,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,0FAAa,CAAC;QAAA,GAAG,CAAC,CAAC;IACxN,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,4EAAa,CAAC;AACvD","sources":["packages/@react-aria/grid/intl/ko-KR.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item}이(가) 선택되지 않았습니다.\",\n \"longPressToSelect\": \"선택 모드로 들어가려면 길게 누르십시오.\",\n \"select\": \"선택\",\n \"selectedAll\": \"모든 항목이 선택되었습니다.\",\n \"selectedCount\": \"{count, plural, =0 {선택된 항목이 없습니다} one {#개 항목이 선택되었습니다} other {#개 항목이 선택되었습니다}}.\",\n \"selectedItem\": \"{item}이(가) 선택되었습니다.\"\n}\n"],"names":[],"version":3,"file":"ko-KR.module.js.map"}
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/data-view-byte-offset
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with a single custom sponsorship URL
@@ -0,0 +1,319 @@
// https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/ShadowTreeWalker.ts
import {nodeContains} from './DOMFunctions';
import {shadowDOM} from '@react-stately/flags';
export class ShadowTreeWalker implements TreeWalker {
public readonly filter: NodeFilter | null;
public readonly root: Node;
public readonly whatToShow: number;
private _doc: Document;
private _walkerStack: Array<TreeWalker> = [];
private _currentNode: Node;
private _currentSetFor: Set<TreeWalker> = new Set();
constructor(
doc: Document,
root: Node,
whatToShow?: number,
filter?: NodeFilter | null
) {
this._doc = doc;
this.root = root;
this.filter = filter ?? null;
this.whatToShow = whatToShow ?? NodeFilter.SHOW_ALL;
this._currentNode = root;
this._walkerStack.unshift(
doc.createTreeWalker(root, whatToShow, this._acceptNode)
);
const shadowRoot = (root as Element).shadowRoot;
if (shadowRoot) {
const walker = this._doc.createTreeWalker(
shadowRoot,
this.whatToShow,
{acceptNode: this._acceptNode}
);
this._walkerStack.unshift(walker);
}
}
private _acceptNode = (node: Node): number => {
if (node.nodeType === Node.ELEMENT_NODE) {
const shadowRoot = (node as Element).shadowRoot;
if (shadowRoot) {
const walker = this._doc.createTreeWalker(
shadowRoot,
this.whatToShow,
{acceptNode: this._acceptNode}
);
this._walkerStack.unshift(walker);
return NodeFilter.FILTER_ACCEPT;
} else {
if (typeof this.filter === 'function') {
return this.filter(node);
} else if (this.filter?.acceptNode) {
return this.filter.acceptNode(node);
} else if (this.filter === null) {
return NodeFilter.FILTER_ACCEPT;
}
}
}
return NodeFilter.FILTER_SKIP;
};
public get currentNode(): Node {
return this._currentNode;
}
public set currentNode(node: Node) {
if (!nodeContains(this.root, node)) {
throw new Error(
'Cannot set currentNode to a node that is not contained by the root node.'
);
}
const walkers: TreeWalker[] = [];
let curNode: Node | null | undefined = node;
let currentWalkerCurrentNode = node;
this._currentNode = node;
while (curNode && curNode !== this.root) {
if (curNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
const shadowRoot = curNode as ShadowRoot;
const walker = this._doc.createTreeWalker(
shadowRoot,
this.whatToShow,
{acceptNode: this._acceptNode}
);
walkers.push(walker);
walker.currentNode = currentWalkerCurrentNode;
this._currentSetFor.add(walker);
curNode = currentWalkerCurrentNode = shadowRoot.host;
} else {
curNode = curNode.parentNode;
}
}
const walker = this._doc.createTreeWalker(
this.root,
this.whatToShow,
{acceptNode: this._acceptNode}
);
walkers.push(walker);
walker.currentNode = currentWalkerCurrentNode;
this._currentSetFor.add(walker);
this._walkerStack = walkers;
}
public get doc(): Document {
return this._doc;
}
public firstChild(): Node | null {
let currentNode = this.currentNode;
let newNode = this.nextNode();
if (!nodeContains(currentNode, newNode)) {
this.currentNode = currentNode;
return null;
}
if (newNode) {
this.currentNode = newNode;
}
return newNode;
}
public lastChild(): Node | null {
let walker = this._walkerStack[0];
let newNode = walker.lastChild();
if (newNode) {
this.currentNode = newNode;
}
return newNode;
}
public nextNode(): Node | null {
const nextNode = this._walkerStack[0].nextNode();
if (nextNode) {
const shadowRoot = (nextNode as Element).shadowRoot;
if (shadowRoot) {
let nodeResult: number | undefined;
if (typeof this.filter === 'function') {
nodeResult = this.filter(nextNode);
} else if (this.filter?.acceptNode) {
nodeResult = this.filter.acceptNode(nextNode);
}
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
this.currentNode = nextNode;
return nextNode;
}
// _acceptNode should have added new walker for this shadow,
// go in recursively.
let newNode = this.nextNode();
if (newNode) {
this.currentNode = newNode;
}
return newNode;
}
if (nextNode) {
this.currentNode = nextNode;
}
return nextNode;
} else {
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.nextNode();
if (newNode) {
this.currentNode = newNode;
}
return newNode;
} else {
return null;
}
}
}
public previousNode(): Node | null {
const currentWalker = this._walkerStack[0];
if (currentWalker.currentNode === currentWalker.root) {
if (this._currentSetFor.has(currentWalker)) {
this._currentSetFor.delete(currentWalker);
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.previousNode();
if (newNode) {
this.currentNode = newNode;
}
return newNode;
} else {
return null;
}
}
return null;
}
const previousNode = currentWalker.previousNode();
if (previousNode) {
const shadowRoot = (previousNode as Element).shadowRoot;
if (shadowRoot) {
let nodeResult: number | undefined;
if (typeof this.filter === 'function') {
nodeResult = this.filter(previousNode);
} else if (this.filter?.acceptNode) {
nodeResult = this.filter.acceptNode(previousNode);
}
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
if (previousNode) {
this.currentNode = previousNode;
}
return previousNode;
}
// _acceptNode should have added new walker for this shadow,
// go in recursively.
let newNode = this.lastChild();
if (newNode) {
this.currentNode = newNode;
}
return newNode;
}
if (previousNode) {
this.currentNode = previousNode;
}
return previousNode;
} else {
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.previousNode();
if (newNode) {
this.currentNode = newNode;
}
return newNode;
} else {
return null;
}
}
}
/**
* @deprecated
*/
public nextSibling(): Node | null {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
/**
* @deprecated
*/
public previousSibling(): Node | null {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
/**
* @deprecated
*/
public parentNode(): Node | null {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
}
/**
* ShadowDOM safe version of document.createTreeWalker.
*/
export function createShadowTreeWalker(
doc: Document,
root: Node,
whatToShow?: number,
filter?: NodeFilter | null
): TreeWalker {
if (shadowDOM()) {
return new ShadowTreeWalker(doc, root, whatToShow, filter);
}
return doc.createTreeWalker(root, whatToShow, filter);
}
@@ -0,0 +1,452 @@
| Linux / MacOS / Windows | Coverage | Downloads |
| ----------------------- | -------- | --------- |
| [![build][bb]][bl] | [![coverage][cb]][cl] | [![downloads][db]][dl] |
[bb]: https://github.com/kaelzhang/node-ignore/actions/workflows/nodejs.yml/badge.svg
[bl]: https://github.com/kaelzhang/node-ignore/actions/workflows/nodejs.yml
[cb]: https://codecov.io/gh/kaelzhang/node-ignore/branch/master/graph/badge.svg
[cl]: https://codecov.io/gh/kaelzhang/node-ignore
[db]: http://img.shields.io/npm/dm/ignore.svg
[dl]: https://www.npmjs.org/package/ignore
# ignore
`ignore` is a manager, filter and parser which implemented in pure JavaScript according to the [.gitignore spec 2.22.1](http://git-scm.com/docs/gitignore).
`ignore` is used by eslint, gitbook and [many others](https://www.npmjs.com/browse/depended/ignore).
Pay **ATTENTION** that [`minimatch`](https://www.npmjs.org/package/minimatch) (which used by `fstream-ignore`) does not follow the gitignore spec.
To filter filenames according to a .gitignore file, I recommend this npm package, `ignore`.
To parse an `.npmignore` file, you should use `minimatch`, because an `.npmignore` file is parsed by npm using `minimatch` and it does not work in the .gitignore way.
### Tested on
`ignore` is fully tested, and has more than **five hundreds** of unit tests.
- Linux + Node: `0.8` - `7.x`
- Windows + Node: `0.10` - `7.x`, node < `0.10` is not tested due to the lack of support of appveyor.
Actually, `ignore` does not rely on any versions of node specially.
Since `4.0.0`, ignore will no longer support `node < 6` by default, to use in node < 6, `require('ignore/legacy')`. For details, see [CHANGELOG](https://github.com/kaelzhang/node-ignore/blob/master/CHANGELOG.md).
## Table Of Main Contents
- [Usage](#usage)
- [`Pathname` Conventions](#pathname-conventions)
- See Also:
- [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules.
- [Upgrade Guide](#upgrade-guide)
## Install
```sh
npm i ignore
```
## Usage
```js
import ignore from 'ignore'
const ig = ignore().add(['.abc/*', '!.abc/d/'])
```
### Filter the given paths
```js
const paths = [
'.abc/a.js', // filtered out
'.abc/d/e.js' // included
]
ig.filter(paths) // ['.abc/d/e.js']
ig.ignores('.abc/a.js') // true
```
### As the filter function
```js
paths.filter(ig.createFilter()); // ['.abc/d/e.js']
```
### Win32 paths will be handled
```js
ig.filter(['.abc\\a.js', '.abc\\d\\e.js'])
// if the code above runs on windows, the result will be
// ['.abc\\d\\e.js']
```
## Why another ignore?
- `ignore` is a standalone module, and is much simpler so that it could easy work with other programs, unlike [isaacs](https://npmjs.org/~isaacs)'s [fstream-ignore](https://npmjs.org/package/fstream-ignore) which must work with the modules of the fstream family.
- `ignore` only contains utility methods to filter paths according to the specified ignore rules, so
- `ignore` never try to find out ignore rules by traversing directories or fetching from git configurations.
- `ignore` don't cares about sub-modules of git projects.
- Exactly according to [gitignore man page](http://git-scm.com/docs/gitignore), fixes some known matching issues of fstream-ignore, such as:
- '`/*.js`' should only match '`a.js`', but not '`abc/a.js`'.
- '`**/foo`' should match '`foo`' anywhere.
- Prevent re-including a file if a parent directory of that file is excluded.
- Handle trailing whitespaces:
- `'a '`(one space) should not match `'a '`(two spaces).
- `'a \ '` matches `'a '`
- All test cases are verified with the result of `git check-ignore`.
# Methods
## .add(pattern: string | Ignore): this
## .add(patterns: Array<string | Ignore>): this
## .add({pattern: string, mark?: string}): this since 7.0.0
- **pattern** `string | Ignore` An ignore pattern string, or the `Ignore` instance
- **patterns** `Array<string | Ignore>` Array of ignore patterns.
- **mark?** `string` Pattern mark, which is used to associate the pattern with a certain marker, such as the line no of the `.gitignore` file. Actually it could be an arbitrary string and is optional.
Adds a rule or several rules to the current manager.
Returns `this`
Notice that a line starting with `'#'`(hash) is treated as a comment. Put a backslash (`'\'`) in front of the first hash for patterns that begin with a hash, if you want to ignore a file with a hash at the beginning of the filename.
```js
ignore().add('#abc').ignores('#abc') // false
ignore().add('\\#abc').ignores('#abc') // true
```
`pattern` could either be a line of ignore pattern or a string of multiple ignore patterns, which means we could just `ignore().add()` the content of a ignore file:
```js
ignore()
.add(fs.readFileSync(filenameOfGitignore).toString())
.filter(filenames)
```
`pattern` could also be an `ignore` instance, so that we could easily inherit the rules of another `Ignore` instance.
## .ignores(pathname: [Pathname](#pathname-conventions)): boolean
> new in 3.2.0
Returns `Boolean` whether `pathname` should be ignored.
```js
ig.ignores('.abc/a.js') // true
```
Please **PAY ATTENTION** that `.ignores()` is **NOT** equivalent to `git check-ignore` although in most cases they return equivalent results.
However, for the purposes of imitating the behavior of `git check-ignore`, please use `.checkIgnore()` instead.
### `Pathname` Conventions:
#### 1. `Pathname` should be a `path.relative()`d pathname
`Pathname` should be a string that have been `path.join()`ed, or the return value of `path.relative()` to the current directory,
```js
// WRONG, an error will be thrown
ig.ignores('./abc')
// WRONG, for it will never happen, and an error will be thrown
// If the gitignore rule locates at the root directory,
// `'/abc'` should be changed to `'abc'`.
// ```
// path.relative('/', '/abc') -> 'abc'
// ```
ig.ignores('/abc')
// WRONG, that it is an absolute path on Windows, an error will be thrown
ig.ignores('C:\\abc')
// Right
ig.ignores('abc')
// Right
ig.ignores(path.join('./abc')) // path.join('./abc') -> 'abc'
```
In other words, each `Pathname` here should be a relative path to the directory of the gitignore rules.
Suppose the dir structure is:
```
/path/to/your/repo
|-- a
| |-- a.js
|
|-- .b
|
|-- .c
|-- .DS_store
```
Then the `paths` might be like this:
```js
[
'a/a.js'
'.b',
'.c/.DS_store'
]
```
#### 2. filenames and dirnames
`node-ignore` does NO `fs.stat` during path matching, so `node-ignore` treats
- `foo` as a file
- **`foo/` as a directory**
For the example below:
```js
// First, we add a ignore pattern to ignore a directory
ig.add('config/')
// `ig` does NOT know if 'config', in the real world,
// is a normal file, directory or something.
ig.ignores('config')
// `ig` treats `config` as a file, so it returns `false`
ig.ignores('config/')
// returns `true`
```
Specially for people who develop some library based on `node-ignore`, it is important to understand that.
Usually, you could use [`glob`](http://npmjs.org/package/glob) with `option.mark = true` to fetch the structure of the current directory:
```js
import glob from 'glob'
glob('**', {
// Adds a / character to directory matches.
mark: true
}, (err, files) => {
if (err) {
return console.error(err)
}
let filtered = ignore().add(patterns).filter(files)
console.log(filtered)
})
```
## .filter(paths: Array&lt;Pathname&gt;): Array&lt;Pathname&gt;
```ts
type Pathname = string
```
Filters the given array of pathnames, and returns the filtered array.
- **paths** `Array.<Pathname>` The array of `pathname`s to be filtered.
## .createFilter()
Creates a filter function which could filter an array of paths with `Array.prototype.filter`.
Returns `function(path)` the filter function.
## .test(pathname: Pathname): TestResult
> New in 5.0.0
Returns `TestResult`
```ts
// Since 5.0.0
interface TestResult {
ignored: boolean
// true if the `pathname` is finally unignored by some negative pattern
unignored: boolean
// The `IgnoreRule` which ignores the pathname
rule?: IgnoreRule
}
// Since 7.0.0
interface IgnoreRule {
// The original pattern
pattern: string
// Whether the pattern is a negative pattern
negative: boolean
// Which is used for other packages to build things upon `node-ignore`
mark?: string
}
```
- `{ignored: true, unignored: false}`: the `pathname` is ignored
- `{ignored: false, unignored: true}`: the `pathname` is unignored
- `{ignored: false, unignored: false}`: the `pathname` is never matched by any ignore rules.
## .checkIgnore(target: string): TestResult
> new in 7.0.0
Debugs gitignore / exclude files, which is equivalent to `git check-ignore -v`. Usually this method is used for other packages to implement the function of `git check-ignore -v` upon `node-ignore`
- **target** `string` the target to test.
Returns `TestResult`
```js
ig.add({
pattern: 'foo/*',
mark: '60'
})
const {
ignored,
rule
} = checkIgnore('foo/')
if (ignored) {
console.log(`.gitignore:${result}:${rule.mark}:${rule.pattern} foo/`)
}
// .gitignore:60:foo/* foo/
```
Please pay attention that this method does not have a strong built-in cache mechanism.
The purpose of introducing this method is to make it possible to implement the `git check-ignore` command in JavaScript based on `node-ignore`.
So do not use this method in those situations where performance is extremely important.
## static `isPathValid(pathname): boolean` since 5.0.0
Check whether the `pathname` is an valid `path.relative()`d path according to the [convention](#1-pathname-should-be-a-pathrelatived-pathname).
This method is **NOT** used to check if an ignore pattern is valid.
```js
import {isPathValid} from 'ignore'
isPathValid('./foo') // false
```
## <strike>.addIgnoreFile(path)</strike>
REMOVED in `3.x` for now.
To upgrade `ignore@2.x` up to `3.x`, use
```js
import fs from 'fs'
if (fs.existsSync(filename)) {
ignore().add(fs.readFileSync(filename).toString())
}
```
instead.
## ignore(options)
### `options.ignorecase` since 4.0.0
Similar to the `core.ignorecase` option of [git-config](https://git-scm.com/docs/git-config), `node-ignore` will be case insensitive if `options.ignorecase` is set to `true` (the default value), otherwise case sensitive.
```js
const ig = ignore({
ignorecase: false
})
ig.add('*.png')
ig.ignores('*.PNG') // false
```
### `options.ignoreCase?: boolean` since 5.2.0
Which is an alternative to `options.ignoreCase`
### `options.allowRelativePaths?: boolean` since 5.2.0
This option brings backward compatibility with projects which based on `ignore@4.x`. If `options.allowRelativePaths` is `true`, `ignore` will not check whether the given path to be tested is [`path.relative()`d](#pathname-conventions).
However, passing a relative path, such as `'./foo'` or `'../foo'`, to test if it is ignored or not is not a good practise, which might lead to unexpected behavior
```js
ignore({
allowRelativePaths: true
}).ignores('../foo/bar.js') // And it will not throw
```
****
# Upgrade Guide
## Upgrade 4.x -> 5.x
Since `5.0.0`, if an invalid `Pathname` passed into `ig.ignores()`, an error will be thrown, unless `options.allowRelative = true` is passed to the `Ignore` factory.
While `ignore < 5.0.0` did not make sure what the return value was, as well as
```ts
.ignores(pathname: Pathname): boolean
.filter(pathnames: Array<Pathname>): Array<Pathname>
.createFilter(): (pathname: Pathname) => boolean
.test(pathname: Pathname): {ignored: boolean, unignored: boolean}
```
See the convention [here](#1-pathname-should-be-a-pathrelatived-pathname) for details.
If there are invalid pathnames, the conversion and filtration should be done by users.
```js
import {isPathValid} from 'ignore' // introduced in 5.0.0
const paths = [
// invalid
//////////////////
'',
false,
'../foo',
'.',
//////////////////
// valid
'foo'
]
.filter(isPathValid)
ig.filter(paths)
```
## Upgrade 3.x -> 4.x
Since `4.0.0`, `ignore` will no longer support node < 6, to use `ignore` in node < 6:
```js
var ignore = require('ignore/legacy')
```
## Upgrade 2.x -> 3.x
- All `options` of 2.x are unnecessary and removed, so just remove them.
- `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed.
- `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details.
****
# Collaborators
- [@whitecolor](https://github.com/whitecolor) *Alex*
- [@SamyPesse](https://github.com/SamyPesse) *Samy Pessé*
- [@azproduction](https://github.com/azproduction) *Mikhail Davydov*
- [@TrySound](https://github.com/TrySound) *Bogdan Chadkin*
- [@JanMattner](https://github.com/JanMattner) *Jan Mattner*
- [@ntwb](https://github.com/ntwb) *Stephen Edgar*
- [@kasperisager](https://github.com/kasperisager) *Kasper Isager*
- [@sandersn](https://github.com/sandersn) *Nathan Shively-Sanders*
@@ -0,0 +1,226 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {AriaSliderProps} from '@react-types/slider';
import {clamp, mergeProps, useGlobalListeners} from '@react-aria/utils';
import {DOMAttributes, RefObject} from '@react-types/shared';
import {getSliderThumbId, sliderData} from './utils';
import React, {LabelHTMLAttributes, OutputHTMLAttributes, useRef} from 'react';
import {setInteractionModality, useMove} from '@react-aria/interactions';
import {SliderState} from '@react-stately/slider';
import {useLabel} from '@react-aria/label';
import {useLocale} from '@react-aria/i18n';
export interface SliderAria {
/** Props for the label element. */
labelProps: LabelHTMLAttributes<HTMLLabelElement>,
/** Props for the root element of the slider component; groups slider inputs. */
groupProps: DOMAttributes,
/** Props for the track element. */
trackProps: DOMAttributes,
/** Props for the output element, displaying the value of the slider thumbs. */
outputProps: OutputHTMLAttributes<HTMLOutputElement>
}
/**
* Provides the behavior and accessibility implementation for a slider component representing one or more values.
*
* @param props Props for the slider.
* @param state State for the slider, as returned by `useSliderState`.
* @param trackRef Ref for the "track" element. The width of this element provides the "length"
* of the track -- the span of one dimensional space that the slider thumb can be. It also
* accepts click and drag motions, so that the closest thumb will follow clicks and drags on
* the track.
*/
export function useSlider<T extends number | number[]>(
props: AriaSliderProps<T>,
state: SliderState,
trackRef: RefObject<Element | null>
): SliderAria {
let {labelProps, fieldProps} = useLabel(props);
let isVertical = props.orientation === 'vertical';
// Attach id of the label to the state so it can be accessed by useSliderThumb.
sliderData.set(state, {
id: (labelProps.id ?? fieldProps.id)!,
'aria-describedby': props['aria-describedby'],
'aria-details': props['aria-details']
});
let {direction} = useLocale();
let {addGlobalListener, removeGlobalListener} = useGlobalListeners();
// When the user clicks or drags the track, we want the motion to set and drag the
// closest thumb. Hence we also need to install useMove() on the track element.
// Here, we keep track of which index is the "closest" to the drag start point.
// It is set onMouseDown/onTouchDown; see trackProps below.
const realTimeTrackDraggingIndex = useRef<number | null>(null);
const reverseX = direction === 'rtl';
const currentPosition = useRef<number | null>(null);
const {moveProps} = useMove({
onMoveStart() {
currentPosition.current = null;
},
onMove({deltaX, deltaY}) {
if (!trackRef.current) {
return;
}
let {height, width} = trackRef.current.getBoundingClientRect();
let size = isVertical ? height : width;
if (currentPosition.current == null && realTimeTrackDraggingIndex.current != null) {
currentPosition.current = state.getThumbPercent(realTimeTrackDraggingIndex.current) * size;
}
let delta = isVertical ? deltaY : deltaX;
if (isVertical || reverseX) {
delta = -delta;
}
currentPosition.current! += delta;
if (realTimeTrackDraggingIndex.current != null && trackRef.current) {
const percent = clamp(currentPosition.current! / size, 0, 1);
state.setThumbPercent(realTimeTrackDraggingIndex.current, percent);
}
},
onMoveEnd() {
if (realTimeTrackDraggingIndex.current != null) {
state.setThumbDragging(realTimeTrackDraggingIndex.current, false);
realTimeTrackDraggingIndex.current = null;
}
}
});
let currentPointer = useRef<number | null | undefined>(undefined);
let onDownTrack = (e: React.UIEvent, id: number | undefined, clientX: number, clientY: number) => {
// We only trigger track-dragging if the user clicks on the track itself and nothing is currently being dragged.
if (trackRef.current && !props.isDisabled && state.values.every((_, i) => !state.isThumbDragging(i))) {
let {height, width, top, left} = trackRef.current.getBoundingClientRect();
let size = isVertical ? height : width;
// Find the closest thumb
const trackPosition = isVertical ? top : left;
const clickPosition = isVertical ? clientY : clientX;
const offset = clickPosition - trackPosition;
let percent = offset / size;
if (direction === 'rtl' || isVertical) {
percent = 1 - percent;
}
let value = state.getPercentValue(percent);
// to find the closet thumb we split the array based on the first thumb position to the "right/end" of the click.
let closestThumb;
let split = state.values.findIndex(v => value - v < 0);
if (split === 0) { // If the index is zero then the closetThumb is the first one
closestThumb = split;
} else if (split === -1) { // If no index is found they've clicked past all the thumbs
closestThumb = state.values.length - 1;
} else {
let lastLeft = state.values[split - 1];
let firstRight = state.values[split];
// Pick the last left/start thumb, unless they are stacked on top of each other, then pick the right/end one
if (Math.abs(lastLeft - value) < Math.abs(firstRight - value)) {
closestThumb = split - 1;
} else {
closestThumb = split;
}
}
// Confirm that the found closest thumb is editable, not disabled, and move it
if (closestThumb >= 0 && state.isThumbEditable(closestThumb)) {
// Don't unfocus anything
e.preventDefault();
realTimeTrackDraggingIndex.current = closestThumb;
state.setFocusedThumb(closestThumb);
currentPointer.current = id;
state.setThumbDragging(realTimeTrackDraggingIndex.current!, true);
state.setThumbValue(closestThumb, value);
addGlobalListener(window, 'mouseup', onUpTrack, false);
addGlobalListener(window, 'touchend', onUpTrack, false);
addGlobalListener(window, 'pointerup', onUpTrack, false);
} else {
realTimeTrackDraggingIndex.current = null;
}
}
};
let onUpTrack = (e) => {
let id = e.pointerId ?? e.changedTouches?.[0].identifier;
if (id === currentPointer.current) {
if (realTimeTrackDraggingIndex.current != null) {
state.setThumbDragging(realTimeTrackDraggingIndex.current, false);
realTimeTrackDraggingIndex.current = null;
}
removeGlobalListener(window, 'mouseup', onUpTrack, false);
removeGlobalListener(window, 'touchend', onUpTrack, false);
removeGlobalListener(window, 'pointerup', onUpTrack, false);
}
};
if ('htmlFor' in labelProps && labelProps.htmlFor) {
// Ideally the `for` attribute should point to the first thumb, but VoiceOver on iOS
// causes this to override the `aria-labelledby` on the thumb. This causes the first
// thumb to only be announced as the slider label rather than its individual name as well.
// See https://bugs.webkit.org/show_bug.cgi?id=172464.
delete labelProps.htmlFor;
labelProps.onClick = () => {
// Safari does not focus <input type="range"> elements when clicking on an associated <label>,
// so do it manually. In addition, make sure we show the focus ring.
document.getElementById(getSliderThumbId(state, 0))?.focus();
setInteractionModality('keyboard');
};
}
return {
labelProps,
// The root element of the Slider will have role="group" to group together
// all the thumb inputs in the Slider. The label of the Slider will
// be used to label the group.
groupProps: {
role: 'group',
...fieldProps
},
trackProps: mergeProps({
onMouseDown(e: React.MouseEvent) {
if (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey) {
return;
}
onDownTrack(e, undefined, e.clientX, e.clientY);
},
onPointerDown(e: React.PointerEvent) {
if (e.pointerType === 'mouse' && (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)) {
return;
}
onDownTrack(e, e.pointerId, e.clientX, e.clientY);
},
onTouchStart(e: React.TouchEvent) { onDownTrack(e, e.changedTouches[0].identifier, e.changedTouches[0].clientX, e.changedTouches[0].clientY); },
style: {
position: 'relative',
touchAction: 'none'
}
}, moveProps),
outputProps: {
htmlFor: state.values.map((_, index) => getSliderThumbId(state, index)).join(' '),
'aria-live': 'off'
}
};
}
@@ -0,0 +1 @@
{"mappings":";;;;;;AAiBA,6CAA6C,CAAC;IAC5C,UAAU,EAAE,CAAC,CAAC;IACd,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,GAAG,CAAC,EAAE,UAAU,WAAW,GAAG,IAAI,CAAC,CAAC;IACpC,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,QAAQ,CAAC;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,gDAAgD;IAChD,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CAC3B;AAED,kCAAkC,CAAC,EAAE,CAAC,SAAS,eAAe,CAAC,CAAC,CAAE,YAAW,gBAAgB;IAC3F,UAAU,EAAE,CAAC,CAAC;IACd,SAAS,CAAC,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC7C,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;IAC/B,SAAS,CAAC,QAAQ,EAAE,KAAK,QAAQ,GAAG,SAAS,CAAC;IAC9C,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IACzC,SAAS,CAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC;gBAExB,OAAO,EAAE,4BAA4B,CAAC,CAAC;IAanD,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,OAAO;IAIxC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,OAAO;IAQvC,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,G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,CAAC;IAChC,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;QAII;IACJ,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED;IACE,uCAAuC;IACvC,aAAa,EAAE,aAAa,CAAC;IAC7B,wDAAwD;IACxD,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;GAIG;AACH,4BAA4B,CAAC,EAAE,CAAC,SAAS,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,gBAAgB,GAAG,IAAI,CAAC,GAAG,YAAY,CAwO/J;ACrRD;IACE,qCAAqC;IACrC,GAAG,EAAE,GAAG,CAAA;CACT;AAED;IACE,oDAAoD;IACpD,aAAa,EAAE,iBAAiB,CAAA;CACjC;AAGD;;;;GAIG;AACH,yCAAyC,CAAC,EAAE,CAAC,SAAS,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,8BAA8B,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,GAAG,yBAAyB,CAsBjK","sources":["packages/@react-aria/grid/src/packages/@react-aria/grid/src/GridKeyboardDelegate.ts","packages/@react-aria/grid/src/packages/@react-aria/grid/src/utils.ts","packages/@react-aria/grid/src/packages/@react-aria/grid/src/useGridSelectionAnnouncement.ts","packages/@react-aria/grid/src/packages/@react-aria/grid/src/useHiLine truncated
@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getInclusionReasons = getInclusionReasons;
var _semver = require("semver");
var _pretty = require("./pretty.js");
var _utils = require("./utils.js");
function getInclusionReasons(item, targetVersions, list) {
const minVersions = list[item] || {};
return Object.keys(targetVersions).reduce((result, env) => {
const minVersion = (0, _utils.getLowestImplementedVersion)(minVersions, env);
const targetVersion = targetVersions[env];
if (!minVersion) {
result[env] = (0, _pretty.prettifyVersion)(targetVersion);
} else {
const minIsUnreleased = (0, _utils.isUnreleasedVersion)(minVersion, env);
const targetIsUnreleased = (0, _utils.isUnreleasedVersion)(targetVersion, env);
if (!targetIsUnreleased && (minIsUnreleased || _semver.lt(targetVersion.toString(), (0, _utils.semverify)(minVersion)))) {
result[env] = (0, _pretty.prettifyVersion)(targetVersion);
}
}
return result;
}, {});
}
//# sourceMappingURL=debug.js.map
@@ -0,0 +1,48 @@
# jsx-a11y/img-redundant-alt
💼 This rule is enabled in the following configs: ☑️ `recommended`, 🔒 `strict`.
<!-- end auto-generated rule header -->
Enforce img alt attribute does not contain the word image, picture, or photo. Screen readers already announce `img` elements as an image. There is no need to use words such as *image*, *photo*, and/or *picture*.
## Rule options
This rule takes one optional object argument of type object:
```json
{
"rules": {
"jsx-a11y/img-redundant-alt": [ 2, {
"components": [ "Image" ],
"words": [ "Bild", "Foto" ],
}],
}
}
```
For the `components` option, these strings determine which JSX elements (**always including** `<img>`) should be checked for having redundant words in the `alt` prop value . This is a good use case when you have a wrapper component that simply renders an `img` element (like in React).
For the `words` option, these strings can be used to specify custom words that should be checked for in the alt prop, including `image`, `photo`, and `picture`. Useful for specifying words in other languages.
The rule will first check if `aria-hidden` is true to determine whether to enforce the rule. If the image is hidden, then rule will always succeed.
### Succeed
```jsx
<img src="foo" alt="Foo eating a sandwich." />
<img src="bar" aria-hidden alt="Picture of me taking a photo of an image" /> // Will pass because it is hidden.
<img src="baz" alt={`Baz taking a ${photo}`} /> // This is valid since photo is a variable name.
```
### Fail
```jsx
<img src="foo" alt="Photo of foo being weird." />
<img src="bar" alt="Image of me at a bar!" />
<img src="baz" alt="Picture of baz fixing a bug." />
```
## Accessibility guidelines
General best practice (reference resources)
### Resources
- [WebAIM, Alternative Text](https://webaim.org/techniques/alttext/)
@@ -0,0 +1,11 @@
import { isoBase64URL } from './iso/index.js';
/**
* Take a certificate in PEM format and convert it to bytes
*/
export function convertPEMToBytes(pem) {
const certBase64 = pem
.replace('-----BEGIN CERTIFICATE-----', '')
.replace('-----END CERTIFICATE-----', '')
.replace(/[\n ]/g, '');
return isoBase64URL.toBuffer(certBase64, 'base64');
}
@@ -0,0 +1,35 @@
import { OverlayTriggerProps } from '@react-types/overlays';
import { CollectionBase, AsyncLoadable, InputBase, DOMProps, HelpTextProps, Validation, LabelableProps, TextInputBase, MultipleSelection, FocusableProps, ValidationError } from '@react-types/shared';
import { MenuTriggerState } from '@react-stately/menu';
import { FormValidationState } from '@react-stately/form';
import { MultiSelectListState } from './use-multiselect-list-state.js';
import '@react-stately/list';
import 'react';
interface MultiSelectProps<T> extends CollectionBase<T>, AsyncLoadable, Omit<InputBase, "isReadOnly">, DOMProps, HelpTextProps, Omit<Validation<T>, "validate">, LabelableProps, TextInputBase, Omit<MultipleSelection, "none">, FocusableProps, OverlayTriggerProps {
/**
* Whether the menu should automatically flip direction when space is limited.
* @default true
*/
shouldFlip?: boolean;
/**
* A function that returns an error message if a given value is invalid.
* Validation errors are displayed to the user when the form is submitted
* if `validationBehavior="native"`. For realtime validation, use the `isInvalid`
* prop instead.
*/
validate?: (value: string | string[]) => ValidationError | true | null | undefined;
/**
* Whether the menu should be hidden when there are no items.
*/
hideEmptyContent?: boolean;
}
interface MultiSelectState<T> extends MultiSelectListState<T>, MenuTriggerState, FormValidationState {
/** Whether the select is currently focused. */
isFocused: boolean;
/** Sets whether the select is focused. */
setFocused(isFocused: boolean): void;
}
declare function useMultiSelectState<T extends object>({ validate, validationBehavior, ...props }: MultiSelectProps<T>): MultiSelectState<T>;
export { MultiSelectProps, MultiSelectState, useMultiSelectState };
@@ -0,0 +1,820 @@
flf2a$ 8 8 20 -1 3
banner3-D by Merlin Greywolf merlin@brahms.udel.edu
August 9, 1994
:::@
:::@
:::@
:::@
:::@
:::@
:::@
:::@@
'####:@
####:@
####:@
: ##::@
:..:::@
'####:@
####:@
....::@@
'####'####:@
#### ####:@
. ##:. ##::@
:..:::..:::@
:::::::::::@
:::::::::::@
:::::::::::@
:::::::::::@@
::'##'##:::@
:: ## ##:::@
'#########:@
.. ## ##.::@
'#########:@
.. ## ##.::@
:: ## ##:::@
::..:..::::@@
:'########::@
'##. ##. ##:@
##: ##:..::@
. ########::@
:... ##. ##:@
'##: ##: ##:@
. ########::@
:........:::@@
'#####::'##:::@
## ##:'##::::@
#####'##:::::@
.....'##::::::@
::::'##'#####:@
:::'##: ## ##:@
::'##:: #####:@
::..:::.....::@@
::'####::::@
:'##. ##:::@
:. ####::::@
:'####:::::@
'##. ##'##:@
##:. ##:::@
. ####. ##:@
:....::..::@@
'####:@
####:@
. ##::@
'##:::@
..::::@
::::::@
::::::@
::::::@@
::'###:@
:'##:::@
'##::::@
##::::@
##::::@
. ##:::@
:. ###:@
::...::@@
'###:::@
.. ##::@
::: ##:@
::: ##:@
::: ##:@
:: ##::@
###:::@
...::::@@
:::::::::::@
:'##::'##::@
:. ##'##:::@
'#########:@
.. ## ##.::@
: ##:. ##::@
:..:::..:::@
:::::::::::@@
::::::::@
::'##:::@
:: ##:::@
'######:@
.. ##.::@
:: ##:::@
::..::::@
::::::::@@
::::::@
::::::@
::::::@
'####:@
####:@
. ##::@
'##:::@
..::::@@
:::::::::@
:::::::::@
:::::::::@
'#######:@
........:@
:::::::::@
:::::::::@
:::::::::@@
:::::@
:::::@
:::::@
:::::@
:::::@
'###:@
###:@
...::@@
::::::'##:@
:::::'##::@
::::'##:::@
:::'##::::@
::'##:::::@
:'##::::::@
'##:::::::@
..::::::::@@
::'#####:::@
:'##.. ##::@
'##:::: ##:@
##:::: ##:@
##:::: ##:@
. ##:: ##::@
:. #####:::@
::.....::::@@
:::'##:::@
:'####:::@
:.. ##:::@
::: ##:::@
::: ##:::@
::: ##:::@
:'######:@
:......::@@
:'#######::@
'##.... ##:@
..::::: ##:@
:'#######::@
'##::::::::@
##::::::::@
#########:@
.........::@@
:'#######::@
'##.... ##:@
..::::: ##:@
:'#######::@
:...... ##:@
'##:::: ##:@
. #######::@
:.......:::@@
'##::::::::@
##:::'##::@
##::: ##::@
##::: ##::@
#########:@
...... ##::@
:::::: ##::@
::::::..:::@@
'########:@
##.....::@
##:::::::@
#######::@
...... ##:@
'##::: ##:@
. ######::@
:......:::@@
:'#######::@
'##.... ##:@
##::::..::@
########::@
##.... ##:@
##:::: ##:@
. #######::@
:.......:::@@
'########:@
##.. ##:@
..:: ##:::@
::: ##::::@
:: ##:::::@
:: ##:::::@
:: ##:::::@
::..::::::@@
:'#######::@
'##.... ##:@
##:::: ##:@
: #######::@
'##.... ##:@
##:::: ##:@
. #######::@
:.......:::@@
:'#######::@
'##.... ##:@
##:::: ##:@
: ########:@
:...... ##:@
'##:::: ##:@
. #######::@
:.......:::@@
:'##::@
'####:@
. ##::@
:..:::@
:'##::@
'####:@
. ##::@
:..:::@@
'####:@
####:@
....::@
'####:@
####:@
. ##::@
##:::@
.:::::@@
:::'##:@
::'##::@
:'##:::@
'##::::@
. ##:::@
:. ##::@
::. ##:@
:::..::@@
:::::::@
:::::::@
'#####:@
.....::@
'#####:@
.....::@
:::::::@
:::::::@@
'##::::@
. ##:::@
:. ##::@
::. ##:@
:: ##::@
: ##:::@
##::::@
..:::::@@
:'#######::@
'##.... ##:@
..:::: ##::@
:::: ###:::@
::: ##.::::@
:::..::::::@
:::'##:::::@
:::..::::::@@
:'#######::@
'##.... ##:@
##'### ##:@
## ### ##:@
## #####::@
##.....:::@
. #######::@
:.......:::@@
:::'###::::@
::'## ##:::@
:'##:. ##::@
'##:::. ##:@
#########:@
##.... ##:@
##:::: ##:@
..:::::..::@@
'########::@
##.... ##:@
##:::: ##:@
########::@
##.... ##:@
##:::: ##:@
########::@
........:::@@
:'######::@
'##... ##:@
##:::..::@
##:::::::@
##:::::::@
##::: ##:@
. ######::@
:......:::@@
'########::@
##.... ##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
########::@
........:::@@
'########:@
##.....::@
##:::::::@
######:::@
##...::::@
##:::::::@
########:@
........::@@
'########:@
##.....::@
##:::::::@
######:::@
##...::::@
##:::::::@
##:::::::@
..::::::::@@
:'######:::@
'##... ##::@
##:::..:::@
##::'####:@
##::: ##::@
##::: ##::@
. ######:::@
:......::::@@
'##::::'##:@
##:::: ##:@
##:::: ##:@
#########:@
##.... ##:@
##:::: ##:@
##:::: ##:@
..:::::..::@@
'####:@
. ##::@
: ##::@
: ##::@
: ##::@
: ##::@
'####:@
....::@@
::::::'##:@
:::::: ##:@
:::::: ##:@
:::::: ##:@
'##::: ##:@
##::: ##:@
. ######::@
:......:::@@
'##:::'##:@
##::'##::@
##:'##:::@
#####::::@
##. ##:::@
##:. ##::@
##::. ##:@
..::::..::@@
'##:::::::@
##:::::::@
##:::::::@
##:::::::@
##:::::::@
##:::::::@
########:@
........::@@
'##::::'##:@
###::'###:@
####'####:@
## ### ##:@
##. #: ##:@
##:.:: ##:@
##:::: ##:@
..:::::..::@@
'##::: ##:@
###:: ##:@
####: ##:@
## ## ##:@
##. ####:@
##:. ###:@
##::. ##:@
..::::..::@@
:'#######::@
'##.... ##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
. #######::@
:.......:::@@
'########::@
##.... ##:@
##:::: ##:@
########::@
##.....:::@
##::::::::@
##::::::::@
..:::::::::@@
:'#######::@
'##.... ##:@
##:::: ##:@
##:::: ##:@
##:'## ##:@
##:.. ##::@
: ##### ##:@
:.....:..::@@
'########::@
##.... ##:@
##:::: ##:@
########::@
##.. ##:::@
##::. ##::@
##:::. ##:@
..:::::..::@@
:'######::@
'##... ##:@
##:::..::@
. ######::@
:..... ##:@
'##::: ##:@
. ######::@
:......:::@@
'########:@
... ##..::@
::: ##::::@
::: ##::::@
::: ##::::@
::: ##::::@
::: ##::::@
:::..:::::@@
'##::::'##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
. #######::@
:.......:::@@
'##::::'##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
. ##:: ##::@
:. ## ##:::@
::. ###::::@
:::...:::::@@
'##:::::'##:@
##:'##: ##:@
##: ##: ##:@
##: ##: ##:@
##: ##: ##:@
##: ##: ##:@
. ###. ###::@
:...::...:::@@
'##::::'##:@
. ##::'##::@
:. ##'##:::@
::. ###::::@
:: ## ##:::@
: ##:. ##::@
##:::. ##:@
..:::::..::@@
'##:::'##:@
. ##:'##::@
:. ####:::@
::. ##::::@
::: ##::::@
::: ##::::@
::: ##::::@
:::..:::::@@
'########:@
..... ##::@
:::: ##:::@
::: ##::::@
:: ##:::::@
: ##::::::@
########:@
........::@@
'######:@
##...::@
##:::::@
##:::::@
##:::::@
##:::::@
######:@
......::@@
'##:::::::@
. ##::::::@
:. ##:::::@
::. ##::::@
:::. ##:::@
::::. ##::@
:::::. ##:@
::::::..::@@
'######:@
.... ##:@
:::: ##:@
:::: ##:@
:::: ##:@
:::: ##:@
'######:@
......::@@
::'###:::@
:'## ##::@
'##:. ##:@
..:::..::@
:::::::::@
:::::::::@
:::::::::@
:::::::::@@
:::::::::@
:::::::::@
:::::::::@
:::::::::@
:::::::::@
:::::::::@
'#######:@
.......::@@
'####:@
####:@
. ##::@
:. ##:@
::..::@
::::::@
::::::@
::::::@@
:::'###::::@
::'## ##:::@
:'##:. ##::@
'##:::. ##:@
#########:@
##.... ##:@
##:::: ##:@
..:::::..::@@
'########::@
##.... ##:@
##:::: ##:@
########::@
##.... ##:@
##:::: ##:@
########::@
........:::@@
:'######::@
'##... ##:@
##:::..::@
##:::::::@
##:::::::@
##::: ##:@
. ######::@
:......:::@@
'########::@
##.... ##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
########::@
........:::@@
'########:@
##.....::@
##:::::::@
######:::@
##...::::@
##:::::::@
########:@
........::@@
'########:@
##.....::@
##:::::::@
######:::@
##...::::@
##:::::::@
##:::::::@
..::::::::@@
:'######:::@
'##... ##::@
##:::..:::@
##::'####:@
##::: ##::@
##::: ##::@
. ######:::@
:......::::@@
'##::::'##:@
##:::: ##:@
##:::: ##:@
#########:@
##.... ##:@
##:::: ##:@
##:::: ##:@
..:::::..::@@
'####:@
. ##::@
: ##::@
: ##::@
: ##::@
: ##::@
'####:@
....::@@
::::::'##:@
:::::: ##:@
:::::: ##:@
:::::: ##:@
'##::: ##:@
##::: ##:@
. ######::@
:......:::@@
'##:::'##:@
##::'##::@
##:'##:::@
#####::::@
##. ##:::@
##:. ##::@
##::. ##:@
..::::..::@@
'##:::::::@
##:::::::@
##:::::::@
##:::::::@
##:::::::@
##:::::::@
########:@
........::@@
'##::::'##:@
###::'###:@
####'####:@
## ### ##:@
##. #: ##:@
##:.:: ##:@
##:::: ##:@
..:::::..::@@
'##::: ##:@
###:: ##:@
####: ##:@
## ## ##:@
##. ####:@
##:. ###:@
##::. ##:@
..::::..::@@
:'#######::@
'##.... ##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
. #######::@
:.......:::@@
'########::@
##.... ##:@
##:::: ##:@
########::@
##.....:::@
##::::::::@
##::::::::@
..:::::::::@@
:'#######::@
'##.... ##:@
##:::: ##:@
##:::: ##:@
##:'## ##:@
##:.. ##::@
. ##### ##:@
:.....:..::@@
'########::@
##.... ##:@
##:::: ##:@
########::@
##.. ##:::@
##::. ##::@
##:::. ##:@
..:::::..::@@
:'######::@
'##... ##:@
##:::..::@
. ######::@
:..... ##:@
'##::: ##:@
. ######::@
:......:::@@
'########:@
... ##..::@
::: ##::::@
::: ##::::@
::: ##::::@
::: ##::::@
::: ##::::@
:::..:::::@@
'##::::'##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
. #######::@
:.......:::@@
'##::::'##:@
##:::: ##:@
##:::: ##:@
##:::: ##:@
. ##:: ##::@
:. ## ##:::@
::. ###::::@
:::...:::::@@
'##:::::'##:@
##:'##: ##:@
##: ##: ##:@
##: ##: ##:@
##: ##: ##:@
##: ##: ##:@
. ###. ###::@
:...::...:::@@
'##::::'##:@
. ##::'##::@
:. ##'##:::@
::. ###::::@
:: ## ##:::@
: ##:. ##::@
##:::. ##:@
..:::::..::@@
'##:::'##:@
. ##:'##::@
:. ####:::@
::. ##::::@
::: ##::::@
::: ##::::@
::: ##::::@
:::..:::::@@
'########:@
..... ##::@
:::: ##:::@
::: ##::::@
:: ##:::::@
: ##::::::@
########:@
........::@@
::'####:@
:'##..::@
: ##::::@
'###::::@
. ##::::@
: ##::::@
:. ####:@
:::...::@@
'##:@
##:@
##:@
..::@
'##:@
##:@
##:@
..::@@
'####:::@
... ##::@
::: ##::@
::: ###:@
::: ##::@
::: ##::@
'####:::@
....::::@@
:'####::::::@
'## ##:'##:@
..::. ####::@
:::::....:::@
::::::::::::@
::::::::::::@
::::::::::::@
::::::::::::@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@@ -0,0 +1 @@
{"version":3,"file":"buildDefaultUnmanagedMetadata.d.ts","sourceRoot":"","sources":["../../../../src/metadata/calculations/buildDefaultUnmanagedMetadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAExF,wBAAgB,6BAA6B,IAAI,6BAA6B,CAI7E"}
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,mDAAmD,CAAC;AAClE,cAAc,kDAAkD,CAAC;AACjE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,44 @@
{
"name": "@vitest/pretty-format",
"type": "module",
"version": "4.0.9",
"description": "Fork of pretty-format with support for ESM",
"license": "MIT",
"funding": "https://opencollective.com/vitest",
"homepage": "https://github.com/vitest-dev/vitest/tree/main/packages/utils#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/vitest-dev/vitest.git",
"directory": "packages/pretty-format"
},
"bugs": {
"url": "https://github.com/vitest-dev/vitest/issues"
},
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./*": "./*"
},
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"*.d.ts",
"dist"
],
"dependencies": {
"tinyrainbow": "^3.0.3"
},
"devDependencies": {
"@types/react-is": "^19.2.0",
"react-is": "^19.2.0",
"react-is-18": "npm:react-is@18.3.1"
},
"scripts": {
"build": "premove dist && rollup -c",
"dev": "rollup -c --watch"
}
}
@@ -0,0 +1,19 @@
export default function boolParserExt(val){
if(isArray(val)){
for (let i = 0; i < val.length; i++) {
val[i] = parse(val[i])
}
}else{
val = parse(val)
}
return val;
}
function parse(val){
if (typeof val === 'string') {
const temp = val.toLowerCase();
if(temp === 'true' || temp ==="yes" || temp==="1") return true;
else if(temp === 'false' || temp ==="no" || temp==="0") return false;
}
return val;
}
@@ -0,0 +1 @@
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAuCM,SAAS,0CAAkB,KAAgC;IAChE,IAAI,oBACF,gBAAgB,cAChB,UAAU,gBACV,YAAY,OACZ,GAAG,oBACH,gBAAgB,kBAChB,cAAc,EACf,GAAG;IAEJ,0HAA0H;IAC1H,qFAAqF;IACrF,IAAI,WAAW,CAAA,GAAA,kBAAU,EAAE;QAAC,OAAO;QAAU,aAAa;IAAM;IAChE,IAAI,mBAAmB,iBAAiB,gBAAgB;IACxD,IAAI,WAAW,CAAA,GAAA,cAAM,EAAE,IACrB,oBAAoB,IAAI,CAAA,GAAA,yCAAmB,EAAE;wBAC3C;0BACA;8BACA;iBACA;sBACA;4BACA;QACF,IACC;QAAC;QAAkB;QAAgB;QAAY;QAAc;QAAK;QAAU;KAAiB;IAEhG,IAAI,mBAAC,eAAe,EAAC,GAAG,CAAA,GAAA,yCAAsB,EAAE;QAC9C,GAAG,KAAK;aACR;0BACA;QACA,kBAAkB;IACpB;IAEA,OAAO;QACL,WAAW;IACb;AACF","sources":["packages/@react-aria/selection/src/useSelectableList.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 {AriaSelectableCollectionOptions, useSelectableCollection} from './useSelectableCollection';\nimport {Collection, DOMAttributes, Key, KeyboardDelegate, LayoutDelegate, Node} from '@react-types/shared';\nimport {ListKeyboardDelegate} from './ListKeyboardDelegate';\nimport {useCollator} from '@react-aria/i18n';\nimport {useMemo} from 'react';\n\nexport interface AriaSelectableListOptions extends Omit<AriaSelectableCollectionOptions, 'keyboardDelegate'> {\n /**\n * State of the collection.\n */\n collection: Collection<Node<unknown>>,\n /**\n * A delegate object that implements behavior for keyboard focus movement.\n */\n keyboardDelegate?: KeyboardDelegate,\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 * The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.\n */\n disabledKeys: Set<Key>\n}\n\nexport interface SelectableListAria {\n /**\n * Props for the option element.\n */\n listProps: DOMAttributes\n}\n\n/**\n * Handles interactions with a selectable list.\n */\nexport function useSelectableList(props: AriaSelectableListOptions): SelectableListAria {\n let {\n selectionManager,\n collection,\n disabledKeys,\n ref,\n keyboardDelegate,\n layoutDelegate\n } = props;\n\n // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).\n // When virtualized, the layout object will be passed in as a prop and override this.\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let disabledBehavior = selectionManager.disabledBehavior;\n let delegate = useMemo(() => (\n keyboardDelegate || new ListKeyboardDelegate({\n collection,\n disabledKeys,\n disabledBehavior,\n ref,\n collator,\n layoutDelegate\n })\n ), [keyboardDelegate, layoutDelegate, collection, disabledKeys, ref, collator, disabledBehavior]);\n\n let {collectionProps} = useSelectableCollection({\n ...props,\n ref,\n selectionManager,\n keyboardDelegate: delegate\n });\n\n return {\n listProps: collectionProps\n };\n}\n"],"names":[],"version":3,"file":"useSelectableList.module.js.map"}
@@ -0,0 +1 @@
{"version":3,"names":["_superPropBase","require","_defineProperty","set","target","property","value","receiver","Reflect","base","superPropBase","desc","Object","getOwnPropertyDescriptor","call","writable","defineProperty","_set","isStrict","s","TypeError"],"sources":["../../src/helpers/set.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport superPropBase from \"./superPropBase.ts\";\nimport defineProperty from \"./defineProperty.ts\";\n\nfunction set(\n target: object,\n property: PropertyKey,\n value: any,\n receiver?: any,\n): boolean {\n if (typeof Reflect !== \"undefined\" && Reflect.set) {\n // @ts-expect-error explicit function reassign\n set = Reflect.set;\n } else {\n // @ts-expect-error explicit function reassign\n set = function set(target, property, value, receiver) {\n var base = superPropBase(target, property);\n var desc;\n\n if (base) {\n desc = Object.getOwnPropertyDescriptor(base, property)!;\n if (desc.set) {\n desc.set.call(receiver, value);\n return true;\n // so getOwnPropertyDescriptor should always be defined\n } else if (!desc.writable) {\n // Both getter and non-writable fall into this.\n return false;\n }\n }\n\n // Without a super that defines the property, spec boils down to\n // \"define on receiver\" for some reason.\n desc = Object.getOwnPropertyDescriptor(receiver, property);\n if (desc) {\n if (!desc.writable) {\n // Setter, getter, and non-writable fall into this.\n return false;\n }\n\n desc.value = value;\n Object.defineProperty(receiver, property, desc);\n } else {\n // Avoid setters that may be defined on Sub's prototype, but not on\n // the instance.\n defineProperty(receiver, property, value);\n }\n\n return true;\n };\n }\n\n return set(target, property, value, receiver);\n}\n\nexport default function _set(\n target: object,\n property: PropertyKey,\n value: any,\n receiver?: any,\n isStrict?: boolean,\n) {\n var s = set(target, property, value, receiver || target);\n if (!s && isStrict) {\n throw new TypeError(\"failed to set property\");\n }\n\n return value;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,SAASE,GAAGA,CACVC,MAAc,EACdC,QAAqB,EACrBC,KAAU,EACVC,QAAc,EACL;EACT,IAAI,OAAOC,OAAO,KAAK,WAAW,IAAIA,OAAO,CAACL,GAAG,EAAE;IAEjDA,GAAG,GAAGK,OAAO,CAACL,GAAG;EACnB,CAAC,MAAM;IAELA,GAAG,GAAG,SAASA,GAAGA,CAACC,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,QAAQ,EAAE;MACpD,IAAIE,IAAI,GAAG,IAAAC,sBAAa,EAACN,MAAM,EAAEC,QAAQ,CAAC;MAC1C,IAAIM,IAAI;MAER,IAAIF,IAAI,EAAE;QACRE,IAAI,GAAGC,MAAM,CAACC,wBAAwB,CAACJ,IAAI,EAAEJ,QAAQ,CAAE;QACvD,IAAIM,IAAI,CAACR,GAAG,EAAE;UACZQ,IAAI,CAACR,GAAG,CAACW,IAAI,CAACP,QAAQ,EAAED,KAAK,CAAC;UAC9B,OAAO,IAAI;QAEb,CAAC,MAAM,IAAI,CAACK,IAAI,CAACI,QAAQ,EAAE;UAEzB,OAAO,KAAK;QACd;MACF;MAIAJ,IAAI,GAAGC,MAAM,CAACC,wBAAwB,CAACN,QAAQ,EAAEF,QAAQ,CAAC;MAC1D,IAAIM,IAAI,EAAE;QACR,IAAI,CAACA,IAAI,CAACI,QAAQ,EAAE;UAElB,OAAO,KAAK;QACd;QAEAJ,IAAI,CAACL,KAAK,GAAGA,KAAK;QAClBM,MAAM,CAACI,cAAc,CAACT,QAAQ,EAAEF,QAAQ,EAAEM,IAAI,CAAC;MACjD,CAAC,MAAM;QAGL,IAAAK,uBAAc,EAACT,QAAQ,EAAEF,QAAQ,EAAEC,KAAK,CAAC;MAC3C;MAEA,OAAO,IAAI;IACb,CAAC;EACH;EAEA,OAAOH,GAAG,CAACC,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,QAAQ,CAAC;AAC/C;AAEe,SAASU,IAAIA,CAC1Bb,MAAc,EACdC,QAAqB,EACrBC,KAAU,EACVC,QAAc,EACdW,QAAkB,EAClB;EACA,IAAIC,CAAC,GAAGhB,GAAG,CAACC,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,QAAQ,IAAIH,MAAM,CAAC;EACxD,IAAI,CAACe,CAAC,IAAID,QAAQ,EAAE;IAClB,MAAM,IAAIE,SAAS,CAAC,wBAAwB,CAAC;EAC/C;EAEA,OAAOd,KAAK;AACd","ignoreList":[]}
@@ -0,0 +1,19 @@
'use strict';
var node_process = require('process');
function debug(logLevel, ...messages) {
if (logLevel === 'debug')
console.log(...messages);
}
function warn(logLevel, warning) {
if (logLevel === 'debug' || logLevel === 'warn') {
if (typeof node_process.emitWarning === 'function')
node_process.emitWarning(warning);
else
console.warn(warning);
}
}
exports.debug = debug;
exports.warn = warn;
@@ -0,0 +1 @@
{"version":3,"file":"isKey.d.ts","sourceRoot":"","sources":["../../src/utils/isKey.ts"],"names":[],"mappings":"yBAAgB,OAAO,MAAM;AAA7B,wBAAsD"}
@@ -0,0 +1,28 @@
/**
* Create an extension for `micromark` to enable GFM syntax.
*
* @param {Options | null | undefined} [options]
* Configuration (optional).
*
* Passed to `micromark-extens-gfm-strikethrough`.
* @returns {Extension}
* Extension for `micromark` that can be passed in `extensions` to enable GFM
* syntax.
*/
export function gfm(options?: Options | null | undefined): Extension
/**
* Create an extension for `micromark` to support GFM when serializing to HTML.
*
* @param {HtmlOptions | null | undefined} [options]
* Configuration (optional).
*
* Passed to `micromark-extens-gfm-footnote`.
* @returns {HtmlExtension}
* Extension for `micromark` that can be passed in `htmlExtensions` to
* support GFM when serializing to HTML.
*/
export function gfmHtml(options?: HtmlOptions | null | undefined): HtmlExtension
export type HtmlOptions = import('micromark-extension-gfm-footnote').HtmlOptions
export type Options = import('micromark-extension-gfm-strikethrough').Options
export type Extension = import('micromark-util-types').Extension
export type HtmlExtension = import('micromark-util-types').HtmlExtension
@@ -0,0 +1 @@
{"version":3,"file":"buildUnmanagedMetadataFromMaybeManagedMetadata.d.ts","sourceRoot":"","sources":["../../../../src/metadata/calculations/buildUnmanagedMetadataFromMaybeManagedMetadata.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAC;AAC9F,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAIxF,wBAAgB,8CAA8C,CAC5D,QAAQ,EAAE,gCAAgC,GAAG,2BAA2B,GACvE,6BAA6B,CAW/B"}
@@ -0,0 +1,46 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed 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
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
interface SymbolConstructor {
/**
* A reference to the prototype.
*/
readonly prototype: Symbol;
/**
* Returns a new unique Symbol value.
* @param description Description of the new Symbol object.
*/
(description?: string | number): symbol;
/**
* Returns a Symbol object from the global symbol registry matching the given key if found.
* Otherwise, returns a new symbol with this key.
* @param key key to search for.
*/
for(key: string): symbol;
/**
* Returns a key from the global symbol registry matching the given Symbol if found.
* Otherwise, returns a undefined.
* @param sym Symbol to find the key for.
*/
keyFor(sym: symbol): string | undefined;
}
declare var Symbol: SymbolConstructor;
@@ -0,0 +1,5 @@
import { ResolvedValueInjectOptions } from './ResolvedValueInjectOptions';
export type MapToResolvedValueInjectOptions<TArgs extends unknown[]> = {
[K in keyof TArgs]-?: ResolvedValueInjectOptions<TArgs[K]>;
};
//# sourceMappingURL=MapToResolvedValueInjectOptions.d.ts.map
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more