This commit is contained in:
2025-05-09 05:30:08 +02:00
parent 7bb10e7df4
commit 73367bad9e
5322 changed files with 1266973 additions and 313 deletions

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F mC","8":"A B"},B:{"1":"Q","2":"0 9 H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","8":"C L M G N O P"},C:{"2":"0 1 2 3 9 nC LC J PB K D E F A B C L M G N O P QB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC qC rC","66":"4 5 6 7 8 RB SB","72":"TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB"},D:{"1":"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q","2":"0 1 2 3 4 5 6 7 9 J PB K D E F A B C L M G N O P QB H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","66":"8 RB SB TB UB VB"},E:{"2":"J PB sC SC tC","8":"K D E F A B C L M G uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C"},F:{"1":"1 2 3 4 5 6 7 8 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B","2":"0 F B C 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 4C 5C 6C 7C FC kC 8C GC","66":"G N O P QB"},G:{"2":"SC 9C lC AD BD","8":"E CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC"},H:{"2":"WD"},I:{"1":"cD","2":"LC J I XD YD ZD aD lC bD"},J:{"2":"D A"},K:{"2":"A B C H FC kC GC"},L:{"2":"I"},M:{"2":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"J dD eD fD gD hD TC iD jD","2":"1 2 3 4 5 6 7 8 kD lD mD IC JC KC nD"},Q:{"1":"oD"},R:{"2":"pD"},S:{"2":"rD","72":"qD"}},B:7,C:"Custom Elements (deprecated V0 spec)",D:true};

View File

@@ -0,0 +1,49 @@
/**
* @fileoverview Rule to disallow empty static blocks.
* @author Sosuke Suzuki
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow empty static blocks",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-empty-static-block",
},
schema: [],
messages: {
unexpected: "Unexpected empty static block.",
},
},
create(context) {
const sourceCode = context.sourceCode;
return {
StaticBlock(node) {
if (node.body.length === 0) {
const closingBrace = sourceCode.getLastToken(node);
if (
sourceCode.getCommentsBefore(closingBrace).length === 0
) {
context.report({
node,
messageId: "unexpected",
});
}
}
},
};
},
};

View File

@@ -0,0 +1,80 @@
[![npm](https://img.shields.io/npm/v/make-cancellable-promise.svg)](https://www.npmjs.com/package/make-cancellable-promise) ![downloads](https://img.shields.io/npm/dt/make-cancellable-promise.svg) [![CI](https://github.com/wojtekmaj/make-cancellable-promise/workflows/CI/badge.svg)](https://github.com/wojtekmaj/make-cancellable-promise/actions)
# Make-Cancellable-Promise
Make any Promise cancellable.
## tl;dr
- Install by executing `npm install make-cancellable-promise` or `yarn add make-cancellable-promise`.
- Import by adding `import makeCancellablePromise from 'make-cancellable-promise`.
- Do stuff with it!
```ts
const { promise, cancel } = makeCancellablePromise(myPromise);
```
## User guide
### makeCancellablePromise(myPromise)
A function that returns an object with two properties:
`promise` and `cancel`. `promise` is a wrapped around your promise. `cancel` is a function which stops `.then()` and `.catch()` from working on `promise`, even if promise passed to `makeCancellablePromise` resolves or rejects.
#### Usage
```ts
const { promise, cancel } = makeCancellablePromise(myPromise);
```
Typically, you'd want to use `makeCancellablePromise` in React components. If you call `setState` on an unmounted component, React will throw an error.
Here's how you can use `makeCancellablePromise` with React:
```tsx
function MyComponent() {
const [status, setStatus] = useState('initial');
useEffect(() => {
const { promise, cancel } = makeCancellable(fetchData());
promise.then(() => setStatus('success')).catch(() => setStatus('error'));
return () => {
cancel();
};
}, []);
const text = (() => {
switch (status) {
case 'pending':
return 'Fetching…';
case 'success':
return 'Success';
case 'error':
return 'Error!';
default:
return 'Click to fetch';
}
})();
return <p>{text}</p>;
}
```
## License
The MIT License.
## Author
<table>
<tr>
<td >
<img src="https://avatars.githubusercontent.com/u/5426427?v=4&s=128" width="64" height="64" alt="Wojciech Maj">
</td>
<td>
<a href="https://github.com/wojtekmaj">Wojciech Maj</a>
</td>
</tr>
</table>

View File

@@ -0,0 +1,4 @@
'use client';
import { createContext } from 'react';
const documentContext = createContext(null);
export default documentContext;

View File

@@ -0,0 +1,240 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.resolveURI = factory());
})(this, (function () { 'use strict';
// Matches the scheme of a URL, eg "http://"
const schemeRegex = /^[\w+.-]+:\/\//;
/**
* Matches the parts of a URL:
* 1. Scheme, including ":", guaranteed.
* 2. User/password, including "@", optional.
* 3. Host, guaranteed.
* 4. Port, including ":", optional.
* 5. Path, including "/", optional.
* 6. Query, including "?", optional.
* 7. Hash, including "#", optional.
*/
const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
/**
* File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start
* with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).
*
* 1. Host, optional.
* 2. Path, which may include "/", guaranteed.
* 3. Query, including "?", optional.
* 4. Hash, including "#", optional.
*/
const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
function isAbsoluteUrl(input) {
return schemeRegex.test(input);
}
function isSchemeRelativeUrl(input) {
return input.startsWith('//');
}
function isAbsolutePath(input) {
return input.startsWith('/');
}
function isFileUrl(input) {
return input.startsWith('file:');
}
function isRelative(input) {
return /^[.?#]/.test(input);
}
function parseAbsoluteUrl(input) {
const match = urlRegex.exec(input);
return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || '');
}
function parseFileUrl(input) {
const match = fileRegex.exec(input);
const path = match[2];
return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || '');
}
function makeUrl(scheme, user, host, port, path, query, hash) {
return {
scheme,
user,
host,
port,
path,
query,
hash,
type: 7 /* Absolute */,
};
}
function parseUrl(input) {
if (isSchemeRelativeUrl(input)) {
const url = parseAbsoluteUrl('http:' + input);
url.scheme = '';
url.type = 6 /* SchemeRelative */;
return url;
}
if (isAbsolutePath(input)) {
const url = parseAbsoluteUrl('http://foo.com' + input);
url.scheme = '';
url.host = '';
url.type = 5 /* AbsolutePath */;
return url;
}
if (isFileUrl(input))
return parseFileUrl(input);
if (isAbsoluteUrl(input))
return parseAbsoluteUrl(input);
const url = parseAbsoluteUrl('http://foo.com/' + input);
url.scheme = '';
url.host = '';
url.type = input
? input.startsWith('?')
? 3 /* Query */
: input.startsWith('#')
? 2 /* Hash */
: 4 /* RelativePath */
: 1 /* Empty */;
return url;
}
function stripPathFilename(path) {
// If a path ends with a parent directory "..", then it's a relative path with excess parent
// paths. It's not a file, so we can't strip it.
if (path.endsWith('/..'))
return path;
const index = path.lastIndexOf('/');
return path.slice(0, index + 1);
}
function mergePaths(url, base) {
normalizePath(base, base.type);
// If the path is just a "/", then it was an empty path to begin with (remember, we're a relative
// path).
if (url.path === '/') {
url.path = base.path;
}
else {
// Resolution happens relative to the base path's directory, not the file.
url.path = stripPathFilename(base.path) + url.path;
}
}
/**
* The path can have empty directories "//", unneeded parents "foo/..", or current directory
* "foo/.". We need to normalize to a standard representation.
*/
function normalizePath(url, type) {
const rel = type <= 4 /* RelativePath */;
const pieces = url.path.split('/');
// We need to preserve the first piece always, so that we output a leading slash. The item at
// pieces[0] is an empty string.
let pointer = 1;
// Positive is the number of real directories we've output, used for popping a parent directory.
// Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo".
let positive = 0;
// We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will
// generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a
// real directory, we won't need to append, unless the other conditions happen again.
let addTrailingSlash = false;
for (let i = 1; i < pieces.length; i++) {
const piece = pieces[i];
// An empty directory, could be a trailing slash, or just a double "//" in the path.
if (!piece) {
addTrailingSlash = true;
continue;
}
// If we encounter a real directory, then we don't need to append anymore.
addTrailingSlash = false;
// A current directory, which we can always drop.
if (piece === '.')
continue;
// A parent directory, we need to see if there are any real directories we can pop. Else, we
// have an excess of parents, and we'll need to keep the "..".
if (piece === '..') {
if (positive) {
addTrailingSlash = true;
positive--;
pointer--;
}
else if (rel) {
// If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute
// URL, protocol relative URL, or an absolute path, we don't need to keep excess.
pieces[pointer++] = piece;
}
continue;
}
// We've encountered a real directory. Move it to the next insertion pointer, which accounts for
// any popped or dropped directories.
pieces[pointer++] = piece;
positive++;
}
let path = '';
for (let i = 1; i < pointer; i++) {
path += '/' + pieces[i];
}
if (!path || (addTrailingSlash && !path.endsWith('/..'))) {
path += '/';
}
url.path = path;
}
/**
* Attempts to resolve `input` URL/path relative to `base`.
*/
function resolve(input, base) {
if (!input && !base)
return '';
const url = parseUrl(input);
let inputType = url.type;
if (base && inputType !== 7 /* Absolute */) {
const baseUrl = parseUrl(base);
const baseType = baseUrl.type;
switch (inputType) {
case 1 /* Empty */:
url.hash = baseUrl.hash;
// fall through
case 2 /* Hash */:
url.query = baseUrl.query;
// fall through
case 3 /* Query */:
case 4 /* RelativePath */:
mergePaths(url, baseUrl);
// fall through
case 5 /* AbsolutePath */:
// The host, user, and port are joined, you can't copy one without the others.
url.user = baseUrl.user;
url.host = baseUrl.host;
url.port = baseUrl.port;
// fall through
case 6 /* SchemeRelative */:
// The input doesn't have a schema at least, so we need to copy at least that over.
url.scheme = baseUrl.scheme;
}
if (baseType > inputType)
inputType = baseType;
}
normalizePath(url, inputType);
const queryHash = url.query + url.hash;
switch (inputType) {
// This is impossible, because of the empty checks at the start of the function.
// case UrlType.Empty:
case 2 /* Hash */:
case 3 /* Query */:
return queryHash;
case 4 /* RelativePath */: {
// The first char is always a "/", and we need it to be relative.
const path = url.path.slice(1);
if (!path)
return queryHash || '.';
if (isRelative(base || input) && !isRelative(path)) {
// If base started with a leading ".", or there is no base and input started with a ".",
// then we need to ensure that the relative path starts with a ".". We don't know if
// relative starts with a "..", though, so check before prepending.
return './' + path + queryHash;
}
return path + queryHash;
}
case 5 /* AbsolutePath */:
return url.path + queryHash;
default:
return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;
}
}
return resolve;
}));
//# sourceMappingURL=resolve-uri.umd.js.map

View File

@@ -0,0 +1,8 @@
/**
* @fileoverview API entrypoint for hfs/core
* @author Nicholas C. Zakas
*/
export { Hfs } from "./hfs.js";
export { Path } from "./path.js";
export * from "./errors.js";

View File

@@ -0,0 +1,100 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "ALIAS_KEYS", {
enumerable: true,
get: function () {
return _utils.ALIAS_KEYS;
}
});
Object.defineProperty(exports, "BUILDER_KEYS", {
enumerable: true,
get: function () {
return _utils.BUILDER_KEYS;
}
});
Object.defineProperty(exports, "DEPRECATED_ALIASES", {
enumerable: true,
get: function () {
return _deprecatedAliases.DEPRECATED_ALIASES;
}
});
Object.defineProperty(exports, "DEPRECATED_KEYS", {
enumerable: true,
get: function () {
return _utils.DEPRECATED_KEYS;
}
});
Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", {
enumerable: true,
get: function () {
return _utils.FLIPPED_ALIAS_KEYS;
}
});
Object.defineProperty(exports, "NODE_FIELDS", {
enumerable: true,
get: function () {
return _utils.NODE_FIELDS;
}
});
Object.defineProperty(exports, "NODE_PARENT_VALIDATIONS", {
enumerable: true,
get: function () {
return _utils.NODE_PARENT_VALIDATIONS;
}
});
Object.defineProperty(exports, "PLACEHOLDERS", {
enumerable: true,
get: function () {
return _placeholders.PLACEHOLDERS;
}
});
Object.defineProperty(exports, "PLACEHOLDERS_ALIAS", {
enumerable: true,
get: function () {
return _placeholders.PLACEHOLDERS_ALIAS;
}
});
Object.defineProperty(exports, "PLACEHOLDERS_FLIPPED_ALIAS", {
enumerable: true,
get: function () {
return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS;
}
});
exports.TYPES = void 0;
Object.defineProperty(exports, "VISITOR_KEYS", {
enumerable: true,
get: function () {
return _utils.VISITOR_KEYS;
}
});
require("./core.js");
require("./flow.js");
require("./jsx.js");
require("./misc.js");
require("./experimental.js");
require("./typescript.js");
var _utils = require("./utils.js");
var _placeholders = require("./placeholders.js");
var _deprecatedAliases = require("./deprecated-aliases.js");
Object.keys(_deprecatedAliases.DEPRECATED_ALIASES).forEach(deprecatedAlias => {
_utils.FLIPPED_ALIAS_KEYS[deprecatedAlias] = _utils.FLIPPED_ALIAS_KEYS[_deprecatedAliases.DEPRECATED_ALIASES[deprecatedAlias]];
});
for (const {
types,
set
} of _utils.allExpandedTypes) {
for (const type of types) {
const aliases = _utils.FLIPPED_ALIAS_KEYS[type];
if (aliases) {
aliases.forEach(set.add, set);
} else {
set.add(type);
}
}
}
const TYPES = exports.TYPES = [].concat(Object.keys(_utils.VISITOR_KEYS), Object.keys(_utils.FLIPPED_ALIAS_KEYS), Object.keys(_utils.DEPRECATED_KEYS));
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC qC rC","2":"nC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC"},E:{"1":"PB K D E F A B C L M G tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"J sC SC"},F:{"1":"0 1 2 3 4 5 6 7 8 G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"E lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","16":"SC 9C"},H:{"2":"WD"},I:{"1":"I bD cD","2":"XD YD ZD","132":"LC J aD lC"},J:{"1":"A","2":"D"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"qD rD"}},B:7,C:"High-quality kerning pairs & ligatures",D:true};

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,72 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const React = require("react");
function _interopNamespaceDefault(e) {
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
if (e) {
for (const k in e) {
if (k !== "default") {
const d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: () => e[k]
});
}
}
}
n.default = e;
return Object.freeze(n);
}
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
function useStableCallback(fn) {
const fnRef = React__namespace.useRef(fn);
fnRef.current = fn;
const ref = React__namespace.useRef((...args) => fnRef.current(...args));
return ref.current;
}
const useLayoutEffect = typeof window !== "undefined" ? React__namespace.useLayoutEffect : React__namespace.useEffect;
function usePrevious(value) {
const ref = React__namespace.useRef({
value,
prev: null
});
const current = ref.current.value;
if (value !== current) {
ref.current = {
value,
prev: current
};
}
return ref.current.prev;
}
function useIntersectionObserver(ref, callback, intersectionObserverOptions = {}, options = {}) {
const isIntersectionObserverAvailable = React__namespace.useRef(
typeof IntersectionObserver === "function"
);
const observerRef = React__namespace.useRef(null);
React__namespace.useEffect(() => {
if (!ref.current || !isIntersectionObserverAvailable.current || options.disabled) {
return;
}
observerRef.current = new IntersectionObserver(([entry]) => {
callback(entry);
}, intersectionObserverOptions);
observerRef.current.observe(ref.current);
return () => {
var _a;
(_a = observerRef.current) == null ? void 0 : _a.disconnect();
};
}, [callback, intersectionObserverOptions, options.disabled, ref]);
return observerRef.current;
}
function useForwardedRef(ref) {
const innerRef = React__namespace.useRef(null);
React__namespace.useImperativeHandle(ref, () => innerRef.current, []);
return innerRef;
}
exports.useForwardedRef = useForwardedRef;
exports.useIntersectionObserver = useIntersectionObserver;
exports.useLayoutEffect = useLayoutEffect;
exports.usePrevious = usePrevious;
exports.useStableCallback = useStableCallback;
//# sourceMappingURL=utils.cjs.map

View File

@@ -0,0 +1,19 @@
# @babel/helpers
> Collection of helper functions used by Babel transforms.
See our website [@babel/helpers](https://babeljs.io/docs/babel-helpers) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/helpers
```
or using yarn:
```sh
yarn add @babel/helpers --dev
```

View File

@@ -0,0 +1,13 @@
"use strict";
const { stringifyValueForError } = require("./shared");
module.exports = function ({ ruleId, value }) {
return `
Configuration for rule "${ruleId}" is invalid. Expected severity of "off", 0, "warn", 1, "error", or 2.
You passed '${stringifyValueForError(value, 4)}'.
See https://eslint.org/docs/latest/use/configure/rules#using-configuration-files for configuring rules.
`.trimStart();
};

View File

@@ -0,0 +1,32 @@
'use strict';
var parse = require('../');
var test = require('tape');
test('short -k=v', function (t) {
t.plan(1);
var argv = parse(['-b=123']);
t.deepEqual(argv, { b: 123, _: [] });
});
test('multi short -k=v', function (t) {
t.plan(1);
var argv = parse(['-a=whatever', '-b=robots']);
t.deepEqual(argv, { a: 'whatever', b: 'robots', _: [] });
});
test('short with embedded equals -k=a=b', function (t) {
t.plan(1);
var argv = parse(['-k=a=b']);
t.deepEqual(argv, { k: 'a=b', _: [] });
});
test('short with later equals like -ab=c', function (t) {
t.plan(1);
var argv = parse(['-ab=c']);
t.deepEqual(argv, { a: true, b: 'c', _: [] });
});

View File

@@ -0,0 +1,11 @@
'use strict';
var parse = require('../');
var test = require('tape');
test('parse with modifier functions', function (t) {
t.plan(1);
var argv = parse(['-b', '123'], { boolean: 'b' });
t.deepEqual(argv, { b: true, _: [123] });
});

View File

@@ -0,0 +1,13 @@
const isMatch = (match, path) => {
const parts = path.split(".");
let part;
let value = match;
while ((part = parts.shift()) != null && value != null) {
value = value[part];
}
return value != null;
};
export {
isMatch
};
//# sourceMappingURL=Matches.js.map

View File

@@ -0,0 +1 @@
module.exports={C:{"35":0.01821,"52":0.00728,"99":0.00364,"103":0.03642,"105":0.00364,"106":0.00364,"113":0.00364,"115":0.16025,"120":0.04006,"121":0.03642,"122":0.00728,"123":0.00728,"124":0.01821,"127":0.04006,"128":0.11654,"131":0.01093,"132":0.02185,"133":0.00728,"134":0.03642,"135":0.29864,"136":1.22735,"137":0.02549,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 100 101 102 104 107 108 109 110 111 112 114 116 117 118 119 125 126 129 130 138 139 140 3.5 3.6"},D:{"39":0.00364,"41":0.00364,"42":0.00364,"43":0.00364,"44":0.00364,"47":0.00364,"48":0.00364,"49":0.00364,"51":0.00364,"55":0.00364,"56":0.00364,"58":0.00364,"59":0.00364,"60":0.00364,"65":0.00364,"66":0.00364,"71":0.00364,"75":0.00728,"79":0.02549,"80":0.00364,"84":0.00364,"87":0.0437,"88":0.00364,"91":0.00728,"93":0.00364,"94":0.01457,"99":0.00364,"103":0.02914,"104":0.00728,"105":0.01093,"106":0.00364,"107":0.00364,"108":0.01093,"109":1.24192,"110":0.00364,"111":0.00728,"112":0.00364,"113":0.00364,"114":0.00728,"116":0.04006,"117":0.00364,"118":0.00364,"119":0.03278,"120":0.01093,"121":0.01093,"122":0.05827,"123":0.02549,"124":0.05463,"125":0.05827,"126":0.05827,"127":0.02185,"128":0.08741,"129":0.08377,"130":0.0437,"131":0.17846,"132":0.71019,"133":7.37141,"134":14.54615,"135":0.01821,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 40 45 46 50 52 53 54 57 61 62 63 64 67 68 69 70 72 73 74 76 77 78 81 83 85 86 89 90 92 95 96 97 98 100 101 102 115 136 137 138"},F:{"36":0.00364,"87":0.00728,"88":0.00364,"95":0.01821,"109":0.00364,"114":0.00364,"116":0.4334,"117":1.03069,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"85":0.00364,"92":0.01457,"100":0.00364,"109":0.02185,"110":0.00364,"112":0.00364,"113":0.00364,"114":0.00728,"119":0.00364,"120":0.00364,"122":0.01093,"124":0.00728,"125":0.00728,"126":0.01093,"127":0.01093,"128":0.00728,"129":0.01093,"130":0.03278,"131":0.08377,"132":0.07284,"133":1.06711,"134":3.33243,_:"12 13 14 15 16 17 18 79 80 81 83 84 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 111 115 116 117 118 121 123"},E:{"12":0.00364,"14":0.00728,"15":0.00364,_:"0 4 5 6 7 8 9 10 11 13 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 15.5 16.2 17.3","5.1":0.00364,"13.1":0.00364,"14.1":0.00728,"15.6":0.04735,"16.0":0.00728,"16.1":0.00364,"16.3":0.00728,"16.4":0.01093,"16.5":0.01093,"16.6":0.01457,"17.0":0.00364,"17.1":0.01457,"17.2":0.00364,"17.4":0.00728,"17.5":0.03278,"17.6":0.10562,"18.0":0.01093,"18.1":0.02914,"18.2":0.01093,"18.3":0.44432,"18.4":0.00728},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00263,"5.0-5.1":0,"6.0-6.1":0.00788,"7.0-7.1":0.00525,"8.1-8.4":0,"9.0-9.2":0.00394,"9.3":0.01839,"10.0-10.2":0.00131,"10.3":0.03021,"11.0-11.2":0.13924,"11.3-11.4":0.00919,"12.0-12.1":0.00525,"12.2-12.5":0.13004,"13.0-13.1":0.00263,"13.2":0.00394,"13.3":0.00525,"13.4-13.7":0.01839,"14.0-14.4":0.04597,"14.5-14.8":0.05517,"15.0-15.1":0.03021,"15.2-15.3":0.03021,"15.4":0.03678,"15.5":0.04203,"15.6-15.8":0.51754,"16.0":0.07356,"16.1":0.15106,"16.2":0.07881,"16.3":0.13661,"16.4":0.03021,"16.5":0.05648,"16.6-16.7":0.61343,"17.0":0.03678,"17.1":0.06568,"17.2":0.04992,"17.3":0.06962,"17.4":0.13924,"17.5":0.31,"17.6-17.7":0.89979,"18.0":0.2522,"18.1":0.82492,"18.2":0.36911,"18.3":7.71455,"18.4":0.11428},P:{"4":0.03079,"20":0.02053,"21":0.01026,"22":0.05132,"23":0.03079,"24":0.05132,"25":0.01026,"26":0.03079,"27":2.07341,_:"5.0-5.4 6.2-6.4 8.2 9.2 10.1 12.0 14.0 16.0 17.0","7.2-7.4":0.04106,"11.1-11.2":0.01026,"13.0":0.02053,"15.0":0.01026,"18.0":0.01026,"19.0":0.01026},I:{"0":0.06979,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00002,"4.4":0,"4.4.3-4.4.4":0.00008},K:{"0":0.3179,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00364,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.30518},Q:{_:"14.9"},O:{"0":0.05722},H:{"0":0},L:{"0":48.55495}};

View File

@@ -0,0 +1,8 @@
'use strict'
module.exports = function (Yallist) {
Yallist.prototype[Symbol.iterator] = function* () {
for (let walker = this.head; walker; walker = walker.next) {
yield walker.value
}
}
}

View File

@@ -0,0 +1 @@
{"version":3,"names":["_arrayLikeToArray","require","_unsupportedIterableToArray","o","minLen","arrayLikeToArray","name","Object","prototype","toString","call","slice","constructor","Array","from","test"],"sources":["../../src/helpers/unsupportedIterableToArray.ts"],"sourcesContent":["/* @minVersion 7.9.0 */\n\nimport arrayLikeToArray from \"./arrayLikeToArray.ts\";\n\ntype NonArrayIterable<V, T extends Iterable<V> = Iterable<V>> =\n T extends Array<any> ? never : Iterable<V>;\n\nexport default function _unsupportedIterableToArray<T>(\n o: RelativeIndexable<T> /* string | typedarray */ | ArrayLike<T> | Set<T>,\n minLen?: number | null,\n): T[];\nexport default function _unsupportedIterableToArray<T, K>(\n o: Map<K, T>,\n minLen?: number | null,\n): [K, T][];\n// This is a specific overload added specifically for createForOfIteratorHelpers.ts\nexport default function _unsupportedIterableToArray<T>(\n o: NonArrayIterable<T>,\n minLen?: number | null,\n): undefined;\nexport default function _unsupportedIterableToArray(\n o: any,\n minLen?: number | null,\n): any[] | undefined {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray<string>(o, minLen);\n var name = Object.prototype.toString.call(o).slice(8, -1);\n if (name === \"Object\" && o.constructor) name = o.constructor.name;\n if (name === \"Map\" || name === \"Set\") return Array.from(o);\n if (\n name === \"Arguments\" ||\n /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(name)\n ) {\n return arrayLikeToArray(o, minLen);\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAkBe,SAASC,2BAA2BA,CACjDC,CAAM,EACNC,MAAsB,EACH;EACnB,IAAI,CAACD,CAAC,EAAE;EACR,IAAI,OAAOA,CAAC,KAAK,QAAQ,EAAE,OAAO,IAAAE,yBAAgB,EAASF,CAAC,EAAEC,MAAM,CAAC;EACrE,IAAIE,IAAI,GAAGC,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACP,CAAC,CAAC,CAACQ,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EACzD,IAAIL,IAAI,KAAK,QAAQ,IAAIH,CAAC,CAACS,WAAW,EAAEN,IAAI,GAAGH,CAAC,CAACS,WAAW,CAACN,IAAI;EACjE,IAAIA,IAAI,KAAK,KAAK,IAAIA,IAAI,KAAK,KAAK,EAAE,OAAOO,KAAK,CAACC,IAAI,CAACX,CAAC,CAAC;EAC1D,IACEG,IAAI,KAAK,WAAW,IACpB,0CAA0C,CAACS,IAAI,CAACT,IAAI,CAAC,EACrD;IACA,OAAO,IAAAD,yBAAgB,EAACF,CAAC,EAAEC,MAAM,CAAC;EACpC;AACF","ignoreList":[]}

View File

@@ -0,0 +1,64 @@
const path = require('path')
const minimist = require('minimist')
const getAbi = require('node-abi').getAbi
const detectLibc = require('detect-libc')
const napi = require('napi-build-utils')
const env = process.env
const libc = env.LIBC || process.env.npm_config_libc ||
(detectLibc.isNonGlibcLinuxSync() && detectLibc.familySync()) || ''
// Get the configuration
module.exports = function (pkg) {
const pkgConf = pkg.config || {}
const buildFromSource = env.npm_config_build_from_source
const rc = require('rc')('prebuild-install', {
target: pkgConf.target || env.npm_config_target || process.versions.node,
runtime: pkgConf.runtime || env.npm_config_runtime || 'node',
arch: pkgConf.arch || env.npm_config_arch || process.arch,
libc: libc,
platform: env.npm_config_platform || process.platform,
debug: env.npm_config_debug === 'true',
force: false,
verbose: env.npm_config_verbose === 'true',
buildFromSource: buildFromSource === pkg.name || buildFromSource === 'true',
path: '.',
proxy: env.npm_config_proxy || env.http_proxy || env.HTTP_PROXY,
'https-proxy': env.npm_config_https_proxy || env.https_proxy || env.HTTPS_PROXY,
'local-address': env.npm_config_local_address,
'local-prebuilds': 'prebuilds',
'tag-prefix': 'v',
download: env.npm_config_download
}, minimist(process.argv, {
alias: {
target: 't',
runtime: 'r',
help: 'h',
arch: 'a',
path: 'p',
version: 'v',
download: 'd',
buildFromSource: 'build-from-source',
token: 'T'
}
}))
rc.path = path.resolve(rc.path === true ? '.' : rc.path || '.')
if (napi.isNapiRuntime(rc.runtime) && rc.target === process.versions.node) {
rc.target = napi.getBestNapiBuildVersion()
}
rc.abi = napi.isNapiRuntime(rc.runtime) ? rc.target : getAbi(rc.target, rc.runtime)
rc.libc = rc.platform !== 'linux' || rc.libc === detectLibc.GLIBC ? '' : rc.libc
return rc
}
// Print the configuration values when executed standalone for testing purposses
if (!module.parent) {
console.log(JSON.stringify(module.exports({}), null, 2))
}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"F A B","2":"K D E mC"},B:{"1":"0 9 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I"},C:{"1":"0 3 4 5 6 7 8 9 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"nC LC","132":"1 2 J PB K D E F A B C L M G N O P QB qC rC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC"},E:{"1":"J PB K D E F A B C L M G tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"sC SC"},F:{"1":"0 1 2 3 4 5 6 7 8 G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"E 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","2":"SC"},H:{"2":"WD"},I:{"1":"LC J I ZD aD lC bD cD","2":"XD YD"},J:{"1":"D A"},K:{"1":"B C H FC kC GC","2":"A"},L:{"1":"I"},M:{"1":"EC"},N:{"1":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"qD rD"}},B:6,C:"MP3 audio format",D:true};

View File

@@ -0,0 +1,187 @@
/**
* @fileoverview Rule to flag statements that use != and == instead of !== and ===
* @author Nicholas C. Zakas
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Require the use of `===` and `!==`",
recommended: false,
url: "https://eslint.org/docs/latest/rules/eqeqeq",
},
schema: {
anyOf: [
{
type: "array",
items: [
{
enum: ["always"],
},
{
type: "object",
properties: {
null: {
enum: ["always", "never", "ignore"],
},
},
additionalProperties: false,
},
],
additionalItems: false,
},
{
type: "array",
items: [
{
enum: ["smart", "allow-null"],
},
],
additionalItems: false,
},
],
},
fixable: "code",
messages: {
unexpected:
"Expected '{{expectedOperator}}' and instead saw '{{actualOperator}}'.",
},
},
create(context) {
const config = context.options[0] || "always";
const options = context.options[1] || {};
const sourceCode = context.sourceCode;
const nullOption =
config === "always" ? options.null || "always" : "ignore";
const enforceRuleForNull = nullOption === "always";
const enforceInverseRuleForNull = nullOption === "never";
/**
* Checks if an expression is a typeof expression
* @param {ASTNode} node The node to check
* @returns {boolean} if the node is a typeof expression
*/
function isTypeOf(node) {
return (
node.type === "UnaryExpression" && node.operator === "typeof"
);
}
/**
* Checks if either operand of a binary expression is a typeof operation
* @param {ASTNode} node The node to check
* @returns {boolean} if one of the operands is typeof
* @private
*/
function isTypeOfBinary(node) {
return isTypeOf(node.left) || isTypeOf(node.right);
}
/**
* Checks if operands are literals of the same type (via typeof)
* @param {ASTNode} node The node to check
* @returns {boolean} if operands are of same type
* @private
*/
function areLiteralsAndSameType(node) {
return (
node.left.type === "Literal" &&
node.right.type === "Literal" &&
typeof node.left.value === typeof node.right.value
);
}
/**
* Checks if one of the operands is a literal null
* @param {ASTNode} node The node to check
* @returns {boolean} if operands are null
* @private
*/
function isNullCheck(node) {
return (
astUtils.isNullLiteral(node.right) ||
astUtils.isNullLiteral(node.left)
);
}
/**
* Reports a message for this rule.
* @param {ASTNode} node The binary expression node that was checked
* @param {string} expectedOperator The operator that was expected (either '==', '!=', '===', or '!==')
* @returns {void}
* @private
*/
function report(node, expectedOperator) {
const operatorToken = sourceCode.getFirstTokenBetween(
node.left,
node.right,
token => token.value === node.operator,
);
context.report({
node,
loc: operatorToken.loc,
messageId: "unexpected",
data: { expectedOperator, actualOperator: node.operator },
fix(fixer) {
// If the comparison is a `typeof` comparison or both sides are literals with the same type, then it's safe to fix.
if (isTypeOfBinary(node) || areLiteralsAndSameType(node)) {
return fixer.replaceText(
operatorToken,
expectedOperator,
);
}
return null;
},
});
}
return {
BinaryExpression(node) {
const isNull = isNullCheck(node);
if (node.operator !== "==" && node.operator !== "!=") {
if (enforceInverseRuleForNull && isNull) {
report(node, node.operator.slice(0, -1));
}
return;
}
if (
config === "smart" &&
(isTypeOfBinary(node) ||
areLiteralsAndSameType(node) ||
isNull)
) {
return;
}
if (!enforceRuleForNull && isNull) {
return;
}
report(node, `${node.operator}=`);
},
};
},
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"not-found.js","sources":["../../src/not-found.ts"],"sourcesContent":["import type { RouteIds } from './routeInfo'\nimport type { RegisteredRouter } from './router'\n\nexport type NotFoundError = {\n /**\n @deprecated\n Use `routeId: rootRouteId` instead\n */\n global?: boolean\n /**\n @private\n Do not use this. It's used internally to indicate a path matching error\n */\n _global?: boolean\n data?: any\n throw?: boolean\n routeId?: RouteIds<RegisteredRouter['routeTree']>\n headers?: HeadersInit\n}\n\nexport function notFound(options: NotFoundError = {}) {\n ;(options as any).isNotFound = true\n if (options.throw) throw options\n return options\n}\n\nexport function isNotFound(obj: any): obj is NotFoundError {\n return !!obj?.isNotFound\n}\n"],"names":[],"mappings":"AAoBgB,SAAA,SAAS,UAAyB,IAAI;AAClD,UAAgB,aAAa;AAC3B,MAAA,QAAQ,MAAa,OAAA;AAClB,SAAA;AACT;AAEO,SAAS,WAAW,KAAgC;AAClD,SAAA,CAAC,EAAC,2BAAK;AAChB;"}