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

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

No files matched your search

@@ -0,0 +1,14 @@
var defineProperty = require("./defineProperty.js");
function _objectSpread(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? Object(arguments[r]) : {},
o = Object.keys(t);
"function" == typeof Object.getOwnPropertySymbols && o.push.apply(o, Object.getOwnPropertySymbols(t).filter(function (e) {
return Object.getOwnPropertyDescriptor(t, e).enumerable;
})), o.forEach(function (r) {
defineProperty(e, r, t[r]);
});
}
return e;
}
module.exports = _objectSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,7 @@
<svg viewbox="0 0 18 18">
<rect class="ql-stroke" height="4" width="12" x="3" y="7"></rect>
<path class="ql-fill ql-transparent" d="M2,2V16H16V2H2ZM14,14H10V11H8v3H4V4H8V7h2V4h4V14Z"></path>
<line class="ql-stroke" x1="12" x2="12" y1="11" y2="7"></line>
<line class="ql-stroke" x1="9" x2="9" y1="11" y2="7"></line>
<line class="ql-stroke" x1="6" x2="6" y1="11" y2="7"></line>
</svg>

After

Width:  |  Height:  |  Size: 392 B

@@ -0,0 +1,2 @@
export declare function isDeepKey(key: PropertyKey): boolean;
export declare function getValue<T = any>(object: any, path: PropertyKey | readonly PropertyKey[], defaultValue?: any): T;
@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _tslib = require("tslib");
var _react = require("react");
var _utils = require("../utils");
function isAsyncGenerator(val) {
return (0, _utils.isFunction)(val[Symbol.asyncIterator]);
}
function useAsyncEffect(effect, deps) {
(0, _react.useEffect)(function () {
var e = effect();
var cancelled = false;
function execute() {
return (0, _tslib.__awaiter)(this, void 0, void 0, function () {
var result;
return (0, _tslib.__generator)(this, function (_a) {
switch (_a.label) {
case 0:
if (!isAsyncGenerator(e)) return [3 /*break*/, 4];
_a.label = 1;
case 1:
if (!true) return [3 /*break*/, 3];
return [4 /*yield*/, e.next()];
case 2:
result = _a.sent();
if (result.done || cancelled) {
return [3 /*break*/, 3];
}
return [3 /*break*/, 1];
case 3:
return [3 /*break*/, 6];
case 4:
return [4 /*yield*/, e];
case 5:
_a.sent();
_a.label = 6;
case 6:
return [2 /*return*/];
}
});
});
}
execute();
return function () {
cancelled = true;
};
}, deps);
}
var _default = exports["default"] = useAsyncEffect;
@@ -0,0 +1,7 @@
import addDays from "./addDays.mjs";
function subDays(date, days) {
return addDays(date, -days);
}
export {
subDays as default
};
@@ -0,0 +1,2 @@
export { default as now } from './now.js';
export { default } from './date.default.js';
@@ -0,0 +1,7 @@
{
"name": "@rtsao/scc",
"version": "1.1.0",
"repository": "rtsao/scc",
"main": "index.js",
"license": "MIT"
}
@@ -0,0 +1,60 @@
# @isaacs/balanced-match
A hybrid CJS/ESM TypeScript fork of
[balanced-match](http://npm.im/balanced-match).
Match balanced string pairs, like `{` and `}` or `<b>` and `</b>`. Supports regular expressions as well!
[![CI](https://github.com/juliangruber/balanced-match/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/balanced-match/actions/workflows/ci.yml)
[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match)
## Example
Get the first matching pair of braces:
```js
import { balanced } from '@isaacs/balanced-match'
console.log(balanced('{', '}', 'pre{in{nested}}post'))
console.log(balanced('{', '}', 'pre{first}between{second}post'))
console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'))
```
The matches are:
```bash
$ node example.js
{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
{ start: 3,
end: 9,
pre: 'pre',
body: 'first',
post: 'between{second}post' }
{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
```
## API
### const m = balanced(a, b, str)
For the first non-nested matching pair of `a` and `b` in `str`, return an
object with those keys:
- **start** the index of the first match of `a`
- **end** the index of the matching `b`
- **pre** the preamble, `a` and `b` not included
- **body** the match, `a` and `b` not included
- **post** the postscript, `a` and `b` not included
If there's no match, `undefined` will be returned.
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.
### const r = balanced.range(a, b, str)
For the first non-nested matching pair of `a` and `b` in `str`, return an
array with indexes: `[ <a index>, <b index> ]`.
If there's no match, `undefined` will be returned.
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
@@ -0,0 +1,17 @@
var $f5e3df4dc8aa7b54$exports = {};
$f5e3df4dc8aa7b54$exports = {
"deselectedItem": (args)=>`${args.item} nepasirinkta.`,
"longPressToSelect": `Nor\u{117}dami \u{12F}jungti pasirinkimo re\u{17E}im\u{105}, paspauskite ir palaikykite.`,
"select": `Pasirinkti`,
"selectedAll": `Pasirinkti visi elementai.`,
"selectedCount": (args, formatter)=>`${formatter.plural(args.count, {
"=0": `Nepasirinktas n\u{117} vienas elementas`,
one: ()=>`Pasirinktas ${formatter.number(args.count)} elementas`,
other: ()=>`Pasirinkta element\u{173}: ${formatter.number(args.count)}`
})}.`,
"selectedItem": (args)=>`Pasirinkta: ${args.item}.`
};
export {$f5e3df4dc8aa7b54$exports as default};
//# sourceMappingURL=lt-LT.module.js.map
@@ -0,0 +1 @@
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_utc=i()}(this,(function(){"use strict";var t="minute",i=/[+-]\d\d(?::?\d\d)?/g,e=/([+-]|\d\d)/g;return function(s,f,n){var u=f.prototype;n.utc=function(t){var i={date:t,utc:!0,args:arguments};return new f(i)},u.utc=function(i){var e=n(this.toDate(),{locale:this.$L,utc:!0});return i?e.add(this.utcOffset(),t):e},u.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var r=u.parse;u.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),r.call(this,t)};var o=u.init;u.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else o.call(this)};var a=u.utcOffset;u.utcOffset=function(s,f){var n=this.$utils().u;if(n(s))return this.$u?0:n(this.$offset)?a.call(this):this.$offset;if("string"==typeof s&&(s=function(t){void 0===t&&(t="");var s=t.match(i);if(!s)return null;var f=(""+s[0]).match(e)||["-",0,0],n=f[0],u=60*+f[1]+ +f[2];return 0===u?0:"+"===n?u:-u}(s),null===s))return this;var u=Math.abs(s)<=16?60*s:s;if(0===u)return this.utc(f);var r=this.clone();if(f)return r.$offset=u,r.$u=!1,r;var o=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(r=this.local().add(u+o,t)).$offset=u,r.$x.$localOffset=o,r};var h=u.format;u.format=function(t){var i=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,i)},u.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},u.isUTC=function(){return!!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var l=u.toDate;u.toDate=function(t){return"s"===t&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var c=u.diff;u.diff=function(t,i,e){if(t&&this.$u===t.$u)return c.call(this,t,i,e);var s=this.local(),f=n(t).local();return c.call(s,f,i,e)}}}));
@@ -0,0 +1 @@
{"version":3,"file":"no-default-export.js","sourceRoot":"","sources":["../../src/rules/no-default-export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEpE,eAAe,UAAU,CAAC;IACxB,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,QAAQ,EAAE,aAAa;YACvB,WAAW,EAAE,yBAAyB;SACvC;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,WAAW,EAAE,uBAAuB;YACpC,cAAc,EACZ,gFAAgF;SACnF;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QAEZ,IAAI,UAAU,CAAC,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;YACrC,OAAO,EAAE,CAAA;QACX,CAAC;QAED,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAA;QAE9B,OAAO;YACL,wBAAwB,CAAC,IAAI;gBAC3B,MAAM,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;gBACxD,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,SAAS,EAAE,aAAa;oBACxB,GAAG;iBACJ,CAAC,CAAA;YACJ,CAAC;YAED,sBAAsB,CAAC,IAAI;gBACzB,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAC5C,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,SAAS,CACxD,EAAE,CAAC;oBACF,MAAM,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;oBAExD,IAAI,SAAS,CAAC,IAAI,KAAK,wBAAwB,EAAE,CAAC;wBAChD,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI;4BACJ,SAAS,EAAE,aAAa;4BACxB,GAAG;yBACJ,CAAC,CAAA;oBACJ,CAAC;yBAAM,IAAI,SAAS,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;wBAChD,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI;4BACJ,SAAS,EAAE,gBAAgB;4BAC3B,IAAI,EAAE;gCACJ,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC;6BACjC;4BACD,GAAG;yBACJ,CAAC,CAAA;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,64 @@
// Copyright (c) 2011-2016 Ryan Prichard
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
#ifndef WINPTY_ASSERT_H
#define WINPTY_ASSERT_H
#ifdef WINPTY_AGENT_ASSERT
void agentShutdown();
void agentAssertFail(const char *file, int line, const char *cond);
// Calling the standard assert() function does not work in the agent because
// the error message would be printed to the console, and the only way the
// user can see the console is via a working agent! Moreover, the console may
// be frozen, so attempting to write to it would block forever. This custom
// assert function instead sends the message to the DebugServer, then attempts
// to close the console, then quietly exits.
#define ASSERT(cond) \
do { \
if (!(cond)) { \
agentAssertFail(__FILE__, __LINE__, #cond); \
} \
} while(0)
#else
void assertTrace(const char *file, int line, const char *cond);
// In the other targets, log the assert failure to the debugserver, then fail
// using the ordinary assert mechanism. In case assert is compiled out, fail
// using abort. The amount of code inlined is unfortunate, but asserts aren't
// used much outside the agent.
#include <assert.h>
#include <stdlib.h>
#define ASSERT_CONDITION(cond) (false && (cond))
#define ASSERT(cond) \
do { \
if (!(cond)) { \
assertTrace(__FILE__, __LINE__, #cond); \
assert(ASSERT_CONDITION(#cond)); \
abort(); \
} \
} while(0)
#endif
#endif // WINPTY_ASSERT_H
@@ -0,0 +1,5 @@
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
import { type TIntrinsic } from './intrinsic.mjs';
export type TUppercase<T extends TSchema> = TIntrinsic<T, 'Uppercase'>;
/** `[Json]` Intrinsic function to Uppercase LiteralString types */
export declare function Uppercase<T extends TSchema>(T: T, options?: SchemaOptions): TUppercase<T>;
@@ -0,0 +1,100 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { definePatternSearchGenerator } = require("../utils")
const codePointEscapeSearchGenerator = definePatternSearchGenerator(
/\\u\{[0-9a-fA-F]+\}/gu
)
/**
* Number to Hex
* @param {number} num number
* @returns {string} hex string
*/
function toHex(num) {
return `0000${num.toString(16).toUpperCase()}`.substr(-4)
}
module.exports = {
meta: {
docs: {
description: "disallow Unicode code point escape sequences.",
category: "ES2015",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-unicode-codepoint-escapes.html",
},
fixable: "code",
messages: {
forbidden:
"ES2015 Unicode code point escape sequences are forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
const sourceCode = context.getSourceCode()
/**
* find code point escape, and report
* @param {Node} node node
* @returns {void}
*/
function findAndReport(node) {
const text = sourceCode.getText(node)
for (const match of codePointEscapeSearchGenerator(text)) {
const start = match.index
const end = start + match[0].length
const range = [start + node.range[0], end + node.range[0]]
context.report({
node,
loc: {
start: sourceCode.getLocFromIndex(range[0]),
end: sourceCode.getLocFromIndex(range[1]),
},
messageId: "forbidden",
fix(fixer) {
const codePointStr = text.slice(start + 3, end - 1)
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint
let codePoint = Number(`0x${codePointStr}`)
let replacement = null
if (codePoint <= 0xffff) {
// BMP code point
replacement = toHex(codePoint)
} else {
// Astral code point; split in surrogate halves
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
codePoint -= 0x10000
const highSurrogate = (codePoint >> 10) + 0xd800
const lowSurrogate = (codePoint % 0x400) + 0xdc00
replacement = `${toHex(highSurrogate)}\\u${toHex(
lowSurrogate
)}`
}
return fixer.replaceTextRange(
[range[0] + 2, range[1]],
replacement
)
},
})
}
}
return {
Identifier(node) {
findAndReport(node)
},
Literal(node) {
if (typeof node.value === "string") {
findAndReport(node)
}
},
TemplateElement(node) {
findAndReport(node)
},
}
},
}
@@ -0,0 +1,7 @@
'use strict'
module.exports = hashToSegments
function hashToSegments (hash) {
return [hash.slice(0, 2), hash.slice(2, 4), hash.slice(4)]
}
@@ -0,0 +1,40 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var IsCallable = require('es-abstract/2024/IsCallable');
var isObject = require('es-abstract/helpers/isObject');
var whichBuiltinType = require('which-builtin-type');
var $TypeError = require('es-errors/type');
var gPO = require('get-proto');
var $Object = require('es-object-atoms');
module.exports = function getPrototypeOf(O) {
if (!isObject(O)) {
throw new $TypeError('Reflect.getPrototypeOf called on non-object');
}
if (gPO) {
return gPO(O);
}
var type = whichBuiltinType(O);
if (type) {
var intrinsic = GetIntrinsic('%' + type + '.prototype%', true);
if (intrinsic) {
return intrinsic;
}
}
if (IsCallable(O.constructor)) {
return O.constructor.prototype;
}
if (O instanceof Object) {
return $Object.prototype;
}
/*
* Correctly return null for Objects created with `Object.create(null)` (shammed or native) or `{ __proto__: null}`. Also returns null for
* cross-realm objects on browsers that lack `__proto__` support (like IE <11), but that's the best we can do.
*/
return null;
};
@@ -0,0 +1,55 @@
var $085250522aa37816$exports = require("./intlStrings.main.js");
var $98baH$reactariautils = require("@react-aria/utils");
var $98baH$reactariainteractions = require("@react-aria/interactions");
var $98baH$reactariai18n = require("@react-aria/i18n");
var $98baH$react = require("react");
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useHighlightSelectionDescription", () => $340f2fcd0ef9ce8d$export$be42ebdab07ae4c2);
/*
* Copyright 2021 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 $340f2fcd0ef9ce8d$export$be42ebdab07ae4c2(props) {
let stringFormatter = (0, $98baH$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($085250522aa37816$exports))), '@react-aria/grid');
let modality = (0, $98baH$reactariainteractions.useInteractionModality)();
// null is the default if the user hasn't interacted with the table at all yet or the rest of the page
let shouldLongPress = (modality === 'pointer' || modality === 'virtual' || modality == null) && typeof window !== 'undefined' && 'ontouchstart' in window;
let interactionDescription = (0, $98baH$react.useMemo)(()=>{
let selectionMode = props.selectionManager.selectionMode;
let selectionBehavior = props.selectionManager.selectionBehavior;
let message;
if (shouldLongPress) message = stringFormatter.format('longPressToSelect');
return selectionBehavior === 'replace' && selectionMode !== 'none' && props.hasItemActions ? message : undefined;
}, [
props.selectionManager.selectionMode,
props.selectionManager.selectionBehavior,
props.hasItemActions,
stringFormatter,
shouldLongPress
]);
let descriptionProps = (0, $98baH$reactariautils.useDescription)(interactionDescription);
return descriptionProps;
}
//# sourceMappingURL=useHighlightSelectionDescription.main.js.map
@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.toGetWrapperPayload = toGetWrapperPayload;
exports.wrapReference = wrapReference;
var _core = require("@babel/core");
var _normalizeAndLoadMetadata = require("./normalize-and-load-metadata.js");
function toGetWrapperPayload(lazy) {
return (source, metadata) => {
if (lazy === false) return null;
if ((0, _normalizeAndLoadMetadata.isSideEffectImport)(metadata) || metadata.reexportAll) return null;
if (lazy === true) {
return source.includes(".") ? null : "lazy";
}
if (Array.isArray(lazy)) {
return !lazy.includes(source) ? null : "lazy";
}
if (typeof lazy === "function") {
return lazy(source) ? "lazy" : null;
}
throw new Error(`.lazy must be a boolean, string array, or function`);
};
}
function wrapReference(ref, payload) {
if (payload === "lazy") return _core.types.callExpression(ref, []);
return null;
}
//# sourceMappingURL=lazy-modules.js.map
@@ -0,0 +1,40 @@
# array-buffer-byte-length <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
Get the byte length of an ArrayBuffer, even in engines without a `.byteLength` method.
## Example
```js
const assert = require('assert');
const byteLength = require('array-buffer-byte-length');
assert.equal(byteLength([]), NaN, 'an array is not an ArrayBuffer, yields NaN');
assert.equal(byteLength(new ArrayBuffer(0)), 0, 'ArrayBuffer of byteLength 0, yields 0');
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/array-buffer-byte-length
[npm-version-svg]: https://versionbadg.es/inspect-js/array-buffer-byte-length.svg
[deps-svg]: https://david-dm.org/inspect-js/array-buffer-byte-length.svg
[deps-url]: https://david-dm.org/inspect-js/array-buffer-byte-length
[dev-deps-svg]: https://david-dm.org/inspect-js/array-buffer-byte-length/dev-status.svg
[dev-deps-url]: https://david-dm.org/inspect-js/array-buffer-byte-length#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/array-buffer-byte-length.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/array-buffer-byte-length.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/array-buffer-byte-length.svg
[downloads-url]: https://npm-stat.com/charts.html?package=array-buffer-byte-length
[codecov-image]: https://codecov.io/gh/inspect-js/array-buffer-byte-length/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/array-buffer-byte-length/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/array-buffer-byte-length
[actions-url]: https://github.com/inspect-js/array-buffer-byte-length/actions
@@ -0,0 +1,6 @@
import {
LoadingIcon
} from "./chunk-UWX5HA6O.mjs";
export {
LoadingIcon
};
@@ -0,0 +1,350 @@
/**
* @license React
* scheduler.native.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
"production" !== process.env.NODE_ENV &&
(function () {
function performWorkUntilDeadline() {
needsPaint = !1;
if (isMessageLoopRunning) {
var currentTime = getCurrentTime();
startTime = currentTime;
var hasMoreWork = !0;
try {
a: {
isHostCallbackScheduled = !1;
isHostTimeoutScheduled &&
((isHostTimeoutScheduled = !1),
localClearTimeout(taskTimeoutID),
(taskTimeoutID = -1));
isPerformingWork = !0;
var previousPriorityLevel = currentPriorityLevel;
try {
b: {
advanceTimers(currentTime);
for (
currentTask = peek(taskQueue);
null !== currentTask &&
!(
currentTask.expirationTime > currentTime &&
shouldYieldToHost()
);
) {
var callback = currentTask.callback;
if ("function" === typeof callback) {
currentTask.callback = null;
currentPriorityLevel = currentTask.priorityLevel;
var continuationCallback = callback(
currentTask.expirationTime <= currentTime
);
currentTime = getCurrentTime();
if ("function" === typeof continuationCallback) {
currentTask.callback = continuationCallback;
advanceTimers(currentTime);
hasMoreWork = !0;
break b;
}
currentTask === peek(taskQueue) && pop(taskQueue);
advanceTimers(currentTime);
} else pop(taskQueue);
currentTask = peek(taskQueue);
}
if (null !== currentTask) hasMoreWork = !0;
else {
var firstTimer = peek(timerQueue);
null !== firstTimer &&
requestHostTimeout(
handleTimeout,
firstTimer.startTime - currentTime
);
hasMoreWork = !1;
}
}
break a;
} finally {
(currentTask = null),
(currentPriorityLevel = previousPriorityLevel),
(isPerformingWork = !1);
}
hasMoreWork = void 0;
}
} finally {
hasMoreWork
? schedulePerformWorkUntilDeadline()
: (isMessageLoopRunning = !1);
}
}
}
function push(heap, node) {
var index = heap.length;
heap.push(node);
a: for (; 0 < index; ) {
var parentIndex = (index - 1) >>> 1,
parent = heap[parentIndex];
if (0 < compare(parent, node))
(heap[parentIndex] = node),
(heap[index] = parent),
(index = parentIndex);
else break a;
}
}
function peek(heap) {
return 0 === heap.length ? null : heap[0];
}
function pop(heap) {
if (0 === heap.length) return null;
var first = heap[0],
last = heap.pop();
if (last !== first) {
heap[0] = last;
a: for (
var index = 0, length = heap.length, halfLength = length >>> 1;
index < halfLength;
) {
var leftIndex = 2 * (index + 1) - 1,
left = heap[leftIndex],
rightIndex = leftIndex + 1,
right = heap[rightIndex];
if (0 > compare(left, last))
rightIndex < length && 0 > compare(right, left)
? ((heap[index] = right),
(heap[rightIndex] = last),
(index = rightIndex))
: ((heap[index] = left),
(heap[leftIndex] = last),
(index = leftIndex));
else if (rightIndex < length && 0 > compare(right, last))
(heap[index] = right),
(heap[rightIndex] = last),
(index = rightIndex);
else break a;
}
}
return first;
}
function compare(a, b) {
var diff = a.sortIndex - b.sortIndex;
return 0 !== diff ? diff : a.id - b.id;
}
function advanceTimers(currentTime) {
for (var timer = peek(timerQueue); null !== timer; ) {
if (null === timer.callback) pop(timerQueue);
else if (timer.startTime <= currentTime)
pop(timerQueue),
(timer.sortIndex = timer.expirationTime),
push(taskQueue, timer);
else break;
timer = peek(timerQueue);
}
}
function handleTimeout(currentTime) {
isHostTimeoutScheduled = !1;
advanceTimers(currentTime);
if (!isHostCallbackScheduled)
if (null !== peek(taskQueue))
(isHostCallbackScheduled = !0),
isMessageLoopRunning ||
((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline());
else {
var firstTimer = peek(timerQueue);
null !== firstTimer &&
requestHostTimeout(
handleTimeout,
firstTimer.startTime - currentTime
);
}
}
function unstable_scheduleCallback$1(priorityLevel, callback, options) {
var currentTime = getCurrentTime();
"object" === typeof options && null !== options
? ((options = options.delay),
(options =
"number" === typeof options && 0 < options
? currentTime + options
: currentTime))
: (options = currentTime);
switch (priorityLevel) {
case 1:
var timeout = -1;
break;
case 2:
timeout = 250;
break;
case 5:
timeout = 1073741823;
break;
case 4:
timeout = 1e4;
break;
default:
timeout = 5e3;
}
timeout = options + timeout;
priorityLevel = {
id: taskIdCounter++,
callback: callback,
priorityLevel: priorityLevel,
startTime: options,
expirationTime: timeout,
sortIndex: -1
};
options > currentTime
? ((priorityLevel.sortIndex = options),
push(timerQueue, priorityLevel),
null === peek(taskQueue) &&
priorityLevel === peek(timerQueue) &&
(isHostTimeoutScheduled
? (localClearTimeout(taskTimeoutID), (taskTimeoutID = -1))
: (isHostTimeoutScheduled = !0),
requestHostTimeout(handleTimeout, options - currentTime)))
: ((priorityLevel.sortIndex = timeout),
push(taskQueue, priorityLevel),
isHostCallbackScheduled ||
isPerformingWork ||
((isHostCallbackScheduled = !0),
isMessageLoopRunning ||
((isMessageLoopRunning = !0),
schedulePerformWorkUntilDeadline())));
return priorityLevel;
}
function unstable_cancelCallback$1(task) {
task.callback = null;
}
function unstable_getCurrentPriorityLevel$1() {
return currentPriorityLevel;
}
function shouldYieldToHost() {
return needsPaint
? !0
: getCurrentTime() - startTime < frameInterval
? !1
: !0;
}
function requestPaint() {
needsPaint = !0;
}
function requestHostTimeout(callback, ms) {
taskTimeoutID = localSetTimeout(function () {
callback(getCurrentTime());
}, ms);
}
function throwNotImplemented() {
throw Error("Not implemented.");
}
if (
"object" === typeof performance &&
"function" === typeof performance.now
) {
var localPerformance = performance;
var getCurrentTime = function () {
return localPerformance.now();
};
} else {
var localDate = Date,
initialTime = localDate.now();
getCurrentTime = function () {
return localDate.now() - initialTime;
};
}
var taskQueue = [],
timerQueue = [],
taskIdCounter = 1,
currentTask = null,
currentPriorityLevel = 3,
isPerformingWork = !1,
isHostCallbackScheduled = !1,
isHostTimeoutScheduled = !1,
needsPaint = !1,
localSetTimeout = "function" === typeof setTimeout ? setTimeout : null,
localClearTimeout =
"function" === typeof clearTimeout ? clearTimeout : null,
localSetImmediate =
"undefined" !== typeof setImmediate ? setImmediate : null,
isMessageLoopRunning = !1,
taskTimeoutID = -1,
frameInterval = 5,
startTime = -1;
if ("function" === typeof localSetImmediate)
var schedulePerformWorkUntilDeadline = function () {
localSetImmediate(performWorkUntilDeadline);
};
else if ("undefined" !== typeof MessageChannel) {
var channel = new MessageChannel(),
port = channel.port2;
channel.port1.onmessage = performWorkUntilDeadline;
schedulePerformWorkUntilDeadline = function () {
port.postMessage(null);
};
} else
schedulePerformWorkUntilDeadline = function () {
localSetTimeout(performWorkUntilDeadline, 0);
};
channel =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_UserBlockingPriority
: 2;
var unstable_NormalPriority =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_NormalPriority
: 3,
unstable_LowPriority =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_LowPriority
: 4,
unstable_ImmediatePriority =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_ImmediatePriority
: 1,
unstable_scheduleCallback =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_scheduleCallback
: unstable_scheduleCallback$1,
unstable_cancelCallback =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_cancelCallback
: unstable_cancelCallback$1,
unstable_getCurrentPriorityLevel =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_getCurrentPriorityLevel
: unstable_getCurrentPriorityLevel$1,
unstable_shouldYield =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_shouldYield
: shouldYieldToHost,
unstable_requestPaint =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_requestPaint
: requestPaint,
unstable_now =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_now
: getCurrentTime;
exports.unstable_IdlePriority =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_IdlePriority
: 5;
exports.unstable_ImmediatePriority = unstable_ImmediatePriority;
exports.unstable_LowPriority = unstable_LowPriority;
exports.unstable_NormalPriority = unstable_NormalPriority;
exports.unstable_Profiling = null;
exports.unstable_UserBlockingPriority = channel;
exports.unstable_cancelCallback = unstable_cancelCallback;
exports.unstable_forceFrameRate = throwNotImplemented;
exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
exports.unstable_next = throwNotImplemented;
exports.unstable_now = unstable_now;
exports.unstable_requestPaint = unstable_requestPaint;
exports.unstable_runWithPriority = throwNotImplemented;
exports.unstable_scheduleCallback = unstable_scheduleCallback;
exports.unstable_shouldYield = unstable_shouldYield;
exports.unstable_wrapCallback = throwNotImplemented;
})();
@@ -0,0 +1 @@
{"name":"encoding","version":"0.1.13","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532121966,"integrity":"sha512-dy5DwPWMJPzxG/TbW+jj6b+6NF12RrEgdEI8Am22Ep8CtQDFsUO2KQ2x1cnrywgbTJ0EfOo3YH/VxaXt/aTfqQ==","mode":420,"size":935},".prettierrc.js":{"checkedAt":1794532121966,"integrity":"sha512-fdQICA9eYJ/Yx7twKrFvDs4j+K4znHP9IXlVZxW0LSQUaqji6F2JJ9XlfB9nNktmky3UMNcNJCD9SjnkpCdUEQ==","mode":420,"size":156},"lib/encoding.js":{"checkedAt":1794532121967,"integrity":"sha512-EIpicGRElXExQnJCUXVpshl8hoZRr4bVmwnYsMxUHWEb4fztd4dCAI1Xy/hKxf+crxhVdIS8B+4nA5ldnhbStQ==","mode":420,"size":2116},"test/test.js":{"checkedAt":1794532121967,"integrity":"sha512-OxRDD3G800PtQCn+n+P3qx3WJei1EFu/nz/7zbpV3kJdMhVRT4SxvbxG7qutzgi3GQOkJcQhc3d+1//jmCapjA==","mode":420,"size":1600},"package.json":{"checkedAt":1794532121967,"integrity":"sha512-9jeMzbcHBE/h3HhB5bQgE33nYzaEpbynNBmaI/xy8D7lBY955yPOKgY1G0MFaj1WaVWQQxdL8fuGgqW6aicwLg==","mode":420,"size":432},"README.md":{"checkedAt":1794532121967,"integrity":"sha512-Mw51YXzBGSQirkQe8IERuj0OTbf4UNil+LKcWsYiiZbaT0Us45iy41Ck1Imix4rT0auFGGzWLaPkIciU5mnZfQ==","mode":420,"size":1379},".travis.yml":{"checkedAt":1794532121967,"integrity":"sha512-zNGL66u4kZPKnxqWTMV1hi1zxXqK6DkC5F2sSAMitXpVbdz5TKDEpllHtgOi3J8LxjOLn/nqQHadS/94HZhX5Q==","mode":420,"size":505}}}
@@ -0,0 +1,424 @@
export default `flf2a$ 4 4 10 63 13 0 24511 0
Author: Marcin \`stforek\` Glinski
Date: 2003/6/15 20:02:23
Version: 1.0
-------------------------------------------------
* 2003-06-15 Changed: CDPQRSY6%@
Added: $/=\\|_{}
* 2003-06-09 Added: A-Z 0-9 !@%^&*()-+[]()\`'":;~?<>
---------------------------------------------------
This font has been created using JavE's FIGlet font
export assistant. [http://www.jave.de]
$ #
$ #
$ #
$ ##
_ #
/ \\ #
\\_/ #
(_) ##
___ #
|// #
#
##
##
#
#
##
||_ #
/'__/ #
\`._\`. #
\\_||/ ##
_ _ #
[// | #
/ / #
|_//] ##
__, #
(_ /_ #
/\`X\\/ |#
\`\\_/\\| |##
_ #
\`.\\ #
#
##
_ #
/ | #
( ( #
\\_| ##
_ #
| \\ #
) ) #
|_/ ##
#
//\\ #
\`\\//' #
##
_ #
_| |_ #
|_ _| #
|_| ##
#
#
_, #
[_/ ##
#
__ #
|__| #
##
#
#
__ #
\\/ ##
_ #
/ | #
/ / #
|_/ ##
__ #
/ \\ #
| // | #
\\__/ ##
__ #
/ | #
\`7 | #
|_| ##
___ #
(_ | #
/ / #
|___| ##
__ #
|__\`. #
|_ | #
|__.' ##
_ _ #
| || | #
\`._ _| #
|_| ##
___ #
| __| #
\`._\`. #
!__.' ##
___ #
/ __| #
| ,_ \\ #
\\___/ ##
___ #
|_ | #
/ / #
|_/ ##
___ #
/ _ \\ #
) _ ( #
\\___/ ##
___ #
/ _ \\ #
\\__ / #
/_/ ##
_ #
\\| #
\\| #
##
_ #
\\| #
_] #
##
__ #
/ / #
< < #
\`\\_\\ ##
____ #
)___/ #
/___( #
##
__ #
\\ \\ #
> > #
/_/ ##
____ #
\\_ | #
/_( #
(_) ##
_ #
/.-.\\ #
( \\_(l_,#
\`---'\` ##
__ #
/ \\ #
| /\\ | #
|_||_| ##
__ #
| \\ #
| -< #
|__/ ##
___ #
/ _/ #
| \\__ #
\\__/ ##
__ #
| _\\ #
| v | #
|__/ ##
___ #
| __| #
| _| #
|___| ##
___ #
| __| #
| _| #
|_| ##
__ #
/ _] #
| [/\\ #
\\__/ ##
_ _ #
| || | #
| >< | #
|_||_| ##
_ #
| | #
| | #
|_| ##
__ #
|_ \\ #
_\\ | #
/___| ##
_ __ #
| |/ / #
| < #
|_|\\_\\ ##
_ #
| | #
| |_ #
|___| ##
__ __ #
| V | #
| \\_/ | #
|_| |_| ##
__ _ #
| \\| | #
| | ' | #
|_|\\__| ##
__ #
/__\\ #
| \\/ | #
\\__/ ##
___ #
| _,\\ #
| v_/ #
|_| ##
__ #
/__\\ #
| \\/ | #
\\_V_\\ ##
___ #
| _ \\ #
| v / #
|_|_\\ ##
__ #
/' _/ #
\`._\`. #
|___/ ##
_____ #
|_ _| #
| | #
|_| ##
_ _ #
| || | #
| \\/ | #
\\__/ ##
_ _ #
| \\ / | #
\`\\ V /' #
\\_/ ##
_ _ #
| | | | #
| 'V' | #
!_/ \\_! ##
__ __ #
\\ \\_/ / #
> , < #
/_/ \\_\\ ##
__ __#
\\ \`v' /#
\`. .' #
!_! ##
___ #
|_ | #
/ / #
|___| ##
___ #
| __| #
| |_ #
|___| ##
_ #
| \\ #
\\ \\ #
\\_| ##
___ #
|_ | #
_| | #
|___| ##
/\\ #
|/\\| #
#
##
#
#
____ #
|____| ##
\`#
#
#
##
__ #
/ \\ #
| /\\ | #
|_||_| ##
__ #
| \\ #
| -< #
|__/ ##
___ #
/ _/ #
| \\__ #
\\__/ ##
__ #
| _\\ #
| v | #
|__/ ##
___ #
| __| #
| _| #
|___| ##
___ #
| __| #
| _| #
|_| ##
__ #
/ _] #
| [/\\ #
\\__/ ##
_ _ #
| || | #
| >< | #
|_||_| ##
_ #
| | #
| | #
|_| ##
__ #
|_ \\ #
_\\ | #
/___| ##
_ __ #
| |/ / #
| < #
|_|\\_\\ ##
_ #
| | #
| |_ #
|___| ##
__ __ #
| V | #
| \\_/ | #
|_| |_| ##
__ _ #
| \\| | #
| | ' | #
|_|\\__| ##
__ #
/__\\ #
| \\/ | #
\\__/ ##
___ #
| _,\\ #
| v_/ #
|_| ##
__ #
/__\\ #
| \\/ | #
\\_V_\\ ##
___ #
| _ \\ #
| v / #
|_|_\\ ##
__ #
/' _/ #
\`._\`. #
|___/ ##
_____ #
|_ _| #
| | #
|_| ##
_ _ #
| || | #
| \\/ | #
\\__/ ##
_ _ #
| \\ / | #
\`\\ V /' #
\\_/ ##
_ _ #
| | | | #
| 'V' | #
!_/ \\_! ##
__ __ #
\\ \\_/ / #
> , < #
/_/ \\_\\ ##
__ __#
\\ \`v' /#
\`. .' #
!_! ##
___ #
|_ | #
/ / #
|___| ##
_ #
/ | #
{ { #
\\_| ##
_ #
| | #
| | #
|_| ##
_ #
| \\ #
} } #
|_/ ##
_ #
./ \\_/| #
|/\`\\_/ #
##
__ #
/ \\ #
| /\\ | #
|_||_| ##
__ #
/__\\ #
| \\/ | #
\\__/ ##
_ _ #
| || | #
| \\/ | #
\\__/ ##
__ #
/ \\ #
| /\\ | #
|_||_| ##
__ #
/__\\ #
| \\/ | #
\\__/ ##
_ _ #
| || | #
| \\/ | #
\\__/ ##
ß#
#
#
##
`
@@ -0,0 +1,39 @@
// Afrikaans [af]
import dayjs from '../index';
var locale = {
name: 'af',
weekdays: 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),
months: 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),
weekStart: 1,
weekdaysShort: 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
monthsShort: 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
weekdaysMin: 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
ordinal: function ordinal(n) {
return n;
},
formats: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
relativeTime: {
future: 'oor %s',
past: '%s gelede',
s: "'n paar sekondes",
m: "'n minuut",
mm: '%d minute',
h: "'n uur",
hh: '%d ure',
d: "'n dag",
dd: '%d dae',
M: "'n maand",
MM: '%d maande',
y: "'n jaar",
yy: '%d jaar'
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,47 @@
{
"name": "color-string",
"description": "Parser and generator for CSS color strings",
"version": "2.1.2",
"author": "Josh Junon (https://github.com/qix-)",
"contributors": [
"Maxime Thirouin",
"Dyma Ywanov <dfcreative@gmail.com>",
"Heather Arthur <fayearthur@gmail.com>",
"LitoMore (https://github.com/LitoMore)"
],
"repository": "Qix-/color-string",
"type": "module",
"exports": "./index.js",
"types": "./index.d.ts",
"engines": {
"node": ">=18"
},
"scripts": {
"test": "xo && tsd && node test.js"
},
"license": "MIT",
"files": [
"index.js",
"index.d.ts"
],
"xo": {
"rules": {
"no-cond-assign": 0,
"operator-linebreak": 0,
"@typescript-eslint/ban-types": 0
}
},
"dependencies": {
"color-name": "^2.0.0"
},
"devDependencies": {
"tsd": "^0.31.2",
"xo": "^0.60.0"
},
"keywords": [
"color",
"colour",
"rgb",
"css"
]
}
@@ -0,0 +1,326 @@
export default `tlf2a 3 3 8 -1 18 0 0 0
===============================================================================
This is emboss.tlf, or “Emboss”, by Sam Hocevar <sam@hocevar.net>. It was
created on September 30th, 2006.
This font is free software. It comes without any warranty, to the extent
permitted by applicable law. You can redistribute it and/or modify it under
the terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more
details.
Missing characters: # $ % , ; < >
To create emboss2.tlf, use the following command:
$ sed '/@@/,$y/═║╔╗╚╝/═║╔╗╚╝/' < emboss.tlf > emboss2.tlf
This font is part of TOIlet’s official distribution. More information
on the TOIlet website at http://caca.zoy.org/wiki/toilet
===============================================================================
@
@
@@
║!
╝!
╝!!
╝╝"
"
""
@
@
#@@
@
@
$@@
@
@
%@@
╔╝║ &
║═╔╝&
══╝ &&
╝'
'
''
╝(
║ (
╝((
═ )
║)
═ ))
╝ ╝*
═╔╝*
╝ ╝**
║ +
═╔╝+
╝ ++
@
@
,@@
-
═╝-
--
.
.
╝..
╝/
╝ /
╝ //
╔═║0
║╝║0
══╝00
═║ 1
║ 1
══╝11
══║2
╔═╝2
══╝22
══║3
══║3
══╝33
║ ║4
══║4
╝44
╔═╝5
══║5
══╝55
╔═╝6
╔═║6
══╝66
╔═║7
║7
╝77
╔═║8
╔═║8
══╝88
╔═║9
══║9
══╝99
:
╝:
╝::
@
@
;@@
@
@
<@@
=
══╝=
══╝==
@
@
>@@
╔═║?
╝?
╝ ??
╔═║@
║╝╝@
══╝@@
╔═║A
╔═║A
╝ ╝AA
╔═ B
╔═║B
══ BB
╔═╝C
║ C
══╝CC
╔═ D
║ ║D
══ DD
╔═╝E
╔═╝E
══╝EE
╔═╝F
╔═╝F
╝ FF
╔═╝G
║ ║G
══╝GG
║ ║H
╔═║H
╝ ╝HH
╝I
║I
╝II
╝J
║J
═╝JJ
║ ║K
╔╝ K
╝ ╝KK
║ L
║ L
══╝LL
╔╔ M
║║║M
╝╝╝MM
╔═ N
║ ║N
╝ ╝NN
╔═║O
║ ║O
══╝OO
╔═║p
╔═╝P
╝ PP
╔═║ Q
║ ║ Q
═══╝QQ
╔═║R
╔╔╝R
╝ ╝RR
╔═╝S
══║S
══╝SS
═╔╝T
║ T
╝ TT
║ ║U
║ ║U
══╝UU
║ ║V
║ ║V
╝ VV
║║║W
║║║W
══╝WW
║ ║X
╝ X
╝ ╝XX
║ ║Y
═╔╝Y
╝ YY
══║Z
╔╝ Z
══╝ZZ
╔╝[
║ [
═╝[[
╝ \\
╝ \\
╝\\\\
═║]
║]
═╝]]
╝ ^
╝ ╝^
^^
_
_
══╝__
╝ \`
╝\`
\`\`
╔═║a
╔═║a
╝ ╝aa
╔═ b
╔═║b
══ bb
╔═╝c
║ c
══╝cc
╔═ d
║ ║d
══ dd
╔═╝e
╔═╝e
══╝ee
╔═╝f
╔═╝f
╝ ff
╔═╝g
║ ║g
══╝gg
║ ║h
╔═║h
╝ ╝hh
╝i
║i
╝ii
╝j
║j
═╝jj
║ ║k
╔╝ k
╝ ╝kk
║ l
║ l
══╝ll
╔╔ m
║║║m
╝╝╝mm
╔═ n
║ ║n
╝ ╝nn
╔═║o
║ ║o
══╝oo
╔═║p
╔═╝p
╝ pp
╔═║ q
║ ║ q
═══╝qq
╔═║r
╔╔╝r
╝ ╝rr
╔═╝s
══║s
══╝ss
═╔╝t
║ t
╝ tt
║ ║u
║ ║u
══╝uu
║ ║v
║ ║v
╝ vv
║║║w
║║║w
══╝ww
║ ║x
╝ x
╝ ╝xx
║ ║y
═╔╝y
╝ yy
══║z
╔╝ z
══╝zz
╔╝{
═║ {
═╝{{
║|
║|
╝||
═║ }
╔╝}
═╝ }}
╝ ╝~
╝ ╝ ~
~~
╔═║╔═╝Ä
╔═║╔═╝Ä
╝ ╝══╝ÄÄ
╔═║╔═╝Ö
║ ║╔═╝Ö
══╝══╝ÖÖ
║ ║╔═╝Ü
║ ║╔═╝Ü
══╝══╝ÜÜ
╔═║╔═╝ä
╔═║╔═╝ä
╝ ╝══╝ää
╔═║╔═╝ö
║ ║╔═╝ö
══╝══╝öö
║ ║╔═╝ü
║ ║╔═╝ü
══╝══╝üü
╔═╝╔═╝ß
══║══║ß
══╝══╝ßß
`
@@ -0,0 +1,7 @@
import { PushMsgBody } from '../../packet/transformer/proto';
import { PacketMsg } from '../../packet/message/message';
import { PacketMsgTextElement } from '../../packet/message/element';
export declare class PacketMsgBuilder {
protected static failBackText: PacketMsgTextElement;
buildFakeMsg(selfUid: string, element: PacketMsg[]): any[];
}
@@ -0,0 +1,14 @@
Copyright (c) 2016, Contributors
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice
appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getKeys = void 0;
const eslint_visitor_keys_1 = require("eslint-visitor-keys");
exports.getKeys = eslint_visitor_keys_1.getKeys;
@@ -0,0 +1,194 @@
"use client";
import { createMotionComponentWithFeatures } from './create.mjs';
/**
* HTML components
*/
const MotionA = /*@__PURE__*/ createMotionComponentWithFeatures("a");
const MotionAbbr = /*@__PURE__*/ createMotionComponentWithFeatures("abbr");
const MotionAddress = /*@__PURE__*/ createMotionComponentWithFeatures("address");
const MotionArea = /*@__PURE__*/ createMotionComponentWithFeatures("area");
const MotionArticle = /*@__PURE__*/ createMotionComponentWithFeatures("article");
const MotionAside = /*@__PURE__*/ createMotionComponentWithFeatures("aside");
const MotionAudio = /*@__PURE__*/ createMotionComponentWithFeatures("audio");
const MotionB = /*@__PURE__*/ createMotionComponentWithFeatures("b");
const MotionBase = /*@__PURE__*/ createMotionComponentWithFeatures("base");
const MotionBdi = /*@__PURE__*/ createMotionComponentWithFeatures("bdi");
const MotionBdo = /*@__PURE__*/ createMotionComponentWithFeatures("bdo");
const MotionBig = /*@__PURE__*/ createMotionComponentWithFeatures("big");
const MotionBlockquote =
/*@__PURE__*/ createMotionComponentWithFeatures("blockquote");
const MotionBody = /*@__PURE__*/ createMotionComponentWithFeatures("body");
const MotionButton = /*@__PURE__*/ createMotionComponentWithFeatures("button");
const MotionCanvas = /*@__PURE__*/ createMotionComponentWithFeatures("canvas");
const MotionCaption = /*@__PURE__*/ createMotionComponentWithFeatures("caption");
const MotionCite = /*@__PURE__*/ createMotionComponentWithFeatures("cite");
const MotionCode = /*@__PURE__*/ createMotionComponentWithFeatures("code");
const MotionCol = /*@__PURE__*/ createMotionComponentWithFeatures("col");
const MotionColgroup = /*@__PURE__*/ createMotionComponentWithFeatures("colgroup");
const MotionData = /*@__PURE__*/ createMotionComponentWithFeatures("data");
const MotionDatalist = /*@__PURE__*/ createMotionComponentWithFeatures("datalist");
const MotionDd = /*@__PURE__*/ createMotionComponentWithFeatures("dd");
const MotionDel = /*@__PURE__*/ createMotionComponentWithFeatures("del");
const MotionDetails = /*@__PURE__*/ createMotionComponentWithFeatures("details");
const MotionDfn = /*@__PURE__*/ createMotionComponentWithFeatures("dfn");
const MotionDialog = /*@__PURE__*/ createMotionComponentWithFeatures("dialog");
const MotionDiv = /*@__PURE__*/ createMotionComponentWithFeatures("div");
const MotionDl = /*@__PURE__*/ createMotionComponentWithFeatures("dl");
const MotionDt = /*@__PURE__*/ createMotionComponentWithFeatures("dt");
const MotionEm = /*@__PURE__*/ createMotionComponentWithFeatures("em");
const MotionEmbed = /*@__PURE__*/ createMotionComponentWithFeatures("embed");
const MotionFieldset = /*@__PURE__*/ createMotionComponentWithFeatures("fieldset");
const MotionFigcaption =
/*@__PURE__*/ createMotionComponentWithFeatures("figcaption");
const MotionFigure = /*@__PURE__*/ createMotionComponentWithFeatures("figure");
const MotionFooter = /*@__PURE__*/ createMotionComponentWithFeatures("footer");
const MotionForm = /*@__PURE__*/ createMotionComponentWithFeatures("form");
const MotionH1 = /*@__PURE__*/ createMotionComponentWithFeatures("h1");
const MotionH2 = /*@__PURE__*/ createMotionComponentWithFeatures("h2");
const MotionH3 = /*@__PURE__*/ createMotionComponentWithFeatures("h3");
const MotionH4 = /*@__PURE__*/ createMotionComponentWithFeatures("h4");
const MotionH5 = /*@__PURE__*/ createMotionComponentWithFeatures("h5");
const MotionH6 = /*@__PURE__*/ createMotionComponentWithFeatures("h6");
const MotionHead = /*@__PURE__*/ createMotionComponentWithFeatures("head");
const MotionHeader = /*@__PURE__*/ createMotionComponentWithFeatures("header");
const MotionHgroup = /*@__PURE__*/ createMotionComponentWithFeatures("hgroup");
const MotionHr = /*@__PURE__*/ createMotionComponentWithFeatures("hr");
const MotionHtml = /*@__PURE__*/ createMotionComponentWithFeatures("html");
const MotionI = /*@__PURE__*/ createMotionComponentWithFeatures("i");
const MotionIframe = /*@__PURE__*/ createMotionComponentWithFeatures("iframe");
const MotionImg = /*@__PURE__*/ createMotionComponentWithFeatures("img");
const MotionInput = /*@__PURE__*/ createMotionComponentWithFeatures("input");
const MotionIns = /*@__PURE__*/ createMotionComponentWithFeatures("ins");
const MotionKbd = /*@__PURE__*/ createMotionComponentWithFeatures("kbd");
const MotionKeygen = /*@__PURE__*/ createMotionComponentWithFeatures("keygen");
const MotionLabel = /*@__PURE__*/ createMotionComponentWithFeatures("label");
const MotionLegend = /*@__PURE__*/ createMotionComponentWithFeatures("legend");
const MotionLi = /*@__PURE__*/ createMotionComponentWithFeatures("li");
const MotionLink = /*@__PURE__*/ createMotionComponentWithFeatures("link");
const MotionMain = /*@__PURE__*/ createMotionComponentWithFeatures("main");
const MotionMap = /*@__PURE__*/ createMotionComponentWithFeatures("map");
const MotionMark = /*@__PURE__*/ createMotionComponentWithFeatures("mark");
const MotionMenu = /*@__PURE__*/ createMotionComponentWithFeatures("menu");
const MotionMenuitem = /*@__PURE__*/ createMotionComponentWithFeatures("menuitem");
const MotionMeter = /*@__PURE__*/ createMotionComponentWithFeatures("meter");
const MotionNav = /*@__PURE__*/ createMotionComponentWithFeatures("nav");
const MotionObject = /*@__PURE__*/ createMotionComponentWithFeatures("object");
const MotionOl = /*@__PURE__*/ createMotionComponentWithFeatures("ol");
const MotionOptgroup = /*@__PURE__*/ createMotionComponentWithFeatures("optgroup");
const MotionOption = /*@__PURE__*/ createMotionComponentWithFeatures("option");
const MotionOutput = /*@__PURE__*/ createMotionComponentWithFeatures("output");
const MotionP = /*@__PURE__*/ createMotionComponentWithFeatures("p");
const MotionParam = /*@__PURE__*/ createMotionComponentWithFeatures("param");
const MotionPicture = /*@__PURE__*/ createMotionComponentWithFeatures("picture");
const MotionPre = /*@__PURE__*/ createMotionComponentWithFeatures("pre");
const MotionProgress = /*@__PURE__*/ createMotionComponentWithFeatures("progress");
const MotionQ = /*@__PURE__*/ createMotionComponentWithFeatures("q");
const MotionRp = /*@__PURE__*/ createMotionComponentWithFeatures("rp");
const MotionRt = /*@__PURE__*/ createMotionComponentWithFeatures("rt");
const MotionRuby = /*@__PURE__*/ createMotionComponentWithFeatures("ruby");
const MotionS = /*@__PURE__*/ createMotionComponentWithFeatures("s");
const MotionSamp = /*@__PURE__*/ createMotionComponentWithFeatures("samp");
const MotionScript = /*@__PURE__*/ createMotionComponentWithFeatures("script");
const MotionSection = /*@__PURE__*/ createMotionComponentWithFeatures("section");
const MotionSelect = /*@__PURE__*/ createMotionComponentWithFeatures("select");
const MotionSmall = /*@__PURE__*/ createMotionComponentWithFeatures("small");
const MotionSource = /*@__PURE__*/ createMotionComponentWithFeatures("source");
const MotionSpan = /*@__PURE__*/ createMotionComponentWithFeatures("span");
const MotionStrong = /*@__PURE__*/ createMotionComponentWithFeatures("strong");
const MotionStyle = /*@__PURE__*/ createMotionComponentWithFeatures("style");
const MotionSub = /*@__PURE__*/ createMotionComponentWithFeatures("sub");
const MotionSummary = /*@__PURE__*/ createMotionComponentWithFeatures("summary");
const MotionSup = /*@__PURE__*/ createMotionComponentWithFeatures("sup");
const MotionTable = /*@__PURE__*/ createMotionComponentWithFeatures("table");
const MotionTbody = /*@__PURE__*/ createMotionComponentWithFeatures("tbody");
const MotionTd = /*@__PURE__*/ createMotionComponentWithFeatures("td");
const MotionTextarea = /*@__PURE__*/ createMotionComponentWithFeatures("textarea");
const MotionTfoot = /*@__PURE__*/ createMotionComponentWithFeatures("tfoot");
const MotionTh = /*@__PURE__*/ createMotionComponentWithFeatures("th");
const MotionThead = /*@__PURE__*/ createMotionComponentWithFeatures("thead");
const MotionTime = /*@__PURE__*/ createMotionComponentWithFeatures("time");
const MotionTitle = /*@__PURE__*/ createMotionComponentWithFeatures("title");
const MotionTr = /*@__PURE__*/ createMotionComponentWithFeatures("tr");
const MotionTrack = /*@__PURE__*/ createMotionComponentWithFeatures("track");
const MotionU = /*@__PURE__*/ createMotionComponentWithFeatures("u");
const MotionUl = /*@__PURE__*/ createMotionComponentWithFeatures("ul");
const MotionVideo = /*@__PURE__*/ createMotionComponentWithFeatures("video");
const MotionWbr = /*@__PURE__*/ createMotionComponentWithFeatures("wbr");
const MotionWebview = /*@__PURE__*/ createMotionComponentWithFeatures("webview");
/**
* SVG components
*/
const MotionAnimate = /*@__PURE__*/ createMotionComponentWithFeatures("animate");
const MotionCircle = /*@__PURE__*/ createMotionComponentWithFeatures("circle");
const MotionDefs = /*@__PURE__*/ createMotionComponentWithFeatures("defs");
const MotionDesc = /*@__PURE__*/ createMotionComponentWithFeatures("desc");
const MotionEllipse = /*@__PURE__*/ createMotionComponentWithFeatures("ellipse");
const MotionG = /*@__PURE__*/ createMotionComponentWithFeatures("g");
const MotionImage = /*@__PURE__*/ createMotionComponentWithFeatures("image");
const MotionLine = /*@__PURE__*/ createMotionComponentWithFeatures("line");
const MotionFilter = /*@__PURE__*/ createMotionComponentWithFeatures("filter");
const MotionMarker = /*@__PURE__*/ createMotionComponentWithFeatures("marker");
const MotionMask = /*@__PURE__*/ createMotionComponentWithFeatures("mask");
const MotionMetadata = /*@__PURE__*/ createMotionComponentWithFeatures("metadata");
const MotionPath = /*@__PURE__*/ createMotionComponentWithFeatures("path");
const MotionPattern = /*@__PURE__*/ createMotionComponentWithFeatures("pattern");
const MotionPolygon = /*@__PURE__*/ createMotionComponentWithFeatures("polygon");
const MotionPolyline = /*@__PURE__*/ createMotionComponentWithFeatures("polyline");
const MotionRect = /*@__PURE__*/ createMotionComponentWithFeatures("rect");
const MotionStop = /*@__PURE__*/ createMotionComponentWithFeatures("stop");
const MotionSvg = /*@__PURE__*/ createMotionComponentWithFeatures("svg");
const MotionSymbol = /*@__PURE__*/ createMotionComponentWithFeatures("symbol");
const MotionText = /*@__PURE__*/ createMotionComponentWithFeatures("text");
const MotionTspan = /*@__PURE__*/ createMotionComponentWithFeatures("tspan");
const MotionUse = /*@__PURE__*/ createMotionComponentWithFeatures("use");
const MotionView = /*@__PURE__*/ createMotionComponentWithFeatures("view");
const MotionClipPath = /*@__PURE__*/ createMotionComponentWithFeatures("clipPath");
const MotionFeBlend = /*@__PURE__*/ createMotionComponentWithFeatures("feBlend");
const MotionFeColorMatrix =
/*@__PURE__*/ createMotionComponentWithFeatures("feColorMatrix");
const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponentWithFeatures("feComponentTransfer");
const MotionFeComposite =
/*@__PURE__*/ createMotionComponentWithFeatures("feComposite");
const MotionFeConvolveMatrix =
/*@__PURE__*/ createMotionComponentWithFeatures("feConvolveMatrix");
const MotionFeDiffuseLighting =
/*@__PURE__*/ createMotionComponentWithFeatures("feDiffuseLighting");
const MotionFeDisplacementMap =
/*@__PURE__*/ createMotionComponentWithFeatures("feDisplacementMap");
const MotionFeDistantLight =
/*@__PURE__*/ createMotionComponentWithFeatures("feDistantLight");
const MotionFeDropShadow =
/*@__PURE__*/ createMotionComponentWithFeatures("feDropShadow");
const MotionFeFlood = /*@__PURE__*/ createMotionComponentWithFeatures("feFlood");
const MotionFeFuncA = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncA");
const MotionFeFuncB = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncB");
const MotionFeFuncG = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncG");
const MotionFeFuncR = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncR");
const MotionFeGaussianBlur =
/*@__PURE__*/ createMotionComponentWithFeatures("feGaussianBlur");
const MotionFeImage = /*@__PURE__*/ createMotionComponentWithFeatures("feImage");
const MotionFeMerge = /*@__PURE__*/ createMotionComponentWithFeatures("feMerge");
const MotionFeMergeNode =
/*@__PURE__*/ createMotionComponentWithFeatures("feMergeNode");
const MotionFeMorphology =
/*@__PURE__*/ createMotionComponentWithFeatures("feMorphology");
const MotionFeOffset = /*@__PURE__*/ createMotionComponentWithFeatures("feOffset");
const MotionFePointLight =
/*@__PURE__*/ createMotionComponentWithFeatures("fePointLight");
const MotionFeSpecularLighting =
/*@__PURE__*/ createMotionComponentWithFeatures("feSpecularLighting");
const MotionFeSpotLight =
/*@__PURE__*/ createMotionComponentWithFeatures("feSpotLight");
const MotionFeTile = /*@__PURE__*/ createMotionComponentWithFeatures("feTile");
const MotionFeTurbulence =
/*@__PURE__*/ createMotionComponentWithFeatures("feTurbulence");
const MotionForeignObject =
/*@__PURE__*/ createMotionComponentWithFeatures("foreignObject");
const MotionLinearGradient =
/*@__PURE__*/ createMotionComponentWithFeatures("linearGradient");
const MotionRadialGradient =
/*@__PURE__*/ createMotionComponentWithFeatures("radialGradient");
const MotionTextPath = /*@__PURE__*/ createMotionComponentWithFeatures("textPath");
export { MotionA, MotionAbbr, MotionAddress, MotionAnimate, MotionArea, MotionArticle, MotionAside, MotionAudio, MotionB, MotionBase, MotionBdi, MotionBdo, MotionBig, MotionBlockquote, MotionBody, MotionButton, MotionCanvas, MotionCaption, MotionCircle, MotionCite, MotionClipPath, MotionCode, MotionCol, MotionColgroup, MotionData, MotionDatalist, MotionDd, MotionDefs, MotionDel, MotionDesc, MotionDetails, MotionDfn, MotionDialog, MotionDiv, MotionDl, MotionDt, MotionEllipse, MotionEm, MotionEmbed, MotionFeBlend, MotionFeColorMatrix, MotionFeComponentTransfer, MotionFeComposite, MotionFeConvolveMatrix, MotionFeDiffuseLighting, MotionFeDisplacementMap, MotionFeDistantLight, MotionFeDropShadow, MotionFeFlood, MotionFeFuncA, MotionFeFuncB, MotionFeFuncG, MotionFeFuncR, MotionFeGaussianBlur, MotionFeImage, MotionFeMerge, MotionFeMergeNode, MotionFeMorphology, MotionFeOffset, MotionFePointLight, MotionFeSpecularLighting, MotionFeSpotLight, MotionFeTile, MotionFeTurbulence, MotionFieldset, MotionFigcaption, MotionFigure, MotionFilter, MotionFooter, MotionForeignObject, MotionForm, MotionG, MotionH1, MotionH2, MotionH3, MotionH4, MotionH5, MotionH6, MotionHead, MotionHeader, MotionHgroup, MotionHr, MotionHtml, MotionI, MotionIframe, MotionImage, MotionImg, MotionInput, MotionIns, MotionKbd, MotionKeygen, MotionLabel, MotionLegend, MotionLi, MotionLine, MotionLinearGradient, MotionLink, MotionMain, MotionMap, MotionMark, MotionMarker, MotionMask, MotionMenu, MotionMenuitem, MotionMetadata, MotionMeter, MotionNav, MotionObject, MotionOl, MotionOptgroup, MotionOption, MotionOutput, MotionP, MotionParam, MotionPath, MotionPattern, MotionPicture, MotionPolygon, MotionPolyline, MotionPre, MotionProgress, MotionQ, MotionRadialGradient, MotionRect, MotionRp, MotionRt, MotionRuby, MotionS, MotionSamp, MotionScript, MotionSection, MotionSelect, MotionSmall, MotionSource, MotionSpan, MotionStop, MotionStrong, MotionStyle, MotionSub, MotionSummary, MotionSup, MotionSvg, MotionSymbol, MotionTable, MotionTbody, MotionTd, MotionText, MotionTextPath, MotionTextarea, MotionTfoot, MotionTh, MotionThead, MotionTime, MotionTitle, MotionTr, MotionTrack, MotionTspan, MotionU, MotionUl, MotionUse, MotionVideo, MotionView, MotionWbr, MotionWebview };
@@ -0,0 +1,659 @@
/*! *****************************************************************************
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
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/tsserver/server.ts
var import_os2 = __toESM(require("os"));
// src/typescript/typescript.ts
var typescript_exports = {};
__reExport(typescript_exports, require("./typescript.js"));
// src/tsserver/nodeServer.ts
var import_child_process = __toESM(require("child_process"));
var import_fs = __toESM(require("fs"));
var import_net = __toESM(require("net"));
var import_os = __toESM(require("os"));
var import_readline = __toESM(require("readline"));
// src/tsserver/common.ts
function getLogLevel(level) {
if (level) {
const l = level.toLowerCase();
for (const name in typescript_exports.server.LogLevel) {
if (isNaN(+name) && l === name.toLowerCase()) {
return typescript_exports.server.LogLevel[name];
}
}
}
return void 0;
}
// src/tsserver/nodeServer.ts
function parseLoggingEnvironmentString(logEnvStr) {
if (!logEnvStr) {
return {};
}
const logEnv = { logToFile: true };
const args = logEnvStr.split(" ");
const len = args.length - 1;
for (let i = 0; i < len; i += 2) {
const option = args[i];
const { value, extraPartCounter } = getEntireValue(i + 1);
i += extraPartCounter;
if (option && value) {
switch (option) {
case "-file":
logEnv.file = value;
break;
case "-level":
const level = getLogLevel(value);
logEnv.detailLevel = level !== void 0 ? level : typescript_exports.server.LogLevel.normal;
break;
case "-traceToConsole":
logEnv.traceToConsole = value.toLowerCase() === "true";
break;
case "-logToFile":
logEnv.logToFile = value.toLowerCase() === "true";
break;
}
}
}
return logEnv;
function getEntireValue(initialIndex) {
let pathStart = args[initialIndex];
let extraPartCounter = 0;
if (pathStart.charCodeAt(0) === typescript_exports.CharacterCodes.doubleQuote && pathStart.charCodeAt(pathStart.length - 1) !== typescript_exports.CharacterCodes.doubleQuote) {
for (let i = initialIndex + 1; i < args.length; i++) {
pathStart += " ";
pathStart += args[i];
extraPartCounter++;
if (pathStart.charCodeAt(pathStart.length - 1) === typescript_exports.CharacterCodes.doubleQuote) break;
}
}
return { value: (0, typescript_exports.stripQuotes)(pathStart), extraPartCounter };
}
}
function parseServerMode() {
const mode = typescript_exports.server.findArgument("--serverMode");
if (!mode) return void 0;
switch (mode.toLowerCase()) {
case "semantic":
return typescript_exports.LanguageServiceMode.Semantic;
case "partialsemantic":
return typescript_exports.LanguageServiceMode.PartialSemantic;
case "syntactic":
return typescript_exports.LanguageServiceMode.Syntactic;
default:
return mode;
}
}
function initializeNodeSystem() {
const sys4 = typescript_exports.Debug.checkDefined(typescript_exports.sys);
class Logger {
constructor(logFilename, traceToConsole, level) {
this.logFilename = logFilename;
this.traceToConsole = traceToConsole;
this.level = level;
this.seq = 0;
this.inGroup = false;
this.firstInGroup = true;
this.fd = -1;
if (this.logFilename) {
try {
this.fd = import_fs.default.openSync(this.logFilename, "w");
} catch {
}
}
}
static padStringRight(str, padding) {
return (str + padding).slice(0, padding.length);
}
close() {
if (this.fd >= 0) {
import_fs.default.close(this.fd, typescript_exports.noop);
}
}
getLogFileName() {
return this.logFilename;
}
perftrc(s) {
this.msg(s, typescript_exports.server.Msg.Perf);
}
info(s) {
this.msg(s, typescript_exports.server.Msg.Info);
}
err(s) {
this.msg(s, typescript_exports.server.Msg.Err);
}
startGroup() {
this.inGroup = true;
this.firstInGroup = true;
}
endGroup() {
this.inGroup = false;
}
loggingEnabled() {
return !!this.logFilename || this.traceToConsole;
}
hasLevel(level) {
return this.loggingEnabled() && this.level >= level;
}
msg(s, type = typescript_exports.server.Msg.Err) {
if (!this.canWrite()) return;
s = `[${typescript_exports.server.nowString()}] ${s}
`;
if (!this.inGroup || this.firstInGroup) {
const prefix = Logger.padStringRight(type + " " + this.seq.toString(), " ");
s = prefix + s;
}
this.write(s, type);
if (!this.inGroup) {
this.seq++;
}
}
canWrite() {
return this.fd >= 0 || this.traceToConsole;
}
write(s, _type) {
if (this.fd >= 0) {
const buf = Buffer.from(s);
import_fs.default.writeSync(
this.fd,
buf,
0,
buf.length,
/*position*/
null
);
}
if (this.traceToConsole) {
console.warn(s);
}
}
}
const libDirectory = (0, typescript_exports.getDirectoryPath)((0, typescript_exports.normalizePath)(sys4.getExecutingFilePath()));
const useWatchGuard = process.platform === "win32";
const originalWatchDirectory = sys4.watchDirectory.bind(sys4);
const logger = createLogger();
typescript_exports.Debug.loggingHost = {
log(level, s) {
switch (level) {
case typescript_exports.LogLevel.Error:
case typescript_exports.LogLevel.Warning:
return logger.msg(s, typescript_exports.server.Msg.Err);
case typescript_exports.LogLevel.Info:
case typescript_exports.LogLevel.Verbose:
return logger.msg(s, typescript_exports.server.Msg.Info);
}
}
};
const pending = (0, typescript_exports.createQueue)();
let canWrite = true;
if (useWatchGuard) {
const currentDrive = extractWatchDirectoryCacheKey(
sys4.resolvePath(sys4.getCurrentDirectory()),
/*currentDriveKey*/
void 0
);
const statusCache = /* @__PURE__ */ new Map();
sys4.watchDirectory = (path, callback, recursive, options) => {
const cacheKey = extractWatchDirectoryCacheKey(path, currentDrive);
let status = cacheKey && statusCache.get(cacheKey);
if (status === void 0) {
if (logger.hasLevel(typescript_exports.server.LogLevel.verbose)) {
logger.info(`${cacheKey} for path ${path} not found in cache...`);
}
try {
const args = [(0, typescript_exports.combinePaths)(libDirectory, "watchGuard.js"), path];
if (logger.hasLevel(typescript_exports.server.LogLevel.verbose)) {
logger.info(`Starting ${process.execPath} with args:${typescript_exports.server.stringifyIndented(args)}`);
}
import_child_process.default.execFileSync(process.execPath, args, { stdio: "ignore", env: { ELECTRON_RUN_AS_NODE: "1" } });
status = true;
if (logger.hasLevel(typescript_exports.server.LogLevel.verbose)) {
logger.info(`WatchGuard for path ${path} returned: OK`);
}
} catch (e) {
status = false;
if (logger.hasLevel(typescript_exports.server.LogLevel.verbose)) {
logger.info(`WatchGuard for path ${path} returned: ${e.message}`);
}
}
if (cacheKey) {
statusCache.set(cacheKey, status);
}
} else if (logger.hasLevel(typescript_exports.server.LogLevel.verbose)) {
logger.info(`watchDirectory for ${path} uses cached drive information.`);
}
if (status) {
return watchDirectorySwallowingException(path, callback, recursive, options);
} else {
return typescript_exports.noopFileWatcher;
}
};
} else {
sys4.watchDirectory = watchDirectorySwallowingException;
}
sys4.write = (s) => writeMessage(Buffer.from(s, "utf8"));
sys4.setTimeout = setTimeout;
sys4.clearTimeout = clearTimeout;
sys4.setImmediate = setImmediate;
sys4.clearImmediate = clearImmediate;
if (typeof global !== "undefined" && global.gc) {
sys4.gc = () => {
var _a;
return (_a = global.gc) == null ? void 0 : _a.call(global);
};
}
const cancellationToken = createCancellationToken(sys4.args);
const localeStr = typescript_exports.server.findArgument("--locale");
if (localeStr) {
(0, typescript_exports.validateLocaleAndSetLanguage)(localeStr, sys4);
}
const modeOrUnknown = parseServerMode();
let serverMode;
let unknownServerMode;
if (modeOrUnknown !== void 0) {
if (typeof modeOrUnknown === "number") serverMode = modeOrUnknown;
else unknownServerMode = modeOrUnknown;
}
return {
args: process.argv,
logger,
cancellationToken,
serverMode,
unknownServerMode,
startSession: startNodeSession
};
function createLogger() {
const cmdLineLogFileName = typescript_exports.server.findArgument("--logFile");
const cmdLineVerbosity = getLogLevel(typescript_exports.server.findArgument("--logVerbosity"));
const envLogOptions = parseLoggingEnvironmentString(process.env.TSS_LOG);
const unsubstitutedLogFileName = cmdLineLogFileName ? (0, typescript_exports.stripQuotes)(cmdLineLogFileName) : envLogOptions.logToFile ? envLogOptions.file || libDirectory + "/.log" + process.pid.toString() : void 0;
const substitutedLogFileName = unsubstitutedLogFileName ? unsubstitutedLogFileName.replace("PID", process.pid.toString()) : void 0;
const logVerbosity = cmdLineVerbosity || envLogOptions.detailLevel;
return new Logger(substitutedLogFileName, envLogOptions.traceToConsole, logVerbosity);
}
function writeMessage(buf) {
if (!canWrite) {
pending.enqueue(buf);
} else {
canWrite = false;
process.stdout.write(buf, setCanWriteFlagAndWriteMessageIfNecessary);
}
}
function setCanWriteFlagAndWriteMessageIfNecessary() {
canWrite = true;
if (!pending.isEmpty()) {
writeMessage(pending.dequeue());
}
}
function extractWatchDirectoryCacheKey(path, currentDriveKey) {
path = (0, typescript_exports.normalizeSlashes)(path);
if (isUNCPath(path)) {
const firstSlash = path.indexOf(typescript_exports.directorySeparator, 2);
return firstSlash !== -1 ? (0, typescript_exports.toFileNameLowerCase)(path.substring(0, firstSlash)) : path;
}
const rootLength = (0, typescript_exports.getRootLength)(path);
if (rootLength === 0) {
return currentDriveKey;
}
if (path.charCodeAt(1) === typescript_exports.CharacterCodes.colon && path.charCodeAt(2) === typescript_exports.CharacterCodes.slash) {
return (0, typescript_exports.toFileNameLowerCase)(path.charAt(0));
}
if (path.charCodeAt(0) === typescript_exports.CharacterCodes.slash && path.charCodeAt(1) !== typescript_exports.CharacterCodes.slash) {
return currentDriveKey;
}
return void 0;
}
function isUNCPath(s) {
return s.length > 2 && s.charCodeAt(0) === typescript_exports.CharacterCodes.slash && s.charCodeAt(1) === typescript_exports.CharacterCodes.slash;
}
function watchDirectorySwallowingException(path, callback, recursive, options) {
try {
return originalWatchDirectory(path, callback, recursive, options);
} catch (e) {
logger.info(`Exception when creating directory watcher: ${e.message}`);
return typescript_exports.noopFileWatcher;
}
}
}
function parseEventPort(eventPortStr) {
const eventPort = eventPortStr === void 0 ? void 0 : parseInt(eventPortStr);
return eventPort !== void 0 && !isNaN(eventPort) ? eventPort : void 0;
}
function startNodeSession(options, logger, cancellationToken) {
const rl = import_readline.default.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});
const _NodeTypingsInstallerAdapter = class _NodeTypingsInstallerAdapter extends typescript_exports.server.TypingsInstallerAdapter {
constructor(telemetryEnabled2, logger2, host, globalTypingsCacheLocation, typingSafeListLocation2, typesMapLocation2, npmLocation2, validateDefaultNpmLocation2, event) {
super(
telemetryEnabled2,
logger2,
host,
globalTypingsCacheLocation,
event,
_NodeTypingsInstallerAdapter.maxActiveRequestCount
);
this.typingSafeListLocation = typingSafeListLocation2;
this.typesMapLocation = typesMapLocation2;
this.npmLocation = npmLocation2;
this.validateDefaultNpmLocation = validateDefaultNpmLocation2;
}
createInstallerProcess() {
if (this.logger.hasLevel(typescript_exports.server.LogLevel.requestTime)) {
this.logger.info("Binding...");
}
const args = [typescript_exports.server.Arguments.GlobalCacheLocation, this.globalTypingsCacheLocation];
if (this.telemetryEnabled) {
args.push(typescript_exports.server.Arguments.EnableTelemetry);
}
if (this.logger.loggingEnabled() && this.logger.getLogFileName()) {
args.push(typescript_exports.server.Arguments.LogFile, (0, typescript_exports.combinePaths)((0, typescript_exports.getDirectoryPath)((0, typescript_exports.normalizeSlashes)(this.logger.getLogFileName())), `ti-${process.pid}.log`));
}
if (this.typingSafeListLocation) {
args.push(typescript_exports.server.Arguments.TypingSafeListLocation, this.typingSafeListLocation);
}
if (this.typesMapLocation) {
args.push(typescript_exports.server.Arguments.TypesMapLocation, this.typesMapLocation);
}
if (this.npmLocation) {
args.push(typescript_exports.server.Arguments.NpmLocation, this.npmLocation);
}
if (this.validateDefaultNpmLocation) {
args.push(typescript_exports.server.Arguments.ValidateDefaultNpmLocation);
}
const execArgv = [];
for (const arg of process.execArgv) {
const match = /^--((?:debug|inspect)(?:-brk)?)(?:=(\d+))?$/.exec(arg);
if (match) {
const currentPort = match[2] !== void 0 ? +match[2] : match[1].charAt(0) === "d" ? 5858 : 9229;
execArgv.push(`--${match[1]}=${currentPort + 1}`);
break;
}
}
const typingsInstaller = (0, typescript_exports.combinePaths)((0, typescript_exports.getDirectoryPath)(typescript_exports.sys.getExecutingFilePath()), "typingsInstaller.js");
this.installer = import_child_process.default.fork(typingsInstaller, args, { execArgv });
this.installer.on("message", (m) => this.handleMessage(m));
this.host.setImmediate(() => this.event({ pid: this.installer.pid }, "typingsInstallerPid"));
process.on("exit", () => {
this.installer.kill();
});
return this.installer;
}
};
// This number is essentially arbitrary. Processing more than one typings request
// at a time makes sense, but having too many in the pipe results in a hang
// (see https://github.com/nodejs/node/issues/7657).
// It would be preferable to base our limit on the amount of space left in the
// buffer, but we have yet to find a way to retrieve that value.
_NodeTypingsInstallerAdapter.maxActiveRequestCount = 10;
let NodeTypingsInstallerAdapter = _NodeTypingsInstallerAdapter;
class IOSession extends typescript_exports.server.Session {
constructor() {
const event = (body, eventName) => {
this.event(body, eventName);
};
const host = typescript_exports.sys;
const typingsInstaller = disableAutomaticTypingAcquisition ? void 0 : new NodeTypingsInstallerAdapter(telemetryEnabled, logger, host, getGlobalTypingsCacheLocation(), typingSafeListLocation, typesMapLocation, npmLocation, validateDefaultNpmLocation, event);
super({
host,
cancellationToken,
...options,
typingsInstaller,
byteLength: Buffer.byteLength,
hrtime: process.hrtime,
logger,
canUseEvents: true,
typesMapLocation
});
this.eventPort = eventPort;
if (this.canUseEvents && this.eventPort) {
const s = import_net.default.connect({ port: this.eventPort }, () => {
this.eventSocket = s;
if (this.socketEventQueue) {
for (const event2 of this.socketEventQueue) {
this.writeToEventSocket(event2.body, event2.eventName);
}
this.socketEventQueue = void 0;
}
});
}
this.constructed = true;
}
event(body, eventName) {
typescript_exports.Debug.assert(!!this.constructed, "Should only call `IOSession.prototype.event` on an initialized IOSession");
if (this.canUseEvents && this.eventPort) {
if (!this.eventSocket) {
if (this.logger.hasLevel(typescript_exports.server.LogLevel.verbose)) {
this.logger.info(`eventPort: event "${eventName}" queued, but socket not yet initialized`);
}
(this.socketEventQueue || (this.socketEventQueue = [])).push({ body, eventName });
return;
} else {
typescript_exports.Debug.assert(this.socketEventQueue === void 0);
this.writeToEventSocket(body, eventName);
}
} else {
super.event(body, eventName);
}
}
writeToEventSocket(body, eventName) {
this.eventSocket.write(typescript_exports.server.formatMessage(typescript_exports.server.toEvent(eventName, body), this.logger, this.byteLength, this.host.newLine), "utf8");
}
exit() {
var _a;
this.logger.info("Exiting...");
this.projectService.closeLog();
(_a = typescript_exports.tracing) == null ? void 0 : _a.stopTracing();
process.exit(0);
}
listen() {
rl.on("line", (input) => {
const message = input.trim();
this.onMessage(message);
});
rl.on("close", () => {
this.exit();
});
}
}
class IpcIOSession extends IOSession {
writeMessage(msg) {
const verboseLogging = logger.hasLevel(typescript_exports.server.LogLevel.verbose);
if (verboseLogging) {
const json = JSON.stringify(msg);
logger.info(`${msg.type}:${typescript_exports.server.indent(json)}`);
}
process.send(msg);
}
parseMessage(message) {
return message;
}
toStringMessage(message) {
return JSON.stringify(message, void 0, 2);
}
listen() {
process.on("message", (e) => {
this.onMessage(e);
});
process.on("disconnect", () => {
this.exit();
});
}
}
const eventPort = parseEventPort(typescript_exports.server.findArgument("--eventPort"));
const typingSafeListLocation = typescript_exports.server.findArgument(typescript_exports.server.Arguments.TypingSafeListLocation);
const typesMapLocation = typescript_exports.server.findArgument(typescript_exports.server.Arguments.TypesMapLocation) || (0, typescript_exports.combinePaths)((0, typescript_exports.getDirectoryPath)(typescript_exports.sys.getExecutingFilePath()), "typesMap.json");
const npmLocation = typescript_exports.server.findArgument(typescript_exports.server.Arguments.NpmLocation);
const validateDefaultNpmLocation = typescript_exports.server.hasArgument(typescript_exports.server.Arguments.ValidateDefaultNpmLocation);
const disableAutomaticTypingAcquisition = typescript_exports.server.hasArgument("--disableAutomaticTypingAcquisition");
const useNodeIpc = typescript_exports.server.hasArgument("--useNodeIpc");
const telemetryEnabled = typescript_exports.server.hasArgument(typescript_exports.server.Arguments.EnableTelemetry);
const commandLineTraceDir = typescript_exports.server.findArgument("--traceDirectory");
const traceDir = commandLineTraceDir ? (0, typescript_exports.stripQuotes)(commandLineTraceDir) : process.env.TSS_TRACE;
if (traceDir) {
(0, typescript_exports.startTracing)("server", traceDir);
}
const ioSession = useNodeIpc ? new IpcIOSession() : new IOSession();
process.on("uncaughtException", (err) => {
ioSession.logError(err, "unknown");
});
process.noAsar = true;
ioSession.listen();
function getGlobalTypingsCacheLocation() {
switch (process.platform) {
case "win32": {
const basePath = process.env.LOCALAPPDATA || process.env.APPDATA || import_os.default.homedir && import_os.default.homedir() || process.env.USERPROFILE || process.env.HOMEDRIVE && process.env.HOMEPATH && (0, typescript_exports.normalizeSlashes)(process.env.HOMEDRIVE + process.env.HOMEPATH) || import_os.default.tmpdir();
return (0, typescript_exports.combinePaths)((0, typescript_exports.combinePaths)((0, typescript_exports.normalizeSlashes)(basePath), "Microsoft/TypeScript"), typescript_exports.versionMajorMinor);
}
case "openbsd":
case "freebsd":
case "netbsd":
case "darwin":
case "linux":
case "android": {
const cacheLocation = getNonWindowsCacheLocation(process.platform === "darwin");
return (0, typescript_exports.combinePaths)((0, typescript_exports.combinePaths)(cacheLocation, "typescript"), typescript_exports.versionMajorMinor);
}
default:
return typescript_exports.Debug.fail(`unsupported platform '${process.platform}'`);
}
}
function getNonWindowsCacheLocation(platformIsDarwin) {
if (process.env.XDG_CACHE_HOME) {
return process.env.XDG_CACHE_HOME;
}
const usersDir = platformIsDarwin ? "Users" : "home";
const homePath = import_os.default.homedir && import_os.default.homedir() || process.env.HOME || (process.env.LOGNAME || process.env.USER) && `/${usersDir}/${process.env.LOGNAME || process.env.USER}` || import_os.default.tmpdir();
const cacheFolder = platformIsDarwin ? "Library/Caches" : ".cache";
return (0, typescript_exports.combinePaths)((0, typescript_exports.normalizeSlashes)(homePath), cacheFolder);
}
}
function pipeExists(name) {
return import_fs.default.existsSync(name);
}
function createCancellationToken(args) {
let cancellationPipeName;
for (let i = 0; i < args.length - 1; i++) {
if (args[i] === "--cancellationPipeName") {
cancellationPipeName = args[i + 1];
break;
}
}
if (!cancellationPipeName) {
return typescript_exports.server.nullCancellationToken;
}
if (cancellationPipeName.charAt(cancellationPipeName.length - 1) === "*") {
const namePrefix = cancellationPipeName.slice(0, -1);
if (namePrefix.length === 0 || namePrefix.includes("*")) {
throw new Error("Invalid name for template cancellation pipe: it should have length greater than 2 characters and contain only one '*'.");
}
let perRequestPipeName;
let currentRequestId;
return {
isCancellationRequested: () => perRequestPipeName !== void 0 && pipeExists(perRequestPipeName),
setRequest(requestId) {
currentRequestId = requestId;
perRequestPipeName = namePrefix + requestId;
},
resetRequest(requestId) {
if (currentRequestId !== requestId) {
throw new Error(`Mismatched request id, expected ${currentRequestId}, actual ${requestId}`);
}
perRequestPipeName = void 0;
}
};
} else {
return {
isCancellationRequested: () => pipeExists(cancellationPipeName),
setRequest: (_requestId) => void 0,
resetRequest: (_requestId) => void 0
};
}
}
// src/tsserver/server.ts
function findArgumentStringArray(argName) {
const arg = typescript_exports.server.findArgument(argName);
if (arg === void 0) {
return typescript_exports.emptyArray;
}
return arg.split(",").filter((name) => name !== "");
}
function start({ args, logger, cancellationToken, serverMode, unknownServerMode, startSession: startServer }, platform) {
logger.info(`Starting TS Server`);
logger.info(`Version: ${typescript_exports.version}`);
logger.info(`Arguments: ${args.join(" ")}`);
logger.info(`Platform: ${platform} NodeVersion: ${process.version} CaseSensitive: ${typescript_exports.sys.useCaseSensitiveFileNames}`);
logger.info(`ServerMode: ${serverMode} hasUnknownServerMode: ${unknownServerMode}`);
typescript_exports.setStackTraceLimit();
if (typescript_exports.Debug.isDebugging) {
typescript_exports.Debug.enableDebugInfo();
}
if (typescript_exports.sys.tryEnableSourceMapsForHost && /^development$/i.test(typescript_exports.sys.getEnvironmentVariable("NODE_ENV"))) {
typescript_exports.sys.tryEnableSourceMapsForHost();
}
console.log = (...args2) => logger.msg(args2.length === 1 ? args2[0] : args2.join(", "), typescript_exports.server.Msg.Info);
console.warn = (...args2) => logger.msg(args2.length === 1 ? args2[0] : args2.join(", "), typescript_exports.server.Msg.Err);
console.error = (...args2) => logger.msg(args2.length === 1 ? args2[0] : args2.join(", "), typescript_exports.server.Msg.Err);
startServer(
{
globalPlugins: findArgumentStringArray("--globalPlugins"),
pluginProbeLocations: findArgumentStringArray("--pluginProbeLocations"),
allowLocalPluginLoads: typescript_exports.server.hasArgument("--allowLocalPluginLoads"),
useSingleInferredProject: typescript_exports.server.hasArgument("--useSingleInferredProject"),
useInferredProjectPerProjectRoot: typescript_exports.server.hasArgument("--useInferredProjectPerProjectRoot"),
suppressDiagnosticEvents: typescript_exports.server.hasArgument("--suppressDiagnosticEvents"),
noGetErrOnBackgroundUpdate: typescript_exports.server.hasArgument("--noGetErrOnBackgroundUpdate"),
canUseWatchEvents: typescript_exports.server.hasArgument("--canUseWatchEvents"),
serverMode
},
logger,
cancellationToken
);
}
typescript_exports.setStackTraceLimit();
start(initializeNodeSystem(), import_os2.default.platform());
//# sourceMappingURL=_tsserver.js.map
@@ -0,0 +1,249 @@
/**
* Copyright (c) 2018 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { C0 } from 'common/data/EscapeSequences';
import { IBufferService } from 'common/services/Services';
const enum Direction {
UP = 'A',
DOWN = 'B',
RIGHT = 'C',
LEFT = 'D'
}
/**
* Concatenates all the arrow sequences together.
* Resets the starting row to an unwrapped row, moves to the requested row,
* then moves to requested col.
*/
export function moveToCellSequence(targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {
const startX = bufferService.buffer.x;
const startY = bufferService.buffer.y;
// The alt buffer should try to navigate between rows
if (!bufferService.buffer.hasScrollback) {
return resetStartingRow(startX, startY, targetX, targetY, bufferService, applicationCursor) +
moveToRequestedRow(startY, targetY, bufferService, applicationCursor) +
moveToRequestedCol(startX, startY, targetX, targetY, bufferService, applicationCursor);
}
// Only move horizontally for the normal buffer
let direction;
if (startY === targetY) {
direction = startX > targetX ? Direction.LEFT : Direction.RIGHT;
return repeat(Math.abs(startX - targetX), sequence(direction, applicationCursor));
}
direction = startY > targetY ? Direction.LEFT : Direction.RIGHT;
const rowDifference = Math.abs(startY - targetY);
const cellsToMove = colsFromRowEnd(startY > targetY ? targetX : startX, bufferService) +
(rowDifference - 1) * bufferService.cols + 1 /* wrap around 1 row */ +
colsFromRowBeginning(startY > targetY ? startX : targetX, bufferService);
return repeat(cellsToMove, sequence(direction, applicationCursor));
}
/**
* Find the number of cols from a row beginning to a col.
*/
function colsFromRowBeginning(currX: number, bufferService: IBufferService): number {
return currX - 1;
}
/**
* Find the number of cols from a col to row end.
*/
function colsFromRowEnd(currX: number, bufferService: IBufferService): number {
return bufferService.cols - currX;
}
/**
* If the initial position of the cursor is on a row that is wrapped, move the
* cursor up to the first row that is not wrapped to have accurate vertical
* positioning.
*/
function resetStartingRow(startX: number, startY: number, targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {
if (moveToRequestedRow(startY, targetY, bufferService, applicationCursor).length === 0) {
return '';
}
return repeat(bufferLine(
startX, startY, startX,
startY - wrappedRowsForRow(startY, bufferService), false, bufferService
).length, sequence(Direction.LEFT, applicationCursor));
}
/**
* Using the reset starting and ending row, move to the requested row,
* ignoring wrapped rows
*/
function moveToRequestedRow(startY: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {
const startRow = startY - wrappedRowsForRow(startY, bufferService);
const endRow = targetY - wrappedRowsForRow(targetY, bufferService);
const rowsToMove = Math.abs(startRow - endRow) - wrappedRowsCount(startY, targetY, bufferService);
return repeat(rowsToMove, sequence(verticalDirection(startY, targetY), applicationCursor));
}
/**
* Move to the requested col on the ending row
*/
function moveToRequestedCol(startX: number, startY: number, targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {
let startRow;
if (moveToRequestedRow(startY, targetY, bufferService, applicationCursor).length > 0) {
startRow = targetY - wrappedRowsForRow(targetY, bufferService);
} else {
startRow = startY;
}
const endRow = targetY;
const direction = horizontalDirection(startX, startY, targetX, targetY, bufferService, applicationCursor);
return repeat(bufferLine(
startX, startRow, targetX, endRow,
direction === Direction.RIGHT, bufferService
).length, sequence(direction, applicationCursor));
}
/**
* Utility functions
*/
/**
* Calculates the number of wrapped rows between the unwrapped starting and
* ending rows. These rows need to ignored since the cursor skips over them.
*/
function wrappedRowsCount(startY: number, targetY: number, bufferService: IBufferService): number {
let wrappedRows = 0;
const startRow = startY - wrappedRowsForRow(startY, bufferService);
const endRow = targetY - wrappedRowsForRow(targetY, bufferService);
for (let i = 0; i < Math.abs(startRow - endRow); i++) {
const direction = verticalDirection(startY, targetY) === Direction.UP ? -1 : 1;
const line = bufferService.buffer.lines.get(startRow + (direction * i));
if (line?.isWrapped) {
wrappedRows++;
}
}
return wrappedRows;
}
/**
* Calculates the number of wrapped rows that make up a given row.
* @param currentRow The row to determine how many wrapped rows make it up
*/
function wrappedRowsForRow(currentRow: number, bufferService: IBufferService): number {
let rowCount = 0;
let line = bufferService.buffer.lines.get(currentRow);
let lineWraps = line?.isWrapped;
while (lineWraps && currentRow >= 0 && currentRow < bufferService.rows) {
rowCount++;
line = bufferService.buffer.lines.get(--currentRow);
lineWraps = line?.isWrapped;
}
return rowCount;
}
/**
* Direction determiners
*/
/**
* Determines if the right or left arrow is needed
*/
function horizontalDirection(startX: number, startY: number, targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): Direction {
let startRow;
if (moveToRequestedRow(targetX, targetY, bufferService, applicationCursor).length > 0) {
startRow = targetY - wrappedRowsForRow(targetY, bufferService);
} else {
startRow = startY;
}
if ((startX < targetX &&
startRow <= targetY) || // down/right or same y/right
(startX >= targetX &&
startRow < targetY)) { // down/left or same y/left
return Direction.RIGHT;
}
return Direction.LEFT;
}
/**
* Determines if the up or down arrow is needed
*/
function verticalDirection(startY: number, targetY: number): Direction {
return startY > targetY ? Direction.UP : Direction.DOWN;
}
/**
* Constructs the string of chars in the buffer from a starting row and col
* to an ending row and col
* @param startCol The starting column position
* @param startRow The starting row position
* @param endCol The ending column position
* @param endRow The ending row position
* @param forward Direction to move
*/
function bufferLine(
startCol: number,
startRow: number,
endCol: number,
endRow: number,
forward: boolean,
bufferService: IBufferService
): string {
let currentCol = startCol;
let currentRow = startRow;
let bufferStr = '';
while (currentCol !== endCol || currentRow !== endRow) {
currentCol += forward ? 1 : -1;
if (forward && currentCol > bufferService.cols - 1) {
bufferStr += bufferService.buffer.translateBufferLineToString(
currentRow, false, startCol, currentCol
);
currentCol = 0;
startCol = 0;
currentRow++;
} else if (!forward && currentCol < 0) {
bufferStr += bufferService.buffer.translateBufferLineToString(
currentRow, false, 0, startCol + 1
);
currentCol = bufferService.cols - 1;
startCol = currentCol;
currentRow--;
}
}
return bufferStr + bufferService.buffer.translateBufferLineToString(
currentRow, false, startCol, currentCol
);
}
/**
* Constructs the escape sequence for clicking an arrow
* @param direction The direction to move
*/
function sequence(direction: Direction, applicationCursor: boolean): string {
const mod = applicationCursor ? 'O' : '[';
return C0.ESC + mod + direction;
}
/**
* Returns a string repeated a given number of times
* Polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat
* @param count The number of times to repeat the string
* @param str The string that is to be repeated
*/
function repeat(count: number, str: string): string {
count = Math.floor(count);
let rpt = '';
for (let i = 0; i < count; i++) {
rpt += str;
}
return rpt;
}
@@ -0,0 +1,428 @@
// this file is a modified version of the code in node 17.2.0
// which is, in turn, a modified version of the fs-extra module on npm
// node core changes:
// - Use of the assert module has been replaced with core's error system.
// - All code related to the glob dependency has been removed.
// - Bring your own custom fs module is not currently supported.
// - Some basic code cleanup.
// changes here:
// - remove all callback related code
// - drop sync support
// - change assertions back to non-internal methods (see options.js)
// - throws ENOTDIR when rmdir gets an ENOENT for a path that exists in Windows
'use strict'
const {
ERR_FS_CP_DIR_TO_NON_DIR,
ERR_FS_CP_EEXIST,
ERR_FS_CP_EINVAL,
ERR_FS_CP_FIFO_PIPE,
ERR_FS_CP_NON_DIR_TO_DIR,
ERR_FS_CP_SOCKET,
ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY,
ERR_FS_CP_UNKNOWN,
ERR_FS_EISDIR,
ERR_INVALID_ARG_TYPE,
} = require('../errors.js')
const {
constants: {
errno: {
EEXIST,
EISDIR,
EINVAL,
ENOTDIR,
},
},
} = require('os')
const {
chmod,
copyFile,
lstat,
mkdir,
readdir,
readlink,
stat,
symlink,
unlink,
utimes,
} = require('../fs.js')
const {
dirname,
isAbsolute,
join,
parse,
resolve,
sep,
toNamespacedPath,
} = require('path')
const { fileURLToPath } = require('url')
const defaultOptions = {
dereference: false,
errorOnExist: false,
filter: undefined,
force: true,
preserveTimestamps: false,
recursive: false,
}
async function cp (src, dest, opts) {
if (opts != null && typeof opts !== 'object') {
throw new ERR_INVALID_ARG_TYPE('options', ['Object'], opts)
}
return cpFn(
toNamespacedPath(getValidatedPath(src)),
toNamespacedPath(getValidatedPath(dest)),
{ ...defaultOptions, ...opts })
}
function getValidatedPath (fileURLOrPath) {
const path = fileURLOrPath != null && fileURLOrPath.href
&& fileURLOrPath.origin
? fileURLToPath(fileURLOrPath)
: fileURLOrPath
return path
}
async function cpFn (src, dest, opts) {
// Warn about using preserveTimestamps on 32-bit node
// istanbul ignore next
if (opts.preserveTimestamps && process.arch === 'ia32') {
const warning = 'Using the preserveTimestamps option in 32-bit ' +
'node is not recommended'
process.emitWarning(warning, 'TimestampPrecisionWarning')
}
const stats = await checkPaths(src, dest, opts)
const { srcStat, destStat } = stats
await checkParentPaths(src, srcStat, dest)
if (opts.filter) {
return handleFilter(checkParentDir, destStat, src, dest, opts)
}
return checkParentDir(destStat, src, dest, opts)
}
async function checkPaths (src, dest, opts) {
const { 0: srcStat, 1: destStat } = await getStats(src, dest, opts)
if (destStat) {
if (areIdentical(srcStat, destStat)) {
throw new ERR_FS_CP_EINVAL({
message: 'src and dest cannot be the same',
path: dest,
syscall: 'cp',
errno: EINVAL,
})
}
if (srcStat.isDirectory() && !destStat.isDirectory()) {
throw new ERR_FS_CP_DIR_TO_NON_DIR({
message: `cannot overwrite directory ${src} ` +
`with non-directory ${dest}`,
path: dest,
syscall: 'cp',
errno: EISDIR,
})
}
if (!srcStat.isDirectory() && destStat.isDirectory()) {
throw new ERR_FS_CP_NON_DIR_TO_DIR({
message: `cannot overwrite non-directory ${src} ` +
`with directory ${dest}`,
path: dest,
syscall: 'cp',
errno: ENOTDIR,
})
}
}
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
throw new ERR_FS_CP_EINVAL({
message: `cannot copy ${src} to a subdirectory of self ${dest}`,
path: dest,
syscall: 'cp',
errno: EINVAL,
})
}
return { srcStat, destStat }
}
function areIdentical (srcStat, destStat) {
return destStat.ino && destStat.dev && destStat.ino === srcStat.ino &&
destStat.dev === srcStat.dev
}
function getStats (src, dest, opts) {
const statFunc = opts.dereference ?
(file) => stat(file, { bigint: true }) :
(file) => lstat(file, { bigint: true })
return Promise.all([
statFunc(src),
statFunc(dest).catch((err) => {
// istanbul ignore next: unsure how to cover.
if (err.code === 'ENOENT') {
return null
}
// istanbul ignore next: unsure how to cover.
throw err
}),
])
}
async function checkParentDir (destStat, src, dest, opts) {
const destParent = dirname(dest)
const dirExists = await pathExists(destParent)
if (dirExists) {
return getStatsForCopy(destStat, src, dest, opts)
}
await mkdir(destParent, { recursive: true })
return getStatsForCopy(destStat, src, dest, opts)
}
function pathExists (dest) {
return stat(dest).then(
() => true,
// istanbul ignore next: not sure when this would occur
(err) => (err.code === 'ENOENT' ? false : Promise.reject(err)))
}
// Recursively check if dest parent is a subdirectory of src.
// It works for all file types including symlinks since it
// checks the src and dest inodes. It starts from the deepest
// parent and stops once it reaches the src parent or the root path.
async function checkParentPaths (src, srcStat, dest) {
const srcParent = resolve(dirname(src))
const destParent = resolve(dirname(dest))
if (destParent === srcParent || destParent === parse(destParent).root) {
return
}
let destStat
try {
destStat = await stat(destParent, { bigint: true })
} catch (err) {
// istanbul ignore else: not sure when this would occur
if (err.code === 'ENOENT') {
return
}
// istanbul ignore next: not sure when this would occur
throw err
}
if (areIdentical(srcStat, destStat)) {
throw new ERR_FS_CP_EINVAL({
message: `cannot copy ${src} to a subdirectory of self ${dest}`,
path: dest,
syscall: 'cp',
errno: EINVAL,
})
}
return checkParentPaths(src, srcStat, destParent)
}
const normalizePathToArray = (path) =>
resolve(path).split(sep).filter(Boolean)
// Return true if dest is a subdir of src, otherwise false.
// It only checks the path strings.
function isSrcSubdir (src, dest) {
const srcArr = normalizePathToArray(src)
const destArr = normalizePathToArray(dest)
return srcArr.every((cur, i) => destArr[i] === cur)
}
async function handleFilter (onInclude, destStat, src, dest, opts, cb) {
const include = await opts.filter(src, dest)
if (include) {
return onInclude(destStat, src, dest, opts, cb)
}
}
function startCopy (destStat, src, dest, opts) {
if (opts.filter) {
return handleFilter(getStatsForCopy, destStat, src, dest, opts)
}
return getStatsForCopy(destStat, src, dest, opts)
}
async function getStatsForCopy (destStat, src, dest, opts) {
const statFn = opts.dereference ? stat : lstat
const srcStat = await statFn(src)
// istanbul ignore else: can't portably test FIFO
if (srcStat.isDirectory() && opts.recursive) {
return onDir(srcStat, destStat, src, dest, opts)
} else if (srcStat.isDirectory()) {
throw new ERR_FS_EISDIR({
message: `${src} is a directory (not copied)`,
path: src,
syscall: 'cp',
errno: EINVAL,
})
} else if (srcStat.isFile() ||
srcStat.isCharacterDevice() ||
srcStat.isBlockDevice()) {
return onFile(srcStat, destStat, src, dest, opts)
} else if (srcStat.isSymbolicLink()) {
return onLink(destStat, src, dest)
} else if (srcStat.isSocket()) {
throw new ERR_FS_CP_SOCKET({
message: `cannot copy a socket file: ${dest}`,
path: dest,
syscall: 'cp',
errno: EINVAL,
})
} else if (srcStat.isFIFO()) {
throw new ERR_FS_CP_FIFO_PIPE({
message: `cannot copy a FIFO pipe: ${dest}`,
path: dest,
syscall: 'cp',
errno: EINVAL,
})
}
// istanbul ignore next: should be unreachable
throw new ERR_FS_CP_UNKNOWN({
message: `cannot copy an unknown file type: ${dest}`,
path: dest,
syscall: 'cp',
errno: EINVAL,
})
}
function onFile (srcStat, destStat, src, dest, opts) {
if (!destStat) {
return _copyFile(srcStat, src, dest, opts)
}
return mayCopyFile(srcStat, src, dest, opts)
}
async function mayCopyFile (srcStat, src, dest, opts) {
if (opts.force) {
await unlink(dest)
return _copyFile(srcStat, src, dest, opts)
} else if (opts.errorOnExist) {
throw new ERR_FS_CP_EEXIST({
message: `${dest} already exists`,
path: dest,
syscall: 'cp',
errno: EEXIST,
})
}
}
async function _copyFile (srcStat, src, dest, opts) {
await copyFile(src, dest)
if (opts.preserveTimestamps) {
return handleTimestampsAndMode(srcStat.mode, src, dest)
}
return setDestMode(dest, srcStat.mode)
}
async function handleTimestampsAndMode (srcMode, src, dest) {
// Make sure the file is writable before setting the timestamp
// otherwise open fails with EPERM when invoked with 'r+'
// (through utimes call)
if (fileIsNotWritable(srcMode)) {
await makeFileWritable(dest, srcMode)
return setDestTimestampsAndMode(srcMode, src, dest)
}
return setDestTimestampsAndMode(srcMode, src, dest)
}
function fileIsNotWritable (srcMode) {
return (srcMode & 0o200) === 0
}
function makeFileWritable (dest, srcMode) {
return setDestMode(dest, srcMode | 0o200)
}
async function setDestTimestampsAndMode (srcMode, src, dest) {
await setDestTimestamps(src, dest)
return setDestMode(dest, srcMode)
}
function setDestMode (dest, srcMode) {
return chmod(dest, srcMode)
}
async function setDestTimestamps (src, dest) {
// The initial srcStat.atime cannot be trusted
// because it is modified by the read(2) system call
// (See https://nodejs.org/api/fs.html#fs_stat_time_values)
const updatedSrcStat = await stat(src)
return utimes(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
}
function onDir (srcStat, destStat, src, dest, opts) {
if (!destStat) {
return mkDirAndCopy(srcStat.mode, src, dest, opts)
}
return copyDir(src, dest, opts)
}
async function mkDirAndCopy (srcMode, src, dest, opts) {
await mkdir(dest)
await copyDir(src, dest, opts)
return setDestMode(dest, srcMode)
}
async function copyDir (src, dest, opts) {
const dir = await readdir(src)
for (let i = 0; i < dir.length; i++) {
const item = dir[i]
const srcItem = join(src, item)
const destItem = join(dest, item)
const { destStat } = await checkPaths(srcItem, destItem, opts)
await startCopy(destStat, srcItem, destItem, opts)
}
}
async function onLink (destStat, src, dest) {
let resolvedSrc = await readlink(src)
if (!isAbsolute(resolvedSrc)) {
resolvedSrc = resolve(dirname(src), resolvedSrc)
}
if (!destStat) {
return symlink(resolvedSrc, dest)
}
let resolvedDest
try {
resolvedDest = await readlink(dest)
} catch (err) {
// Dest exists and is a regular file or directory,
// Windows may throw UNKNOWN error. If dest already exists,
// fs throws error anyway, so no need to guard against it here.
// istanbul ignore next: can only test on windows
if (err.code === 'EINVAL' || err.code === 'UNKNOWN') {
return symlink(resolvedSrc, dest)
}
// istanbul ignore next: should not be possible
throw err
}
if (!isAbsolute(resolvedDest)) {
resolvedDest = resolve(dirname(dest), resolvedDest)
}
if (isSrcSubdir(resolvedSrc, resolvedDest)) {
throw new ERR_FS_CP_EINVAL({
message: `cannot copy ${resolvedSrc} to a subdirectory of self ` +
`${resolvedDest}`,
path: dest,
syscall: 'cp',
errno: EINVAL,
})
}
// Do not copy if src is a subdir of dest since unlinking
// dest in this case would result in removing src contents
// and therefore a broken symlink would be created.
const srcStat = await stat(src)
if (srcStat.isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc)) {
throw new ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY({
message: `cannot overwrite ${resolvedDest} with ${resolvedSrc}`,
path: dest,
syscall: 'cp',
errno: EINVAL,
})
}
return copyLink(resolvedSrc, dest)
}
async function copyLink (resolvedSrc, dest) {
await unlink(dest)
return symlink(resolvedSrc, dest)
}
module.exports = cp
@@ -0,0 +1,31 @@
// Copyright (c) 2015 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.
#ifndef UNIX_ADAPTER_UTIL_H
#define UNIX_ADAPTER_UTIL_H
#include <stdlib.h>
#include <sys/select.h>
bool writeAll(int fd, const void *buffer, size_t size);
bool writeStr(int fd, const char *str);
void selectWrapper(const char *diagName, int nfds, fd_set *readfds);
#endif // UNIX_ADAPTER_UTIL_H
@@ -0,0 +1,7 @@
var Buffer = require('buffer').Buffer;
module.exports = function(buf) {
var out = new Buffer(buf.length);
buf.copy(out);
return out;
};
@@ -0,0 +1,15 @@
module.exports = {
"deselectedItem": (args)=>`Polo\u{17E}ka ${args.item} nen\xed vybr\xe1na.`,
"longPressToSelect": `Dlouh\xfdm stisknut\xedm p\u{159}ejdete do re\u{17E}imu v\xfdb\u{11B}ru.`,
"select": `Vybrat`,
"selectedAll": `Vybr\xe1ny v\u{161}echny polo\u{17E}ky.`,
"selectedCount": (args, formatter)=>`${formatter.plural(args.count, {
"=0": `Nevybr\xe1ny \u{17E}\xe1dn\xe9 polo\u{17E}ky`,
one: ()=>`Vybr\xe1na ${formatter.number(args.count)} polo\u{17E}ka`,
other: ()=>`Vybr\xe1no ${formatter.number(args.count)} polo\u{17E}ek`
})}.`,
"selectedItem": (args)=>`Vybr\xe1na polo\u{17E}ka ${args.item}.`
};
//# sourceMappingURL=cs-CZ.main.js.map
@@ -0,0 +1,256 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.environmentVisitor = environmentVisitor;
exports.explode = explode$1;
exports.isExplodedVisitor = isExplodedVisitor;
exports.merge = merge;
exports.verify = verify$1;
var virtualTypes = require("./path/lib/virtual-types.js");
var virtualTypesValidators = require("./path/lib/virtual-types-validator.js");
var _t = require("@babel/types");
var _context = require("./path/context.js");
const {
DEPRECATED_KEYS,
DEPRECATED_ALIASES,
FLIPPED_ALIAS_KEYS,
TYPES,
__internal__deprecationWarning: deprecationWarning
} = _t;
function isVirtualType(type) {
return type in virtualTypes;
}
function isExplodedVisitor(visitor) {
return visitor == null ? void 0 : visitor._exploded;
}
function explode$1(visitor) {
if (isExplodedVisitor(visitor)) return visitor;
visitor._exploded = true;
for (const nodeType of Object.keys(visitor)) {
if (shouldIgnoreKey(nodeType)) continue;
const parts = nodeType.split("|");
if (parts.length === 1) continue;
const fns = visitor[nodeType];
delete visitor[nodeType];
for (const part of parts) {
visitor[part] = fns;
}
}
verify$1(visitor);
delete visitor.__esModule;
ensureEntranceObjects(visitor);
ensureCallbackArrays(visitor);
for (const nodeType of Object.keys(visitor)) {
if (shouldIgnoreKey(nodeType)) continue;
if (!isVirtualType(nodeType)) continue;
const fns = visitor[nodeType];
for (const type of Object.keys(fns)) {
fns[type] = wrapCheck(nodeType, fns[type]);
}
delete visitor[nodeType];
const types = virtualTypes[nodeType];
if (types !== null) {
for (const type of types) {
var _visitor$type;
(_visitor$type = visitor[type]) != null ? _visitor$type : visitor[type] = {};
mergePair(visitor[type], fns);
}
} else {
mergePair(visitor, fns);
}
}
for (const nodeType of Object.keys(visitor)) {
if (shouldIgnoreKey(nodeType)) continue;
let aliases = FLIPPED_ALIAS_KEYS[nodeType];
if (nodeType in DEPRECATED_KEYS) {
const deprecatedKey = DEPRECATED_KEYS[nodeType];
deprecationWarning(nodeType, deprecatedKey, "Visitor ");
aliases = [deprecatedKey];
} else if (nodeType in DEPRECATED_ALIASES) {
const deprecatedAlias = DEPRECATED_ALIASES[nodeType];
deprecationWarning(nodeType, deprecatedAlias, "Visitor ");
aliases = FLIPPED_ALIAS_KEYS[deprecatedAlias];
}
if (!aliases) continue;
const fns = visitor[nodeType];
delete visitor[nodeType];
for (const alias of aliases) {
const existing = visitor[alias];
if (existing) {
mergePair(existing, fns);
} else {
visitor[alias] = Object.assign({}, fns);
}
}
}
for (const nodeType of Object.keys(visitor)) {
if (shouldIgnoreKey(nodeType)) continue;
ensureCallbackArrays(visitor[nodeType]);
}
return visitor;
}
function verify$1(visitor) {
if (visitor._verified) return;
if (typeof visitor === "function") {
throw new Error("You passed `traverse()` a function when it expected a visitor object, " + "are you sure you didn't mean `{ enter: Function }`?");
}
for (const nodeType of Object.keys(visitor)) {
if (nodeType === "enter" || nodeType === "exit") {
validateVisitorMethods(nodeType, visitor[nodeType]);
}
if (shouldIgnoreKey(nodeType)) continue;
if (!TYPES.includes(nodeType)) {
throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${"7.28.5"}`);
}
const visitors = visitor[nodeType];
if (typeof visitors === "object") {
for (const visitorKey of Object.keys(visitors)) {
if (visitorKey === "enter" || visitorKey === "exit") {
validateVisitorMethods(`${nodeType}.${visitorKey}`, visitors[visitorKey]);
} else {
throw new Error("You passed `traverse()` a visitor object with the property " + `${nodeType} that has the invalid property ${visitorKey}`);
}
}
}
}
visitor._verified = true;
}
function validateVisitorMethods(path, val) {
const fns = [].concat(val);
for (const fn of fns) {
if (typeof fn !== "function") {
throw new TypeError(`Non-function found defined in ${path} with type ${typeof fn}`);
}
}
}
function merge(visitors, states = [], wrapper) {
const mergedVisitor = {
_verified: true,
_exploded: true
};
{
Object.defineProperty(mergedVisitor, "_exploded", {
enumerable: false
});
Object.defineProperty(mergedVisitor, "_verified", {
enumerable: false
});
}
for (let i = 0; i < visitors.length; i++) {
const visitor = explode$1(visitors[i]);
const state = states[i];
let topVisitor = visitor;
if (state || wrapper) {
topVisitor = wrapWithStateOrWrapper(topVisitor, state, wrapper);
}
mergePair(mergedVisitor, topVisitor);
for (const key of Object.keys(visitor)) {
if (shouldIgnoreKey(key)) continue;
let typeVisitor = visitor[key];
if (state || wrapper) {
typeVisitor = wrapWithStateOrWrapper(typeVisitor, state, wrapper);
}
const nodeVisitor = mergedVisitor[key] || (mergedVisitor[key] = {});
mergePair(nodeVisitor, typeVisitor);
}
}
return mergedVisitor;
}
function wrapWithStateOrWrapper(oldVisitor, state, wrapper) {
const newVisitor = {};
for (const phase of ["enter", "exit"]) {
let fns = oldVisitor[phase];
if (!Array.isArray(fns)) continue;
fns = fns.map(function (fn) {
let newFn = fn;
if (state) {
newFn = function (path) {
fn.call(state, path, state);
};
}
if (wrapper) {
newFn = wrapper(state == null ? void 0 : state.key, phase, newFn);
}
if (newFn !== fn) {
newFn.toString = () => fn.toString();
}
return newFn;
});
newVisitor[phase] = fns;
}
return newVisitor;
}
function ensureEntranceObjects(obj) {
for (const key of Object.keys(obj)) {
if (shouldIgnoreKey(key)) continue;
const fns = obj[key];
if (typeof fns === "function") {
obj[key] = {
enter: fns
};
}
}
}
function ensureCallbackArrays(obj) {
if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter];
if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit];
}
function wrapCheck(nodeType, fn) {
const fnKey = `is${nodeType}`;
const validator = virtualTypesValidators[fnKey];
const newFn = function (path) {
if (validator.call(path)) {
return fn.apply(this, arguments);
}
};
newFn.toString = () => fn.toString();
return newFn;
}
function shouldIgnoreKey(key) {
if (key[0] === "_") return true;
if (key === "enter" || key === "exit" || key === "shouldSkip") return true;
if (key === "denylist" || key === "noScope" || key === "skipKeys") {
return true;
}
{
if (key === "blacklist") {
return true;
}
}
return false;
}
function mergePair(dest, src) {
for (const phase of ["enter", "exit"]) {
if (!src[phase]) continue;
dest[phase] = [].concat(dest[phase] || [], src[phase]);
}
}
const _environmentVisitor = {
FunctionParent(path) {
if (path.isArrowFunctionExpression()) return;
path.skip();
if (path.isMethod()) {
if (!path.requeueComputedKeyAndDecorators) {
_context.requeueComputedKeyAndDecorators.call(path);
} else {
path.requeueComputedKeyAndDecorators();
}
}
},
Property(path) {
if (path.isObjectProperty()) return;
path.skip();
if (!path.requeueComputedKeyAndDecorators) {
_context.requeueComputedKeyAndDecorators.call(path);
} else {
path.requeueComputedKeyAndDecorators();
}
}
};
function environmentVisitor(visitor) {
return merge([_environmentVisitor, visitor]);
}
//# sourceMappingURL=visitors.js.map
@@ -0,0 +1,16 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2017_full = void 0;
const dom_1 = require("./dom");
const dom_iterable_1 = require("./dom.iterable");
const es2017_1 = require("./es2017");
const scripthost_1 = require("./scripthost");
const webworker_importscripts_1 = require("./webworker.importscripts");
exports.es2017_full = {
libs: [es2017_1.es2017, dom_1.dom, webworker_importscripts_1.webworker_importscripts, scripthost_1.scripthost, dom_iterable_1.dom_iterable],
variables: [],
};
@@ -0,0 +1,105 @@
/**
* @fileoverview Rule to check that spaced function application
* @author Matt DuVall <http://www.mattduvall.com>
* @deprecated in ESLint v3.3.0
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
docs: {
description:
"Disallow spacing between function identifiers and their applications (deprecated)",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-spaced-func",
},
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2016/08/eslint-v3.3.0-released/#deprecated-rules",
deprecatedSince: "3.3.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "function-call-spacing",
url: "https://eslint.style/rules/function-call-spacing",
},
},
],
},
fixable: "whitespace",
schema: [],
messages: {
noSpacedFunction:
"Unexpected space between function name and paren.",
},
},
create(context) {
const sourceCode = context.sourceCode;
/**
* Check if open space is present in a function name
* @param {ASTNode} node node to evaluate
* @returns {void}
* @private
*/
function detectOpenSpaces(node) {
const lastCalleeToken = sourceCode.getLastToken(node.callee);
let prevToken = lastCalleeToken,
parenToken = sourceCode.getTokenAfter(lastCalleeToken);
// advances to an open parenthesis.
while (
parenToken &&
parenToken.range[1] < node.range[1] &&
parenToken.value !== "("
) {
prevToken = parenToken;
parenToken = sourceCode.getTokenAfter(parenToken);
}
// look for a space between the callee and the open paren
if (
parenToken &&
parenToken.range[1] < node.range[1] &&
sourceCode.isSpaceBetweenTokens(prevToken, parenToken)
) {
context.report({
node,
loc: lastCalleeToken.loc.start,
messageId: "noSpacedFunction",
fix(fixer) {
return fixer.removeRange([
prevToken.range[1],
parenToken.range[0],
]);
},
});
}
}
return {
CallExpression: detectOpenSpaces,
NewExpression: detectOpenSpaces,
};
},
};
@@ -0,0 +1,4 @@
import type { Field } from '../types';
declare const _default: (fieldReference: Field["_f"]) => boolean;
export default _default;
//# sourceMappingURL=hasPromiseValidation.d.ts.map
@@ -0,0 +1,2 @@
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
module.exports = require("./data/overlapping-plugins.json");
@@ -0,0 +1,14 @@
import { _ as _get } from "./_get.js";
import { _ as _set } from "./_set.js";
function _update(target, property, receiver, isStrict) {
return {
get _() {
return _get(target, property, receiver);
},
set _(value) {
_set(target, property, value, receiver, isStrict);
}
};
}
export { _update as _ };
@@ -0,0 +1,133 @@
export * from './utils.js';
type ScrollDirection = 'forward' | 'backward';
type ScrollAlignment = 'start' | 'center' | 'end' | 'auto';
type ScrollBehavior = 'auto' | 'smooth';
export interface ScrollToOptions {
align?: ScrollAlignment;
behavior?: ScrollBehavior;
}
type ScrollToOffsetOptions = ScrollToOptions;
type ScrollToIndexOptions = ScrollToOptions;
export interface Range {
startIndex: number;
endIndex: number;
overscan: number;
count: number;
}
type Key = number | string | bigint;
export interface VirtualItem {
key: Key;
index: number;
start: number;
end: number;
size: number;
lane: number;
}
export interface Rect {
width: number;
height: number;
}
export declare const defaultKeyExtractor: (index: number) => number;
export declare const defaultRangeExtractor: (range: Range) => number[];
export declare const observeElementRect: <T extends Element>(instance: Virtualizer<T, any>, cb: (rect: Rect) => void) => (() => void) | undefined;
export declare const observeWindowRect: (instance: Virtualizer<Window, any>, cb: (rect: Rect) => void) => (() => void) | undefined;
type ObserveOffsetCallBack = (offset: number, isScrolling: boolean) => void;
export declare const observeElementOffset: <T extends Element>(instance: Virtualizer<T, any>, cb: ObserveOffsetCallBack) => (() => void) | undefined;
export declare const observeWindowOffset: (instance: Virtualizer<Window, any>, cb: ObserveOffsetCallBack) => (() => void) | undefined;
export declare const measureElement: <TItemElement extends Element>(element: TItemElement, entry: ResizeObserverEntry | undefined, instance: Virtualizer<any, TItemElement>) => number;
export declare const windowScroll: <T extends Window>(offset: number, { adjustments, behavior, }: {
adjustments?: number | undefined;
behavior?: ScrollBehavior | undefined;
}, instance: Virtualizer<T, any>) => void;
export declare const elementScroll: <T extends Element>(offset: number, { adjustments, behavior, }: {
adjustments?: number | undefined;
behavior?: ScrollBehavior | undefined;
}, instance: Virtualizer<T, any>) => void;
export interface VirtualizerOptions<TScrollElement extends Element | Window, TItemElement extends Element> {
count: number;
getScrollElement: () => TScrollElement | null;
estimateSize: (index: number) => number;
scrollToFn: (offset: number, options: {
adjustments?: number;
behavior?: ScrollBehavior;
}, instance: Virtualizer<TScrollElement, TItemElement>) => void;
observeElementRect: (instance: Virtualizer<TScrollElement, TItemElement>, cb: (rect: Rect) => void) => void | (() => void);
observeElementOffset: (instance: Virtualizer<TScrollElement, TItemElement>, cb: ObserveOffsetCallBack) => void | (() => void);
debug?: boolean;
initialRect?: Rect;
onChange?: (instance: Virtualizer<TScrollElement, TItemElement>, sync: boolean) => void;
measureElement?: (element: TItemElement, entry: ResizeObserverEntry | undefined, instance: Virtualizer<TScrollElement, TItemElement>) => number;
overscan?: number;
horizontal?: boolean;
paddingStart?: number;
paddingEnd?: number;
scrollPaddingStart?: number;
scrollPaddingEnd?: number;
initialOffset?: number | (() => number);
getItemKey?: (index: number) => Key;
rangeExtractor?: (range: Range) => Array<number>;
scrollMargin?: number;
gap?: number;
indexAttribute?: string;
initialMeasurementsCache?: Array<VirtualItem>;
lanes?: number;
isScrollingResetDelay?: number;
useScrollendEvent?: boolean;
enabled?: boolean;
isRtl?: boolean;
}
export declare class Virtualizer<TScrollElement extends Element | Window, TItemElement extends Element> {
private unsubs;
options: Required<VirtualizerOptions<TScrollElement, TItemElement>>;
scrollElement: TScrollElement | null;
targetWindow: (Window & typeof globalThis) | null;
isScrolling: boolean;
private scrollToIndexTimeoutId;
measurementsCache: Array<VirtualItem>;
private itemSizeCache;
private pendingMeasuredCacheIndexes;
scrollRect: Rect | null;
scrollOffset: number | null;
scrollDirection: ScrollDirection | null;
private scrollAdjustments;
shouldAdjustScrollPositionOnItemSizeChange: undefined | ((item: VirtualItem, delta: number, instance: Virtualizer<TScrollElement, TItemElement>) => boolean);
elementsCache: Map<Key, TItemElement>;
private observer;
range: {
startIndex: number;
endIndex: number;
} | null;
constructor(opts: VirtualizerOptions<TScrollElement, TItemElement>);
setOptions: (opts: VirtualizerOptions<TScrollElement, TItemElement>) => void;
private notify;
private maybeNotify;
private cleanup;
_didMount: () => () => void;
_willUpdate: () => void;
private getSize;
private getScrollOffset;
private getFurthestMeasurement;
private getMeasurementOptions;
private getMeasurements;
calculateRange: () => {
startIndex: number;
endIndex: number;
} | null;
private getIndexes;
indexFromElement: (node: TItemElement) => number;
private _measureElement;
resizeItem: (index: number, size: number) => void;
measureElement: (node: TItemElement | null | undefined) => void;
getVirtualItems: () => VirtualItem[];
getVirtualItemForOffset: (offset: number) => VirtualItem | undefined;
getOffsetForAlignment: (toOffset: number, align: ScrollAlignment) => number;
getOffsetForIndex: (index: number, align?: ScrollAlignment) => readonly [number, "auto"] | readonly [number, "center"] | readonly [number, "end"] | readonly [number, "start"] | undefined;
private isDynamicMode;
private cancelScrollToIndex;
scrollToOffset: (toOffset: number, { align, behavior }?: ScrollToOffsetOptions) => void;
scrollToIndex: (index: number, { align: initialAlign, behavior }?: ScrollToIndexOptions) => void;
scrollBy: (delta: number, { behavior }?: ScrollToOffsetOptions) => void;
getTotalSize: () => number;
private _scrollToOffset;
measure: () => void;
}
@@ -0,0 +1,23 @@
import { _ as _define_property } from "./_define_property.js";
function _object_spread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === "function") {
ownKeys = ownKeys.concat(
Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
})
);
}
ownKeys.forEach(function(key) {
_define_property(target, key, source[key]);
});
}
return target;
}
export { _object_spread as _ };
@@ -0,0 +1,69 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = literalTemplate;
var _options = require("./options.js");
var _parse = require("./parse.js");
var _populate = require("./populate.js");
function literalTemplate(formatter, tpl, opts) {
const {
metadata,
names
} = buildLiteralData(formatter, tpl, opts);
return arg => {
const defaultReplacements = {};
arg.forEach((replacement, i) => {
defaultReplacements[names[i]] = replacement;
});
return arg => {
const replacements = (0, _options.normalizeReplacements)(arg);
if (replacements) {
Object.keys(replacements).forEach(key => {
if (hasOwnProperty.call(defaultReplacements, key)) {
throw new Error("Unexpected replacement overlap.");
}
});
}
return formatter.unwrap((0, _populate.default)(metadata, replacements ? Object.assign(replacements, defaultReplacements) : defaultReplacements));
};
};
}
function buildLiteralData(formatter, tpl, opts) {
let prefix = "BABEL_TPL$";
const raw = tpl.join("");
do {
prefix = "$$" + prefix;
} while (raw.includes(prefix));
const {
names,
code
} = buildTemplateCode(tpl, prefix);
const metadata = (0, _parse.default)(formatter, formatter.code(code), {
parser: opts.parser,
placeholderWhitelist: new Set(names.concat(opts.placeholderWhitelist ? Array.from(opts.placeholderWhitelist) : [])),
placeholderPattern: opts.placeholderPattern,
preserveComments: opts.preserveComments,
syntacticPlaceholders: opts.syntacticPlaceholders
});
return {
metadata,
names
};
}
function buildTemplateCode(tpl, prefix) {
const names = [];
let code = tpl[0];
for (let i = 1; i < tpl.length; i++) {
const value = `${prefix}${i - 1}`;
names.push(value);
code += value + tpl[i];
}
return {
names,
code
};
}
//# sourceMappingURL=literal.js.map
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,wDAAQ,CAAC;AACzC","sources":["packages/@react-aria/overlays/intl/el-GR.json"],"sourcesContent":["{\n \"dismiss\": \"Απόρριψη\"\n}\n"],"names":[],"version":3,"file":"el-GR.main.js.map"}
@@ -0,0 +1,7 @@
import { isLength } from "./isLength.mjs";
function isArrayLike(value) {
return value != null && isLength(value.length) && typeof value !== "function";
}
export {
isArrayLike
};
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isEnoentCodeError = void 0;
function isEnoentCodeError(error) {
return error.code === 'ENOENT';
}
exports.isEnoentCodeError = isEnoentCodeError;
@@ -0,0 +1,547 @@
flf2a$ 3 2 7 0 8
This font is (c) Michel Eftimakis 1995 -- Version 1.1 -- 15 feb 1995
____________________________________________________________ /`____
| Michel Eftimakis | "Ascii-Artist" '\/ |
| Michel.Eftimakis@ustc.vlsi.com | Boo)- (00) ||
| Tel : (33) 92 96 27 19 | (_`'_) ||
|__ Fax : (33) 92 96 27 01 _________|____ FRANCE ___________ _!!_ ____||
|_____________________________________________________________________|
$$@
$$@
$$@@
[]@
()@
@@
,,@
@
@@
@
=||=@
@@
|@
S@
|@@
o/@
/o@
@@
@
&@
@@
,@
$@
@@
$@
/$@
`$@@
$ @
$\@
$'@@
@
*@
@@
@
+@
@@
@
,@
@@
@
-@
@@
@
.@
@@
/@
/ @
@@
@
0@
@@
@
1@
@@
@
2@
@@
@
3@
@@
@
4@
@@
@
5@
@@
@
6@
@@
@
7@
@@
@
8@
@@
@
9@
@@
@
:@
@@
@
;@
@@
/@
\@
@@
@
=@
@@
\@
/@
@@
@
?@
@@
_ @
(a)@
@@
_ @
//\@
@@
_ @
[|}@
@@
_@
((@
@@
_ @
[|)@
@@
__@
[|-@
`-@@
__@
[|-@
@@
__ @
(|_;@
@@
@
[]-|@
@@
()@
[]@
@@
()@
||@
[_|@@
@
[]/@
`@@
|| @
L_]@
@@
_ _ @
//\/\@
@@
_ @
[|\|@
@@
_ @
(()@
@@
_ @
||)@
L| @@
_ @
(()@
`@@
_ @
[|)@
`@@
@
((@
''@@
____@
L| @
@@
@
|U|@
`-'@@
_ _@
\\/@
@@
_ _ _@
\\/\/@
@@
@
\\/@
''`@@
_ _@
\\/@
'' @@
__ @
//_@
@@
_$@
| $@
|_$@@
\ @
\@
@@
$_ @
$ |@
$_|@@
^@
$@
@@
@
$$@
==@@
.@
$@
@@
@
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@
@@
@
{@
@@
|@
|@
|@@
@
}@
@@
@
~@
@@
..@
//\@
@@
..@
(()@
@@
..@
|U|@
`-'@@
..@
a @
@@
..@
o @
@@
..@
u @
@@
_ @
||}@
L| @@
160
$@
$@
$@@
161
()@
||@
L|@@
168
..@
$$@
@@
183
o@
$@
@@
192
` @
//\@
@@
193
' @
//\@
@@
194
^ @
//\@
@@
195
~ @
//\@
@@
196
..@
//\@
@@
197
o @
//\@
@@
198
____@
//\|-@
`-@@
199
@
((@
'@@
200
`_@
||-@
`-@@
201
'_@
||-@
`-@@
202
^_@
||-@
`-@@
203
..@
||-@
`-@@
204
` @
L|@
@@
205
'@
L|@
@@
206
^ @
L|@
@@
207
..@
L|@
@@
209
_~ @
[|\|@
@@
210
` @
(()@
@@
211
' @
(()@
@@
212
^ @
(()@
@@
213
~ @
(()@
@@
214
..@
(()@
@@
217
` @
|U|@
`-'@@
218
' @
|U|@
`-'@@
219
^ @
|U|@
`-'@@
220
..@
|U|@
`-'@@
223
_ @
||}@
L| @@
224
-@
a@
@@
225
,@
a@
@@
226
^@
a@
@@
227
~@
a@
@@
228
..@
a @
@@
229
.@
a@
@@
231
@
c@
'@@
232
-@
e@
@@
233
,@
e@
@@
234
^@
e@
@@
235
..@
e @
@@
236
-@
i@
@@
237
,@
i@
@@
238
^@
i@
@@
239
..@
i @
@@
241
~@
n@
@@
242
-@
o@
@@
243
,@
o@
@@
244
^@
o@
@@
245
~@
o@
@@
246
..@
o @
@@
249
-@
u@
@@
250
,@
u@
@@
251
^@
u@
@@
252
..@
u @
@@
253
,@
y@
@@
255
..@
y @
@@
@@ -0,0 +1 @@
{"version":3,"file":"resetDeactivationParams.d.ts","sourceRoot":"","sources":["../../../../src/container/actions/resetDeactivationParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,wBAAgB,uBAAuB,CACrC,uBAAuB,EAAE,uBAAuB,EAChD,kBAAkB,EAAE,kBAAkB,GACrC,IAAI,CAaN"}
@@ -0,0 +1,126 @@
'use strict';
const path = require('path');
const fs = require('fs');
function applyPolyfills(object, polyfill) {
return new Proxy(object, {
get(_target, p) {
var _a;
return (_a = object[p]) != null ? _a : polyfill[p];
}
});
}
function getParent(node) {
return node.parent;
}
const cache = /* @__PURE__ */ new WeakMap();
function getSourceCode(context) {
const original = context.sourceCode || context.getSourceCode();
const cached = cache.get(original);
if (cached) {
return cached;
}
const sourceCode = applyPolyfills(original, {
getScope(node) {
const inner = node.type !== "Program";
for (let n = node; n; n = getParent(n)) {
const scope = original.scopeManager.acquire(n, inner);
if (scope) {
if (scope.type === "function-expression-name") {
return scope.childScopes[0];
}
return scope;
}
}
return original.scopeManager.scopes[0];
},
markVariableAsUsed(name, refNode = original.ast) {
const currentScope = sourceCode.getScope(refNode);
if (currentScope === context.getScope()) {
return context.markVariableAsUsed(name);
}
let initialScope = currentScope;
if (currentScope.type === "global" && currentScope.childScopes.length > 0 && currentScope.childScopes[0].block === original.ast) {
initialScope = currentScope.childScopes[0];
}
for (let scope = initialScope; scope; scope = scope.upper) {
const variable = scope.variables.find(
(scopeVar) => scopeVar.name === name
);
if (variable) {
variable.eslintUsed = true;
return true;
}
}
return false;
},
getAncestors(node) {
const result = [];
for (let ancestor = getParent(node); ancestor; ancestor = ancestor.parent) {
result.unshift(ancestor);
}
return result;
},
getDeclaredVariables(node) {
return original.scopeManager.getDeclaredVariables(node);
},
isSpaceBetween(first, second) {
if (first.range[0] <= second.range[1] && second.range[0] <= first.range[1]) {
return false;
}
const [startingNodeOrToken, endingNodeOrToken] = first.range[1] <= second.range[0] ? [first, second] : [second, first];
const tokens = sourceCode.getTokensBetween(first, second, {
includeComments: true
});
let startIndex = startingNodeOrToken.range[1];
for (const token of tokens) {
if (startIndex !== token.range[0]) {
return true;
}
startIndex = token.range[1];
}
return startIndex !== endingNodeOrToken.range[0];
}
});
cache.set(original, sourceCode);
return sourceCode;
}
function getCwd(context) {
var _a, _b, _c;
return (_c = (_b = context.cwd) != null ? _b : (_a = context.getCwd) == null ? void 0 : _a.call(context)) != null ? _c : (
// getCwd is added in v6.6.0
process.cwd()
);
}
function getFilename(context) {
var _a;
return (_a = context.filename) != null ? _a : context.getFilename();
}
function getPhysicalFilename(context) {
var _a, _b;
const physicalFilename = (_b = context.physicalFilename) != null ? _b : (_a = context.getPhysicalFilename) == null ? void 0 : _a.call(context);
if (physicalFilename != null) {
return physicalFilename;
}
const filename = getFilename(context);
let target = filename;
while (/^\d+_/u.test(path.basename(target)) && !fs.existsSync(target)) {
const next = path.dirname(target);
if (next === target || !path.extname(next)) {
break;
}
target = next;
}
return target;
}
exports.getCwd = getCwd;
exports.getFilename = getFilename;
exports.getPhysicalFilename = getPhysicalFilename;
exports.getSourceCode = getSourceCode;
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA4CM,SAAS,0CAAY,KAAqB,EAAE,KAAuC,EAAE,GAAkC;IAC5H,IAAI,oBACF,gBAAgB,iBAChB,aAAa,kBACb,cAAc,UACd,MAAM,EACP,GAAG;IAEJ,0HAA0H;IAC1H,qFAAqF;IACrF,IAAI,WAAW,CAAA,GAAA,gCAAU,EAAE;QAAC,OAAO;QAAU,aAAa;IAAM;IAChE,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,8BAAQ;IAC1B,IAAI,mBAAmB,MAAM,gBAAgB,CAAC,gBAAgB;IAC9D,IAAI,WAAW,CAAA,GAAA,oBAAM,EAAE,IAAM,oBAAoB,IAAI,CAAA,GAAA,+CAAoB,EAAE;YACzE,YAAY,MAAM,UAAU;YAC5B,cAAc,MAAM,YAAY;8BAChC;iBACA;uBACA;sBACA;4BACA;oBACA;QACF,IAAI;QAAC;QAAkB,MAAM,UAAU;QAAE,MAAM,YAAY;QAAE;QAAkB;QAAK;QAAW;QAAU;QAAgB;KAAO;IAChI,IAAI,KAAK,CAAA,GAAA,2BAAI,EAAE,MAAM,EAAE;IACvB,CAAA,GAAA,iCAAM,EAAE,GAAG,CAAC,OAAO;IAEnB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,4BAAM,EAAE;QACxB,GAAG,KAAK;YACR;QACA,kBAAkB;IACpB,GAAG,OAAO;IAEV,kCAAkC;IAClC,IAAI,eACF,SAAS,CAAC,gBAAgB,GAAG,MAAM,UAAU,CAAC,IAAI,GAAG,MAAM,UAAU,CAAC,UAAU,CAAC,MAAM;IAGzF,IAAI,CAAA,GAAA,wCAAc,OAAO,kBAAkB,OACzC,UAAU,IAAI,GAAG;IAGnB,IAAI,UAAC,MAAM,EAAE,WAAW,aAAa,EAAC,GAAG,MAAM,cAAc,IAAI,CAAC;IAClE,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,kBAAkB,CAAA,GAAA,oBAAM,EAAE;YACX;YAAA;QAAjB,IAAI,aAAa,CAAA,4CAAA,iCAAA,MAAM,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA,IAAK,EAAE,GAAG,KAAK,qBAA7C,qDAAA,+BAAsD,SAAS,cAA/D,sDAAA,2CAAmE;QACpF,OAAO,iBAAiB,SAAS,gBAAgB,MAAM,CAAC,GAAG,cAAc,IAAI,CAAC,EAAE;wBAAC;QAAU,KAAK;IAClG,uDAAuD;IACvD,GAAG;QAAC;QAAe;QAAQ,MAAM,UAAU,CAAC,OAAO;KAAC;IAEpD,IAAI,mBAAmB,CAAA,GAAA,oCAAa,EAAE;IAEtC,uGAAuG;IACvG,CAAA,GAAA,qCAAc,EAAE;QACd,IAAI,iBACF,CAAA,GAAA,sCAAO,EAAE,iBAAiB,aAAa;IAE3C,GAAG;QAAC;KAAgB;IAEpB,OAAO;QACL,WAAW,CAAA,GAAA,gCAAS,EAClB,WACA,kBACA;YACE,qDAAqD;YACrD,oBAAoB;gBAAC,gBAAgB,CAAC,mBAAmB;gBAAE,SAAS,CAAC,mBAAmB;aAAC,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC;QACjH;IAEJ;AACF","sources":["packages/@react-aria/table/src/useTable.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {announce} from '@react-aria/live-announcer';\nimport {GridAria, GridProps, useGrid} from '@react-aria/grid';\nimport {gridIds} from './utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Key, LayoutDelegate, Rect, RefObject, Size} from '@react-types/shared';\nimport {mergeProps, useDescription, useId, useUpdateEffect} from '@react-aria/utils';\nimport {TableKeyboardDelegate} from './TableKeyboardDelegate';\nimport {tableNestedRows} from '@react-stately/flags';\nimport {TableState, TreeGridState} from '@react-stately/table';\nimport {useCollator, useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useMemo} from 'react';\n\nexport interface AriaTableProps extends GridProps {\n /** The layout object for the table. Computes what content is visible and how to position and style them. */\n layoutDelegate?: LayoutDelegate,\n /** @deprecated - Use layoutDelegate instead. */\n layout?: DeprecatedLayout\n}\n\ninterface DeprecatedLayout {\n getLayoutInfo(key: Key): DeprecatedLayoutInfo,\n getContentSize(): Size,\n virtualizer: DeprecatedVirtualizer\n}\n\ninterface DeprecatedLayoutInfo {\n rect: Rect\n}\n\ninterface DeprecatedVirtualizer {\n visibleRect: Rect\n}\n\n/**\n * Provides the behavior and accessibility implementation for a table component.\n * A table displays data in rows and columns and enables a user to navigate its contents via directional navigation keys,\n * and optionally supports row selection and sorting.\n * @param props - Props for the table.\n * @param state - State for the table, as returned by `useTableState`.\n * @param ref - The ref attached to the table element.\n */\nexport function useTable<T>(props: AriaTableProps, state: TableState<T> | TreeGridState<T>, ref: RefObject<HTMLElement | null>): GridAria {\n let {\n keyboardDelegate,\n isVirtualized,\n layoutDelegate,\n layout\n } = props;\n\n // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).\n // When virtualized, the layout object will be passed in as a prop and override this.\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {direction} = useLocale();\n let disabledBehavior = state.selectionManager.disabledBehavior;\n let delegate = useMemo(() => keyboardDelegate || new TableKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n disabledBehavior,\n ref,\n direction,\n collator,\n layoutDelegate,\n layout\n }),Line truncated
@@ -0,0 +1,45 @@
// Copyright (c) 2015 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.
#ifndef UNIX_CTRL_CHARS_H
#define UNIX_CTRL_CHARS_H
inline char decodeUnixCtrlChar(char ch) {
const char ctrlKeys[] = {
/* 0x00 */ '@', /* 0x01 */ 'A', /* 0x02 */ 'B', /* 0x03 */ 'C',
/* 0x04 */ 'D', /* 0x05 */ 'E', /* 0x06 */ 'F', /* 0x07 */ 'G',
/* 0x08 */ 'H', /* 0x09 */ 'I', /* 0x0A */ 'J', /* 0x0B */ 'K',
/* 0x0C */ 'L', /* 0x0D */ 'M', /* 0x0E */ 'N', /* 0x0F */ 'O',
/* 0x10 */ 'P', /* 0x11 */ 'Q', /* 0x12 */ 'R', /* 0x13 */ 'S',
/* 0x14 */ 'T', /* 0x15 */ 'U', /* 0x16 */ 'V', /* 0x17 */ 'W',
/* 0x18 */ 'X', /* 0x19 */ 'Y', /* 0x1A */ 'Z', /* 0x1B */ '[',
/* 0x1C */ '\\', /* 0x1D */ ']', /* 0x1E */ '^', /* 0x1F */ '_',
};
unsigned char uch = ch;
if (uch < 32) {
return ctrlKeys[uch];
} else if (uch == 127) {
return '?';
} else {
return '\0';
}
}
#endif // UNIX_CTRL_CHARS_H
@@ -0,0 +1,96 @@
{
"name": "typescript-eslint",
"version": "8.46.4",
"description": "Tooling which enables you to use TypeScript with ESLint",
"files": [
"dist",
"!*.tsbuildinfo",
"README.md",
"LICENSE"
],
"type": "commonjs",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
},
"types": "./dist/index.d.ts",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"repository": {
"type": "git",
"url": "https://github.com/typescript-eslint/typescript-eslint.git",
"directory": "packages/typescript-eslint"
},
"bugs": {
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"homepage": "https://typescript-eslint.io/packages/typescript-eslint",
"license": "MIT",
"keywords": [
"ast",
"ecmascript",
"javascript",
"typescript",
"parser",
"syntax",
"eslint",
"eslintplugin",
"eslint-plugin"
],
"scripts": {
"build": "yarn run -BT nx build",
"clean": "rimraf dist/ coverage/",
"format": "yarn run -T format",
"lint": "yarn run -BT nx lint",
"test": "yarn run -BT nx test",
"typecheck": "yarn run -BT nx typecheck"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "8.46.4",
"@typescript-eslint/parser": "8.46.4",
"@typescript-eslint/typescript-estree": "8.46.4",
"@typescript-eslint/utils": "8.46.4"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <6.0.0"
},
"devDependencies": {
"@vitest/coverage-v8": "^3.1.3",
"eslint": "*",
"rimraf": "*",
"typescript": "*",
"vitest": "^3.1.3"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"nx": {
"name": "typescript-eslint",
"includedScripts": [
"clean"
],
"targets": {
"lint": {
"command": "eslint"
},
"typecheck": {
"outputs": [
"{workspaceRoot}/dist",
"{projectRoot}/dist"
]
},
"test": {
"dependsOn": [
"^build",
"typecheck"
]
}
}
}
}
@@ -0,0 +1,28 @@
import { Rule, SourceCode } from 'eslint';
/**
* Returns an extended instance of `context.sourceCode` or the result of `context.getSourceCode()`.
* Extended instances can use new APIs such as `getScope(node)` even with old ESLint.
*/
declare function getSourceCode(context: Rule.RuleContext): SourceCode;
/**
* Gets the value of `context.cwd`, but for older ESLint it returns the result of `context.getCwd()`.
* Versions older than v6.6.0 return a value from the result of `process.cwd()`.
*/
declare function getCwd(context: Rule.RuleContext): string;
/**
* Gets the value of `context.filename`, but for older ESLint it returns the result of `context.getFilename()`.
*/
declare function getFilename(context: Rule.RuleContext): string;
/**
* Gets the value of `context.physicalFilename`,
* but for older ESLint it returns the result of `context.getPhysicalFilename()`.
* Versions older than v7.28.0 return a value guessed from the result of `context.getFilename()`,
* but it may be incorrect.
*/
declare function getPhysicalFilename(context: Rule.RuleContext): string;
export { getCwd, getFilename, getPhysicalFilename, getSourceCode };
@@ -0,0 +1,69 @@
{
"name": "has-bigints",
"version": "1.1.0",
"description": "Determine if the JS environment has BigInt support.",
"main": "index.js",
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"",
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"lint": "eslint --ext=js,mjs .",
"postlint": "tsc && attw -P",
"pretest": "npm run lint",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only",
"posttest": "npx npm@'>= 10.2' audit --production"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ljharb/has-bigints.git"
},
"keywords": [
"BigInt",
"bigints",
"typeof",
"ES2020"
],
"author": "Jordan Harband <ljharb@gmail.com>",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/ljharb/has-bigints/issues"
},
"homepage": "https://github.com/ljharb/has-bigints#readme",
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.1",
"@ljharb/eslint-config": "^21.1.1",
"@ljharb/tsconfig": "^0.2.2",
"@types/tape": "^5.8.0",
"auto-changelog": "^2.5.0",
"encoding": "^0.1.13",
"eslint": "=8.8.0",
"in-publish": "^2.0.1",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"tape": "^5.9.0",
"typescript": "next"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows"
]
},
"engines": {
"node": ">= 0.4"
}
}
@@ -0,0 +1 @@
{"version":3,"names":["_gensync","data","require","_async","_util","synchronize","gen","gensync","sync","genTrue","makeWeakCache","handler","makeCachedFunction","WeakMap","makeWeakCacheSync","makeStrongCache","Map","makeStrongCacheSync","CallCache","callCacheSync","callCacheAsync","futureCache","cachedFunction","arg","asyncContext","isAsync","callCache","cached","getCachedValueOrWait","valid","value","cache","CacheConfigurator","handlerResult","finishLock","isIterableIterator","onFirstPause","setupAsyncLocks","updateFunctionCache","delete","release","getCachedValue","cachedValue","get","waitFor","promise","config","Lock","configured","forever","deactivate","mode","set","validator","push","constructor","_active","_never","_forever","_invalidate","_configured","_pairs","_data","simple","makeSimpleConfigurator","Error","never","using","key","fn","maybeAsync","isThenable","then","invalidate","pairs","cacheFn","val","assertSimpleType","cb","released","_resolve","Promise","resolve"],"sources":["../../src/config/caching.ts"],"sourcesContent":["import gensync from \"gensync\";\nimport type { Handler } from \"gensync\";\nimport {\n maybeAsync,\n isAsync,\n onFirstPause,\n waitFor,\n isThenable,\n} from \"../gensync-utils/async.ts\";\nimport { isIterableIterator } from \"./util.ts\";\n\nexport type { CacheConfigurator };\n\nexport type SimpleCacheConfigurator = {\n (forever: boolean): void;\n <T extends SimpleType>(handler: () => T): T;\n\n forever: () => void;\n never: () => void;\n using: <T extends SimpleType>(handler: () => T) => T;\n invalidate: <T extends SimpleType>(handler: () => T) => T;\n};\n\nexport type CacheEntry<ResultT, SideChannel> = Array<{\n value: ResultT;\n valid: (channel: SideChannel) => Handler<boolean>;\n}>;\n\nconst synchronize = <ArgsT extends unknown[], ResultT>(\n gen: (...args: ArgsT) => Handler<ResultT>,\n): ((...args: ArgsT) => ResultT) => {\n return gensync(gen).sync;\n};\n\n// eslint-disable-next-line require-yield\nfunction* genTrue() {\n return true;\n}\n\nexport function makeWeakCache<ArgT extends object, ResultT, SideChannel>(\n handler: (\n arg: ArgT,\n cache: CacheConfigurator<SideChannel>,\n ) => Handler<ResultT> | ResultT,\n): (arg: ArgT, data: SideChannel) => Handler<ResultT> {\n return makeCachedFunction<ArgT, ResultT, SideChannel>(WeakMap, handler);\n}\n\nexport function makeWeakCacheSync<ArgT extends object, ResultT, SideChannel>(\n handler: (arg: ArgT, cache?: CacheConfigurator<SideChannel>) => ResultT,\n): (arg: ArgT, data?: SideChannel) => ResultT {\n return synchronize<[ArgT, SideChannel], ResultT>(\n makeWeakCache<ArgT, ResultT, SideChannel>(handler),\n );\n}\n\nexport function makeStrongCache<ArgT, ResultT, SideChannel>(\n handler: (\n arg: ArgT,\n cache: CacheConfigurator<SideChannel>,\n ) => Handler<ResultT> | ResultT,\n): (arg: ArgT, data: SideChannel) => Handler<ResultT> {\n return makeCachedFunction<ArgT, ResultT, SideChannel>(Map, handler);\n}\n\nexport function makeStrongCacheSync<ArgT, ResultT, SideChannel>(\n handler: (arg: ArgT, cache?: CacheConfigurator<SideChannel>) => ResultT,\n): (arg: ArgT, data?: SideChannel) => ResultT {\n return synchronize<[ArgT, SideChannel], ResultT>(\n makeStrongCache<ArgT, ResultT, SideChannel>(handler),\n );\n}\n\n/* NOTE: Part of the logic explained in this comment is explained in the\n * getCachedValueOrWait and setupAsyncLocks functions.\n *\n * > There are only two hard things in Computer Science: cache invalidation and naming things.\n * > -- Phil Karlton\n *\n * I don't know if Phil was also thinking about handling a cache whose invalidation function is\n * defined asynchronously is considered, but it is REALLY hard to do correctly.\n *\n * The implemented logic (only when gensync is run asynchronously) is the following:\n * 1. If there is a valid cache associated to the current \"arg\" parameter,\n * a. RETURN the cached value\n * 3. If there is a FinishLock associated to the current \"arg\" parameter representing a valid cache,\n * a. Wait for that lock to be released\n * b. RETURN the value associated with that lock\n * 5. Start executing the function to be cached\n * a. If it pauses on a promise, then\n * i. Let FinishLock be a new lock\n * ii. Store FinishLock as associated to the current \"arg\" parameter\n * iii. Wait for the function to finish executing\n * iv. Release FinishLock\n * v. Send the function result to anyone waiting on FinishLock\n * 6. Store the result in the cache\n * 7. RETURN the result\n */\nfunction makeCachedFunction<ArgT, ResultT, SideChannel>(\n CallCache: new <Cached>() => CacheMap<ArgT, Cached, SideChannel>,\n handler: (\n arg: ArgT,\n cache: CacheConfigurator<SideChannel>,\n ) => Handler<ResultT> | ResultT,\n): (arg: ArgT, data: SideChannel) => Handler<ResultT> {\n const callCacheSync = new CallCache<ResultT>();\n const callCacheAsync = new CallCaLine truncated
@@ -0,0 +1,4 @@
{
"//": "this file is here to make typescript happy when moduleResolution=node16+",
"version": "0.0.0"
}
@@ -0,0 +1 @@
{"mappings":";;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/form/src/index.ts"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useFormValidation} from './useFormValidation';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,21 @@
import { toast } from '../core/toast';
export type {
DefaultToastOptions,
IconTheme,
Renderable,
Toast,
ToasterProps,
ToastOptions,
ToastPosition,
ToastType,
ValueFunction,
ValueOrFunction,
} from '../core/types';
export { resolveValue } from '../core/types';
export { useToaster } from '../core/use-toaster';
export { useStore as useToasterStore } from '../core/store';
export { toast };
export default toast;
@@ -0,0 +1,21 @@
export { AutoScrollActivator, TraversalOrder, useAutoScroller, } from './useAutoScroller';
export type { Options as AutoScrollOptions } from './useAutoScroller';
export { useCachedNode } from './useCachedNode';
export { useCombineActivators } from './useCombineActivators';
export { useDroppableMeasuring, MeasuringFrequency, MeasuringStrategy, } from './useDroppableMeasuring';
export type { DroppableMeasuring } from './useDroppableMeasuring';
export { useInitialValue } from './useInitialValue';
export { useInitialRect } from './useInitialRect';
export { useRect } from './useRect';
export { useRectDelta } from './useRectDelta';
export { useResizeObserver } from './useResizeObserver';
export { useScrollableAncestors } from './useScrollableAncestors';
export { useScrollIntoViewIfNeeded } from './useScrollIntoViewIfNeeded';
export { useScrollOffsets } from './useScrollOffsets';
export { useScrollOffsetsDelta } from './useScrollOffsetsDelta';
export { useSensorSetup } from './useSensorSetup';
export { useSyntheticListeners } from './useSyntheticListeners';
export type { SyntheticListener, SyntheticListeners, SyntheticListenerMap, } from './useSyntheticListeners';
export { useRects } from './useRects';
export { useWindowRect } from './useWindowRect';
export { useDragOverlayMeasuring } from './useDragOverlayMeasuring';
@@ -0,0 +1,254 @@
import path from 'node:path';
import { createRule, ExportMap, getValue } from '../utils/index.js';
export default createRule({
name: 'no-rename-default',
meta: {
type: 'suggestion',
docs: {
category: 'Helpful warnings',
description: 'Forbid importing a default export by a different name.',
},
schema: [
{
type: 'object',
properties: {
commonjs: {
default: false,
type: 'boolean',
},
preventRenamingBindings: {
default: true,
type: 'boolean',
},
},
additionalProperties: false,
},
],
messages: {
renameDefault: 'Caution: `{{importBasename}}` has a default export `{{defaultExportName}}`. This {{requiresOrImports}} `{{defaultExportName}}` as `{{importName}}`. Check if you meant to write `{{suggestion}}` instead.',
},
},
defaultOptions: [],
create(context) {
const { commonjs = false, preventRenamingBindings = true } = context.options[0] || {};
function getDefaultExportName(targetNode) {
if (targetNode == null) {
return;
}
switch (targetNode.type) {
case 'AssignmentExpression': {
if (!preventRenamingBindings) {
return;
}
if (targetNode.left.type !== 'Identifier') {
return;
}
return targetNode.left.name;
}
case 'CallExpression': {
const [argumentNode] = targetNode.arguments;
return getDefaultExportName(argumentNode);
}
case 'ClassDeclaration': {
if (targetNode.id && typeof targetNode.id.name === 'string') {
return targetNode.id.name;
}
return;
}
case 'ExportSpecifier': {
return getValue(targetNode.local);
}
case 'FunctionDeclaration': {
return targetNode.id?.name;
}
case 'Identifier': {
if (!preventRenamingBindings) {
return;
}
return targetNode.name;
}
default:
}
}
function getExportMap(source) {
if (!source) {
return;
}
const exportMap = ExportMap.get(source.value, context);
if (exportMap == null) {
return;
}
if (exportMap.errors.length > 0) {
exportMap.reportErrors(context, { source });
return;
}
return exportMap;
}
function handleImport(node) {
const exportMap = getExportMap(node.parent.source);
if (exportMap == null) {
return;
}
const defaultExportNode = getDefaultExportNode(exportMap);
if (defaultExportNode == null) {
return;
}
const defaultExportName = getDefaultExportName(defaultExportNode);
if (defaultExportName === undefined) {
return;
}
const importTarget = node.parent.source?.value;
const importBasename = path.basename(exportMap.path);
if (node.type === 'ImportDefaultSpecifier') {
const importName = node.local.name;
if (importName === defaultExportName) {
return;
}
context.report({
node,
messageId: 'renameDefault',
data: {
importBasename,
defaultExportName,
importName,
requiresOrImports: 'imports',
suggestion: `import ${defaultExportName} from '${importTarget}'`,
},
});
return;
}
if (node.type !== 'ImportSpecifier') {
return;
}
if (getValue(node.imported) !== 'default') {
return;
}
const actualImportedName = node.local.name;
if (actualImportedName === defaultExportName) {
return;
}
context.report({
node,
messageId: 'renameDefault',
data: {
importBasename,
defaultExportName,
importName: actualImportedName,
requiresOrImports: 'imports',
suggestion: `import { default as ${defaultExportName} } from '${importTarget}'`,
},
});
}
function handleRequire(node) {
if (!commonjs ||
node.type !== 'VariableDeclarator' ||
!node.id ||
!(node.id.type === 'Identifier' || node.id.type === 'ObjectPattern') ||
!node.init ||
node.init.type !== 'CallExpression') {
return;
}
let defaultDestructure;
if (node.id.type === 'ObjectPattern') {
defaultDestructure = findDefaultDestructure(node.id.properties);
if (defaultDestructure === undefined) {
return;
}
}
const call = node.init;
const [source] = call.arguments;
if (call.callee.type !== 'Identifier' ||
call.callee.name !== 'require' ||
call.arguments.length !== 1 ||
source.type !== 'Literal' ||
typeof source.value !== 'string') {
return;
}
const exportMap = getExportMap(source);
if (exportMap == null) {
return;
}
const defaultExportNode = getDefaultExportNode(exportMap);
if (defaultExportNode == null) {
return;
}
const defaultExportName = getDefaultExportName(defaultExportNode);
const requireTarget = source.value;
const requireBasename = path.basename(exportMap.path);
let requireName;
if (node.id.type === 'Identifier') {
requireName = node.id.name;
}
else if (defaultDestructure?.value?.type === 'Identifier') {
requireName = defaultDestructure.value.name;
}
else {
requireName = '';
}
if (defaultExportName === undefined) {
return;
}
if (requireName === defaultExportName) {
return;
}
if (node.id.type === 'Identifier') {
context.report({
node,
messageId: 'renameDefault',
data: {
importBasename: requireBasename,
defaultExportName,
importName: requireName,
requiresOrImports: 'requires',
suggestion: `const ${defaultExportName} = require('${requireTarget}')`,
},
});
return;
}
context.report({
node,
messageId: 'renameDefault',
data: {
importBasename: requireBasename,
defaultExportName,
importName: requireName,
requiresOrImports: 'requires',
suggestion: `const { default: ${defaultExportName} } = require('${requireTarget}')`,
},
});
}
return {
ImportDefaultSpecifier: handleImport,
ImportSpecifier: handleImport,
VariableDeclarator: handleRequire,
};
},
});
function findDefaultDestructure(properties) {
const found = properties.find(property => {
if ('key' in property &&
'name' in property.key &&
property.key.name === 'default') {
return property;
}
});
return found;
}
function getDefaultExportNode(exportMap) {
const defaultExportNode = exportMap.exports.get('default');
if (defaultExportNode == null) {
return;
}
switch (defaultExportNode.type) {
case 'ExportDefaultDeclaration': {
return defaultExportNode.declaration;
}
case 'ExportNamedDeclaration': {
return defaultExportNode.specifiers.find(specifier => getValue(specifier.exported) === 'default');
}
default: {
return;
}
}
}
//# sourceMappingURL=no-rename-default.js.map
@@ -0,0 +1,99 @@
/**
* @author Vignesh Anand
* See LICENSE file in root directory for full license.
*/
"use strict"
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
const querySelector = [
`MemberExpression`,
`[computed!=true]`,
`[object.name="process"]`,
`[property.name="env"]`,
`,`,
`MemberExpression`,
`[computed=true]`,
`[object.name="process"]`,
`[property.value="env"]`,
]
/**
* @param {unknown} node [description]
* @returns {node is import('estree').MemberExpression}
*/
function isMemberExpresion(node) {
return (
node != null &&
typeof node === "object" &&
"type" in node &&
node.type === "MemberExpression"
)
}
/**
* @typedef {[
* {
* allowedVariables?: string[]
* }?
* ]} RuleOptions
*/
/** @type {import('./rule-module').RuleModule<{RuleOptions: RuleOptions}>} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "disallow the use of `process.env`",
recommended: false,
url: "https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-process-env.md",
},
fixable: null,
schema: [
{
type: "object",
properties: {
allowedVariables: {
type: "array",
items: { type: "string" },
},
},
additionalProperties: false,
},
],
messages: {
unexpectedProcessEnv: "Unexpected use of process.env.",
},
},
create(context) {
const options = context.options[0] ?? {}
/** @type {string[]} */
const allowedVariables = options.allowedVariables ?? []
return {
/** @param {import('estree').MemberExpression} node */
[querySelector.join("")](node) {
if (
"parent" in node &&
isMemberExpresion(node.parent) &&
node.parent.property != null
) {
const child = node.parent.property
if (
(child.type === "Identifier" &&
node.parent.computed === false &&
allowedVariables.includes(child.name)) ||
(child.type === "Literal" &&
typeof child.value === "string" &&
node.parent.computed === true &&
allowedVariables.includes(child.value))
) {
return
}
}
context.report({ node, messageId: "unexpectedProcessEnv" })
},
}
},
}
@@ -0,0 +1,79 @@
/**
* Copyright (c) 2020, Microsoft Corporation (MIT License).
*/
import { Worker } from 'worker_threads';
import { Socket } from 'net';
import { IDisposable } from './types';
import { IWorkerData, ConoutWorkerMessage, getWorkerPipeName } from './shared/conout';
import { join } from 'path';
import { IEvent, EventEmitter2 } from './eventEmitter2';
/**
* The amount of time to wait for additional data after the conpty shell process has exited before
* shutting down the worker and sockets. The timer will be reset if a new data event comes in after
* the timer has started.
*/
const FLUSH_DATA_INTERVAL = 1000;
/**
* Connects to and manages the lifecycle of the conout socket. This socket must be drained on
* another thread in order to avoid deadlocks where Conpty waits for the out socket to drain
* when `ClosePseudoConsole` is called. This happens when data is being written to the terminal when
* the pty is closed.
*
* See also:
* - https://github.com/microsoft/node-pty/issues/375
* - https://github.com/microsoft/vscode/issues/76548
* - https://github.com/microsoft/terminal/issues/1810
* - https://docs.microsoft.com/en-us/windows/console/closepseudoconsole
*/
export class ConoutConnection implements IDisposable {
private _worker: Worker;
private _drainTimeout: NodeJS.Timeout | undefined;
private _isDisposed: boolean = false;
private _onReady = new EventEmitter2<void>();
public get onReady(): IEvent<void> { return this._onReady.event; }
constructor(
private _conoutPipeName: string
) {
const workerData: IWorkerData = { conoutPipeName: _conoutPipeName };
const scriptPath = __dirname.replace('node_modules.asar', 'node_modules.asar.unpacked');
this._worker = new Worker(join(scriptPath, 'worker/conoutSocketWorker.js'), { workerData });
this._worker.on('message', (message: ConoutWorkerMessage) => {
switch (message) {
case ConoutWorkerMessage.READY:
this._onReady.fire();
return;
default:
console.warn('Unexpected ConoutWorkerMessage', message);
}
});
}
dispose(): void {
if (this._isDisposed) {
return;
}
this._isDisposed = true;
// Drain all data from the socket before closing
this._drainDataAndClose();
}
connectSocket(socket: Socket): void {
socket.connect(getWorkerPipeName(this._conoutPipeName));
}
private _drainDataAndClose(): void {
if (this._drainTimeout) {
clearTimeout(this._drainTimeout);
}
this._drainTimeout = setTimeout(() => this._destroySocket(), FLUSH_DATA_INTERVAL);
}
private async _destroySocket(): Promise<void> {
await this._worker.terminate();
}
}
@@ -0,0 +1 @@
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,function(t){"use strict";function e(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function n(t){let e;return()=>(void 0===e&&(e=t()),e)}const i=t=>t,s=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},o=t=>1e3*t,a=t=>t/1e3;function r(t,e){return n=t,Array.isArray(n)&&"number"!=typeof n[0]?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t;var n}const u=(t,e,n)=>t+(e-t)*n,l=2e4;function h(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(function(t){let e=0,n=t.next(e);for(;!n.done&&e<l;)e+=50,n=t.next(e);return e>=l?1/0:e}(i),l);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:a(s)}}function c(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const o=s(0,e,i);t.push(u(n,1,o))}}function f(t){const e=[0];return c(e,t.length-1),e}const d=t=>null!==t;class m{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}function p(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const y=t=>t.startsWith("--");const g=n(()=>void 0!==window.ScrollTimeline),A={};function b(t,e){const i=n(t);return()=>A[e]??i()}const T=b(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),v=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,w={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:v([0,.65,.55,1]),circOut:v([.55,0,1,.45]),backIn:v([.31,.01,.66,-.59]),backOut:v([.33,1.53,.69,.99])};function M(t,e){return t?"function"==typeof t?T()?((t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`})(t,e):"ease-out":(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?v(t):Array.isArray(t)?t.map(t=>M(t,e)||w.easeOut):w[t]:void 0}function k(t){return"function"==typeof t&&"applyToOptions"in t}class x extends m{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:r}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t,t.type;const u=function({type:t,...e}){return k(t)&&T()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:a="loop",ease:r="easeOut",times:u}={},l){const h={[e]:n};u&&(h.offset=u);const c=M(r,s);Array.isArray(c)&&(h.easing=c);const f={delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"};return l&&(f.pseudoElement=l),t.animate(h,f)}(e,n,i,u,s),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=function(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(d),a=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return a&&void 0!==i?i:o[a]}(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){y(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}r?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return a(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+a(t)}get time(){return a(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=o(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&g()?(this.animation.timeline=t,i):e(this)}}class E{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animatLine truncated
@@ -0,0 +1 @@
{"mappings":";;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-stately/grid/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useGridState} from './useGridState';\nexport {GridCollection} from './GridCollection';\n\nexport type {GridStateOptions, GridState} from './useGridState';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,134 @@
/**
* @fileoverview Enforce that elements with ARIA roles must
* have all required attributes for that role.
* @author Ethan Cohen
*/
// -----------------------------------------------------------------------------
// Requirements
// -----------------------------------------------------------------------------
import { roles } from 'aria-query';
import { RuleTester } from 'eslint';
import parserOptionsMapper from '../../__util__/parserOptionsMapper';
import parsers from '../../__util__/helpers/parsers';
import rule from '../../../src/rules/role-has-required-aria-props';
// -----------------------------------------------------------------------------
// Tests
// -----------------------------------------------------------------------------
const ruleTester = new RuleTester();
const errorMessage = (role) => {
const requiredProps = Object.keys(roles.get(role).requiredProps);
return {
message: `Elements with the ARIA role "${role}" must have the following attributes defined: ${requiredProps}`,
type: 'JSXAttribute',
};
};
const componentsSettings = {
'jsx-a11y': {
components: {
MyComponent: 'div',
},
},
};
// Create basic test cases using all valid role types.
const basicValidityTests = roles.keys().map((role) => {
const {
requiredProps: requiredPropKeyValues,
} = roles.get(role);
const requiredProps = Object.keys(requiredPropKeyValues);
const propChain = requiredProps.join(' ');
return {
code: `<div role="${role.toLowerCase()}" ${propChain} />`,
};
});
ruleTester.run('role-has-required-aria-props', rule, {
valid: parsers.all([].concat(
{ code: '<Bar baz />' },
{ code: '<MyComponent role="combobox" />' },
// Variables should pass, as we are only testing literals.
{ code: '<div />' },
{ code: '<div></div>' },
{ code: '<div role={role} />' },
{ code: '<div role={role || "button"} />' },
{ code: '<div role={role || "foobar"} />' },
{ code: '<div role="row" />' },
{ code: '<span role="checkbox" aria-checked="false" aria-labelledby="foo" tabindex="0"></span>' },
{ code: '<input role="checkbox" aria-checked="false" aria-labelledby="foo" tabindex="0" {...props} type="checkbox" />' },
{ code: '<input type="checkbox" role="switch" />' },
{ code: '<MyComponent role="checkbox" aria-checked="false" aria-labelledby="foo" tabindex="0" />', settings: componentsSettings },
{ code: '<div role="heading" aria-level={2} />' },
{ code: '<div role="heading" aria-level="3" />' },
)).concat(basicValidityTests).map(parserOptionsMapper),
invalid: parsers.all([].concat(
// SLIDER
{ code: '<div role="slider" />', errors: [errorMessage('slider')] },
{
code: '<div role="slider" aria-valuemax />',
errors: [errorMessage('slider')],
},
{
code: '<div role="slider" aria-valuemax aria-valuemin />',
errors: [errorMessage('slider')],
},
// CHECKBOX
{ code: '<div role="checkbox" />', errors: [errorMessage('checkbox')] },
{ code: '<div role="checkbox" checked />', errors: [errorMessage('checkbox')] },
{
code: '<div role="checkbox" aria-chcked />',
errors: [errorMessage('checkbox')],
},
{
code: '<span role="checkbox" aria-labelledby="foo" tabindex="0"></span>',
errors: [errorMessage('checkbox')],
},
// COMBOBOX
{ code: '<div role="combobox" />', errors: [errorMessage('combobox')] },
{ code: '<div role="combobox" expanded />', errors: [errorMessage('combobox')] },
{
code: '<div role="combobox" aria-expandd />',
errors: [errorMessage('combobox')],
},
// SCROLLBAR
{ code: '<div role="scrollbar" />', errors: [errorMessage('scrollbar')] },
{
code: '<div role="scrollbar" aria-valuemax />',
errors: [errorMessage('scrollbar')],
},
{
code: '<div role="scrollbar" aria-valuemax aria-valuemin />',
errors: [errorMessage('scrollbar')],
},
{
code: '<div role="scrollbar" aria-valuemax aria-valuenow />',
errors: [errorMessage('scrollbar')],
},
{
code: '<div role="scrollbar" aria-valuemin aria-valuenow />',
errors: [errorMessage('scrollbar')],
},
{
code: '<div role="heading" />',
errors: [errorMessage('heading')],
},
{
code: '<div role="option" />',
errors: [errorMessage('option')],
},
// Custom element
{ code: '<MyComponent role="combobox" />', settings: componentsSettings, errors: [errorMessage('combobox')] },
)).map(parserOptionsMapper),
});
@@ -0,0 +1 @@
var l=Object.defineProperty;var i=(n,r)=>l(n,"name",{value:r,configurable:!0});import{r as a}from"./get-pipe-path-BHW2eJdv.mjs";import{constants as f}from"node:os";import{isMainThread as d}from"node:worker_threads";import{c as u}from"./client-BQVF1NaW.mjs";import"./suppress-warnings.mjs";import"module";import"node:path";import"./temporary-directory-CwHp0_NW.mjs";import"node:net";const m=i((n,r)=>{const o=new Map;for(const e of n){const t=i(s=>{r(s),process.listenerCount(e)===0&&process.exit(128+f.signals[e])},"hiddenHandler");process.on(e,t),o.set(e,t)}const{listenerCount:c,listeners:p}=process;process.listenerCount=function(e){let t=Reflect.apply(c,this,arguments);return n.includes(e)&&(t-=1),t},process.listeners=function(e){const t=Reflect.apply(p,this,arguments);return n.includes(e)?t.filter(s=>s!==o.get(e)):t}},"bindHiddenSignalsHandler");d&&(a("./cjs/index.cjs"),(async()=>{const n=await u;n&&m(["SIGINT","SIGTERM"],r=>{n({type:"signal",signal:r})})})());
@@ -0,0 +1,33 @@
import { OneBotAction } from '../../action/OneBotAction';
import { Static } from '@sinclair/typebox';
declare const PayloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
folder_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
folder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
}>;
type PayloadType = Static<typeof PayloadSchema>;
declare const ReturnSchema: import("@sinclair/typebox").TAny;
type ReturnType = Static<typeof ReturnSchema>;
export declare class DeleteGroupFileFolder extends OneBotAction<PayloadType, ReturnType> {
actionName: "delete_group_folder";
payloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
folder_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
folder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
}>;
returnSchema: import("@sinclair/typebox").TAny;
actionSummary: string;
actionDescription: string;
actionTags: string[];
payloadExample: {
group_id: string;
folder_id: string;
};
returnExample: {};
_handle(payload: PayloadType): Promise<{
retCode: number;
retMsg: string;
clientWording: string;
}>;
}
export {};
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoerceOptionsToObject = CoerceOptionsToObject;
var _262_1 = require("./262");
/**
* https://tc39.es/ecma402/#sec-coerceoptionstoobject
* @param options
* @returns
*/
function CoerceOptionsToObject(options) {
if (typeof options === 'undefined') {
return Object.create(null);
}
return (0, _262_1.ToObject)(options);
}
@@ -0,0 +1,31 @@
/**
* Converts snake_case to lowerCamelCase.
*
* Should behave like protoc:
* https://github.com/protocolbuffers/protobuf/blob/e8ae137c96444ea313485ed1118c5e43b2099cf1/src/google/protobuf/compiler/java/java_helpers.cc#L118
*/
export function lowerCamelCase(snakeCase) {
let capNext = false;
const sb = [];
for (let i = 0; i < snakeCase.length; i++) {
let next = snakeCase.charAt(i);
if (next == '_') {
capNext = true;
}
else if (/\d/.test(next)) {
sb.push(next);
capNext = true;
}
else if (capNext) {
sb.push(next.toUpperCase());
capNext = false;
}
else if (i == 0) {
sb.push(next.toLowerCase());
}
else {
sb.push(next);
}
}
return sb.join('');
}
@@ -0,0 +1,18 @@
/**
* DON'T EDIT THIS FILE.
* This file was generated by "scripts/update-lib-configs.js" script.
*/
"use strict"
module.exports = {
extends: [
require.resolve("./no-new-in-es2023-intl-api"),
require.resolve("./no-new-in-es2022-intl-api"),
require.resolve("./no-new-in-es2021-intl-api"),
require.resolve("./no-new-in-es2020-intl-api"),
require.resolve("./no-new-in-es2019-intl-api"),
require.resolve("./no-new-in-es2018-intl-api"),
require.resolve("./no-new-in-es2017-intl-api"),
require.resolve("./no-new-in-es2016-intl-api"),
],
}
@@ -0,0 +1,94 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $SyntaxError = require('es-errors/syntax');
var $TypeError = require('es-errors/type');
var $Uint8Array = GetIntrinsic('%Uint8Array%', true);
var isInteger = require('math-intrinsics/isInteger');
var IsDetachedBuffer = require('./IsDetachedBuffer');
var NumberToRawBytes = require('./NumberToRawBytes');
var isArrayBuffer = require('is-array-buffer');
var isSharedArrayBuffer = require('is-shared-array-buffer');
var hasOwn = require('hasown');
var tableTAO = require('./tables/typed-array-objects');
var defaultEndianness = require('../helpers/defaultEndianness');
var forEach = require('../helpers/forEach');
// https://262.ecma-international.org/8.0/#sec-setvalueinbuffer
/* eslint max-params: 0 */
module.exports = function SetValueInBuffer(arrayBuffer, byteIndex, type, value, isTypedArray, order) {
var isSAB = isSharedArrayBuffer(arrayBuffer);
if (!isArrayBuffer(arrayBuffer) && !isSAB) {
throw new $TypeError('Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer');
}
if (!isInteger(byteIndex)) {
throw new $TypeError('Assertion failed: `byteIndex` must be an integer');
}
if (typeof type !== 'string' || !hasOwn(tableTAO.size, '$' + type)) {
throw new $TypeError('Assertion failed: `type` must be one of ' + tableTAO.choices);
}
if (typeof value !== 'number') {
throw new $TypeError('Assertion failed: `value` must be a number');
}
if (typeof isTypedArray !== 'boolean') {
throw new $TypeError('Assertion failed: `isTypedArray` must be a boolean');
}
if (order !== 'SeqCst' && order !== 'Unordered' && order !== 'Init') {
throw new $TypeError('Assertion failed: `order` must be `"SeqCst"`, `"Unordered"`, or `"Init"`');
}
if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
throw new $TypeError('Assertion failed: `isLittleEndian` must be a boolean, if present');
}
if (IsDetachedBuffer(arrayBuffer)) {
throw new $TypeError('Assertion failed: ArrayBuffer is detached'); // step 1
}
// 2. Assert: There are sufficient bytes in arrayBuffer starting at byteIndex to represent a value of type.
if (byteIndex < 0) {
throw new $TypeError('Assertion failed: `byteIndex` must be non-negative'); // step 3
}
// 4. Assert: Type(value) is Number.
// 5. Let block be arrayBuffer.[[ArrayBufferData]].
var elementSize = tableTAO.size['$' + type]; // step 6
// 7. If isLittleEndian is not present, set isLittleEndian to to the value of the [[LittleEndian]] field of the surrounding agent's Agent Record.
var isLittleEndian = arguments.length > 6 ? arguments[6] : defaultEndianness === 'little'; // step 8
var rawBytes = NumberToRawBytes(type, value, isLittleEndian); // step 8
if (isSAB) { // step 9
/*
Let execution be the [[CandidateExecution]] field of the surrounding agent's Agent Record.
Let eventList be the [[EventList]] field of the element in execution.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
If isTypedArray is true and IsNoTearConfiguration(type, order) is true, let noTear be true; otherwise let noTear be false.
Append WriteSharedMemory { [[Order]]: order, [[NoTear]]: noTear, [[Block]]: block, [[ByteIndex]]: byteIndex, [[ElementSize]]: elementSize, [[Payload]]: rawBytes } to eventList.
*/
throw new $SyntaxError('SharedArrayBuffer is not supported by this implementation');
} else {
// 10. Store the individual bytes of rawBytes into block, in order, starting at block[byteIndex].
var arr = new $Uint8Array(arrayBuffer, byteIndex, elementSize);
forEach(rawBytes, function (rawByte, i) {
arr[i] = rawByte;
});
}
// 11. Return NormalCompletion(undefined).
};
@@ -0,0 +1,90 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
import { util } from "../helpers/util.js";
const promSchema = z.promise(
z.object({
name: z.string(),
age: z.number(),
})
);
test("promise inference", () => {
type promSchemaType = z.infer<typeof promSchema>;
util.assertEqual<promSchemaType, Promise<{ name: string; age: number }>>(true);
});
test("promise parsing success", async () => {
const pr = promSchema.parse(Promise.resolve({ name: "Bobby", age: 10 }));
expect(pr).toBeInstanceOf(Promise);
const result = await pr;
expect(typeof result).toBe("object");
expect(typeof result.age).toBe("number");
expect(typeof result.name).toBe("string");
});
test("promise parsing success 2", () => {
const fakePromise = {
then() {
return this;
},
catch() {
return this;
},
};
promSchema.parse(fakePromise);
});
test("promise parsing fail", async () => {
const bad = promSchema.parse(Promise.resolve({ name: "Bobby", age: "10" }));
// return await expect(bad).resolves.toBe({ name: 'Bobby', age: '10' });
return await expect(bad).rejects.toBeInstanceOf(z.ZodError);
// done();
});
test("promise parsing fail 2", async () => {
const failPromise = promSchema.parse(Promise.resolve({ name: "Bobby", age: "10" }));
await expect(failPromise).rejects.toBeInstanceOf(z.ZodError);
// done();/z
});
test("promise parsing fail", () => {
const bad = () => promSchema.parse({ then: () => {}, catch: {} });
expect(bad).toThrow();
});
// test('sync promise parsing', () => {
// expect(() => z.promise(z.string()).parse(Promise.resolve('asfd'))).toThrow();
// });
const asyncFunction = z.function(z.tuple([]), promSchema);
test("async function pass", async () => {
const validatedFunction = asyncFunction.implement(async () => {
return { name: "jimmy", age: 14 };
});
await expect(validatedFunction()).resolves.toEqual({
name: "jimmy",
age: 14,
});
});
test("async function fail", async () => {
const validatedFunction = asyncFunction.implement(() => {
return Promise.resolve("asdf" as any);
});
await expect(validatedFunction()).rejects.toBeInstanceOf(z.ZodError);
});
test("async promise parsing", () => {
const res = z.promise(z.number()).parseAsync(Promise.resolve(12));
expect(res).toBeInstanceOf(Promise);
});
test("resolves", () => {
const foo = z.literal("foo");
const res = z.promise(foo);
expect(res.unwrap()).toEqual(foo);
});
@@ -0,0 +1,31 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { Range } = require("semver")
const cache = new Map()
/**
* Get the `semver.Range` object of a given range text.
* @param {string} x The text expression for a semver range.
* @returns {Range|undefined} The range object of a given range text.
* It's null if the `x` is not a valid range text.
*/
module.exports = function getSemverRange(x) {
const stringVersion = String(x)
const cached = cache.get(stringVersion)
if (cached != null) {
return cached
}
try {
const output = new Range(stringVersion)
cache.set(stringVersion, output)
return output
} catch {
// Ignore parsing error.
cache.set(stringVersion, null)
}
}
@@ -0,0 +1,722 @@
flf2a$ 7 6 20 -1 7
fatty.flf by Mike Rosulek. 1/12/95
Based on Bravo TrueType Font.
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $##
d8b $#
!Y88!$#
Y8Y $#
8 $#
e $#
"8" $#
$##
8 8$#
Y P$#
$#
$#
$#
$#
$##
dP dP$#
____dP__dP_$#
dP dP $#
__dP__dP___$#
dP dP $#
dP dP $#
$##
,d88~/\$#
8888/ $#
`Y88b $#
`Y88b,$#
/8888$#
\/_88P'$#
$##
,8~\ /$#
"8_// $#
/ $#
/ $#
/,8~\$#
/ "8_/$#
$##
,d8P\ $#
888b | $#
`Y88X $#
/Y88b/ $#
| `Y88b $#
\_/Y88b$#
$##
d88b$#
Y88P$#
__/ $#
$#
$#
$#
$##
,8P~$#
88 $#
88 $#
88 $#
88 $#
88 $#
"8b_$##
~Y8,$#
88$#
88$#
88$#
88$#
88$#
_d8"$##
, 8 ,$#
"8" $#
e" "e$#
$#
$#
$#
$##
$#
888 $#
__888__$#
888 $#
888 $#
$#
$##
$#
$#
$#
$#
d88b$#
Y88P$#
__/ $##
$#
$#
____$#
$#
$#
$#
$##
$#
$#
$#
$#
d88b$#
Y88P$#
$##
/$#
/ $#
/ $#
/ $#
/ $#
/ $#
/ $##
,88~~\ $#
d888 \ $#
88888 |$#
88888 |$#
Y888 / $#
`88__/ $#
$##
,d$#
,d888$#
888$#
888$#
888$#
888$#
$##
/~~88b$#
| 888$#
` d88P$#
d88P $#
d88P $#
d88P___$#
$##
_-~88e $#
888b$#
__888"$#
888e$#
888P$#
~-_88" $#
$##
d8 $#
d88 $#
d888 $#
/ 888 $#
/__888__$#
888 $#
$##
/~~~~~~$#
/ $#
`-~~88e $#
/ 888b$#
| 888P$#
\__88" $#
$##
e88~-_ $#
d888 $#
8888~~\ $#
8888 |$#
Y888 |$#
"88__/ $#
$##
[~~~~d88P$#
d88P $#
d88P $#
d88P $#
d88P $#
d88P $#
$##
d8~~\ $#
C88b |$#
Y88b/ $#
/Y88b $#
| Y88D$#
\__8P $#
$##
/~~88e $#
| 888b$#
| 8888$#
\__8888$#
888P$#
~-_88" $#
$##
$#
d88b$#
Y88P$#
$#
d88b$#
Y88P$#
$##
$#
d88b$#
Y88P$#
$#
d88b$#
Y88P$#
__/ $##
_-$#
_-~ $#
< $#
~-_ $#
~-$#
$#
$##
$#
______$#
$#
______$#
$#
$#
$##
-_ $#
~-_ $#
>$#
_-~ $#
-~ $#
$#
$##
_-~88e$#
/ 88"$#
` 8P $#
` $#
d88b $#
Y88P $#
$##
__---__ $#
/ \ $#
| dP~dP |$#
| dP_d8b_/ $#
\______ $#
$#
$##
e $#
d8b $#
/Y88b $#
/ Y88b $#
/____Y88b $#
/ Y88b$#
$##
888~~\ $#
888 |$#
888 _/ $#
888 \ $#
888 |$#
888__/ $#
$##
e88~-_ $#
d888 \$#
8888 $#
8888 $#
Y888 /$#
"88_-~ $#
$##
888~-_ $#
888 \ $#
888 |$#
888 |$#
888 / $#
888_-~ $#
$##
888~~ $#
888___$#
888 $#
888 $#
888 $#
888___$#
$##
888~~ $#
888___$#
888 $#
888 $#
888 $#
888 $#
$##
e88~~\ $#
d888 $#
8888 __ $#
8888 |$#
Y888 |$#
"88__/ $#
$##
888 |$#
888___|$#
888 |$#
888 |$#
888 |$#
888 |$#
$##
888$#
888$#
888$#
888$#
888$#
888$#
$##
888$#
888$#
888$#
888$#
| 88P$#
\__8" $#
$##
888 / $#
888 / $#
888/\ $#
888 \ $#
888 \ $#
888 \$#
$##
888 $#
888 $#
888 $#
888 $#
888 $#
888____$#
$##
e e $#
d8b d8b $#
d888bdY88b $#
/ Y88Y Y888b $#
/ YY Y888b $#
/ Y888b$#
$##
888b |$#
|Y88b |$#
| Y88b |$#
| Y88b |$#
| Y88b|$#
| Y888$#
$##
,88~-_ $#
d888 \ $#
88888 |$#
88888 |$#
Y888 / $#
`88_-~ $#
$##
888~-_ $#
888 \ $#
888 |$#
888 / $#
888_-~ $#
888 $#
$##
,88~-_ $#
d888 \ $#
88888 |$#
88888 |$#
Y888 \ / $#
`88__X $#
\ $##
888~-_ $#
888 \ $#
888 |$#
888 / $#
888_-~ $#
888 ~-_ $#
$##
,d88~~\$#
8888 $#
`Y88b $#
`Y88b,$#
8888$#
\__88P'$#
$##
~~~888~~~$#
888 $#
888 $#
888 $#
888 $#
888 $#
$##
888 |$#
888 |$#
888 |$#
888 |$#
Y88 |$#
"8__/ $#
$##
Y88b /$#
Y88b / $#
Y88b / $#
Y888/ $#
Y8/ $#
Y $#
$##
Y88b /$#
Y88b / $#
Y88b e / $#
Y88bd8b/ $#
Y88Y8Y $#
Y Y $#
$##
Y88b /$#
Y88b / $#
Y88b/ $#
/Y88b $#
/ Y88b $#
/ Y88b$#
$##
Y88b /$#
Y88b / $#
Y88b/ $#
Y8Y $#
Y $#
/ $#
$##
~~~~d88P$#
d88P $#
d88P $#
d88P $#
d88P $#
d88P____ $#
$##
88~~$#
88 $#
88 $#
88 $#
88 $#
88 $#
88__$##
\ $#
\ $#
\ $#
\ $#
\ $#
\$#
$##
~~88$#
88$#
88$#
88$#
88$#
88$#
__88$##
/\ $#
/ \$#
$#
$#
$#
$#
$##
$#
$#
$#
$#
$#
$#
----$##
Y8b $#
Y8b$#
$#
$#
$#
$#
$##
$#
/~~~8e $#
88b$#
e88~-888$#
C888 888$#
"88_-888$#
$##
888 $#
888-~88e $#
888 888b$#
888 8888$#
888 888P$#
888-_88" $#
$##
$#
e88~~\$#
d888 $#
8888 $#
Y888 $#
"88__/$#
$##
888$#
e88~\888$#
d888 888$#
8888 888$#
Y888 888$#
"88_/888$#
$##
$#
e88~~8e $#
d888 88b$#
8888__888$#
Y888 ,$#
"88___/ $#
$##
88~\$#
_888__$#
888 $#
888 $#
888 $#
888 $#
$##
/$#
e88~88e$#
888 888$#
"88_88"$#
/ $#
Cb $#
Y8""8D$##
888 $#
888-~88e$#
888 888$#
888 888$#
888 888$#
888 888$#
$##
,e,$#
" $#
888$#
888$#
888$#
888$#
$##
,e,$#
" $#
888$#
888$#
888$#
88P$#
\_8" $##
888 _ $#
888 e~ ~ $#
888d8b $#
888Y88b $#
888 Y88b $#
888 Y88b$#
$##
888$#
888$#
888$#
888$#
888$#
888$#
$##
$#
888-~88e-~88e$#
888 888 888$#
888 888 888$#
888 888 888$#
888 888 888$#
$##
$#
888-~88e$#
888 888$#
888 888$#
888 888$#
888 888$#
$##
$#
e88~-_ $#
d888 i$#
8888 |$#
Y888 '$#
"88_-~ $#
$##
$#
888-~88e $#
888 888b$#
888 8888$#
888 888P$#
888-_88" $#
888 $##
$#
e88~-888$#
d888 888$#
8888 888$#
Y888 888$#
"88_-888$#
888$##
$#
888-~\$#
888 $#
888 $#
888 $#
888 $#
$##
$#
d88~\$#
C888 $#
Y88b $#
888D$#
\_88P $#
$##
d8 $#
_d88__$#
888 $#
888 $#
888 $#
"88_/$#
$##
$#
888 888$#
888 888$#
888 888$#
888 888$#
"88_-888$#
$##
$#
Y88b /$#
Y88b / $#
Y88b/ $#
Y8/ $#
Y $#
$##
$#
Y88b e /$#
Y88b d8b / $#
Y888/Y88b/ $#
Y8/ Y8/ $#
Y Y $#
$##
$#
Y88b / $#
Y88b/ $#
Y88b $#
/Y88b $#
/ Y88b$#
$##
$#
Y88b /$#
Y888/ $#
Y8/ $#
Y $#
/ $#
_/ $##
$#
~~~d88P$#
d88P $#
d88P $#
d88P $#
d88P___ $#
$##
e8~~$#
88 $#
8P $#
<K $#
8b $#
88 $#
"8__$##
|$#
|$#
|$#
|$#
|$#
|$#
|$##
~~8e $#
88 $#
Y8 $#
D>$#
d8 $#
88 $#
__8" $##
$#
$#
$#
/~\_/$#
$#
$#
$##
e e e $#
"8" d8b "8"$#
/Y88b $#
/ Y88b $#
/____Y88b $#
/ Y88b$#
$##
e ,88~-_ e $#
"8"d888 \"8"$#
88888 | $#
88888 | $#
Y888 / $#
`88_-~ $#
$##
e 888 | e $#
"8"888 |"8"$#
888 | $#
888 | $#
Y88 | $#
"8__/ $#
$##
e e $#
"8"/~~~8e"8"$#
88b $#
e88~-888 $#
C888 888 $#
"88_-888 $#
$##
e e $#
"8"e88~-_"8"$#
d888 i $#
8888 | $#
Y888 ' $#
"88_-~ $#
$##
e e $#
"8"888 888"8"$#
888 888 $#
888 888 $#
888 888 $#
"88_-888 $#
$##
#
#
#
#
#
#
##
@@ -0,0 +1,18 @@
import { OneBotAction } from '../../action/OneBotAction';
import { Static } from '@sinclair/typebox';
declare const ReturnSchema: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>;
type ReturnType = Static<typeof ReturnSchema>;
export declare class GetRobotUinRange extends OneBotAction<void, ReturnType> {
actionName: "get_robot_uin_range";
actionSummary: string;
actionTags: string[];
payloadExample: {};
returnExample: {
minUin: string;
maxUin: string;
}[];
payloadSchema: import("@sinclair/typebox").TObject<{}>;
returnSchema: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>;
_handle(): Promise<unknown[]>;
}
export {};
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from './types.js';
import 'react';
declare const EllipsisIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { EllipsisIcon };
@@ -0,0 +1,238 @@
'use strict';
var defineProperties = require('define-properties');
var test = require('tape');
var callBind = require('call-bind');
var functionsHaveNames = require('functions-have-names')();
var hasStrictMode = require('has-strict-mode')();
var forEach = require('for-each');
var debug = require('object-inspect');
var v = require('es-value-fixtures');
var hasSymbols = require('has-symbols/shams')();
var iterate = require('iterate-iterator');
var StringToCodePoints = require('es-abstract/2024/StringToCodePoints');
var index = require('../Iterator.prototype.flatMap');
var impl = require('../Iterator.prototype.flatMap/implementation');
var fnName = 'flatMap';
var isEnumerable = Object.prototype.propertyIsEnumerable;
var testIterator = require('./helpers/testIterator');
module.exports = {
tests: function (flatMap, name, t) {
t['throws'](
function () { return new flatMap(); }, // eslint-disable-line new-cap
TypeError,
'`' + name + '` is not a constructor'
);
forEach(v.primitives.concat(v.objects), function (nonIterator) {
t['throws'](
function () { iterate(flatMap(nonIterator, function () {})); },
TypeError,
debug(nonIterator) + ' is not an Object with a callable `next` method'
);
var badNext = { next: nonIterator };
t['throws'](
function () { iterate(flatMap(badNext, function () {})); },
TypeError,
debug(badNext) + ' is not an Object with a callable `next` method'
);
});
forEach(v.nonFunctions, function (nonFunction) {
t['throws'](
function () { flatMap({ next: function () {} }, nonFunction); },
TypeError,
debug(nonFunction) + ' is not a function'
);
});
t.test('actual iteration', { skip: !hasSymbols }, function (st) {
var arr = [1, 2, 3];
var iterator = callBind(arr[Symbol.iterator], arr);
st['throws'](
function () { return new flatMap(iterator()); }, // eslint-disable-line new-cap
TypeError,
'`' + name + '` iterator is not a constructor'
);
st['throws'](
function () { return new flatMap(iterator(), function () {}); }, // eslint-disable-line new-cap
TypeError,
'`' + name + '` iterator is not a constructor'
);
testIterator(iterator(), [1, 2, 3], st, 'original');
var nonIterableFlatMap = flatMap(iterator(), function (x) { return x; });
st['throws'](
function () { nonIterableFlatMap.next(); },
TypeError,
'non-iterable return value throws'
);
forEach(v.strings, function (string) {
st['throws'](
function () { flatMap(iterator(), function () { return string; }).next(); },
TypeError,
'non-object return value throws even if iterable (' + debug(string) + ')'
);
testIterator(
flatMap(iterator(), function () { return Object(string); }),
[].concat(StringToCodePoints(string), StringToCodePoints(string), StringToCodePoints(string)),
st,
'boxed string (' + debug(string) + ')'
);
});
testIterator(flatMap(iterator(), function (x) { return [x][Symbol.iterator](); }), [1, 2, 3], st, 'identity mapper in array iterator');
testIterator(flatMap(iterator(), function (x) { return [2 * x][Symbol.iterator](); }), [2, 4, 6], st, 'doubler mapper in array iterator');
testIterator(flatMap(iterator(), function () { return []; }), [], st, 'empty mapper in nested array iterator');
testIterator(flatMap(iterator(), function (x) { return [[x, x + 1]][Symbol.iterator](); }), [[1, 2], [2, 3], [3, 4]], st, 'identity mapper in nested array iterator');
testIterator(flatMap(iterator(), function (x) { return [[2 * x, 2 * (x + 1)]][Symbol.iterator](); }), [[2, 4], [4, 6], [6, 8]], st, 'doubler mapper in nested array iterator');
testIterator(flatMap([0, 1, 2, 3][Symbol.iterator](), function (value) {
var result = [];
for (var i = 0; i < value; ++i) {
result.push(value);
}
return result;
}), [1, 2, 2, 3, 3, 3], st, 'test262: test/built-ins/Iterator/prototype/flatMap/flattens-iteratable');
testIterator(flatMap([0, 1, 2, 3][Symbol.iterator](), function (value) {
var i = 0;
return {
next: function () {
if (i < value) {
i += 1;
return {
value: value,
done: false
};
}
return {
value: undefined,
done: true
};
}
};
}), [1, 2, 2, 3, 3, 3], st, 'test262: test/built-ins/Iterator/prototype/flatMap/flattens-iterator');
testIterator(flatMap([0][Symbol.iterator](), function () {
var n = [0, 1, 2][Symbol.iterator]();
var ret = {
next: function next() {
return n.next();
}
};
ret[Symbol.iterator] = null;
return ret;
}), [0, 1, 2], st, 'test262: test/built-ins/Iterator/prototype/flatMap/iterable-to-iterator-fallback');
var counts = [];
testIterator(flatMap(['a', 'b', 'c', 'd', 'e'][Symbol.iterator](), function (value, count) {
counts.push(count);
if (value === 'a' || value === 'b') {
return [0];
}
if (value === 'c') {
return [1, 2];
}
if (value === 'd') {
return [3, 4, 5];
}
if (value === 'e') {
return [6, 7, 8, 9];
}
return st.fail('got unexpected value: ' + debug(v));
}), [0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], st, 'test262: test/built-ins/Iterator/prototype/flatMap/mapper-args');
st.deepEqual(counts, [0, 1, 2, 3, 4], 'count values are as expected');
st.test('return protocol', function (s2t) {
var returnCount = 0;
var iter = flatMap([0][Symbol.iterator](), function () {
return {
next: function next() {
return {
done: false,
value: 1
};
},
'return': function () {
returnCount += 1;
return {};
}
};
});
s2t.equal(returnCount, 0, '`return` is not called yet');
s2t.deepEqual(iter.next(), {
done: false,
value: 1
});
s2t.equal(returnCount, 0, '`return` is not called after first yield');
iter['return']();
s2t.equal(returnCount, 1, '`return` is called when iterator return is called');
iter['return']();
s2t.equal(returnCount, 1, '`return` is not called again when iterator return is called again');
s2t.end();
});
st.end();
});
},
index: function () {
test('Iterator.prototype.' + fnName + ': index', function (t) {
module.exports.tests(index, 'Iterator.prototype.' + fnName, t);
t.end();
});
},
implementation: function () {
test('Iterator.prototype.' + fnName + ': implementation', function (t) {
module.exports.tests(callBind(impl), 'Iterator.prototype.' + fnName, t);
t.end();
});
},
shimmed: function () {
test('Iterator.prototype.' + fnName + ': shimmed', function (t) {
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(Iterator.prototype[fnName].name, fnName, 'Iterator#' + fnName + ' has name "' + fnName + '"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(Iterator.prototype, fnName), 'Iterator#' + fnName + ' is not enumerable');
et.end();
});
t.test('bad string/this value', { skip: !hasStrictMode }, function (st) {
st['throws'](function () { return Iterator.prototype[fnName].call(undefined, 'a'); }, TypeError, 'undefined is not an object');
st['throws'](function () { return Iterator.prototype[fnName].call(null, 'a'); }, TypeError, 'null is not an object');
st.end();
});
module.exports.tests(callBind(Iterator.prototype[fnName]), 'Iterator.prototype.' + fnName, t);
t.end();
});
}
};
@@ -0,0 +1,58 @@
'use strict'
let list = {
comma(string) {
return list.split(string, [','], true)
},
space(string) {
let spaces = [' ', '\n', '\t']
return list.split(string, spaces)
},
split(string, separators, last) {
let array = []
let current = ''
let split = false
let func = 0
let inQuote = false
let prevQuote = ''
let escape = false
for (let letter of string) {
if (escape) {
escape = false
} else if (letter === '\\') {
escape = true
} else if (inQuote) {
if (letter === prevQuote) {
inQuote = false
}
} else if (letter === '"' || letter === "'") {
inQuote = true
prevQuote = letter
} else if (letter === '(') {
func += 1
} else if (letter === ')') {
if (func > 0) func -= 1
} else if (func === 0) {
if (separators.includes(letter)) split = true
}
if (split) {
if (current !== '') array.push(current.trim())
current = ''
split = false
} else {
current += letter
}
}
if (last || current !== '') array.push(current.trim())
return array
}
}
module.exports = list
list.default = list
@@ -0,0 +1,14 @@
import type { TSchema, SchemaOptions } from '../schema/index';
import type { TProperties } from '../object/index';
import type { Assert } from '../helpers/index';
import { type TMappedResult, type TMappedKey } from '../mapped/index';
import { type TLiteral, type TLiteralValue } from '../literal/index';
import { type TExtends } from './extends';
type TFromPropertyKey<K extends PropertyKey, U extends TSchema, L extends TSchema, R extends TSchema> = {
[_ in K]: TExtends<TLiteral<Assert<K, TLiteralValue>>, U, L, R>;
};
type TFromPropertyKeys<K extends PropertyKey[], U extends TSchema, L extends TSchema, R extends TSchema, Acc extends TProperties = {}> = (K extends [infer LK extends PropertyKey, ...infer RK extends PropertyKey[]] ? TFromPropertyKeys<RK, U, L, R, Acc & TFromPropertyKey<LK, U, L, R>> : Acc);
type TFromMappedKey<K extends TMappedKey, U extends TSchema, L extends TSchema, R extends TSchema> = (TFromPropertyKeys<K['keys'], U, L, R>);
export type TExtendsFromMappedKey<T extends TMappedKey, U extends TSchema, L extends TSchema, R extends TSchema, P extends TProperties = TFromMappedKey<T, U, L, R>> = (TMappedResult<P>);
export declare function ExtendsFromMappedKey<T extends TMappedKey, U extends TSchema, L extends TSchema, R extends TSchema, P extends TProperties = TFromMappedKey<T, U, L, R>>(T: T, U: U, L: L, R: R, options?: SchemaOptions): TMappedResult<P>;
export {};
@@ -0,0 +1,50 @@
{
"name": "expect-type",
"version": "1.2.2",
"engines": {
"node": ">=12.0.0"
},
"keywords": [
"typescript",
"type-check",
"assert",
"types",
"typings",
"test",
"testing"
],
"homepage": "https://github.com/mmkal/expect-type#readme",
"repository": {
"type": "git",
"url": "https://github.com/mmkal/expect-type.git"
},
"license": "Apache-2.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist",
"*.md"
],
"devDependencies": {
"@arethetypeswrong/cli": "0.17.3",
"@types/node": "^22.0.0",
"@typescript/native-preview": "7.0.0-dev.20250527.1",
"@vitest/ui": "^3.0.0",
"eslint": "^8.57.0",
"eslint-plugin-mmkal": "0.9.0",
"np": "^10.2.0",
"pkg-pr-new": "0.0.39",
"strip-ansi": "7.1.0",
"ts-morph": "23.0.0",
"typescript": "5.8.3",
"vitest": "^3.0.0"
},
"scripts": {
"eslint": "eslint --max-warnings 0",
"lint": "tsc && pnpm eslint .",
"type-check": "tsc",
"build": "tsc -p tsconfig.lib.json",
"arethetypeswrong": "attw --pack",
"test": "vitest run"
}
}
@@ -0,0 +1,271 @@
var test = require('tape');
var forEach = require('for-each');
var inspect = require('../');
test('bad indent options', function (t) {
forEach([
undefined,
true,
false,
-1,
1.2,
Infinity,
-Infinity,
NaN
], function (indent) {
t['throws'](
function () { inspect('', { indent: indent }); },
TypeError,
inspect(indent) + ' is invalid'
);
});
t.end();
});
test('simple object with indent', function (t) {
t.plan(2);
var obj = { a: 1, b: 2 };
var expectedSpaces = [
'{',
' a: 1,',
' b: 2',
'}'
].join('\n');
var expectedTabs = [
'{',
' a: 1,',
' b: 2',
'}'
].join('\n');
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
});
test('two deep object with indent', function (t) {
t.plan(2);
var obj = { a: 1, b: { c: 3, d: 4 } };
var expectedSpaces = [
'{',
' a: 1,',
' b: {',
' c: 3,',
' d: 4',
' }',
'}'
].join('\n');
var expectedTabs = [
'{',
' a: 1,',
' b: {',
' c: 3,',
' d: 4',
' }',
'}'
].join('\n');
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
});
test('simple array with all single line elements', function (t) {
t.plan(2);
var obj = [1, 2, 3, 'asdf\nsdf'];
var expected = '[ 1, 2, 3, \'asdf\\nsdf\' ]';
t.equal(inspect(obj, { indent: 2 }), expected, 'two');
t.equal(inspect(obj, { indent: '\t' }), expected, 'tabs');
});
test('array with complex elements', function (t) {
t.plan(2);
var obj = [1, { a: 1, b: { c: 1 } }, 'asdf\nsdf'];
var expectedSpaces = [
'[',
' 1,',
' {',
' a: 1,',
' b: {',
' c: 1',
' }',
' },',
' \'asdf\\nsdf\'',
']'
].join('\n');
var expectedTabs = [
'[',
' 1,',
' {',
' a: 1,',
' b: {',
' c: 1',
' }',
' },',
' \'asdf\\nsdf\'',
']'
].join('\n');
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
});
test('values', function (t) {
t.plan(2);
var obj = [{}, [], { 'a-b': 5 }];
var expectedSpaces = [
'[',
' {},',
' [],',
' {',
' \'a-b\': 5',
' }',
']'
].join('\n');
var expectedTabs = [
'[',
' {},',
' [],',
' {',
' \'a-b\': 5',
' }',
']'
].join('\n');
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
});
test('Map', { skip: typeof Map !== 'function' }, function (t) {
var map = new Map();
map.set({ a: 1 }, ['b']);
map.set(3, NaN);
var expectedStringSpaces = [
'Map (2) {',
' { a: 1 } => [ \'b\' ],',
' 3 => NaN',
'}'
].join('\n');
var expectedStringTabs = [
'Map (2) {',
' { a: 1 } => [ \'b\' ],',
' 3 => NaN',
'}'
].join('\n');
var expectedStringTabsDoubleQuotes = [
'Map (2) {',
' { a: 1 } => [ "b" ],',
' 3 => NaN',
'}'
].join('\n');
t.equal(
inspect(map, { indent: 2 }),
expectedStringSpaces,
'Map keys are not indented (two)'
);
t.equal(
inspect(map, { indent: '\t' }),
expectedStringTabs,
'Map keys are not indented (tabs)'
);
t.equal(
inspect(map, { indent: '\t', quoteStyle: 'double' }),
expectedStringTabsDoubleQuotes,
'Map keys are not indented (tabs + double quotes)'
);
t.equal(inspect(new Map(), { indent: 2 }), 'Map (0) {}', 'empty Map should show as empty (two)');
t.equal(inspect(new Map(), { indent: '\t' }), 'Map (0) {}', 'empty Map should show as empty (tabs)');
var nestedMap = new Map();
nestedMap.set(nestedMap, map);
var expectedNestedSpaces = [
'Map (1) {',
' [Circular] => Map (2) {',
' { a: 1 } => [ \'b\' ],',
' 3 => NaN',
' }',
'}'
].join('\n');
var expectedNestedTabs = [
'Map (1) {',
' [Circular] => Map (2) {',
' { a: 1 } => [ \'b\' ],',
' 3 => NaN',
' }',
'}'
].join('\n');
t.equal(inspect(nestedMap, { indent: 2 }), expectedNestedSpaces, 'Map containing a Map should work (two)');
t.equal(inspect(nestedMap, { indent: '\t' }), expectedNestedTabs, 'Map containing a Map should work (tabs)');
t.end();
});
test('Set', { skip: typeof Set !== 'function' }, function (t) {
var set = new Set();
set.add({ a: 1 });
set.add(['b']);
var expectedStringSpaces = [
'Set (2) {',
' {',
' a: 1',
' },',
' [ \'b\' ]',
'}'
].join('\n');
var expectedStringTabs = [
'Set (2) {',
' {',
' a: 1',
' },',
' [ \'b\' ]',
'}'
].join('\n');
t.equal(inspect(set, { indent: 2 }), expectedStringSpaces, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (two)');
t.equal(inspect(set, { indent: '\t' }), expectedStringTabs, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (tabs)');
t.equal(inspect(new Set(), { indent: 2 }), 'Set (0) {}', 'empty Set should show as empty (two)');
t.equal(inspect(new Set(), { indent: '\t' }), 'Set (0) {}', 'empty Set should show as empty (tabs)');
var nestedSet = new Set();
nestedSet.add(set);
nestedSet.add(nestedSet);
var expectedNestedSpaces = [
'Set (2) {',
' Set (2) {',
' {',
' a: 1',
' },',
' [ \'b\' ]',
' },',
' [Circular]',
'}'
].join('\n');
var expectedNestedTabs = [
'Set (2) {',
' Set (2) {',
' {',
' a: 1',
' },',
' [ \'b\' ]',
' },',
' [Circular]',
'}'
].join('\n');
t.equal(inspect(nestedSet, { indent: 2 }), expectedNestedSpaces, 'Set containing a Set should work (two)');
t.equal(inspect(nestedSet, { indent: '\t' }), expectedNestedTabs, 'Set containing a Set should work (tabs)');
t.end();
});
@@ -0,0 +1,681 @@
"use strict";
var _TRAILING_WILD_CARD_R;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { 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 _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
// A simple implementation of make-array
function makeArray(subject) {
return Array.isArray(subject) ? subject : [subject];
}
var UNDEFINED = undefined;
var EMPTY = '';
var SPACE = ' ';
var ESCAPE = '\\';
var REGEX_TEST_BLANK_LINE = /^\s+$/;
var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
var REGEX_SPLITALL_CRLF = /\r?\n/g;
// Invalid:
// - /foo,
// - ./foo,
// - ../foo,
// - .
// - ..
// Valid:
// - .foo
var REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/;
var REGEX_TEST_TRAILING_SLASH = /\/$/;
var SLASH = '/';
// Do not use ternary expression here, since "istanbul ignore next" is buggy
var TMP_KEY_IGNORE = 'node-ignore';
/* istanbul ignore else */
if (typeof Symbol !== 'undefined') {
TMP_KEY_IGNORE = Symbol["for"]('node-ignore');
}
var KEY_IGNORE = TMP_KEY_IGNORE;
var define = function define(object, key, value) {
Object.defineProperty(object, key, {
value: value
});
return value;
};
var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
var RETURN_FALSE = function RETURN_FALSE() {
return false;
};
// Sanitize the range of a regular expression
// The cases are complicated, see test cases for details
var sanitizeRange = function sanitizeRange(range) {
return range.replace(REGEX_REGEXP_RANGE, function (match, from, to) {
return from.charCodeAt(0) <= to.charCodeAt(0) ? match
// Invalid range (out of order) which is ok for gitignore rules but
// fatal for JavaScript regular expression, so eliminate it.
: EMPTY;
});
};
// See fixtures #59
var cleanRangeBackSlash = function cleanRangeBackSlash(slashes) {
var length = slashes.length;
return slashes.slice(0, length - length % 2);
};
// > If the pattern ends with a slash,
// > it is removed for the purpose of the following description,
// > but it would only find a match with a directory.
// > In other words, foo/ will match a directory foo and paths underneath it,
// > but will not match a regular file or a symbolic link foo
// > (this is consistent with the way how pathspec works in general in Git).
// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`'
// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call
// you could use option `mark: true` with `glob`
// '`foo/`' should not continue with the '`..`'
var REPLACERS = [[
// Remove BOM
// TODO:
// Other similar zero-width characters?
/^\uFEFF/, function () {
return EMPTY;
}],
// > Trailing spaces are ignored unless they are quoted with backslash ("\")
[
// (a\ ) -> (a )
// (a ) -> (a)
// (a ) -> (a)
// (a \ ) -> (a )
/((?:\\\\)*?)(\\?\s+)$/, function (_, m1, m2) {
return m1 + (m2.indexOf('\\') === 0 ? SPACE : EMPTY);
}],
// Replace (\ ) with ' '
// (\ ) -> ' '
// (\\ ) -> '\\ '
// (\\\ ) -> '\\ '
[/(\\+?)\s/g, function (_, m1) {
var length = m1.length;
return m1.slice(0, length - length % 2) + SPACE;
}],
// Escape metacharacters
// which is written down by users but means special for regular expressions.
// > There are 12 characters with special meanings:
// > - the backslash \,
// > - the caret ^,
// > - the dollar sign $,
// > - the period or dot .,
// > - the vertical bar or pipe symbol |,
// > - the question mark ?,
// > - the asterisk or star *,
// > - the plus sign +,
// > - the opening parenthesis (,
// > - the closing parenthesis ),
// > - and the opening square bracket [,
// > - the opening curly brace {,
// > These special characters are often called "metacharacters".
[/[\\$.|*+(){^]/g, function (match) {
return "\\".concat(match);
}], [
// > a question mark (?) matches a single character
/(?!\\)\?/g, function () {
return '[^/]';
}],
// leading slash
[
// > A leading slash matches the beginning of the pathname.
// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
// A leading slash matches the beginning of the pathname
/^\//, function () {
return '^';
}],
// replace special metacharacter slash after the leading slash
[/\//g, function () {
return '\\/';
}], [
// > A leading "**" followed by a slash means match in all directories.
// > For example, "**/foo" matches file or directory "foo" anywhere,
// > the same as pattern "foo".
// > "**/foo/bar" matches file or directory "bar" anywhere that is directly
// > under directory "foo".
// Notice that the '*'s have been replaced as '\\*'
/^\^*\\\*\\\*\\\//,
// '**/foo' <-> 'foo'
function () {
return '^(?:.*\\/)?';
}],
// starting
[
// there will be no leading '/'
// (which has been replaced by section "leading slash")
// If starts with '**', adding a '^' to the regular expression also works
/^(?=[^^])/, function startingReplacer() {
// If has a slash `/` at the beginning or middle
return !/\/(?!$)/.test(this)
// > Prior to 2.22.1
// > If the pattern does not contain a slash /,
// > Git treats it as a shell glob pattern
// Actually, if there is only a trailing slash,
// git also treats it as a shell glob pattern
// After 2.22.1 (compatible but clearer)
// > If there is a separator at the beginning or middle (or both)
// > of the pattern, then the pattern is relative to the directory
// > level of the particular .gitignore file itself.
// > Otherwise the pattern may also match at any level below
// > the .gitignore level.
? '(?:^|\\/)'
// > Otherwise, Git treats the pattern as a shell glob suitable for
// > consumption by fnmatch(3)
: '^';
}],
// two globstars
[
// Use lookahead assertions so that we could match more than one `'/**'`
/\\\/\\\*\\\*(?=\\\/|$)/g,
// Zero, one or several directories
// should not use '*', or it will be replaced by the next replacer
// Check if it is not the last `'/**'`
function (_, index, str) {
return index + 6 < str.length
// case: /**/
// > A slash followed by two consecutive asterisks then a slash matches
// > zero or more directories.
// > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.
// '/**/'
? '(?:\\/[^\\/]+)*'
// case: /**
// > A trailing `"/**"` matches everything inside.
// #21: everything inside but it should not include the current folder
: '\\/.+';
}],
// normal intermediate wildcards
[
// Never replace escaped '*'
// ignore rule '\*' will match the path '*'
// 'abc.*/' -> go
// 'abc.*' -> skip this rule,
// coz trailing single wildcard will be handed by [trailing wildcard]
/(^|[^\\]+)(\\\*)+(?=.+)/g,
// '*.js' matches '.js'
// '*.js' doesn't match 'abc'
function (_, p1, p2) {
// 1.
// > An asterisk "*" matches anything except a slash.
// 2.
// > Other consecutive asterisks are considered regular asterisks
// > and will match according to the previous rules.
var unescaped = p2.replace(/\\\*/g, '[^\\/]*');
return p1 + unescaped;
}], [
// unescape, revert step 3 except for back slash
// For example, if a user escape a '\\*',
// after step 3, the result will be '\\\\\\*'
/\\\\\\(?=[$.|*+(){^])/g, function () {
return ESCAPE;
}], [
// '\\\\' -> '\\'
/\\\\/g, function () {
return ESCAPE;
}], [
// > The range notation, e.g. [a-zA-Z],
// > can be used to match one of the characters in a range.
// `\` is escaped by step 3
/(\\)?\[([^\]/]*?)(\\*)($|\])/g, function (match, leadEscape, range, endEscape, close) {
return leadEscape === ESCAPE
// '\\[bar]' -> '\\\\[bar\\]'
? "\\[".concat(range).concat(cleanRangeBackSlash(endEscape)).concat(close) : close === ']' ? endEscape.length % 2 === 0
// A normal case, and it is a range notation
// '[bar]'
// '[bar\\\\]'
? "[".concat(sanitizeRange(range)).concat(endEscape, "]") // Invalid range notaton
// '[bar\\]' -> '[bar\\\\]'
: '[]' : '[]';
}],
// ending
[
// 'js' will not match 'js.'
// 'ab' will not match 'abc'
/(?:[^*])$/,
// WTF!
// https://git-scm.com/docs/gitignore
// changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
// which re-fixes #24, #38
// > If there is a separator at the end of the pattern then the pattern
// > will only match directories, otherwise the pattern can match both
// > files and directories.
// 'js*' will not match 'a.js'
// 'js/' will not match 'a.js'
// 'js' will match 'a.js' and 'a.js/'
function (match) {
return /\/$/.test(match)
// foo/ will not match 'foo'
? "".concat(match, "$") // foo matches 'foo' and 'foo/'
: "".concat(match, "(?=$|\\/$)");
}]];
var REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\\\*$/;
var MODE_IGNORE = 'regex';
var MODE_CHECK_IGNORE = 'checkRegex';
var UNDERSCORE = '_';
var TRAILING_WILD_CARD_REPLACERS = (_TRAILING_WILD_CARD_R = {}, _defineProperty(_TRAILING_WILD_CARD_R, MODE_IGNORE, function (_, p1) {
var prefix = p1
// '\^':
// '/*' does not match EMPTY
// '/*' does not match everything
// '\\\/':
// 'abc/*' does not match 'abc/'
? "".concat(p1, "[^/]+") // 'a*' matches 'a'
// 'a*' matches 'aa'
: '[^/]*';
return "".concat(prefix, "(?=$|\\/$)");
}), _defineProperty(_TRAILING_WILD_CARD_R, MODE_CHECK_IGNORE, function (_, p1) {
// When doing `git check-ignore`
var prefix = p1
// '\\\/':
// 'abc/*' DOES match 'abc/' !
? "".concat(p1, "[^/]*") // 'a*' matches 'a'
// 'a*' matches 'aa'
: '[^/]*';
return "".concat(prefix, "(?=$|\\/$)");
}), _TRAILING_WILD_CARD_R);
// @param {pattern}
var makeRegexPrefix = function makeRegexPrefix(pattern) {
return REPLACERS.reduce(function (prev, _ref) {
var _ref2 = _slicedToArray(_ref, 2),
matcher = _ref2[0],
replacer = _ref2[1];
return prev.replace(matcher, replacer.bind(pattern));
}, pattern);
};
var isString = function isString(subject) {
return typeof subject === 'string';
};
// > A blank line matches no files, so it can serve as a separator for readability.
var checkPattern = function checkPattern(pattern) {
return pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern)
// > A line starting with # serves as a comment.
&& pattern.indexOf('#') !== 0;
};
var splitPattern = function splitPattern(pattern) {
return pattern.split(REGEX_SPLITALL_CRLF).filter(Boolean);
};
var IgnoreRule = /*#__PURE__*/function () {
function IgnoreRule(pattern, mark, body, ignoreCase, negative, prefix) {
_classCallCheck(this, IgnoreRule);
this.pattern = pattern;
this.mark = mark;
this.negative = negative;
define(this, 'body', body);
define(this, 'ignoreCase', ignoreCase);
define(this, 'regexPrefix', prefix);
}
_createClass(IgnoreRule, [{
key: "regex",
get: function get() {
var key = UNDERSCORE + MODE_IGNORE;
if (this[key]) {
return this[key];
}
return this._make(MODE_IGNORE, key);
}
}, {
key: "checkRegex",
get: function get() {
var key = UNDERSCORE + MODE_CHECK_IGNORE;
if (this[key]) {
return this[key];
}
return this._make(MODE_CHECK_IGNORE, key);
}
}, {
key: "_make",
value: function _make(mode, key) {
var str = this.regexPrefix.replace(REGEX_REPLACE_TRAILING_WILDCARD,
// It does not need to bind pattern
TRAILING_WILD_CARD_REPLACERS[mode]);
var regex = this.ignoreCase ? new RegExp(str, 'i') : new RegExp(str);
return define(this, key, regex);
}
}]);
return IgnoreRule;
}();
var createRule = function createRule(_ref3, ignoreCase) {
var pattern = _ref3.pattern,
mark = _ref3.mark;
var negative = false;
var body = pattern;
// > An optional prefix "!" which negates the pattern;
if (body.indexOf('!') === 0) {
negative = true;
body = body.substr(1);
}
body = body
// > Put a backslash ("\") in front of the first "!" for patterns that
// > begin with a literal "!", for example, `"\!important!.txt"`.
.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!')
// > Put a backslash ("\") in front of the first hash for patterns that
// > begin with a hash.
.replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#');
var regexPrefix = makeRegexPrefix(body);
return new IgnoreRule(pattern, mark, body, ignoreCase, negative, regexPrefix);
};
var RuleManager = /*#__PURE__*/function () {
function RuleManager(ignoreCase) {
_classCallCheck(this, RuleManager);
this._ignoreCase = ignoreCase;
this._rules = [];
}
_createClass(RuleManager, [{
key: "_add",
value: function _add(pattern) {
// #32
if (pattern && pattern[KEY_IGNORE]) {
this._rules = this._rules.concat(pattern._rules._rules);
this._added = true;
return;
}
if (isString(pattern)) {
pattern = {
pattern: pattern
};
}
if (checkPattern(pattern.pattern)) {
var rule = createRule(pattern, this._ignoreCase);
this._added = true;
this._rules.push(rule);
}
}
// @param {Array<string> | string | Ignore} pattern
}, {
key: "add",
value: function add(pattern) {
this._added = false;
makeArray(isString(pattern) ? splitPattern(pattern) : pattern).forEach(this._add, this);
return this._added;
}
// Test one single path without recursively checking parent directories
//
// - checkUnignored `boolean` whether should check if the path is unignored,
// setting `checkUnignored` to `false` could reduce additional
// path matching.
// - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`
// @returns {TestResult} true if a file is ignored
}, {
key: "test",
value: function test(path, checkUnignored, mode) {
var ignored = false;
var unignored = false;
var matchedRule;
this._rules.forEach(function (rule) {
var negative = rule.negative;
// | ignored : unignored
// -------- | ---------------------------------------
// negative | 0:0 | 0:1 | 1:0 | 1:1
// -------- | ------- | ------- | ------- | --------
// 0 | TEST | TEST | SKIP | X
// 1 | TESTIF | SKIP | TEST | X
// - SKIP: always skip
// - TEST: always test
// - TESTIF: only test if checkUnignored
// - X: that never happen
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
return;
}
var matched = rule[mode].test(path);
if (!matched) {
return;
}
ignored = !negative;
unignored = negative;
matchedRule = negative ? UNDEFINED : rule;
});
var ret = {
ignored: ignored,
unignored: unignored
};
if (matchedRule) {
ret.rule = matchedRule;
}
return ret;
}
}]);
return RuleManager;
}();
var throwError = function throwError(message, Ctor) {
throw new Ctor(message);
};
var checkPath = function checkPath(path, originalPath, doThrow) {
if (!isString(path)) {
return doThrow("path must be a string, but got `".concat(originalPath, "`"), TypeError);
}
// We don't know if we should ignore EMPTY, so throw
if (!path) {
return doThrow("path must not be empty", TypeError);
}
// Check if it is a relative path
if (checkPath.isNotRelative(path)) {
var r = '`path.relative()`d';
return doThrow("path should be a ".concat(r, " string, but got \"").concat(originalPath, "\""), RangeError);
}
return true;
};
var isNotRelative = function isNotRelative(path) {
return REGEX_TEST_INVALID_PATH.test(path);
};
checkPath.isNotRelative = isNotRelative;
// On windows, the following function will be replaced
/* istanbul ignore next */
checkPath.convert = function (p) {
return p;
};
var Ignore = /*#__PURE__*/function () {
function Ignore() {
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref4$ignorecase = _ref4.ignorecase,
ignorecase = _ref4$ignorecase === void 0 ? true : _ref4$ignorecase,
_ref4$ignoreCase = _ref4.ignoreCase,
ignoreCase = _ref4$ignoreCase === void 0 ? ignorecase : _ref4$ignoreCase,
_ref4$allowRelativePa = _ref4.allowRelativePaths,
allowRelativePaths = _ref4$allowRelativePa === void 0 ? false : _ref4$allowRelativePa;
_classCallCheck(this, Ignore);
define(this, KEY_IGNORE, true);
this._rules = new RuleManager(ignoreCase);
this._strictPathCheck = !allowRelativePaths;
this._initCache();
}
_createClass(Ignore, [{
key: "_initCache",
value: function _initCache() {
// A cache for the result of `.ignores()`
this._ignoreCache = Object.create(null);
// A cache for the result of `.test()`
this._testCache = Object.create(null);
}
}, {
key: "add",
value: function add(pattern) {
if (this._rules.add(pattern)) {
// Some rules have just added to the ignore,
// making the behavior changed,
// so we need to re-initialize the result cache
this._initCache();
}
return this;
}
// legacy
}, {
key: "addPattern",
value: function addPattern(pattern) {
return this.add(pattern);
}
// @returns {TestResult}
}, {
key: "_test",
value: function _test(originalPath, cache, checkUnignored, slices) {
var path = originalPath
// Supports nullable path
&& checkPath.convert(originalPath);
checkPath(path, originalPath, this._strictPathCheck ? throwError : RETURN_FALSE);
return this._t(path, cache, checkUnignored, slices);
}
}, {
key: "checkIgnore",
value: function checkIgnore(path) {
// If the path doest not end with a slash, `.ignores()` is much equivalent
// to `git check-ignore`
if (!REGEX_TEST_TRAILING_SLASH.test(path)) {
return this.test(path);
}
var slices = path.split(SLASH).filter(Boolean);
slices.pop();
if (slices.length) {
var parent = this._t(slices.join(SLASH) + SLASH, this._testCache, true, slices);
if (parent.ignored) {
return parent;
}
}
return this._rules.test(path, false, MODE_CHECK_IGNORE);
}
}, {
key: "_t",
value: function _t(
// The path to be tested
path,
// The cache for the result of a certain checking
cache,
// Whether should check if the path is unignored
checkUnignored,
// The path slices
slices) {
if (path in cache) {
return cache[path];
}
if (!slices) {
// path/to/a.js
// ['path', 'to', 'a.js']
slices = path.split(SLASH).filter(Boolean);
}
slices.pop();
// If the path has no parent directory, just test it
if (!slices.length) {
return cache[path] = this._rules.test(path, checkUnignored, MODE_IGNORE);
}
var parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices);
// If the path contains a parent directory, check the parent first
return cache[path] = parent.ignored
// > It is not possible to re-include a file if a parent directory of
// > that file is excluded.
? parent : this._rules.test(path, checkUnignored, MODE_IGNORE);
}
}, {
key: "ignores",
value: function ignores(path) {
return this._test(path, this._ignoreCache, false).ignored;
}
}, {
key: "createFilter",
value: function createFilter() {
var _this = this;
return function (path) {
return !_this.ignores(path);
};
}
}, {
key: "filter",
value: function filter(paths) {
return makeArray(paths).filter(this.createFilter());
}
// @returns {TestResult}
}, {
key: "test",
value: function test(path) {
return this._test(path, this._testCache, true);
}
}]);
return Ignore;
}();
var factory = function factory(options) {
return new Ignore(options);
};
var isPathValid = function isPathValid(path) {
return checkPath(path && checkPath.convert(path), path, RETURN_FALSE);
};
/* istanbul ignore next */
var setupWindows = function setupWindows() {
/* eslint no-control-regex: "off" */
var makePosix = function makePosix(str) {
return /^\\\\\?\\/.test(str) || /[\0-\x1F"<>\|]+/.test(str) ? str : str.replace(/\\/g, '/');
};
checkPath.convert = makePosix;
// 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/'
// 'd:\\foo'
var REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
checkPath.isNotRelative = function (path) {
return REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path);
};
};
// Windows
// --------------------------------------------------------------
/* istanbul ignore next */
if (
// Detect `process` so that it can run in browsers.
typeof process !== 'undefined' && process.platform === 'win32') {
setupWindows();
}
// COMMONJS_EXPORTS ////////////////////////////////////////////////////////////
module.exports = factory;
// Although it is an anti-pattern,
// it is still widely misused by a lot of libraries in github
// Ref: https://github.com/search?q=ignore.default%28%29&type=code
factory["default"] = factory;
module.exports.isPathValid = isPathValid;
// For testing purposes
define(module.exports, Symbol["for"]('setupWindows'), setupWindows);
@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.transformFile = transformFile;
exports.transformFileAsync = transformFileAsync;
exports.transformFileSync = transformFileSync;
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
var _index = require("./config/index.js");
var _index2 = require("./transformation/index.js");
var fs = require("./gensync-utils/fs.js");
({});
const transformFileRunner = _gensync()(function* (filename, opts) {
const options = Object.assign({}, opts, {
filename
});
const config = yield* (0, _index.default)(options);
if (config === null) return null;
const code = yield* fs.readFile(filename, "utf8");
return yield* (0, _index2.run)(config, code);
});
function transformFile(...args) {
transformFileRunner.errback(...args);
}
function transformFileSync(...args) {
return transformFileRunner.sync(...args);
}
function transformFileAsync(...args) {
return transformFileRunner.async(...args);
}
0 && 0;
//# sourceMappingURL=transform-file.js.map
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isValueProvider = void 0;
function isValueProvider(provider) {
return provider.useValue != undefined;
}
exports.isValueProvider = isValueProvider;
@@ -0,0 +1,24 @@
"use strict";
var pattern = /-(\w|$)/g;
var callback = function callback(dashChar, char) {
return char.toUpperCase();
};
var camelCaseCSS = function camelCaseCSS(property) {
property = property.toLowerCase();
// NOTE :: IE8's "styleFloat" is intentionally not supported
if (property === "float") {
return "cssFloat";
}
// Microsoft vendor-prefixes are uniquely cased
else if (property.charCodeAt(0) === 45&& property.charCodeAt(1) === 109&& property.charCodeAt(2) === 115&& property.charCodeAt(3) === 45) {
return property.substr(1).replace(pattern, callback);
} else {
return property.replace(pattern, callback);
}
};
module.exports = camelCaseCSS;
@@ -0,0 +1,4 @@
C. Scott Ananian <cscott@cscott.net> (http://cscott.net)
Kyle E. Mitchell <kyle@kemitchell.com> (https://kemitchell.com)
Shinnosuke Watanabe <snnskwtnb@gmail.com>
Antoine Motet <antoine.motet@gmail.com>
@@ -0,0 +1,4 @@
type Listener = (data: any) => void;
declare const trigger: (key: string, data: any) => void;
declare const subscribe: (key: string, listener: Listener) => () => void;
export { trigger, subscribe };
@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExtendsUndefinedCheck = ExtendsUndefinedCheck;
const index_1 = require("../symbols/index");
/** Fast undefined check used for properties of type undefined */
function Intersect(schema) {
return schema.allOf.every((schema) => ExtendsUndefinedCheck(schema));
}
function Union(schema) {
return schema.anyOf.some((schema) => ExtendsUndefinedCheck(schema));
}
function Not(schema) {
return !ExtendsUndefinedCheck(schema.not);
}
/** Fast undefined check used for properties of type undefined */
// prettier-ignore
function ExtendsUndefinedCheck(schema) {
return (schema[index_1.Kind] === 'Intersect' ? Intersect(schema) :
schema[index_1.Kind] === 'Union' ? Union(schema) :
schema[index_1.Kind] === 'Not' ? Not(schema) :
schema[index_1.Kind] === 'Undefined' ? true :
false);
}
@@ -0,0 +1,30 @@
import { OneBotAction } from '../../action/OneBotAction';
import { Static } from '@sinclair/typebox';
declare const PayloadSchema: import("@sinclair/typebox").TObject<{
message_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString]>>;
msg_seq: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
msg_random: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
group_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
}>;
type PayloadType = Static<typeof PayloadSchema>;
declare const ReturnSchema: import("@sinclair/typebox").TAny;
type ReturnType = Static<typeof ReturnSchema>;
export default class DelEssenceMsg extends OneBotAction<PayloadType, ReturnType> {
actionName: "delete_essence_msg";
payloadSchema: import("@sinclair/typebox").TObject<{
message_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString]>>;
msg_seq: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
msg_random: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
group_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
}>;
returnSchema: import("@sinclair/typebox").TAny;
actionSummary: string;
actionDescription: string;
actionTags: string[];
payloadExample: {
message_id: number;
};
returnExample: null;
_handle(payload: PayloadType): Promise<ReturnType>;
}
export {};
@@ -0,0 +1 @@
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAkBM,SAAS,0CAAqB,KAAiC,EAAE,KAAyB,EAAE,QAA4C;IAC7I,MAAM,cAAc,CAAA,GAAA,qBAAa,EAAE;QACjC,YAAY,MAAM,UAAU,IAAI,MAAM,UAAU;QAChD,YAAY,MAAM,UAAU,CAAC,MAAM,KAAK;QACxC,UAAS,UAAU;YACjB,IAAI,YACF,MAAM,QAAQ,CAAC,MAAM,KAAK;iBAE1B,MAAM,WAAW,CAAC,MAAM,KAAK;YAG/B,IAAI,MAAM,QAAQ,EAChB,MAAM,QAAQ,CAAC;QAEnB;IACF;IAEA,IAAI,QAAC,IAAI,iBAAE,aAAa,kBAAE,cAAc,sBAAE,kBAAkB,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE,GAAG,CAAC;QACjE;IAArB,qBAAqB,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B;IAEjD,sCAAsC;IACtC,IAAI,sBAAC,kBAAkB,EAAC,GAAG,CAAA,GAAA,6BAAqB,EAAE;QAChD,GAAG,KAAK;QACR,OAAO,YAAY,UAAU;QAC7B,mDAAmD;QACnD,MAAM;QACN,oBAAoB;IACtB;IAEA,oEAAoE;IACpE,IAAI,mBAAmB,CAAA,GAAA,aAAK,EAAE,CAAA,GAAA,gCAAwB;IACtD,IAAI,mBAAmB;QACrB,MAAM,UAAU,CAAC,MAAM,KAAK,EAAE,mBAAmB,SAAS,GAAG,qBAAqB,iBAAiB,OAAO;IAC5G;IAEA,CAAA,GAAA,gBAAQ,EAAE;IAEV,+CAA+C;IAC/C,IAAI,6BAA6B,MAAM,kBAAkB,CAAC,SAAS,GAAG,MAAM,kBAAkB,GAAG;IACjG,IAAI,oBAAoB,uBAAuB,WAAW,MAAM,iBAAiB,GAAG;QAOtE;IALd,IAAI,MAAM,CAAA,GAAA,yCAAU,EAAE;QACpB,GAAG,KAAK;QACR,YAAY,MAAM,UAAU,IAAI,MAAM,UAAU;QAChD,YAAY,MAAM,UAAU,IAAI,MAAM,UAAU;QAChD,MAAM,MAAM,IAAI,IAAI;QACpB,YAAY,CAAA,oBAAA,MAAM,UAAU,cAAhB,+BAAA,oBAAoB,MAAM,UAAU;4BAChD;QACA,CAAC,CAAA,GAAA,iCAAyB,EAAE,EAAE;YAC5B,oBAAoB;+BACpB;YACA,iBAAiB,MAAM,eAAe;YACtC,kBAAkB,MAAM,gBAAgB;YACxC,kBAAiB,CAAmB;gBAClC,iBAAiB,OAAO,GAAG;gBAC3B;YACF;QACF;IACF,GAAG,aAAa;IAEhB,OAAO;QACL,GAAG,GAAG;QACN,YAAY;YACV,GAAG,IAAI,UAAU;YACjB,oBAAoB;gBAClB,KAAK,CAAC,mBAAmB;gBACzB,MAAM,SAAS,GAAG,iBAAiB;gBACnC;aACD,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,QAAQ;QACjC;IACF;AACF","sources":["packages/@react-aria/checkbox/src/useCheckboxGroupItem.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaCheckboxGroupItemProps} from '@react-types/checkbox';\nimport {CheckboxAria, useCheckbox} from './useCheckbox';\nimport {checkboxGroupData} from './utils';\nimport {CheckboxGroupState} from '@react-stately/checkbox';\nimport {DEFAULT_VALIDATION_RESULT, privateValidationStateProp, useFormValidationState} from '@react-stately/form';\nimport {RefObject, ValidationResult} from '@react-types/shared';\nimport {useEffect, useRef} from 'react';\nimport {useToggleState} from '@react-stately/toggle';\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox component contained within a checkbox group.\n * Checkbox groups allow users to select multiple items from a list of options.\n * @param props - Props for the checkbox.\n * @param state - State for the checkbox, as returned by `useCheckboxGroupState`.\n * @param inputRef - A ref for the HTML input element.\n */\nexport function useCheckboxGroupItem(props: AriaCheckboxGroupItemProps, state: CheckboxGroupState, inputRef: RefObject<HTMLInputElement | null>): CheckboxAria {\n const toggleState = useToggleState({\n isReadOnly: props.isReadOnly || state.isReadOnly,\n isSelected: state.isSelected(props.value),\n onChange(isSelected) {\n if (isSelected) {\n state.addValue(props.value);\n } else {\n state.removeValue(props.value);\n }\n\n if (props.onChange) {\n props.onChange(isSelected);\n }\n }\n });\n\n let {name, descriptionId, errorMessageId, validationBehavior} = checkboxGroupData.get(state)!;\n validationBehavior = props.validationBehavior ?? validationBehavior;\n\n // Local validation for this checkbox.\n let {realtimeValidation} = useFormValidationState({\n ...props,\n value: toggleState.isSelected,\n // Server validation is handled at the group level.\n name: undefined,\n validationBehavior: 'aria'\n });\n\n // Update the checkbox group state when realtime validation changes.\n let nativeValidation = useRef(DEFAULT_VALIDATION_RESULT);\n let updateValidation = () => {\n state.setInvalid(props.value, realtimeValidation.isInvalid ? realtimeValidation : nativeValidation.current);\n };\n\n useEffect(updateValidation);\n\n // Combine group and checkbox level validation.\n let combinedRealtimeValidation = state.realtimeValidation.isInvalid ? state.realtimeValidation : realtimeValidation;\n let displayValidation = validationBehavior === 'native' ? state.displayValidation : combinedRealtimeValidation;\n\n let res = useCheckbox({\n ...props,\n isReadOnly: props.isReadOnly || state.isReadOnly,\n isDisabled: props.isDisabled || state.isDisabled,\n name: props.name || name,\n isRequired: props.isRequired ?? sLine truncated
@@ -0,0 +1,416 @@
# router
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][ci-image]][ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]
Simple middleware-style router
## Installation
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```bash
$ npm install router
```
## API
```js
var finalhandler = require('finalhandler')
var http = require('http')
var Router = require('router')
var router = Router()
router.get('/', function (req, res) {
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end('Hello World!')
})
var server = http.createServer(function (req, res) {
router(req, res, finalhandler(req, res))
})
server.listen(3000)
```
This module is currently an extracted version from the Express project,
but with the main change being it can be used with a plain `http.createServer`
object or other web frameworks by removing Express-specific API calls.
## Router(options)
Options
- `strict` - When `false` trailing slashes are optional (default: `false`)
- `caseSensitive` - When `true` the routing will be case sensitive. (default: `false`)
- `mergeParams` - When `true` any `req.params` passed to the router will be
merged into the router's `req.params`. (default: `false`) ([example](#example-using-mergeparams))
Returns a function with the signature `router(req, res, callback)` where
`callback([err])` must be provided to handle errors and fall-through from
not handling requests.
### router.use([path], ...middleware)
Use the given [middleware function](#middleware) for all http methods on the
given `path`, defaulting to the root path.
`router` does not automatically see `use` as a handler. As such, it will not
consider it one for handling `OPTIONS` requests.
* Note: If a `path` is specified, that `path` is stripped from the start of
`req.url`.
<!-- eslint-disable no-undef -->
```js
router.use(function (req, res, next) {
// do your things
// continue to the next middleware
// the request will stall if this is not called
next()
// note: you should NOT call `next` if you have begun writing to the response
})
```
[Middleware](#middleware) can themselves use `next('router')` at any time to
exit the current router instance completely, invoking the top-level callback.
### router\[method](path, ...[middleware], handler)
The [http methods](https://github.com/jshttp/methods/blob/master/index.js) provide
the routing functionality in `router`.
Method middleware and handlers follow usual [middleware](#middleware) behavior,
except they will only be called when the method and path match the request.
<!-- eslint-disable no-undef -->
```js
// handle a `GET` request
router.get('/', function (req, res) {
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end('Hello World!')
})
```
[Middleware](#middleware) given before the handler have one additional trick,
they may invoke `next('route')`. Calling `next('route')` bypasses the remaining
middleware and the handler mounted for this route, passing the request to the
next route suitable for handling this request.
Route handlers and middleware can themselves use `next('router')` at any time
to exit the current router instance completely, invoking the top-level callback.
### router.param(name, param_middleware)
Maps the specified path parameter `name` to a specialized param-capturing middleware.
This function positions the middleware in the same stack as `.use`.
The function can optionally return a `Promise` object. If a `Promise` object
is returned from the function, the router will attach an `onRejected` callback
using `.then`. If the promise is rejected, `next` will be called with the
rejected value, or an error if the value is falsy.
Parameter mapping is used to provide pre-conditions to routes
which use normalized placeholders. For example a _:user_id_ parameter
could automatically load a user's information from the database without
any additional code:
<!-- eslint-disable no-undef -->
```js
router.param('user_id', function (req, res, next, id) {
User.find(id, function (err, user) {
if (err) {
return next(err)
} else if (!user) {
return next(new Error('failed to load user'))
}
req.user = user
// continue processing the request
next()
})
})
```
### router.route(path)
Creates an instance of a single `Route` for the given `path`.
(See `Router.Route` below)
Routes can be used to handle http `methods` with their own, optional middleware.
Using `router.route(path)` is a recommended approach to avoiding duplicate
route naming and thus typo errors.
<!-- eslint-disable no-undef, no-unused-vars -->
```js
var api = router.route('/api/')
```
## Router.Route(path)
Represents a single route as an instance that can be used to handle http
`methods` with it's own, optional middleware.
### route\[method](handler)
These are functions which you can directly call on a route to register a new
`handler` for the `method` on the route.
<!-- eslint-disable no-undef -->
```js
// handle a `GET` request
var status = router.route('/status')
status.get(function (req, res) {
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end('All Systems Green!')
})
```
### route.all(handler)
Adds a handler for all HTTP methods to this route.
The handler can behave like middleware and call `next` to continue processing
rather than responding.
<!-- eslint-disable no-undef -->
```js
router.route('/')
.all(function (req, res, next) {
next()
})
.all(checkSomething)
.get(function (req, res) {
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end('Hello World!')
})
```
## Middleware
Middleware (and method handlers) are functions that follow specific function
parameters and have defined behavior when used with `router`. The most common
format is with three parameters - "req", "res" and "next".
- `req` - This is a [HTTP incoming message](https://nodejs.org/api/http.html#http_http_incomingmessage) instance.
- `res` - This is a [HTTP server response](https://nodejs.org/api/http.html#http_class_http_serverresponse) instance.
- `next` - Calling this function that tells `router` to proceed to the next matching middleware or method handler. It accepts an error as the first argument.
The function can optionally return a `Promise` object. If a `Promise` object
is returned from the function, the router will attach an `onRejected` callback
using `.then`. If the promise is rejected, `next` will be called with the
rejected value, or an error if the value is falsy.
Middleware and method handlers can also be defined with four arguments. When
the function has four parameters defined, the first argument is an error and
subsequent arguments remain, becoming - "err", "req", "res", "next". These
functions are "error handling middleware", and can be used for handling
errors that occurred in previous handlers (E.g. from calling `next(err)`).
This is most used when you want to define arbitrary rendering of errors.
<!-- eslint-disable no-undef -->
```js
router.get('/error_route', function (req, res, next) {
return next(new Error('Bad Request'))
})
router.use(function (err, req, res, next) {
res.end(err.message) //= > "Bad Request"
})
```
Error handling middleware will **only** be invoked when an error was given. As
long as the error is in the pipeline, normal middleware and handlers will be
bypassed - only error handling middleware will be invoked with an error.
## Examples
```js
// import our modules
var http = require('http')
var Router = require('router')
var finalhandler = require('finalhandler')
var compression = require('compression')
var bodyParser = require('body-parser')
// store our message to display
var message = 'Hello World!'
// initialize the router & server and add a final callback.
var router = Router()
var server = http.createServer(function onRequest (req, res) {
router(req, res, finalhandler(req, res))
})
// use some middleware and compress all outgoing responses
router.use(compression())
// handle `GET` requests to `/message`
router.get('/message', function (req, res) {
res.statusCode = 200
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end(message + '\n')
})
// create and mount a new router for our API
var api = Router()
router.use('/api/', api)
// add a body parsing middleware to our API
api.use(bodyParser.json())
// handle `PATCH` requests to `/api/set-message`
api.patch('/set-message', function (req, res) {
if (req.body.value) {
message = req.body.value
res.statusCode = 200
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end(message + '\n')
} else {
res.statusCode = 400
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end('Invalid API Syntax\n')
}
})
// make our http server listen to connections
server.listen(8080)
```
You can get the message by running this command in your terminal,
or navigating to `127.0.0.1:8080` in a web browser.
```bash
curl http://127.0.0.1:8080
```
You can set the message by sending it a `PATCH` request via this command:
```bash
curl http://127.0.0.1:8080/api/set-message -X PATCH -H "Content-Type: application/json" -d '{"value":"Cats!"}'
```
### Example using mergeParams
```js
var http = require('http')
var Router = require('router')
var finalhandler = require('finalhandler')
// this example is about the mergeParams option
var opts = { mergeParams: true }
// make a router with out special options
var router = Router(opts)
var server = http.createServer(function onRequest (req, res) {
// set something to be passed into the router
req.params = { type: 'kitten' }
router(req, res, finalhandler(req, res))
})
router.get('/', function (req, res) {
res.statusCode = 200
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
// with respond with the the params that were passed in
res.end(req.params.type + '\n')
})
// make another router with our options
var handler = Router(opts)
// mount our new router to a route that accepts a param
router.use('/:path', handler)
handler.get('/', function (req, res) {
res.statusCode = 200
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
// will respond with the param of the router's parent route
res.end(req.params.path + '\n')
})
// make our http server listen to connections
server.listen(8080)
```
Now you can get the type, or what path you are requesting:
```bash
curl http://127.0.0.1:8080
> kitten
curl http://127.0.0.1:8080/such_path
> such_path
```
### Example of advanced `.route()` usage
This example shows how to implement routes where there is a custom
handler to execute when the path matched, but no methods matched.
Without any special handling, this would be treated as just a
generic non-match by `router` (which typically results in a 404),
but with a custom handler, a `405 Method Not Allowed` can be sent.
```js
var http = require('http')
var finalhandler = require('finalhandler')
var Router = require('router')
// create the router and server
var router = new Router()
var server = http.createServer(function onRequest (req, res) {
router(req, res, finalhandler(req, res))
})
// register a route and add all methods
router.route('/pet/:id')
.get(function (req, res) {
// this is GET /pet/:id
res.setHeader('Content-Type', 'application/json')
res.end(JSON.stringify({ name: 'tobi' }))
})
.delete(function (req, res) {
// this is DELETE /pet/:id
res.end()
})
.all(function (req, res) {
// this is called for all other methods not
// defined above for /pet/:id
res.statusCode = 405
res.end()
})
// make our http server listen to connections
server.listen(8080)
```
## License
[MIT](LICENSE)
[ci-image]: https://badgen.net/github/checks/pillarjs/router/master?label=ci
[ci-url]: https://github.com/pillarjs/router/actions/workflows/ci.yml
[npm-image]: https://img.shields.io/npm/v/router.svg
[npm-url]: https://npmjs.org/package/router
[node-version-image]: https://img.shields.io/node/v/router.svg
[node-version-url]: http://nodejs.org/download/
[coveralls-image]: https://img.shields.io/coveralls/pillarjs/router/master.svg
[coveralls-url]: https://coveralls.io/r/pillarjs/router?branch=master
[downloads-image]: https://img.shields.io/npm/dm/router.svg
[downloads-url]: https://npmjs.org/package/router
@@ -0,0 +1,342 @@
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { 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 _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { 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 _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
import _accepts from "attr-accept";
var accepts = typeof _accepts === "function" ? _accepts : _accepts.default; // Error codes
export var FILE_INVALID_TYPE = "file-invalid-type";
export var FILE_TOO_LARGE = "file-too-large";
export var FILE_TOO_SMALL = "file-too-small";
export var TOO_MANY_FILES = "too-many-files";
export var ErrorCode = {
FileInvalidType: FILE_INVALID_TYPE,
FileTooLarge: FILE_TOO_LARGE,
FileTooSmall: FILE_TOO_SMALL,
TooManyFiles: TOO_MANY_FILES
};
/**
*
* @param {string} accept
*/
export var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr() {
var accept = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
var acceptArr = accept.split(",");
var msg = acceptArr.length > 1 ? "one of ".concat(acceptArr.join(", ")) : acceptArr[0];
return {
code: FILE_INVALID_TYPE,
message: "File type must be ".concat(msg)
};
};
export var getTooLargeRejectionErr = function getTooLargeRejectionErr(maxSize) {
return {
code: FILE_TOO_LARGE,
message: "File is larger than ".concat(maxSize, " ").concat(maxSize === 1 ? "byte" : "bytes")
};
};
export var getTooSmallRejectionErr = function getTooSmallRejectionErr(minSize) {
return {
code: FILE_TOO_SMALL,
message: "File is smaller than ".concat(minSize, " ").concat(minSize === 1 ? "byte" : "bytes")
};
};
export var TOO_MANY_FILES_REJECTION = {
code: TOO_MANY_FILES,
message: "Too many files"
};
/**
* Check if file is accepted.
*
* Firefox versions prior to 53 return a bogus MIME type for every file drag,
* so dragovers with that MIME type will always be accepted.
*
* @param {File} file
* @param {string} accept
* @returns
*/
export function fileAccepted(file, accept) {
var isAcceptable = file.type === "application/x-moz-file" || accepts(file, accept);
return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];
}
export function fileMatchSize(file, minSize, maxSize) {
if (isDefined(file.size)) {
if (isDefined(minSize) && isDefined(maxSize)) {
if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];
if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];
} else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];
}
return [true, null];
}
function isDefined(value) {
return value !== undefined && value !== null;
}
/**
*
* @param {object} options
* @param {File[]} options.files
* @param {string} [options.accept]
* @param {number} [options.minSize]
* @param {number} [options.maxSize]
* @param {boolean} [options.multiple]
* @param {number} [options.maxFiles]
* @param {(f: File) => FileError|FileError[]|null} [options.validator]
* @returns
*/
export function allFilesAccepted(_ref) {
var files = _ref.files,
accept = _ref.accept,
minSize = _ref.minSize,
maxSize = _ref.maxSize,
multiple = _ref.multiple,
maxFiles = _ref.maxFiles,
validator = _ref.validator;
if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {
return false;
}
return files.every(function (file) {
var _fileAccepted = fileAccepted(file, accept),
_fileAccepted2 = _slicedToArray(_fileAccepted, 1),
accepted = _fileAccepted2[0];
var _fileMatchSize = fileMatchSize(file, minSize, maxSize),
_fileMatchSize2 = _slicedToArray(_fileMatchSize, 1),
sizeMatch = _fileMatchSize2[0];
var customErrors = validator ? validator(file) : null;
return accepted && sizeMatch && !customErrors;
});
} // React's synthetic events has event.isPropagationStopped,
// but to remain compatibility with other libs (Preact) fall back
// to check event.cancelBubble
export function isPropagationStopped(event) {
if (typeof event.isPropagationStopped === "function") {
return event.isPropagationStopped();
} else if (typeof event.cancelBubble !== "undefined") {
return event.cancelBubble;
}
return false;
}
export function isEvtWithFiles(event) {
if (!event.dataTransfer) {
return !!event.target && !!event.target.files;
} // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types
// https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file
return Array.prototype.some.call(event.dataTransfer.types, function (type) {
return type === "Files" || type === "application/x-moz-file";
});
}
export function isKindFile(item) {
return _typeof(item) === "object" && item !== null && item.kind === "file";
} // allow the entire document to be a drag target
export function onDocumentDragOver(event) {
event.preventDefault();
}
function isIe(userAgent) {
return userAgent.indexOf("MSIE") !== -1 || userAgent.indexOf("Trident/") !== -1;
}
function isEdge(userAgent) {
return userAgent.indexOf("Edge/") !== -1;
}
export function isIeOrEdge() {
var userAgent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.navigator.userAgent;
return isIe(userAgent) || isEdge(userAgent);
}
/**
* This is intended to be used to compose event handlers
* They are executed in order until one of them calls `event.isPropagationStopped()`.
* Note that the check is done on the first invoke too,
* meaning that if propagation was stopped before invoking the fns,
* no handlers will be executed.
*
* @param {Function} fns the event hanlder functions
* @return {Function} the event handler to add to an element
*/
export function composeEventHandlers() {
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
fns[_key] = arguments[_key];
}
return function (event) {
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
return fns.some(function (fn) {
if (!isPropagationStopped(event) && fn) {
fn.apply(void 0, [event].concat(args));
}
return isPropagationStopped(event);
});
};
}
/**
* canUseFileSystemAccessAPI checks if the [File System Access API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API)
* is supported by the browser.
* @returns {boolean}
*/
export function canUseFileSystemAccessAPI() {
return "showOpenFilePicker" in window;
}
/**
* Convert the `{accept}` dropzone prop to the
* `{types}` option for https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker
*
* @param {AcceptProp} accept
* @returns {{accept: string[]}[]}
*/
export function pickerOptionsFromAccept(accept) {
if (isDefined(accept)) {
var acceptForPicker = Object.entries(accept).filter(function (_ref2) {
var _ref3 = _slicedToArray(_ref2, 2),
mimeType = _ref3[0],
ext = _ref3[1];
var ok = true;
if (!isMIMEType(mimeType)) {
console.warn("Skipped \"".concat(mimeType, "\" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types."));
ok = false;
}
if (!Array.isArray(ext) || !ext.every(isExt)) {
console.warn("Skipped \"".concat(mimeType, "\" because an invalid file extension was provided."));
ok = false;
}
return ok;
}).reduce(function (agg, _ref4) {
var _ref5 = _slicedToArray(_ref4, 2),
mimeType = _ref5[0],
ext = _ref5[1];
return _objectSpread(_objectSpread({}, agg), {}, _defineProperty({}, mimeType, ext));
}, {});
return [{
// description is required due to https://crbug.com/1264708
description: "Files",
accept: acceptForPicker
}];
}
return accept;
}
/**
* Convert the `{accept}` dropzone prop to an array of MIME types/extensions.
* @param {AcceptProp} accept
* @returns {string}
*/
export function acceptPropAsAcceptAttr(accept) {
if (isDefined(accept)) {
return Object.entries(accept).reduce(function (a, _ref6) {
var _ref7 = _slicedToArray(_ref6, 2),
mimeType = _ref7[0],
ext = _ref7[1];
return [].concat(_toConsumableArray(a), [mimeType], _toConsumableArray(ext));
}, []) // Silently discard invalid entries as pickerOptionsFromAccept warns about these
.filter(function (v) {
return isMIMEType(v) || isExt(v);
}).join(",");
}
return undefined;
}
/**
* Check if v is an exception caused by aborting a request (e.g window.showOpenFilePicker()).
*
* See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.
* @param {any} v
* @returns {boolean} True if v is an abort exception.
*/
export function isAbort(v) {
return v instanceof DOMException && (v.name === "AbortError" || v.code === v.ABORT_ERR);
}
/**
* Check if v is a security error.
*
* See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.
* @param {any} v
* @returns {boolean} True if v is a security error.
*/
export function isSecurityError(v) {
return v instanceof DOMException && (v.name === "SecurityError" || v.code === v.SECURITY_ERR);
}
/**
* Check if v is a MIME type string.
*
* See accepted format: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers.
*
* @param {string} v
*/
export function isMIMEType(v) {
return v === "audio/*" || v === "video/*" || v === "image/*" || v === "text/*" || v === "application/*" || /\w+\/[-+.\w]+/g.test(v);
}
/**
* Check if v is a file extension.
* @param {string} v
*/
export function isExt(v) {
return /^.*\.[\w]+$/.test(v);
}
/**
* @typedef {Object.<string, string[]>} AcceptProp
*/
/**
* @typedef {object} FileError
* @property {string} message
* @property {ErrorCode|string} code
*/
/**
* @typedef {"file-invalid-type"|"file-too-large"|"file-too-small"|"too-many-files"} ErrorCode
*/
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more