docs: 仓库链接指向本镜像仓库
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s

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,21 @@
The MIT License (MIT)
Copyright (c) 2016 Alex Indigo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,6 @@
module.exports = {
"breadcrumbs": `Chemin de navigation`
};
//# sourceMappingURL=fr-FR.main.js.map
@@ -0,0 +1,2 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).esquery=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],u=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return s}}(e,t)||n(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||n(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function a(e,t){return e(t={exports:{}},t.exports),t.exports}var i=a((function(e,t){!function e(t){var r,n,o,a,i,s;function u(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],n[t]="object"==typeof r&&null!==r?u(r):r);return n}function l(e,t){this.parent=e,this.key=t}function c(e,t,r,n){this.node=e,this.path=t,this.wrap=r,this.ref=n}function f(){}function p(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function h(e,t){return(e===r.ObjectExpression||e===r.ObjectPattern)&&"properties"===t}function y(e,t){for(var r=e.length-1;r>=0;--r)if(e[r].node===t)return!0;return!1}function d(e,t){return(new f).traverse(e,t)}function m(e,t){var r;return r=function(e,t){var r,n,o,a;for(n=e.length,o=0;n;)t(e[a=o+(r=n>>>1)])?n=r:(o=a+1,n-=r+1);return o}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SprLine truncated
//# sourceMappingURL=esquery.min.js.map
@@ -0,0 +1 @@
{"mappings":"AAAA;;;;;;;;;;CAUC,GAED,8CAA8C;AAC9C,MAAM,oCAAc,IAAI,IAAI;IAAC;IAAQ;IAAQ;IAAQ;IAAQ;IAAQ;IAAQ;IAAQ;IAAQ;IAAQ;CAAO;AAC5G,MAAM,kCAAY,IAAI,IAAI;IAAC;IAAM;IAAM;IAAO;IAAO;IAAO;IAAO;IAAM;IAAM;IAAO;IAAM;IAAM;IAAO;IAAO;IAAO;IAAM;IAAM;IAAM;IAAM;CAAK;AAK7I,SAAS,0CAAM,YAAoB;IACxC,kFAAkF;IAClF,IAAI,KAAK,MAAM,EAAE;QACf,IAAI,SAAS,IAAI,KAAK,MAAM,CAAC,cAAc,QAAQ;QAEnD,6DAA6D;QAC7D,6GAA6G;QAC7G,2GAA2G;QAC3G,IAAI,WAAW,OAAO,OAAO,WAAW,KAAK,aAAa,OAAO,WAAW,KAAK,OAAO,QAAQ;QAChG,IAAI,UACF,OAAO,SAAS,SAAS,KAAK;QAGhC,oCAAoC;QACpC,uGAAuG;QACvG,IAAI,OAAO,MAAM,EACf,OAAO,kCAAY,GAAG,CAAC,OAAO,MAAM;IAExC;IAEA,gEAAgE;IAChE,IAAI,OAAO,aAAa,KAAK,CAAC,IAAI,CAAC,EAAE;IACrC,OAAO,gCAAU,GAAG,CAAC;AACvB","sources":["packages/@react-aria/i18n/src/utils.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\n// https://en.wikipedia.org/wiki/Right-to-left\nconst RTL_SCRIPTS = new Set(['Arab', 'Syrc', 'Samr', 'Mand', 'Thaa', 'Mend', 'Nkoo', 'Adlm', 'Rohg', 'Hebr']);\nconst RTL_LANGS = new Set(['ae', 'ar', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'glk', 'he', 'ku', 'mzn', 'nqo', 'pnb', 'ps', 'sd', 'ug', 'ur', 'yi']);\n\n/**\n * Determines if a locale is read right to left using [Intl.Locale]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale}.\n */\nexport function isRTL(localeString: string) {\n // If the Intl.Locale API is available, use it to get the locale's text direction.\n if (Intl.Locale) {\n let locale = new Intl.Locale(localeString).maximize();\n\n // Use the text info object to get the direction if possible.\n // @ts-ignore - this was implemented as a property by some browsers before it was standardized as a function.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo\n let textInfo = typeof locale.getTextInfo === 'function' ? locale.getTextInfo() : locale.textInfo;\n if (textInfo) {\n return textInfo.direction === 'rtl';\n }\n\n // Fallback: guess using the script.\n // This is more accurate than guessing by language, since languages can be written in multiple scripts.\n if (locale.script) {\n return RTL_SCRIPTS.has(locale.script);\n }\n }\n\n // If not, just guess by the language (first part of the locale)\n let lang = localeString.split('-')[0];\n return RTL_LANGS.has(lang);\n}\n"],"names":[],"version":3,"file":"utils.module.js.map"}
@@ -0,0 +1,25 @@
/*! *****************************************************************************
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 RegExp {
/**
* Returns a Boolean value indicating the state of the unicodeSets flag (v) used with a regular expression.
* Default is false. Read-only.
*/
readonly unicodeSets: boolean;
}
@@ -0,0 +1,14 @@
import { formatErrorMessage } from './format-error-message.mjs';
const warned = new Set();
function hasWarned(message) {
return warned.has(message);
}
function warnOnce(condition, message, errorCode) {
if (condition || warned.has(message))
return;
console.warn(formatErrorMessage(message, errorCode));
warned.add(message);
}
export { hasWarned, warnOnce };
@@ -0,0 +1 @@
{"version":3,"file":"style-to-js.js","sources":["../node_modules/inline-style-parser/cjs/index.js","../node_modules/style-to-object/cjs/index.js","../cjs/utilities.js","../cjs/index.js","../cjs/index.js?commonjs-entry"],"sourcesContent":["'use strict';\n\n// http://www.w3.org/TR/CSS21/grammar.html\n// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027\nvar COMMENT_REGEX = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\n\nvar NEWLINE_REGEX = /\\n/g;\nvar WHITESPACE_REGEX = /^\\s*/;\n\n// declaration\nvar PROPERTY_REGEX = /^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/;\nvar COLON_REGEX = /^:\\s*/;\nvar VALUE_REGEX = /^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};])+)/;\nvar SEMICOLON_REGEX = /^[;\\s]*/;\n\n// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\nvar TRIM_REGEX = /^\\s+|\\s+$/g;\n\n// strings\nvar NEWLINE = '\\n';\nvar FORWARD_SLASH = '/';\nvar ASTERISK = '*';\nvar EMPTY_STRING = '';\n\n// types\nvar TYPE_COMMENT = 'comment';\nvar TYPE_DECLARATION = 'declaration';\n\n/**\n * @param {String} style\n * @param {Object} [options]\n * @return {Object[]}\n * @throws {TypeError}\n * @throws {Error}\n */\nfunction index (style, options) {\n if (typeof style !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n if (!style) return [];\n\n options = options || {};\n\n /**\n * Positional.\n */\n var lineno = 1;\n var column = 1;\n\n /**\n * Update lineno and column based on `str`.\n *\n * @param {String} str\n */\n function updatePosition(str) {\n var lines = str.match(NEWLINE_REGEX);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf(NEWLINE);\n column = ~i ? str.length - i : column + str.length;\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @return {Function}\n */\n function position() {\n var start = { line: lineno, column: column };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }\n\n /**\n * Store position information for a node.\n *\n * @constructor\n * @property {Object} start\n * @property {Object} end\n * @property {undefined|String} source\n */\n function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }\n\n /**\n * Non-enumerable source string.\n */\n Position.prototype.content = style;\n\n /**\n * Error `msg`.\n *\n * @param {String} msg\n * @throws {Error}\n */\n function error(msg) {\n var err = new Error(\n options.source + ':' + lineno + ':' + column + ': ' + msg\n );\n err.reason = msg;\n err.filename = options.source;\n err.line = lineno;\n err.column = column;\n err.source = style;\n\n if (options.silent) ; else {\n throw err;\n }\n }\n\n /**\n * Match `re` and return captures.\n *\n * @param {RegExp} re\n * @return {undefined|Array}\n */\n function match(re) {\n var m = re.exec(style);\n if (!m) return;\n var str = m[0];\n updatePosition(str);\n style = style.slice(str.length);\n return m;\n }\n\n /**\n * Parse whitespace.\n */\n function whitespace() {\n match(WHITESPACE_REGEX);\n }\n\n /**\n * Parse comments.\n *\n * @param {Object[]} [rules]\n * @return {Object[]}\n */\n function comments(rules) {\n var c;\n rules = rules || [];\n while ((c = comment())) {\n if (c !== false) {\n rules.push(c);\n }\n }\n return rules;\n }\n\n /**\n * Parse comment.\n *\n * @return {Object}\n * @throws {Error}\n */\n function comment() {\n var pos = position();\n if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;\n\n var i = 2;\n while (\n EMPTY_STRING != style.charAt(i) &&\n (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))\n ) {\n ++i;\n }\n i += 2;\n\n if (EMPTY_STRING === style.charAt(i - 1)) {\n return error('End of comment missing');\n }\n\n var str = style.slice(2, i - 2);\n column += 2;\n updatePosition(str);\n style = style.slice(i);\n column += 2;\n\n return pos({\n type: TYPE_COMMENT,\n comment: str\n });\n }\n\n /**\n * Parse declaration.\n *\n * @return {Object}\n * @throws {Error}\n */\n function declaration() {\n var pos = position();\n\n // prop\n var prop = match(PROPERTY_REGEX);\n if (!prop) return;\n comment();\n\n // :\n if (!match(COLON_REGEX)) return error(\"property missing ':'\");\n\n // val\n var val = match(VALUE_REGEX);\n\n var ret = pos({\n type: TYPE_DECLARATION,\n property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),\n value: val\n ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))\n : EMPTY_STRING\n });\n\n // ;\n match(SEMICOLON_REGEX);\n\n return ret;\n }Line truncated
@@ -0,0 +1 @@
{"name":"mime-types","version":"3.0.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532088997,"integrity":"sha512-oaKT6wCX/oeHXzv5CMwLDujxXplcaOmEtqJOJHsulUQH15QeqWq9f+ACob37cT/fsNODnZSKM0YD8F5kSCn2Bg==","mode":420,"size":1167},"index.js":{"checkedAt":1794532088998,"integrity":"sha512-uWaCth08/vUK5EYl3ek53ETqPSpMUn39GOFuHSv2Vea4FFEqmDKmbvFOQ3tWhUg+WAVeZKZs/93htDQdS1v03A==","mode":420,"size":4554},"mimeScore.js":{"checkedAt":1794532088998,"integrity":"sha512-RXsEjpVTeGKX3D4m1UyJrMyyzh8dgHA9PcCvpTLVC3ap8nLipC5qu++/Lp+0/dxZpqiGjsHBLrPot4ECfFa2Mg==","mode":420,"size":1351},"package.json":{"checkedAt":1794532088998,"integrity":"sha512-0wM2NNDxXVqv9CuIvrYtugYsWjuABc9ZOu9aQ1927Df1LRVmfbVlOE37L5ubZe7f+j1cvZ3H3inhcBs7WFLV7Q==","mode":420,"size":1170},"HISTORY.md":{"checkedAt":1794532088998,"integrity":"sha512-FiMRFNE4FG0T4cPVsDUoTYsGdC46rmM3sAsj+yhDpQCNV3yjxlFtskOYZWAX8zEFCUjV59B7hdJJg/FUAommmg==","mode":420,"size":9627},"README.md":{"checkedAt":1794532088998,"integrity":"sha512-1LQWL2XR+nWKqn/mpr0ADG3gRQKxAZUn8GIn8AApImL+S9Xhu/k6QC1oaJs6Fs7CkEFwosJtrTJta0qXSH8MvQ==","mode":420,"size":4472}}}
@@ -0,0 +1,62 @@
"use client";
import { motionValue } from 'motion-dom';
import { invariant } from 'motion-utils';
import { useRef, useCallback, useEffect } from 'react';
import { scroll } from '../render/dom/scroll/index.mjs';
import { useConstant } from '../utils/use-constant.mjs';
import { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';
const createScrollMotionValues = () => ({
scrollX: motionValue(0),
scrollY: motionValue(0),
scrollXProgress: motionValue(0),
scrollYProgress: motionValue(0),
});
const isRefPending = (ref) => {
if (!ref)
return false;
return !ref.current;
};
function useScroll({ container, target, ...options } = {}) {
const values = useConstant(createScrollMotionValues);
const scrollAnimation = useRef(null);
const needsStart = useRef(false);
const start = useCallback(() => {
scrollAnimation.current = scroll((_progress, { x, y, }) => {
values.scrollX.set(x.current);
values.scrollXProgress.set(x.progress);
values.scrollY.set(y.current);
values.scrollYProgress.set(y.progress);
}, {
...options,
container: container?.current || undefined,
target: target?.current || undefined,
});
return () => {
scrollAnimation.current?.();
};
}, [container, target, JSON.stringify(options.offset)]);
useIsomorphicLayoutEffect(() => {
needsStart.current = false;
if (isRefPending(container) || isRefPending(target)) {
needsStart.current = true;
return;
}
else {
return start();
}
}, [start]);
useEffect(() => {
if (needsStart.current) {
invariant(!isRefPending(container), "Container ref is defined but not hydrated", "use-scroll-ref");
invariant(!isRefPending(target), "Target ref is defined but not hydrated", "use-scroll-ref");
return start();
}
else {
return;
}
}, [start]);
return values;
}
export { useScroll };
@@ -0,0 +1,50 @@
"use client";
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/use-is-hydrated.ts
var use_is_hydrated_exports = {};
__export(use_is_hydrated_exports, {
useIsHydrated: () => useIsHydrated
});
module.exports = __toCommonJS(use_is_hydrated_exports);
var React = __toESM(require("react"));
function useIsHydrated() {
const subscribe = () => () => {
};
return React.useSyncExternalStore(
subscribe,
() => true,
() => false
);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
useIsHydrated
});
@@ -0,0 +1,11 @@
import { _ as _get_prototype_of } from "./_get_prototype_of.js";
function _super_prop_base(object, property) {
while (!Object.prototype.hasOwnProperty.call(object, property)) {
object = _get_prototype_of(object);
if (object === null) break;
}
return object;
}
export { _super_prop_base as _ };
@@ -0,0 +1,42 @@
{
"name": "@codemirror/commands",
"version": "6.10.1",
"description": "Collection of editing commands for the CodeMirror code editor",
"scripts": {
"test": "cm-runtests",
"prepare": "cm-buildhelper src/commands.ts"
},
"keywords": [
"editor",
"code"
],
"author": {
"name": "Marijn Haverbeke",
"email": "marijn@haverbeke.berlin",
"url": "http://marijnhaverbeke.nl"
},
"type": "module",
"main": "dist/index.cjs",
"exports": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"types": "dist/index.d.ts",
"module": "dist/index.js",
"sideEffects": false,
"license": "MIT",
"dependencies": {
"@codemirror/language": "^6.0.0",
"@codemirror/state": "^6.4.0",
"@codemirror/view": "^6.27.0",
"@lezer/common": "^1.1.0"
},
"devDependencies": {
"@codemirror/buildhelper": "^1.0.0",
"@codemirror/lang-javascript": "^6.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/codemirror/commands.git"
}
}
@@ -0,0 +1,4 @@
export declare const OidbSvcTrpcTcp0XF90_1: {
groupUin: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
msgSeq: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT64, false, false>;
};
@@ -0,0 +1 @@
{"version":3,"file":"no-access-state-in-setstate.d.ts","sourceRoot":"","sources":["no-access-state-in-setstate.js"],"names":[],"mappings":"wBAqBW,OAAO,QAAQ,EAAE,IAAI,CAAC,UAAU"}
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2013 James Halliday
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,118 @@
const IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@";
const IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
function isImmutable(v) {
return v && (v[IS_COLLECTION_SYMBOL] || v[IS_RECORD_SYMBOL]);
}
const OBJECT_PROTO = Object.getPrototypeOf({});
function getUnserializableMessage(err) {
if (err instanceof Error) {
return `<unserializable>: ${err.message}`;
}
if (typeof err === "string") {
return `<unserializable>: ${err}`;
}
return "<unserializable>";
}
// https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
function serializeValue(val, seen = new WeakMap()) {
if (!val || typeof val === "string") {
return val;
}
if (val instanceof Error && "toJSON" in val && typeof val.toJSON === "function") {
const jsonValue = val.toJSON();
if (jsonValue && jsonValue !== val && typeof jsonValue === "object") {
if (typeof val.message === "string") {
safe(() => jsonValue.message ?? (jsonValue.message = normalizeErrorMessage(val.message)));
}
if (typeof val.stack === "string") {
safe(() => jsonValue.stack ?? (jsonValue.stack = val.stack));
}
if (typeof val.name === "string") {
safe(() => jsonValue.name ?? (jsonValue.name = val.name));
}
if (val.cause != null) {
safe(() => jsonValue.cause ?? (jsonValue.cause = serializeValue(val.cause, seen)));
}
}
return serializeValue(jsonValue, seen);
}
if (typeof val === "function") {
return `Function<${val.name || "anonymous"}>`;
}
if (typeof val === "symbol") {
return val.toString();
}
if (typeof val !== "object") {
return val;
}
if (typeof Buffer !== "undefined" && val instanceof Buffer) {
return `<Buffer(${val.length}) ...>`;
}
if (typeof Uint8Array !== "undefined" && val instanceof Uint8Array) {
return `<Uint8Array(${val.length}) ...>`;
}
// cannot serialize immutables as immutables
if (isImmutable(val)) {
return serializeValue(val.toJSON(), seen);
}
if (val instanceof Promise || val.constructor && val.constructor.prototype === "AsyncFunction") {
return "Promise";
}
if (typeof Element !== "undefined" && val instanceof Element) {
return val.tagName;
}
if (typeof val.toJSON === "function") {
return serializeValue(val.toJSON(), seen);
}
if (seen.has(val)) {
return seen.get(val);
}
if (Array.isArray(val)) {
// eslint-disable-next-line unicorn/no-new-array -- we need to keep sparse arrays ([1,,3])
const clone = new Array(val.length);
seen.set(val, clone);
val.forEach((e, i) => {
try {
clone[i] = serializeValue(e, seen);
} catch (err) {
clone[i] = getUnserializableMessage(err);
}
});
return clone;
} else {
// Objects with `Error` constructors appear to cause problems during worker communication
// using `MessagePort`, so the serialized error object is being recreated as plain object.
const clone = Object.create(null);
seen.set(val, clone);
let obj = val;
while (obj && obj !== OBJECT_PROTO) {
Object.getOwnPropertyNames(obj).forEach((key) => {
if (key in clone) {
return;
}
try {
clone[key] = serializeValue(val[key], seen);
} catch (err) {
// delete in case it has a setter from prototype that might throw
delete clone[key];
clone[key] = getUnserializableMessage(err);
}
});
obj = Object.getPrototypeOf(obj);
}
if (val instanceof Error) {
safe(() => val.message = normalizeErrorMessage(val.message));
}
return clone;
}
}
function safe(fn) {
try {
return fn();
} catch {}
}
function normalizeErrorMessage(message) {
return message.replace(/__(vite_ssr_import|vi_import)_\d+__\./g, "");
}
export { serializeValue };
@@ -0,0 +1 @@
{"version":3,"file":"manipulation.js","sourceRoot":"https://raw.githubusercontent.com/fb55/domutils/0ab8bcf1ecfc70dfc93291a4cb2496578ac25e9c/src/","sources":["manipulation.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,IAAe;IACzC,IAAI,IAAI,CAAC,IAAI;QAAE,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IAC1C,IAAI,IAAI,CAAC,IAAI;QAAE,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IAE1C,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QACpC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,WAAW,IAAI,CAAC,EAAE,CAAC;YACnB,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QAClC,CAAC;IACL,CAAC;IACD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACjB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;AACvB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,IAAe,EAAE,WAAsB;IAClE,MAAM,IAAI,GAAG,CAAC,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,IAAI,IAAI,EAAE,CAAC;QACP,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC5B,CAAC;IAED,MAAM,IAAI,GAAG,CAAC,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,IAAI,IAAI,EAAE,CAAC;QACP,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC5B,CAAC;IAED,MAAM,MAAM,GAAG,CAAC,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAClD,IAAI,MAAM,EAAE,CAAC;QACT,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC/B,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,WAAW,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,MAAkB,EAAE,KAAgB;IAC5D,aAAa,CAAC,KAAK,CAAC,CAAC;IAErB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAEtB,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC5D,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC;QACrB,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC;IACzB,CAAC;SAAM,CAAC;QACJ,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;IACtB,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,MAAM,CAAC,IAAe,EAAE,IAAe;IACnD,aAAa,CAAC,IAAI,CAAC,CAAC;IAEpB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;IAE3B,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;IACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IAErB,IAAI,QAAQ,EAAE,CAAC;QACX,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;QACrB,IAAI,MAAM,EAAE,CAAC;YACT,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;YAC/B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;QACzD,CAAC;IACL,CAAC;SAAM,IAAI,MAAM,EAAE,CAAC;QAChB,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,MAAkB,EAAE,KAAgB;IAC7D,aAAa,CAAC,KAAK,CAAC,CAAC;IAErB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;IAElB,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACvC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC;QACrB,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC;IACzB,CAAC;SAAM,CAAC;QACJ,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;IACtB,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,IAAe,EAAE,IAAe;IACpD,aAAa,CAAC,IAAI,CAAC,CAAC;IAEpB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,IAAI,MAAM,EAAE,CAAC;QACT,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC/B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACrB,CAAC"}
@@ -0,0 +1,547 @@
flf2a$ 5 4 12 -1 36 0 3903 0
Author : Aaron Nolan
Email : speed_racer420@hotmail.com
Date : 2005/4/7 10:39:30
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
(english)
(comments): I put in an "ä, ö, and ü" for all you germans out there,
the "ß" was a little too difficult. This is of course the FILTER font
inspired from the band logo, have fun. And don't poke an eye out.
(deutsch)
(kommentar): Ich habe auch "ä, ö, und ü" dazu gemacht, für Ihr Deutschen
da drausen, das scharfe S (ß) war ein bisschen zu schwierig. Dies ist
natrürlich
die FILTER schriftart (figlet-font), inspiriert von dem Bandlogo, viel Spaß.
Und, das Auge nicht damit auspflücken!
Permission is hereby given to modify this font, as long as the
modifier's, and the original author's name name is placed on a comment line.
Also check out the Malicious (industrial electronic darkwave ebm synthpop)
band here:
http://themalicious.dmusic.com/
http://themalicious.shim.net/
http://groups.yahoo.com/group/themalicious
http://www.audiostreet.net/themalicious
http://www.roilnoise.com/Industrialterror.htm
thanks.
$ #
$ #
$ #
$ #
$ ##
d88 #
d88. #
`'d8 #
YP #
##
88b 88b #
`8p `8p #
#
#
##
##
#
#
#
##
$#
#
#
#
##
%#
#
#
#
##
&#
#
#
#
##
'#
#
#
#
##
(#
#
#
#
##
)#
#
#
#
##
*#
#
#
#
##
888 #
ooo888ooo #
888888888 #
888 #
##
,#
#
#
#
##
#
______ #
XXXXXX #
#
##
.#
#
#
#
##
/#
#
#
#
##
0#
#
#
#
##
1#
#
#
#
##
2#
#
#
#
##
3#
#
#
#
##
4#
#
#
#
##
5#
#
#
#
##
6#
#
#
#
##
7#
#
#
#
##
8#
#
#
#
##
9#
#
#
#
##
#
d8p #
#
d8p #
##
#
d8p #
#
,d #
##
<#
#
#
#
##
#
oooooo #
oooooo #
#
##
>#
#
#
#
##
?#
#
#
#
##
@#
#
#
#
##
,8b. #
88'8o #
88PPY8. #
8b `Y' #
##
d88PPPo #
888ooo8 #
888 8 #
888PPPP #
##
doooooo #
d88 #
d88 #
d888888 #
##
88PPP. #
88 8 #
88 8 #
88oop' #
##
,d8PPPP #
d88ooo #
,88' #
88bdPPP #
##
o8boooo #
88booop #
88b #
88P #
##
888PPP8b #
d88 ` #
d8b PPY8 #
Y8PPPPPP #
##
888 888 #
88888888 #
88P 888 #
88P 888 #
##
8888 #
8888 #
8888 #
8888 #
##
d8p #
88p #
88P #
88888' #
##
888 ,dP #
888o8P' #
888 Y8L #
888 `8p #
##
888 #
888 #
888 #
888PPPPP #
##
d88b_o8b #
d88 8'8b #
d88 8b #
Y88 8P #
##
888 ,d8 #
888_dPY8 #
8888' 88 #
Y8P Y8 #
##
88888888 #
888 888 #
888 888 #
888oo888 #
##
8888PPPp, #
8888 8 #
8888PPPP' #
888P #
_ _ ##
88888888 #
88b Y8 #
888 Yb,8, #
888oopY88 #
##
,dbPPPp #
d88ooP' #
,88' P' #
88 do #
##
88888888 #
88ooooPp #
d8 #
8888888P #
##
888888888 #
'88d #
'888 #
'88p #
##
888 888 #
888 888 #
888 888 #
888PP888 #
##
d88 88 #
d88 88 #
d88_o8P' #
Y88P' #
##
8d8 d88 #
888,o.d88 #
888P`Y8b8 #
88P YP8 #
##
88b d88 #
88od88 #
d8PY8d #
Y88 Y8P #
##
888 88 #
888ooo88 #
88 #
PPPPPP8P #
##
PPPPP88p' #
,dP' #
,dP' #
YPPPPPPP #
##
[#
#
#
#
##
\#
#
#
#
##
]#
#
#
#
##
^#
#
#
#
##
_#
#
#
#
##
`#
#
#
#
##
,8b. #
88'8o #
88PPY8. #
8b `Y' #
##
d88PPPo #
888ooo8 #
888 8 #
888PPPP #
##
doooooo #
d88 #
d88 #
d888888 #
##
88PPP. #
88 8 #
88 8 #
88oop' #
##
,d8PPPP #
d88ooo #
,88' #
88bdPPP #
##
o8boooo #
88booop #
88b #
88P #
##
888PPP8b #
d88 ` #
d8b PPY8 #
Y8PPPPPP #
##
888 888 #
88888888 #
88P 888 #
88P 888 #
##
8888 #
8888 #
8888 #
8888 #
##
d8p #
88p #
88P #
88888' #
##
888 ,dP #
888o8P' #
888 Y8L #
888 `8p #
##
888 #
888 #
888 #
888PPPPP #
##
d88b_o8b #
d88 8'8b #
d88 8b #
Y88 8P #
##
888 ,d8 #
888_dPY8 #
8888' 88 #
Y8P Y8 #
##
88888888 #
888 888 #
888 888 #
888oo888 #
##
8888PPPp, #
8888 8 #
8888PPPP' #
888P #
_ _ ##
88888888 #
88b Y8 #
888 Yb,8, #
888oopY88 #
##
,dbPPPp #
d88ooP' #
,88' P' #
88 do #
##
88888888 #
88ooooPp #
d8 #
8888888P #
##
888888888 #
'88d #
'888 #
'88p #
##
888 888 #
888 888 #
888 888 #
888PP888 #
##
d88 88 #
d88 88 #
d88_o8P' #
Y88P' #
##
8d8 d88 #
888,o.d88 #
888P`Y8b8 #
88P YP8 #
##
88b d88 #
88od88 #
d8PY8d #
Y88 Y8P #
##
888 88 #
888ooo88 #
88 #
PPPPPP8P #
##
PPPPP88p'#
,dP' #
,dP' #
YPPPPPPP #
##
{#
#
#
#
##
|#
#
#
#
##
}#
#
#
#
##
~#
#
#
#
##
,8b. #
88'8o #
88PPY8. #
8b `Y' #
##
88888888 #
888 888 #
888 888 #
888oo888 #
##
888 888 #
888 888 #
888 888 #
888PP888 #
##
a a #
dPPP8 #
.oood #
8ppp8 #
##
o o #
poooop #
88 88 #
YPPP8P #
##
u u #
d8 d8 #
d8 d8 #
YPPP8P #
##
ß#
#
#
#
##
@@ -0,0 +1,287 @@
const fs = require('fs');
const { Readable, Writable, PassThrough } = require('stream');
const Pend = require('pend');
const { EventEmitter } = require('events');
class FdSlicer extends EventEmitter {
constructor(fd, options = {}) {
super();
this.fd = fd;
this.pend = new Pend();
this.pend.max = 1;
this.refCount = 0;
this.autoClose = !!options.autoClose;
}
read(buffer, offset, length, position, callback) {
this.pend.go(cb => {
fs.read(this.fd, buffer, offset, length, position, (err, bytesRead, buffer) => {
cb();
callback(err, bytesRead, buffer);
});
});
}
write(buffer, offset, length, position, callback) {
this.pend.go(cb => {
fs.write(this.fd, buffer, offset, length, position, (err, written, buffer) => {
cb();
callback(err, written, buffer);
});
});
}
createReadStream(options) {
return new ReadStream(this, options);
}
createWriteStream(options) {
return new WriteStream(this, options);
}
ref() {
this.refCount += 1;
}
unref() {
this.refCount -= 1;
if (this.refCount > 0) return;
if (this.refCount < 0) throw new Error("invalid unref");
if (this.autoClose) {
fs.close(this.fd, err => {
if (err) {
this.emit('error', err);
} else {
this.emit('close');
}
});
}
}
}
class ReadStream extends Readable {
constructor(context, options = {}) {
super(options);
this.context = context;
this.context.ref();
this.start = options.start || 0;
this.endOffset = options.end;
this.pos = this.start;
this.destroyed = false;
}
_read(n) {
if (this.destroyed) return;
let toRead = Math.min(this._readableState.highWaterMark, n);
if (this.endOffset != null) {
toRead = Math.min(toRead, this.endOffset - this.pos);
}
if (toRead <= 0) {
this.destroyed = true;
this.push(null);
this.context.unref();
return;
}
this.context.pend.go(cb => {
if (this.destroyed) return cb();
const buffer = Buffer.alloc(toRead);
fs.read(this.context.fd, buffer, 0, toRead, this.pos, (err, bytesRead) => {
if (err) {
this.destroy(err);
} else if (bytesRead === 0) {
this.destroyed = true;
this.push(null);
this.context.unref();
} else {
this.pos += bytesRead;
this.push(buffer.slice(0, bytesRead));
}
cb();
});
});
}
destroy(err) {
if (this.destroyed) return;
err = err || new Error("stream destroyed");
this.destroyed = true;
this.emit('error', err);
this.context.unref();
}
}
class WriteStream extends Writable {
constructor(context, options = {}) {
super(options);
this.context = context;
this.context.ref();
this.start = options.start || 0;
this.endOffset = (options.end == null) ? Infinity : +options.end;
this.bytesWritten = 0;
this.pos = this.start;
this.destroyed = false;
this.on('finish', this.destroy.bind(this));
}
_write(buffer, _encoding, callback) {
if (this.destroyed) return;
if (this.pos + buffer.length > this.endOffset) {
const err = new Error("maximum file length exceeded");
err.code = 'ETOOBIG';
this.destroy();
callback(err);
return;
}
this.context.pend.go(cb => {
if (this.destroyed) return cb();
fs.write(this.context.fd, buffer, 0, buffer.length, this.pos, (err, bytes) => {
if (err) {
this.destroy();
cb();
callback(err);
} else {
this.bytesWritten += bytes;
this.pos += bytes;
this.emit('progress');
cb();
callback();
}
});
});
}
destroy() {
if (this.destroyed) return;
this.destroyed = true;
this.context.unref();
}
}
const { MAX_SAFE_INTEGER } = Number;
class BufferSlicer extends EventEmitter {
constructor(buffer, options) {
super();
options = options || {};
this.refCount = 0;
this.buffer = buffer;
this.maxChunkSize = options.maxChunkSize || MAX_SAFE_INTEGER;
}
read(buffer, offset, length, position, callback) {
const end = position + length;
const delta = end - this.buffer.length;
const written = (delta > 0) ? delta : length;
this.buffer.copy(buffer, offset, position, end);
setImmediate(() => {
callback(null, written);
});
}
write(buffer, offset, length, position, callback) {
buffer.copy(this.buffer, position, offset, offset + length);
setImmediate(() => {
callback(null, length, buffer);
});
}
createReadStream(options = {}) {
const readStream = new PassThrough(options);
readStream.destroyed = false;
readStream.start = options.start || 0;
readStream.endOffset = options.end;
// by the time this function returns, we'll be done.
readStream.pos = readStream.endOffset || this.buffer.length;
// respect the maxChunkSize option to slice up the chunk into smaller pieces.
const entireSlice = this.buffer.slice(readStream.start, readStream.pos);
let offset = 0;
while (true) {
const nextOffset = offset + this.maxChunkSize;
if (nextOffset >= entireSlice.length) {
// last chunk
if (offset < entireSlice.length) {
readStream.write(entireSlice.slice(offset, entireSlice.length));
}
break;
}
readStream.write(entireSlice.slice(offset, nextOffset));
offset = nextOffset;
}
readStream.end();
readStream.destroy = () => {
readStream.destroyed = true;
};
return readStream;
}
createWriteStream(options) {
const bufferSlicer = this;
options = options || {};
const writeStream = new Writable(options);
writeStream.start = options.start || 0;
writeStream.endOffset = (options.end == null) ? this.buffer.length : +options.end;
writeStream.bytesWritten = 0;
writeStream.pos = writeStream.start;
writeStream.destroyed = false;
writeStream._write = (buffer, encoding, callback) => {
if (writeStream.destroyed) return;
const end = writeStream.pos + buffer.length;
if (end > writeStream.endOffset) {
const err = new Error("maximum file length exceeded");
err.code = 'ETOOBIG';
writeStream.destroyed = true;
callback(err);
return;
}
buffer.copy(bufferSlicer.buffer, writeStream.pos, 0, buffer.length);
writeStream.bytesWritten += buffer.length;
writeStream.pos = end;
writeStream.emit('progress');
callback();
};
writeStream.destroy = () => {
writeStream.destroyed = true;
};
return writeStream;
}
ref() {
this.refCount += 1;
}
unref() {
this.refCount -= 1;
if (this.refCount < 0) {
throw new Error("invalid unref");
}
}
}
function createFromBuffer(buffer, options) {
return new BufferSlicer(buffer, options);
}
function createFromFd(fd, options) {
return new FdSlicer(fd, options);
}
exports.createFromBuffer = createFromBuffer;
exports.createFromFd = createFromFd;
exports.BufferSlicer = BufferSlicer;
exports.FdSlicer = FdSlicer;
@@ -0,0 +1,14 @@
import { isNumber } from "./isNumber.mjs";
import { isValidDate } from "./isValidDate.mjs";
function isLeapYear(value) {
let year = value;
if (isValidDate(value)) {
year = value.getFullYear();
} else if (!isNumber(value)) {
return false;
}
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
}
export {
isLeapYear
};
@@ -0,0 +1,605 @@
/**
* @fileoverview Rule to disallow use of the `RegExp` constructor in favor of regular expression literals
* @author Milos Djermanovic
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
const {
CALL,
CONSTRUCT,
ReferenceTracker,
} = require("@eslint-community/eslint-utils");
const {
RegExpValidator,
visitRegExpAST,
RegExpParser,
} = require("@eslint-community/regexpp");
const { canTokensBeAdjacent } = require("./utils/ast-utils");
const { REGEXPP_LATEST_ECMA_VERSION } = require("./utils/regular-expressions");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Determines whether the given node is a string literal.
* @param {ASTNode} node Node to check.
* @returns {boolean} True if the node is a string literal.
*/
function isStringLiteral(node) {
return node.type === "Literal" && typeof node.value === "string";
}
/**
* Determines whether the given node is a regex literal.
* @param {ASTNode} node Node to check.
* @returns {boolean} True if the node is a regex literal.
*/
function isRegexLiteral(node) {
return node.type === "Literal" && Object.hasOwn(node, "regex");
}
const validPrecedingTokens = new Set([
"(",
";",
"[",
",",
"=",
"+",
"*",
"-",
"?",
"~",
"%",
"**",
"!",
"typeof",
"instanceof",
"&&",
"||",
"??",
"return",
"...",
"delete",
"void",
"in",
"<",
">",
"<=",
">=",
"==",
"===",
"!=",
"!==",
"<<",
">>",
">>>",
"&",
"|",
"^",
":",
"{",
"=>",
"*=",
"<<=",
">>=",
">>>=",
"^=",
"|=",
"&=",
"??=",
"||=",
"&&=",
"**=",
"+=",
"-=",
"/=",
"%=",
"/",
"do",
"break",
"continue",
"debugger",
"case",
"throw",
]);
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [
{
disallowRedundantWrapping: false,
},
],
docs: {
description:
"Disallow use of the `RegExp` constructor in favor of regular expression literals",
recommended: false,
url: "https://eslint.org/docs/latest/rules/prefer-regex-literals",
},
hasSuggestions: true,
schema: [
{
type: "object",
properties: {
disallowRedundantWrapping: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
unexpectedRegExp:
"Use a regular expression literal instead of the 'RegExp' constructor.",
replaceWithLiteral:
"Replace with an equivalent regular expression literal.",
replaceWithLiteralAndFlags:
"Replace with an equivalent regular expression literal with flags '{{ flags }}'.",
replaceWithIntendedLiteralAndFlags:
"Replace with a regular expression literal with flags '{{ flags }}'.",
unexpectedRedundantRegExp:
"Regular expression literal is unnecessarily wrapped within a 'RegExp' constructor.",
unexpectedRedundantRegExpWithFlags:
"Use regular expression literal with flags instead of the 'RegExp' constructor.",
},
},
create(context) {
const [{ disallowRedundantWrapping }] = context.options;
const sourceCode = context.sourceCode;
/**
* Determines whether the given node is a String.raw`` tagged template expression
* with a static template literal.
* @param {ASTNode} node Node to check.
* @returns {boolean} True if the node is String.raw`` with a static template.
*/
function isStringRawTaggedStaticTemplateLiteral(node) {
return (
node.type === "TaggedTemplateExpression" &&
astUtils.isSpecificMemberAccess(node.tag, "String", "raw") &&
sourceCode.isGlobalReference(
astUtils.skipChainExpression(node.tag).object,
) &&
astUtils.isStaticTemplateLiteral(node.quasi)
);
}
/**
* Gets the value of a string
* @param {ASTNode} node The node to get the string of.
* @returns {string|null} The value of the node.
*/
function getStringValue(node) {
if (isStringLiteral(node)) {
return node.value;
}
if (astUtils.isStaticTemplateLiteral(node)) {
return node.quasis[0].value.cooked;
}
if (isStringRawTaggedStaticTemplateLiteral(node)) {
return node.quasi.quasis[0].value.raw;
}
return null;
}
/**
* Determines whether the given node is considered to be a static string by the logic of this rule.
* @param {ASTNode} node Node to check.
* @returns {boolean} True if the node is a static string.
*/
function isStaticString(node) {
return (
isStringLiteral(node) ||
astUtils.isStaticTemplateLiteral(node) ||
isStringRawTaggedStaticTemplateLiteral(node)
);
}
/**
* Determines whether the relevant arguments of the given are all static string literals.
* @param {ASTNode} node Node to check.
* @returns {boolean} True if all arguments are static strings.
*/
function hasOnlyStaticStringArguments(node) {
const args = node.arguments;
if (
(args.length === 1 || args.length === 2) &&
args.every(isStaticString)
) {
return true;
}
return false;
}
/**
* Determines whether the arguments of the given node indicate that a regex literal is unnecessarily wrapped.
* @param {ASTNode} node Node to check.
* @returns {boolean} True if the node already contains a regex literal argument.
*/
function isUnnecessarilyWrappedRegexLiteral(node) {
const args = node.arguments;
if (args.length === 1 && isRegexLiteral(args[0])) {
return true;
}
if (
args.length === 2 &&
isRegexLiteral(args[0]) &&
isStaticString(args[1])
) {
return true;
}
return false;
}
/**
* Returns a ecmaVersion compatible for regexpp.
* @param {number} ecmaVersion The ecmaVersion to convert.
* @returns {import("@eslint-community/regexpp/ecma-versions").EcmaVersion} The resulting ecmaVersion compatible for regexpp.
*/
function getRegexppEcmaVersion(ecmaVersion) {
if (ecmaVersion <= 5) {
return 5;
}
return Math.min(ecmaVersion, REGEXPP_LATEST_ECMA_VERSION);
}
const regexppEcmaVersion = getRegexppEcmaVersion(
context.languageOptions.ecmaVersion,
);
/**
* Makes a character escaped or else returns null.
* @param {string} character The character to escape.
* @returns {string} The resulting escaped character.
*/
function resolveEscapes(character) {
switch (character) {
case "\n":
case "\\\n":
return "\\n";
case "\r":
case "\\\r":
return "\\r";
case "\t":
case "\\\t":
return "\\t";
case "\v":
case "\\\v":
return "\\v";
case "\f":
case "\\\f":
return "\\f";
case "/":
return "\\/";
default:
return null;
}
}
/**
* Checks whether the given regex and flags are valid for the ecma version or not.
* @param {string} pattern The regex pattern to check.
* @param {string | undefined} flags The regex flags to check.
* @returns {boolean} True if the given regex pattern and flags are valid for the ecma version.
*/
function isValidRegexForEcmaVersion(pattern, flags) {
const validator = new RegExpValidator({
ecmaVersion: regexppEcmaVersion,
});
try {
validator.validatePattern(pattern, 0, pattern.length, {
unicode: flags ? flags.includes("u") : false,
unicodeSets: flags ? flags.includes("v") : false,
});
if (flags) {
validator.validateFlags(flags);
}
return true;
} catch {
return false;
}
}
/**
* Checks whether two given regex flags contain the same flags or not.
* @param {string} flagsA The regex flags.
* @param {string} flagsB The regex flags.
* @returns {boolean} True if two regex flags contain same flags.
*/
function areFlagsEqual(flagsA, flagsB) {
return [...flagsA].sort().join("") === [...flagsB].sort().join("");
}
/**
* Merges two regex flags.
* @param {string} flagsA The regex flags.
* @param {string} flagsB The regex flags.
* @returns {string} The merged regex flags.
*/
function mergeRegexFlags(flagsA, flagsB) {
const flagsSet = new Set([...flagsA, ...flagsB]);
return [...flagsSet].join("");
}
/**
* Checks whether a give node can be fixed to the given regex pattern and flags.
* @param {ASTNode} node The node to check.
* @param {string} pattern The regex pattern to check.
* @param {string} flags The regex flags
* @returns {boolean} True if a node can be fixed to the given regex pattern and flags.
*/
function canFixTo(node, pattern, flags) {
const tokenBefore = sourceCode.getTokenBefore(node);
return (
sourceCode.getCommentsInside(node).length === 0 &&
(!tokenBefore || validPrecedingTokens.has(tokenBefore.value)) &&
isValidRegexForEcmaVersion(pattern, flags)
);
}
/**
* Returns a safe output code considering the before and after tokens.
* @param {ASTNode} node The regex node.
* @param {string} newRegExpValue The new regex expression value.
* @returns {string} The output code.
*/
function getSafeOutput(node, newRegExpValue) {
const tokenBefore = sourceCode.getTokenBefore(node);
const tokenAfter = sourceCode.getTokenAfter(node);
return (
(tokenBefore &&
!canTokensBeAdjacent(tokenBefore, newRegExpValue) &&
tokenBefore.range[1] === node.range[0]
? " "
: "") +
newRegExpValue +
(tokenAfter &&
!canTokensBeAdjacent(newRegExpValue, tokenAfter) &&
node.range[1] === tokenAfter.range[0]
? " "
: "")
);
}
return {
Program(node) {
const scope = sourceCode.getScope(node);
const tracker = new ReferenceTracker(scope);
const traceMap = {
RegExp: {
[CALL]: true,
[CONSTRUCT]: true,
},
};
for (const { node: refNode } of tracker.iterateGlobalReferences(
traceMap,
)) {
if (
disallowRedundantWrapping &&
isUnnecessarilyWrappedRegexLiteral(refNode)
) {
const regexNode = refNode.arguments[0];
if (refNode.arguments.length === 2) {
const suggests = [];
const argFlags =
getStringValue(refNode.arguments[1]) || "";
if (
canFixTo(
refNode,
regexNode.regex.pattern,
argFlags,
)
) {
suggests.push({
messageId: "replaceWithLiteralAndFlags",
pattern: regexNode.regex.pattern,
flags: argFlags,
});
}
const literalFlags = regexNode.regex.flags || "";
const mergedFlags = mergeRegexFlags(
literalFlags,
argFlags,
);
if (
!areFlagsEqual(mergedFlags, argFlags) &&
canFixTo(
refNode,
regexNode.regex.pattern,
mergedFlags,
)
) {
suggests.push({
messageId:
"replaceWithIntendedLiteralAndFlags",
pattern: regexNode.regex.pattern,
flags: mergedFlags,
});
}
context.report({
node: refNode,
messageId: "unexpectedRedundantRegExpWithFlags",
suggest: suggests.map(
({ flags, pattern, messageId }) => ({
messageId,
data: {
flags,
},
fix(fixer) {
return fixer.replaceText(
refNode,
getSafeOutput(
refNode,
`/${pattern}/${flags}`,
),
);
},
}),
),
});
} else {
const outputs = [];
if (
canFixTo(
refNode,
regexNode.regex.pattern,
regexNode.regex.flags,
)
) {
outputs.push(sourceCode.getText(regexNode));
}
context.report({
node: refNode,
messageId: "unexpectedRedundantRegExp",
suggest: outputs.map(output => ({
messageId: "replaceWithLiteral",
fix(fixer) {
return fixer.replaceText(
refNode,
getSafeOutput(refNode, output),
);
},
})),
});
}
} else if (hasOnlyStaticStringArguments(refNode)) {
let regexContent = getStringValue(refNode.arguments[0]);
let noFix = false;
let flags;
if (refNode.arguments[1]) {
flags = getStringValue(refNode.arguments[1]);
}
if (!canFixTo(refNode, regexContent, flags)) {
noFix = true;
}
if (
!/^[-\w\\[\](){} \t\r\n\v\f!@#$%^&*+=/~`.><?,'"|:;]*$/u.test(
regexContent,
)
) {
noFix = true;
}
if (regexContent && !noFix) {
let charIncrease = 0;
const ast = new RegExpParser({
ecmaVersion: regexppEcmaVersion,
}).parsePattern(
regexContent,
0,
regexContent.length,
{
unicode: flags
? flags.includes("u")
: false,
unicodeSets: flags
? flags.includes("v")
: false,
},
);
visitRegExpAST(ast, {
onCharacterEnter(characterNode) {
const escaped = resolveEscapes(
characterNode.raw,
);
if (escaped) {
regexContent =
regexContent.slice(
0,
characterNode.start +
charIncrease,
) +
escaped +
regexContent.slice(
characterNode.end +
charIncrease,
);
if (characterNode.raw.length === 1) {
charIncrease += 1;
}
}
},
});
}
const newRegExpValue = `/${regexContent || "(?:)"}/${flags || ""}`;
context.report({
node: refNode,
messageId: "unexpectedRegExp",
suggest: noFix
? []
: [
{
messageId: "replaceWithLiteral",
fix(fixer) {
return fixer.replaceText(
refNode,
getSafeOutput(
refNode,
newRegExpValue,
),
);
},
},
],
});
}
}
},
};
},
};
@@ -0,0 +1,39 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const {
definePrototypeMethodHandler,
} = require("../util/define-prototype-method-handler")
module.exports = {
meta: {
docs: {
description: "disallow the `Array.prototype.entries` method.",
category: "ES2015",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-array-prototype-entries.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' method is forbidden.",
},
schema: [
{
type: "object",
properties: {
aggressive: { type: "boolean" },
},
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
return definePrototypeMethodHandler(context, {
Array: ["entries"],
})
},
}
@@ -0,0 +1,78 @@
import LodashWrapper from './_LodashWrapper.js';
import flatRest from './_flatRest.js';
import getData from './_getData.js';
import getFuncName from './_getFuncName.js';
import isArray from './isArray.js';
import isLaziable from './_isLaziable.js';
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used to compose bitmasks for function metadata. */
var WRAP_CURRY_FLAG = 8,
WRAP_PARTIAL_FLAG = 32,
WRAP_ARY_FLAG = 128,
WRAP_REARG_FLAG = 256;
/**
* Creates a `_.flow` or `_.flowRight` function.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new flow function.
*/
function createFlow(fromRight) {
return flatRest(function(funcs) {
var length = funcs.length,
index = length,
prereq = LodashWrapper.prototype.thru;
if (fromRight) {
funcs.reverse();
}
while (index--) {
var func = funcs[index];
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
var wrapper = new LodashWrapper([], true);
}
}
index = wrapper ? index : length;
while (++index < length) {
func = funcs[index];
var funcName = getFuncName(func),
data = funcName == 'wrapper' ? getData(func) : undefined;
if (data && isLaziable(data[0]) &&
data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
!data[4].length && data[9] == 1
) {
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
} else {
wrapper = (func.length == 1 && isLaziable(func))
? wrapper[funcName]()
: wrapper.thru(func);
}
}
return function() {
var args = arguments,
value = args[0];
if (wrapper && args.length == 1 && isArray(value)) {
return wrapper.plant(value).value();
}
var index = 0,
result = length ? funcs[index].apply(this, args) : value;
while (++index < length) {
result = funcs[index].call(this, result);
}
return result;
};
});
}
export default createFlow;
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,sBAAgB,CAAC;IACjD,iBAAiB,CAAC,OAAS,CAAC,wBAAqB,EAAE,KAAK,UAAU,CAAC,0BAAoB,CAAC;IACxF,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,QAAQ,CAAC;IAC/C,cAAc,CAAC,mBAAgB,CAAC;IAChC,kBAAkB,CAAC,OAAS,CAAC,wBAAqB,EAAE,KAAK,UAAU,CAAC,wBAAqB,CAAC;IAC1F,sBAAsB,CAAC,mDAAmD,CAAC;IAC3E,UAAU,CAAC,IAAI,CAAC;IAChB,aAAa,CAAC,YAAS,CAAC;IACxB,YAAY,CAAC,cAAc,CAAC;AAC9B","sources":["packages/@react-aria/table/intl/et-EE.json"],"sourcesContent":["{\n \"ascending\": \"tõusev järjestus\",\n \"ascendingSort\": \"sorditud veeru järgi {columnName} tõusvas järjestuses\",\n \"columnSize\": \"{value} pikslit\",\n \"descending\": \"laskuv järjestus\",\n \"descendingSort\": \"sorditud veeru järgi {columnName} laskuvas järjestuses\",\n \"resizerDescription\": \"Suuruse muutmise alustamiseks vajutage klahvi Enter\",\n \"select\": \"Vali\",\n \"selectAll\": \"Vali kõik\",\n \"sortable\": \"sorditav veerg\"\n}\n"],"names":[],"version":3,"file":"et-EE.main.js.map"}
@@ -0,0 +1,5 @@
import type { ReadableStream as NodeReadableStream } from 'node:stream/web';
import { WebStreamByobReader } from './WebStreamByobReader.js';
import { WebStreamDefaultReader } from './WebStreamDefaultReader.js';
export type AnyWebByteStream = NodeReadableStream<Uint8Array> | ReadableStream<Uint8Array>;
export declare function makeWebStreamReader(stream: AnyWebByteStream): WebStreamByobReader | WebStreamDefaultReader;
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"noEmit": true,
"strict": true
},
"files": [
"./reusify.d.ts"
]
}
@@ -0,0 +1 @@
{"version":3,"file":"PlanParamsConstraint.d.ts","sourceRoot":"","sources":["../../../../src/planning/models/PlanParamsConstraint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AAExF,MAAM,MAAM,oBAAoB,GAC5B,iCAAiC,GACjC,mCAAmC,CAAC"}
@@ -0,0 +1,6 @@
"use strict";
function _read_only_error(name) {
throw new TypeError("\"" + name + "\" is read-only");
}
exports._ = _read_only_error;
@@ -0,0 +1,66 @@
{
"name": "csstype",
"version": "3.1.3",
"main": "",
"types": "index.d.ts",
"description": "Strict TypeScript and Flow types for style based on MDN data",
"repository": "https://github.com/frenic/csstype",
"author": "Fredrik Nicol <fredrik.nicol@gmail.com>",
"license": "MIT",
"devDependencies": {
"@types/chokidar": "^2.1.3",
"@types/css-tree": "^2.3.1",
"@types/jest": "^29.5.0",
"@types/jsdom": "^21.1.1",
"@types/node": "^16.18.23",
"@types/prettier": "^2.7.2",
"@types/request": "^2.48.8",
"@types/turndown": "^5.0.1",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.57.0",
"chalk": "^4.1.2",
"chokidar": "^3.5.3",
"eslint": "^8.37.0",
"css-tree": "^2.3.1",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"fast-glob": "^3.2.12",
"flow-bin": "^0.203.1",
"jest": "^29.5.0",
"jsdom": "^21.1.1",
"mdn-browser-compat-data": "git+https://github.com/mdn/browser-compat-data.git#1bf44517bd08de735e9ec20dbfe8e86c96341054",
"mdn-data": "git+https://github.com/mdn/data.git#7f0c865a3c4b5d891285c93308ee5c25cb5cfee8",
"prettier": "^2.8.7",
"request": "^2.88.2",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1",
"turndown": "^7.1.2",
"typescript": "~5.0.3"
},
"scripts": {
"prepublish": "npm install --prefix __tests__ && npm install --prefix __tests__/__fixtures__",
"prepublishOnly": "tsc && npm run test:src && npm run build && ts-node --files prepublish.ts",
"update": "ts-node --files update.ts",
"build": "ts-node --files build.ts --start",
"watch": "ts-node --files build.ts --watch",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
"pretty": "prettier --write build.ts **/*.{ts,js,json,md}",
"lazy": "tsc && npm run lint",
"test": "jest --runInBand",
"test:src": "jest src.*.ts",
"test:dist": "jest dist.*.ts --runInBand"
},
"files": [
"index.d.ts",
"index.js.flow"
],
"keywords": [
"css",
"style",
"typescript",
"flow",
"typings",
"types",
"definitions"
]
}
@@ -0,0 +1,87 @@
import { HotPayload } from '../../types/hmrPayload.js';
interface FetchFunctionOptions {
cached?: boolean;
startOffset?: number;
}
type FetchResult = CachedFetchResult | ExternalFetchResult | ViteFetchResult;
interface CachedFetchResult {
/**
* If module cached in the runner, we can just confirm
* it wasn't invalidated on the server side.
*/
cache: true;
}
interface ExternalFetchResult {
/**
* The path to the externalized module starting with file://,
* by default this will be imported via a dynamic "import"
* instead of being transformed by vite and loaded with vite runner
*/
externalize: string;
/**
* Type of the module. Will be used to determine if import statement is correct.
* For example, if Vite needs to throw an error if variable is not actually exported
*/
type: 'module' | 'commonjs' | 'builtin' | 'network';
}
interface ViteFetchResult {
/**
* Code that will be evaluated by vite runner
* by default this will be wrapped in an async function
*/
code: string;
/**
* File path of the module on disk.
* This will be resolved as import.meta.url/filename
* Will be equal to `null` for virtual modules
*/
file: string | null;
/**
* Module ID in the server module graph.
*/
id: string;
/**
* Module URL used in the import.
*/
url: string;
/**
* Invalidate module on the client side.
*/
invalidate: boolean;
}
type InvokeMethods = {
fetchModule: (id: string, importer?: string, options?: FetchFunctionOptions) => Promise<FetchResult>;
};
type ModuleRunnerTransportHandlers = {
onMessage: (data: HotPayload) => void;
onDisconnection: () => void;
};
/**
* "send and connect" or "invoke" must be implemented
*/
interface ModuleRunnerTransport {
connect?(handlers: ModuleRunnerTransportHandlers): Promise<void> | void;
disconnect?(): Promise<void> | void;
send?(data: HotPayload): Promise<void> | void;
invoke?(data: HotPayload): Promise<{
result: any;
} | {
error: any;
}>;
timeout?: number;
}
interface NormalizedModuleRunnerTransport {
connect?(onMessage?: (data: HotPayload) => void): Promise<void> | void;
disconnect?(): Promise<void> | void;
send(data: HotPayload): Promise<void>;
invoke<T extends keyof InvokeMethods>(name: T, data: Parameters<InvokeMethods[T]>): Promise<ReturnType<Awaited<InvokeMethods[T]>>>;
}
declare const createWebSocketModuleRunnerTransport: (options: {
createConnection: () => WebSocket;
pingInterval?: number;
}) => Required<Pick<ModuleRunnerTransport, "connect" | "disconnect" | "send">>;
export { createWebSocketModuleRunnerTransport as c };
export type { ExternalFetchResult as E, FetchFunctionOptions as F, ModuleRunnerTransport as M, NormalizedModuleRunnerTransport as N, ViteFetchResult as V, FetchResult as a, ModuleRunnerTransportHandlers as b };
@@ -0,0 +1,350 @@
'use strict'
const Minipass = require('minipass')
const MinipassSized = require('minipass-sized')
const Blob = require('./blob.js')
const { BUFFER } = Blob
const FetchError = require('./fetch-error.js')
// optional dependency on 'encoding'
let convert
try {
convert = require('encoding').convert
} catch (e) {
// defer error until textConverted is called
}
const INTERNALS = Symbol('Body internals')
const CONSUME_BODY = Symbol('consumeBody')
class Body {
constructor (bodyArg, options = {}) {
const { size = 0, timeout = 0 } = options
const body = bodyArg === undefined || bodyArg === null ? null
: isURLSearchParams(bodyArg) ? Buffer.from(bodyArg.toString())
: isBlob(bodyArg) ? bodyArg
: Buffer.isBuffer(bodyArg) ? bodyArg
: Object.prototype.toString.call(bodyArg) === '[object ArrayBuffer]'
? Buffer.from(bodyArg)
: ArrayBuffer.isView(bodyArg)
? Buffer.from(bodyArg.buffer, bodyArg.byteOffset, bodyArg.byteLength)
: Minipass.isStream(bodyArg) ? bodyArg
: Buffer.from(String(bodyArg))
this[INTERNALS] = {
body,
disturbed: false,
error: null,
}
this.size = size
this.timeout = timeout
if (Minipass.isStream(body)) {
body.on('error', er => {
const error = er.name === 'AbortError' ? er
: new FetchError(`Invalid response while trying to fetch ${
this.url}: ${er.message}`, 'system', er)
this[INTERNALS].error = error
})
}
}
get body () {
return this[INTERNALS].body
}
get bodyUsed () {
return this[INTERNALS].disturbed
}
arrayBuffer () {
return this[CONSUME_BODY]().then(buf =>
buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength))
}
blob () {
const ct = this.headers && this.headers.get('content-type') || ''
return this[CONSUME_BODY]().then(buf => Object.assign(
new Blob([], { type: ct.toLowerCase() }),
{ [BUFFER]: buf }
))
}
async json () {
const buf = await this[CONSUME_BODY]()
try {
return JSON.parse(buf.toString())
} catch (er) {
throw new FetchError(
`invalid json response body at ${this.url} reason: ${er.message}`,
'invalid-json'
)
}
}
text () {
return this[CONSUME_BODY]().then(buf => buf.toString())
}
buffer () {
return this[CONSUME_BODY]()
}
textConverted () {
return this[CONSUME_BODY]().then(buf => convertBody(buf, this.headers))
}
[CONSUME_BODY] () {
if (this[INTERNALS].disturbed) {
return Promise.reject(new TypeError(`body used already for: ${
this.url}`))
}
this[INTERNALS].disturbed = true
if (this[INTERNALS].error) {
return Promise.reject(this[INTERNALS].error)
}
// body is null
if (this.body === null) {
return Promise.resolve(Buffer.alloc(0))
}
if (Buffer.isBuffer(this.body)) {
return Promise.resolve(this.body)
}
const upstream = isBlob(this.body) ? this.body.stream() : this.body
/* istanbul ignore if: should never happen */
if (!Minipass.isStream(upstream)) {
return Promise.resolve(Buffer.alloc(0))
}
const stream = this.size && upstream instanceof MinipassSized ? upstream
: !this.size && upstream instanceof Minipass &&
!(upstream instanceof MinipassSized) ? upstream
: this.size ? new MinipassSized({ size: this.size })
: new Minipass()
// allow timeout on slow response body, but only if the stream is still writable. this
// makes the timeout center on the socket stream from lib/index.js rather than the
// intermediary minipass stream we create to receive the data
const resTimeout = this.timeout && stream.writable ? setTimeout(() => {
stream.emit('error', new FetchError(
`Response timeout while trying to fetch ${
this.url} (over ${this.timeout}ms)`, 'body-timeout'))
}, this.timeout) : null
// do not keep the process open just for this timeout, even
// though we expect it'll get cleared eventually.
if (resTimeout && resTimeout.unref) {
resTimeout.unref()
}
// do the pipe in the promise, because the pipe() can send too much
// data through right away and upset the MP Sized object
return new Promise((resolve, reject) => {
// if the stream is some other kind of stream, then pipe through a MP
// so we can collect it more easily.
if (stream !== upstream) {
upstream.on('error', er => stream.emit('error', er))
upstream.pipe(stream)
}
resolve()
}).then(() => stream.concat()).then(buf => {
clearTimeout(resTimeout)
return buf
}).catch(er => {
clearTimeout(resTimeout)
// request was aborted, reject with this Error
if (er.name === 'AbortError' || er.name === 'FetchError') {
throw er
} else if (er.name === 'RangeError') {
throw new FetchError(`Could not create Buffer from response body for ${
this.url}: ${er.message}`, 'system', er)
} else {
// other errors, such as incorrect content-encoding or content-length
throw new FetchError(`Invalid response body while trying to fetch ${
this.url}: ${er.message}`, 'system', er)
}
})
}
static clone (instance) {
if (instance.bodyUsed) {
throw new Error('cannot clone body after it is used')
}
const body = instance.body
// check that body is a stream and not form-data object
// NB: can't clone the form-data object without having it as a dependency
if (Minipass.isStream(body) && typeof body.getBoundary !== 'function') {
// create a dedicated tee stream so that we don't lose data
// potentially sitting in the body stream's buffer by writing it
// immediately to p1 and not having it for p2.
const tee = new Minipass()
const p1 = new Minipass()
const p2 = new Minipass()
tee.on('error', er => {
p1.emit('error', er)
p2.emit('error', er)
})
body.on('error', er => tee.emit('error', er))
tee.pipe(p1)
tee.pipe(p2)
body.pipe(tee)
// set instance body to one fork, return the other
instance[INTERNALS].body = p1
return p2
} else {
return instance.body
}
}
static extractContentType (body) {
return body === null || body === undefined ? null
: typeof body === 'string' ? 'text/plain;charset=UTF-8'
: isURLSearchParams(body)
? 'application/x-www-form-urlencoded;charset=UTF-8'
: isBlob(body) ? body.type || null
: Buffer.isBuffer(body) ? null
: Object.prototype.toString.call(body) === '[object ArrayBuffer]' ? null
: ArrayBuffer.isView(body) ? null
: typeof body.getBoundary === 'function'
? `multipart/form-data;boundary=${body.getBoundary()}`
: Minipass.isStream(body) ? null
: 'text/plain;charset=UTF-8'
}
static getTotalBytes (instance) {
const { body } = instance
return (body === null || body === undefined) ? 0
: isBlob(body) ? body.size
: Buffer.isBuffer(body) ? body.length
: body && typeof body.getLengthSync === 'function' && (
// detect form data input from form-data module
body._lengthRetrievers &&
/* istanbul ignore next */ body._lengthRetrievers.length === 0 || // 1.x
body.hasKnownLength && body.hasKnownLength()) // 2.x
? body.getLengthSync()
: null
}
static writeToStream (dest, instance) {
const { body } = instance
if (body === null || body === undefined) {
dest.end()
} else if (Buffer.isBuffer(body) || typeof body === 'string') {
dest.end(body)
} else {
// body is stream or blob
const stream = isBlob(body) ? body.stream() : body
stream.on('error', er => dest.emit('error', er)).pipe(dest)
}
return dest
}
}
Object.defineProperties(Body.prototype, {
body: { enumerable: true },
bodyUsed: { enumerable: true },
arrayBuffer: { enumerable: true },
blob: { enumerable: true },
json: { enumerable: true },
text: { enumerable: true },
})
const isURLSearchParams = obj =>
// Duck-typing as a necessary condition.
(typeof obj !== 'object' ||
typeof obj.append !== 'function' ||
typeof obj.delete !== 'function' ||
typeof obj.get !== 'function' ||
typeof obj.getAll !== 'function' ||
typeof obj.has !== 'function' ||
typeof obj.set !== 'function') ? false
// Brand-checking and more duck-typing as optional condition.
: obj.constructor.name === 'URLSearchParams' ||
Object.prototype.toString.call(obj) === '[object URLSearchParams]' ||
typeof obj.sort === 'function'
const isBlob = obj =>
typeof obj === 'object' &&
typeof obj.arrayBuffer === 'function' &&
typeof obj.type === 'string' &&
typeof obj.stream === 'function' &&
typeof obj.constructor === 'function' &&
typeof obj.constructor.name === 'string' &&
/^(Blob|File)$/.test(obj.constructor.name) &&
/^(Blob|File)$/.test(obj[Symbol.toStringTag])
const convertBody = (buffer, headers) => {
/* istanbul ignore if */
if (typeof convert !== 'function') {
throw new Error('The package `encoding` must be installed to use the textConverted() function')
}
const ct = headers && headers.get('content-type')
let charset = 'utf-8'
let res
// header
if (ct) {
res = /charset=([^;]*)/i.exec(ct)
}
// no charset in content type, peek at response body for at most 1024 bytes
const str = buffer.slice(0, 1024).toString()
// html5
if (!res && str) {
res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str)
}
// html4
if (!res && str) {
res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str)
if (!res) {
res = /<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(str)
if (res) {
res.pop()
} // drop last quote
}
if (res) {
res = /charset=(.*)/i.exec(res.pop())
}
}
// xml
if (!res && str) {
res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str)
}
// found charset
if (res) {
charset = res.pop()
// prevent decode issues when sites use incorrect encoding
// ref: https://hsivonen.fi/encoding-menu/
if (charset === 'gb2312' || charset === 'gbk') {
charset = 'gb18030'
}
}
// turn raw buffers into a single utf-8 buffer
return convert(
buffer,
'UTF-8',
charset
).toString()
}
module.exports = Body
@@ -0,0 +1,187 @@
// Copyright (c) 2011-2012 Ryan Prichard
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
#include "DebugClient.h"
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <string>
#include "winpty_snprintf.h"
const wchar_t *const kPipeName = L"\\\\.\\pipe\\DebugServer";
void *volatile g_debugConfig;
namespace {
// It would be easy to accidentally trample on the Windows LastError value
// by adding logging/debugging code. Ensure that can't happen by saving and
// restoring the value. This saving and restoring doesn't happen along the
// fast path.
class PreserveLastError {
public:
PreserveLastError() : m_lastError(GetLastError()) {}
~PreserveLastError() { SetLastError(m_lastError); }
private:
DWORD m_lastError;
};
} // anonymous namespace
static void sendToDebugServer(const char *message)
{
HANDLE tracePipe = INVALID_HANDLE_VALUE;
do {
// The default impersonation level is SECURITY_IMPERSONATION, which allows
// a sufficiently authorized named pipe server to impersonate the client.
// There's no need for impersonation in this debugging system, so reduce
// the impersonation level to SECURITY_IDENTIFICATION, which allows a
// server to merely identify us.
tracePipe = CreateFileW(
kPipeName,
GENERIC_READ | GENERIC_WRITE,
0, NULL, OPEN_EXISTING,
SECURITY_SQOS_PRESENT | SECURITY_IDENTIFICATION,
NULL);
} while (tracePipe == INVALID_HANDLE_VALUE &&
GetLastError() == ERROR_PIPE_BUSY &&
WaitNamedPipeW(kPipeName, NMPWAIT_WAIT_FOREVER));
if (tracePipe != INVALID_HANDLE_VALUE) {
DWORD newMode = PIPE_READMODE_MESSAGE;
SetNamedPipeHandleState(tracePipe, &newMode, NULL, NULL);
char response[16];
DWORD actual = 0;
TransactNamedPipe(tracePipe,
const_cast<char*>(message), strlen(message),
response, sizeof(response), &actual, NULL);
CloseHandle(tracePipe);
}
}
// Get the current UTC time as milliseconds from the epoch (ignoring leap
// seconds). Use the Unix epoch for consistency with DebugClient.py. There
// are 134774 days between 1601-01-01 (the Win32 epoch) and 1970-01-01 (the
// Unix epoch).
static long long unixTimeMillis()
{
FILETIME fileTime;
GetSystemTimeAsFileTime(&fileTime);
long long msTime = (((long long)fileTime.dwHighDateTime << 32) +
fileTime.dwLowDateTime) / 10000;
return msTime - 134774LL * 24 * 3600 * 1000;
}
static const char *getDebugConfig()
{
if (g_debugConfig == NULL) {
PreserveLastError preserve;
const int bufSize = 256;
char buf[bufSize];
DWORD actualSize =
GetEnvironmentVariableA("WINPTY_DEBUG", buf, bufSize);
if (actualSize == 0 || actualSize >= static_cast<DWORD>(bufSize)) {
buf[0] = '\0';
}
const size_t len = strlen(buf) + 1;
char *newConfig = new char[len];
std::copy(buf, buf + len, newConfig);
void *oldValue = InterlockedCompareExchangePointer(
&g_debugConfig, newConfig, NULL);
if (oldValue != NULL) {
delete [] newConfig;
}
}
return static_cast<const char*>(g_debugConfig);
}
bool isTracingEnabled()
{
static bool disabled, enabled;
if (disabled) {
return false;
} else if (enabled) {
return true;
} else {
// Recognize WINPTY_DEBUG=1 for backwards compatibility.
PreserveLastError preserve;
bool value = hasDebugFlag("trace") || hasDebugFlag("1");
disabled = !value;
enabled = value;
return value;
}
}
bool hasDebugFlag(const char *flag)
{
if (strchr(flag, ',') != NULL) {
trace("INTERNAL ERROR: hasDebugFlag flag has comma: '%s'", flag);
abort();
}
const char *const configCStr = getDebugConfig();
if (configCStr[0] == '\0') {
return false;
}
PreserveLastError preserve;
std::string config(configCStr);
std::string flagStr(flag);
config = "," + config + ",";
flagStr = "," + flagStr + ",";
return config.find(flagStr) != std::string::npos;
}
void trace(const char *format, ...)
{
if (!isTracingEnabled())
return;
PreserveLastError preserve;
char message[1024];
va_list ap;
va_start(ap, format);
winpty_vsnprintf(message, format, ap);
message[sizeof(message) - 1] = '\0';
va_end(ap);
const int currentTime = (int)(unixTimeMillis() % (100000 * 1000));
char moduleName[1024];
moduleName[0] = '\0';
GetModuleFileNameA(NULL, moduleName, sizeof(moduleName));
const char *baseName = strrchr(moduleName, '\\');
baseName = (baseName != NULL) ? baseName + 1 : moduleName;
char fullMessage[1024];
winpty_snprintf(fullMessage,
"[%05d.%03d %s,p%04d,t%04d]: %s",
currentTime / 1000, currentTime % 1000,
baseName, (int)GetCurrentProcessId(), (int)GetCurrentThreadId(),
message);
fullMessage[sizeof(fullMessage) - 1] = '\0';
sendToDebugServer(fullMessage);
}
@@ -0,0 +1,102 @@
// Belarusian [be]
import dayjs from '../index';
var monthFormat = 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_');
var monthStandalone = 'студзень_лютый_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_');
var monthShortFormat = 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж.'.split('_');
var monthShortStandalone = 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_');
var MONTHS_IN_FORMAT = /D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;
function plural(word, num) {
var forms = word.split('_');
return num % 10 === 1 && num % 100 !== 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]; // eslint-disable-line
}
function relativeTimeWithPlural(number, withoutSuffix, key) {
var format = {
ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
mm: withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
hh: withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
dd: 'дзень_дні_дзён',
MM: 'месяц_месяцы_месяцаў',
yy: 'год_гады_гадоў'
};
if (key === 'm') {
return withoutSuffix ? 'хвіліна' : 'хвіліну';
} else if (key === 'h') {
return withoutSuffix ? 'гадзіна' : 'гадзіну';
}
return number + " " + plural(format[key], +number);
}
var months = function months(dayjsInstance, format) {
if (MONTHS_IN_FORMAT.test(format)) {
return monthFormat[dayjsInstance.month()];
}
return monthStandalone[dayjsInstance.month()];
};
months.s = monthStandalone;
months.f = monthFormat;
var monthsShort = function monthsShort(dayjsInstance, format) {
if (MONTHS_IN_FORMAT.test(format)) {
return monthShortFormat[dayjsInstance.month()];
}
return monthShortStandalone[dayjsInstance.month()];
};
monthsShort.s = monthShortStandalone;
monthsShort.f = monthShortFormat;
var locale = {
name: 'be',
weekdays: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),
weekdaysShort: 'няд_пнд_аўт_сер_чцв_пят_суб'.split('_'),
weekdaysMin: 'нд_пн_аў_ср_чц_пт_сб'.split('_'),
months: months,
monthsShort: monthsShort,
weekStart: 1,
yearStart: 4,
formats: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY г.',
LLL: 'D MMMM YYYY г., HH:mm',
LLLL: 'dddd, D MMMM YYYY г., HH:mm'
},
relativeTime: {
future: 'праз %s',
past: '%s таму',
s: 'некалькі секунд',
m: relativeTimeWithPlural,
mm: relativeTimeWithPlural,
h: relativeTimeWithPlural,
hh: relativeTimeWithPlural,
d: 'дзень',
dd: relativeTimeWithPlural,
M: 'месяц',
MM: relativeTimeWithPlural,
y: 'год',
yy: relativeTimeWithPlural
},
ordinal: function ordinal(n) {
return n;
},
meridiem: function meridiem(hour) {
if (hour < 4) {
return 'ночы';
} else if (hour < 12) {
return 'раніцы';
} else if (hour < 17) {
return 'дня';
}
return 'вечара';
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,21 @@
'use strict';
var GetIterator = require('./GetIterator');
var IteratorStep = require('./IteratorStep');
var IteratorValue = require('./IteratorValue');
// https://262.ecma-international.org/8.0/#sec-iterabletolist
module.exports = function IterableToList(items, method) {
var iterator = GetIterator(items, method);
var values = [];
var next = true;
while (next) {
next = IteratorStep(iterator);
if (next) {
var nextValue = IteratorValue(next);
values[values.length] = nextValue;
}
}
return values;
};
@@ -0,0 +1,23 @@
// When on node 14, it validates that all of the commonjs exports
// are correctly re-exported for es modules importers.
const nodeMajor = Number(process.version.split(".")[0].slice(1))
if (nodeMajor < 14) {
console.log("Skipping because node does not support module exports.")
process.exit(0)
}
// ES Modules import via the ./modules folder
import * as esTSLib from "../../modules/index.js"
// Force a commonjs resolve
import { createRequire } from "module";
const commonJSTSLib = createRequire(import.meta.url)("../../tslib.js");
for (const key in commonJSTSLib) {
if (commonJSTSLib.hasOwnProperty(key)) {
if(!esTSLib[key]) throw new Error(`ESModules is missing ${key} - it needs to be re-exported in ./modules/index.js`)
}
}
console.log("All exports in commonjs are available for es module consumers.")
@@ -0,0 +1,111 @@
import fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import { toArray } from '@vitest/utils/helpers';
import { resolve, basename } from 'pathe';
import sirv from 'sirv';
import c from 'tinyrainbow';
import { coverageConfigDefaults } from 'vitest/config';
import { isValidApiRequest, isFileServingAllowed } from 'vitest/node';
var version = "4.0.9";
var index = (ctx) => {
if (ctx.version !== version) {
ctx.logger.warn(c.yellow(`Loaded ${c.inverse(c.yellow(` vitest@${ctx.version} `))} and ${c.inverse(c.yellow(` @vitest/ui@${version} `))}.` + "\nRunning mixed versions is not supported and may lead into bugs" + "\nUpdate your dependencies and make sure the versions match."));
}
return {
name: "vitest:ui",
apply: "serve",
configureServer: {
order: "post",
handler(server) {
const uiOptions = ctx.config;
const base = uiOptions.uiBase;
const coverageFolder = resolveCoverageFolder(ctx);
const coveragePath = coverageFolder ? coverageFolder[1] : undefined;
if (coveragePath && base === coveragePath) {
throw new Error(`The ui base path and the coverage path cannot be the same: ${base}, change coverage.reportsDirectory`);
}
if (coverageFolder) {
server.middlewares.use(coveragePath, sirv(coverageFolder[0], {
single: true,
dev: true,
setHeaders: (res) => {
res.setHeader("Cache-Control", "public,max-age=0,must-revalidate");
}
}));
}
const clientDist = resolve(fileURLToPath(import.meta.url), "../client");
const clientIndexHtml = fs.readFileSync(resolve(clientDist, "index.html"), "utf-8");
// eslint-disable-next-line prefer-arrow-callback
server.middlewares.use(function vitestAttachment(req, res, next) {
if (!req.url) {
return next();
}
const url = new URL(req.url, "http://localhost");
if (url.pathname === "/__vitest_attachment__") {
const path = url.searchParams.get("path");
const contentType = url.searchParams.get("contentType");
// ignore invalid requests
if (!isValidApiRequest(ctx.config, req) || !contentType || !path) {
return next();
}
const fsPath = decodeURIComponent(path);
if (!isFileServingAllowed(ctx.vite.config, fsPath)) {
return next();
}
try {
res.writeHead(200, { "content-type": contentType });
fs.createReadStream(fsPath).pipe(res).on("close", () => res.end());
} catch (err) {
next(err);
}
} else {
next();
}
});
// serve index.html with api token
// eslint-disable-next-line prefer-arrow-callback
server.middlewares.use(function vitestUiHtmlMiddleware(req, res, next) {
if (req.url) {
const url = new URL(req.url, "http://localhost");
if (url.pathname === base) {
const html = clientIndexHtml.replace("<!-- !LOAD_METADATA! -->", `<script>window.VITEST_API_TOKEN = ${JSON.stringify(ctx.config.api.token)}<\/script>`);
res.setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate");
res.setHeader("Content-Type", "text/html; charset=utf-8");
res.write(html);
res.end();
return;
}
}
next();
});
server.middlewares.use(base, sirv(clientDist, {
single: true,
dev: true
}));
}
}
};
};
function resolveCoverageFolder(ctx) {
const options = ctx.config;
const htmlReporter = options.api?.port && options.coverage?.enabled ? toArray(options.coverage.reporter).find((reporter) => {
if (typeof reporter === "string") {
return reporter === "html";
}
return reporter[0] === "html";
}) : undefined;
if (!htmlReporter) {
return undefined;
}
// reportsDirectory not resolved yet
const root = resolve(ctx.config?.root || options.root || process.cwd(), options.coverage.reportsDirectory || coverageConfigDefaults.reportsDirectory);
const subdir = Array.isArray(htmlReporter) && htmlReporter.length > 1 && "subdir" in htmlReporter[1] ? htmlReporter[1].subdir : undefined;
if (!subdir || typeof subdir !== "string") {
return [root, `/${basename(root)}/`];
}
return [resolve(root, subdir), `/${basename(root)}/${subdir}/`];
}
export { index as default };
@@ -0,0 +1,140 @@
# through2
![Build & Test](https://github.com/rvagg/through2/workflows/Build%20&%20Test/badge.svg)
[![NPM](https://nodei.co/npm/through2.png?downloads&downloadRank)](https://nodei.co/npm/through2/)
**A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise**
Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`.
```js
fs.createReadStream('ex.txt')
.pipe(through2(function (chunk, enc, callback) {
for (let i = 0; i < chunk.length; i++)
if (chunk[i] == 97)
chunk[i] = 122 // swap 'a' for 'z'
this.push(chunk)
callback()
}))
.pipe(fs.createWriteStream('out.txt'))
.on('finish', () => doSomethingSpecial())
```
Or object streams:
```js
const all = []
fs.createReadStream('data.csv')
.pipe(csv2())
.pipe(through2.obj(function (chunk, enc, callback) {
const data = {
name : chunk[0]
, address : chunk[3]
, phone : chunk[10]
}
this.push(data)
callback()
}))
.on('data', (data) => {
all.push(data)
})
.on('end', () => {
doSomethingSpecial(all)
})
```
Note that `through2.obj(fn)` is a convenience wrapper around `through2({ objectMode: true }, fn)`.
## Do you need this?
Since Node.js introduced [Simplified Stream Construction](https://nodejs.org/api/stream.html#stream_simplified_construction), many uses of **through2** have become redundant. Consider whether you really need to use **through2** or just want to use the `'readable-stream'` package, or the core `'stream'` package (which is derived from `'readable-stream'`):
```js
const { Transform } = require('readable-stream')
const transformer = new Transform({
transform(chunk, enc, callback) {
// ...
}
})
```
## API
<b><code>through2([ options, ] [ transformFunction ] [, flushFunction ])</code></b>
Consult the **[stream.Transform](https://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`).
### options
The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams (or just use `through2.obj()`).
The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call:
```js
fs.createReadStream('/tmp/important.dat')
.pipe(through2({ objectMode: true, allowHalfOpen: false },
(chunk, enc, cb) => {
cb(null, 'wut?') // note we can use the second argument on the callback
// to provide data as an alternative to this.push('wut?')
}
))
.pipe(fs.createWriteStream('/tmp/wut.txt'))
```
### transformFunction
The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk.
To queue a new chunk, call `this.push(chunk)`&mdash;this can be called as many times as required before the `callback()` if you have multiple pieces to send on.
Alternatively, you may use `callback(err, chunk)` as shorthand for emitting a single chunk or an error.
If you **do not provide a `transformFunction`** then you will get a simple pass-through stream.
### flushFunction
The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress.
```js
fs.createReadStream('/tmp/important.dat')
.pipe(through2(
(chunk, enc, cb) => cb(null, chunk), // transform is a noop
function (cb) { // flush function
this.push('tacking on an extra buffer to the end');
cb();
}
))
.pipe(fs.createWriteStream('/tmp/wut.txt'));
```
<b><code>through2.ctor([ options, ] transformFunction[, flushFunction ])</code></b>
Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances.
```js
const FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) {
if (record.temp != null && record.unit == "F") {
record.temp = ( ( record.temp - 32 ) * 5 ) / 9
record.unit = "C"
}
this.push(record)
callback()
})
// Create instances of FToC like so:
const converter = new FToC()
// Or:
const converter = FToC()
// Or specify/override options when you instantiate, if you prefer:
const converter = FToC({objectMode: true})
```
## License
**through2** is Copyright &copy; Rod Vagg and additional contributors and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.
@@ -0,0 +1,6 @@
import { ResolvedValueBinding } from '../../binding/models/ResolvedValueBinding';
import { ResolvedValueBindingNode } from '../../planning/models/ResolvedValueBindingNode';
import { ResolutionParams } from '../models/ResolutionParams';
import { Resolved } from '../models/Resolved';
export declare const resolveScopedResolvedValueBindingNode: <TActivated>(resolve: (params: ResolutionParams, node: ResolvedValueBindingNode<ResolvedValueBinding<TActivated>>) => Resolved<TActivated>) => (params: ResolutionParams, node: ResolvedValueBindingNode<ResolvedValueBinding<TActivated>>) => Resolved<TActivated>;
//# sourceMappingURL=resolveScopedResolvedValueBindingNode.d.ts.map
@@ -0,0 +1,17 @@
import baseInverter from './_baseInverter.js';
/**
* Creates a function like `_.invertBy`.
*
* @private
* @param {Function} setter The function to set accumulator values.
* @param {Function} toIteratee The function to resolve iteratees.
* @returns {Function} Returns the new inverter function.
*/
function createInverter(setter, toIteratee) {
return function(object, iteratee) {
return baseInverter(object, setter, toIteratee(iteratee), {});
};
}
export default createInverter;
@@ -0,0 +1,5 @@
import { Colors } from "./types"
declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors }
export = picocolors
@@ -0,0 +1 @@
{"version":3,"sources":["tag.js"],"names":["Object","defineProperty","exports","value","tagTokenizer","spec","tokens","source","match","description","problems","push","code","message","line","number","critical","tag","postTag","slice","length","default"],"mappings":"AAAA;;AACAA,MAAM,CAACC,cAAP,CAAsBC,OAAtB,EAA+B,YAA/B,EAA6C;AAAEC,EAAAA,KAAK,EAAE;AAAT,CAA7C;AACA;AACA;AACA;AACA;;AACA,SAASC,YAAT,GAAwB;AACpB,SAAQC,IAAD,IAAU;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAaD,IAAI,CAACE,MAAL,CAAY,CAAZ,CAAnB;AACA,UAAMC,KAAK,GAAGF,MAAM,CAACG,WAAP,CAAmBD,KAAnB,CAAyB,kBAAzB,CAAd;;AACA,QAAIA,KAAK,KAAK,IAAd,EAAoB;AAChBH,MAAAA,IAAI,CAACK,QAAL,CAAcC,IAAd,CAAmB;AACfC,QAAAA,IAAI,EAAE,iBADS;AAEfC,QAAAA,OAAO,EAAE,kCAFM;AAGfC,QAAAA,IAAI,EAAET,IAAI,CAACE,MAAL,CAAY,CAAZ,EAAeQ,MAHN;AAIfC,QAAAA,QAAQ,EAAE;AAJK,OAAnB;AAMA,aAAOX,IAAP;AACH;;AACDC,IAAAA,MAAM,CAACW,GAAP,GAAaT,KAAK,CAAC,CAAD,CAAlB;AACAF,IAAAA,MAAM,CAACY,OAAP,GAAiBV,KAAK,CAAC,CAAD,CAAtB;AACAF,IAAAA,MAAM,CAACG,WAAP,GAAqBH,MAAM,CAACG,WAAP,CAAmBU,KAAnB,CAAyBX,KAAK,CAAC,CAAD,CAAL,CAASY,MAAlC,CAArB;AACAf,IAAAA,IAAI,CAACY,GAAL,GAAWT,KAAK,CAAC,CAAD,CAAhB;AACA,WAAOH,IAAP;AACH,GAjBD;AAkBH;;AACDH,OAAO,CAACmB,OAAR,GAAkBjB,YAAlB","sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Splits the `@prefix` from remaining `Spec.lines[].token.description` into the `tag` token,\n * and populates `spec.tag`\n */\nfunction tagTokenizer() {\n return (spec) => {\n const { tokens } = spec.source[0];\n const match = tokens.description.match(/\\s*(@(\\S+))(\\s*)/);\n if (match === null) {\n spec.problems.push({\n code: 'spec:tag:prefix',\n message: 'tag should start with \"@\" symbol',\n line: spec.source[0].number,\n critical: true,\n });\n return spec;\n }\n tokens.tag = match[1];\n tokens.postTag = match[3];\n tokens.description = tokens.description.slice(match[0].length);\n spec.tag = match[2];\n return spec;\n };\n}\nexports.default = tagTokenizer;\n"],"file":"tag.cjs"}
@@ -0,0 +1,15 @@
module.exports = {
"deselectedItem": (args)=>`Nie zaznaczono ${args.item}.`,
"longPressToSelect": `Naci\u{15B}nij i przytrzymaj, aby wej\u{15B}\u{107} do trybu wyboru.`,
"select": `Zaznacz`,
"selectedAll": `Wszystkie zaznaczone elementy.`,
"selectedCount": (args, formatter)=>`${formatter.plural(args.count, {
"=0": `Nie zaznaczono \u{17C}adnych element\xf3w`,
one: ()=>`${formatter.number(args.count)} zaznaczony element`,
other: ()=>`${formatter.number(args.count)} zaznaczonych element\xf3w`
})}.`,
"selectedItem": (args)=>`Zaznaczono ${args.item}.`
};
//# sourceMappingURL=pl-PL.main.js.map
@@ -0,0 +1 @@
{"name":"react-hook-form","version":"7.66.0","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532112248,"integrity":"sha512-idA6Hy9mFVJ68GOPpdiGMhUkVPLgy9liYcZl4UkvadNJ6EeNd86JnGBZUokZGXTEaeNJZWrsJ8bqKJ0uP3RjlA==","mode":420,"size":1080},"dist/index.cjs.js":{"checkedAt":1794532112248,"integrity":"sha512-QYVC/zoxsbKGjzaQZgm3O3o8ksxxl0oYhb0gGBOThlGEwhoG04V1rlXb/4DEDXRazgHCeXXK/CZlApHEitaljg==","mode":420,"size":31552},"dist/index.umd.js":{"checkedAt":1794532112248,"integrity":"sha512-CbmkGtVJ47J52tLOTkl6tWD0VpQaEcoZJNv8S5vTPUFm1ydpBojOhRAnXdwEu8abw7M3Mbx9yIXM2v8Sg+oAUg==","mode":420,"size":31717},"package.json":{"checkedAt":1794532112249,"integrity":"sha512-zKUfY4picWz3D1bhSwY5TCr4IJLkzSvZVUF+CEB3mva9v85jSzpsTP8SIYVmNhj5twgYJP7Mrs1f7Zx8sZXDkg==","mode":420,"size":4385},"dist/utils/append.d.ts.map":{"checkedAt":1794532112249,"integrity":"sha512-816iPDOdpUcMyo3EWZSgAmwr5fikzMDpFte+j3IYMpPoNz7cyFUHB4SLA55qDWh+Uf7Rsp/EdX6BUV4izDPQZw==","mode":420,"size":203},"dist/logic/appendErrors.d.ts.map":{"checkedAt":1794532112249,"integrity":"sha512-XKFQ0VCVlLZdhqF7e+0HTVu1Sdc+iD6CkYQGbB301jN8aSi7PPCwhLwYQDyvNpw88yD/+hc7FKA+UIZWQ//45A==","mode":420,"size":295},"dist/utils/cloneObject.d.ts.map":{"checkedAt":1794532112249,"integrity":"sha512-2V7pcAyQUUg5xYvTj1STirp2hpmzkuxY0Sz7n5zan8OV+tkJecUspCBkrRYVWYqc1/h4IBcokD3siPAPcE4g3Q==","mode":420,"size":201},"dist/types/path/common.d.ts.map":{"checkedAt":1794532112249,"integrity":"sha512-5mFQSvClvpF38OnmukgVdaQE+9g9OdEIwAgiARhYCTVz9Y8VMCo7qsjpkjkSll6XeJJhaiE2cx/R/soWFtdmDA==","mode":420,"size":5207},"dist/utils/compact.d.ts.map":{"checkedAt":1794532112249,"integrity":"sha512-0ygaTnp0c21mrKdvfUNvgqsjPM8xe4rMK9ybN3t0YOQt4Q8nTC6ciM3QzkEigeNO+z91YbKq2QORl8nksA/Obg==","mode":420,"size":161},"dist/constants.d.ts.map":{"checkedAt":1794532112250,"integrity":"sha512-JrnOawM1b1bEcKoZW4Er2MXjUILeaeVTjycMtnNl1fEw8/rK4WBSM9wLlM5ZI+OxNxSGbADXrji3m4GivFJjhA==","mode":420,"size":220},"dist/controller.d.ts.map":{"checkedAt":1794532112250,"integrity":"sha512-u75KuJTkmAY+thx+TyNrkKoRrGNhI6e26pSaIIN5plPMASCL4GwoynKGUWvMIqd0iLu0DdJkdlLfnnOkxZn1SQ==","mode":420,"size":460},"dist/types/controller.d.ts.map":{"checkedAt":1794532112250,"integrity":"sha512-LtDZP6jvmpAbohnpTQGeIj+BUAnkaHKFuXejPIDUQobQHHTixcfaLSGsMpiJswV/0Ylj6Ro5syqV2Tg6NgoEVg==","mode":420,"size":2021},"dist/utils/convertToArrayPayload.d.ts.map":{"checkedAt":1794532112250,"integrity":"sha512-91dt3BbZCeOwT6fQ8WaaB8OFMz09q9mtSn/AuzQih3NsBdOt4NArTnxd9mDvOX5mxhseYYhgxzz5XZyu4K4wEw==","mode":420,"size":184},"dist/logic/createFormControl.d.ts.map":{"checkedAt":1794532112250,"integrity":"sha512-zVdlsN3frVsBtdrFhR0zU+4uD21VVxgD9Rnrhn2Ym7k0TvxUZ5jSDi3TXDCB3YIHnHMyqPFwOMDssc6LY0Gi8g==","mode":420,"size":534},"dist/utils/createSubject.d.ts.map":{"checkedAt":1794532112250,"integrity":"sha512-2Yj+R/w/zCSWENxVjx73Y/CWuQE4G75gUMnKSON2xTQ3n5BeMhb+5/SmRISa3UiHJhFkLxgDXHhJieAe7/0JqA==","mode":420,"size":601},"dist/utils/deepEqual.d.ts.map":{"checkedAt":1794532112250,"integrity":"sha512-R1FH+qAnSH9DrKdksJt8smi/EY2MRORUHpuF8+x0pBg7hh5mIVYl/JBoY/RN/WCI/efzLjd5FOo7ctTU2MnejA==","mode":420,"size":217},"dist/utils/deepMerge.d.ts.map":{"checkedAt":1794532112251,"integrity":"sha512-Bc4FjwzyP/TxRIQ0Koue/xhF2vxNyDv2yi68XBeocQwekhSyzO+axa2JDCf/5pR4TTNS0Cj8OyOwUJPLpQyuKA==","mode":420,"size":320},"dist/types/path/eager.d.ts.map":{"checkedAt":1794532112251,"integrity":"sha512-oadzMveBsLOlOPj3TKir5mkh6uf+UD1LGleSwdDU7kNoIuhAKB2opkA15E7MLBz0s5BvnjaPQcAS1FvBnc0KKw==","mode":420,"size":4397},"dist/types/errors.d.ts.map":{"checkedAt":1794532112251,"integrity":"sha512-8byE9HeyL1qn1KmSPuTRney8czHlAyOb4iiIQbUMDRov2RZ1QJlJrfSSlBFUaxRUzOhSBC6TXOhLbHNYATVnww==","mode":420,"size":1795},"dist/types/events.d.ts.map":{"checkedAt":1794532112251,"integrity":"sha512-S1tBGx6a15InZnJpM58SENsJmzaLFSNJNjrnRWtuRKwYybP+reXo1nEL+1BMZDXK+HPDmZFW7yJezym8wQzYDQ==","mode":420,"size":395},"dist/utils/extractFormValues.d.ts.map":{"checkedAt":1794532112251,"integrity":"sha512-T05UYXzaznuTVjg0RRCzmQi6+cyxV/OydtfyzyfL35/lyhpm+aytwnYv0hHECA/9XZlRKkPrNKjKysJ/i0ML6w==","mode":420,"size":284},"dist/types/fieldArray.d.ts.map":{"checkedAt":1794532112251,"integrity":"sha512-8YXLJJPG5c3byVzLK319R5SMlUOTQhc50AjBntsKXYdizHxmYdOxgxnn/j4T/QcHvBef87Ar/3EkYSPI1GLREw==","mode":420,"size":3740},"dist/types/fields.d.ts.map":{"checkedAt":1794532112251,"integrity":"sha512-H1pwoNSFbqLdPTQEQwcXziBN3KPRX6wAifyDw+L9OElSUwtBwhkY/rNZ9COFA9TJ412ligXmmaByYB7TIAo7Vg==","mode":420,"size":1419},"dist/utils/fillEmptyArray.d.ts.map":{"checkedAt":1794532112251,"integrity":"sha512-93Cg14JFeQvFSBn+AaD/cgu3i4SzatrArB9lADzQOPWQ4zGwg9NygUSVlGeBlixbmUqh0fFnfc/+CZLvxF/y1w==","mode":420,"size":210},"dist/utils/flatten.d.ts.map":{"checkedAt":1794532112251,"integrity":"sha512-ArMioAmjgrcP/bBAX2YMMD9pAjtnr/B+884JEzyQ8SGR8qcfutPiMoicrz6AcBQMORwV3sk3oAblxOtAeoGuJQ==","mode":420,"size":210},"dist/form.d.ts.map":{"checkedAt":1794532112252,"integrity":"sha512-gMTkNBosCEJufvNaoI/k77zHUaXLc7biC5eCcVaZppdz+BanDEWnjs+VaTbJ/jHfaA/8j99aSkJPNWuh/Hl7KgLine truncated
@@ -0,0 +1,62 @@
var $e1dbec26039c051d$exports = require("./Pressable.main.js");
var $3596bae48579386f$exports = require("./PressResponder.main.js");
var $5cb73d0ce355b0dc$exports = require("./useFocus.main.js");
var $e77252a287ef94ab$exports = require("./useFocusVisible.main.js");
var $d16842bbd0359d1b$exports = require("./useFocusWithin.main.js");
var $ffbc150311c75f01$exports = require("./useHover.main.js");
var $edcfa848c42f94f4$exports = require("./useInteractOutside.main.js");
var $892d64db2a3c53b0$exports = require("./useKeyboard.main.js");
var $c09386fc48fa427d$exports = require("./useMove.main.js");
var $0294ea432cd92340$exports = require("./usePress.main.js");
var $a3dbce0aed7087e2$exports = require("./useScrollWheel.main.js");
var $3cd7b5d0eebf0ca9$exports = require("./useLongPress.main.js");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "Pressable", () => $e1dbec26039c051d$exports.Pressable);
$parcel$export(module.exports, "PressResponder", () => $3596bae48579386f$exports.PressResponder);
$parcel$export(module.exports, "ClearPressResponder", () => $3596bae48579386f$exports.ClearPressResponder);
$parcel$export(module.exports, "useFocus", () => $5cb73d0ce355b0dc$exports.useFocus);
$parcel$export(module.exports, "isFocusVisible", () => $e77252a287ef94ab$exports.isFocusVisible);
$parcel$export(module.exports, "getInteractionModality", () => $e77252a287ef94ab$exports.getInteractionModality);
$parcel$export(module.exports, "setInteractionModality", () => $e77252a287ef94ab$exports.setInteractionModality);
$parcel$export(module.exports, "addWindowFocusTracking", () => $e77252a287ef94ab$exports.addWindowFocusTracking);
$parcel$export(module.exports, "useInteractionModality", () => $e77252a287ef94ab$exports.useInteractionModality);
$parcel$export(module.exports, "useFocusVisible", () => $e77252a287ef94ab$exports.useFocusVisible);
$parcel$export(module.exports, "useFocusVisibleListener", () => $e77252a287ef94ab$exports.useFocusVisibleListener);
$parcel$export(module.exports, "useFocusWithin", () => $d16842bbd0359d1b$exports.useFocusWithin);
$parcel$export(module.exports, "useHover", () => $ffbc150311c75f01$exports.useHover);
$parcel$export(module.exports, "useInteractOutside", () => $edcfa848c42f94f4$exports.useInteractOutside);
$parcel$export(module.exports, "useKeyboard", () => $892d64db2a3c53b0$exports.useKeyboard);
$parcel$export(module.exports, "useMove", () => $c09386fc48fa427d$exports.useMove);
$parcel$export(module.exports, "usePress", () => $0294ea432cd92340$exports.usePress);
$parcel$export(module.exports, "useScrollWheel", () => $a3dbce0aed7087e2$exports.useScrollWheel);
$parcel$export(module.exports, "useLongPress", () => $3cd7b5d0eebf0ca9$exports.useLongPress);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
//# sourceMappingURL=main.js.map
@@ -0,0 +1,13 @@
import { OB11BaseMetaEvent } from './OB11BaseMetaEvent';
import { NapCatCore } from '../../../napcat-core';
interface HeartbeatStatus {
online: boolean | undefined;
good: boolean;
}
export declare class OB11HeartbeatEvent extends OB11BaseMetaEvent {
meta_event_type: string;
status: HeartbeatStatus;
interval: number;
constructor(core: NapCatCore, interval: number, isOnline: boolean, isGood: boolean);
}
export {};
@@ -0,0 +1,39 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const {
definePrototypeMethodHandler,
} = require("../util/define-prototype-method-handler")
module.exports = {
meta: {
docs: {
description: "disallow the `Array.prototype.indexOf` method.",
category: "ES5",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-array-prototype-indexof.html",
},
fixable: null,
messages: {
forbidden: "ES5 '{{name}}' method is forbidden.",
},
schema: [
{
type: "object",
properties: {
aggressive: { type: "boolean" },
},
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
return definePrototypeMethodHandler(context, {
Array: ["indexOf"],
})
},
}
@@ -0,0 +1,64 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.isArrayMethodCallWithPredicate = isArrayMethodCallWithPredicate;
const type_utils_1 = require("@typescript-eslint/type-utils");
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const misc_1 = require("./misc");
const ARRAY_PREDICATE_FUNCTIONS = new Set([
'every',
'filter',
'find',
'findIndex',
'findLast',
'findLastIndex',
'some',
]);
function isArrayMethodCallWithPredicate(context, services, node) {
if (node.callee.type !== utils_1.AST_NODE_TYPES.MemberExpression) {
return false;
}
const staticAccessValue = (0, misc_1.getStaticMemberAccessValue)(node.callee, context);
if (!ARRAY_PREDICATE_FUNCTIONS.has(staticAccessValue)) {
return false;
}
const checker = services.program.getTypeChecker();
const type = (0, type_utils_1.getConstrainedTypeAtLocation)(services, node.callee.object);
return tsutils
.unionConstituents(type)
.flatMap(part => tsutils.intersectionConstituents(part))
.some(t => checker.isArrayType(t) || checker.isTupleType(t));
}
@@ -0,0 +1,18 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./constructor-parameters"), exports);
@@ -0,0 +1 @@
{"version":3,"file":"querying.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/domutils/0ab8bcf1ecfc70dfc93291a4cb2496578ac25e9c/src/","sources":["querying.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE9E;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAClB,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,EAChC,IAAI,EAAE,OAAO,GAAG,OAAO,EAAE,EACzB,OAAO,UAAO,EACd,KAAK,GAAE,MAAiB,GACzB,OAAO,EAAE,CAEX;AAED;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAChB,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,EAChC,KAAK,EAAE,OAAO,EAAE,GAAG,UAAU,EAC7B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,GACd,OAAO,EAAE,CAuCX;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC1B,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,EAC1B,KAAK,EAAE,CAAC,EAAE,GACX,CAAC,GAAG,SAAS,CAEf;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CACnB,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,EAChC,KAAK,EAAE,OAAO,EAAE,GAAG,UAAU,EAC7B,OAAO,UAAO,GACf,OAAO,GAAG,IAAI,CAchB;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACrB,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,EAChC,KAAK,EAAE,OAAO,EAAE,GAAG,UAAU,GAC9B,OAAO,CAMT;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CACnB,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,EAChC,KAAK,EAAE,OAAO,EAAE,GAAG,UAAU,GAC9B,OAAO,EAAE,CA4BX"}
@@ -0,0 +1,320 @@
import { describe, it, expect, vitest } from "vitest";
import * as entities from "./decode.js";
describe("Decode test", () => {
const testcases = [
{ input: "&amp;amp;", output: "&amp;" },
{ input: "&amp;#38;", output: "&#38;" },
{ input: "&amp;#x26;", output: "&#x26;" },
{ input: "&amp;#X26;", output: "&#X26;" },
{ input: "&#38;#38;", output: "&#38;" },
{ input: "&#x26;#38;", output: "&#38;" },
{ input: "&#X26;#38;", output: "&#38;" },
{ input: "&#x3a;", output: ":" },
{ input: "&#x3A;", output: ":" },
{ input: "&#X3a;", output: ":" },
{ input: "&#X3A;", output: ":" },
{ input: "&#", output: "&#" },
{ input: "&>", output: "&>" },
{ input: "id=770&#anchor", output: "id=770&#anchor" },
];
for (const { input, output } of testcases) {
it(`should XML decode ${input}`, () =>
expect(entities.decodeXML(input)).toBe(output));
it(`should HTML decode ${input}`, () =>
expect(entities.decodeHTML(input)).toBe(output));
}
it("should HTML decode partial legacy entity", () => {
expect(entities.decodeHTMLStrict("&timesbar")).toBe("&timesbar");
expect(entities.decodeHTML("&timesbar")).toBe("×bar");
});
it("should HTML decode legacy entities according to spec", () =>
expect(entities.decodeHTML("?&image_uri=1&ℑ=2&image=3")).toBe(
"?&image_uri=1&ℑ=2&image=3",
));
it("should back out of legacy entities", () =>
expect(entities.decodeHTML("&ampa")).toBe("&a"));
it("should not parse numeric entities in strict mode", () =>
expect(entities.decodeHTMLStrict("&#55")).toBe("&#55"));
it("should parse &nbsp followed by < (#852)", () =>
expect(entities.decodeHTML("&nbsp<")).toBe("\u00A0<"));
it("should decode trailing legacy entities", () => {
expect(entities.decodeHTML("&timesbar;&timesbar")).toBe("⨱×bar");
});
it("should decode multi-byte entities", () => {
expect(entities.decodeHTML("&NotGreaterFullEqual;")).toBe("≧̸");
});
it("should not decode legacy entities followed by text in attribute mode", () => {
expect(
entities.decodeHTML("&not", entities.DecodingMode.Attribute),
).toBe("¬");
expect(
entities.decodeHTML("&noti", entities.DecodingMode.Attribute),
).toBe("&noti");
expect(
entities.decodeHTML("&not=", entities.DecodingMode.Attribute),
).toBe("&not=");
expect(entities.decodeHTMLAttribute("&notp")).toBe("&notp");
expect(entities.decodeHTMLAttribute("&notP")).toBe("&notP");
expect(entities.decodeHTMLAttribute("&not3")).toBe("&not3");
});
});
describe("EntityDecoder", () => {
it("should decode decimal entities", () => {
const callback = vitest.fn();
const decoder = new entities.EntityDecoder(
entities.htmlDecodeTree,
callback,
);
expect(decoder.write("&#5", 1)).toBe(-1);
expect(decoder.write("8;", 0)).toBe(5);
expect(callback).toHaveBeenCalledTimes(1);
expect(callback).toHaveBeenCalledWith(":".charCodeAt(0), 5);
});
it("should decode hex entities", () => {
const callback = vitest.fn();
const decoder = new entities.EntityDecoder(
entities.htmlDecodeTree,
callback,
);
expect(decoder.write("&#x3a;", 1)).toBe(6);
expect(callback).toHaveBeenCalledTimes(1);
expect(callback).toHaveBeenCalledWith(":".charCodeAt(0), 6);
});
it("should decode named entities", () => {
const callback = vitest.fn();
const decoder = new entities.EntityDecoder(
entities.htmlDecodeTree,
callback,
);
expect(decoder.write("&amp;", 1)).toBe(5);
expect(callback).toHaveBeenCalledTimes(1);
expect(callback).toHaveBeenCalledWith("&".charCodeAt(0), 5);
});
it("should decode legacy entities", () => {
const callback = vitest.fn();
const decoder = new entities.EntityDecoder(
entities.htmlDecodeTree,
callback,
);
decoder.startEntity(entities.DecodingMode.Legacy);
expect(decoder.write("&amp", 1)).toBe(-1);
expect(callback).toHaveBeenCalledTimes(0);
expect(decoder.end()).toBe(4);
expect(callback).toHaveBeenCalledTimes(1);
expect(callback).toHaveBeenCalledWith("&".charCodeAt(0), 4);
});
it("should decode named entity written character by character", () => {
const callback = vitest.fn();
const decoder = new entities.EntityDecoder(
entities.htmlDecodeTree,
callback,
);
for (const c of "amp") {
expect(decoder.write(c, 0)).toBe(-1);
}
expect(decoder.write(";", 0)).toBe(5);
expect(callback).toHaveBeenCalledTimes(1);
expect(callback).toHaveBeenCalledWith("&".charCodeAt(0), 5);
});
it("should decode numeric entity written character by character", () => {
const callback = vitest.fn();
const decoder = new entities.EntityDecoder(
entities.htmlDecodeTree,
callback,
);
for (const c of "#x3a") {
expect(decoder.write(c, 0)).toBe(-1);
}
expect(decoder.write(";", 0)).toBe(6);
expect(callback).toHaveBeenCalledTimes(1);
expect(callback).toHaveBeenCalledWith(":".charCodeAt(0), 6);
});
it("should decode hex entities across several chunks", () => {
const callback = vitest.fn();
const decoder = new entities.EntityDecoder(
entities.htmlDecodeTree,
callback,
);
for (const chunk of ["#x", "cf", "ff", "d"]) {
expect(decoder.write(chunk, 0)).toBe(-1);
}
expect(decoder.write(";", 0)).toBe(9);
expect(callback).toHaveBeenCalledTimes(1);
expect(callback).toHaveBeenCalledWith(0xc_ff_fd, 9);
});
it("should not fail if nothing is written", () => {
const callback = vitest.fn();
const decoder = new entities.EntityDecoder(
entities.htmlDecodeTree,
callback,
);
expect(decoder.end()).toBe(0);
expect(callback).toHaveBeenCalledTimes(0);
});
describe("errors", () => {
it("should produce an error for a named entity without a semicolon", () => {
const errorHandlers = {
missingSemicolonAfterCharacterReference: vitest.fn(),
absenceOfDigitsInNumericCharacterReference: vitest.fn(),
validateNumericCharacterReference: vitest.fn(),
};
const callback = vitest.fn();
const decoder = new entities.EntityDecoder(
entities.htmlDecodeTree,
callback,
errorHandlers,
);
decoder.startEntity(entities.DecodingMode.Legacy);
expect(decoder.write("&amp;", 1)).toBe(5);
expect(callback).toHaveBeenCalledTimes(1);
expect(callback).toHaveBeenCalledWith("&".charCodeAt(0), 5);
expect(
errorHandlers.missingSemicolonAfterCharacterReference,
).toHaveBeenCalledTimes(0);
decoder.startEntity(entities.DecodingMode.Legacy);
expect(decoder.write("&amp", 1)).toBe(-1);
expect(decoder.end()).toBe(4);
expect(callback).toHaveBeenCalledTimes(2);
expect(callback).toHaveBeenLastCalledWith("&".charCodeAt(0), 4);
expect(
errorHandlers.missingSemicolonAfterCharacterReference,
).toHaveBeenCalledTimes(1);
});
it("should produce an error for a numeric entity without a semicolon", () => {
const errorHandlers = {
missingSemicolonAfterCharacterReference: vitest.fn(),
absenceOfDigitsInNumericCharacterReference: vitest.fn(),
validateNumericCharacterReference: vitest.fn(),
};
const callback = vitest.fn();
const decoder = new entities.EntityDecoder(
entities.htmlDecodeTree,
callback,
errorHandlers,
);
decoder.startEntity(entities.DecodingMode.Legacy);
expect(decoder.write("&#x3a", 1)).toBe(-1);
expect(decoder.end()).toBe(5);
expect(callback).toHaveBeenCalledTimes(1);
expect(callback).toHaveBeenCalledWith(0x3a, 5);
expect(
errorHandlers.missingSemicolonAfterCharacterReference,
).toHaveBeenCalledTimes(1);
expect(
errorHandlers.absenceOfDigitsInNumericCharacterReference,
).toHaveBeenCalledTimes(0);
expect(
errorHandlers.validateNumericCharacterReference,
).toHaveBeenCalledTimes(1);
expect(
errorHandlers.validateNumericCharacterReference,
).toHaveBeenCalledWith(0x3a);
});
it("should produce an error for numeric entities without digits", () => {
const errorHandlers = {
missingSemicolonAfterCharacterReference: vitest.fn(),
absenceOfDigitsInNumericCharacterReference: vitest.fn(),
validateNumericCharacterReference: vitest.fn(),
};
const callback = vitest.fn();
const decoder = new entities.EntityDecoder(
entities.htmlDecodeTree,
callback,
errorHandlers,
);
decoder.startEntity(entities.DecodingMode.Legacy);
expect(decoder.write("&#", 1)).toBe(-1);
expect(decoder.end()).toBe(0);
expect(callback).toHaveBeenCalledTimes(0);
expect(
errorHandlers.missingSemicolonAfterCharacterReference,
).toHaveBeenCalledTimes(0);
expect(
errorHandlers.absenceOfDigitsInNumericCharacterReference,
).toHaveBeenCalledTimes(1);
expect(
errorHandlers.absenceOfDigitsInNumericCharacterReference,
).toHaveBeenCalledWith(2);
expect(
errorHandlers.validateNumericCharacterReference,
).toHaveBeenCalledTimes(0);
});
it("should produce an error for hex entities without digits", () => {
const errorHandlers = {
missingSemicolonAfterCharacterReference: vitest.fn(),
absenceOfDigitsInNumericCharacterReference: vitest.fn(),
validateNumericCharacterReference: vitest.fn(),
};
const callback = vitest.fn();
const decoder = new entities.EntityDecoder(
entities.htmlDecodeTree,
callback,
errorHandlers,
);
decoder.startEntity(entities.DecodingMode.Legacy);
expect(decoder.write("&#x", 1)).toBe(-1);
expect(decoder.end()).toBe(0);
expect(callback).toHaveBeenCalledTimes(0);
expect(
errorHandlers.missingSemicolonAfterCharacterReference,
).toHaveBeenCalledTimes(0);
expect(
errorHandlers.absenceOfDigitsInNumericCharacterReference,
).toHaveBeenCalledTimes(1);
expect(
errorHandlers.validateNumericCharacterReference,
).toHaveBeenCalledTimes(0);
});
});
});
@@ -0,0 +1,33 @@
var baseDifference = require('./_baseDifference'),
baseFlatten = require('./_baseFlatten'),
baseRest = require('./_baseRest'),
isArrayLikeObject = require('./isArrayLikeObject');
/**
* Creates an array of `array` values not included in the other given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. The order and references of result values are
* determined by the first array.
*
* **Note:** Unlike `_.pullAll`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.without, _.xor
* @example
*
* _.difference([2, 1], [2, 3]);
* // => [1]
*/
var difference = baseRest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
: [];
});
module.exports = difference;
@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Apple_WebAuthn_Root_CA = void 0;
/**
* Apple WebAuthn Root CA
*
* Downloaded from https://www.apple.com/certificateauthority/Apple_WebAuthn_Root_CA.pem
*
* Valid until 2045-03-14 @ 17:00 PST
*
* SHA256 Fingerprint
* 09:15:DD:5C:07:A2:8D:B5:49:D1:F6:77:BB:5A:75:D4:BF:BE:95:61:A7:73:42:43:27:76:2E:9E:02:F9:BB:29
*/
exports.Apple_WebAuthn_Root_CA = `-----BEGIN CERTIFICATE-----
MIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8w
HQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJ
bmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMx
NTAwMDAwMFowSzEfMB0GA1UEAwwWQXBwbGUgV2ViQXV0aG4gUm9vdCBDQTETMBEG
A1UECgwKQXBwbGUgSW5jLjETMBEGA1UECAwKQ2FsaWZvcm5pYTB2MBAGByqGSM49
AgEGBSuBBAAiA2IABCJCQ2pTVhzjl4Wo6IhHtMSAzO2cv+H9DQKev3//fG59G11k
xu9eI0/7o6V5uShBpe1u6l6mS19S1FEh6yGljnZAJ+2GNP1mi/YK2kSXIuTHjxA/
pcoRf7XkOtO4o1qlcaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJtdk
2cV4wlpn0afeaxLQG2PxxtcwDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2cA
MGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3
jAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5RCmGQ21gpSAk9QZW4B
1bWeT0vT
-----END CERTIFICATE-----
`;
@@ -0,0 +1,919 @@
// @flow
import memoizeOne from 'memoize-one';
import { createElement, PureComponent } from 'react';
import { cancelTimeout, requestTimeout } from './timer';
import { getScrollbarSize, getRTLOffsetType } from './domHelpers';
import type { TimeoutID } from './timer';
type Direction = 'ltr' | 'rtl';
export type ScrollToAlign = 'auto' | 'smart' | 'center' | 'start' | 'end';
type itemSize = number | ((index: number) => number);
type RenderComponentProps<T> = {|
columnIndex: number,
data: T,
isScrolling?: boolean,
rowIndex: number,
style: Object,
|};
export type RenderComponent<T> = React$ComponentType<
$Shape<RenderComponentProps<T>>
>;
type ScrollDirection = 'forward' | 'backward';
type OnItemsRenderedCallback = ({
overscanColumnStartIndex: number,
overscanColumnStopIndex: number,
overscanRowStartIndex: number,
overscanRowStopIndex: number,
visibleColumnStartIndex: number,
visibleColumnStopIndex: number,
visibleRowStartIndex: number,
visibleRowStopIndex: number,
}) => void;
type OnScrollCallback = ({
horizontalScrollDirection: ScrollDirection,
scrollLeft: number,
scrollTop: number,
scrollUpdateWasRequested: boolean,
verticalScrollDirection: ScrollDirection,
}) => void;
type ScrollEvent = SyntheticEvent<HTMLDivElement>;
type ItemStyleCache = { [key: string]: Object };
type OuterProps = {|
children: React$Node,
className: string | void,
onScroll: ScrollEvent => void,
style: {
[string]: mixed,
},
|};
type InnerProps = {|
children: React$Node,
style: {
[string]: mixed,
},
|};
export type Props<T> = {|
children: RenderComponent<T>,
className?: string,
columnCount: number,
columnWidth: itemSize,
direction: Direction,
height: number,
initialScrollLeft?: number,
initialScrollTop?: number,
innerRef?: any,
innerElementType?: string | React$AbstractComponent<InnerProps, any>,
innerTagName?: string, // deprecated
itemData: T,
itemKey?: (params: {|
columnIndex: number,
data: T,
rowIndex: number,
|}) => any,
onItemsRendered?: OnItemsRenderedCallback,
onScroll?: OnScrollCallback,
outerRef?: any,
outerElementType?: string | React$AbstractComponent<OuterProps, any>,
outerTagName?: string, // deprecated
overscanColumnCount?: number,
overscanColumnsCount?: number, // deprecated
overscanCount?: number, // deprecated
overscanRowCount?: number,
overscanRowsCount?: number, // deprecated
rowCount: number,
rowHeight: itemSize,
style?: Object,
useIsScrolling: boolean,
width: number,
|};
type State = {|
instance: any,
isScrolling: boolean,
horizontalScrollDirection: ScrollDirection,
scrollLeft: number,
scrollTop: number,
scrollUpdateWasRequested: boolean,
verticalScrollDirection: ScrollDirection,
|};
type getItemOffset = (
props: Props<any>,
index: number,
instanceProps: any
) => number;
type getItemSize = (
props: Props<any>,
index: number,
instanceProps: any
) => number;
type getEstimatedTotalSize = (props: Props<any>, instanceProps: any) => number;
type GetOffsetForItemAndAlignment = (
props: Props<any>,
index: number,
align: ScrollToAlign,
scrollOffset: number,
instanceProps: any,
scrollbarSize: number
) => number;
type GetStartIndexForOffset = (
props: Props<any>,
offset: number,
instanceProps: any
) => number;
type GetStopIndexForStartIndex = (
props: Props<any>,
startIndex: number,
scrollOffset: number,
instanceProps: any
) => number;
type InitInstanceProps = (props: Props<any>, instance: any) => any;
type ValidateProps = (props: Props<any>) => void;
const IS_SCROLLING_DEBOUNCE_INTERVAL = 150;
const defaultItemKey = ({ columnIndex, data, rowIndex }) =>
`${rowIndex}:${columnIndex}`;
// In DEV mode, this Set helps us only log a warning once per component instance.
// This avoids spamming the console every time a render happens.
let devWarningsOverscanCount = null;
let devWarningsOverscanRowsColumnsCount = null;
let devWarningsTagName = null;
if (process.env.NODE_ENV !== 'production') {
if (typeof window !== 'undefined' && typeof window.WeakSet !== 'undefined') {
devWarningsOverscanCount = new WeakSet();
devWarningsOverscanRowsColumnsCount = new WeakSet();
devWarningsTagName = new WeakSet();
}
}
export default function createGridComponent({
getColumnOffset,
getColumnStartIndexForOffset,
getColumnStopIndexForStartIndex,
getColumnWidth,
getEstimatedTotalHeight,
getEstimatedTotalWidth,
getOffsetForColumnAndAlignment,
getOffsetForRowAndAlignment,
getRowHeight,
getRowOffset,
getRowStartIndexForOffset,
getRowStopIndexForStartIndex,
initInstanceProps,
shouldResetStyleCacheOnItemSizeChange,
validateProps,
}: {|
getColumnOffset: getItemOffset,
getColumnStartIndexForOffset: GetStartIndexForOffset,
getColumnStopIndexForStartIndex: GetStopIndexForStartIndex,
getColumnWidth: getItemSize,
getEstimatedTotalHeight: getEstimatedTotalSize,
getEstimatedTotalWidth: getEstimatedTotalSize,
getOffsetForColumnAndAlignment: GetOffsetForItemAndAlignment,
getOffsetForRowAndAlignment: GetOffsetForItemAndAlignment,
getRowOffset: getItemOffset,
getRowHeight: getItemSize,
getRowStartIndexForOffset: GetStartIndexForOffset,
getRowStopIndexForStartIndex: GetStopIndexForStartIndex,
initInstanceProps: InitInstanceProps,
shouldResetStyleCacheOnItemSizeChange: boolean,
validateProps: ValidateProps,
|}) {
return class Grid<T> extends PureComponent<Props<T>, State> {
_instanceProps: any = initInstanceProps(this.props, this);
_resetIsScrollingTimeoutId: TimeoutID | null = null;
_outerRef: ?HTMLDivElement;
static defaultProps = {
direction: 'ltr',
itemData: undefined,
useIsScrolling: false,
};
state: State = {
instance: this,
isScrolling: false,
horizontalScrollDirection: 'forward',
scrollLeft:
typeof this.props.initialScrollLeft === 'number'
? this.props.initialScrollLeft
: 0,
scrollTop:
typeof this.props.initialScrollTop === 'number'
? this.props.initialScrollTop
: 0,
scrollUpdateWasRequested: false,
verticalScrollDirection: 'forward',
};
// Always use explicit constructor for React components.
// It produces less code after transpilation. (#26)
// eslint-disable-next-line no-useless-constructor
constructor(props: Props<T>) {
super(props);
}
static getDerivedStateFromProps(
nextProps: Props<T>,
prevState: State
): $Shape<State> | null {
validateSharedProps(nextProps, prevState);
validateProps(nextProps);
return null;
}
scrollTo({
scrollLeft,
scrollTop,
}: {
scrollLeft: number,
scrollTop: number,
}): void {
if (scrollLeft !== undefined) {
scrollLeft = Math.max(0, scrollLeft);
}
if (scrollTop !== undefined) {
scrollTop = Math.max(0, scrollTop);
}
this.setState(prevState => {
if (scrollLeft === undefined) {
scrollLeft = prevState.scrollLeft;
}
if (scrollTop === undefined) {
scrollTop = prevState.scrollTop;
}
if (
prevState.scrollLeft === scrollLeft &&
prevState.scrollTop === scrollTop
) {
return null;
}
return {
horizontalScrollDirection:
prevState.scrollLeft < scrollLeft ? 'forward' : 'backward',
scrollLeft: scrollLeft,
scrollTop: scrollTop,
scrollUpdateWasRequested: true,
verticalScrollDirection:
prevState.scrollTop < scrollTop ? 'forward' : 'backward',
};
}, this._resetIsScrollingDebounced);
}
scrollToItem({
align = 'auto',
columnIndex,
rowIndex,
}: {
align: ScrollToAlign,
columnIndex?: number,
rowIndex?: number,
}): void {
const { columnCount, height, rowCount, width } = this.props;
const { scrollLeft, scrollTop } = this.state;
const scrollbarSize = getScrollbarSize();
if (columnIndex !== undefined) {
columnIndex = Math.max(0, Math.min(columnIndex, columnCount - 1));
}
if (rowIndex !== undefined) {
rowIndex = Math.max(0, Math.min(rowIndex, rowCount - 1));
}
const estimatedTotalHeight = getEstimatedTotalHeight(
this.props,
this._instanceProps
);
const estimatedTotalWidth = getEstimatedTotalWidth(
this.props,
this._instanceProps
);
// The scrollbar size should be considered when scrolling an item into view,
// to ensure it's fully visible.
// But we only need to account for its size when it's actually visible.
const horizontalScrollbarSize =
estimatedTotalWidth > width ? scrollbarSize : 0;
const verticalScrollbarSize =
estimatedTotalHeight > height ? scrollbarSize : 0;
this.scrollTo({
scrollLeft:
columnIndex !== undefined
? getOffsetForColumnAndAlignment(
this.props,
columnIndex,
align,
scrollLeft,
this._instanceProps,
verticalScrollbarSize
)
: scrollLeft,
scrollTop:
rowIndex !== undefined
? getOffsetForRowAndAlignment(
this.props,
rowIndex,
align,
scrollTop,
this._instanceProps,
horizontalScrollbarSize
)
: scrollTop,
});
}
componentDidMount() {
const { initialScrollLeft, initialScrollTop } = this.props;
if (this._outerRef != null) {
const outerRef = ((this._outerRef: any): HTMLElement);
if (typeof initialScrollLeft === 'number') {
outerRef.scrollLeft = initialScrollLeft;
}
if (typeof initialScrollTop === 'number') {
outerRef.scrollTop = initialScrollTop;
}
}
this._callPropsCallbacks();
}
componentDidUpdate() {
const { direction } = this.props;
const { scrollLeft, scrollTop, scrollUpdateWasRequested } = this.state;
if (scrollUpdateWasRequested && this._outerRef != null) {
// TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
// This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
// So we need to determine which browser behavior we're dealing with, and mimic it.
const outerRef = ((this._outerRef: any): HTMLElement);
if (direction === 'rtl') {
switch (getRTLOffsetType()) {
case 'negative':
outerRef.scrollLeft = -scrollLeft;
break;
case 'positive-ascending':
outerRef.scrollLeft = scrollLeft;
break;
default:
const { clientWidth, scrollWidth } = outerRef;
outerRef.scrollLeft = scrollWidth - clientWidth - scrollLeft;
break;
}
} else {
outerRef.scrollLeft = Math.max(0, scrollLeft);
}
outerRef.scrollTop = Math.max(0, scrollTop);
}
this._callPropsCallbacks();
}
componentWillUnmount() {
if (this._resetIsScrollingTimeoutId !== null) {
cancelTimeout(this._resetIsScrollingTimeoutId);
}
}
render() {
const {
children,
className,
columnCount,
direction,
height,
innerRef,
innerElementType,
innerTagName,
itemData,
itemKey = defaultItemKey,
outerElementType,
outerTagName,
rowCount,
style,
useIsScrolling,
width,
} = this.props;
const { isScrolling } = this.state;
const [
columnStartIndex,
columnStopIndex,
] = this._getHorizontalRangeToRender();
const [rowStartIndex, rowStopIndex] = this._getVerticalRangeToRender();
const items = [];
if (columnCount > 0 && rowCount) {
for (
let rowIndex = rowStartIndex;
rowIndex <= rowStopIndex;
rowIndex++
) {
for (
let columnIndex = columnStartIndex;
columnIndex <= columnStopIndex;
columnIndex++
) {
items.push(
createElement(children, {
columnIndex,
data: itemData,
isScrolling: useIsScrolling ? isScrolling : undefined,
key: itemKey({ columnIndex, data: itemData, rowIndex }),
rowIndex,
style: this._getItemStyle(rowIndex, columnIndex),
})
);
}
}
}
// Read this value AFTER items have been created,
// So their actual sizes (if variable) are taken into consideration.
const estimatedTotalHeight = getEstimatedTotalHeight(
this.props,
this._instanceProps
);
const estimatedTotalWidth = getEstimatedTotalWidth(
this.props,
this._instanceProps
);
return createElement(
outerElementType || outerTagName || 'div',
{
className,
onScroll: this._onScroll,
ref: this._outerRefSetter,
style: {
position: 'relative',
height,
width,
overflow: 'auto',
WebkitOverflowScrolling: 'touch',
willChange: 'transform',
direction,
...style,
},
},
createElement(innerElementType || innerTagName || 'div', {
children: items,
ref: innerRef,
style: {
height: estimatedTotalHeight,
pointerEvents: isScrolling ? 'none' : undefined,
width: estimatedTotalWidth,
},
})
);
}
_callOnItemsRendered: (
overscanColumnStartIndex: number,
overscanColumnStopIndex: number,
overscanRowStartIndex: number,
overscanRowStopIndex: number,
visibleColumnStartIndex: number,
visibleColumnStopIndex: number,
visibleRowStartIndex: number,
visibleRowStopIndex: number
) => void;
_callOnItemsRendered = memoizeOne(
(
overscanColumnStartIndex: number,
overscanColumnStopIndex: number,
overscanRowStartIndex: number,
overscanRowStopIndex: number,
visibleColumnStartIndex: number,
visibleColumnStopIndex: number,
visibleRowStartIndex: number,
visibleRowStopIndex: number
) =>
((this.props.onItemsRendered: any): OnItemsRenderedCallback)({
overscanColumnStartIndex,
overscanColumnStopIndex,
overscanRowStartIndex,
overscanRowStopIndex,
visibleColumnStartIndex,
visibleColumnStopIndex,
visibleRowStartIndex,
visibleRowStopIndex,
})
);
_callOnScroll: (
scrollLeft: number,
scrollTop: number,
horizontalScrollDirection: ScrollDirection,
verticalScrollDirection: ScrollDirection,
scrollUpdateWasRequested: boolean
) => void;
_callOnScroll = memoizeOne(
(
scrollLeft: number,
scrollTop: number,
horizontalScrollDirection: ScrollDirection,
verticalScrollDirection: ScrollDirection,
scrollUpdateWasRequested: boolean
) =>
((this.props.onScroll: any): OnScrollCallback)({
horizontalScrollDirection,
scrollLeft,
scrollTop,
verticalScrollDirection,
scrollUpdateWasRequested,
})
);
_callPropsCallbacks() {
const { columnCount, onItemsRendered, onScroll, rowCount } = this.props;
if (typeof onItemsRendered === 'function') {
if (columnCount > 0 && rowCount > 0) {
const [
overscanColumnStartIndex,
overscanColumnStopIndex,
visibleColumnStartIndex,
visibleColumnStopIndex,
] = this._getHorizontalRangeToRender();
const [
overscanRowStartIndex,
overscanRowStopIndex,
visibleRowStartIndex,
visibleRowStopIndex,
] = this._getVerticalRangeToRender();
this._callOnItemsRendered(
overscanColumnStartIndex,
overscanColumnStopIndex,
overscanRowStartIndex,
overscanRowStopIndex,
visibleColumnStartIndex,
visibleColumnStopIndex,
visibleRowStartIndex,
visibleRowStopIndex
);
}
}
if (typeof onScroll === 'function') {
const {
horizontalScrollDirection,
scrollLeft,
scrollTop,
scrollUpdateWasRequested,
verticalScrollDirection,
} = this.state;
this._callOnScroll(
scrollLeft,
scrollTop,
horizontalScrollDirection,
verticalScrollDirection,
scrollUpdateWasRequested
);
}
}
// Lazily create and cache item styles while scrolling,
// So that pure component sCU will prevent re-renders.
// We maintain this cache, and pass a style prop rather than index,
// So that List can clear cached styles and force item re-render if necessary.
_getItemStyle: (rowIndex: number, columnIndex: number) => Object;
_getItemStyle = (rowIndex: number, columnIndex: number): Object => {
const { columnWidth, direction, rowHeight } = this.props;
const itemStyleCache = this._getItemStyleCache(
shouldResetStyleCacheOnItemSizeChange && columnWidth,
shouldResetStyleCacheOnItemSizeChange && direction,
shouldResetStyleCacheOnItemSizeChange && rowHeight
);
const key = `${rowIndex}:${columnIndex}`;
let style;
if (itemStyleCache.hasOwnProperty(key)) {
style = itemStyleCache[key];
} else {
const offset = getColumnOffset(
this.props,
columnIndex,
this._instanceProps
);
const isRtl = direction === 'rtl';
itemStyleCache[key] = style = {
position: 'absolute',
left: isRtl ? undefined : offset,
right: isRtl ? offset : undefined,
top: getRowOffset(this.props, rowIndex, this._instanceProps),
height: getRowHeight(this.props, rowIndex, this._instanceProps),
width: getColumnWidth(this.props, columnIndex, this._instanceProps),
};
}
return style;
};
_getItemStyleCache: (_: any, __: any, ___: any) => ItemStyleCache;
_getItemStyleCache = memoizeOne((_: any, __: any, ___: any) => ({}));
_getHorizontalRangeToRender(): [number, number, number, number] {
const {
columnCount,
overscanColumnCount,
overscanColumnsCount,
overscanCount,
rowCount,
} = this.props;
const { horizontalScrollDirection, isScrolling, scrollLeft } = this.state;
const overscanCountResolved: number =
overscanColumnCount || overscanColumnsCount || overscanCount || 1;
if (columnCount === 0 || rowCount === 0) {
return [0, 0, 0, 0];
}
const startIndex = getColumnStartIndexForOffset(
this.props,
scrollLeft,
this._instanceProps
);
const stopIndex = getColumnStopIndexForStartIndex(
this.props,
startIndex,
scrollLeft,
this._instanceProps
);
// Overscan by one item in each direction so that tab/focus works.
// If there isn't at least one extra item, tab loops back around.
const overscanBackward =
!isScrolling || horizontalScrollDirection === 'backward'
? Math.max(1, overscanCountResolved)
: 1;
const overscanForward =
!isScrolling || horizontalScrollDirection === 'forward'
? Math.max(1, overscanCountResolved)
: 1;
return [
Math.max(0, startIndex - overscanBackward),
Math.max(0, Math.min(columnCount - 1, stopIndex + overscanForward)),
startIndex,
stopIndex,
];
}
_getVerticalRangeToRender(): [number, number, number, number] {
const {
columnCount,
overscanCount,
overscanRowCount,
overscanRowsCount,
rowCount,
} = this.props;
const { isScrolling, verticalScrollDirection, scrollTop } = this.state;
const overscanCountResolved: number =
overscanRowCount || overscanRowsCount || overscanCount || 1;
if (columnCount === 0 || rowCount === 0) {
return [0, 0, 0, 0];
}
const startIndex = getRowStartIndexForOffset(
this.props,
scrollTop,
this._instanceProps
);
const stopIndex = getRowStopIndexForStartIndex(
this.props,
startIndex,
scrollTop,
this._instanceProps
);
// Overscan by one item in each direction so that tab/focus works.
// If there isn't at least one extra item, tab loops back around.
const overscanBackward =
!isScrolling || verticalScrollDirection === 'backward'
? Math.max(1, overscanCountResolved)
: 1;
const overscanForward =
!isScrolling || verticalScrollDirection === 'forward'
? Math.max(1, overscanCountResolved)
: 1;
return [
Math.max(0, startIndex - overscanBackward),
Math.max(0, Math.min(rowCount - 1, stopIndex + overscanForward)),
startIndex,
stopIndex,
];
}
_onScroll = (event: ScrollEvent): void => {
const {
clientHeight,
clientWidth,
scrollLeft,
scrollTop,
scrollHeight,
scrollWidth,
} = event.currentTarget;
this.setState(prevState => {
if (
prevState.scrollLeft === scrollLeft &&
prevState.scrollTop === scrollTop
) {
// Scroll position may have been updated by cDM/cDU,
// In which case we don't need to trigger another render,
// And we don't want to update state.isScrolling.
return null;
}
const { direction } = this.props;
// TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
// This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
// It's also easier for this component if we convert offsets to the same format as they would be in for ltr.
// So the simplest solution is to determine which browser behavior we're dealing with, and convert based on it.
let calculatedScrollLeft = scrollLeft;
if (direction === 'rtl') {
switch (getRTLOffsetType()) {
case 'negative':
calculatedScrollLeft = -scrollLeft;
break;
case 'positive-descending':
calculatedScrollLeft = scrollWidth - clientWidth - scrollLeft;
break;
}
}
// Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.
calculatedScrollLeft = Math.max(
0,
Math.min(calculatedScrollLeft, scrollWidth - clientWidth)
);
const calculatedScrollTop = Math.max(
0,
Math.min(scrollTop, scrollHeight - clientHeight)
);
return {
isScrolling: true,
horizontalScrollDirection:
prevState.scrollLeft < scrollLeft ? 'forward' : 'backward',
scrollLeft: calculatedScrollLeft,
scrollTop: calculatedScrollTop,
verticalScrollDirection:
prevState.scrollTop < scrollTop ? 'forward' : 'backward',
scrollUpdateWasRequested: false,
};
}, this._resetIsScrollingDebounced);
};
_outerRefSetter = (ref: any): void => {
const { outerRef } = this.props;
this._outerRef = ((ref: any): HTMLDivElement);
if (typeof outerRef === 'function') {
outerRef(ref);
} else if (
outerRef != null &&
typeof outerRef === 'object' &&
outerRef.hasOwnProperty('current')
) {
outerRef.current = ref;
}
};
_resetIsScrollingDebounced = () => {
if (this._resetIsScrollingTimeoutId !== null) {
cancelTimeout(this._resetIsScrollingTimeoutId);
}
this._resetIsScrollingTimeoutId = requestTimeout(
this._resetIsScrolling,
IS_SCROLLING_DEBOUNCE_INTERVAL
);
};
_resetIsScrolling = () => {
this._resetIsScrollingTimeoutId = null;
this.setState({ isScrolling: false }, () => {
// Clear style cache after state update has been committed.
// This way we don't break pure sCU for items that don't use isScrolling param.
this._getItemStyleCache(-1);
});
};
};
}
const validateSharedProps = (
{
children,
direction,
height,
innerTagName,
outerTagName,
overscanColumnsCount,
overscanCount,
overscanRowsCount,
width,
}: Props<any>,
{ instance }: State
): void => {
if (process.env.NODE_ENV !== 'production') {
if (typeof overscanCount === 'number') {
if (devWarningsOverscanCount && !devWarningsOverscanCount.has(instance)) {
devWarningsOverscanCount.add(instance);
console.warn(
'The overscanCount prop has been deprecated. ' +
'Please use the overscanColumnCount and overscanRowCount props instead.'
);
}
}
if (
typeof overscanColumnsCount === 'number' ||
typeof overscanRowsCount === 'number'
) {
if (
devWarningsOverscanRowsColumnsCount &&
!devWarningsOverscanRowsColumnsCount.has(instance)
) {
devWarningsOverscanRowsColumnsCount.add(instance);
console.warn(
'The overscanColumnsCount and overscanRowsCount props have been deprecated. ' +
'Please use the overscanColumnCount and overscanRowCount props instead.'
);
}
}
if (innerTagName != null || outerTagName != null) {
if (devWarningsTagName && !devWarningsTagName.has(instance)) {
devWarningsTagName.add(instance);
console.warn(
'The innerTagName and outerTagName props have been deprecated. ' +
'Please use the innerElementType and outerElementType props instead.'
);
}
}
if (children == null) {
throw Error(
'An invalid "children" prop has been specified. ' +
'Value should be a React component. ' +
`"${children === null ? 'null' : typeof children}" was specified.`
);
}
switch (direction) {
case 'ltr':
case 'rtl':
// Valid values
break;
default:
throw Error(
'An invalid "direction" prop has been specified. ' +
'Value should be either "ltr" or "rtl". ' +
`"${direction}" was specified.`
);
}
if (typeof width !== 'number') {
throw Error(
'An invalid "width" prop has been specified. ' +
'Grids must specify a number for width. ' +
`"${width === null ? 'null' : typeof width}" was specified.`
);
}
if (typeof height !== 'number') {
throw Error(
'An invalid "height" prop has been specified. ' +
'Grids must specify a number for height. ' +
`"${height === null ? 'null' : typeof height}" was specified.`
);
}
}
};
@@ -0,0 +1,14 @@
type ListNode<T, K> = {
key: K;
next: undefined | ListNode<T, K>;
value: T;
};
type RootNode<T, K> = {
next: undefined | ListNode<T, K>;
};
export function listGetNode<T, K>(list: RootNode<T, K>, key: ListNode<T, K>['key'], isDelete?: boolean): ListNode<T, K> | undefined;
export function listGet<T, K>(objects: undefined | RootNode<T, K>, key: ListNode<T, K>['key']): T | undefined;
export function listSet<T, K>(objects: RootNode<T, K>, key: ListNode<T, K>['key'], value: T): void;
export function listHas<T, K>(objects: undefined | RootNode<T, K>, key: ListNode<T, K>['key']): boolean;
export function listDelete<T, K>(objects: undefined | RootNode<T, K>, key: ListNode<T, K>['key']): ListNode<T, K> | undefined;
@@ -0,0 +1,255 @@
//#region src/utils.ts
const postfixRE = /[?#].*$/;
function cleanUrl(url) {
return url.replace(postfixRE, "");
}
function extractQueryWithoutFragment(url) {
const questionMarkIndex = url.indexOf("?");
if (questionMarkIndex === -1) return "";
const fragmentIndex = url.indexOf("#", questionMarkIndex);
if (fragmentIndex === -1) return url.substring(questionMarkIndex);
else return url.substring(questionMarkIndex, fragmentIndex);
}
//#endregion
//#region src/composable-filters.ts
var And = class {
kind;
args;
constructor(...args) {
if (args.length === 0) throw new Error("`And` expects at least one operand");
this.args = args;
this.kind = "and";
}
};
var Or = class {
kind;
args;
constructor(...args) {
if (args.length === 0) throw new Error("`Or` expects at least one operand");
this.args = args;
this.kind = "or";
}
};
var Not = class {
kind;
expr;
constructor(expr) {
this.expr = expr;
this.kind = "not";
}
};
var Id = class {
kind;
pattern;
params;
constructor(pattern, params) {
this.pattern = pattern;
this.kind = "id";
this.params = params ?? { cleanUrl: false };
}
};
var ModuleType = class {
kind;
pattern;
constructor(pattern) {
this.pattern = pattern;
this.kind = "moduleType";
}
};
var Code = class {
kind;
pattern;
constructor(expr) {
this.pattern = expr;
this.kind = "code";
}
};
var Query = class {
kind;
key;
pattern;
constructor(key, pattern) {
this.pattern = pattern;
this.key = key;
this.kind = "query";
}
};
var Include = class {
kind;
expr;
constructor(expr) {
this.expr = expr;
this.kind = "include";
}
};
var Exclude = class {
kind;
expr;
constructor(expr) {
this.expr = expr;
this.kind = "exclude";
}
};
function and(...args) {
return new And(...args);
}
function or(...args) {
return new Or(...args);
}
function not(expr) {
return new Not(expr);
}
function id(pattern, params) {
return new Id(pattern, params);
}
function moduleType(pattern) {
return new ModuleType(pattern);
}
function code(pattern) {
return new Code(pattern);
}
function query(key, pattern) {
return new Query(key, pattern);
}
function include(expr) {
return new Include(expr);
}
function exclude(expr) {
return new Exclude(expr);
}
/**
* convert a queryObject to FilterExpression like
* ```js
* and(query(k1, v1), query(k2, v2))
* ```
* @param queryFilterObject The query filter object needs to be matched.
* @returns a `And` FilterExpression
*/
function queries(queryFilter) {
let arr = Object.entries(queryFilter).map(([key, value]) => {
return new Query(key, value);
});
return and(...arr);
}
function interpreter(exprs, code$1, id$1, moduleType$1) {
let arr = [];
if (Array.isArray(exprs)) arr = exprs;
else arr = [exprs];
return interpreterImpl(arr, code$1, id$1, moduleType$1);
}
function interpreterImpl(expr, code$1, id$1, moduleType$1, ctx = {}) {
let hasInclude = false;
for (const e of expr) switch (e.kind) {
case "include": {
hasInclude = true;
if (exprInterpreter(e.expr, code$1, id$1, moduleType$1, ctx)) return true;
break;
}
case "exclude": {
if (exprInterpreter(e.expr, code$1, id$1, moduleType$1)) return false;
break;
}
}
return !hasInclude;
}
function exprInterpreter(expr, code$1, id$1, moduleType$1, ctx = {}) {
switch (expr.kind) {
case "and": return expr.args.every((e) => exprInterpreter(e, code$1, id$1, moduleType$1, ctx));
case "or": return expr.args.some((e) => exprInterpreter(e, code$1, id$1, moduleType$1, ctx));
case "not": return !exprInterpreter(expr.expr, code$1, id$1, moduleType$1, ctx);
case "id": {
if (id$1 === void 0) throw new Error("`id` is required for `id` expression");
if (expr.params.cleanUrl) id$1 = cleanUrl(id$1);
return typeof expr.pattern === "string" ? id$1 === expr.pattern : expr.pattern.test(id$1);
}
case "moduleType": {
if (moduleType$1 === void 0) throw new Error("`moduleType` is required for `moduleType` expression");
return moduleType$1 === expr.pattern;
}
case "code": {
if (code$1 === void 0) throw new Error("`code` is required for `code` expression");
return typeof expr.pattern === "string" ? code$1.includes(expr.pattern) : expr.pattern.test(code$1);
}
case "query": {
if (id$1 === void 0) throw new Error("`id` is required for `Query` expression");
if (!ctx.urlSearchParamsCache) {
let queryString = extractQueryWithoutFragment(id$1);
ctx.urlSearchParamsCache = new URLSearchParams(queryString);
}
let urlParams = ctx.urlSearchParamsCache;
if (typeof expr.pattern === "boolean") if (expr.pattern) return urlParams.has(expr.key);
else return !urlParams.has(expr.key);
else if (typeof expr.pattern === "string") return urlParams.get(expr.key) === expr.pattern;
else return expr.pattern.test(urlParams.get(expr.key) ?? "");
}
default: throw new Error(`Expression ${JSON.stringify(expr)} is not expected.`);
}
}
//#endregion
//#region src/simple-filters.ts
/**
* Constructs a RegExp that matches the exact string specified.
*
* This is useful for plugin hook filters.
*
* @param str the string to match.
* @param flags flags for the RegExp.
*
* @example
* ```ts
* import { exactRegex } from '@rolldown/pluginutils';
* const plugin = {
* name: 'plugin',
* resolveId: {
* filter: { id: exactRegex('foo') },
* handler(id) {} // will only be called for `foo`
* }
* }
* ```
*/
function exactRegex(str, flags) {
return new RegExp(`^${escapeRegex(str)}$`, flags);
}
/**
* Constructs a RegExp that matches a value that has the specified prefix.
*
* This is useful for plugin hook filters.
*
* @param str the string to match.
* @param flags flags for the RegExp.
*
* @example
* ```ts
* import { prefixRegex } from '@rolldown/pluginutils';
* const plugin = {
* name: 'plugin',
* resolveId: {
* filter: { id: prefixRegex('foo') },
* handler(id) {} // will only be called for IDs starting with `foo`
* }
* }
* ```
*/
function prefixRegex(str, flags) {
return new RegExp(`^${escapeRegex(str)}`, flags);
}
const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g;
function escapeRegex(str) {
return str.replace(escapeRegexRE, "\\$&");
}
function makeIdFiltersToMatchWithQuery(input) {
if (!Array.isArray(input)) return makeIdFilterToMatchWithQuery(input);
return input.map((i) => makeIdFilterToMatchWithQuery(i));
}
function makeIdFilterToMatchWithQuery(input) {
if (typeof input === "string") return `${input}{?*,}`;
return makeRegexIdFilterToMatchWithQuery(input);
}
function makeRegexIdFilterToMatchWithQuery(input) {
return new RegExp(input.source.replace(/(?<!\\)\$/g, "(?:\\?.*)?$"), input.flags);
}
//#endregion
export { and, code, exactRegex, exclude, exprInterpreter, id, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query };
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,eAAe,SAAS,CAAC"}
@@ -0,0 +1,9 @@
'use strict';
var implementation = require('./implementation');
module.exports = function getPolyfill() {
return typeof Iterator === 'function' && typeof Iterator.prototype.forEach === 'function'
? Iterator.prototype.forEach
: implementation;
};
@@ -0,0 +1,9 @@
import * as Types from './types.mjs';
/** Parses content using the given Parser */
export declare function Parse<Parser extends Types.IParser>(moduleProperties: Types.IModuleProperties, parser: Parser, code: string, context: unknown): [] | [Types.StaticParser<Parser>, string];
/** Parses content using the given Parser */
export declare function Parse<Parser extends Types.IParser>(moduleProperties: Types.IModuleProperties, parser: Parser, code: string): [] | [Types.StaticParser<Parser>, string];
/** Parses content using the given Parser */
export declare function Parse<Parser extends Types.IParser>(parser: Parser, content: string, context: unknown): [] | [Types.StaticParser<Parser>, string];
/** Parses content using the given Parser */
export declare function Parse<Parser extends Types.IParser>(parser: Parser, content: string): [] | [Types.StaticParser<Parser>, string];
@@ -0,0 +1,20 @@
export declare enum ScopeType {
block = "block",
catch = "catch",
class = "class",
classFieldInitializer = "class-field-initializer",
classStaticBlock = "class-static-block",
conditionalType = "conditionalType",
for = "for",
function = "function",
functionExpressionName = "function-expression-name",
functionType = "functionType",
global = "global",
mappedType = "mappedType",
module = "module",
switch = "switch",
tsEnum = "tsEnum",
tsModule = "tsModule",
type = "type",
with = "with"
}
@@ -0,0 +1 @@
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAaM,MAAM,0DAA2D,CAAA,GAAA,oBAAY,EAA8B,CAAC;AAK5G,SAAS,0CAAsB,KAA0B;IAC9D,IAAI,gBAAC,YAAY,EAAC,GAAG;IACrB,IAAI,EAAC,cAAc,eAAe,EAAC,GAAG;IACtC,qBACE,gCAAC,0CAAc,QAAQ;QAAC,OAAO;YAAC,cAAc,iBAAiB,OAAO,YAAY,yBAAA,0BAAA,eAAgB;QAAe;OAC9G,MAAM,QAAQ;AAGrB;AAEO,SAAS;QACP;IAAP,OAAO,CAAA,cAAA,CAAA,GAAA,iBAAS,EAAE,wDAAX,yBAAA,cAA6B,CAAC;AACvC","sources":["packages/@react-aria/overlays/src/PortalProvider.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 React, {createContext, JSX, ReactNode, useContext} from 'react';\n\nexport interface PortalProviderProps {\n /** Should return the element where we should portal to. Can clear the context by passing null. */\n getContainer?: (() => HTMLElement | null) | null,\n /** The content of the PortalProvider. Should contain all children that want to portal their overlays to the element returned by the provided `getContainer()`. */\n children: ReactNode\n}\n\nexport interface PortalProviderContextValue extends Omit<PortalProviderProps, 'children'>{};\n\nexport const PortalContext: React.Context<PortalProviderContextValue> = createContext<PortalProviderContextValue>({});\n\n/**\n * Sets the portal container for all overlay elements rendered by its children.\n */\nexport function UNSAFE_PortalProvider(props: PortalProviderProps): JSX.Element {\n let {getContainer} = props;\n let {getContainer: ctxGetContainer} = useUNSAFE_PortalContext();\n return (\n <PortalContext.Provider value={{getContainer: getContainer === null ? undefined : getContainer ?? ctxGetContainer}}>\n {props.children}\n </PortalContext.Provider>\n );\n}\n\nexport function useUNSAFE_PortalContext(): PortalProviderContextValue {\n return useContext(PortalContext) ?? {};\n}\n"],"names":[],"version":3,"file":"PortalProvider.module.js.map"}
@@ -0,0 +1,19 @@
# @babel/helper-module-imports
> Babel helper functions for inserting module loads
See our website [@babel/helper-module-imports](https://babeljs.io/docs/babel-helper-module-imports) for more information.
## Install
Using npm:
```sh
npm install --save @babel/helper-module-imports
```
or using yarn:
```sh
yarn add @babel/helper-module-imports
```
@@ -0,0 +1 @@
{"version":3,"sources":["../src/headless/index.ts","../src/core/types.ts","../src/core/utils.ts","../src/core/store.ts","../src/core/toast.ts","../src/core/use-toaster.ts"],"sourcesContent":["import { toast } from '../core/toast';\n\nexport type {\n DefaultToastOptions,\n IconTheme,\n Renderable,\n Toast,\n ToasterProps,\n ToastOptions,\n ToastPosition,\n ToastType,\n ValueFunction,\n ValueOrFunction,\n} from '../core/types';\n\nexport { resolveValue } from '../core/types';\nexport { useToaster } from '../core/use-toaster';\nexport { useStore as useToasterStore } from '../core/store';\n\nexport { toast };\nexport default toast;\n","import { CSSProperties } from 'react';\n\nexport type ToastType = 'success' | 'error' | 'loading' | 'blank' | 'custom';\nexport type ToastPosition =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right';\n\nexport type Renderable = React.ReactElement | string | null;\n\nexport interface IconTheme {\n primary: string;\n secondary: string;\n}\n\nexport type ValueFunction<TValue, TArg> = (arg: TArg) => TValue;\nexport type ValueOrFunction<TValue, TArg> =\n | TValue\n | ValueFunction<TValue, TArg>;\n\nconst isFunction = <TValue, TArg>(\n valOrFunction: ValueOrFunction<TValue, TArg>\n): valOrFunction is ValueFunction<TValue, TArg> =>\n typeof valOrFunction === 'function';\n\nexport const resolveValue = <TValue, TArg>(\n valOrFunction: ValueOrFunction<TValue, TArg>,\n arg: TArg\n): TValue => (isFunction(valOrFunction) ? valOrFunction(arg) : valOrFunction);\n\nexport interface Toast {\n type: ToastType;\n id: string;\n toasterId?: string;\n message: ValueOrFunction<Renderable, Toast>;\n icon?: Renderable;\n duration?: number;\n pauseDuration: number;\n position?: ToastPosition;\n removeDelay?: number;\n\n ariaProps: {\n role: 'status' | 'alert';\n 'aria-live': 'assertive' | 'off' | 'polite';\n };\n\n style?: CSSProperties;\n className?: string;\n iconTheme?: IconTheme;\n\n createdAt: number;\n visible: boolean;\n dismissed: boolean;\n height?: number;\n}\n\nexport type ToastOptions = Partial<\n Pick<\n Toast,\n | 'id'\n | 'icon'\n | 'duration'\n | 'ariaProps'\n | 'className'\n | 'style'\n | 'position'\n | 'iconTheme'\n | 'toasterId'\n | 'removeDelay'\n >\n>;\n\nexport type DefaultToastOptions = ToastOptions & {\n [key in ToastType]?: ToastOptions;\n};\n\nexport interface ToasterProps {\n position?: ToastPosition;\n toastOptions?: DefaultToastOptions;\n reverseOrder?: boolean;\n gutter?: number;\n containerStyle?: React.CSSProperties;\n containerClassName?: string;\n toasterId?: string;\n children?: (toast: Toast) => React.ReactElement;\n}\n\nexport interface ToastWrapperProps {\n id: string;\n className?: string;\n style?: React.CSSProperties;\n onHeightUpdate: (id: string, height: number) => void;\n children?: React.ReactNode;\n}\n","export const genId = (() => {\n let count = 0;\n return () => {\n return (++count).toString();\n };\n})();\n\nexport const prefersReducedMotion = (() => {\n // Cache result\n let shouldReduceMotion: boolean | undefined = undefined;\n\n return () => {\n if (shouldReduceMotion === undefined && typeof window !== 'undefined') {\n const mediaQuery = matchMedia('(prefers-reduced-motion: reduce)');\n shouldReduceMotion = !mediaQuery || mediaQuery.matches;\n }\n return shouldReduceMotion;\n };\n})();\n","import { useEffect, useState, useRef } from 'react';\nimport { DefaultToastOptions, Toast, ToastType } from './types';\n\nexport const TOAST_EXPIRE_DISMISS_DELAY = 1000;\nexport const TOAST_LIMIT = 20;\nexport const DEFAULT_TOASTER_ID = 'default';\n\ninterface ToasterSettings {\n toastLimit: number;\n}\n\nexport enum ActionType {\n ADD_TOAST,\n UPDATE_TOAST,\n UPSERT_TOAST,\n DISMISS_TOAST,\n REMOVE_TOAST,\n START_PAUSE,\n END_PAUSE,\n}\n\nexport type Action =\n | {\n type: ActionType.ADD_TOAST;\n toast: Toast;\n }\n | {\n type: ActionType.UPSERT_TOAST;\n toast: Toast;\n }\n | {\n type: ActionType.UPDATE_TOAST;\n toast: Partial<Toast>;\n }\n | {\n type: ActionType.DISMISS_TOAST;\n toastId?: string;\n }\n | {\n type: ActionType.REMOVE_TOAST;\n toastId?: string;\n }\n | {\n type: ActionType.START_PAUSE;\n time: number;\n }\n | {\n type: ActionType.END_PAUSE;\n time: number;\n };\n\ninterface ToasterState {\n toasts: Toast[];\n settings: ToasterSettings;\n pausedAt: number | undefined;\n}\n\ninterface State {\n [toasterId: string]: ToasterState;\n}\n\nexport const reducer = (state: ToasterState, action: Action): ToasterState => {\n const { toastLimit } = state.settings;\n\n switch (action.type) {\n case ActionType.ADD_TOAST:\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, toastLimit),\n };\n\n case ActionType.UPDATE_TOAST:\n Line truncated
@@ -0,0 +1,53 @@
/*! *****************************************************************************
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.
***************************************************************************** */
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// src/watchGuard/watchGuard.ts
var fs = __toESM(require("fs"));
if (process.argv.length < 3) {
process.exit(1);
}
var directoryName = process.argv[2];
try {
const watcher = fs.watch(directoryName, { recursive: true }, () => ({}));
watcher.close();
} catch {
}
process.exit(0);
//# sourceMappingURL=watchGuard.js.map
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,oBAAoB,CAAC,6GAA6D,CAAC;AACvG","sources":["packages/@react-aria/menu/intl/tr-TR.json"],"sourcesContent":["{\n \"longPressMessage\": \"Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın\"\n}\n"],"names":[],"version":3,"file":"tr-TR.main.js.map"}
@@ -0,0 +1,265 @@
/**
* exception-handler.js: Object for handling uncaughtException events.
*
* (C) 2010 Charlie Robbins
* MIT LICENCE
*/
'use strict';
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var os = require('os');
var asyncForEach = require('async/forEach');
var debug = require('@dabh/diagnostics')('winston:exception');
var once = require('one-time');
var stackTrace = require('stack-trace');
var ExceptionStream = require('./exception-stream');
/**
* Object for handling uncaughtException events.
* @type {ExceptionHandler}
*/
module.exports = /*#__PURE__*/function () {
/**
* TODO: add contructor description
* @param {!Logger} logger - TODO: add param description
*/
function ExceptionHandler(logger) {
_classCallCheck(this, ExceptionHandler);
if (!logger) {
throw new Error('Logger is required to handle exceptions');
}
this.logger = logger;
this.handlers = new Map();
}
/**
* Handles `uncaughtException` events for the current process by adding any
* handlers passed in.
* @returns {undefined}
*/
return _createClass(ExceptionHandler, [{
key: "handle",
value: function handle() {
var _this = this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
args.forEach(function (arg) {
if (Array.isArray(arg)) {
return arg.forEach(function (handler) {
return _this._addHandler(handler);
});
}
_this._addHandler(arg);
});
if (!this.catcher) {
this.catcher = this._uncaughtException.bind(this);
process.on('uncaughtException', this.catcher);
}
}
/**
* Removes any handlers to `uncaughtException` events for the current
* process. This does not modify the state of the `this.handlers` set.
* @returns {undefined}
*/
}, {
key: "unhandle",
value: function unhandle() {
var _this2 = this;
if (this.catcher) {
process.removeListener('uncaughtException', this.catcher);
this.catcher = false;
Array.from(this.handlers.values()).forEach(function (wrapper) {
return _this2.logger.unpipe(wrapper);
});
}
}
/**
* TODO: add method description
* @param {Error} err - Error to get information about.
* @returns {mixed} - TODO: add return description.
*/
}, {
key: "getAllInfo",
value: function getAllInfo(err) {
var message = null;
if (err) {
message = typeof err === 'string' ? err : err.message;
}
return {
error: err,
// TODO (indexzero): how do we configure this?
level: 'error',
message: ["uncaughtException: ".concat(message || '(no error message)'), err && err.stack || ' No stack trace'].join('\n'),
stack: err && err.stack,
exception: true,
date: new Date().toString(),
process: this.getProcessInfo(),
os: this.getOsInfo(),
trace: this.getTrace(err)
};
}
/**
* Gets all relevant process information for the currently running process.
* @returns {mixed} - TODO: add return description.
*/
}, {
key: "getProcessInfo",
value: function getProcessInfo() {
return {
pid: process.pid,
uid: process.getuid ? process.getuid() : null,
gid: process.getgid ? process.getgid() : null,
cwd: process.cwd(),
execPath: process.execPath,
version: process.version,
argv: process.argv,
memoryUsage: process.memoryUsage()
};
}
/**
* Gets all relevant OS information for the currently running process.
* @returns {mixed} - TODO: add return description.
*/
}, {
key: "getOsInfo",
value: function getOsInfo() {
return {
loadavg: os.loadavg(),
uptime: os.uptime()
};
}
/**
* Gets a stack trace for the specified error.
* @param {mixed} err - TODO: add param description.
* @returns {mixed} - TODO: add return description.
*/
}, {
key: "getTrace",
value: function getTrace(err) {
var trace = err ? stackTrace.parse(err) : stackTrace.get();
return trace.map(function (site) {
return {
column: site.getColumnNumber(),
file: site.getFileName(),
"function": site.getFunctionName(),
line: site.getLineNumber(),
method: site.getMethodName(),
"native": site.isNative()
};
});
}
/**
* Helper method to add a transport as an exception handler.
* @param {Transport} handler - The transport to add as an exception handler.
* @returns {void}
*/
}, {
key: "_addHandler",
value: function _addHandler(handler) {
if (!this.handlers.has(handler)) {
handler.handleExceptions = true;
var wrapper = new ExceptionStream(handler);
this.handlers.set(handler, wrapper);
this.logger.pipe(wrapper);
}
}
/**
* Logs all relevant information around the `err` and exits the current
* process.
* @param {Error} err - Error to handle
* @returns {mixed} - TODO: add return description.
* @private
*/
}, {
key: "_uncaughtException",
value: function _uncaughtException(err) {
var info = this.getAllInfo(err);
var handlers = this._getExceptionHandlers();
// Calculate if we should exit on this error
var doExit = typeof this.logger.exitOnError === 'function' ? this.logger.exitOnError(err) : this.logger.exitOnError;
var timeout;
if (!handlers.length && doExit) {
// eslint-disable-next-line no-console
console.warn('winston: exitOnError cannot be true with no exception handlers.');
// eslint-disable-next-line no-console
console.warn('winston: not exiting process.');
doExit = false;
}
function gracefulExit() {
debug('doExit', doExit);
debug('process._exiting', process._exiting);
if (doExit && !process._exiting) {
// Remark: Currently ignoring any exceptions from transports when
// catching uncaught exceptions.
if (timeout) {
clearTimeout(timeout);
}
// eslint-disable-next-line no-process-exit
process.exit(1);
}
}
if (!handlers || handlers.length === 0) {
return process.nextTick(gracefulExit);
}
// Log to all transports attempting to listen for when they are completed.
asyncForEach(handlers, function (handler, next) {
var done = once(next);
var transport = handler.transport || handler;
// Debug wrapping so that we can inspect what's going on under the covers.
function onDone(event) {
return function () {
debug(event);
done();
};
}
transport._ending = true;
transport.once('finish', onDone('finished'));
transport.once('error', onDone('error'));
}, function () {
return doExit && gracefulExit();
});
this.logger.log(info);
// If exitOnError is true, then only allow the logging of exceptions to
// take up to `3000ms`.
if (doExit) {
timeout = setTimeout(gracefulExit, 3000);
}
}
/**
* Returns the list of transports and exceptionHandlers for this instance.
* @returns {Array} - List of transports and exceptionHandlers for this
* instance.
* @private
*/
}, {
key: "_getExceptionHandlers",
value: function _getExceptionHandlers() {
// Remark (indexzero): since `logger.transports` returns all of the pipes
// from the _readableState of the stream we actually get the join of the
// explicit handlers and the implicit transports with
// `handleExceptions: true`
return this.logger.transports.filter(function (wrap) {
var transport = wrap.transport || wrap;
return transport.handleExceptions;
});
}
}]);
}();
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConditionalTypeScope = void 0;
const ScopeBase_1 = require("./ScopeBase");
const ScopeType_1 = require("./ScopeType");
class ConditionalTypeScope extends ScopeBase_1.ScopeBase {
constructor(scopeManager, upperScope, block) {
super(scopeManager, ScopeType_1.ScopeType.conditionalType, upperScope, block, false);
}
}
exports.ConditionalTypeScope = ConditionalTypeScope;
@@ -0,0 +1,3 @@
declare const _default: (tempObject: object) => boolean;
export default _default;
//# sourceMappingURL=isPlainObject.d.ts.map
@@ -0,0 +1,46 @@
// this spawns a child process that listens for SIGHUP when the
// parent process exits, and after 200ms, sends a SIGKILL to the
// child, in case it did not terminate.
import { spawn } from 'child_process';
const watchdogCode = String.raw `
const pid = parseInt(process.argv[1], 10)
process.title = 'node (foreground-child watchdog pid=' + pid + ')'
if (!isNaN(pid)) {
let barked = false
// keepalive
const interval = setInterval(() => {}, 60000)
const bark = () => {
clearInterval(interval)
if (barked) return
barked = true
process.removeListener('SIGHUP', bark)
setTimeout(() => {
try {
process.kill(pid, 'SIGKILL')
setTimeout(() => process.exit(), 200)
} catch (_) {}
}, 500)
})
process.on('SIGHUP', bark)
}
`;
/**
* Pass in a ChildProcess, and this will spawn a watchdog process that
* will make sure it exits if the parent does, thus preventing any
* dangling detached zombie processes.
*
* If the child ends before the parent, then the watchdog will terminate.
*/
export const watchdog = (child) => {
let dogExited = false;
const dog = spawn(process.execPath, ['-e', watchdogCode, String(child.pid)], {
stdio: 'ignore',
});
dog.on('exit', () => (dogExited = true));
child.on('exit', () => {
if (!dogExited)
dog.kill('SIGKILL');
});
return dog;
};
//# sourceMappingURL=watchdog.js.map
@@ -0,0 +1,247 @@
# bl *(BufferList)*
[![Build Status](https://api.travis-ci.com/rvagg/bl.svg?branch=master)](https://travis-ci.com/rvagg/bl/)
**A Node.js Buffer list collector, reader and streamer thingy.**
[![NPM](https://nodei.co/npm/bl.svg)](https://nodei.co/npm/bl/)
**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them!
The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently.
```js
const { BufferList } = require('bl')
const bl = new BufferList()
bl.append(Buffer.from('abcd'))
bl.append(Buffer.from('efg'))
bl.append('hi') // bl will also accept & convert Strings
bl.append(Buffer.from('j'))
bl.append(Buffer.from([ 0x3, 0x4 ]))
console.log(bl.length) // 12
console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij'
console.log(bl.slice(3, 10).toString('ascii')) // 'defghij'
console.log(bl.slice(3, 6).toString('ascii')) // 'def'
console.log(bl.slice(3, 8).toString('ascii')) // 'defgh'
console.log(bl.slice(5, 10).toString('ascii')) // 'fghij'
console.log(bl.indexOf('def')) // 3
console.log(bl.indexOf('asdf')) // -1
// or just use toString!
console.log(bl.toString()) // 'abcdefghij\u0003\u0004'
console.log(bl.toString('ascii', 3, 8)) // 'defgh'
console.log(bl.toString('ascii', 5, 10)) // 'fghij'
// other standard Buffer readables
console.log(bl.readUInt16BE(10)) // 0x0304
console.log(bl.readUInt16LE(10)) // 0x0403
```
Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**:
```js
const { BufferListStream } = require('bl')
const fs = require('fs')
fs.createReadStream('README.md')
.pipe(BufferListStream((err, data) => { // note 'new' isn't strictly required
// `data` is a complete Buffer object containing the full data
console.log(data.toString())
}))
```
Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream.
Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!):
```js
const hyperquest = require('hyperquest')
const { BufferListStream } = require('bl')
const url = 'https://raw.github.com/rvagg/bl/master/README.md'
hyperquest(url).pipe(BufferListStream((err, data) => {
console.log(data.toString())
}))
```
Or, use it as a readable stream to recompose a list of Buffers to an output source:
```js
const { BufferListStream } = require('bl')
const fs = require('fs')
var bl = new BufferListStream()
bl.append(Buffer.from('abcd'))
bl.append(Buffer.from('efg'))
bl.append(Buffer.from('hi'))
bl.append(Buffer.from('j'))
bl.pipe(fs.createWriteStream('gibberish.txt'))
```
## API
* <a href="#ctor"><code><b>new BufferList([ buf ])</b></code></a>
* <a href="#isBufferList"><code><b>BufferList.isBufferList(obj)</b></code></a>
* <a href="#length"><code>bl.<b>length</b></code></a>
* <a href="#append"><code>bl.<b>append(buffer)</b></code></a>
* <a href="#get"><code>bl.<b>get(index)</b></code></a>
* <a href="#indexOf"><code>bl.<b>indexOf(value[, byteOffset][, encoding])</b></code></a>
* <a href="#slice"><code>bl.<b>slice([ start[, end ] ])</b></code></a>
* <a href="#shallowSlice"><code>bl.<b>shallowSlice([ start[, end ] ])</b></code></a>
* <a href="#copy"><code>bl.<b>copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])</b></code></a>
* <a href="#duplicate"><code>bl.<b>duplicate()</b></code></a>
* <a href="#consume"><code>bl.<b>consume(bytes)</b></code></a>
* <a href="#toString"><code>bl.<b>toString([encoding, [ start, [ end ]]])</b></code></a>
* <a href="#readXX"><code>bl.<b>readDoubleBE()</b></code>, <code>bl.<b>readDoubleLE()</b></code>, <code>bl.<b>readFloatBE()</b></code>, <code>bl.<b>readFloatLE()</b></code>, <code>bl.<b>readInt32BE()</b></code>, <code>bl.<b>readInt32LE()</b></code>, <code>bl.<b>readUInt32BE()</b></code>, <code>bl.<b>readUInt32LE()</b></code>, <code>bl.<b>readInt16BE()</b></code>, <code>bl.<b>readInt16LE()</b></code>, <code>bl.<b>readUInt16BE()</b></code>, <code>bl.<b>readUInt16LE()</b></code>, <code>bl.<b>readInt8()</b></code>, <code>bl.<b>readUInt8()</b></code></a>
* <a href="#ctorStream"><code><b>new BufferListStream([ callback ])</b></code></a>
--------------------------------------------------------
<a name="ctor"></a>
### new BufferList([ Buffer | Buffer array | BufferList | BufferList array | String ])
No arguments are _required_ for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` objects.
`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:
```js
const { BufferList } = require('bl')
const bl = BufferList()
// equivalent to:
const { BufferList } = require('bl')
const bl = new BufferList()
```
--------------------------------------------------------
<a name="isBufferList"></a>
### BufferList.isBufferList(obj)
Determines if the passed object is a `BufferList`. It will return `true` if the passed object is an instance of `BufferList` **or** `BufferListStream` and `false` otherwise.
N.B. this won't return `true` for `BufferList` or `BufferListStream` instances created by versions of this library before this static method was added.
--------------------------------------------------------
<a name="length"></a>
### bl.length
Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list.
--------------------------------------------------------
<a name="append"></a>
### bl.append(Buffer | Buffer array | BufferList | BufferList array | String)
`append(buffer)` adds an additional buffer or BufferList to the internal list. `this` is returned so it can be chained.
--------------------------------------------------------
<a name="get"></a>
### bl.get(index)
`get()` will return the byte at the specified index.
--------------------------------------------------------
<a name="indexOf"></a>
### bl.indexOf(value[, byteOffset][, encoding])
`get()` will return the byte at the specified index.
`indexOf()` method returns the first index at which a given element can be found in the BufferList, or -1 if it is not present.
--------------------------------------------------------
<a name="slice"></a>
### bl.slice([ start, [ end ] ])
`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer.
--------------------------------------------------------
<a name="shallowSlice"></a>
### bl.shallowSlice([ start, [ end ] ])
`shallowSlice()` returns a new `BufferList` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
No copies will be performed. All buffers in the result share memory with the original list.
--------------------------------------------------------
<a name="copy"></a>
### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])
`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively.
--------------------------------------------------------
<a name="duplicate"></a>
### bl.duplicate()
`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example:
```js
var bl = new BufferListStream()
bl.append('hello')
bl.append(' world')
bl.append('\n')
bl.duplicate().pipe(process.stdout, { end: false })
console.log(bl.toString())
```
--------------------------------------------------------
<a name="consume"></a>
### bl.consume(bytes)
`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers&mdash;initial offsets will be calculated accordingly in order to give you a consistent view of the data.
--------------------------------------------------------
<a name="toString"></a>
### bl.toString([encoding, [ start, [ end ]]])
`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information.
--------------------------------------------------------
<a name="readXX"></a>
### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8()
All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently.
See the <b><code>[Buffer](http://nodejs.org/docs/latest/api/buffer.html)</code></b> documentation for how these work.
--------------------------------------------------------
<a name="ctorStream"></a>
### new BufferListStream([ callback | Buffer | Buffer array | BufferList | BufferList array | String ])
**BufferListStream** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **BufferListStream** instance.
The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream.
Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object.
`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:
```js
const { BufferListStream } = require('bl')
const bl = BufferListStream()
// equivalent to:
const { BufferListStream } = require('bl')
const bl = new BufferListStream()
```
N.B. For backwards compatibility reasons, `BufferListStream` is the **default** export when you `require('bl')`:
```js
const { BufferListStream } = require('bl')
// equivalent to:
const BufferListStream = require('bl')
```
--------------------------------------------------------
## Contributors
**bl** is brought to you by the following hackers:
* [Rod Vagg](https://github.com/rvagg)
* [Matteo Collina](https://github.com/mcollina)
* [Jarett Cruger](https://github.com/jcrugzz)
<a name="license"></a>
## License &amp; copyright
Copyright (c) 2013-2019 bl contributors (listed above).
bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.
@@ -0,0 +1,57 @@
import {useRef as $lPAwt$useRef, useCallback as $lPAwt$useCallback, useEffect as $lPAwt$useEffect} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $03deb23ff14920c4$export$4eaf04e54aa8eed6() {
let globalListeners = (0, $lPAwt$useRef)(new Map());
let addGlobalListener = (0, $lPAwt$useCallback)((eventTarget, type, listener, options)=>{
// Make sure we remove the listener after it is called with the `once` option.
let fn = (options === null || options === void 0 ? void 0 : options.once) ? (...args)=>{
globalListeners.current.delete(listener);
listener(...args);
} : listener;
globalListeners.current.set(listener, {
type: type,
eventTarget: eventTarget,
fn: fn,
options: options
});
eventTarget.addEventListener(type, fn, options);
}, []);
let removeGlobalListener = (0, $lPAwt$useCallback)((eventTarget, type, listener, options)=>{
var _globalListeners_current_get;
let fn = ((_globalListeners_current_get = globalListeners.current.get(listener)) === null || _globalListeners_current_get === void 0 ? void 0 : _globalListeners_current_get.fn) || listener;
eventTarget.removeEventListener(type, fn, options);
globalListeners.current.delete(listener);
}, []);
let removeAllGlobalListeners = (0, $lPAwt$useCallback)(()=>{
globalListeners.current.forEach((value, key)=>{
removeGlobalListener(value.eventTarget, value.type, key, value.options);
});
}, [
removeGlobalListener
]);
(0, $lPAwt$useEffect)(()=>{
return removeAllGlobalListeners;
}, [
removeAllGlobalListeners
]);
return {
addGlobalListener: addGlobalListener,
removeGlobalListener: removeGlobalListener,
removeAllGlobalListeners: removeAllGlobalListeners
};
}
export {$03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners};
//# sourceMappingURL=useGlobalListeners.module.js.map
@@ -0,0 +1,94 @@
# node-promise-retry
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url] [![Greenkeeper badge][greenkeeper-image]][greenkeeper-url]
[npm-url]:https://npmjs.org/package/promise-retry
[downloads-image]:http://img.shields.io/npm/dm/promise-retry.svg
[npm-image]:http://img.shields.io/npm/v/promise-retry.svg
[travis-url]:https://travis-ci.org/IndigoUnited/node-promise-retry
[travis-image]:http://img.shields.io/travis/IndigoUnited/node-promise-retry/master.svg
[david-dm-url]:https://david-dm.org/IndigoUnited/node-promise-retry
[david-dm-image]:https://img.shields.io/david/IndigoUnited/node-promise-retry.svg
[david-dm-dev-url]:https://david-dm.org/IndigoUnited/node-promise-retry?type=dev
[david-dm-dev-image]:https://img.shields.io/david/dev/IndigoUnited/node-promise-retry.svg
[greenkeeper-image]:https://badges.greenkeeper.io/IndigoUnited/node-promise-retry.svg
[greenkeeper-url]:https://greenkeeper.io/
Retries a function that returns a promise, leveraging the power of the [retry](https://github.com/tim-kos/node-retry) module to the promises world.
There's already some modules that are able to retry functions that return promises but
they were rather difficult to use or do not offer an easy way to do conditional retries.
## Installation
`$ npm install promise-retry`
## Usage
### promiseRetry(fn, [options])
Calls `fn` until the returned promise ends up fulfilled or rejected with an error different than
a `retry` error.
The `options` argument is an object which maps to the [retry](https://github.com/tim-kos/node-retry) module options:
- `retries`: The maximum amount of times to retry the operation. Default is `10`.
- `factor`: The exponential factor to use. Default is `2`.
- `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`.
- `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`.
- `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`.
The `fn` function will receive a `retry` function as its first argument that should be called with an error whenever you want to retry `fn`. The `retry` function will always throw an error.
If there are retries left, it will throw a special `retry` error that will be handled internally to call `fn` again.
If there are no retries left, it will throw the actual error passed to it.
If you prefer, you can pass the options first using the alternative function signature `promiseRetry([options], fn)`.
## Example
```js
var promiseRetry = require('promise-retry');
// Simple example
promiseRetry(function (retry, number) {
console.log('attempt number', number);
return doSomething()
.catch(retry);
})
.then(function (value) {
// ..
}, function (err) {
// ..
});
// Conditional example
promiseRetry(function (retry, number) {
console.log('attempt number', number);
return doSomething()
.catch(function (err) {
if (err.code === 'ETIMEDOUT') {
retry(err);
}
throw err;
});
})
.then(function (value) {
// ..
}, function (err) {
// ..
});
```
## Tests
`$ npm test`
## License
Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
@@ -0,0 +1 @@
{"name":"react-markdown","version":"9.1.0","requiresBuild":false,"files":{"license":{"checkedAt":1794532112390,"integrity":"sha512-ZnUbTH2k972UWT6sXPy5d/KzfkGn30g/tF63QNxQTP7xpO+mXJFC6JlYatipQZ/vgRH++X4aSgTK8EKFvPQe+g==","mode":420,"size":1079},"index.js":{"checkedAt":1794532112390,"integrity":"sha512-20klBSaDaHOAYnnTraCOPu0MF/Xh52M7bMF+jWeJNpy0B5UHhfCRwEY78tN2j6Ebkhk8Qa80tjKLLCUx12dppw==","mode":420,"size":428},"lib/index.js":{"checkedAt":1794532112391,"integrity":"sha512-CidIpZGY3zJmfgcusLnVt0ikdqyUZYIqG8yTQk6zvtXpqPa/LtMJSLuX88E/a2o8ukWn2Mct6i6lRmciHK4GAA==","mode":420,"size":12867},"package.json":{"checkedAt":1794532112391,"integrity":"sha512-6+cGcd9EED3/CN5JAtMbY5yUwM6ylOxI8FCkxNnqAQ9xRrMMfgHWSEBcNrHrRgMhZQuzdlbWbQAnGCq3sPcFPA==","mode":420,"size":4974},"index.d.ts.map":{"checkedAt":1794532112391,"integrity":"sha512-K+CF3yok8XQEG/DuGJwS6H3wMn2x4fISWp3wHGjjAglTCK5AJA+SvIYzrZg7O3Kfl6BZ0xBXNstOYq/pcy+gCw==","mode":420,"size":240},"lib/index.d.ts.map":{"checkedAt":1794532112391,"integrity":"sha512-B5CMRVzVjqOPjx5diSP4DxSBzLebhm9eZDE8ZhJLJEjzefnR/De6cFckV/UCLAt2n0xfb6S3P+bsy/lFLpRhEw==","mode":420,"size":1297},"readme.md":{"checkedAt":1794532112391,"integrity":"sha512-ABrnjRSPwJ9mWClc8RX7wPcIwRvjsCx1PQNjQzRray8LdFnVRMJcW6TZDFmcletExFfXWPjULu0uqUO1K8+Nww==","mode":420,"size":26216},"index.d.ts":{"checkedAt":1794532112391,"integrity":"sha512-8qhUW9mvu91RvBpRshJb+2hWP/Pty07m40paYhrptPO76MAgRWryJ3LU9J/LI70K/6UlsQXZ2WUE5tE9Sf4Gcg==","mode":420,"size":452},"lib/index.d.ts":{"checkedAt":1794532112391,"integrity":"sha512-yK7hLNtXqK8b3YXgZ6qb1ERVktAmpAxi5j55jWworHwjtWSFTeq9XmbTsNt5R0bGOfBFUxqOq3K6bXzzXwUccg==","mode":420,"size":4360}}}
@@ -0,0 +1 @@
{"version":3,"file":"receivebuffer.js","sourceRoot":"","sources":["../../src/common/receivebuffer.ts"],"names":[],"mappings":";;;AAAA,MAAM,aAAa;IAKjB,YAAY,IAAI,GAAG,IAAI;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,IAAY;QACjB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAC;QACJ,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACpD,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;YACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAC9B,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,EACtC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CACjC,CACF,CAAC;YACF,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,CAAC,MAAc;QACjB,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,GAAG,CAAC,MAAc;QAChB,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC;QAEtB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAEO,sCAAa"}
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,eAAe,CAAC;IAC3E,qBAAqB,CAAC,gDAA0C,CAAC;IACjE,UAAU,CAAC,SAAS,CAAC;IACrB,eAAe,CAAC,uBAAuB,CAAC;IACxC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,4BAA4B,CAAC;YAAE,KAAK,IAAM,CAAC,YAAY,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,OAAO,CAAC;YAAE,OAAO,IAAM,CAAC,YAAY,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,OAAO,CAAC;QAAA,GAAG,CAAC,CAAC;IACpP,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,aAAa,CAAC;AACvD","sources":["packages/@react-aria/grid/intl/sr-SP.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} nije izabrano.\",\n \"longPressToSelect\": \"Dugo pritisnite za ulazak u režim biranja.\",\n \"select\": \"Izaberite\",\n \"selectedAll\": \"Izabrane su sve stavke.\",\n \"selectedCount\": \"{count, plural, =0 {Nije izabrana nijedna stavka} one {Izabrana je # stavka} other {Izabrano je # stavki}}.\",\n \"selectedItem\": \"{item} je izabrano.\"\n}\n"],"names":[],"version":3,"file":"sr-SP.module.js.map"}
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA8DM,SAAS,0CAAW,KAAuB,EAAE,KAA0B;IAC5E,IAAI,cACF,UAAU,cACV,UAAU,cACV,UAAU,6BACV,yBAAyB,gCACzB,4BAA4B,EAC5B,GAAG,YACJ,GAAG;IAEJ,IAAI,gBAAC,YAAY,iBAAE,aAAa,EAAC,GAAG,CAAA,GAAA,oCAAS,EAC3C;QACE,6FAA6F;QAC7F,QAAQ,MAAM,MAAM,IAAI,CAAC,UAAU,CAAC,4BAA4B;QAChE,SAAS,MAAM,KAAK;QACpB,mBAAmB;QACnB,eAAe,CAAC;mCAChB;sCACA;IACF,GACA;IAGF,IAAI,EAAC,cAAc,aAAa,cAAE,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,4CAAiB,EAAE;QAC5E,GAAG,UAAU;QACb,WAAW;QACX,YAAY;QACZ,QAAQ,MAAM,MAAM;QACpB,SAAS,aAAa,MAAM,KAAK,GAAG;IACtC;IAEA,CAAA,GAAA,0CAAe,EAAE;QACf,YAAY,cAAc,CAAC,MAAM,MAAM;IACzC;IAEA,CAAA,GAAA,qCAAc,EAAE;QACd,IAAI,MAAM,MAAM,IAAI,CAAC,cAAc,WAAW,OAAO,EACnD,OAAO,CAAA,GAAA,yCAAc,EAAE;YAAC,WAAW,OAAO;SAAC;IAE/C,GAAG;QAAC;QAAY,MAAM,MAAM;QAAE;KAAW;IAEzC,OAAO;QACL,cAAc,CAAA,GAAA,gCAAS,EAAE,cAAc;oBACvC;uBACA;mBACA;IACF;AACF","sources":["packages/@react-aria/overlays/src/usePopover.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ariaHideOutside} from './ariaHideOutside';\nimport {AriaPositionProps, useOverlayPosition} from './useOverlayPosition';\nimport {DOMAttributes, RefObject} from '@react-types/shared';\nimport {mergeProps, useLayoutEffect} from '@react-aria/utils';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport {PlacementAxis} from '@react-types/overlays';\nimport {useOverlay} from './useOverlay';\nimport {usePreventScroll} from './usePreventScroll';\n\nexport interface AriaPopoverProps extends Omit<AriaPositionProps, 'isOpen' | 'onClose' | 'targetRef' | 'overlayRef'> {\n /**\n * The ref for the element which the popover positions itself with respect to.\n */\n triggerRef: RefObject<Element | null>,\n /**\n * The ref for the popover element.\n */\n popoverRef: RefObject<Element | null>,\n /**\n * Whether the popover is non-modal, i.e. elements outside the popover may be\n * interacted with by assistive technologies.\n *\n * Most popovers should not use this option as it may negatively impact the screen\n * reader experience. Only use with components such as combobox, which are designed\n * to handle this situation carefully.\n */\n isNonModal?: boolean,\n /**\n * Whether pressing the escape key to close the popover should be disabled.\n *\n * Most popovers should not use this option. When set to true, an alternative\n * way to close the popover with a keyboard must be provided.\n *\n * @default false\n */\n isKeyboardDismissDisabled?: boolean,\n /**\n * When user interacts with the argument element outside of the popover ref,\n * return true if onClose should be called. This gives you a chance to filter\n * out interaction with elements that should not dismiss the popover.\n * By default, onClose will always be called on interaction outside the popover ref.\n */\n shouldCloseOnInteractOutside?: (element: Element) => boolean\n}\n\nexport interface PopoverAria {\n /** Props for the popover element. */\n popoverProps: DOMAttributes,\n /** Props for the popover tip arrow if any. */\n arrowProps: DOMAttributes,\n /** Props to apply to the underlay element, if any. */\n underlayProps: DOMAttributes,\n /** Placement of the popover with respect to the trigger. */\n placement: PlacementAxis | null\n}\n\n/**\n * Provides the behavior and accessibility implementation for a popover component.\n * A popover is an overlay element positioned relative to a trigger.\n */\nexport function usePopover(props: AriaPopoverProps, state: OverlayTriggerState): PopoverAria {\n let {\n triggerRef,\n popoverRef,\n isNonModal,\n isKeyboardDismissDisabled,\n shouldCloseOnInteractOutside,\n ...otherProps\n } = props;\n\n let {overlayProps, underlayProps} = useOverlay(\n {\n // If popover is in the top layer, it should not prevent other popovers from being dismissed.\n isOpen: state.isOpen && !otherProps['data-react-aria-top-layer'],\n onClose: state.close,\n shouldCloseOnBlur: true,\n isDismissable: !isNonModal,\n isKeyboardDismissDisabled,\n shouldCloseOnInteractOutside\n },\n popoverRef\n );\n\n let {overlayProps: positionProps, arrowProps, placement} = useOverlayPosition({\n ...otherProps,\n targetRef: triggerRef,\n overlayRef: popoverRef,\n isOpen: state.isOpen,\n onClose: isNonModal ? state.close : undefined\n });\n\n usePreventScroll({\n isDisLine truncated
@@ -0,0 +1,349 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createValidator = createValidator;
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../../util");
const enums_1 = require("./enums");
const format_1 = require("./format");
const shared_1 = require("./shared");
function createValidator(type, context, allConfigs) {
// make sure the "highest priority" configs are checked first
const selectorType = enums_1.Selectors[type];
const configs = allConfigs
// gather all of the applicable selectors
.filter(c => (c.selector & selectorType) !== 0 ||
c.selector === enums_1.MetaSelectors.default)
.sort((a, b) => {
if (a.selector === b.selector) {
// in the event of the same selector, order by modifier weight
// sort descending - the type modifiers are "more important"
return b.modifierWeight - a.modifierWeight;
}
const aIsMeta = (0, shared_1.isMetaSelector)(a.selector);
const bIsMeta = (0, shared_1.isMetaSelector)(b.selector);
// non-meta selectors should go ahead of meta selectors
if (aIsMeta && !bIsMeta) {
return 1;
}
if (!aIsMeta && bIsMeta) {
return -1;
}
const aIsMethodOrProperty = (0, shared_1.isMethodOrPropertySelector)(a.selector);
const bIsMethodOrProperty = (0, shared_1.isMethodOrPropertySelector)(b.selector);
// for backward compatibility, method and property have higher precedence than other meta selectors
if (aIsMethodOrProperty && !bIsMethodOrProperty) {
return -1;
}
if (!aIsMethodOrProperty && bIsMethodOrProperty) {
return 1;
}
// both aren't meta selectors
// sort descending - the meta selectors are "least important"
return b.selector - a.selector;
});
return (node, modifiers = new Set()) => {
const originalName = node.type === utils_1.AST_NODE_TYPES.Identifier ||
node.type === utils_1.AST_NODE_TYPES.PrivateIdentifier
? node.name
: `${node.value}`;
// return will break the loop and stop checking configs
// it is only used when the name is known to have failed or succeeded a config.
for (const config of configs) {
if (config.filter?.regex.test(originalName) !== config.filter?.match) {
// name does not match the filter
continue;
}
if (config.modifiers?.some(modifier => !modifiers.has(modifier))) {
// does not have the required modifiers
continue;
}
if (!isCorrectType(node, config, context, selectorType)) {
// is not the correct type
continue;
}
let name = originalName;
name = validateUnderscore('leading', config, name, node, originalName);
if (name == null) {
// fail
return;
}
name = validateUnderscore('trailing', config, name, node, originalName);
if (name == null) {
// fail
return;
}
name = validateAffix('prefix', config, name, node, originalName);
if (name == null) {
// fail
return;
}
name = validateAffix('suffix', config, name, node, originalName);
if (name == null) {
// fail
return;
}
if (!validateCustom(config, name, node, originalName)) {
// fail
return;
}
if (!validatePredefinedFormat(config, name, node, originalName, modifiers)) {
// fail
return;
}
// it's valid for this config, so we don't need to check any more configs
return;
}
};
// centralizes the logic for formatting the report data
function formatReportData({ affixes, count, custom, formats, originalName, position, processedName, }) {
return {
affixes: affixes?.join(', '),
count,
formats: formats?.map(f => enums_1.PredefinedFormats[f]).join(', '),
name: originalName,
position,
processedName,
regex: custom?.regex.toString(),
regexMatch: custom?.match === true
? 'match'
: custom?.match === false
? 'not match'
: null,
type: (0, shared_1.selectorTypeToMessageString)(type),
};
}
/**
* @returns the name with the underscore removed, if it is valid according to the specified underscore option, null otherwise
*/
function validateUnderscore(position, config, name, node, originalName) {
const option = position === 'leading'
? config.leadingUnderscore
: config.trailingUnderscore;
if (!option) {
return name;
}
const hasSingleUnderscore = position === 'leading'
? () => name.startsWith('_')
: () => name.endsWith('_');
const trimSingleUnderscore = position === 'leading'
? () => name.slice(1)
: () => name.slice(0, -1);
const hasDoubleUnderscore = position === 'leading'
? () => name.startsWith('__')
: () => name.endsWith('__');
const trimDoubleUnderscore = position === 'leading'
? () => name.slice(2)
: () => name.slice(0, -2);
switch (option) {
// ALLOW - no conditions as the user doesn't care if it's there or not
case enums_1.UnderscoreOptions.allow: {
if (hasSingleUnderscore()) {
return trimSingleUnderscore();
}
return name;
}
case enums_1.UnderscoreOptions.allowDouble: {
if (hasDoubleUnderscore()) {
return trimDoubleUnderscore();
}
return name;
}
case enums_1.UnderscoreOptions.allowSingleOrDouble: {
if (hasDoubleUnderscore()) {
return trimDoubleUnderscore();
}
if (hasSingleUnderscore()) {
return trimSingleUnderscore();
}
return name;
}
// FORBID
case enums_1.UnderscoreOptions.forbid: {
if (hasSingleUnderscore()) {
context.report({
data: formatReportData({
count: 'one',
originalName,
position,
}),
messageId: 'unexpectedUnderscore',
node,
});
return null;
}
return name;
}
// REQUIRE
case enums_1.UnderscoreOptions.require: {
if (!hasSingleUnderscore()) {
context.report({
data: formatReportData({
count: 'one',
originalName,
position,
}),
messageId: 'missingUnderscore',
node,
});
return null;
}
return trimSingleUnderscore();
}
case enums_1.UnderscoreOptions.requireDouble: {
if (!hasDoubleUnderscore()) {
context.report({
data: formatReportData({
count: 'two',
originalName,
position,
}),
messageId: 'missingUnderscore',
node,
});
return null;
}
return trimDoubleUnderscore();
}
}
}
/**
* @returns the name with the affix removed, if it is valid according to the specified affix option, null otherwise
*/
function validateAffix(position, config, name, node, originalName) {
const affixes = config[position];
if (!affixes || affixes.length === 0) {
return name;
}
for (const affix of affixes) {
const hasAffix = position === 'prefix' ? name.startsWith(affix) : name.endsWith(affix);
const trimAffix = position === 'prefix'
? () => name.slice(affix.length)
: () => name.slice(0, -affix.length);
if (hasAffix) {
// matches, so trim it and return
return trimAffix();
}
}
context.report({
data: formatReportData({
affixes,
originalName,
position,
}),
messageId: 'missingAffix',
node,
});
return null;
}
/**
* @returns true if the name is valid according to the `regex` option, false otherwise
*/
function validateCustom(config, name, node, originalName) {
const custom = config.custom;
if (!custom) {
return true;
}
const result = custom.regex.test(name);
if (custom.match && result) {
return true;
}
if (!custom.match && !result) {
return true;
}
context.report({
data: formatReportData({
custom,
originalName,
}),
messageId: 'satisfyCustom',
node,
});
return false;
}
/**
* @returns true if the name is valid according to the `format` option, false otherwise
*/
function validatePredefinedFormat(config, name, node, originalName, modifiers) {
const formats = config.format;
if (!formats?.length) {
return true;
}
if (!modifiers.has(enums_1.Modifiers.requiresQuotes)) {
for (const format of formats) {
const checker = format_1.PredefinedFormatToCheckFunction[format];
if (checker(name)) {
return true;
}
}
}
context.report({
data: formatReportData({
formats,
originalName,
processedName: name,
}),
messageId: originalName === name
? 'doesNotMatchFormat'
: 'doesNotMatchFormatTrimmed',
node,
});
return false;
}
}
const SelectorsAllowedToHaveTypes = enums_1.Selectors.variable |
enums_1.Selectors.parameter |
enums_1.Selectors.classProperty |
enums_1.Selectors.objectLiteralProperty |
enums_1.Selectors.typeProperty |
enums_1.Selectors.parameterProperty |
enums_1.Selectors.classicAccessor;
function isCorrectType(node, config, context, selector) {
if (config.types == null) {
return true;
}
if ((SelectorsAllowedToHaveTypes & selector) === 0) {
return true;
}
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
const type = services
.getTypeAtLocation(node)
// remove null and undefined from the type, as we don't care about it here
.getNonNullableType();
for (const allowedType of config.types) {
switch (allowedType) {
case enums_1.TypeModifiers.array:
if (isAllTypesMatch(type, t => checker.isArrayType(t) || checker.isTupleType(t))) {
return true;
}
break;
case enums_1.TypeModifiers.function:
if (isAllTypesMatch(type, t => t.getCallSignatures().length > 0)) {
return true;
}
break;
case enums_1.TypeModifiers.boolean:
case enums_1.TypeModifiers.number:
case enums_1.TypeModifiers.string: {
const typeString = checker.typeToString(
// this will resolve things like true => boolean, 'a' => string and 1 => number
checker.getWidenedType(checker.getBaseTypeOfLiteralType(type)));
const allowedTypeString = enums_1.TypeModifiers[allowedType];
if (typeString === allowedTypeString) {
return true;
}
break;
}
}
}
return false;
}
/**
* @returns `true` if the type (or all union types) in the given type return true for the callback
*/
function isAllTypesMatch(type, cb) {
if (type.isUnion()) {
return type.types.every(t => cb(t));
}
return cb(type);
}
@@ -0,0 +1,8 @@
import {
COMMON_UNITS,
twMergeConfig
} from "../chunk-GIXI35A3.mjs";
export {
COMMON_UNITS,
twMergeConfig
};
@@ -0,0 +1 @@
{"name":"json-schema-traverse","version":"0.4.1","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532093044,"integrity":"sha512-/pSzR8ShCNINYioNxjA9lYSDDHciEkjcke0X4Fl1klc1o/LscaIaf5btlDVGufjAm2NPkpjRoDaMCaCwGPBuGw==","mode":420,"size":1008},".eslintrc.yml":{"checkedAt":1794532093044,"integrity":"sha512-pdSopcQ8EM8QuKdndkjm5EcKbbMg18eV18zHRX88+GbftQelWV4m+r7vhqLj51m1z9v3IrYX6xLMMzbmmKM82A==","mode":420,"size":630},".travis.yml":{"checkedAt":1794532093044,"integrity":"sha512-7bCIyre3ClQ9irgHu0UoPXgnvLXj1rDmQBLS/evTil6gJ493jqElShBipMNcOvEkj57wLkcGJlFDH+NMvUJxZQ==","mode":420,"size":108},"index.js":{"checkedAt":1794532093044,"integrity":"sha512-lborl7TOctg+6K0jjHISehxzNhUi40ty0RScV9MtMJaoNlZyHoTLdR9LIywSr+ubv555ry461aBXpUA7kjJ2PQ==","mode":420,"size":2373},"LICENSE":{"checkedAt":1794532093044,"integrity":"sha512-svXYFD9E7Zz2wGLKoKg1acr0tR4HHDCgjS+s1B4V3VERunapCEhPpdY4ocpq+lPQIZ2OxZveGnp4rnWYENc53Q==","mode":420,"size":1074},"README.md":{"checkedAt":1794532093044,"integrity":"sha512-4MOLO201dg5N3DITFR8ZHRdB3LLdpWXsJ6qgDs2K39u4w0+oBU02YZAJCeFWpiyiHNpmqizdL+8isUqy4E9mwA==","mode":420,"size":2694},"spec/.eslintrc.yml":{"checkedAt":1794532093044,"integrity":"sha512-KC8lq1Pd0oOfh+3MDQjrcKRn+xChsYCQIX76ROC8jWvRSnsEkzhQ+YhjGBKUFRPPgZ0JgDwXG9wCjNKsQ2tVjA==","mode":420,"size":91},"spec/fixtures/schema.js":{"checkedAt":1794532093045,"integrity":"sha512-FolHerAW10fB9yHUwAEOMB3/PQJlREWnDp6w1+tJa12qgLXO3Dz4mC64hqAvBGKkY0M10/W/Jm8Yexq89diXGQ==","mode":420,"size":5544},"spec/index.spec.js":{"checkedAt":1794532093045,"integrity":"sha512-QdE8ARE08gPy5xQAiusZS1iAVjxusg/eajv5ks5+az2li0oNwoRw6/9nR5XAqb2Wh2eW/kwiYECmrxgjuoAsQA==","mode":420,"size":6042}}}
@@ -0,0 +1,39 @@
// Georgian [ka]
import dayjs from '../index';
var locale = {
name: 'ka',
weekdays: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),
weekdaysShort: 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
weekdaysMin: 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
months: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'),
monthsShort: 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
weekStart: 1,
formats: {
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY h:mm A',
LLLL: 'dddd, D MMMM YYYY h:mm A'
},
relativeTime: {
future: '%s შემდეგ',
past: '%s წინ',
s: 'წამი',
m: 'წუთი',
mm: '%d წუთი',
h: 'საათი',
hh: '%d საათის',
d: 'დღეს',
dd: '%d დღის განმავლობაში',
M: 'თვის',
MM: '%d თვის',
y: 'წელი',
yy: '%d წლის'
},
ordinal: function ordinal(n) {
return n;
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,546 @@
/**
* @fileoverview A rule to suggest using of const declaration for variables that are never reassigned after declared.
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const FixTracker = require("./utils/fix-tracker");
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const PATTERN_TYPE =
/^(?:.+?Pattern|RestElement|SpreadProperty|ExperimentalRestProperty|Property)$/u;
const DECLARATION_HOST_TYPE =
/^(?:Program|BlockStatement|StaticBlock|SwitchCase)$/u;
const DESTRUCTURING_HOST_TYPE =
/^(?:VariableDeclarator|AssignmentExpression)$/u;
/**
* Checks whether a given node is located at `ForStatement.init` or not.
* @param {ASTNode} node A node to check.
* @returns {boolean} `true` if the node is located at `ForStatement.init`.
*/
function isInitOfForStatement(node) {
return node.parent.type === "ForStatement" && node.parent.init === node;
}
/**
* Checks whether a given Identifier node becomes a VariableDeclaration or not.
* @param {ASTNode} identifier An Identifier node to check.
* @returns {boolean} `true` if the node can become a VariableDeclaration.
*/
function canBecomeVariableDeclaration(identifier) {
let node = identifier.parent;
while (PATTERN_TYPE.test(node.type)) {
node = node.parent;
}
return (
node.type === "VariableDeclarator" ||
(node.type === "AssignmentExpression" &&
node.parent.type === "ExpressionStatement" &&
DECLARATION_HOST_TYPE.test(node.parent.parent.type))
);
}
/**
* Checks if an property or element is from outer scope or function parameters
* in destructing pattern.
* @param {string} name A variable name to be checked.
* @param {eslint-scope.Scope} initScope A scope to start find.
* @returns {boolean} Indicates if the variable is from outer scope or function parameters.
*/
function isOuterVariableInDestructing(name, initScope) {
if (
initScope.through.some(
ref => ref.resolved && ref.resolved.name === name,
)
) {
return true;
}
const variable = astUtils.getVariableByName(initScope, name);
if (variable !== null) {
return variable.defs.some(def => def.type === "Parameter");
}
return false;
}
/**
* Gets the VariableDeclarator/AssignmentExpression node that a given reference
* belongs to.
* This is used to detect a mix of reassigned and never reassigned in a
* destructuring.
* @param {eslint-scope.Reference} reference A reference to get.
* @returns {ASTNode|null} A VariableDeclarator/AssignmentExpression node or
* null.
*/
function getDestructuringHost(reference) {
if (!reference.isWrite()) {
return null;
}
let node = reference.identifier.parent;
while (PATTERN_TYPE.test(node.type)) {
node = node.parent;
}
if (!DESTRUCTURING_HOST_TYPE.test(node.type)) {
return null;
}
return node;
}
/**
* Determines if a destructuring assignment node contains
* any MemberExpression nodes. This is used to determine if a
* variable that is only written once using destructuring can be
* safely converted into a const declaration.
* @param {ASTNode} node The ObjectPattern or ArrayPattern node to check.
* @returns {boolean} True if the destructuring pattern contains
* a MemberExpression, false if not.
*/
function hasMemberExpressionAssignment(node) {
switch (node.type) {
case "ObjectPattern":
return node.properties.some(prop => {
if (prop) {
/*
* Spread elements have an argument property while
* others have a value property. Because different
* parsers use different node types for spread elements,
* we just check if there is an argument property.
*/
return hasMemberExpressionAssignment(
prop.argument || prop.value,
);
}
return false;
});
case "ArrayPattern":
return node.elements.some(element => {
if (element) {
return hasMemberExpressionAssignment(element);
}
return false;
});
case "AssignmentPattern":
return hasMemberExpressionAssignment(node.left);
case "MemberExpression":
return true;
// no default
}
return false;
}
/**
* Gets an identifier node of a given variable.
*
* If the initialization exists or one or more reading references exist before
* the first assignment, the identifier node is the node of the declaration.
* Otherwise, the identifier node is the node of the first assignment.
*
* If the variable should not change to const, this function returns null.
* - If the variable is reassigned.
* - If the variable is never initialized nor assigned.
* - If the variable is initialized in a different scope from the declaration.
* - If the unique assignment of the variable cannot change to a declaration.
* e.g. `if (a) b = 1` / `return (b = 1)`
* - If the variable is declared in the global scope and `eslintUsed` is `true`.
* `/*exported foo` directive comment makes such variables. This rule does not
* warn such variables because this rule cannot distinguish whether the
* exported variables are reassigned or not.
* @param {eslint-scope.Variable} variable A variable to get.
* @param {boolean} ignoreReadBeforeAssign
* The value of `ignoreReadBeforeAssign` option.
* @returns {ASTNode|null}
* An Identifier node if the variable should change to const.
* Otherwise, null.
*/
function getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign) {
if (variable.eslintUsed && variable.scope.type === "global") {
return null;
}
// Finds the unique WriteReference.
let writer = null;
let isReadBeforeInit = false;
const references = variable.references;
for (let i = 0; i < references.length; ++i) {
const reference = references[i];
if (reference.isWrite()) {
const isReassigned =
writer !== null && writer.identifier !== reference.identifier;
if (isReassigned) {
return null;
}
const destructuringHost = getDestructuringHost(reference);
if (
destructuringHost !== null &&
destructuringHost.left !== void 0
) {
const leftNode = destructuringHost.left;
let hasOuterVariables = false,
hasNonIdentifiers = false;
if (leftNode.type === "ObjectPattern") {
const properties = leftNode.properties;
hasOuterVariables = properties
.filter(prop => prop.value)
.map(prop => prop.value.name)
.some(name =>
isOuterVariableInDestructing(name, variable.scope),
);
hasNonIdentifiers = hasMemberExpressionAssignment(leftNode);
} else if (leftNode.type === "ArrayPattern") {
const elements = leftNode.elements;
hasOuterVariables = elements
.map(element => element && element.name)
.some(name =>
isOuterVariableInDestructing(name, variable.scope),
);
hasNonIdentifiers = hasMemberExpressionAssignment(leftNode);
}
if (hasOuterVariables || hasNonIdentifiers) {
return null;
}
}
writer = reference;
} else if (reference.isRead() && writer === null) {
if (ignoreReadBeforeAssign) {
return null;
}
isReadBeforeInit = true;
}
}
/*
* If the assignment is from a different scope, ignore it.
* If the assignment cannot change to a declaration, ignore it.
*/
const shouldBeConst =
writer !== null &&
writer.from === variable.scope &&
canBecomeVariableDeclaration(writer.identifier);
if (!shouldBeConst) {
return null;
}
if (isReadBeforeInit) {
return variable.defs[0].name;
}
return writer.identifier;
}
/**
* Groups by the VariableDeclarator/AssignmentExpression node that each
* reference of given variables belongs to.
* This is used to detect a mix of reassigned and never reassigned in a
* destructuring.
* @param {eslint-scope.Variable[]} variables Variables to group by destructuring.
* @param {boolean} ignoreReadBeforeAssign
* The value of `ignoreReadBeforeAssign` option.
* @returns {Map<ASTNode, ASTNode[]>} Grouped identifier nodes.
*/
function groupByDestructuring(variables, ignoreReadBeforeAssign) {
const identifierMap = new Map();
for (let i = 0; i < variables.length; ++i) {
const variable = variables[i];
const references = variable.references;
const identifier = getIdentifierIfShouldBeConst(
variable,
ignoreReadBeforeAssign,
);
let prevId = null;
for (let j = 0; j < references.length; ++j) {
const reference = references[j];
const id = reference.identifier;
/*
* Avoid counting a reference twice or more for default values of
* destructuring.
*/
if (id === prevId) {
continue;
}
prevId = id;
// Add the identifier node into the destructuring group.
const group = getDestructuringHost(reference);
if (group) {
if (identifierMap.has(group)) {
identifierMap.get(group).push(identifier);
} else {
identifierMap.set(group, [identifier]);
}
}
}
}
return identifierMap;
}
/**
* Finds the nearest parent of node with a given type.
* @param {ASTNode} node The node to search from.
* @param {string} type The type field of the parent node.
* @param {Function} shouldStop A predicate that returns true if the traversal should stop, and false otherwise.
* @returns {ASTNode} The closest ancestor with the specified type; null if no such ancestor exists.
*/
function findUp(node, type, shouldStop) {
if (!node || shouldStop(node)) {
return null;
}
if (node.type === type) {
return node;
}
return findUp(node.parent, type, shouldStop);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [
{
destructuring: "any",
ignoreReadBeforeAssign: false,
},
],
docs: {
description:
"Require `const` declarations for variables that are never reassigned after declared",
recommended: false,
url: "https://eslint.org/docs/latest/rules/prefer-const",
},
fixable: "code",
schema: [
{
type: "object",
properties: {
destructuring: { enum: ["any", "all"] },
ignoreReadBeforeAssign: { type: "boolean" },
},
additionalProperties: false,
},
],
messages: {
useConst: "'{{name}}' is never reassigned. Use 'const' instead.",
},
},
create(context) {
const [{ destructuring, ignoreReadBeforeAssign }] = context.options;
const shouldMatchAnyDestructuredVariable = destructuring !== "all";
const sourceCode = context.sourceCode;
const variables = [];
let reportCount = 0;
let checkedId = null;
let checkedName = "";
/**
* Reports given identifier nodes if all of the nodes should be declared
* as const.
*
* The argument 'nodes' is an array of Identifier nodes.
* This node is the result of 'getIdentifierIfShouldBeConst()', so it's
* nullable. In simple declaration or assignment cases, the length of
* the array is 1. In destructuring cases, the length of the array can
* be 2 or more.
* @param {(eslint-scope.Reference|null)[]} nodes
* References which are grouped by destructuring to report.
* @returns {void}
*/
function checkGroup(nodes) {
const nodesToReport = nodes.filter(Boolean);
if (
nodes.length &&
(shouldMatchAnyDestructuredVariable ||
nodesToReport.length === nodes.length)
) {
const varDeclParent = findUp(
nodes[0],
"VariableDeclaration",
parentNode => parentNode.type.endsWith("Statement"),
);
const isVarDecParentNull = varDeclParent === null;
if (
!isVarDecParentNull &&
varDeclParent.declarations.length > 0
) {
const firstDeclaration = varDeclParent.declarations[0];
if (firstDeclaration.init) {
const firstDecParent = firstDeclaration.init.parent;
/*
* First we check the declaration type and then depending on
* if the type is a "VariableDeclarator" or its an "ObjectPattern"
* we compare the name and id from the first identifier, if the names are different
* we assign the new name, id and reset the count of reportCount and nodeCount in
* order to check each block for the number of reported errors and base our fix
* based on comparing nodes.length and nodesToReport.length.
*/
if (firstDecParent.type === "VariableDeclarator") {
if (firstDecParent.id.name !== checkedName) {
checkedName = firstDecParent.id.name;
reportCount = 0;
}
if (firstDecParent.id.type === "ObjectPattern") {
if (firstDecParent.init.name !== checkedName) {
checkedName = firstDecParent.init.name;
reportCount = 0;
}
}
if (firstDecParent.id !== checkedId) {
checkedId = firstDecParent.id;
reportCount = 0;
}
}
}
}
let shouldFix =
varDeclParent &&
// Don't do a fix unless all variables in the declarations are initialized (or it's in a for-in or for-of loop)
(varDeclParent.parent.type === "ForInStatement" ||
varDeclParent.parent.type === "ForOfStatement" ||
varDeclParent.declarations.every(
declaration => declaration.init,
)) &&
/*
* If options.destructuring is "all", then this warning will not occur unless
* every assignment in the destructuring should be const. In that case, it's safe
* to apply the fix.
*/
nodesToReport.length === nodes.length;
if (
!isVarDecParentNull &&
varDeclParent.declarations &&
varDeclParent.declarations.length !== 1
) {
if (
varDeclParent &&
varDeclParent.declarations &&
varDeclParent.declarations.length >= 1
) {
/*
* Add nodesToReport.length to a count, then comparing the count to the length
* of the declarations in the current block.
*/
reportCount += nodesToReport.length;
let totalDeclarationsCount = 0;
varDeclParent.declarations.forEach(declaration => {
if (declaration.id.type === "ObjectPattern") {
totalDeclarationsCount +=
declaration.id.properties.length;
} else if (declaration.id.type === "ArrayPattern") {
totalDeclarationsCount +=
declaration.id.elements.length;
} else {
totalDeclarationsCount += 1;
}
});
shouldFix =
shouldFix && reportCount === totalDeclarationsCount;
}
}
nodesToReport.forEach(node => {
context.report({
node,
messageId: "useConst",
data: node,
fix: shouldFix
? fixer => {
const letKeywordToken =
sourceCode.getFirstToken(
varDeclParent,
t => t.value === varDeclParent.kind,
);
/**
* Extend the replacement range to the whole declaration,
* in order to prevent other fixes in the same pass
* https://github.com/eslint/eslint/issues/13899
*/
return new FixTracker(fixer, sourceCode)
.retainRange(varDeclParent.range)
.replaceTextRange(
letKeywordToken.range,
"const",
);
}
: null,
});
});
}
}
return {
"Program:exit"() {
groupByDestructuring(variables, ignoreReadBeforeAssign).forEach(
checkGroup,
);
},
VariableDeclaration(node) {
if (node.kind === "let" && !isInitOfForStatement(node)) {
variables.push(...sourceCode.getDeclaredVariables(node));
}
},
};
},
};
@@ -0,0 +1,31 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = consoleFunc;
var _wrapAsync = require('./wrapAsync.js');
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function consoleFunc(name) {
return (fn, ...args) => (0, _wrapAsync2.default)(fn)(...args, (err, ...resultArgs) => {
/* istanbul ignore else */
if (typeof console === 'object') {
/* istanbul ignore else */
if (err) {
/* istanbul ignore else */
if (console.error) {
console.error(err);
}
} else if (console[name]) {
/* istanbul ignore else */
resultArgs.forEach(x => console[name](x));
}
}
});
}
module.exports = exports.default;
@@ -0,0 +1,236 @@
# flat [![Build Status](https://secure.travis-ci.org/hughsk/flat.png?branch=master)](http://travis-ci.org/hughsk/flat)
Take a nested Javascript object and flatten it, or unflatten an object with
delimited keys.
## Installation
``` bash
$ npm install flat
```
## Methods
### flatten(original, options)
Flattens the object - it'll return an object one level deep, regardless of how
nested the original object was:
``` javascript
var flatten = require('flat')
flatten({
key1: {
keyA: 'valueI'
},
key2: {
keyB: 'valueII'
},
key3: { a: { b: { c: 2 } } }
})
// {
// 'key1.keyA': 'valueI',
// 'key2.keyB': 'valueII',
// 'key3.a.b.c': 2
// }
```
### unflatten(original, options)
Flattening is reversible too, you can call `flatten.unflatten()` on an object:
``` javascript
var unflatten = require('flat').unflatten
unflatten({
'three.levels.deep': 42,
'three.levels': {
nested: true
}
})
// {
// three: {
// levels: {
// deep: 42,
// nested: true
// }
// }
// }
```
## Options
### delimiter
Use a custom delimiter for (un)flattening your objects, instead of `.`.
### safe
When enabled, both `flat` and `unflatten` will preserve arrays and their
contents. This is disabled by default.
``` javascript
var flatten = require('flat')
flatten({
this: [
{ contains: 'arrays' },
{ preserving: {
them: 'for you'
}}
]
}, {
safe: true
})
// {
// 'this': [
// { contains: 'arrays' },
// { preserving: {
// them: 'for you'
// }}
// ]
// }
```
### object
When enabled, arrays will not be created automatically when calling unflatten, like so:
``` javascript
unflatten({
'hello.you.0': 'ipsum',
'hello.you.1': 'lorem',
'hello.other.world': 'foo'
}, { object: true })
// hello: {
// you: {
// 0: 'ipsum',
// 1: 'lorem',
// },
// other: { world: 'foo' }
// }
```
### overwrite
When enabled, existing keys in the unflattened object may be overwritten if they cannot hold a newly encountered nested value:
```javascript
unflatten({
'TRAVIS': 'true',
'TRAVIS.DIR': '/home/travis/build/kvz/environmental'
}, { overwrite: true })
// TRAVIS: {
// DIR: '/home/travis/build/kvz/environmental'
// }
```
Without `overwrite` set to `true`, the `TRAVIS` key would already have been set to a string, thus could not accept the nested `DIR` element.
This only makes sense on ordered arrays, and since we're overwriting data, should be used with care.
### maxDepth
Maximum number of nested objects to flatten.
``` javascript
var flatten = require('flat')
flatten({
key1: {
keyA: 'valueI'
},
key2: {
keyB: 'valueII'
},
key3: { a: { b: { c: 2 } } }
}, { maxDepth: 2 })
// {
// 'key1.keyA': 'valueI',
// 'key2.keyB': 'valueII',
// 'key3.a': { b: { c: 2 } }
// }
```
### transformKey
Transform each part of a flat key before and after flattening.
```javascript
var flatten = require('flat')
var unflatten = require('flat').unflatten
flatten({
key1: {
keyA: 'valueI'
},
key2: {
keyB: 'valueII'
},
key3: { a: { b: { c: 2 } } }
}, {
transformKey: function(key){
return '__' + key + '__';
}
})
// {
// '__key1__.__keyA__': 'valueI',
// '__key2__.__keyB__': 'valueII',
// '__key3__.__a__.__b__.__c__': 2
// }
unflatten({
'__key1__.__keyA__': 'valueI',
'__key2__.__keyB__': 'valueII',
'__key3__.__a__.__b__.__c__': 2
}, {
transformKey: function(key){
return key.substring(2, key.length - 2)
}
})
// {
// key1: {
// keyA: 'valueI'
// },
// key2: {
// keyB: 'valueII'
// },
// key3: { a: { b: { c: 2 } } }
// }
```
## Command Line Usage
`flat` is also available as a command line tool. You can run it with
[`npx`](https://ghub.io/npx):
```sh
npx flat foo.json
```
Or install the `flat` command globally:
```sh
npm i -g flat && flat foo.json
```
Accepts a filename as an argument:
```sh
flat foo.json
```
Also accepts JSON on stdin:
```sh
cat foo.json | flat
```
@@ -0,0 +1,8 @@
/**
* Darkens using lightness. This is equivalent to subtracting the lightness
* from the L in HSL.
*
* @param amount The amount to darken, given as a decimal between 0 and 1
*/
declare function darken(color: string, amount: number): string;
export default darken;
@@ -0,0 +1,54 @@
# cloneable-readable
[![Greenkeeper badge](https://badges.greenkeeper.io/mcollina/cloneable-readable.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/mcollina/cloneable-readable.svg?branch=master)](https://travis-ci.org/mcollina/cloneable-readable)
Clone a Readable stream, safely.
```js
'use strict'
var cloneable = require('cloneable-readable')
var fs = require('fs')
var pump = require('pump')
var stream = cloneable(fs.createReadStream('./package.json'))
pump(stream.clone(), fs.createWriteStream('./out1'))
// simulate some asynchronicity
setImmediate(function () {
pump(stream, fs.createWriteStream('./out2'))
})
```
**cloneable-readable** automatically handles `objectMode: true`.
This module comes out of an healthy discussion on the 'right' way to
clone a Readable in https://github.com/gulpjs/vinyl/issues/85
and https://github.com/nodejs/readable-stream/issues/202. This is my take.
**YOU MUST PIPE ALL CLONES TO START THE FLOW**
You can also attach `'data'` and `'readable'` events to them.
## API
### cloneable(stream)
Create a `Cloneable` stream.
A Cloneable has a `clone()` method to create more clones.
All clones must be resumed/piped to start the flow.
### cloneable.isCloneable(stream)
Check if `stream` needs to be wrapped in a `Cloneable` or not.
## Acknowledgements
This project was kindly sponsored by [nearForm](http://nearform.com).
## License
MIT
@@ -0,0 +1,13 @@
'use strict'
function rebuild (gyp, argv, callback) {
gyp.todo.push(
{ name: 'clean', args: [] }
, { name: 'configure', args: argv }
, { name: 'build', args: [] }
)
process.nextTick(callback)
}
module.exports = rebuild
module.exports.usage = 'Runs "clean", "configure" and "build" all at once'
@@ -0,0 +1,178 @@
import type { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types';
import type * as ts from 'typescript';
import type { TSNode } from './ts-nodes';
export interface EstreeToTsNodeTypes {
[AST_NODE_TYPES.AccessorProperty]: ts.PropertyDeclaration;
[AST_NODE_TYPES.ArrayExpression]: ts.ArrayLiteralExpression;
[AST_NODE_TYPES.ArrayPattern]: ts.ArrayBindingPattern | ts.ArrayLiteralExpression;
[AST_NODE_TYPES.ArrowFunctionExpression]: ts.ArrowFunction;
[AST_NODE_TYPES.AssignmentExpression]: ts.BinaryExpression;
[AST_NODE_TYPES.AssignmentPattern]: ts.BinaryExpression | ts.BindingElement | ts.ParameterDeclaration | ts.ShorthandPropertyAssignment;
[AST_NODE_TYPES.AwaitExpression]: ts.AwaitExpression;
[AST_NODE_TYPES.BinaryExpression]: ts.BinaryExpression;
[AST_NODE_TYPES.BlockStatement]: ts.Block;
[AST_NODE_TYPES.BreakStatement]: ts.BreakStatement;
[AST_NODE_TYPES.CallExpression]: ts.CallExpression;
[AST_NODE_TYPES.CatchClause]: ts.CatchClause;
[AST_NODE_TYPES.ChainExpression]: ts.CallExpression | ts.ElementAccessExpression | ts.NonNullExpression | ts.PropertyAccessExpression;
[AST_NODE_TYPES.ClassBody]: ts.ClassDeclaration | ts.ClassExpression;
[AST_NODE_TYPES.ClassDeclaration]: ts.ClassDeclaration;
[AST_NODE_TYPES.ClassExpression]: ts.ClassExpression;
[AST_NODE_TYPES.ConditionalExpression]: ts.ConditionalExpression;
[AST_NODE_TYPES.ContinueStatement]: ts.ContinueStatement;
[AST_NODE_TYPES.DebuggerStatement]: ts.DebuggerStatement;
[AST_NODE_TYPES.Decorator]: ts.Decorator;
[AST_NODE_TYPES.DoWhileStatement]: ts.DoStatement;
[AST_NODE_TYPES.EmptyStatement]: ts.EmptyStatement;
[AST_NODE_TYPES.ExportAllDeclaration]: ts.ExportDeclaration;
[AST_NODE_TYPES.ExportDefaultDeclaration]: ts.ClassDeclaration | ts.ClassExpression | ts.EnumDeclaration | ts.ExportAssignment | ts.FunctionDeclaration | ts.InterfaceDeclaration | ts.ModuleDeclaration | ts.TypeAliasDeclaration | ts.VariableStatement;
[AST_NODE_TYPES.ExportNamedDeclaration]: ts.ClassDeclaration | ts.ClassExpression | ts.EnumDeclaration | ts.ExportDeclaration | ts.FunctionDeclaration | ts.ImportEqualsDeclaration | ts.InterfaceDeclaration | ts.ModuleDeclaration | ts.TypeAliasDeclaration | ts.VariableStatement;
[AST_NODE_TYPES.ExportSpecifier]: ts.ExportSpecifier;
[AST_NODE_TYPES.ExpressionStatement]: ts.ExpressionStatement;
[AST_NODE_TYPES.ForInStatement]: ts.ForInStatement;
[AST_NODE_TYPES.ForOfStatement]: ts.ForOfStatement;
[AST_NODE_TYPES.ForStatement]: ts.ForStatement;
[AST_NODE_TYPES.FunctionDeclaration]: ts.FunctionDeclaration;
[AST_NODE_TYPES.FunctionExpression]: ts.ConstructorDeclaration | ts.FunctionExpression | ts.GetAccessorDeclaration | ts.MethodDeclaration | ts.SetAccessorDeclaration;
[AST_NODE_TYPES.Identifier]: ts.ConstructorDeclaration | ts.Identifier | ts.Token<ts.SyntaxKind.ImportKeyword | ts.SyntaxKind.NewKeyword>;
[AST_NODE_TYPES.IfStatement]: ts.IfStatement;
[AST_NODE_TYPES.PrivateIdentifier]: ts.PrivateIdentifier;
[AST_NODE_TYPES.PropertyDefinition]: ts.PropertyDeclaration;
[AST_NODE_TYPES.ImportAttribute]: 'ImportAttribute' extends keyof typeof ts ? ts.ImportAttribute : ts.AssertEntry;
[AST_NODE_TYPES.ImportDeclaration]: ts.ImportDeclaration;
[AST_NODE_TYPES.ImportDefaultSpecifier]: ts.ImportClause;
[AST_NODE_TYPES.ImportExpression]: ts.CallExpression;
[AST_NODE_TYPES.ImportNamespaceSpecifier]: ts.NamespaceImport;
[AST_NODE_TYPES.ImportSpecifier]: ts.ImportSpecifier;
[AST_NODE_TYPES.JSXAttribute]: ts.JsxAttribute;
[AST_NODE_TYPES.JSXClosingElement]: ts.JsxClosingElement;
[AST_NODE_TYPES.JSXClosingFragment]: ts.JsxClosingFragment;
[AST_NODE_TYPES.JSXElement]: ts.JsxElement | ts.JsxSelfClosingElement;
[AST_NODE_TYPES.JSXEmptyExpression]: ts.JsxExpression;
[AST_NODE_TYPES.JSXExpressionContainer]: ts.JsxExpression;
[AST_NODE_TYPES.JSXFragment]: ts.JsxFragment;
[AST_NODE_TYPES.JSXIdentifier]: ts.Identifier | ts.ThisExpression;
[AST_NODE_TYPES.JSXMemberExpression]: ts.PropertyAccessExpression;
[AST_NODE_TYPES.JSXNamespacedName]: ts.JsxNamespacedName;
[AST_NODE_TYPES.JSXOpeningElement]: ts.JsxOpeningElement | ts.JsxSelfClosingElement;
[AST_NODE_TYPES.JSXOpeningFragment]: ts.JsxOpeningFragment;
[AST_NODE_TYPES.JSXSpreadAttribute]: ts.JsxSpreadAttribute;
[AST_NODE_TYPES.JSXSpreadChild]: ts.JsxExpression;
[AST_NODE_TYPES.JSXText]: ts.JsxText;
[AST_NODE_TYPES.LabeledStatement]: ts.LabeledStatement;
[AST_NODE_TYPES.Literal]: ts.BigIntLiteral | ts.BooleanLiteral | ts.NullLiteral | ts.NumericLiteral | ts.RegularExpressionLiteral | ts.StringLiteral;
[AST_NODE_TYPES.LogicalExpression]: ts.BinaryExpression;
[AST_NODE_TYPES.MemberExpression]: ts.ElementAccessExpression | ts.PropertyAccessExpression;
[AST_NODE_TYPES.MetaProperty]: ts.MetaProperty;
[AST_NODE_TYPES.MethodDefinition]: ts.ConstructorDeclaration | ts.GetAccessorDeclaration | ts.MethodDeclaration | ts.SetAccessorDeclaration;
[AST_NODE_TYPES.NewExpression]: ts.NewExpression;
[AST_NODE_TYPES.ObjectExpression]: ts.ObjectLiteralExpression;
[AST_NODE_TYPES.ObjectPattern]: ts.ObjectBindingPattern | ts.ObjectLiteralExpression;
[AST_NODE_TYPES.Program]: ts.SourceFile;
[AST_NODE_TYPES.Property]: ts.BindingElement | ts.GetAccessorDeclaration | ts.MethodDeclaration | ts.PropertyAssignment | ts.SetAccessorDeclaration | ts.ShorthandPropertyAssignment;
[AST_NODE_TYPES.RestElement]: ts.BindingElement | ts.ParameterDeclaration | ts.SpreadAssignment | ts.SpreadElement;
[AST_NODE_TYPES.ReturnStatement]: ts.ReturnStatement;
[AST_NODE_TYPES.SequenceExpression]: ts.BinaryExpression;
[AST_NODE_TYPES.SpreadElement]: ts.SpreadAssignment | ts.SpreadElement;
[AST_NODE_TYPES.StaticBlock]: ts.ClassStaticBlockDeclaration;
[AST_NODE_TYPES.Super]: ts.SuperExpression;
[AST_NODE_TYPES.SwitchCase]: ts.CaseClause | ts.DefaultClause;
[AST_NODE_TYPES.SwitchStatement]: ts.SwitchStatement;
[AST_NODE_TYPES.TaggedTemplateExpression]: ts.TaggedTemplateExpression;
[AST_NODE_TYPES.TemplateElement]: ts.NoSubstitutionTemplateLiteral | ts.TemplateHead | ts.TemplateMiddle | ts.TemplateTail;
[AST_NODE_TYPES.TemplateLiteral]: ts.NoSubstitutionTemplateLiteral | ts.TemplateExpression;
[AST_NODE_TYPES.ThisExpression]: ts.Identifier | ts.KeywordTypeNode | ts.ThisExpression;
[AST_NODE_TYPES.ThrowStatement]: ts.ThrowStatement;
[AST_NODE_TYPES.TryStatement]: ts.TryStatement;
[AST_NODE_TYPES.TSAbstractAccessorProperty]: ts.PropertyDeclaration;
[AST_NODE_TYPES.TSAbstractMethodDefinition]: ts.ConstructorDeclaration | ts.GetAccessorDeclaration | ts.MethodDeclaration | ts.SetAccessorDeclaration;
[AST_NODE_TYPES.TSAbstractPropertyDefinition]: ts.PropertyDeclaration;
[AST_NODE_TYPES.TSArrayType]: ts.ArrayTypeNode;
[AST_NODE_TYPES.TSAsExpression]: ts.AsExpression;
[AST_NODE_TYPES.TSCallSignatureDeclaration]: ts.CallSignatureDeclaration;
[AST_NODE_TYPES.TSClassImplements]: ts.ExpressionWithTypeArguments;
[AST_NODE_TYPES.TSConditionalType]: ts.ConditionalTypeNode;
[AST_NODE_TYPES.TSConstructorType]: ts.ConstructorTypeNode;
[AST_NODE_TYPES.TSConstructSignatureDeclaration]: ts.ConstructSignatureDeclaration;
[AST_NODE_TYPES.TSDeclareFunction]: ts.FunctionDeclaration;
[AST_NODE_TYPES.TSEnumBody]: ts.EnumDeclaration;
[AST_NODE_TYPES.TSEnumDeclaration]: ts.EnumDeclaration;
[AST_NODE_TYPES.TSEnumMember]: ts.EnumMember;
[AST_NODE_TYPES.TSExportAssignment]: ts.ExportAssignment;
[AST_NODE_TYPES.TSExternalModuleReference]: ts.ExternalModuleReference;
[AST_NODE_TYPES.TSFunctionType]: ts.FunctionTypeNode;
[AST_NODE_TYPES.TSImportEqualsDeclaration]: ts.ImportEqualsDeclaration;
[AST_NODE_TYPES.TSImportType]: ts.ImportTypeNode;
[AST_NODE_TYPES.TSIndexedAccessType]: ts.IndexedAccessTypeNode;
[AST_NODE_TYPES.TSIndexSignature]: ts.IndexSignatureDeclaration;
[AST_NODE_TYPES.TSInferType]: ts.InferTypeNode;
[AST_NODE_TYPES.TSInstantiationExpression]: ts.ExpressionWithTypeArguments;
[AST_NODE_TYPES.TSInterfaceBody]: ts.InterfaceDeclaration;
[AST_NODE_TYPES.TSInterfaceDeclaration]: ts.InterfaceDeclaration;
[AST_NODE_TYPES.TSInterfaceHeritage]: ts.ExpressionWithTypeArguments;
[AST_NODE_TYPES.TSIntersectionType]: ts.IntersectionTypeNode;
[AST_NODE_TYPES.TSLiteralType]: ts.LiteralTypeNode;
[AST_NODE_TYPES.TSMappedType]: ts.MappedTypeNode;
[AST_NODE_TYPES.TSMethodSignature]: ts.GetAccessorDeclaration | ts.MethodSignature | ts.SetAccessorDeclaration;
[AST_NODE_TYPES.TSModuleBlock]: ts.ModuleBlock;
[AST_NODE_TYPES.TSModuleDeclaration]: ts.ModuleDeclaration;
[AST_NODE_TYPES.TSNamedTupleMember]: ts.NamedTupleMember;
[AST_NODE_TYPES.TSNamespaceExportDeclaration]: ts.NamespaceExportDeclaration;
[AST_NODE_TYPES.TSNonNullExpression]: ts.NonNullExpression;
[AST_NODE_TYPES.TSOptionalType]: ts.OptionalTypeNode;
[AST_NODE_TYPES.TSParameterProperty]: ts.ParameterDeclaration;
[AST_NODE_TYPES.TSPropertySignature]: ts.PropertySignature;
[AST_NODE_TYPES.TSQualifiedName]: ts.Identifier | ts.QualifiedName;
[AST_NODE_TYPES.TSRestType]: ts.NamedTupleMember | ts.RestTypeNode;
[AST_NODE_TYPES.TSSatisfiesExpression]: ts.SatisfiesExpression;
[AST_NODE_TYPES.TSTemplateLiteralType]: ts.TemplateLiteralTypeNode;
[AST_NODE_TYPES.TSThisType]: ts.ThisTypeNode;
[AST_NODE_TYPES.TSTupleType]: ts.TupleTypeNode;
[AST_NODE_TYPES.TSTypeAliasDeclaration]: ts.TypeAliasDeclaration;
[AST_NODE_TYPES.TSTypeAnnotation]: undefined;
[AST_NODE_TYPES.TSTypeAssertion]: ts.TypeAssertion;
[AST_NODE_TYPES.TSTypeLiteral]: ts.TypeLiteralNode;
[AST_NODE_TYPES.TSTypeOperator]: ts.TypeOperatorNode;
[AST_NODE_TYPES.TSTypeParameter]: ts.TypeParameterDeclaration;
[AST_NODE_TYPES.TSTypeParameterDeclaration]: undefined;
[AST_NODE_TYPES.TSTypeParameterInstantiation]: ts.CallExpression | ts.ExpressionWithTypeArguments | ts.ImportTypeNode | ts.JsxOpeningElement | ts.JsxSelfClosingElement | ts.NewExpression | ts.TaggedTemplateExpression | ts.TypeQueryNode | ts.TypeReferenceNode;
[AST_NODE_TYPES.TSTypePredicate]: ts.TypePredicateNode;
[AST_NODE_TYPES.TSTypeQuery]: ts.ImportTypeNode | ts.TypeQueryNode;
[AST_NODE_TYPES.TSTypeReference]: ts.TypeReferenceNode;
[AST_NODE_TYPES.TSUnionType]: ts.UnionTypeNode;
[AST_NODE_TYPES.UnaryExpression]: ts.DeleteExpression | ts.PostfixUnaryExpression | ts.PrefixUnaryExpression | ts.TypeOfExpression | ts.VoidExpression;
[AST_NODE_TYPES.UpdateExpression]: ts.PostfixUnaryExpression | ts.PrefixUnaryExpression;
[AST_NODE_TYPES.VariableDeclaration]: ts.VariableDeclarationList | ts.VariableStatement;
[AST_NODE_TYPES.VariableDeclarator]: ts.VariableDeclaration;
[AST_NODE_TYPES.WhileStatement]: ts.WhileStatement;
[AST_NODE_TYPES.WithStatement]: ts.WithStatement;
[AST_NODE_TYPES.YieldExpression]: ts.YieldExpression;
[AST_NODE_TYPES.TSEmptyBodyFunctionExpression]: ts.ConstructorDeclaration | ts.FunctionExpression | ts.GetAccessorDeclaration | ts.MethodDeclaration | ts.SetAccessorDeclaration;
[AST_NODE_TYPES.TSAbstractKeyword]: ts.Token<ts.SyntaxKind.AbstractKeyword>;
[AST_NODE_TYPES.TSAnyKeyword]: ts.KeywordTypeNode;
[AST_NODE_TYPES.TSBigIntKeyword]: ts.KeywordTypeNode;
[AST_NODE_TYPES.TSBooleanKeyword]: ts.KeywordTypeNode;
[AST_NODE_TYPES.TSIntrinsicKeyword]: ts.KeywordTypeNode;
[AST_NODE_TYPES.TSNeverKeyword]: ts.KeywordTypeNode;
[AST_NODE_TYPES.TSNullKeyword]: ts.KeywordTypeNode | ts.NullLiteral;
[AST_NODE_TYPES.TSNumberKeyword]: ts.KeywordTypeNode;
[AST_NODE_TYPES.TSObjectKeyword]: ts.KeywordTypeNode;
[AST_NODE_TYPES.TSStringKeyword]: ts.KeywordTypeNode;
[AST_NODE_TYPES.TSSymbolKeyword]: ts.KeywordTypeNode;
[AST_NODE_TYPES.TSUndefinedKeyword]: ts.KeywordTypeNode;
[AST_NODE_TYPES.TSUnknownKeyword]: ts.KeywordTypeNode;
[AST_NODE_TYPES.TSVoidKeyword]: ts.KeywordTypeNode;
[AST_NODE_TYPES.TSAsyncKeyword]: ts.Token<ts.SyntaxKind.AsyncKeyword>;
[AST_NODE_TYPES.TSDeclareKeyword]: ts.Token<ts.SyntaxKind.DeclareKeyword>;
[AST_NODE_TYPES.TSExportKeyword]: ts.Token<ts.SyntaxKind.ExportKeyword>;
[AST_NODE_TYPES.TSPrivateKeyword]: ts.Token<ts.SyntaxKind.PrivateKeyword>;
[AST_NODE_TYPES.TSProtectedKeyword]: ts.Token<ts.SyntaxKind.ProtectedKeyword>;
[AST_NODE_TYPES.TSPublicKeyword]: ts.Token<ts.SyntaxKind.PublicKeyword>;
[AST_NODE_TYPES.TSReadonlyKeyword]: ts.Token<ts.SyntaxKind.ReadonlyKeyword>;
[AST_NODE_TYPES.TSStaticKeyword]: ts.Token<ts.SyntaxKind.StaticKeyword>;
}
/**
* Maps TSESTree AST Node type to the expected TypeScript AST Node type(s).
* This mapping is based on the internal logic of the parser.
*/
export type TSESTreeToTSNode<T extends TSESTree.Node = TSESTree.Node> = Extract<ts.Token<ts.SyntaxKind.ImportKeyword | ts.SyntaxKind.NewKeyword> | TSNode, EstreeToTsNodeTypes[T['type']]>;
@@ -0,0 +1,15 @@
/**
Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string.
@example
```
import stripAnsi from 'strip-ansi';
stripAnsi('\u001B[4mUnicorn\u001B[0m');
//=> 'Unicorn'
stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
//=> 'Click'
```
*/
export default function stripAnsi(string: string): string;
@@ -0,0 +1 @@
{"name":"picocolors","version":"1.1.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532090567,"integrity":"sha512-siCC877DY+L4WNDjCgZllV/Xo55Q0BQPC4FE7VNRXj6IrShxhiIbUbw19qHfyDM1aaaYJkiWYaNiwtXeLM4MGg==","mode":420,"size":787},"picocolors.browser.js":{"checkedAt":1794532090568,"integrity":"sha512-9zayIH/B9JIa7Wo79fhXioQS3j/titr3ckvRwiNRLDN8brQU1flpVh2COaJj2jzoG0yBdA5/PPC1qpGM8RbZjw==","mode":420,"size":598},"picocolors.js":{"checkedAt":1794532090568,"integrity":"sha512-HJIYuAyIcMWcA1I9jMn9EuRMXIH8a7u2X9uzStLuwNIStE2KJdVTtRIB4wBV7KTiCAtI3tHPML7evv7sIhdLPQ==","mode":420,"size":2663},"package.json":{"checkedAt":1794532090568,"integrity":"sha512-l4xt5cZdDB8O4hMD8ia5St7/BA0+K9njLgL2QuXLalIbmBJaEcFa8i1Jrc1pEhGAYzVbDXjlXXQ0qpHvLvCtBg==","mode":420,"size":552},"README.md":{"checkedAt":1794532090568,"integrity":"sha512-VS5KXHX0TCBfjcv8o7JKnFxmDSxwIXD0j7qgC+UNbtop55QuIk7gtgRya3ljvhFhcgC/Y/iC5DgjSyhI5kjnGg==","mode":420,"size":622},"picocolors.d.ts":{"checkedAt":1794532090568,"integrity":"sha512-xV29Juoidmh2MN6Uk1R8AFQEBuDrfRXXYCqPV4LBeaOyjpo8xoPmVpAtFHrCkQP7rNibMZAzCgPQ8cjCO2sMrQ==","mode":420,"size":138},"types.d.ts":{"checkedAt":1794532090568,"integrity":"sha512-Ko8xkCcJuAVtcZbp0niSNCSHqSIa0MLMg03ft4DJzCSi1pFOR8B5lutyOhQZ8lraBstmsS4tuqA0CTcdLGezJg==","mode":420,"size":1013}}}
@@ -0,0 +1 @@
module.exports={C:{"47":0.02291,"48":0.00573,"52":0.04582,"59":0.00573,"60":0.00573,"68":0.00573,"77":0.01146,"78":0.02291,"88":0.00573,"91":0.00573,"98":0.00573,"102":0.00573,"109":0.00573,"110":0.00573,"111":0.00573,"113":0.01146,"115":0.47542,"118":0.00573,"119":0.11456,"120":0.00573,"121":0.00573,"122":0.01146,"123":0.01146,"124":0.00573,"125":0.01146,"126":0.00573,"127":0.01146,"128":0.42387,"130":0.00573,"131":0.01146,"132":0.01718,"133":2.21674,"134":0.08592,"135":0.06301,"136":0.02864,"137":0.01146,"138":0.01718,"139":0.02291,"140":0.30358,"141":0.0401,"142":0.16038,"143":3.44826,"144":3.15613,"145":0.00573,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 49 50 51 53 54 55 56 57 58 61 62 63 64 65 66 67 69 70 71 72 73 74 75 76 79 80 81 82 83 84 85 86 87 89 90 92 93 94 95 96 97 99 100 101 103 104 105 106 107 108 112 114 116 117 129 146 147 3.5 3.6"},D:{"39":0.01146,"40":0.01146,"41":0.01146,"42":0.01146,"43":0.01146,"44":0.01146,"45":0.01146,"46":0.01146,"47":0.01146,"48":0.01146,"49":0.01718,"50":0.01146,"51":0.01146,"52":0.03437,"53":0.01146,"54":0.01146,"55":0.01146,"56":0.01146,"57":0.01146,"58":0.01146,"59":0.01146,"60":0.01146,"66":0.02291,"74":0.00573,"77":0.00573,"79":0.02291,"80":0.02864,"81":0.01146,"83":0.00573,"84":0.00573,"85":0.00573,"86":0.00573,"87":0.02864,"88":0.01146,"89":0.00573,"90":0.00573,"91":0.05728,"93":0.00573,"94":0.01146,"95":0.00573,"97":0.06301,"98":0.00573,"99":0.00573,"102":0.03437,"103":0.04582,"104":0.03437,"106":0.00573,"107":0.01146,"108":0.06301,"109":0.40669,"110":0.01146,"111":0.01146,"112":0.00573,"113":0.00573,"114":0.02291,"115":0.04582,"116":0.1031,"117":0.02291,"118":0.08019,"119":0.0401,"120":0.09165,"121":0.01718,"122":0.08019,"123":0.02864,"124":0.14893,"125":0.40096,"126":1.30026,"127":0.03437,"128":0.04582,"129":0.02864,"130":0.25203,"131":1.0024,"132":0.09165,"133":0.06874,"134":0.10883,"135":0.09165,"136":0.14893,"137":0.12029,"138":0.41814,"139":0.67018,"140":6.19197,"141":11.98298,"142":0.3265,"143":0.00573,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 61 62 63 64 65 67 68 69 70 71 72 73 75 76 78 92 96 100 101 105 144 145"},F:{"46":0.00573,"91":0.02291,"92":0.06874,"95":0.0401,"114":0.01146,"117":0.00573,"119":0.00573,"120":0.27494,"121":0.49261,"122":3.66592,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 118 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6","12.1":0.01146},B:{"17":0.00573,"92":0.00573,"96":0.00573,"109":0.08592,"114":0.00573,"119":0.00573,"120":0.01146,"121":0.02864,"122":0.01718,"124":0.00573,"126":0.00573,"127":0.00573,"128":0.00573,"129":0.00573,"130":0.00573,"131":0.03437,"132":0.01146,"133":0.01146,"134":0.03437,"135":0.01718,"136":0.02291,"137":0.02291,"138":0.05728,"139":0.08019,"140":1.45491,"141":6.58147,"142":0.01146,_:"12 13 14 15 16 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 123 125"},E:{"14":0.00573,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 26.2","11.1":0.00573,"12.1":0.00573,"13.1":0.02291,"14.1":0.02864,"15.1":0.00573,"15.2-15.3":0.00573,"15.4":0.00573,"15.5":0.00573,"15.6":0.13747,"16.0":0.02291,"16.1":0.01718,"16.2":0.01146,"16.3":0.02864,"16.4":0.00573,"16.5":0.01718,"16.6":0.20048,"17.0":0.01146,"17.1":0.13174,"17.2":0.01718,"17.3":0.01146,"17.4":0.02291,"17.5":0.06301,"17.6":0.17757,"18.0":0.02291,"18.1":0.0401,"18.2":0.01718,"18.3":0.08019,"18.4":0.0401,"18.5-18.6":0.23485,"26.0":0.92794,"26.1":0.02864},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00133,"5.0-5.1":0,"6.0-6.1":0.0053,"7.0-7.1":0.00398,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01193,"10.0-10.2":0.00133,"10.3":0.02254,"11.0-11.2":0.33416,"11.3-11.4":0.00796,"12.0-12.1":0.00265,"12.2-12.5":0.06498,"13.0-13.1":0,"13.2":0.00663,"13.3":0.00265,"13.4-13.7":0.01061,"14.0-14.4":0.02254,"14.5-14.8":0.02387,"15.0-15.1":0.02254,"15.2-15.3":0.01724,"15.4":0.01989,"15.5":0.02254,"15.6-15.8":0.29438,"16.0":0.03978,"16.1":0.07426,"16.2":0.03845,"16.3":0.06895,"16.4":0.01724,"16.5":0.0305,"16.6-16.7":0.39383,"17.0":0.02785,"17.1":0.04243,"17.2":0.0305,"17.3":0.04508,"17.4":0.07956,"17.5":0.13658,"17.6-17.7":0.34477,"18.0":0.07824,"18.1":0.16178,"18.2":0.08752,"18.3":0.28112,"18.4":0.14454,"18.5-18.6":7.37007,"26.0":0.91098,"26.1":0.03315},P:{"4":0.03159,"20":0.01053,"21":0.03159,"22":0.02106,"23":0.02106,"24":0.02106,"25":0.02106,"26":0.08425,"27":0.08425,"28":3.30664,"29":0.25274,_:"5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 18.0","7.2-7.4":0.01053,"17.0":0.01053,"19.0":0.01053},I:{"0":0.01706,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.Line truncated
@@ -0,0 +1 @@
{"version":3,"file":"Parser.js","sourceRoot":"","sources":["../../src/Parser.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,EAAE,EAAkB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;IACrB,OAAO;IACP,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,UAAU;CACb,CAAC,CAAC;AACH,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5B,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AACrD,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AACtC,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAEtC,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAsB;IAClD,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACnC,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACvB,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACtC,CAAC,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC7C,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACvB,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACpB,CAAC,OAAO,EAAE,QAAQ,CAAC;IACnB,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACpB,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACpB,CAAC,UAAU,EAAE,QAAQ,CAAC;IACtB,CAAC,UAAU,EAAE,QAAQ,CAAC;IACtB,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/B,CAAC,UAAU,EAAE,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC7C,CAAC,IAAI,EAAE,OAAO,CAAC;IACf,CAAC,IAAI,EAAE,OAAO,CAAC;IACf,CAAC,SAAS,EAAE,IAAI,CAAC;IACjB,CAAC,SAAS,EAAE,IAAI,CAAC;IACjB,CAAC,OAAO,EAAE,IAAI,CAAC;IACf,CAAC,YAAY,EAAE,IAAI,CAAC;IACpB,CAAC,SAAS,EAAE,IAAI,CAAC;IACjB,CAAC,KAAK,EAAE,IAAI,CAAC;IACb,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,UAAU,EAAE,IAAI,CAAC;IAClB,CAAC,YAAY,EAAE,IAAI,CAAC;IACpB,CAAC,QAAQ,EAAE,IAAI,CAAC;IAChB,CAAC,QAAQ,EAAE,IAAI,CAAC;IAChB,CAAC,MAAM,EAAE,IAAI,CAAC;IACd,CAAC,QAAQ,EAAE,IAAI,CAAC;IAChB,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,MAAM,EAAE,IAAI,CAAC;IACd,CAAC,KAAK,EAAE,IAAI,CAAC;IACb,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,KAAK,EAAE,IAAI,CAAC;IACb,CAAC,SAAS,EAAE,IAAI,CAAC;IACjB,CAAC,OAAO,EAAE,IAAI,CAAC;IACf,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,IAAI,EAAE,OAAO,CAAC;IACf,CAAC,IAAI,EAAE,OAAO,CAAC;IACf,CAAC,OAAO,EAAE,gBAAgB,CAAC;IAC3B,CAAC,OAAO,EAAE,gBAAgB,CAAC;CAC9B,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IACzB,MAAM;IACN,MAAM;IACN,UAAU;IACV,IAAI;IACJ,KAAK;IACL,SAAS;IACT,OAAO;IACP,OAAO;IACP,IAAI;IACJ,KAAK;IACL,OAAO;IACP,SAAS;IACT,QAAQ;IACR,MAAM;IACN,MAAM;IACN,OAAO;IACP,QAAQ;IACR,OAAO;IACP,KAAK;CACR,CAAC,CAAC;AAEH,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AAExD,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC;IACpC,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,gBAAgB;IAChB,eAAe;IACf,MAAM;IACN,OAAO;CACV,CAAC,CAAC;AA+FH,MAAM,SAAS,GAAG,OAAO,CAAC;AAE1B,MAAM,OAAO,MAAM;IAiCf,YACI,GAA6B,EACZ,UAAyB,EAAE;;QAA3B,YAAO,GAAP,OAAO,CAAoB;QAlChD,yCAAyC;QAClC,eAAU,GAAG,CAAC,CAAC;QACtB,uCAAuC;QAChC,aAAQ,GAAG,CAAC,CAAC;QACpB;;;WAGG;QACK,iBAAY,GAAG,CAAC,CAAC;QAEjB,YAAO,GAAG,EAAE,CAAC;QACb,eAAU,GAAG,EAAE,CAAC;QAChB,gBAAW,GAAG,EAAE,CAAC;QACjB,YAAO,GAAqC,IAAI,CAAC;QACxC,UAAK,GAAa,EAAE,CAAC;QAWrB,YAAO,GAAa,EAAE,CAAC;QAChC,iBAAY,GAAG,CAAC,CAAC;QACzB,kFAAkF;QAC1E,eAAU,GAAG,CAAC,CAAC;QACvB,kFAAkF;QAC1E,UAAK,GAAG,KAAK,CAAC;QAMlB,IAAI,CAAC,GAAG,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,EAAE,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QACtC,IAAI,CAAC,iBAAiB,GAAG,MAAA,OAAO,CAAC,aAAa,mCAAI,IAAI,CAAC,QAAQ,CAAC;QAChE,IAAI,CAAC,uBAAuB;YACxB,MAAA,OAAO,CAAC,uBAAuB,mCAAI,IAAI,CAAC,QAAQ,CAAC;QACrD,IAAI,CAAC,oBAAoB;YACrB,MAAA,OAAO,CAAC,oBAAoB,mCAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;QACnD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAA,OAAO,CAAC,SAAS,mCAAI,SAAS,CAAC,CACjD,IAAI,CAAC,OAAO,EACZ,IAAI,CACP,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,MAAA,MAAA,IAAI,CAAC,GAAG,EAAC,YAAY,mDAAG,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,2BAA2B;IAE3B,gBAAgB;IAChB,MAAM,CAAC,KAAa,EAAE,QAAgB;;QAClC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC5C,IAAI,CAAC,QAAQ,GAAG,QAAQ,GAAG,CAAC,CAAC;QAC7B,MAAA,MAAA,IAAI,CAAC,GAAG,EAAC,MAAM,mDAAG,IAAI,CAAC,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;IAC/B,CAAC;IAED,gBAAgB;IAChB,YAAY,CAAC,EAAU,EAAE,QAAgB;;QACrC,IAAI,CAAC,QAAQ,GAAG,QAAQ,GAAG,CAAC,CAAC;QAC7B,MAAA,MAAA,IAAI,CAAC,GAAG,EAAC,MAAM,mDAAG,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACO,aAAa,CAAC,IAAY;QAChC,OAAO,IAAI,CAAC,QAAQ,IAAI,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,gBAAgB;IAChB,aAAa,CAAC,KAAa,EAAE,QAAgB;QACzC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAE1C,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACzB,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAC9B,CAAC;QAED,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAEO,WAAW,CAAC,IAAY;;QAC5B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QAEpB,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CALine truncated
@@ -0,0 +1 @@
{"name":"functions-have-names","version":"1.2.3","requiresBuild":false,"files":{".editorconfig":{"checkedAt":1794532097242,"integrity":"sha512-gD3iQtgC7ZgFS97pyZqR0FPjMNyRAfat8dipbSL28iiJ6B1MP5dDeDYeEnP5sYMTz8whQIk3E5vltk2kcyJJEQ==","mode":420,"size":286},".eslintrc":{"checkedAt":1794532097243,"integrity":"sha512-DtwYX4YeuzuPnIZABU1O2H00e4l3mXmgnayUqmb3aFU9utX1wZF1YZG4OOPJ5SKeYhohg4ku9NGKt8XhOKjrng==","mode":420,"size":219},".nycrc":{"checkedAt":1794532097243,"integrity":"sha512-2vm1RFz8Ajl/OYrfoCWPJIm3Bpnf7Gyn5bha/lZx/cq+We3uMy9xj15XeP6x4wF3jf/pO7KMHAkU9mllm605xg==","mode":420,"size":139},"LICENSE":{"checkedAt":1794532089199,"integrity":"sha512-d2fjYr50p8QKjqC0qhH5nWv3sgAsKHHicw91kVzLPCZ54cpPIRw8zJk+nn45Y6q/yJ/T/xdxK77zBLuAvFgmVg==","mode":420,"size":1071},"index.js":{"checkedAt":1794532097243,"integrity":"sha512-8WqIvCnEslYY20uVQaFbQLTlwATT2UBb326wPVX4gtzJy7qx5PxOo5rRv6fMrmB/G1Phk6W73j9u9Nid5MZT3Q==","mode":420,"size":774},"test/index.js":{"checkedAt":1794532097243,"integrity":"sha512-B/55dvRtJwrp7kZTYMKhMwh6yOMf9uGrEUYeEzFXooZEK650RCvi+Tw1p9QHCfTuyQbRcfb62ej5KPLF0PvUSg==","mode":420,"size":1958},"package.json":{"checkedAt":1794532097243,"integrity":"sha512-2N6m8yr6gtgQxmLEabmTfxIRMpY0pJ7f99Oz03Od4LnE3R6nLm6gO+zVcScs+P7x0pKiMzjmzNndWhC/OtGq8w==","mode":420,"size":1554},"CHANGELOG.md":{"checkedAt":1794532097243,"integrity":"sha512-IuZia71Bq0BoVwIiK3A87+p4MX6xL5zydSnNf4hyh5XdvEKSgJDzNE9vuKrMSOmji6btjyS951XnrxKZn0Jnsw==","mode":420,"size":8229},"README.md":{"checkedAt":1794532097243,"integrity":"sha512-odJo1c2NQR+tjAAVsxEqb6H6+XQrILGHMWiLBO2Y/ZEMq+D4dry1DnDtfWzepdl/iTIxRTc/tHD+9i2Rr+V6kw==","mode":420,"size":1894},".github/FUNDING.yml":{"checkedAt":1794532097243,"integrity":"sha512-YfsYas5tNfBo7HxGLn6QRUwk1emzfkT+AsVl9yK2eTNl7iv7zwWI0T96rhesP8exiv19HTBKpa6a+KaBhBmsLw==","mode":420,"size":591}}}
@@ -0,0 +1,24 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $BigInt = GetIntrinsic('%BigInt%', true);
var $RangeError = require('es-errors/range');
var $SyntaxError = require('es-errors/syntax');
var $TypeError = require('es-errors/type');
var isInteger = require('math-intrinsics/isInteger');
// https://262.ecma-international.org/11.0/#sec-numbertobigint
module.exports = function NumberToBigInt(number) {
if (typeof number !== 'number') {
throw new $TypeError('Assertion failed: `number` must be a String');
}
if (!isInteger(number)) {
throw new $RangeError('The number ' + number + ' cannot be converted to a BigInt because it is not an integer');
}
if (!$BigInt) {
throw new $SyntaxError('BigInts are not supported in this environment');
}
return $BigInt(number);
};
@@ -0,0 +1,145 @@
/**
* @fileoverview Rule to flag bitwise identifiers
* @author Nicholas C. Zakas
*/
"use strict";
/*
*
* Set of bitwise operators.
*
*/
const BITWISE_OPERATORS = [
"^",
"|",
"&",
"<<",
">>",
">>>",
"^=",
"|=",
"&=",
"<<=",
">>=",
">>>=",
"~",
];
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [
{
allow: [],
int32Hint: false,
},
],
docs: {
description: "Disallow bitwise operators",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-bitwise",
},
schema: [
{
type: "object",
properties: {
allow: {
type: "array",
items: {
enum: BITWISE_OPERATORS,
},
uniqueItems: true,
},
int32Hint: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
unexpected: "Unexpected use of '{{operator}}'.",
},
},
create(context) {
const [{ allow: allowed, int32Hint }] = context.options;
/**
* Reports an unexpected use of a bitwise operator.
* @param {ASTNode} node Node which contains the bitwise operator.
* @returns {void}
*/
function report(node) {
context.report({
node,
messageId: "unexpected",
data: { operator: node.operator },
});
}
/**
* Checks if the given node has a bitwise operator.
* @param {ASTNode} node The node to check.
* @returns {boolean} Whether or not the node has a bitwise operator.
*/
function hasBitwiseOperator(node) {
return BITWISE_OPERATORS.includes(node.operator);
}
/**
* Checks if exceptions were provided, e.g. `{ allow: ['~', '|'] }`.
* @param {ASTNode} node The node to check.
* @returns {boolean} Whether or not the node has a bitwise operator.
*/
function allowedOperator(node) {
return allowed.includes(node.operator);
}
/**
* Checks if the given bitwise operator is used for integer typecasting, i.e. "|0"
* @param {ASTNode} node The node to check.
* @returns {boolean} whether the node is used in integer typecasting.
*/
function isInt32Hint(node) {
return (
int32Hint &&
node.operator === "|" &&
node.right &&
node.right.type === "Literal" &&
node.right.value === 0
);
}
/**
* Report if the given node contains a bitwise operator.
* @param {ASTNode} node The node to check.
* @returns {void}
*/
function checkNodeForBitwiseOperator(node) {
if (
hasBitwiseOperator(node) &&
!allowedOperator(node) &&
!isInt32Hint(node)
) {
report(node);
}
}
return {
AssignmentExpression: checkNodeForBitwiseOperator,
BinaryExpression: checkNodeForBitwiseOperator,
UnaryExpression: checkNodeForBitwiseOperator,
};
},
};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E wC","132":"F A B"},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","1028":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"xC TC","260":"J ZB K D E F A B C L M G 0C 1C","1028":"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"},D:{"1":"0 1 2 3 4 5 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","548":"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","1028":"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"},E:{"1":"QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","2":"2C ZC","548":"J ZB K D E F A B C L M G 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD"},F:{"1":"0 1 2 3 4 5 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 OC","2":"F","548":"B C FD GD HD ID NC uC JD","1028":"6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB"},G:{"1":"QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","16":"ZC","548":"E 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"},H:{"132":"hD"},I:{"1":"I","16":"iD jD","548":"TC J kD lD vC","1028":"mD nD"},J:{"548":"D A"},K:{"1":"H OC","548":"A B C NC uC"},L:{"1":"I"},M:{"1":"MC"},N:{"132":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB aC tD uD vD wD xD QC RC SC yD","1028":"J oD pD qD rD sD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:4,C:"Media Queries: resolution feature",D:true};
@@ -0,0 +1 @@
module.exports={C:{"115":0.17673,"142":0.01537,"143":0.35731,"144":0.19978,"145":0.00768,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 146 147 3.5 3.6"},D:{"40":0.01537,"41":0.00768,"42":0.00768,"43":0.01537,"44":0.00768,"45":0.00768,"47":0.00768,"49":0.01537,"51":0.00768,"54":0.01537,"56":0.00768,"58":0.00768,"73":0.06916,"84":0.00768,"98":0.02689,"99":0.01921,"103":0.00768,"105":0.00768,"109":0.41878,"110":0.04226,"111":0.01537,"114":0.07684,"116":0.02689,"123":0.01537,"125":0.47257,"126":0.07684,"129":0.01921,"130":0.00768,"131":0.14984,"132":0.02689,"133":0.1921,"134":0.01921,"135":0.00768,"136":0.06916,"137":0.05379,"138":1.0796,"139":0.51483,"140":4.59887,"141":7.03854,"142":0.13831,"143":0.00768,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 46 48 50 52 53 55 57 59 60 61 62 63 64 65 66 67 68 69 70 71 72 74 75 76 77 78 79 80 81 83 85 86 87 88 89 90 91 92 93 94 95 96 97 100 101 102 104 106 107 108 112 113 115 117 118 119 120 121 122 124 127 128 144 145"},F:{"90":0.02689,"91":0.00768,"122":0.21899,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.01921,"114":0.04995,"115":0.00768,"119":0.00768,"131":0.01537,"135":0.04226,"136":0.03458,"137":0.04226,"138":0.12294,"139":0.11526,"140":1.61364,"141":6.40077,"142":0.1921,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 116 117 118 120 121 122 123 124 125 126 127 128 129 130 132 133 134"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 15.1 15.2-15.3 15.4 16.0 16.1 16.2 16.5 17.0 17.1 17.2 17.4 18.0 18.2 18.3 26.1 26.2","14.1":0.00768,"15.5":0.01537,"15.6":0.03458,"16.3":0.00768,"16.4":0.00768,"16.6":0.06147,"17.3":0.06147,"17.5":1.98631,"17.6":0.02689,"18.1":0.16521,"18.4":0.03458,"18.5-18.6":0.13831,"26.0":0.02689},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00076,"5.0-5.1":0,"6.0-6.1":0.00305,"7.0-7.1":0.00229,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00686,"10.0-10.2":0.00076,"10.3":0.01296,"11.0-11.2":0.19211,"11.3-11.4":0.00457,"12.0-12.1":0.00152,"12.2-12.5":0.03736,"13.0-13.1":0,"13.2":0.00381,"13.3":0.00152,"13.4-13.7":0.0061,"14.0-14.4":0.01296,"14.5-14.8":0.01372,"15.0-15.1":0.01296,"15.2-15.3":0.00991,"15.4":0.01144,"15.5":0.01296,"15.6-15.8":0.16924,"16.0":0.02287,"16.1":0.04269,"16.2":0.02211,"16.3":0.03964,"16.4":0.00991,"16.5":0.01753,"16.6-16.7":0.22642,"17.0":0.01601,"17.1":0.0244,"17.2":0.01753,"17.3":0.02592,"17.4":0.04574,"17.5":0.07852,"17.6-17.7":0.19821,"18.0":0.04498,"18.1":0.09301,"18.2":0.05032,"18.3":0.16162,"18.4":0.0831,"18.5-18.6":4.2372,"26.0":0.52374,"26.1":0.01906},P:{"20":0.0102,"21":0.07143,"22":0.09184,"23":0.12245,"24":0.39797,"25":2.20412,"26":0.16327,"27":1.29594,"28":3.52046,"29":0.05102,_:"4 5.0-5.4 6.2-6.4 8.2 9.2 10.1 12.0 14.0 15.0 17.0 18.0","7.2-7.4":0.09184,"11.1-11.2":0.0102,"13.0":0.10204,"16.0":0.0102,"19.0":0.0102},I:{"0":0.0369,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00002},K:{"0":0.37564,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":1.17618},Q:{_:"14.9"},O:{"0":0.00616},H:{"0":0},L:{"0":54.64915}};
@@ -0,0 +1,77 @@
import { OneBotAction } from '../../action/OneBotAction';
import { Static } from '@sinclair/typebox';
declare const PayloadSchema: import("@sinclair/typebox").TObject<{
user_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
start: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString]>;
count: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString]>;
}>;
type PayloadType = Static<typeof PayloadSchema>;
declare const ReturnSchema: import("@sinclair/typebox").TObject<{
uid: import("@sinclair/typebox").TString;
time: import("@sinclair/typebox").TString;
favoriteInfo: import("@sinclair/typebox").TObject<{
userInfos: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>;
total_count: import("@sinclair/typebox").TNumber;
last_time: import("@sinclair/typebox").TNumber;
today_count: import("@sinclair/typebox").TNumber;
}>;
voteInfo: import("@sinclair/typebox").TObject<{
total_count: import("@sinclair/typebox").TNumber;
new_count: import("@sinclair/typebox").TNumber;
new_nearby_count: import("@sinclair/typebox").TNumber;
last_visit_time: import("@sinclair/typebox").TNumber;
userInfos: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>;
}>;
}>;
type ReturnType = Static<typeof ReturnSchema>;
export declare class GetProfileLike extends OneBotAction<PayloadType, ReturnType> {
actionName: "get_profile_like";
payloadSchema: import("@sinclair/typebox").TObject<{
user_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
start: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString]>;
count: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString]>;
}>;
returnSchema: import("@sinclair/typebox").TObject<{
uid: import("@sinclair/typebox").TString;
time: import("@sinclair/typebox").TString;
favoriteInfo: import("@sinclair/typebox").TObject<{
userInfos: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>;
total_count: import("@sinclair/typebox").TNumber;
last_time: import("@sinclair/typebox").TNumber;
today_count: import("@sinclair/typebox").TNumber;
}>;
voteInfo: import("@sinclair/typebox").TObject<{
total_count: import("@sinclair/typebox").TNumber;
new_count: import("@sinclair/typebox").TNumber;
new_nearby_count: import("@sinclair/typebox").TNumber;
last_visit_time: import("@sinclair/typebox").TNumber;
userInfos: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>;
}>;
}>;
actionSummary: string;
actionTags: string[];
payloadExample: {
user_id: string;
start: number;
count: number;
};
returnExample: {
uid: string;
time: string;
favoriteInfo: {
userInfos: never[];
total_count: number;
last_time: number;
today_count: number;
};
voteInfo: {
total_count: number;
new_count: number;
new_nearby_count: number;
last_visit_time: number;
userInfos: never[];
};
};
_handle(payload: PayloadType): Promise<ReturnType>;
}
export {};
@@ -0,0 +1,4 @@
'use strict';
/** @type {import('./round')} */
module.exports = Math.round;
@@ -0,0 +1,2 @@
import 'reflect-metadata';
//# sourceMappingURL=isPendingClassMetadata.spec.d.ts.map
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more