chore(ja3-ja4-tls-fingerprinting): untrack accidentally committed frontend/.pnpm-store
This commit is contained in:
parent
e87efe7e29
commit
fb8e8c0ac9
|
|
@ -1,68 +0,0 @@
|
|||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/streamedQuery.ts
|
||||
var streamedQuery_exports = {};
|
||||
__export(streamedQuery_exports, {
|
||||
streamedQuery: () => streamedQuery
|
||||
});
|
||||
module.exports = __toCommonJS(streamedQuery_exports);
|
||||
var import_utils = require("./utils.cjs");
|
||||
function streamedQuery({
|
||||
streamFn,
|
||||
refetchMode = "reset",
|
||||
reducer = (items, chunk) => (0, import_utils.addToEnd)(items, chunk),
|
||||
initialValue = []
|
||||
}) {
|
||||
return async (context) => {
|
||||
const query = context.client.getQueryCache().find({ queryKey: context.queryKey, exact: true });
|
||||
const isRefetch = !!query && query.state.data !== void 0;
|
||||
if (isRefetch && refetchMode === "reset") {
|
||||
query.setState({
|
||||
status: "pending",
|
||||
data: void 0,
|
||||
error: null,
|
||||
fetchStatus: "fetching"
|
||||
});
|
||||
}
|
||||
let result = initialValue;
|
||||
const stream = await streamFn(context);
|
||||
for await (const chunk of stream) {
|
||||
if (context.signal.aborted) {
|
||||
break;
|
||||
}
|
||||
if (!isRefetch || refetchMode !== "replace") {
|
||||
context.client.setQueryData(
|
||||
context.queryKey,
|
||||
(prev) => reducer(prev === void 0 ? initialValue : prev, chunk)
|
||||
);
|
||||
}
|
||||
result = reducer(result, chunk);
|
||||
}
|
||||
if (isRefetch && refetchMode === "replace" && !context.signal.aborted) {
|
||||
context.client.setQueryData(context.queryKey, result);
|
||||
}
|
||||
return context.client.getQueryData(context.queryKey) ?? initialValue;
|
||||
};
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
streamedQuery
|
||||
});
|
||||
//# sourceMappingURL=streamedQuery.cjs.map
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,39 +0,0 @@
|
|||
/**
|
||||
Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag.
|
||||
|
||||
@param flag - CLI flag to look for. The `--` prefix is optional.
|
||||
@param argv - CLI arguments. Default: `process.argv`.
|
||||
@returns Whether the flag exists.
|
||||
|
||||
@example
|
||||
```
|
||||
// $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow
|
||||
|
||||
// foo.ts
|
||||
import hasFlag = require('has-flag');
|
||||
|
||||
hasFlag('unicorn');
|
||||
//=> true
|
||||
|
||||
hasFlag('--unicorn');
|
||||
//=> true
|
||||
|
||||
hasFlag('f');
|
||||
//=> true
|
||||
|
||||
hasFlag('-f');
|
||||
//=> true
|
||||
|
||||
hasFlag('foo=bar');
|
||||
//=> true
|
||||
|
||||
hasFlag('foo');
|
||||
//=> false
|
||||
|
||||
hasFlag('rainbow');
|
||||
//=> false
|
||||
```
|
||||
*/
|
||||
declare function hasFlag(flag: string, argv?: string[]): boolean;
|
||||
|
||||
export = hasFlag;
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={A:{A:{"1":"F A B","2":"xC","8":"K D E"},B:{"1":"0 1 2 3 4 5 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC zC 0C 1C 2C","8":"yC TC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC"},E:{"1":"J ZB K D E F A B C L M G 4C 5C 6C 7C bC NC OC 8C 9C AD cC dC PC BD QC eC fC gC hC iC CD RC jC kC lC mC nC DD SC oC pC qC rC sC tC uC ED FD","8":"3C aC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z ID JD NC vC KD OC","8":"F GD HD"},G:{"1":"E aC LD wC MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD cC dC PC fD QC eC fC gC hC iC gD RC jC kC lC mC nC hD SC oC pC qC rC sC tC uC"},H:{"2":"iD"},I:{"1":"TC J I jD kD lD mD wC nD oD"},J:{"1":"D A"},K:{"1":"B C H NC vC OC","8":"A"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB pD qD rD sD tD bC uD vD wD xD yD QC RC SC zD"},Q:{"1":"0D"},R:{"1":"1D"},S:{"1":"2D 3D"}},B:1,C:"Text API for Canvas",D:true};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,35 +0,0 @@
|
|||
const unicode = require('../lib/unicode')
|
||||
|
||||
module.exports = {
|
||||
isSpaceSeparator (c) {
|
||||
return typeof c === 'string' && unicode.Space_Separator.test(c)
|
||||
},
|
||||
|
||||
isIdStartChar (c) {
|
||||
return typeof c === 'string' && (
|
||||
(c >= 'a' && c <= 'z') ||
|
||||
(c >= 'A' && c <= 'Z') ||
|
||||
(c === '$') || (c === '_') ||
|
||||
unicode.ID_Start.test(c)
|
||||
)
|
||||
},
|
||||
|
||||
isIdContinueChar (c) {
|
||||
return typeof c === 'string' && (
|
||||
(c >= 'a' && c <= 'z') ||
|
||||
(c >= 'A' && c <= 'Z') ||
|
||||
(c >= '0' && c <= '9') ||
|
||||
(c === '$') || (c === '_') ||
|
||||
(c === '\u200C') || (c === '\u200D') ||
|
||||
unicode.ID_Continue.test(c)
|
||||
)
|
||||
},
|
||||
|
||||
isDigit (c) {
|
||||
return typeof c === 'string' && /[0-9]/.test(c)
|
||||
},
|
||||
|
||||
isHexDigit (c) {
|
||||
return typeof c === 'string' && /[0-9A-Fa-f]/.test(c)
|
||||
},
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={A:{A:{"2":"K D E F A B xC"},B:{"1":"0 1 2 3 4 5 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC zC 0C","2":"6 7 8 9 yC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC 1C 2C"},D:{"1":"0 1 2 3 4 5 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC"},E:{"1":"hC iC CD RC jC kC lC mC nC DD SC oC pC qC rC sC tC uC ED FD","2":"J ZB K D E F A B C L M G 3C aC 4C 5C 6C 7C bC NC OC 8C 9C AD cC dC PC BD QC eC fC gC"},F:{"1":"0 1 2 3 4 5 uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB GD HD ID JD NC vC KD OC"},G:{"1":"hC iC gD RC jC kC lC mC nC hD SC oC pC qC rC sC tC uC","2":"E aC LD wC MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD cC dC PC fD QC eC fC gC"},H:{"2":"iD"},I:{"1":"I","2":"TC J jD kD lD mD wC nD oD"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC vC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB sD tD bC uD vD wD xD yD QC RC SC zD","2":"J pD qD rD"},Q:{"1":"0D"},R:{"1":"1D"},S:{"1":"3D","2":"2D"}},B:6,C:"Lookbehind in JS regular expressions",D:true};
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
type Pathname = string
|
||||
|
||||
interface TestResult {
|
||||
ignored: boolean
|
||||
unignored: boolean
|
||||
}
|
||||
|
||||
export interface Ignore {
|
||||
/**
|
||||
* Adds one or several rules to the current manager.
|
||||
* @param {string[]} patterns
|
||||
* @returns IgnoreBase
|
||||
*/
|
||||
add(patterns: string | Ignore | readonly (string | Ignore)[]): this
|
||||
|
||||
/**
|
||||
* Filters the given array of pathnames, and returns the filtered array.
|
||||
* NOTICE that each path here should be a relative path to the root of your repository.
|
||||
* @param paths the array of paths to be filtered.
|
||||
* @returns The filtered array of paths
|
||||
*/
|
||||
filter(pathnames: readonly Pathname[]): Pathname[]
|
||||
|
||||
/**
|
||||
* Creates a filter function which could filter
|
||||
* an array of paths with Array.prototype.filter.
|
||||
*/
|
||||
createFilter(): (pathname: Pathname) => boolean
|
||||
|
||||
/**
|
||||
* Returns Boolean whether pathname should be ignored.
|
||||
* @param {string} pathname a path to check
|
||||
* @returns boolean
|
||||
*/
|
||||
ignores(pathname: Pathname): boolean
|
||||
|
||||
/**
|
||||
* Returns whether pathname should be ignored or unignored
|
||||
* @param {string} pathname a path to check
|
||||
* @returns TestResult
|
||||
*/
|
||||
test(pathname: Pathname): TestResult
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
ignorecase?: boolean
|
||||
// For compatibility
|
||||
ignoreCase?: boolean
|
||||
allowRelativePaths?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new ignore manager.
|
||||
*/
|
||||
declare function ignore(options?: Options): Ignore
|
||||
|
||||
declare namespace ignore {
|
||||
export function isPathValid (pathname: string): boolean
|
||||
}
|
||||
|
||||
export default ignore
|
||||
|
|
@ -1,632 +0,0 @@
|
|||
/**
|
||||
* lodash (Custom Build) <https://lodash.com/>
|
||||
* Build: `lodash modularize exports="npm" -o ./`
|
||||
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||||
* Released under MIT license <https://lodash.com/license>
|
||||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
*/
|
||||
|
||||
/** Used as default options for `_.truncate`. */
|
||||
var DEFAULT_TRUNC_LENGTH = 30,
|
||||
DEFAULT_TRUNC_OMISSION = '...';
|
||||
|
||||
/** Used as references for various `Number` constants. */
|
||||
var INFINITY = 1 / 0,
|
||||
MAX_INTEGER = 1.7976931348623157e+308,
|
||||
NAN = 0 / 0;
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var regexpTag = '[object RegExp]',
|
||||
symbolTag = '[object Symbol]';
|
||||
|
||||
/** Used to match leading and trailing whitespace. */
|
||||
var reTrim = /^\s+|\s+$/g;
|
||||
|
||||
/** Used to match `RegExp` flags from their coerced string values. */
|
||||
var reFlags = /\w*$/;
|
||||
|
||||
/** Used to detect bad signed hexadecimal string values. */
|
||||
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
||||
|
||||
/** Used to detect binary string values. */
|
||||
var reIsBinary = /^0b[01]+$/i;
|
||||
|
||||
/** Used to detect octal string values. */
|
||||
var reIsOctal = /^0o[0-7]+$/i;
|
||||
|
||||
/** Used to compose unicode character classes. */
|
||||
var rsAstralRange = '\\ud800-\\udfff',
|
||||
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
||||
rsComboSymbolsRange = '\\u20d0-\\u20f0',
|
||||
rsVarRange = '\\ufe0e\\ufe0f';
|
||||
|
||||
/** Used to compose unicode capture groups. */
|
||||
var rsAstral = '[' + rsAstralRange + ']',
|
||||
rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
|
||||
rsFitz = '\\ud83c[\\udffb-\\udfff]',
|
||||
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
|
||||
rsNonAstral = '[^' + rsAstralRange + ']',
|
||||
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
|
||||
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
|
||||
rsZWJ = '\\u200d';
|
||||
|
||||
/** Used to compose unicode regexes. */
|
||||
var reOptMod = rsModifier + '?',
|
||||
rsOptVar = '[' + rsVarRange + ']?',
|
||||
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
|
||||
rsSeq = rsOptVar + reOptMod + rsOptJoin,
|
||||
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
|
||||
|
||||
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
|
||||
var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
|
||||
|
||||
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
|
||||
var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
|
||||
|
||||
/** Built-in method references without a dependency on `root`. */
|
||||
var freeParseInt = parseInt;
|
||||
|
||||
/** Detect free variable `global` from Node.js. */
|
||||
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
||||
|
||||
/** Detect free variable `self`. */
|
||||
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
||||
|
||||
/** Used as a reference to the global object. */
|
||||
var root = freeGlobal || freeSelf || Function('return this')();
|
||||
|
||||
/** Detect free variable `exports`. */
|
||||
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
||||
|
||||
/** Detect free variable `module`. */
|
||||
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
||||
|
||||
/** Detect the popular CommonJS extension `module.exports`. */
|
||||
var moduleExports = freeModule && freeModule.exports === freeExports;
|
||||
|
||||
/** Detect free variable `process` from Node.js. */
|
||||
var freeProcess = moduleExports && freeGlobal.process;
|
||||
|
||||
/** Used to access faster Node.js helpers. */
|
||||
var nodeUtil = (function() {
|
||||
try {
|
||||
return freeProcess && freeProcess.binding('util');
|
||||
} catch (e) {}
|
||||
}());
|
||||
|
||||
/* Node.js helper references. */
|
||||
var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;
|
||||
|
||||
/**
|
||||
* Gets the size of an ASCII `string`.
|
||||
*
|
||||
* @private
|
||||
* @param {string} string The string inspect.
|
||||
* @returns {number} Returns the string size.
|
||||
*/
|
||||
var asciiSize = baseProperty('length');
|
||||
|
||||
/**
|
||||
* Converts an ASCII `string` to an array.
|
||||
*
|
||||
* @private
|
||||
* @param {string} string The string to convert.
|
||||
* @returns {Array} Returns the converted array.
|
||||
*/
|
||||
function asciiToArray(string) {
|
||||
return string.split('');
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `_.property` without support for deep paths.
|
||||
*
|
||||
* @private
|
||||
* @param {string} key The key of the property to get.
|
||||
* @returns {Function} Returns the new accessor function.
|
||||
*/
|
||||
function baseProperty(key) {
|
||||
return function(object) {
|
||||
return object == null ? undefined : object[key];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `_.unary` without support for storing metadata.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to cap arguments for.
|
||||
* @returns {Function} Returns the new capped function.
|
||||
*/
|
||||
function baseUnary(func) {
|
||||
return function(value) {
|
||||
return func(value);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `string` contains Unicode symbols.
|
||||
*
|
||||
* @private
|
||||
* @param {string} string The string to inspect.
|
||||
* @returns {boolean} Returns `true` if a symbol is found, else `false`.
|
||||
*/
|
||||
function hasUnicode(string) {
|
||||
return reHasUnicode.test(string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the number of symbols in `string`.
|
||||
*
|
||||
* @private
|
||||
* @param {string} string The string to inspect.
|
||||
* @returns {number} Returns the string size.
|
||||
*/
|
||||
function stringSize(string) {
|
||||
return hasUnicode(string)
|
||||
? unicodeSize(string)
|
||||
: asciiSize(string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `string` to an array.
|
||||
*
|
||||
* @private
|
||||
* @param {string} string The string to convert.
|
||||
* @returns {Array} Returns the converted array.
|
||||
*/
|
||||
function stringToArray(string) {
|
||||
return hasUnicode(string)
|
||||
? unicodeToArray(string)
|
||||
: asciiToArray(string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the size of a Unicode `string`.
|
||||
*
|
||||
* @private
|
||||
* @param {string} string The string inspect.
|
||||
* @returns {number} Returns the string size.
|
||||
*/
|
||||
function unicodeSize(string) {
|
||||
var result = reUnicode.lastIndex = 0;
|
||||
while (reUnicode.test(string)) {
|
||||
result++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a Unicode `string` to an array.
|
||||
*
|
||||
* @private
|
||||
* @param {string} string The string to convert.
|
||||
* @returns {Array} Returns the converted array.
|
||||
*/
|
||||
function unicodeToArray(string) {
|
||||
return string.match(reUnicode) || [];
|
||||
}
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/**
|
||||
* Used to resolve the
|
||||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||
* of values.
|
||||
*/
|
||||
var objectToString = objectProto.toString;
|
||||
|
||||
/** Built-in value references. */
|
||||
var Symbol = root.Symbol;
|
||||
|
||||
/** Used to convert symbols to primitives and strings. */
|
||||
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
||||
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.isRegExp` without Node.js optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
|
||||
*/
|
||||
function baseIsRegExp(value) {
|
||||
return isObject(value) && objectToString.call(value) == regexpTag;
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `_.slice` without an iteratee call guard.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to slice.
|
||||
* @param {number} [start=0] The start position.
|
||||
* @param {number} [end=array.length] The end position.
|
||||
* @returns {Array} Returns the slice of `array`.
|
||||
*/
|
||||
function baseSlice(array, start, end) {
|
||||
var index = -1,
|
||||
length = array.length;
|
||||
|
||||
if (start < 0) {
|
||||
start = -start > length ? 0 : (length + start);
|
||||
}
|
||||
end = end > length ? length : end;
|
||||
if (end < 0) {
|
||||
end += length;
|
||||
}
|
||||
length = start > end ? 0 : ((end - start) >>> 0);
|
||||
start >>>= 0;
|
||||
|
||||
var result = Array(length);
|
||||
while (++index < length) {
|
||||
result[index] = array[index + start];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `_.toString` which doesn't convert nullish
|
||||
* values to empty strings.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to process.
|
||||
* @returns {string} Returns the string.
|
||||
*/
|
||||
function baseToString(value) {
|
||||
// Exit early for strings to avoid a performance hit in some environments.
|
||||
if (typeof value == 'string') {
|
||||
return value;
|
||||
}
|
||||
if (isSymbol(value)) {
|
||||
return symbolToString ? symbolToString.call(value) : '';
|
||||
}
|
||||
var result = (value + '');
|
||||
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Casts `array` to a slice if it's needed.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {number} start The start position.
|
||||
* @param {number} [end=array.length] The end position.
|
||||
* @returns {Array} Returns the cast slice.
|
||||
*/
|
||||
function castSlice(array, start, end) {
|
||||
var length = array.length;
|
||||
end = end === undefined ? length : end;
|
||||
return (!start && end >= length) ? array : baseSlice(array, start, end);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is the
|
||||
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
||||
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 0.1.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isObject({});
|
||||
* // => true
|
||||
*
|
||||
* _.isObject([1, 2, 3]);
|
||||
* // => true
|
||||
*
|
||||
* _.isObject(_.noop);
|
||||
* // => true
|
||||
*
|
||||
* _.isObject(null);
|
||||
* // => false
|
||||
*/
|
||||
function isObject(value) {
|
||||
var type = typeof value;
|
||||
return !!value && (type == 'object' || type == 'function');
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
||||
* and has a `typeof` result of "object".
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isObjectLike({});
|
||||
* // => true
|
||||
*
|
||||
* _.isObjectLike([1, 2, 3]);
|
||||
* // => true
|
||||
*
|
||||
* _.isObjectLike(_.noop);
|
||||
* // => false
|
||||
*
|
||||
* _.isObjectLike(null);
|
||||
* // => false
|
||||
*/
|
||||
function isObjectLike(value) {
|
||||
return !!value && typeof value == 'object';
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is classified as a `RegExp` object.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 0.1.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isRegExp(/abc/);
|
||||
* // => true
|
||||
*
|
||||
* _.isRegExp('/abc/');
|
||||
* // => false
|
||||
*/
|
||||
var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
|
||||
|
||||
/**
|
||||
* Checks if `value` is classified as a `Symbol` primitive or object.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isSymbol(Symbol.iterator);
|
||||
* // => true
|
||||
*
|
||||
* _.isSymbol('abc');
|
||||
* // => false
|
||||
*/
|
||||
function isSymbol(value) {
|
||||
return typeof value == 'symbol' ||
|
||||
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `value` to a finite number.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.12.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to convert.
|
||||
* @returns {number} Returns the converted number.
|
||||
* @example
|
||||
*
|
||||
* _.toFinite(3.2);
|
||||
* // => 3.2
|
||||
*
|
||||
* _.toFinite(Number.MIN_VALUE);
|
||||
* // => 5e-324
|
||||
*
|
||||
* _.toFinite(Infinity);
|
||||
* // => 1.7976931348623157e+308
|
||||
*
|
||||
* _.toFinite('3.2');
|
||||
* // => 3.2
|
||||
*/
|
||||
function toFinite(value) {
|
||||
if (!value) {
|
||||
return value === 0 ? value : 0;
|
||||
}
|
||||
value = toNumber(value);
|
||||
if (value === INFINITY || value === -INFINITY) {
|
||||
var sign = (value < 0 ? -1 : 1);
|
||||
return sign * MAX_INTEGER;
|
||||
}
|
||||
return value === value ? value : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `value` to an integer.
|
||||
*
|
||||
* **Note:** This method is loosely based on
|
||||
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to convert.
|
||||
* @returns {number} Returns the converted integer.
|
||||
* @example
|
||||
*
|
||||
* _.toInteger(3.2);
|
||||
* // => 3
|
||||
*
|
||||
* _.toInteger(Number.MIN_VALUE);
|
||||
* // => 0
|
||||
*
|
||||
* _.toInteger(Infinity);
|
||||
* // => 1.7976931348623157e+308
|
||||
*
|
||||
* _.toInteger('3.2');
|
||||
* // => 3
|
||||
*/
|
||||
function toInteger(value) {
|
||||
var result = toFinite(value),
|
||||
remainder = result % 1;
|
||||
|
||||
return result === result ? (remainder ? result - remainder : result) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `value` to a number.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to process.
|
||||
* @returns {number} Returns the number.
|
||||
* @example
|
||||
*
|
||||
* _.toNumber(3.2);
|
||||
* // => 3.2
|
||||
*
|
||||
* _.toNumber(Number.MIN_VALUE);
|
||||
* // => 5e-324
|
||||
*
|
||||
* _.toNumber(Infinity);
|
||||
* // => Infinity
|
||||
*
|
||||
* _.toNumber('3.2');
|
||||
* // => 3.2
|
||||
*/
|
||||
function toNumber(value) {
|
||||
if (typeof value == 'number') {
|
||||
return value;
|
||||
}
|
||||
if (isSymbol(value)) {
|
||||
return NAN;
|
||||
}
|
||||
if (isObject(value)) {
|
||||
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
||||
value = isObject(other) ? (other + '') : other;
|
||||
}
|
||||
if (typeof value != 'string') {
|
||||
return value === 0 ? value : +value;
|
||||
}
|
||||
value = value.replace(reTrim, '');
|
||||
var isBinary = reIsBinary.test(value);
|
||||
return (isBinary || reIsOctal.test(value))
|
||||
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
||||
: (reIsBadHex.test(value) ? NAN : +value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `value` to a string. An empty string is returned for `null`
|
||||
* and `undefined` values. The sign of `-0` is preserved.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to process.
|
||||
* @returns {string} Returns the string.
|
||||
* @example
|
||||
*
|
||||
* _.toString(null);
|
||||
* // => ''
|
||||
*
|
||||
* _.toString(-0);
|
||||
* // => '-0'
|
||||
*
|
||||
* _.toString([1, 2, 3]);
|
||||
* // => '1,2,3'
|
||||
*/
|
||||
function toString(value) {
|
||||
return value == null ? '' : baseToString(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Truncates `string` if it's longer than the given maximum string length.
|
||||
* The last characters of the truncated string are replaced with the omission
|
||||
* string which defaults to "...".
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to truncate.
|
||||
* @param {Object} [options={}] The options object.
|
||||
* @param {number} [options.length=30] The maximum string length.
|
||||
* @param {string} [options.omission='...'] The string to indicate text is omitted.
|
||||
* @param {RegExp|string} [options.separator] The separator pattern to truncate to.
|
||||
* @returns {string} Returns the truncated string.
|
||||
* @example
|
||||
*
|
||||
* _.truncate('hi-diddly-ho there, neighborino');
|
||||
* // => 'hi-diddly-ho there, neighbo...'
|
||||
*
|
||||
* _.truncate('hi-diddly-ho there, neighborino', {
|
||||
* 'length': 24,
|
||||
* 'separator': ' '
|
||||
* });
|
||||
* // => 'hi-diddly-ho there,...'
|
||||
*
|
||||
* _.truncate('hi-diddly-ho there, neighborino', {
|
||||
* 'length': 24,
|
||||
* 'separator': /,? +/
|
||||
* });
|
||||
* // => 'hi-diddly-ho there...'
|
||||
*
|
||||
* _.truncate('hi-diddly-ho there, neighborino', {
|
||||
* 'omission': ' [...]'
|
||||
* });
|
||||
* // => 'hi-diddly-ho there, neig [...]'
|
||||
*/
|
||||
function truncate(string, options) {
|
||||
var length = DEFAULT_TRUNC_LENGTH,
|
||||
omission = DEFAULT_TRUNC_OMISSION;
|
||||
|
||||
if (isObject(options)) {
|
||||
var separator = 'separator' in options ? options.separator : separator;
|
||||
length = 'length' in options ? toInteger(options.length) : length;
|
||||
omission = 'omission' in options ? baseToString(options.omission) : omission;
|
||||
}
|
||||
string = toString(string);
|
||||
|
||||
var strLength = string.length;
|
||||
if (hasUnicode(string)) {
|
||||
var strSymbols = stringToArray(string);
|
||||
strLength = strSymbols.length;
|
||||
}
|
||||
if (length >= strLength) {
|
||||
return string;
|
||||
}
|
||||
var end = length - stringSize(omission);
|
||||
if (end < 1) {
|
||||
return omission;
|
||||
}
|
||||
var result = strSymbols
|
||||
? castSlice(strSymbols, 0, end).join('')
|
||||
: string.slice(0, end);
|
||||
|
||||
if (separator === undefined) {
|
||||
return result + omission;
|
||||
}
|
||||
if (strSymbols) {
|
||||
end += (result.length - end);
|
||||
}
|
||||
if (isRegExp(separator)) {
|
||||
if (string.slice(end).search(separator)) {
|
||||
var match,
|
||||
substring = result;
|
||||
|
||||
if (!separator.global) {
|
||||
separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
|
||||
}
|
||||
separator.lastIndex = 0;
|
||||
while ((match = separator.exec(substring))) {
|
||||
var newEnd = match.index;
|
||||
}
|
||||
result = result.slice(0, newEnd === undefined ? end : newEnd);
|
||||
}
|
||||
} else if (string.indexOf(baseToString(separator), end) != end) {
|
||||
var index = result.lastIndexOf(separator);
|
||||
if (index > -1) {
|
||||
result = result.slice(0, index);
|
||||
}
|
||||
}
|
||||
return result + omission;
|
||||
}
|
||||
|
||||
module.exports = truncate;
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={C:{"143":1.7563,"144":1.7563,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 145 146 147 3.5 3.6"},D:{"95":0.07983,"109":0.36159,"125":0.95798,"131":0.39916,"138":0.15966,"139":0.31933,"140":14.49655,"141":15.01311,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 126 127 128 129 130 132 133 134 135 136 137 142 143 144 145"},F:{"122":0.92042,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"114":0.15966,"140":0.36159,"141":4.83218,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 142"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.4 15.5 15.6 16.0 16.1 16.2 16.3 16.4 16.5 16.6 17.0 17.1 17.2 17.3 17.4 17.5 17.6 18.0 18.1 18.2 18.3 18.4 18.5-18.6 26.1 26.2","26.0":0.2395},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00087,"5.0-5.1":0,"6.0-6.1":0.0035,"7.0-7.1":0.00262,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00787,"10.0-10.2":0.00087,"10.3":0.01486,"11.0-11.2":0.22027,"11.3-11.4":0.00524,"12.0-12.1":0.00175,"12.2-12.5":0.04283,"13.0-13.1":0,"13.2":0.00437,"13.3":0.00175,"13.4-13.7":0.00699,"14.0-14.4":0.01486,"14.5-14.8":0.01573,"15.0-15.1":0.01486,"15.2-15.3":0.01136,"15.4":0.01311,"15.5":0.01486,"15.6-15.8":0.19405,"16.0":0.02622,"16.1":0.04895,"16.2":0.02535,"16.3":0.04545,"16.4":0.01136,"16.5":0.0201,"16.6-16.7":0.25961,"17.0":0.01836,"17.1":0.02797,"17.2":0.0201,"17.3":0.02972,"17.4":0.05245,"17.5":0.09003,"17.6-17.7":0.22727,"18.0":0.05157,"18.1":0.10664,"18.2":0.05769,"18.3":0.18531,"18.4":0.09528,"18.5-18.6":4.85824,"26.0":0.60051,"26.1":0.02185},P:{"28":3.27787,_:"4 20 21 22 23 24 25 26 27 29 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.16442},Q:{_:"14.9"},O:{"0":1.25174},H:{"0":0},L:{"0":43.66862}};
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
import { promise as queueAsPromised } from './queue.js'
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
const queue = queueAsPromised(worker, 1)
|
||||
|
||||
console.log('the result is', await queue.push(42))
|
||||
|
||||
async function worker (arg) {
|
||||
return 42 * 2
|
||||
}
|
||||
|
|
@ -1,141 +0,0 @@
|
|||
import type { $ZodStringFormats } from "../core/checks.js";
|
||||
import type * as errors from "../core/errors.js";
|
||||
import * as util from "../core/util.js";
|
||||
|
||||
const error: () => errors.$ZodErrorMap = () => {
|
||||
const Sizable: Record<string, { unit: string; verb: string }> = {
|
||||
string: { unit: "caracteres", verb: "tener" },
|
||||
file: { unit: "bytes", verb: "tener" },
|
||||
array: { unit: "elementos", verb: "tener" },
|
||||
set: { unit: "elementos", verb: "tener" },
|
||||
};
|
||||
|
||||
function getSizing(origin: string): { unit: string; verb: string } | null {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
|
||||
const FormatDictionary: {
|
||||
[k in $ZodStringFormats | (string & {})]?: string;
|
||||
} = {
|
||||
regex: "entrada",
|
||||
email: "dirección de correo electrónico",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "fecha y hora ISO",
|
||||
date: "fecha ISO",
|
||||
time: "hora ISO",
|
||||
duration: "duración ISO",
|
||||
ipv4: "dirección IPv4",
|
||||
ipv6: "dirección IPv6",
|
||||
cidrv4: "rango IPv4",
|
||||
cidrv6: "rango IPv6",
|
||||
base64: "cadena codificada en base64",
|
||||
base64url: "URL codificada en base64",
|
||||
json_string: "cadena JSON",
|
||||
e164: "número E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "entrada",
|
||||
};
|
||||
|
||||
const TypeDictionary: {
|
||||
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
|
||||
} = {
|
||||
nan: "NaN",
|
||||
string: "texto",
|
||||
number: "número",
|
||||
boolean: "booleano",
|
||||
array: "arreglo",
|
||||
object: "objeto",
|
||||
set: "conjunto",
|
||||
file: "archivo",
|
||||
date: "fecha",
|
||||
bigint: "número grande",
|
||||
symbol: "símbolo",
|
||||
undefined: "indefinido",
|
||||
null: "nulo",
|
||||
function: "función",
|
||||
map: "mapa",
|
||||
record: "registro",
|
||||
tuple: "tupla",
|
||||
enum: "enumeración",
|
||||
union: "unión",
|
||||
literal: "literal",
|
||||
promise: "promesa",
|
||||
void: "vacío",
|
||||
never: "nunca",
|
||||
unknown: "desconocido",
|
||||
any: "cualquiera",
|
||||
};
|
||||
|
||||
return (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type": {
|
||||
const expected = TypeDictionary[issue.expected] ?? issue.expected;
|
||||
const receivedType = util.parsedType(issue.input);
|
||||
const received = TypeDictionary[receivedType] ?? receivedType;
|
||||
if (/^[A-Z]/.test(issue.expected)) {
|
||||
return `Entrada inválida: se esperaba instanceof ${issue.expected}, recibido ${received}`;
|
||||
}
|
||||
return `Entrada inválida: se esperaba ${expected}, recibido ${received}`;
|
||||
}
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Entrada inválida: se esperaba ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Opción inválida: se esperaba una de ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
const origin = TypeDictionary[issue.origin] ?? issue.origin;
|
||||
if (sizing)
|
||||
return `Demasiado grande: se esperaba que ${origin ?? "valor"} tuviera ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementos"}`;
|
||||
return `Demasiado grande: se esperaba que ${origin ?? "valor"} fuera ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
const origin = TypeDictionary[issue.origin] ?? issue.origin;
|
||||
if (sizing) {
|
||||
return `Demasiado pequeño: se esperaba que ${origin} tuviera ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
|
||||
return `Demasiado pequeño: se esperaba que ${origin} fuera ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue as errors.$ZodStringFormatIssues;
|
||||
if (_issue.format === "starts_with") return `Cadena inválida: debe comenzar con "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with") return `Cadena inválida: debe terminar en "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes") return `Cadena inválida: debe incluir "${_issue.includes}"`;
|
||||
if (_issue.format === "regex") return `Cadena inválida: debe coincidir con el patrón ${_issue.pattern}`;
|
||||
return `Inválido ${FormatDictionary[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Número inválido: debe ser múltiplo de ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Llave${issue.keys.length > 1 ? "s" : ""} desconocida${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Llave inválida en ${TypeDictionary[issue.origin] ?? issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Entrada inválida";
|
||||
case "invalid_element":
|
||||
return `Valor inválido en ${TypeDictionary[issue.origin] ?? issue.origin}`;
|
||||
default:
|
||||
return `Entrada inválida`;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export default function (): { localeError: errors.$ZodErrorMap } {
|
||||
return {
|
||||
localeError: error(),
|
||||
};
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
var OverloadYield = require("./OverloadYield.js");
|
||||
var regeneratorDefine = require("./regeneratorDefine.js");
|
||||
function AsyncIterator(t, e) {
|
||||
function n(r, o, i, f) {
|
||||
try {
|
||||
var c = t[r](o),
|
||||
u = c.value;
|
||||
return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {
|
||||
n("next", t, i, f);
|
||||
}, function (t) {
|
||||
n("throw", t, i, f);
|
||||
}) : e.resolve(u).then(function (t) {
|
||||
c.value = t, i(c);
|
||||
}, function (t) {
|
||||
return n("throw", t, i, f);
|
||||
});
|
||||
} catch (t) {
|
||||
f(t);
|
||||
}
|
||||
}
|
||||
var r;
|
||||
this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
|
||||
return this;
|
||||
})), regeneratorDefine(this, "_invoke", function (t, o, i) {
|
||||
function f() {
|
||||
return new e(function (e, r) {
|
||||
n(t, i, e, r);
|
||||
});
|
||||
}
|
||||
return r = r ? r.then(f, f) : f();
|
||||
}, !0);
|
||||
}
|
||||
module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,56 +0,0 @@
|
|||
import {
|
||||
aNPlusBNotationPseudoClasses,
|
||||
aNPlusBOfSNotationPseudoClasses,
|
||||
linguisticPseudoClasses,
|
||||
shadowTreePseudoElements,
|
||||
} from '../reference/selectors.mjs';
|
||||
|
||||
/**
|
||||
* Check whether a type selector is standard
|
||||
*
|
||||
* @param {import('postcss-selector-parser').Tag} node postcss-selector-parser node (of type tag)
|
||||
* @returns {boolean} If `true`, the type selector is standard
|
||||
*/
|
||||
export default function isStandardSyntaxTypeSelector(node) {
|
||||
// postcss-selector-parser includes the arguments to nth-child() functions
|
||||
// as "tags", so we need to ignore them ourselves.
|
||||
// The fake-tag's "parent" is actually a selector node, whose parent
|
||||
// should be the :nth-child pseudo node.
|
||||
if (!node.parent || !node.parent.parent) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const _node$parent$parent = node.parent.parent;
|
||||
const parentType = _node$parent$parent.type;
|
||||
const parentValue = _node$parent$parent.value;
|
||||
|
||||
if (parentValue) {
|
||||
const normalisedParentName = parentValue.toLowerCase().replace(/:+/, '');
|
||||
|
||||
if (
|
||||
parentType === 'pseudo' &&
|
||||
(aNPlusBNotationPseudoClasses.has(normalisedParentName) ||
|
||||
aNPlusBOfSNotationPseudoClasses.has(normalisedParentName) ||
|
||||
linguisticPseudoClasses.has(normalisedParentName) ||
|
||||
shadowTreePseudoElements.has(normalisedParentName))
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// &-bar is a nesting selector combined with a suffix
|
||||
if (node.prev()?.type === 'nesting') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (node.value.startsWith('%')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reference combinators like `/deep/`
|
||||
if (node.value.startsWith('/') && node.value.endsWith('/')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
// legacy IE function
|
||||
// expression( <any-value> )
|
||||
function expressionFn() {
|
||||
return this.createSingleNodeList(
|
||||
this.Raw(null, false)
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = expressionFn;
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
const types = require('../../tokenizer/types.cjs');
|
||||
|
||||
const name = 'SupportsDeclaration';
|
||||
const structure = {
|
||||
feature: String,
|
||||
value: 'Declaration'
|
||||
};
|
||||
|
||||
function parse() {
|
||||
const start = this.tokenStart;
|
||||
let featureName = 'declaration';
|
||||
let valueParser = this.Declaration;
|
||||
|
||||
if (this.tokenType === types.Function) {
|
||||
featureName = this.consumeFunctionName();
|
||||
valueParser = this.supportsFeature[featureName.toLowerCase()];
|
||||
if (!valueParser) {
|
||||
this.error(`Unknown supports feature ${featureName.toLowerCase()}()`);
|
||||
}
|
||||
} else {
|
||||
this.eat(types.LeftParenthesis);
|
||||
}
|
||||
|
||||
this.skipSC();
|
||||
|
||||
const value = this.parseWithFallback(
|
||||
() => {
|
||||
const startValueToken = this.tokenIndex;
|
||||
const value = valueParser.call(this);
|
||||
|
||||
if (this.eof === false &&
|
||||
this.isBalanceEdge(startValueToken) === false) {
|
||||
this.error();
|
||||
}
|
||||
|
||||
return value;
|
||||
},
|
||||
(startToken) => this.Raw(startToken, null, false)
|
||||
);
|
||||
|
||||
if (!this.eof) {
|
||||
this.eat(types.RightParenthesis);
|
||||
}
|
||||
|
||||
return {
|
||||
type: 'SupportsDeclaration',
|
||||
loc: this.getLocation(start, this.tokenStart),
|
||||
feature: featureName,
|
||||
value
|
||||
};
|
||||
}
|
||||
|
||||
function generate(node) {
|
||||
if (node.feature !== 'declaration') {
|
||||
this.token(types.Function, node.feature + '(');
|
||||
} else {
|
||||
this.token(types.LeftParenthesis, '(');
|
||||
}
|
||||
|
||||
this.node(node.value);
|
||||
this.token(types.RightParenthesis, ')');
|
||||
}
|
||||
|
||||
exports.generate = generate;
|
||||
exports.name = name;
|
||||
exports.parse = parse;
|
||||
exports.structure = structure;
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={A:{A:{"2":"K D E F A B xC"},B:{"2":"C L M G N O P","1028":"0 1 2 3 4 5 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"2":"0 1 2 3 4 5 6 7 8 9 yC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC zC 0C 1C 2C"},D:{"2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B","1028":"0 1 2 3 4 5 VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC"},E:{"2":"J ZB K D E F A B C L M G 3C aC 4C 5C 6C 7C bC NC OC 8C 9C AD cC dC PC BD QC eC fC gC hC iC CD RC jC kC lC mC nC DD SC oC pC qC rC sC tC uC ED FD"},F:{"2":"6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB GD HD ID JD NC vC KD OC","1028":"0 1 2 3 4 5 tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{"2":"E aC LD wC MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD cC dC PC fD QC eC fC gC hC iC gD RC jC kC lC mC nC hD SC oC pC qC rC sC tC uC"},H:{"2":"iD"},I:{"1":"I","2":"jD nD oD","132":"TC J kD lD mD wC"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC vC OC"},L:{"1":"I"},M:{"2":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB sD tD bC uD vD wD xD yD QC RC SC zD","132":"J","516":"pD qD rD"},Q:{"1":"0D"},R:{"1":"1D"},S:{"2":"3D","260":"2D"}},B:7,C:"Network Information API",D:true};
|
||||
|
|
@ -1,235 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = applyDecs2305;
|
||||
var _checkInRHS = require("./checkInRHS.js");
|
||||
var _setFunctionName = require("./setFunctionName.js");
|
||||
var _toPropertyKey = require("./toPropertyKey.js");
|
||||
function applyDecs2305(targetClass, memberDecs, classDecs, classDecsHaveThis, instanceBrand, parentClass) {
|
||||
function _bindPropCall(obj, name, before) {
|
||||
return function (_this, value) {
|
||||
if (before) {
|
||||
before(_this);
|
||||
}
|
||||
return obj[name].call(_this, value);
|
||||
};
|
||||
}
|
||||
function runInitializers(initializers, value) {
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
initializers[i].call(value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertCallable(fn, hint1, hint2, throwUndefined) {
|
||||
if (typeof fn !== "function") {
|
||||
if (throwUndefined || fn !== void 0) {
|
||||
throw new TypeError(hint1 + " must " + (hint2 || "be") + " a function" + (throwUndefined ? "" : " or undefined"));
|
||||
}
|
||||
}
|
||||
return fn;
|
||||
}
|
||||
function applyDec(Class, decInfo, decoratorsHaveThis, name, kind, metadata, initializers, ret, isStatic, isPrivate, isField, isAccessor, hasPrivateBrand) {
|
||||
function assertInstanceIfPrivate(target) {
|
||||
if (!hasPrivateBrand(target)) {
|
||||
throw new TypeError("Attempted to access private element on non-instance");
|
||||
}
|
||||
}
|
||||
var decs = decInfo[0],
|
||||
decVal = decInfo[3],
|
||||
_,
|
||||
isClass = !ret;
|
||||
if (!isClass) {
|
||||
if (!decoratorsHaveThis && !Array.isArray(decs)) {
|
||||
decs = [decs];
|
||||
}
|
||||
var desc = {},
|
||||
init = [],
|
||||
key = kind === 3 ? "get" : kind === 4 || isAccessor ? "set" : "value";
|
||||
if (isPrivate) {
|
||||
if (isField || isAccessor) {
|
||||
desc = {
|
||||
get: (0, _setFunctionName.default)(function () {
|
||||
return decVal(this);
|
||||
}, name, "get"),
|
||||
set: function (value) {
|
||||
decInfo[4](this, value);
|
||||
}
|
||||
};
|
||||
} else {
|
||||
desc[key] = decVal;
|
||||
}
|
||||
if (!isField) {
|
||||
(0, _setFunctionName.default)(desc[key], name, kind === 2 ? "" : key);
|
||||
}
|
||||
} else if (!isField) {
|
||||
desc = Object.getOwnPropertyDescriptor(Class, name);
|
||||
}
|
||||
}
|
||||
var newValue = Class;
|
||||
for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) {
|
||||
var dec = decs[i],
|
||||
decThis = decoratorsHaveThis ? decs[i - 1] : void 0;
|
||||
var decoratorFinishedRef = {};
|
||||
var ctx = {
|
||||
kind: ["field", "accessor", "method", "getter", "setter", "class"][kind],
|
||||
name: name,
|
||||
metadata: metadata,
|
||||
addInitializer: function (decoratorFinishedRef, initializer) {
|
||||
if (decoratorFinishedRef.v) {
|
||||
throw new Error("attempted to call addInitializer after decoration was finished");
|
||||
}
|
||||
assertCallable(initializer, "An initializer", "be", true);
|
||||
initializers.push(initializer);
|
||||
}.bind(null, decoratorFinishedRef)
|
||||
};
|
||||
try {
|
||||
if (isClass) {
|
||||
if (_ = assertCallable(dec.call(decThis, newValue, ctx), "class decorators", "return")) {
|
||||
newValue = _;
|
||||
}
|
||||
} else {
|
||||
ctx["static"] = isStatic;
|
||||
ctx["private"] = isPrivate;
|
||||
var get, set;
|
||||
if (!isPrivate) {
|
||||
get = function (target) {
|
||||
return target[name];
|
||||
};
|
||||
if (kind < 2 || kind === 4) {
|
||||
set = function (target, v) {
|
||||
target[name] = v;
|
||||
};
|
||||
}
|
||||
} else if (kind === 2) {
|
||||
get = function (_this) {
|
||||
assertInstanceIfPrivate(_this);
|
||||
return desc.value;
|
||||
};
|
||||
} else {
|
||||
if (kind < 4) {
|
||||
get = _bindPropCall(desc, "get", assertInstanceIfPrivate);
|
||||
}
|
||||
if (kind !== 3) {
|
||||
set = _bindPropCall(desc, "set", assertInstanceIfPrivate);
|
||||
}
|
||||
}
|
||||
var access = ctx.access = {
|
||||
has: isPrivate ? hasPrivateBrand.bind() : function (target) {
|
||||
return name in target;
|
||||
}
|
||||
};
|
||||
if (get) access.get = get;
|
||||
if (set) access.set = set;
|
||||
newValue = dec.call(decThis, isAccessor ? {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
} : desc[key], ctx);
|
||||
if (isAccessor) {
|
||||
if (typeof newValue === "object" && newValue) {
|
||||
if (_ = assertCallable(newValue.get, "accessor.get")) {
|
||||
desc.get = _;
|
||||
}
|
||||
if (_ = assertCallable(newValue.set, "accessor.set")) {
|
||||
desc.set = _;
|
||||
}
|
||||
if (_ = assertCallable(newValue.init, "accessor.init")) {
|
||||
init.push(_);
|
||||
}
|
||||
} else if (newValue !== void 0) {
|
||||
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
||||
}
|
||||
} else if (assertCallable(newValue, (isField ? "field" : "method") + " decorators", "return")) {
|
||||
if (isField) {
|
||||
init.push(newValue);
|
||||
} else {
|
||||
desc[key] = newValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
decoratorFinishedRef.v = true;
|
||||
}
|
||||
}
|
||||
if (isField || isAccessor) {
|
||||
ret.push(function (instance, value) {
|
||||
for (var i = init.length - 1; i >= 0; i--) {
|
||||
value = init[i].call(instance, value);
|
||||
}
|
||||
return value;
|
||||
});
|
||||
}
|
||||
if (!isField && !isClass) {
|
||||
if (isPrivate) {
|
||||
if (isAccessor) {
|
||||
ret.push(_bindPropCall(desc, "get"), _bindPropCall(desc, "set"));
|
||||
} else {
|
||||
ret.push(kind === 2 ? desc[key] : _bindPropCall.call.bind(desc[key]));
|
||||
}
|
||||
} else {
|
||||
Object.defineProperty(Class, name, desc);
|
||||
}
|
||||
}
|
||||
return newValue;
|
||||
}
|
||||
function applyMemberDecs(Class, decInfos, instanceBrand, metadata) {
|
||||
var ret = [];
|
||||
var protoInitializers;
|
||||
var staticInitializers;
|
||||
var staticBrand = function (_) {
|
||||
return (0, _checkInRHS.default)(_) === Class;
|
||||
};
|
||||
var existingNonFields = new Map();
|
||||
function pushInitializers(initializers) {
|
||||
if (initializers) {
|
||||
ret.push(runInitializers.bind(null, initializers));
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < decInfos.length; i++) {
|
||||
var decInfo = decInfos[i];
|
||||
if (!Array.isArray(decInfo)) continue;
|
||||
var kind = decInfo[1];
|
||||
var name = decInfo[2];
|
||||
var isPrivate = decInfo.length > 3;
|
||||
var decoratorsHaveThis = kind & 16;
|
||||
var isStatic = !!(kind & 8);
|
||||
kind &= 7;
|
||||
var isField = kind === 0;
|
||||
var key = name + "/" + isStatic;
|
||||
if (!isField && !isPrivate) {
|
||||
var existingKind = existingNonFields.get(key);
|
||||
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
|
||||
throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
||||
}
|
||||
existingNonFields.set(key, kind > 2 ? kind : true);
|
||||
}
|
||||
applyDec(isStatic ? Class : Class.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : (0, _toPropertyKey.default)(name), kind, metadata, isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, isStatic, isPrivate, isField, kind === 1, isStatic && isPrivate ? staticBrand : instanceBrand);
|
||||
}
|
||||
pushInitializers(protoInitializers);
|
||||
pushInitializers(staticInitializers);
|
||||
return ret;
|
||||
}
|
||||
function defineMetadata(Class, metadata) {
|
||||
return Object.defineProperty(Class, Symbol.metadata || Symbol["for"]("Symbol.metadata"), {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
value: metadata
|
||||
});
|
||||
}
|
||||
if (arguments.length >= 6) {
|
||||
var parentMetadata = parentClass[Symbol.metadata || Symbol["for"]("Symbol.metadata")];
|
||||
}
|
||||
var metadata = Object.create(parentMetadata == null ? null : parentMetadata);
|
||||
var e = applyMemberDecs(targetClass, memberDecs, instanceBrand, metadata);
|
||||
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
||||
return {
|
||||
e: e,
|
||||
get c() {
|
||||
var initializers = [];
|
||||
return classDecs.length && [defineMetadata(applyDec(targetClass, [classDecs], classDecsHaveThis, targetClass.name, 5, metadata, initializers), metadata), runInitializers.bind(null, initializers, targetClass)];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=applyDecs2305.js.map
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
// NOTICE: This file is generated by Rollup. To modify it,
|
||||
// please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
|
||||
'use strict';
|
||||
|
||||
const constants = require('./constants.cjs');
|
||||
const optionsMatches = require('./utils/optionsMatches.cjs');
|
||||
const putIfAbsent = require('./utils/putIfAbsent.cjs');
|
||||
const reportCommentProblem = require('./utils/reportCommentProblem.cjs');
|
||||
const validateDisableSettings = require('./validateDisableSettings.cjs');
|
||||
|
||||
/**
|
||||
* @param {import('stylelint').PostcssResult} postcssResult
|
||||
* @returns {void}
|
||||
*/
|
||||
function needlessDisables(postcssResult) {
|
||||
const [enabled, options] = validateDisableSettings(postcssResult, 'reportNeedlessDisables');
|
||||
|
||||
if (!options) return;
|
||||
|
||||
const {
|
||||
disabledRanges,
|
||||
disabledRanges: { [constants.RULE_NAME_ALL]: disabledRangesAll = [] },
|
||||
disabledWarnings = [],
|
||||
} = postcssResult.stylelint;
|
||||
|
||||
// A map from `stylelint-disable` comments to the set of rules that
|
||||
// are usefully disabled by each comment. We track this
|
||||
// comment-by-comment rather than range-by-range because ranges that
|
||||
// disable *all* rules are duplicated for each rule they apply to in
|
||||
// practice.
|
||||
/** @type {Map<import('postcss').Node, Set<string>>}} */
|
||||
const usefulDisables = new Map();
|
||||
|
||||
for (const warning of disabledWarnings) {
|
||||
const rule = warning.rule;
|
||||
const ruleRanges = disabledRanges[rule];
|
||||
|
||||
if (ruleRanges) {
|
||||
for (const range of ruleRanges) {
|
||||
if (isWarningInRange(warning, range)) {
|
||||
putIfAbsent(usefulDisables, range.node, () => new Set()).add(rule);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const range of disabledRangesAll) {
|
||||
if (isWarningInRange(warning, range)) {
|
||||
putIfAbsent(usefulDisables, range.node, () => new Set()).add(rule);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const allRangeNodes = new Set(disabledRangesAll.map((range) => range.node));
|
||||
|
||||
for (const [rule, ranges] of Object.entries(disabledRanges)) {
|
||||
for (const range of ranges) {
|
||||
const node = range.node;
|
||||
|
||||
if (rule !== constants.RULE_NAME_ALL && allRangeNodes.has(node)) continue;
|
||||
|
||||
if (enabled === optionsMatches(options, 'except', rule)) continue;
|
||||
|
||||
const useful = usefulDisables.get(node) || new Set();
|
||||
|
||||
// Only emit a warning if this range's comment isn't useful for this rule.
|
||||
// For the special rule "all", only emit a warning if it's not useful for
|
||||
// *any* rules, because it covers all of them.
|
||||
if (rule === constants.RULE_NAME_ALL ? useful.size !== 0 : useful.has(rule)) continue;
|
||||
|
||||
reportCommentProblem({
|
||||
rule: '--report-needless-disables',
|
||||
message: `Needless disable for "${rule}"`,
|
||||
severity: options.severity,
|
||||
node,
|
||||
postcssResult,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import('stylelint').DisabledWarning} warning
|
||||
* @param {import('stylelint').DisabledRange} range
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isWarningInRange(warning, range) {
|
||||
const line = warning.line;
|
||||
|
||||
// Need to check if range.end exist, because line number type cannot be compared to undefined
|
||||
return (
|
||||
range.start <= line &&
|
||||
((range.end !== undefined && range.end >= line) || range.end === undefined)
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = needlessDisables;
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
{
|
||||
"name": "@nodelib/fs.stat",
|
||||
"version": "2.0.5",
|
||||
"description": "Get the status of a file with some features",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat",
|
||||
"keywords": [
|
||||
"NodeLib",
|
||||
"fs",
|
||||
"FileSystem",
|
||||
"file system",
|
||||
"stat"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
},
|
||||
"files": [
|
||||
"out/**",
|
||||
"!out/**/*.map",
|
||||
"!out/**/*.spec.*"
|
||||
],
|
||||
"main": "out/index.js",
|
||||
"typings": "out/index.d.ts",
|
||||
"scripts": {
|
||||
"clean": "rimraf {tsconfig.tsbuildinfo,out}",
|
||||
"lint": "eslint \"src/**/*.ts\" --cache",
|
||||
"compile": "tsc -b .",
|
||||
"compile:watch": "tsc -p . --watch --sourceMap",
|
||||
"test": "mocha \"out/**/*.spec.js\" -s 0",
|
||||
"build": "npm run clean && npm run compile && npm run lint && npm test",
|
||||
"watch": "npm run clean && npm run compile:watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nodelib/fs.macchiato": "1.0.4"
|
||||
},
|
||||
"gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562"
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
// NOTICE: This file is generated by Rollup. To modify it,
|
||||
// please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
|
||||
'use strict';
|
||||
|
||||
const typeGuards = require('./typeGuards.cjs');
|
||||
|
||||
/**
|
||||
* @param {import('postcss').Container} statement
|
||||
* @param {{ noRawBefore: boolean }} options
|
||||
* @returns {string}
|
||||
*/
|
||||
function beforeBlockString(statement, { noRawBefore } = { noRawBefore: false }) {
|
||||
let result = '';
|
||||
|
||||
const before = statement.raws.before || '';
|
||||
|
||||
if (!noRawBefore) {
|
||||
result += before;
|
||||
}
|
||||
|
||||
if (typeGuards.isRule(statement)) {
|
||||
result += statement.selector;
|
||||
} else if (typeGuards.isAtRule(statement)) {
|
||||
result += `@${statement.name}${statement.raws.afterName || ''}${statement.params}`;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
||||
result += statement.raws.between || '';
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = beforeBlockString;
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
module.exports.isClean = Symbol('isClean')
|
||||
|
||||
module.exports.my = Symbol('my')
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
module.exports = {
|
||||
y: 1 << 0,
|
||||
n: 1 << 1,
|
||||
a: 1 << 2,
|
||||
p: 1 << 3,
|
||||
u: 1 << 4,
|
||||
x: 1 << 5,
|
||||
d: 1 << 6
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
var defer = require('./defer.js');
|
||||
|
||||
// API
|
||||
module.exports = async;
|
||||
|
||||
/**
|
||||
* Runs provided callback asynchronously
|
||||
* even if callback itself is not
|
||||
*
|
||||
* @param {function} callback - callback to invoke
|
||||
* @returns {function} - augmented callback
|
||||
*/
|
||||
function async(callback)
|
||||
{
|
||||
var isAsync = false;
|
||||
|
||||
// check if async happened
|
||||
defer(function() { isAsync = true; });
|
||||
|
||||
return function async_callback(err, result)
|
||||
{
|
||||
if (isAsync)
|
||||
{
|
||||
callback(err, result);
|
||||
}
|
||||
else
|
||||
{
|
||||
defer(function nextTick_callback()
|
||||
{
|
||||
callback(err, result);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -1,135 +0,0 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.cjs"));
|
||||
const error = () => {
|
||||
const Sizable = {
|
||||
string: { unit: "karakter", verb: "legyen" },
|
||||
file: { unit: "byte", verb: "legyen" },
|
||||
array: { unit: "elem", verb: "legyen" },
|
||||
set: { unit: "elem", verb: "legyen" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const FormatDictionary = {
|
||||
regex: "bemenet",
|
||||
email: "email cím",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO időbélyeg",
|
||||
date: "ISO dátum",
|
||||
time: "ISO idő",
|
||||
duration: "ISO időintervallum",
|
||||
ipv4: "IPv4 cím",
|
||||
ipv6: "IPv6 cím",
|
||||
cidrv4: "IPv4 tartomány",
|
||||
cidrv6: "IPv6 tartomány",
|
||||
base64: "base64-kódolt string",
|
||||
base64url: "base64url-kódolt string",
|
||||
json_string: "JSON string",
|
||||
e164: "E.164 szám",
|
||||
jwt: "JWT",
|
||||
template_literal: "bemenet",
|
||||
};
|
||||
const TypeDictionary = {
|
||||
nan: "NaN",
|
||||
number: "szám",
|
||||
array: "tömb",
|
||||
};
|
||||
return (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type": {
|
||||
const expected = TypeDictionary[issue.expected] ?? issue.expected;
|
||||
const receivedType = util.parsedType(issue.input);
|
||||
const received = TypeDictionary[receivedType] ?? receivedType;
|
||||
if (/^[A-Z]/.test(issue.expected)) {
|
||||
return `Érvénytelen bemenet: a várt érték instanceof ${issue.expected}, a kapott érték ${received}`;
|
||||
}
|
||||
return `Érvénytelen bemenet: a várt érték ${expected}, a kapott érték ${received}`;
|
||||
}
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Érvénytelen bemenet: a várt érték ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Érvénytelen opció: valamelyik érték várt ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Túl nagy: ${issue.origin ?? "érték"} mérete túl nagy ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elem"}`;
|
||||
return `Túl nagy: a bemeneti érték ${issue.origin ?? "érték"} túl nagy: ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Túl kicsi: a bemeneti érték ${issue.origin} mérete túl kicsi ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Túl kicsi: a bemeneti érték ${issue.origin} túl kicsi ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Érvénytelen string: "${_issue.prefix}" értékkel kell kezdődnie`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Érvénytelen string: "${_issue.suffix}" értékkel kell végződnie`;
|
||||
if (_issue.format === "includes")
|
||||
return `Érvénytelen string: "${_issue.includes}" értéket kell tartalmaznia`;
|
||||
if (_issue.format === "regex")
|
||||
return `Érvénytelen string: ${_issue.pattern} mintának kell megfelelnie`;
|
||||
return `Érvénytelen ${FormatDictionary[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Érvénytelen szám: ${issue.divisor} többszörösének kell lennie`;
|
||||
case "unrecognized_keys":
|
||||
return `Ismeretlen kulcs${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Érvénytelen kulcs ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Érvénytelen bemenet";
|
||||
case "invalid_element":
|
||||
return `Érvénytelen érték: ${issue.origin}`;
|
||||
default:
|
||||
return `Érvénytelen bemenet`;
|
||||
}
|
||||
};
|
||||
};
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error(),
|
||||
};
|
||||
}
|
||||
module.exports = exports.default;
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports["default"] = void 0;
|
||||
var _node = _interopRequireDefault(require("./node"));
|
||||
var _types = require("./types");
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
||||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
var Nesting = /*#__PURE__*/function (_Node) {
|
||||
_inheritsLoose(Nesting, _Node);
|
||||
function Nesting(opts) {
|
||||
var _this;
|
||||
_this = _Node.call(this, opts) || this;
|
||||
_this.type = _types.NESTING;
|
||||
_this.value = '&';
|
||||
return _this;
|
||||
}
|
||||
return Nesting;
|
||||
}(_node["default"]);
|
||||
exports["default"] = Nesting;
|
||||
module.exports = exports.default;
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
# combined-stream
|
||||
|
||||
A stream that emits multiple other streams one after another.
|
||||
|
||||
**NB** Currently `combined-stream` works with streams version 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatibility with `combined-stream`.
|
||||
|
||||
- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module.
|
||||
|
||||
- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another.
|
||||
|
||||
## Installation
|
||||
|
||||
``` bash
|
||||
npm install combined-stream
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Here is a simple example that shows how you can use combined-stream to combine
|
||||
two files into one:
|
||||
|
||||
``` javascript
|
||||
var CombinedStream = require('combined-stream');
|
||||
var fs = require('fs');
|
||||
|
||||
var combinedStream = CombinedStream.create();
|
||||
combinedStream.append(fs.createReadStream('file1.txt'));
|
||||
combinedStream.append(fs.createReadStream('file2.txt'));
|
||||
|
||||
combinedStream.pipe(fs.createWriteStream('combined.txt'));
|
||||
```
|
||||
|
||||
While the example above works great, it will pause all source streams until
|
||||
they are needed. If you don't want that to happen, you can set `pauseStreams`
|
||||
to `false`:
|
||||
|
||||
``` javascript
|
||||
var CombinedStream = require('combined-stream');
|
||||
var fs = require('fs');
|
||||
|
||||
var combinedStream = CombinedStream.create({pauseStreams: false});
|
||||
combinedStream.append(fs.createReadStream('file1.txt'));
|
||||
combinedStream.append(fs.createReadStream('file2.txt'));
|
||||
|
||||
combinedStream.pipe(fs.createWriteStream('combined.txt'));
|
||||
```
|
||||
|
||||
However, what if you don't have all the source streams yet, or you don't want
|
||||
to allocate the resources (file descriptors, memory, etc.) for them right away?
|
||||
Well, in that case you can simply provide a callback that supplies the stream
|
||||
by calling a `next()` function:
|
||||
|
||||
``` javascript
|
||||
var CombinedStream = require('combined-stream');
|
||||
var fs = require('fs');
|
||||
|
||||
var combinedStream = CombinedStream.create();
|
||||
combinedStream.append(function(next) {
|
||||
next(fs.createReadStream('file1.txt'));
|
||||
});
|
||||
combinedStream.append(function(next) {
|
||||
next(fs.createReadStream('file2.txt'));
|
||||
});
|
||||
|
||||
combinedStream.pipe(fs.createWriteStream('combined.txt'));
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### CombinedStream.create([options])
|
||||
|
||||
Returns a new combined stream object. Available options are:
|
||||
|
||||
* `maxDataSize`
|
||||
* `pauseStreams`
|
||||
|
||||
The effect of those options is described below.
|
||||
|
||||
### combinedStream.pauseStreams = `true`
|
||||
|
||||
Whether to apply back pressure to the underlaying streams. If set to `false`,
|
||||
the underlaying streams will never be paused. If set to `true`, the
|
||||
underlaying streams will be paused right after being appended, as well as when
|
||||
`delayedStream.pipe()` wants to throttle.
|
||||
|
||||
### combinedStream.maxDataSize = `2 * 1024 * 1024`
|
||||
|
||||
The maximum amount of bytes (or characters) to buffer for all source streams.
|
||||
If this value is exceeded, `combinedStream` emits an `'error'` event.
|
||||
|
||||
### combinedStream.dataSize = `0`
|
||||
|
||||
The amount of bytes (or characters) currently buffered by `combinedStream`.
|
||||
|
||||
### combinedStream.append(stream)
|
||||
|
||||
Appends the given `stream` to the combinedStream object. If `pauseStreams` is
|
||||
set to `true, this stream will also be paused right away.
|
||||
|
||||
`streams` can also be a function that takes one parameter called `next`. `next`
|
||||
is a function that must be invoked in order to provide the `next` stream, see
|
||||
example above.
|
||||
|
||||
Regardless of how the `stream` is appended, combined-stream always attaches an
|
||||
`'error'` listener to it, so you don't have to do that manually.
|
||||
|
||||
Special case: `stream` can also be a String or Buffer.
|
||||
|
||||
### combinedStream.write(data)
|
||||
|
||||
You should not call this, `combinedStream` takes care of piping the appended
|
||||
streams into itself for you.
|
||||
|
||||
### combinedStream.resume()
|
||||
|
||||
Causes `combinedStream` to start drain the streams it manages. The function is
|
||||
idempotent, and also emits a `'resume'` event each time which usually goes to
|
||||
the stream that is currently being drained.
|
||||
|
||||
### combinedStream.pause();
|
||||
|
||||
If `combinedStream.pauseStreams` is set to `false`, this does nothing.
|
||||
Otherwise a `'pause'` event is emitted, this goes to the stream that is
|
||||
currently being drained, so you can use it to apply back pressure.
|
||||
|
||||
### combinedStream.end();
|
||||
|
||||
Sets `combinedStream.writable` to false, emits an `'end'` event, and removes
|
||||
all streams from the queue.
|
||||
|
||||
### combinedStream.destroy();
|
||||
|
||||
Same as `combinedStream.end()`, except it emits a `'close'` event instead of
|
||||
`'end'`.
|
||||
|
||||
## License
|
||||
|
||||
combined-stream is licensed under the MIT license.
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
# has-flag [](https://travis-ci.org/sindresorhus/has-flag)
|
||||
|
||||
> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag
|
||||
|
||||
Correctly stops looking after an `--` argument terminator.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-has-flag?utm_source=npm-has-flag&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install has-flag
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// foo.js
|
||||
const hasFlag = require('has-flag');
|
||||
|
||||
hasFlag('unicorn');
|
||||
//=> true
|
||||
|
||||
hasFlag('--unicorn');
|
||||
//=> true
|
||||
|
||||
hasFlag('f');
|
||||
//=> true
|
||||
|
||||
hasFlag('-f');
|
||||
//=> true
|
||||
|
||||
hasFlag('foo=bar');
|
||||
//=> true
|
||||
|
||||
hasFlag('foo');
|
||||
//=> false
|
||||
|
||||
hasFlag('rainbow');
|
||||
//=> false
|
||||
```
|
||||
|
||||
```
|
||||
$ node foo.js -f --unicorn --foo=bar -- --rainbow
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### hasFlag(flag, [argv])
|
||||
|
||||
Returns a boolean for whether the flag exists.
|
||||
|
||||
#### flag
|
||||
|
||||
Type: `string`
|
||||
|
||||
CLI flag to look for. The `--` prefix is optional.
|
||||
|
||||
#### argv
|
||||
|
||||
Type: `string[]`<br>
|
||||
Default: `process.argv`
|
||||
|
||||
CLI arguments.
|
||||
|
||||
|
||||
## Security
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
|
|
@ -1,975 +0,0 @@
|
|||
/**
|
||||
* react-router v7.10.1
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
"use client";
|
||||
import {
|
||||
RSCRouterGlobalErrorBoundary,
|
||||
deserializeErrors,
|
||||
getHydrationData,
|
||||
populateRSCRouteModules
|
||||
} from "./chunk-PMGK554W.mjs";
|
||||
import {
|
||||
CRITICAL_CSS_DATA_ATTRIBUTE,
|
||||
ErrorResponseImpl,
|
||||
FrameworkContext,
|
||||
RSCRouterContext,
|
||||
RemixErrorBoundary,
|
||||
RouterProvider,
|
||||
createBrowserHistory,
|
||||
createClientRoutes,
|
||||
createClientRoutesWithHMRRevalidationOptOut,
|
||||
createContext,
|
||||
createRequestInit,
|
||||
createRouter,
|
||||
decodeViaTurboStream,
|
||||
getPatchRoutesOnNavigationFunction,
|
||||
getSingleFetchDataStrategyImpl,
|
||||
getTurboStreamSingleFetchDataStrategy,
|
||||
hydrationRouteProperties,
|
||||
invariant,
|
||||
isMutationMethod,
|
||||
mapRouteProperties,
|
||||
noActionDefinedError,
|
||||
setIsHydrated,
|
||||
shouldHydrateRouteLoader,
|
||||
singleFetchUrl,
|
||||
stripIndexParam,
|
||||
useFogOFWarDiscovery
|
||||
} from "./chunk-WWGJGFF6.mjs";
|
||||
|
||||
// lib/dom-export/dom-router-provider.tsx
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
function RouterProvider2(props) {
|
||||
return /* @__PURE__ */ React.createElement(RouterProvider, { flushSync: ReactDOM.flushSync, ...props });
|
||||
}
|
||||
|
||||
// lib/dom-export/hydrated-router.tsx
|
||||
import * as React2 from "react";
|
||||
var ssrInfo = null;
|
||||
var router = null;
|
||||
function initSsrInfo() {
|
||||
if (!ssrInfo && window.__reactRouterContext && window.__reactRouterManifest && window.__reactRouterRouteModules) {
|
||||
if (window.__reactRouterManifest.sri === true) {
|
||||
const importMap = document.querySelector("script[rr-importmap]");
|
||||
if (importMap?.textContent) {
|
||||
try {
|
||||
window.__reactRouterManifest.sri = JSON.parse(
|
||||
importMap.textContent
|
||||
).integrity;
|
||||
} catch (err) {
|
||||
console.error("Failed to parse import map", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
ssrInfo = {
|
||||
context: window.__reactRouterContext,
|
||||
manifest: window.__reactRouterManifest,
|
||||
routeModules: window.__reactRouterRouteModules,
|
||||
stateDecodingPromise: void 0,
|
||||
router: void 0,
|
||||
routerInitialized: false
|
||||
};
|
||||
}
|
||||
}
|
||||
function createHydratedRouter({
|
||||
getContext,
|
||||
unstable_instrumentations
|
||||
}) {
|
||||
initSsrInfo();
|
||||
if (!ssrInfo) {
|
||||
throw new Error(
|
||||
"You must be using the SSR features of React Router in order to skip passing a `router` prop to `<RouterProvider>`"
|
||||
);
|
||||
}
|
||||
let localSsrInfo = ssrInfo;
|
||||
if (!ssrInfo.stateDecodingPromise) {
|
||||
let stream = ssrInfo.context.stream;
|
||||
invariant(stream, "No stream found for single fetch decoding");
|
||||
ssrInfo.context.stream = void 0;
|
||||
ssrInfo.stateDecodingPromise = decodeViaTurboStream(stream, window).then((value) => {
|
||||
ssrInfo.context.state = value.value;
|
||||
localSsrInfo.stateDecodingPromise.value = true;
|
||||
}).catch((e) => {
|
||||
localSsrInfo.stateDecodingPromise.error = e;
|
||||
});
|
||||
}
|
||||
if (ssrInfo.stateDecodingPromise.error) {
|
||||
throw ssrInfo.stateDecodingPromise.error;
|
||||
}
|
||||
if (!ssrInfo.stateDecodingPromise.value) {
|
||||
throw ssrInfo.stateDecodingPromise;
|
||||
}
|
||||
let routes = createClientRoutes(
|
||||
ssrInfo.manifest.routes,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.state,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.isSpaMode
|
||||
);
|
||||
let hydrationData = void 0;
|
||||
if (ssrInfo.context.isSpaMode) {
|
||||
let { loaderData } = ssrInfo.context.state;
|
||||
if (ssrInfo.manifest.routes.root?.hasLoader && loaderData && "root" in loaderData) {
|
||||
hydrationData = {
|
||||
loaderData: {
|
||||
root: loaderData.root
|
||||
}
|
||||
};
|
||||
}
|
||||
} else {
|
||||
hydrationData = getHydrationData({
|
||||
state: ssrInfo.context.state,
|
||||
routes,
|
||||
getRouteInfo: (routeId) => ({
|
||||
clientLoader: ssrInfo.routeModules[routeId]?.clientLoader,
|
||||
hasLoader: ssrInfo.manifest.routes[routeId]?.hasLoader === true,
|
||||
hasHydrateFallback: ssrInfo.routeModules[routeId]?.HydrateFallback != null
|
||||
}),
|
||||
location: window.location,
|
||||
basename: window.__reactRouterContext?.basename,
|
||||
isSpaMode: ssrInfo.context.isSpaMode
|
||||
});
|
||||
if (hydrationData && hydrationData.errors) {
|
||||
hydrationData.errors = deserializeErrors(hydrationData.errors);
|
||||
}
|
||||
}
|
||||
let router2 = createRouter({
|
||||
routes,
|
||||
history: createBrowserHistory(),
|
||||
basename: ssrInfo.context.basename,
|
||||
getContext,
|
||||
hydrationData,
|
||||
hydrationRouteProperties,
|
||||
unstable_instrumentations,
|
||||
mapRouteProperties,
|
||||
future: {
|
||||
middleware: ssrInfo.context.future.v8_middleware
|
||||
},
|
||||
dataStrategy: getTurboStreamSingleFetchDataStrategy(
|
||||
() => router2,
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.basename
|
||||
),
|
||||
patchRoutesOnNavigation: getPatchRoutesOnNavigationFunction(
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.routeDiscovery,
|
||||
ssrInfo.context.isSpaMode,
|
||||
ssrInfo.context.basename
|
||||
)
|
||||
});
|
||||
ssrInfo.router = router2;
|
||||
if (router2.state.initialized) {
|
||||
ssrInfo.routerInitialized = true;
|
||||
router2.initialize();
|
||||
}
|
||||
router2.createRoutesForHMR = /* spacer so ts-ignore does not affect the right hand of the assignment */
|
||||
createClientRoutesWithHMRRevalidationOptOut;
|
||||
window.__reactRouterDataRouter = router2;
|
||||
return router2;
|
||||
}
|
||||
function HydratedRouter(props) {
|
||||
if (!router) {
|
||||
router = createHydratedRouter({
|
||||
getContext: props.getContext,
|
||||
unstable_instrumentations: props.unstable_instrumentations
|
||||
});
|
||||
}
|
||||
let [criticalCss, setCriticalCss] = React2.useState(
|
||||
process.env.NODE_ENV === "development" ? ssrInfo?.context.criticalCss : void 0
|
||||
);
|
||||
React2.useEffect(() => {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
setCriticalCss(void 0);
|
||||
}
|
||||
}, []);
|
||||
React2.useEffect(() => {
|
||||
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
|
||||
document.querySelectorAll(`[${CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
||||
}
|
||||
}, [criticalCss]);
|
||||
let [location2, setLocation] = React2.useState(router.state.location);
|
||||
React2.useLayoutEffect(() => {
|
||||
if (ssrInfo && ssrInfo.router && !ssrInfo.routerInitialized) {
|
||||
ssrInfo.routerInitialized = true;
|
||||
ssrInfo.router.initialize();
|
||||
}
|
||||
}, []);
|
||||
React2.useLayoutEffect(() => {
|
||||
if (ssrInfo && ssrInfo.router) {
|
||||
return ssrInfo.router.subscribe((newState) => {
|
||||
if (newState.location !== location2) {
|
||||
setLocation(newState.location);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, [location2]);
|
||||
invariant(ssrInfo, "ssrInfo unavailable for HydratedRouter");
|
||||
useFogOFWarDiscovery(
|
||||
router,
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.routeDiscovery,
|
||||
ssrInfo.context.isSpaMode
|
||||
);
|
||||
return (
|
||||
// This fragment is important to ensure we match the <ServerRouter> JSX
|
||||
// structure so that useId values hydrate correctly
|
||||
/* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
||||
FrameworkContext.Provider,
|
||||
{
|
||||
value: {
|
||||
manifest: ssrInfo.manifest,
|
||||
routeModules: ssrInfo.routeModules,
|
||||
future: ssrInfo.context.future,
|
||||
criticalCss,
|
||||
ssr: ssrInfo.context.ssr,
|
||||
isSpaMode: ssrInfo.context.isSpaMode,
|
||||
routeDiscovery: ssrInfo.context.routeDiscovery
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ React2.createElement(RemixErrorBoundary, { location: location2 }, /* @__PURE__ */ React2.createElement(
|
||||
RouterProvider2,
|
||||
{
|
||||
router,
|
||||
unstable_useTransitions: props.unstable_useTransitions,
|
||||
unstable_onError: props.unstable_onError
|
||||
}
|
||||
))
|
||||
), /* @__PURE__ */ React2.createElement(React2.Fragment, null))
|
||||
);
|
||||
}
|
||||
|
||||
// lib/rsc/browser.tsx
|
||||
import * as React3 from "react";
|
||||
import * as ReactDOM2 from "react-dom";
|
||||
function createCallServer({
|
||||
createFromReadableStream,
|
||||
createTemporaryReferenceSet,
|
||||
encodeReply,
|
||||
fetch: fetchImplementation = fetch
|
||||
}) {
|
||||
const globalVar = window;
|
||||
let landedActionId = 0;
|
||||
return async (id, args) => {
|
||||
let actionId = globalVar.__routerActionID = (globalVar.__routerActionID ?? (globalVar.__routerActionID = 0)) + 1;
|
||||
const temporaryReferences = createTemporaryReferenceSet();
|
||||
const payloadPromise = fetchImplementation(
|
||||
new Request(location.href, {
|
||||
body: await encodeReply(args, { temporaryReferences }),
|
||||
method: "POST",
|
||||
headers: {
|
||||
Accept: "text/x-component",
|
||||
"rsc-action-id": id
|
||||
}
|
||||
})
|
||||
).then((response) => {
|
||||
if (!response.body) {
|
||||
throw new Error("No response body");
|
||||
}
|
||||
return createFromReadableStream(response.body, {
|
||||
temporaryReferences
|
||||
});
|
||||
});
|
||||
React3.startTransition(
|
||||
() => (
|
||||
// @ts-expect-error - Needs React 19 types
|
||||
Promise.resolve(payloadPromise).then(async (payload) => {
|
||||
if (payload.type === "redirect") {
|
||||
if (payload.reload || isExternalLocation(payload.location)) {
|
||||
window.location.href = payload.location;
|
||||
return;
|
||||
}
|
||||
React3.startTransition(() => {
|
||||
globalVar.__reactRouterDataRouter.navigate(payload.location, {
|
||||
replace: payload.replace
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (payload.type !== "action") {
|
||||
throw new Error("Unexpected payload type");
|
||||
}
|
||||
const rerender = await payload.rerender;
|
||||
if (rerender && landedActionId < actionId && globalVar.__routerActionID <= actionId) {
|
||||
if (rerender.type === "redirect") {
|
||||
if (rerender.reload || isExternalLocation(rerender.location)) {
|
||||
window.location.href = rerender.location;
|
||||
return;
|
||||
}
|
||||
React3.startTransition(() => {
|
||||
globalVar.__reactRouterDataRouter.navigate(rerender.location, {
|
||||
replace: rerender.replace
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
React3.startTransition(() => {
|
||||
let lastMatch;
|
||||
for (const match of rerender.matches) {
|
||||
globalVar.__reactRouterDataRouter.patchRoutes(
|
||||
lastMatch?.id ?? null,
|
||||
[createRouteFromServerManifest(match)],
|
||||
true
|
||||
);
|
||||
lastMatch = match;
|
||||
}
|
||||
window.__reactRouterDataRouter._internalSetStateDoNotUseOrYouWillBreakYourApp(
|
||||
{
|
||||
loaderData: Object.assign(
|
||||
{},
|
||||
globalVar.__reactRouterDataRouter.state.loaderData,
|
||||
rerender.loaderData
|
||||
),
|
||||
errors: rerender.errors ? Object.assign(
|
||||
{},
|
||||
globalVar.__reactRouterDataRouter.state.errors,
|
||||
rerender.errors
|
||||
) : null
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
)
|
||||
);
|
||||
return payloadPromise.then((payload) => {
|
||||
if (payload.type !== "action" && payload.type !== "redirect") {
|
||||
throw new Error("Unexpected payload type");
|
||||
}
|
||||
return payload.actionResult;
|
||||
});
|
||||
};
|
||||
}
|
||||
function createRouterFromPayload({
|
||||
fetchImplementation,
|
||||
createFromReadableStream,
|
||||
getContext,
|
||||
payload
|
||||
}) {
|
||||
const globalVar = window;
|
||||
if (globalVar.__reactRouterDataRouter && globalVar.__reactRouterRouteModules)
|
||||
return {
|
||||
router: globalVar.__reactRouterDataRouter,
|
||||
routeModules: globalVar.__reactRouterRouteModules
|
||||
};
|
||||
if (payload.type !== "render") throw new Error("Invalid payload type");
|
||||
globalVar.__reactRouterRouteModules = globalVar.__reactRouterRouteModules ?? {};
|
||||
populateRSCRouteModules(globalVar.__reactRouterRouteModules, payload.matches);
|
||||
let patches = /* @__PURE__ */ new Map();
|
||||
payload.patches?.forEach((patch) => {
|
||||
invariant(patch.parentId, "Invalid patch parentId");
|
||||
if (!patches.has(patch.parentId)) {
|
||||
patches.set(patch.parentId, []);
|
||||
}
|
||||
patches.get(patch.parentId)?.push(patch);
|
||||
});
|
||||
let routes = payload.matches.reduceRight((previous, match) => {
|
||||
const route = createRouteFromServerManifest(
|
||||
match,
|
||||
payload
|
||||
);
|
||||
if (previous.length > 0) {
|
||||
route.children = previous;
|
||||
let childrenToPatch = patches.get(match.id);
|
||||
if (childrenToPatch) {
|
||||
route.children.push(
|
||||
...childrenToPatch.map((r) => createRouteFromServerManifest(r))
|
||||
);
|
||||
}
|
||||
}
|
||||
return [route];
|
||||
}, []);
|
||||
globalVar.__reactRouterDataRouter = createRouter({
|
||||
routes,
|
||||
getContext,
|
||||
basename: payload.basename,
|
||||
history: createBrowserHistory(),
|
||||
hydrationData: getHydrationData({
|
||||
state: {
|
||||
loaderData: payload.loaderData,
|
||||
actionData: payload.actionData,
|
||||
errors: payload.errors
|
||||
},
|
||||
routes,
|
||||
getRouteInfo: (routeId) => {
|
||||
let match = payload.matches.find((m) => m.id === routeId);
|
||||
invariant(match, "Route not found in payload");
|
||||
return {
|
||||
clientLoader: match.clientLoader,
|
||||
hasLoader: match.hasLoader,
|
||||
hasHydrateFallback: match.hydrateFallbackElement != null
|
||||
};
|
||||
},
|
||||
location: payload.location,
|
||||
basename: payload.basename,
|
||||
isSpaMode: false
|
||||
}),
|
||||
async patchRoutesOnNavigation({ path, signal }) {
|
||||
if (discoveredPaths.has(path)) {
|
||||
return;
|
||||
}
|
||||
await fetchAndApplyManifestPatches(
|
||||
[path],
|
||||
createFromReadableStream,
|
||||
fetchImplementation,
|
||||
signal
|
||||
);
|
||||
},
|
||||
// FIXME: Pass `build.ssr` into this function
|
||||
dataStrategy: getRSCSingleFetchDataStrategy(
|
||||
() => globalVar.__reactRouterDataRouter,
|
||||
true,
|
||||
payload.basename,
|
||||
createFromReadableStream,
|
||||
fetchImplementation
|
||||
)
|
||||
});
|
||||
if (globalVar.__reactRouterDataRouter.state.initialized) {
|
||||
globalVar.__routerInitialized = true;
|
||||
globalVar.__reactRouterDataRouter.initialize();
|
||||
} else {
|
||||
globalVar.__routerInitialized = false;
|
||||
}
|
||||
let lastLoaderData = void 0;
|
||||
globalVar.__reactRouterDataRouter.subscribe(({ loaderData, actionData }) => {
|
||||
if (lastLoaderData !== loaderData) {
|
||||
globalVar.__routerActionID = (globalVar.__routerActionID ?? (globalVar.__routerActionID = 0)) + 1;
|
||||
}
|
||||
});
|
||||
globalVar.__reactRouterDataRouter._updateRoutesForHMR = (routeUpdateByRouteId) => {
|
||||
const oldRoutes = window.__reactRouterDataRouter.routes;
|
||||
const newRoutes = [];
|
||||
function walkRoutes(routes2, parentId) {
|
||||
return routes2.map((route) => {
|
||||
const routeUpdate = routeUpdateByRouteId.get(route.id);
|
||||
if (routeUpdate) {
|
||||
const {
|
||||
routeModule,
|
||||
hasAction,
|
||||
hasComponent,
|
||||
hasErrorBoundary,
|
||||
hasLoader
|
||||
} = routeUpdate;
|
||||
const newRoute = createRouteFromServerManifest({
|
||||
clientAction: routeModule.clientAction,
|
||||
clientLoader: routeModule.clientLoader,
|
||||
element: route.element,
|
||||
errorElement: route.errorElement,
|
||||
handle: route.handle,
|
||||
hasAction,
|
||||
hasComponent,
|
||||
hasErrorBoundary,
|
||||
hasLoader,
|
||||
hydrateFallbackElement: route.hydrateFallbackElement,
|
||||
id: route.id,
|
||||
index: route.index,
|
||||
links: routeModule.links,
|
||||
meta: routeModule.meta,
|
||||
parentId,
|
||||
path: route.path,
|
||||
shouldRevalidate: routeModule.shouldRevalidate
|
||||
});
|
||||
if (route.children) {
|
||||
newRoute.children = walkRoutes(route.children, route.id);
|
||||
}
|
||||
return newRoute;
|
||||
}
|
||||
const updatedRoute = { ...route };
|
||||
if (route.children) {
|
||||
updatedRoute.children = walkRoutes(route.children, route.id);
|
||||
}
|
||||
return updatedRoute;
|
||||
});
|
||||
}
|
||||
newRoutes.push(
|
||||
...walkRoutes(oldRoutes, void 0)
|
||||
);
|
||||
window.__reactRouterDataRouter._internalSetRoutes(newRoutes);
|
||||
};
|
||||
return {
|
||||
router: globalVar.__reactRouterDataRouter,
|
||||
routeModules: globalVar.__reactRouterRouteModules
|
||||
};
|
||||
}
|
||||
var renderedRoutesContext = createContext();
|
||||
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
||||
let dataStrategy = getSingleFetchDataStrategyImpl(
|
||||
getRouter,
|
||||
(match) => {
|
||||
let M = match;
|
||||
return {
|
||||
hasLoader: M.route.hasLoader,
|
||||
hasClientLoader: M.route.hasClientLoader,
|
||||
hasComponent: M.route.hasComponent,
|
||||
hasAction: M.route.hasAction,
|
||||
hasClientAction: M.route.hasClientAction,
|
||||
hasShouldRevalidate: M.route.hasShouldRevalidate
|
||||
};
|
||||
},
|
||||
// pass map into fetchAndDecode so it can add payloads
|
||||
getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation),
|
||||
ssr,
|
||||
basename,
|
||||
// If the route has a component but we don't have an element, we need to hit
|
||||
// the server loader flow regardless of whether the client loader calls
|
||||
// `serverLoader` or not, otherwise we'll have nothing to render.
|
||||
(match) => {
|
||||
let M = match;
|
||||
return M.route.hasComponent && !M.route.element;
|
||||
}
|
||||
);
|
||||
return async (args) => args.runClientMiddleware(async () => {
|
||||
let context = args.context;
|
||||
context.set(renderedRoutesContext, []);
|
||||
let results = await dataStrategy(args);
|
||||
const renderedRoutesById = /* @__PURE__ */ new Map();
|
||||
for (const route of context.get(renderedRoutesContext)) {
|
||||
if (!renderedRoutesById.has(route.id)) {
|
||||
renderedRoutesById.set(route.id, []);
|
||||
}
|
||||
renderedRoutesById.get(route.id).push(route);
|
||||
}
|
||||
React3.startTransition(() => {
|
||||
for (const match of args.matches) {
|
||||
const renderedRoutes = renderedRoutesById.get(match.route.id);
|
||||
if (renderedRoutes) {
|
||||
for (const rendered of renderedRoutes) {
|
||||
window.__reactRouterDataRouter.patchRoutes(
|
||||
rendered.parentId ?? null,
|
||||
[createRouteFromServerManifest(rendered)],
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return results;
|
||||
});
|
||||
}
|
||||
function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {
|
||||
return async (args, basename, targetRoutes) => {
|
||||
let { request, context } = args;
|
||||
let url = singleFetchUrl(request.url, basename, "rsc");
|
||||
if (request.method === "GET") {
|
||||
url = stripIndexParam(url);
|
||||
if (targetRoutes) {
|
||||
url.searchParams.set("_routes", targetRoutes.join(","));
|
||||
}
|
||||
}
|
||||
let res = await fetchImplementation(
|
||||
new Request(url, await createRequestInit(request))
|
||||
);
|
||||
if (res.status >= 400 && !res.headers.has("X-Remix-Response")) {
|
||||
throw new ErrorResponseImpl(res.status, res.statusText, await res.text());
|
||||
}
|
||||
invariant(res.body, "No response body to decode");
|
||||
try {
|
||||
const payload = await createFromReadableStream(res.body, {
|
||||
temporaryReferences: void 0
|
||||
});
|
||||
if (payload.type === "redirect") {
|
||||
return {
|
||||
status: res.status,
|
||||
data: {
|
||||
redirect: {
|
||||
redirect: payload.location,
|
||||
reload: payload.reload,
|
||||
replace: payload.replace,
|
||||
revalidate: false,
|
||||
status: payload.status
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
if (payload.type !== "render") {
|
||||
throw new Error("Unexpected payload type");
|
||||
}
|
||||
context.get(renderedRoutesContext).push(...payload.matches);
|
||||
let results = { routes: {} };
|
||||
const dataKey = isMutationMethod(request.method) ? "actionData" : "loaderData";
|
||||
for (let [routeId, data] of Object.entries(payload[dataKey] || {})) {
|
||||
results.routes[routeId] = { data };
|
||||
}
|
||||
if (payload.errors) {
|
||||
for (let [routeId, error] of Object.entries(payload.errors)) {
|
||||
results.routes[routeId] = { error };
|
||||
}
|
||||
}
|
||||
return { status: res.status, data: results };
|
||||
} catch (e) {
|
||||
throw new Error("Unable to decode RSC response");
|
||||
}
|
||||
};
|
||||
}
|
||||
function RSCHydratedRouter({
|
||||
createFromReadableStream,
|
||||
fetch: fetchImplementation = fetch,
|
||||
payload,
|
||||
routeDiscovery = "eager",
|
||||
getContext
|
||||
}) {
|
||||
if (payload.type !== "render") throw new Error("Invalid payload type");
|
||||
let { router: router2, routeModules } = React3.useMemo(
|
||||
() => createRouterFromPayload({
|
||||
payload,
|
||||
fetchImplementation,
|
||||
getContext,
|
||||
createFromReadableStream
|
||||
}),
|
||||
[createFromReadableStream, payload, fetchImplementation, getContext]
|
||||
);
|
||||
React3.useEffect(() => {
|
||||
setIsHydrated();
|
||||
}, []);
|
||||
React3.useLayoutEffect(() => {
|
||||
const globalVar = window;
|
||||
if (!globalVar.__routerInitialized) {
|
||||
globalVar.__routerInitialized = true;
|
||||
globalVar.__reactRouterDataRouter.initialize();
|
||||
}
|
||||
}, []);
|
||||
let [{ routes, state }, setState] = React3.useState(() => ({
|
||||
routes: cloneRoutes(router2.routes),
|
||||
state: router2.state
|
||||
}));
|
||||
React3.useLayoutEffect(
|
||||
() => router2.subscribe((newState) => {
|
||||
if (diffRoutes(router2.routes, routes))
|
||||
React3.startTransition(() => {
|
||||
setState({
|
||||
routes: cloneRoutes(router2.routes),
|
||||
state: newState
|
||||
});
|
||||
});
|
||||
}),
|
||||
[router2.subscribe, routes, router2]
|
||||
);
|
||||
const transitionEnabledRouter = React3.useMemo(
|
||||
() => ({
|
||||
...router2,
|
||||
state,
|
||||
routes
|
||||
}),
|
||||
[router2, routes, state]
|
||||
);
|
||||
React3.useEffect(() => {
|
||||
if (routeDiscovery === "lazy" || // @ts-expect-error - TS doesn't know about this yet
|
||||
window.navigator?.connection?.saveData === true) {
|
||||
return;
|
||||
}
|
||||
function registerElement(el) {
|
||||
let path = el.tagName === "FORM" ? el.getAttribute("action") : el.getAttribute("href");
|
||||
if (!path) {
|
||||
return;
|
||||
}
|
||||
let pathname = el.tagName === "A" ? el.pathname : new URL(path, window.location.origin).pathname;
|
||||
if (!discoveredPaths.has(pathname)) {
|
||||
nextPaths.add(pathname);
|
||||
}
|
||||
}
|
||||
async function fetchPatches() {
|
||||
document.querySelectorAll("a[data-discover], form[data-discover]").forEach(registerElement);
|
||||
let paths = Array.from(nextPaths.keys()).filter((path) => {
|
||||
if (discoveredPaths.has(path)) {
|
||||
nextPaths.delete(path);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
if (paths.length === 0) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await fetchAndApplyManifestPatches(
|
||||
paths,
|
||||
createFromReadableStream,
|
||||
fetchImplementation
|
||||
);
|
||||
} catch (e) {
|
||||
console.error("Failed to fetch manifest patches", e);
|
||||
}
|
||||
}
|
||||
let debouncedFetchPatches = debounce(fetchPatches, 100);
|
||||
fetchPatches();
|
||||
let observer = new MutationObserver(() => debouncedFetchPatches());
|
||||
observer.observe(document.documentElement, {
|
||||
subtree: true,
|
||||
childList: true,
|
||||
attributes: true,
|
||||
attributeFilter: ["data-discover", "href", "action"]
|
||||
});
|
||||
}, [routeDiscovery, createFromReadableStream, fetchImplementation]);
|
||||
const frameworkContext = {
|
||||
future: {
|
||||
// These flags have no runtime impact so can always be false. If we add
|
||||
// flags that drive runtime behavior they'll need to be proxied through.
|
||||
v8_middleware: false,
|
||||
unstable_subResourceIntegrity: false
|
||||
},
|
||||
isSpaMode: false,
|
||||
ssr: true,
|
||||
criticalCss: "",
|
||||
manifest: {
|
||||
routes: {},
|
||||
version: "1",
|
||||
url: "",
|
||||
entry: {
|
||||
module: "",
|
||||
imports: []
|
||||
}
|
||||
},
|
||||
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
||||
routeModules
|
||||
};
|
||||
return /* @__PURE__ */ React3.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(RSCRouterGlobalErrorBoundary, { location: state.location }, /* @__PURE__ */ React3.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
|
||||
RouterProvider,
|
||||
{
|
||||
router: transitionEnabledRouter,
|
||||
flushSync: ReactDOM2.flushSync,
|
||||
unstable_useTransitions: true
|
||||
}
|
||||
))));
|
||||
}
|
||||
function createRouteFromServerManifest(match, payload) {
|
||||
let hasInitialData = payload && match.id in payload.loaderData;
|
||||
let initialData = payload?.loaderData[match.id];
|
||||
let hasInitialError = payload?.errors && match.id in payload.errors;
|
||||
let initialError = payload?.errors?.[match.id];
|
||||
let isHydrationRequest = match.clientLoader?.hydrate === true || !match.hasLoader || // If the route has a component but we don't have an element, we need to hit
|
||||
// the server loader flow regardless of whether the client loader calls
|
||||
// `serverLoader` or not, otherwise we'll have nothing to render.
|
||||
match.hasComponent && !match.element;
|
||||
invariant(window.__reactRouterRouteModules);
|
||||
populateRSCRouteModules(window.__reactRouterRouteModules, match);
|
||||
let dataRoute = {
|
||||
id: match.id,
|
||||
element: match.element,
|
||||
errorElement: match.errorElement,
|
||||
handle: match.handle,
|
||||
hasErrorBoundary: match.hasErrorBoundary,
|
||||
hydrateFallbackElement: match.hydrateFallbackElement,
|
||||
index: match.index,
|
||||
loader: match.clientLoader ? async (args, singleFetch) => {
|
||||
try {
|
||||
let result = await match.clientLoader({
|
||||
...args,
|
||||
serverLoader: () => {
|
||||
preventInvalidServerHandlerCall(
|
||||
"loader",
|
||||
match.id,
|
||||
match.hasLoader
|
||||
);
|
||||
if (isHydrationRequest) {
|
||||
if (hasInitialData) {
|
||||
return initialData;
|
||||
}
|
||||
if (hasInitialError) {
|
||||
throw initialError;
|
||||
}
|
||||
}
|
||||
return callSingleFetch(singleFetch);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
} finally {
|
||||
isHydrationRequest = false;
|
||||
}
|
||||
} : (
|
||||
// We always make the call in this RSC world since even if we don't
|
||||
// have a `loader` we may need to get the `element` implementation
|
||||
(_, singleFetch) => callSingleFetch(singleFetch)
|
||||
),
|
||||
action: match.clientAction ? (args, singleFetch) => match.clientAction({
|
||||
...args,
|
||||
serverAction: async () => {
|
||||
preventInvalidServerHandlerCall(
|
||||
"action",
|
||||
match.id,
|
||||
match.hasLoader
|
||||
);
|
||||
return await callSingleFetch(singleFetch);
|
||||
}
|
||||
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
||||
throw noActionDefinedError("action", match.id);
|
||||
},
|
||||
path: match.path,
|
||||
shouldRevalidate: match.shouldRevalidate,
|
||||
// We always have a "loader" in this RSC world since even if we don't
|
||||
// have a `loader` we may need to get the `element` implementation
|
||||
hasLoader: true,
|
||||
hasClientLoader: match.clientLoader != null,
|
||||
hasAction: match.hasAction,
|
||||
hasClientAction: match.clientAction != null,
|
||||
hasShouldRevalidate: match.shouldRevalidate != null
|
||||
};
|
||||
if (typeof dataRoute.loader === "function") {
|
||||
dataRoute.loader.hydrate = shouldHydrateRouteLoader(
|
||||
match.id,
|
||||
match.clientLoader,
|
||||
match.hasLoader,
|
||||
false
|
||||
);
|
||||
}
|
||||
return dataRoute;
|
||||
}
|
||||
function callSingleFetch(singleFetch) {
|
||||
invariant(typeof singleFetch === "function", "Invalid singleFetch parameter");
|
||||
return singleFetch();
|
||||
}
|
||||
function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
||||
if (!hasHandler) {
|
||||
let fn = type === "action" ? "serverAction()" : "serverLoader()";
|
||||
let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
|
||||
console.error(msg);
|
||||
throw new ErrorResponseImpl(400, "Bad Request", new Error(msg), true);
|
||||
}
|
||||
}
|
||||
var nextPaths = /* @__PURE__ */ new Set();
|
||||
var discoveredPathsMaxSize = 1e3;
|
||||
var discoveredPaths = /* @__PURE__ */ new Set();
|
||||
var URL_LIMIT = 7680;
|
||||
function getManifestUrl(paths) {
|
||||
if (paths.length === 0) {
|
||||
return null;
|
||||
}
|
||||
if (paths.length === 1) {
|
||||
return new URL(`${paths[0]}.manifest`, window.location.origin);
|
||||
}
|
||||
const globalVar = window;
|
||||
let basename = (globalVar.__reactRouterDataRouter.basename ?? "").replace(
|
||||
/^\/|\/$/g,
|
||||
""
|
||||
);
|
||||
let url = new URL(`${basename}/.manifest`, window.location.origin);
|
||||
url.searchParams.set("paths", paths.sort().join(","));
|
||||
return url;
|
||||
}
|
||||
async function fetchAndApplyManifestPatches(paths, createFromReadableStream, fetchImplementation, signal) {
|
||||
let url = getManifestUrl(paths);
|
||||
if (url == null) {
|
||||
return;
|
||||
}
|
||||
if (url.toString().length > URL_LIMIT) {
|
||||
nextPaths.clear();
|
||||
return;
|
||||
}
|
||||
let response = await fetchImplementation(new Request(url, { signal }));
|
||||
if (!response.body || response.status < 200 || response.status >= 300) {
|
||||
throw new Error("Unable to fetch new route matches from the server");
|
||||
}
|
||||
let payload = await createFromReadableStream(response.body, {
|
||||
temporaryReferences: void 0
|
||||
});
|
||||
if (payload.type !== "manifest") {
|
||||
throw new Error("Failed to patch routes");
|
||||
}
|
||||
paths.forEach((p) => addToFifoQueue(p, discoveredPaths));
|
||||
React3.startTransition(() => {
|
||||
payload.patches.forEach((p) => {
|
||||
window.__reactRouterDataRouter.patchRoutes(
|
||||
p.parentId ?? null,
|
||||
[createRouteFromServerManifest(p)]
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
function addToFifoQueue(path, queue) {
|
||||
if (queue.size >= discoveredPathsMaxSize) {
|
||||
let first = queue.values().next().value;
|
||||
queue.delete(first);
|
||||
}
|
||||
queue.add(path);
|
||||
}
|
||||
function debounce(callback, wait) {
|
||||
let timeoutId;
|
||||
return (...args) => {
|
||||
window.clearTimeout(timeoutId);
|
||||
timeoutId = window.setTimeout(() => callback(...args), wait);
|
||||
};
|
||||
}
|
||||
function isExternalLocation(location2) {
|
||||
const newLocation = new URL(location2, window.location.href);
|
||||
return newLocation.origin !== window.location.origin;
|
||||
}
|
||||
function cloneRoutes(routes) {
|
||||
if (!routes) return void 0;
|
||||
return routes.map((route) => ({
|
||||
...route,
|
||||
children: cloneRoutes(route.children)
|
||||
}));
|
||||
}
|
||||
function diffRoutes(a, b) {
|
||||
if (a.length !== b.length) return true;
|
||||
return a.some((route, index) => {
|
||||
if (route.element !== b[index].element) return true;
|
||||
if (route.errorElement !== b[index].errorElement)
|
||||
return true;
|
||||
if (route.hydrateFallbackElement !== b[index].hydrateFallbackElement)
|
||||
return true;
|
||||
if (route.hasErrorBoundary !== b[index].hasErrorBoundary)
|
||||
return true;
|
||||
if (route.hasLoader !== b[index].hasLoader) return true;
|
||||
if (route.hasClientLoader !== b[index].hasClientLoader)
|
||||
return true;
|
||||
if (route.hasAction !== b[index].hasAction) return true;
|
||||
if (route.hasClientAction !== b[index].hasClientAction)
|
||||
return true;
|
||||
return diffRoutes(route.children || [], b[index].children || []);
|
||||
});
|
||||
}
|
||||
|
||||
// lib/rsc/html-stream/browser.ts
|
||||
function getRSCStream() {
|
||||
let encoder = new TextEncoder();
|
||||
let streamController = null;
|
||||
let rscStream = new ReadableStream({
|
||||
start(controller) {
|
||||
if (typeof window === "undefined") {
|
||||
return;
|
||||
}
|
||||
let handleChunk = (chunk) => {
|
||||
if (typeof chunk === "string") {
|
||||
controller.enqueue(encoder.encode(chunk));
|
||||
} else {
|
||||
controller.enqueue(chunk);
|
||||
}
|
||||
};
|
||||
window.__FLIGHT_DATA || (window.__FLIGHT_DATA = []);
|
||||
window.__FLIGHT_DATA.forEach(handleChunk);
|
||||
window.__FLIGHT_DATA.push = (chunk) => {
|
||||
handleChunk(chunk);
|
||||
return 0;
|
||||
};
|
||||
streamController = controller;
|
||||
}
|
||||
});
|
||||
if (typeof document !== "undefined" && document.readyState === "loading") {
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
streamController?.close();
|
||||
});
|
||||
} else {
|
||||
streamController?.close();
|
||||
}
|
||||
return rscStream;
|
||||
}
|
||||
export {
|
||||
HydratedRouter,
|
||||
RouterProvider2 as RouterProvider,
|
||||
RSCHydratedRouter as unstable_RSCHydratedRouter,
|
||||
createCallServer as unstable_createCallServer,
|
||||
getRSCStream as unstable_getRSCStream
|
||||
};
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={A:{A:{"2":"K D E F A B xC"},B:{"1":"0 1 2 3 4 5 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L M G N"},C:{"1":"0 1 2 3 4 5 oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC zC 0C","2":"6 7 8 9 yC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB 1C 2C"},D:{"1":"0 1 2 3 4 5 qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB"},E:{"1":"B C L M G NC OC 8C 9C AD cC dC PC BD QC eC fC gC hC iC CD RC jC kC lC mC nC DD SC oC pC qC rC sC tC uC ED FD","2":"J ZB K D E F A 3C aC 4C 5C 6C 7C bC"},F:{"1":"0 1 2 3 4 5 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB GD HD ID JD NC vC KD OC"},G:{"1":"VD WD XD YD ZD aD bD cD dD eD cC dC PC fD QC eC fC gC hC iC gD RC jC kC lC mC nC hD SC oC pC qC rC sC tC uC","2":"E aC LD wC MD ND OD PD QD RD SD TD","194":"UD"},H:{"2":"iD"},I:{"1":"I","2":"TC J jD kD lD mD wC nD oD"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC vC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB pD qD rD sD tD bC uD vD wD xD yD QC RC SC zD","2":"J"},Q:{"1":"0D"},R:{"1":"1D"},S:{"1":"2D 3D"}},B:2,C:"Subresource Integrity",D:true};
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright 2022 Andrey Sitnik <andrey@sitnik.ru> and other contributors
|
||||
|
||||
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.
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"names":["_importDeferProxy","init","ns","constValue","v","proxy","run","_target","p","receiver","Proxy","defineProperty","deleteProperty","get","Reflect","getOwnPropertyDescriptor","getPrototypeOf","isExtensible","has","ownKeys","preventExtensions","set","setPrototypeOf"],"sources":["../../src/helpers/importDeferProxy.ts"],"sourcesContent":["/* @minVersion 7.23.0 */\n\nexport default function _importDeferProxy<T extends object>(\n init: () => T,\n): ProxyHandler<T> {\n var ns: T | null = null;\n\n var constValue = function <V extends boolean | null>(v: V) {\n return function (): V {\n return v;\n };\n };\n\n var proxy = function (run: Function) {\n return function (_target: T, p?: string | symbol, receiver?: any) {\n if (ns === null) ns = init();\n return run(ns, p, receiver);\n };\n };\n\n return new Proxy(\n {},\n {\n defineProperty: constValue(false),\n deleteProperty: constValue(false),\n get: proxy(Reflect.get),\n getOwnPropertyDescriptor: proxy(Reflect.getOwnPropertyDescriptor),\n getPrototypeOf: constValue(null),\n isExtensible: constValue(false),\n has: proxy(Reflect.has),\n ownKeys: proxy(Reflect.ownKeys),\n preventExtensions: constValue(true),\n set: constValue(false),\n setPrototypeOf: constValue(false),\n },\n );\n}\n"],"mappings":";;;;;;AAEe,SAASA,iBAAiBA,CACvCC,IAAa,EACI;EACjB,IAAIC,EAAY,GAAG,IAAI;EAEvB,IAAIC,UAAU,GAAG,SAAAA,CAAoCC,CAAI,EAAE;IACzD,OAAO,YAAe;MACpB,OAAOA,CAAC;IACV,CAAC;EACH,CAAC;EAED,IAAIC,KAAK,GAAG,SAAAA,CAAUC,GAAa,EAAE;IACnC,OAAO,UAAUC,OAAU,EAAEC,CAAmB,EAAEC,QAAc,EAAE;MAChE,IAAIP,EAAE,KAAK,IAAI,EAAEA,EAAE,GAAGD,IAAI,CAAC,CAAC;MAC5B,OAAOK,GAAG,CAACJ,EAAE,EAAEM,CAAC,EAAEC,QAAQ,CAAC;IAC7B,CAAC;EACH,CAAC;EAED,OAAO,IAAIC,KAAK,CACd,CAAC,CAAC,EACF;IACEC,cAAc,EAAER,UAAU,CAAC,KAAK,CAAC;IACjCS,cAAc,EAAET,UAAU,CAAC,KAAK,CAAC;IACjCU,GAAG,EAAER,KAAK,CAACS,OAAO,CAACD,GAAG,CAAC;IACvBE,wBAAwB,EAAEV,KAAK,CAACS,OAAO,CAACC,wBAAwB,CAAC;IACjEC,cAAc,EAAEb,UAAU,CAAC,IAAI,CAAC;IAChCc,YAAY,EAAEd,UAAU,CAAC,KAAK,CAAC;IAC/Be,GAAG,EAAEb,KAAK,CAACS,OAAO,CAACI,GAAG,CAAC;IACvBC,OAAO,EAAEd,KAAK,CAACS,OAAO,CAACK,OAAO,CAAC;IAC/BC,iBAAiB,EAAEjB,UAAU,CAAC,IAAI,CAAC;IACnCkB,GAAG,EAAElB,UAAU,CAAC,KAAK,CAAC;IACtBmB,cAAc,EAAEnB,UAAU,CAAC,KAAK;EAClC,CACF,CAAC;AACH","ignoreList":[]}
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
// NOTICE: This file is generated by Rollup. To modify it,
|
||||
// please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
|
||||
'use strict';
|
||||
|
||||
const validateTypes = require('../../utils/validateTypes.cjs');
|
||||
const getRuleSelector = require('../../utils/getRuleSelector.cjs');
|
||||
const hasPrefix = require('../../utils/hasPrefix.cjs');
|
||||
const isAutoprefixable = require('../../utils/isAutoprefixable.cjs');
|
||||
const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule.cjs');
|
||||
const optionsMatches = require('../../utils/optionsMatches.cjs');
|
||||
const parseSelector = require('../../utils/parseSelector.cjs');
|
||||
const report = require('../../utils/report.cjs');
|
||||
const ruleMessages = require('../../utils/ruleMessages.cjs');
|
||||
const validateOptions = require('../../utils/validateOptions.cjs');
|
||||
|
||||
const ruleName = 'selector-no-vendor-prefix';
|
||||
|
||||
const messages = ruleMessages(ruleName, {
|
||||
rejected: (selector) => `Unexpected vendor-prefixed selector "${selector}"`,
|
||||
});
|
||||
|
||||
const meta = {
|
||||
url: 'https://stylelint.io/user-guide/rules/selector-no-vendor-prefix',
|
||||
fixable: true,
|
||||
};
|
||||
|
||||
/** @type {import('stylelint').CoreRules[ruleName]} */
|
||||
const rule = (primary, secondaryOptions) => {
|
||||
return (root, result) => {
|
||||
const validOptions = validateOptions(
|
||||
result,
|
||||
ruleName,
|
||||
{ actual: primary },
|
||||
{
|
||||
actual: secondaryOptions,
|
||||
possible: {
|
||||
ignoreSelectors: [validateTypes.isString, validateTypes.isRegExp],
|
||||
},
|
||||
optional: true,
|
||||
},
|
||||
);
|
||||
|
||||
if (!validOptions) {
|
||||
return;
|
||||
}
|
||||
|
||||
root.walkRules((ruleNode) => {
|
||||
if (!hasPrefix(ruleNode.selector)) return;
|
||||
|
||||
if (!isStandardSyntaxRule(ruleNode)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const resolvedRoot = parseSelector(getRuleSelector(ruleNode), result, ruleNode);
|
||||
|
||||
if (!resolvedRoot) return;
|
||||
|
||||
resolvedRoot.walkPseudos((pseudoNode) => {
|
||||
const { value } = pseudoNode;
|
||||
|
||||
if (!isAutoprefixable.selector(value)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (optionsMatches(secondaryOptions, 'ignoreSelectors', value)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const fix = () => {
|
||||
pseudoNode.value = isAutoprefixable.unprefix(value);
|
||||
ruleNode.selector = resolvedRoot.toString();
|
||||
};
|
||||
|
||||
const index = pseudoNode.sourceIndex;
|
||||
const endIndex = index + value.length;
|
||||
|
||||
report({
|
||||
result,
|
||||
ruleName,
|
||||
message: messages.rejected,
|
||||
messageArgs: [value],
|
||||
node: ruleNode,
|
||||
index,
|
||||
endIndex,
|
||||
fix: {
|
||||
apply: fix,
|
||||
node: ruleNode,
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
rule.ruleName = ruleName;
|
||||
rule.messages = messages;
|
||||
rule.meta = meta;
|
||||
|
||||
module.exports = rule;
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"names":["_deepArray","require","Plugin","constructor","plugin","options","key","externalDependencies","finalize","manipulateOptions","post","pre","visitor","parserOverride","generatorOverride","name","exports","default"],"sources":["../../src/config/plugin.ts"],"sourcesContent":["import { finalize } from \"./helpers/deep-array.ts\";\nimport type { ReadonlyDeepArray } from \"./helpers/deep-array.ts\";\nimport type { PluginObject } from \"./validation/plugins.ts\";\n\nexport default class Plugin {\n key: string | undefined | null;\n manipulateOptions?: PluginObject[\"manipulateOptions\"];\n post?: PluginObject[\"post\"];\n pre?: PluginObject[\"pre\"];\n visitor: PluginObject[\"visitor\"];\n\n parserOverride?: PluginObject[\"parserOverride\"];\n generatorOverride?: PluginObject[\"generatorOverride\"];\n\n options: object;\n\n externalDependencies: ReadonlyDeepArray<string>;\n\n constructor(\n plugin: PluginObject,\n options: object,\n key?: string,\n externalDependencies: ReadonlyDeepArray<string> = finalize([]),\n ) {\n this.key = plugin.name || key;\n\n this.manipulateOptions = plugin.manipulateOptions;\n this.post = plugin.post;\n this.pre = plugin.pre;\n this.visitor = plugin.visitor || {};\n this.parserOverride = plugin.parserOverride;\n this.generatorOverride = plugin.generatorOverride;\n\n this.options = options;\n this.externalDependencies = externalDependencies;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAIe,MAAMC,MAAM,CAAC;EAc1BC,WAAWA,CACTC,MAAoB,EACpBC,OAAe,EACfC,GAAY,EACZC,oBAA+C,GAAG,IAAAC,mBAAQ,EAAC,EAAE,CAAC,EAC9D;IAAA,KAlBFF,GAAG;IAAA,KACHG,iBAAiB;IAAA,KACjBC,IAAI;IAAA,KACJC,GAAG;IAAA,KACHC,OAAO;IAAA,KAEPC,cAAc;IAAA,KACdC,iBAAiB;IAAA,KAEjBT,OAAO;IAAA,KAEPE,oBAAoB;IAQlB,IAAI,CAACD,GAAG,GAAGF,MAAM,CAACW,IAAI,IAAIT,GAAG;IAE7B,IAAI,CAACG,iBAAiB,GAAGL,MAAM,CAACK,iBAAiB;IACjD,IAAI,CAACC,IAAI,GAAGN,MAAM,CAACM,IAAI;IACvB,IAAI,CAACC,GAAG,GAAGP,MAAM,CAACO,GAAG;IACrB,IAAI,CAACC,OAAO,GAAGR,MAAM,CAACQ,OAAO,IAAI,CAAC,CAAC;IACnC,IAAI,CAACC,cAAc,GAAGT,MAAM,CAACS,cAAc;IAC3C,IAAI,CAACC,iBAAiB,GAAGV,MAAM,CAACU,iBAAiB;IAEjD,IAAI,CAACT,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACE,oBAAoB,GAAGA,oBAAoB;EAClD;AACF;AAACS,OAAA,CAAAC,OAAA,GAAAf,MAAA;AAAA","ignoreList":[]}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.mts';
|
||||
export type Source = ReverseSegment[][];
|
||||
export default function buildBySources(decoded: readonly SourceMapSegment[][], memos: unknown[]): Source[];
|
||||
//# sourceMappingURL=by-source.d.ts.map
|
||||
|
|
@ -1,287 +0,0 @@
|
|||
{
|
||||
"an-plus-b": {
|
||||
"groups": [
|
||||
"Selectors"
|
||||
],
|
||||
"status": "standard"
|
||||
},
|
||||
"angle": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/angle"
|
||||
},
|
||||
"angle-percentage": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/angle-percentage"
|
||||
},
|
||||
"basic-shape": {
|
||||
"groups": [
|
||||
"CSS Shapes",
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape"
|
||||
},
|
||||
"blend-mode": {
|
||||
"groups": [
|
||||
"Compositing and Blending",
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/blend-mode"
|
||||
},
|
||||
"color": {
|
||||
"groups": [
|
||||
"CSS Color",
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value"
|
||||
},
|
||||
"custom-ident": {
|
||||
"groups": [
|
||||
"CSS Will Change",
|
||||
"CSS Counter Styles",
|
||||
"CSS Lists and Counters",
|
||||
"CSS Animations",
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/custom-ident"
|
||||
},
|
||||
"dashed-ident": {
|
||||
"groups": [
|
||||
"CSS Animations",
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/dashed-ident"
|
||||
},
|
||||
"dimension": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/dimension"
|
||||
},
|
||||
"display-outside": {
|
||||
"groups": [
|
||||
"CSS Display"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-outside"
|
||||
},
|
||||
"display-inside": {
|
||||
"groups": [
|
||||
"CSS Display"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-inside"
|
||||
},
|
||||
"display-listitem": {
|
||||
"groups": [
|
||||
"CSS Display"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-listitem"
|
||||
},
|
||||
"display-internal": {
|
||||
"groups": [
|
||||
"CSS Display"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-internal"
|
||||
},
|
||||
"display-box": {
|
||||
"groups": [
|
||||
"CSS Display"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-box"
|
||||
},
|
||||
"display-legacy": {
|
||||
"groups": [
|
||||
"CSS Display"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-legacy"
|
||||
},
|
||||
"easing-function": {
|
||||
"groups": [
|
||||
"CSS Animations",
|
||||
"CSS Transitions",
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/easing-function"
|
||||
},
|
||||
"filter-function": {
|
||||
"groups": [
|
||||
"Filter Effects"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function"
|
||||
},
|
||||
"flex": {
|
||||
"groups": [
|
||||
"CSS Grid Layout",
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/flex_value"
|
||||
},
|
||||
"frequency": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/frequency"
|
||||
},
|
||||
"frequency-percentage": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/frequency-percentage"
|
||||
},
|
||||
"gradient": {
|
||||
"groups": [
|
||||
"CSS Images",
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gradient"
|
||||
},
|
||||
"ident": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard"
|
||||
},
|
||||
"image": {
|
||||
"groups": [
|
||||
"CSS Images",
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/image"
|
||||
},
|
||||
"integer": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/integer"
|
||||
},
|
||||
"length": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/length"
|
||||
},
|
||||
"length-percentage": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/length-percentage"
|
||||
},
|
||||
"line-style": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/line-style"
|
||||
},
|
||||
"number": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/number"
|
||||
},
|
||||
"overflow": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overflow_value"
|
||||
},
|
||||
"percentage": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/percentage"
|
||||
},
|
||||
"position": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/position_value"
|
||||
},
|
||||
"ratio": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/ratio"
|
||||
},
|
||||
"resolution": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/resolution"
|
||||
},
|
||||
"shape": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/shape"
|
||||
},
|
||||
"string": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/string"
|
||||
},
|
||||
"time": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/time"
|
||||
},
|
||||
"time-percentage": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/time-percentage"
|
||||
},
|
||||
"transform-function": {
|
||||
"groups": [
|
||||
"CSS Transforms",
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function"
|
||||
},
|
||||
"url": {
|
||||
"groups": [
|
||||
"CSS Types"
|
||||
],
|
||||
"status": "standard",
|
||||
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/url"
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,178 +0,0 @@
|
|||
import { isRegExp, isString } from '../../utils/validateTypes.mjs';
|
||||
import fixEmptyLinesBefore from '../../utils/fixEmptyLinesBefore.mjs';
|
||||
import getPreviousNonSharedLineCommentNode from '../../utils/getPreviousNonSharedLineCommentNode.mjs';
|
||||
import hasEmptyLine from '../../utils/hasEmptyLine.mjs';
|
||||
import isAfterComment from '../../utils/isAfterComment.mjs';
|
||||
import { isAtRule } from '../../utils/typeGuards.mjs';
|
||||
import isBlocklessAtRuleAfterBlocklessAtRule from '../../utils/isBlocklessAtRuleAfterBlocklessAtRule.mjs';
|
||||
import isBlocklessAtRuleAfterSameNameBlocklessAtRule from '../../utils/isBlocklessAtRuleAfterSameNameBlocklessAtRule.mjs';
|
||||
import isFirstNested from '../../utils/isFirstNested.mjs';
|
||||
import isFirstNodeOfRoot from '../../utils/isFirstNodeOfRoot.mjs';
|
||||
import isStandardSyntaxAtRule from '../../utils/isStandardSyntaxAtRule.mjs';
|
||||
import optionsMatches from '../../utils/optionsMatches.mjs';
|
||||
import report from '../../utils/report.mjs';
|
||||
import ruleMessages from '../../utils/ruleMessages.mjs';
|
||||
import validateOptions from '../../utils/validateOptions.mjs';
|
||||
|
||||
const ruleName = 'at-rule-empty-line-before';
|
||||
|
||||
const messages = ruleMessages(ruleName, {
|
||||
expected: 'Expected empty line before at-rule',
|
||||
rejected: 'Unexpected empty line before at-rule',
|
||||
});
|
||||
|
||||
const meta = {
|
||||
url: 'https://stylelint.io/user-guide/rules/at-rule-empty-line-before',
|
||||
fixable: true,
|
||||
};
|
||||
|
||||
/** @type {import('stylelint').CoreRules[ruleName]} */
|
||||
const rule = (primary, secondaryOptions, context) => {
|
||||
return (root, result) => {
|
||||
const validOptions = validateOptions(
|
||||
result,
|
||||
ruleName,
|
||||
{
|
||||
actual: primary,
|
||||
possible: ['always', 'never'],
|
||||
},
|
||||
{
|
||||
actual: secondaryOptions,
|
||||
possible: {
|
||||
except: [
|
||||
'after-same-name',
|
||||
'inside-block',
|
||||
'blockless-after-same-name-blockless',
|
||||
'blockless-after-blockless',
|
||||
'first-nested',
|
||||
],
|
||||
ignore: [
|
||||
'after-comment',
|
||||
'first-nested',
|
||||
'inside-block',
|
||||
'blockless-after-same-name-blockless',
|
||||
'blockless-after-blockless',
|
||||
],
|
||||
ignoreAtRules: [isString, isRegExp],
|
||||
},
|
||||
optional: true,
|
||||
},
|
||||
);
|
||||
|
||||
if (!validOptions) {
|
||||
return;
|
||||
}
|
||||
|
||||
/** @type {'always' | 'never'} */
|
||||
const expectation = primary;
|
||||
|
||||
root.walkAtRules((atRule) => {
|
||||
const isNested = atRule.parent && atRule.parent.type !== 'root';
|
||||
|
||||
// Ignore the first node
|
||||
if (isFirstNodeOfRoot(atRule)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isStandardSyntaxAtRule(atRule)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Return early if at-rule is to be ignored
|
||||
if (optionsMatches(secondaryOptions, 'ignoreAtRules', atRule.name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Optionally ignore the expectation if the node is blockless
|
||||
if (
|
||||
optionsMatches(secondaryOptions, 'ignore', 'blockless-after-blockless') &&
|
||||
isBlocklessAtRuleAfterBlocklessAtRule(atRule)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Optionally ignore the node if it is the first nested
|
||||
if (optionsMatches(secondaryOptions, 'ignore', 'first-nested') && isFirstNested(atRule)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Optionally ignore the expectation if the node is blockless
|
||||
// and following another blockless at-rule with the same name
|
||||
if (
|
||||
optionsMatches(secondaryOptions, 'ignore', 'blockless-after-same-name-blockless') &&
|
||||
isBlocklessAtRuleAfterSameNameBlocklessAtRule(atRule)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Optionally ignore the expectation if the node is inside a block
|
||||
if (optionsMatches(secondaryOptions, 'ignore', 'inside-block') && isNested) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Optionally ignore the expectation if a comment precedes this node
|
||||
if (optionsMatches(secondaryOptions, 'ignore', 'after-comment') && isAfterComment(atRule)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const hasEmptyLineBefore = hasEmptyLine(atRule.raws.before);
|
||||
let expectEmptyLineBefore = expectation === 'always';
|
||||
|
||||
// Optionally reverse the expectation if any exceptions apply
|
||||
if (
|
||||
(optionsMatches(secondaryOptions, 'except', 'after-same-name') &&
|
||||
isAtRuleAfterSameNameAtRule(atRule)) ||
|
||||
(optionsMatches(secondaryOptions, 'except', 'inside-block') && isNested) ||
|
||||
(optionsMatches(secondaryOptions, 'except', 'first-nested') && isFirstNested(atRule)) ||
|
||||
(optionsMatches(secondaryOptions, 'except', 'blockless-after-blockless') &&
|
||||
isBlocklessAtRuleAfterBlocklessAtRule(atRule)) ||
|
||||
(optionsMatches(secondaryOptions, 'except', 'blockless-after-same-name-blockless') &&
|
||||
isBlocklessAtRuleAfterSameNameBlocklessAtRule(atRule))
|
||||
) {
|
||||
expectEmptyLineBefore = !expectEmptyLineBefore;
|
||||
}
|
||||
|
||||
// Return if the expectation is met
|
||||
if (expectEmptyLineBefore === hasEmptyLineBefore) {
|
||||
return;
|
||||
}
|
||||
|
||||
const message = expectEmptyLineBefore ? messages.expected : messages.rejected;
|
||||
const action = expectEmptyLineBefore ? 'add' : 'remove';
|
||||
|
||||
// Fix
|
||||
const fix = () =>
|
||||
fixEmptyLinesBefore({
|
||||
node: atRule,
|
||||
newline: context.newline,
|
||||
action,
|
||||
});
|
||||
|
||||
report({
|
||||
message,
|
||||
messageArgs: [],
|
||||
node: atRule,
|
||||
result,
|
||||
ruleName,
|
||||
fix: {
|
||||
apply: fix,
|
||||
node: atRule.parent,
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {import('postcss').AtRule} atRule
|
||||
*/
|
||||
function isAtRuleAfterSameNameAtRule(atRule) {
|
||||
const previousNode = getPreviousNonSharedLineCommentNode(atRule);
|
||||
|
||||
return previousNode && isAtRule(previousNode) && previousNode.name === atRule.name;
|
||||
}
|
||||
|
||||
rule.ruleName = ruleName;
|
||||
rule.messages = messages;
|
||||
rule.meta = meta;
|
||||
export default rule;
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
/*
|
||||
Copyright Node.js contributors. All rights reserved.
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
// Node does not include the headers for these functions when compiling for WASM, so add them here.
|
||||
#ifdef __wasm32__
|
||||
extern "C" {
|
||||
NAPI_EXTERN napi_status NAPI_CDECL
|
||||
napi_create_threadsafe_function(napi_env env,
|
||||
napi_value func,
|
||||
napi_value async_resource,
|
||||
napi_value async_resource_name,
|
||||
size_t max_queue_size,
|
||||
size_t initial_thread_count,
|
||||
void* thread_finalize_data,
|
||||
napi_finalize thread_finalize_cb,
|
||||
void* context,
|
||||
napi_threadsafe_function_call_js call_js_cb,
|
||||
napi_threadsafe_function* result);
|
||||
|
||||
NAPI_EXTERN napi_status NAPI_CDECL napi_get_threadsafe_function_context(
|
||||
napi_threadsafe_function func, void** result);
|
||||
|
||||
NAPI_EXTERN napi_status NAPI_CDECL
|
||||
napi_call_threadsafe_function(napi_threadsafe_function func,
|
||||
void* data,
|
||||
napi_threadsafe_function_call_mode is_blocking);
|
||||
|
||||
NAPI_EXTERN napi_status NAPI_CDECL
|
||||
napi_acquire_threadsafe_function(napi_threadsafe_function func);
|
||||
|
||||
NAPI_EXTERN napi_status NAPI_CDECL napi_release_threadsafe_function(
|
||||
napi_threadsafe_function func, napi_threadsafe_function_release_mode mode);
|
||||
|
||||
NAPI_EXTERN napi_status NAPI_CDECL
|
||||
napi_unref_threadsafe_function(napi_env env, napi_threadsafe_function func);
|
||||
|
||||
NAPI_EXTERN napi_status NAPI_CDECL
|
||||
napi_ref_threadsafe_function(napi_env env, napi_threadsafe_function func);
|
||||
|
||||
NAPI_EXTERN napi_status NAPI_CDECL
|
||||
napi_create_async_work(napi_env env,
|
||||
napi_value async_resource,
|
||||
napi_value async_resource_name,
|
||||
napi_async_execute_callback execute,
|
||||
napi_async_complete_callback complete,
|
||||
void* data,
|
||||
napi_async_work* result);
|
||||
NAPI_EXTERN napi_status NAPI_CDECL napi_delete_async_work(napi_env env,
|
||||
napi_async_work work);
|
||||
NAPI_EXTERN napi_status NAPI_CDECL napi_queue_async_work(napi_env env,
|
||||
napi_async_work work);
|
||||
NAPI_EXTERN napi_status NAPI_CDECL napi_cancel_async_work(napi_env env,
|
||||
napi_async_work work);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
# resolve-from [](https://travis-ci.org/sindresorhus/resolve-from)
|
||||
|
||||
> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install resolve-from
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const resolveFrom = require('resolve-from');
|
||||
|
||||
// There is a file at `./foo/bar.js`
|
||||
|
||||
resolveFrom('foo', './bar');
|
||||
//=> '/Users/sindresorhus/dev/test/foo/bar.js'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### resolveFrom(fromDirectory, moduleId)
|
||||
|
||||
Like `require()`, throws when the module can't be found.
|
||||
|
||||
### resolveFrom.silent(fromDirectory, moduleId)
|
||||
|
||||
Returns `undefined` instead of throwing when the module can't be found.
|
||||
|
||||
#### fromDirectory
|
||||
|
||||
Type: `string`
|
||||
|
||||
Directory to resolve from.
|
||||
|
||||
#### moduleId
|
||||
|
||||
Type: `string`
|
||||
|
||||
What you would use in `require()`.
|
||||
|
||||
|
||||
## Tip
|
||||
|
||||
Create a partial using a bound function if you want to resolve from the same `fromDirectory` multiple times:
|
||||
|
||||
```js
|
||||
const resolveFromFoo = resolveFrom.bind(null, 'foo');
|
||||
|
||||
resolveFromFoo('./bar');
|
||||
resolveFromFoo('./baz');
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory
|
||||
- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path
|
||||
- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory
|
||||
- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point
|
||||
- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily
|
||||
- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
{
|
||||
"name": "gensync",
|
||||
"version": "1.0.0-beta.2",
|
||||
"license": "MIT",
|
||||
"description": "Allows users to use generators in order to write common functions that can be both sync or async.",
|
||||
"main": "index.js",
|
||||
"author": "Logan Smyth <loganfsmyth@gmail.com>",
|
||||
"homepage": "https://github.com/loganfsmyth/gensync",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/loganfsmyth/gensync.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"keywords": [
|
||||
"async",
|
||||
"sync",
|
||||
"generators",
|
||||
"async-await",
|
||||
"callbacks"
|
||||
],
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
"eslint-plugin-node": "^6.0.1",
|
||||
"eslint-plugin-prettier": "^2.6.0",
|
||||
"flow-bin": "^0.71.0",
|
||||
"jest": "^22.4.3",
|
||||
"prettier": "^1.12.1"
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={A:{A:{"2":"K D E F A B xC"},B:{"2":"0 1 2 3 4 5 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"2":"0 1 2 3 4 5 6 7 8 9 yC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC zC 0C 1C 2C"},D:{"2":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC"},E:{"1":"K D E F A B C L M G 5C 6C 7C bC NC OC 8C 9C AD cC dC PC BD QC eC fC gC hC iC CD RC jC kC lC mC nC DD","2":"J 3C aC SC oC pC qC rC sC tC uC ED FD","129":"ZB 4C"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GD HD ID JD NC vC KD OC"},G:{"1":"E MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD cC dC PC fD QC eC fC gC hC iC gD RC jC kC lC mC nC hD","2":"aC LD wC SC oC pC qC rC sC tC uC"},H:{"2":"iD"},I:{"2":"TC J I jD kD lD mD wC nD oD"},J:{"2":"D A"},K:{"2":"A B C H NC vC OC"},L:{"2":"I"},M:{"2":"MC"},N:{"2":"A B"},O:{"2":"PC"},P:{"2":"6 7 8 9 J AB BB CB DB EB FB pD qD rD sD tD bC uD vD wD xD yD QC RC SC zD"},Q:{"2":"0D"},R:{"2":"1D"},S:{"2":"2D 3D"}},B:6,C:"JPEG 2000 image format",D:true};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,27 +0,0 @@
|
|||
import * as core from "../core/index.js";
|
||||
import * as schemas from "./schemas.js";
|
||||
|
||||
export interface ZodCoercedString<T = unknown> extends schemas._ZodString<core.$ZodStringInternals<T>> {}
|
||||
export function string<T = unknown>(params?: string | core.$ZodStringParams): ZodCoercedString<T> {
|
||||
return core._coercedString(schemas.ZodString, params) as any;
|
||||
}
|
||||
|
||||
export interface ZodCoercedNumber<T = unknown> extends schemas._ZodNumber<core.$ZodNumberInternals<T>> {}
|
||||
export function number<T = unknown>(params?: string | core.$ZodNumberParams): ZodCoercedNumber<T> {
|
||||
return core._coercedNumber(schemas.ZodNumber, params) as ZodCoercedNumber<T>;
|
||||
}
|
||||
|
||||
export interface ZodCoercedBoolean<T = unknown> extends schemas._ZodBoolean<core.$ZodBooleanInternals<T>> {}
|
||||
export function boolean<T = unknown>(params?: string | core.$ZodBooleanParams): ZodCoercedBoolean<T> {
|
||||
return core._coercedBoolean(schemas.ZodBoolean, params) as ZodCoercedBoolean<T>;
|
||||
}
|
||||
|
||||
export interface ZodCoercedBigInt<T = unknown> extends schemas._ZodBigInt<core.$ZodBigIntInternals<T>> {}
|
||||
export function bigint<T = unknown>(params?: string | core.$ZodBigIntParams): ZodCoercedBigInt<T> {
|
||||
return core._coercedBigint(schemas.ZodBigInt, params) as ZodCoercedBigInt<T>;
|
||||
}
|
||||
|
||||
export interface ZodCoercedDate<T = unknown> extends schemas._ZodDate<core.$ZodDateInternals<T>> {}
|
||||
export function date<T = unknown>(params?: string | core.$ZodDateParams): ZodCoercedDate<T> {
|
||||
return core._coercedDate(schemas.ZodDate, params) as ZodCoercedDate<T>;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,33 +0,0 @@
|
|||
type Key = string | number | symbol;
|
||||
/**
|
||||
* SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the
|
||||
* index of the `key` in the backing array.
|
||||
*
|
||||
* This is designed to allow synchronizing a second array with the contents of the backing array,
|
||||
* like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,
|
||||
* and there are never duplicates.
|
||||
*/
|
||||
export declare class SetArray<T extends Key = Key> {
|
||||
private _indexes;
|
||||
array: readonly T[];
|
||||
constructor();
|
||||
}
|
||||
/**
|
||||
* Gets the index associated with `key` in the backing array, if it is already present.
|
||||
*/
|
||||
export declare function get<T extends Key>(setarr: SetArray<T>, key: T): number | undefined;
|
||||
/**
|
||||
* Puts `key` into the backing array, if it is not already present. Returns
|
||||
* the index of the `key` in the backing array.
|
||||
*/
|
||||
export declare function put<T extends Key>(setarr: SetArray<T>, key: T): number;
|
||||
/**
|
||||
* Pops the last added item out of the SetArray.
|
||||
*/
|
||||
export declare function pop<T extends Key>(setarr: SetArray<T>): void;
|
||||
/**
|
||||
* Removes the key, if it exists in the set.
|
||||
*/
|
||||
export declare function remove<T extends Key>(setarr: SetArray<T>, key: T): void;
|
||||
export {};
|
||||
//# sourceMappingURL=set-array.d.ts.map
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
"use client";
|
||||
|
||||
// src/useInfiniteQuery.ts
|
||||
import { InfiniteQueryObserver } from "@tanstack/query-core";
|
||||
import { useBaseQuery } from "./useBaseQuery.js";
|
||||
function useInfiniteQuery(options, queryClient) {
|
||||
return useBaseQuery(
|
||||
options,
|
||||
InfiniteQueryObserver,
|
||||
queryClient
|
||||
);
|
||||
}
|
||||
export {
|
||||
useInfiniteQuery
|
||||
};
|
||||
//# sourceMappingURL=useInfiniteQuery.js.map
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
{
|
||||
"name": "lru-cache",
|
||||
"description": "A cache object that deletes the least-recently-used items.",
|
||||
"version": "5.1.1",
|
||||
"author": "Isaac Z. Schlueter <i@izs.me>",
|
||||
"keywords": [
|
||||
"mru",
|
||||
"lru",
|
||||
"cache"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "tap test/*.js --100 -J",
|
||||
"snap": "TAP_SNAPSHOT=1 tap test/*.js -J",
|
||||
"coveragerport": "tap --coverage-report=html",
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"postpublish": "git push origin --all; git push origin --tags"
|
||||
},
|
||||
"main": "index.js",
|
||||
"repository": "git://github.com/isaacs/node-lru-cache.git",
|
||||
"devDependencies": {
|
||||
"benchmark": "^2.1.4",
|
||||
"tap": "^12.1.0"
|
||||
},
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"yallist": "^3.0.2"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
]
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
import index from './index.js';
|
||||
|
||||
const { transform, transformStyleAttribute, bundle, bundleAsync, browserslistToTargets, composeVisitors, Features } = index;
|
||||
export { transform, transformStyleAttribute, bundle, bundleAsync, browserslistToTargets, composeVisitors, Features };
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _rewriteStackTrace = require("./rewrite-stack-trace.js");
|
||||
class ConfigError extends Error {
|
||||
constructor(message, filename) {
|
||||
super(message);
|
||||
(0, _rewriteStackTrace.expectedError)(this);
|
||||
if (filename) (0, _rewriteStackTrace.injectVirtualStackFrame)(this, filename);
|
||||
}
|
||||
}
|
||||
exports.default = ConfigError;
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=config-error.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"names":["_findSuggestion","require","OptionValidator","constructor","descriptor","validateTopLevelOptions","options","TopLevelOptionShape","validOptionNames","Object","keys","option","includes","Error","formatMessage","findSuggestion","validateBooleanOption","name","value","defaultValue","undefined","invariant","validateStringOption","condition","message","exports"],"sources":["../src/validator.ts"],"sourcesContent":["import { findSuggestion } from \"./find-suggestion.ts\";\n\nexport class OptionValidator {\n declare descriptor: string;\n constructor(descriptor: string) {\n this.descriptor = descriptor;\n }\n\n /**\n * Validate if the given `options` follow the name of keys defined in the `TopLevelOptionShape`\n *\n * @param {Object} options\n * @param {Object} TopLevelOptionShape\n * An object with all the valid key names that `options` should be allowed to have\n * The property values of `TopLevelOptionShape` can be arbitrary\n * @memberof OptionValidator\n */\n validateTopLevelOptions(options: object, TopLevelOptionShape: object): void {\n const validOptionNames = Object.keys(TopLevelOptionShape);\n for (const option of Object.keys(options)) {\n if (!validOptionNames.includes(option)) {\n throw new Error(\n this.formatMessage(`'${option}' is not a valid top-level option.\n- Did you mean '${findSuggestion(option, validOptionNames)}'?`),\n );\n }\n }\n }\n\n // note: we do not consider rewrite them to high order functions\n // until we have to support `validateNumberOption`.\n validateBooleanOption<T extends boolean>(\n name: string,\n value?: boolean,\n defaultValue?: T,\n ): boolean | T {\n if (value === undefined) {\n return defaultValue;\n } else {\n this.invariant(\n typeof value === \"boolean\",\n `'${name}' option must be a boolean.`,\n );\n }\n return value;\n }\n\n validateStringOption<T extends string>(\n name: string,\n value?: string,\n defaultValue?: T,\n ): string | T {\n if (value === undefined) {\n return defaultValue;\n } else {\n this.invariant(\n typeof value === \"string\",\n `'${name}' option must be a string.`,\n );\n }\n return value;\n }\n /**\n * A helper interface copied from the `invariant` npm package.\n * It throws given `message` when `condition` is not met\n *\n * @param {boolean} condition\n * @param {string} message\n * @memberof OptionValidator\n */\n invariant(condition: boolean, message: string): void {\n if (!condition) {\n throw new Error(this.formatMessage(message));\n }\n }\n\n formatMessage(message: string): string {\n return `${this.descriptor}: ${message}`;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAEO,MAAMC,eAAe,CAAC;EAE3BC,WAAWA,CAACC,UAAkB,EAAE;IAC9B,IAAI,CAACA,UAAU,GAAGA,UAAU;EAC9B;EAWAC,uBAAuBA,CAACC,OAAe,EAAEC,mBAA2B,EAAQ;IAC1E,MAAMC,gBAAgB,GAAGC,MAAM,CAACC,IAAI,CAACH,mBAAmB,CAAC;IACzD,KAAK,MAAMI,MAAM,IAAIF,MAAM,CAACC,IAAI,CAACJ,OAAO,CAAC,EAAE;MACzC,IAAI,CAACE,gBAAgB,CAACI,QAAQ,CAACD,MAAM,CAAC,EAAE;QACtC,MAAM,IAAIE,KAAK,CACb,IAAI,CAACC,aAAa,CAAC,IAAIH,MAAM;AACvC,kBAAkB,IAAAI,8BAAc,EAACJ,MAAM,EAAEH,gBAAgB,CAAC,IAAI,CACtD,CAAC;MACH;IACF;EACF;EAIAQ,qBAAqBA,CACnBC,IAAY,EACZC,KAAe,EACfC,YAAgB,EACH;IACb,IAAID,KAAK,KAAKE,SAAS,EAAE;MACvB,OAAOD,YAAY;IACrB,CAAC,MAAM;MACL,IAAI,CAACE,SAAS,CACZ,OAAOH,KAAK,KAAK,SAAS,EAC1B,IAAID,IAAI,6BACV,CAAC;IACH;IACA,OAAOC,KAAK;EACd;EAEAI,oBAAoBA,CAClBL,IAAY,EACZC,KAAc,EACdC,YAAgB,EACJ;IACZ,IAAID,KAAK,KAAKE,SAAS,EAAE;MACvB,OAAOD,YAAY;IACrB,CAAC,MAAM;MACL,IAAI,CAACE,SAAS,CACZ,OAAOH,KAAK,KAAK,QAAQ,EACzB,IAAID,IAAI,4BACV,CAAC;IACH;IACA,OAAOC,KAAK;EACd;EASAG,SAASA,CAACE,SAAkB,EAAEC,OAAe,EAAQ;IACnD,IAAI,CAACD,SAAS,EAAE;MACd,MAAM,IAAIV,KAAK,CAAC,IAAI,CAACC,aAAa,CAACU,OAAO,CAAC,CAAC;IAC9C;EACF;EAEAV,aAAaA,CAACU,OAAe,EAAU;IACrC,OAAO,GAAG,IAAI,CAACpB,UAAU,KAAKoB,OAAO,EAAE;EACzC;AACF;AAACC,OAAA,CAAAvB,eAAA,GAAAA,eAAA","ignoreList":[]}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _classPrivateFieldSet2;
|
||||
var _assertClassBrand = require("./assertClassBrand.js");
|
||||
function _classPrivateFieldSet2(privateMap, receiver, value) {
|
||||
privateMap.set((0, _assertClassBrand.default)(privateMap, receiver), value);
|
||||
return value;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=classPrivateFieldSet2.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={A:{A:{"2":"K D E F A B xC"},B:{"1":"G N O P","33":"C L M","129":"3 4 5 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","161":"0 1 2 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"},C:{"1":"0 1 2 3 4 5 uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC zC 0C","2":"6 7 8 9 yC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB 1C 2C"},D:{"129":"3 4 5 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC","161":"0 1 2 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},E:{"2":"3C","129":"PC BD QC eC fC gC hC iC CD RC jC kC lC mC nC DD SC oC pC qC rC sC tC uC ED FD","388":"ZB K D E F A B C L M G 4C 5C 6C 7C bC NC OC 8C 9C AD cC dC","420":"J aC"},F:{"2":"F B C GD HD ID JD NC vC KD OC","129":"0 1 2 3 4 5 p q r s t u v w x y z","161":"6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o"},G:{"129":"PC fD QC eC fC gC hC iC gD RC jC kC lC mC nC hD SC oC pC qC rC sC tC uC","388":"E aC LD wC MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD cC dC"},H:{"2":"iD"},I:{"16":"TC jD kD lD","129":"I","161":"J mD wC nD oD"},J:{"161":"D A"},K:{"16":"A B C NC vC OC","129":"H"},L:{"129":"I"},M:{"1":"MC"},N:{"2":"A B"},O:{"161":"PC"},P:{"1":"BB CB DB EB FB","161":"6 7 8 9 J AB pD qD rD sD tD bC uD vD wD xD yD QC RC SC zD"},Q:{"161":"0D"},R:{"161":"1D"},S:{"1":"2D 3D"}},B:7,C:"Background-clip: text",D:true};
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
presets: [
|
||||
["env", { targets: { node: "current" }}],
|
||||
],
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={C:{"45":0.01257,"115":0.08486,"121":0.03143,"127":0.01257,"128":0.00629,"137":0.00314,"138":0.00314,"140":0.00629,"141":0.00314,"142":0.00943,"143":0.90518,"144":0.48402,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 122 123 124 125 126 129 130 131 132 133 134 135 136 139 145 146 147 3.5 3.6"},D:{"40":0.00314,"41":0.00314,"42":0.00314,"43":0.00314,"44":0.00314,"45":0.00629,"46":0.00629,"48":0.00314,"49":0.00943,"50":0.00629,"52":0.00943,"53":0.00943,"54":0.00629,"55":0.00943,"56":0.00314,"57":0.00314,"58":0.00629,"59":0.00314,"60":0.00314,"63":0.00629,"70":0.00314,"73":0.00314,"76":0.00314,"79":0.00629,"83":0.00314,"84":0.00314,"86":0.022,"87":0.00629,"93":0.00629,"94":0.03143,"97":0.01257,"98":0.00629,"100":0.09115,"103":0.01886,"105":0.00629,"109":0.34573,"110":0.00629,"111":0.01886,"113":0.00314,"114":0.00314,"116":0.022,"118":0.022,"119":0.022,"120":0.01257,"121":0.00314,"122":0.04086,"124":0.05029,"125":2.51754,"126":0.01886,"127":0.03143,"128":0.05343,"129":0.00629,"130":0.00943,"131":0.11943,"132":0.00943,"133":0.04086,"134":0.04086,"135":0.044,"136":0.06915,"137":0.07543,"138":0.34259,"139":0.2703,"140":3.86589,"141":6.29229,"142":0.09743,"143":0.02829,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 47 51 61 62 64 65 66 67 68 69 71 72 74 75 77 78 80 81 85 88 89 90 91 92 95 96 99 101 102 104 106 107 108 112 115 117 123 144 145"},F:{"46":0.00629,"82":0.00314,"88":0.00629,"90":0.04086,"91":0.00314,"92":0.00943,"95":0.00314,"118":0.00314,"120":0.03772,"121":0.022,"122":0.21058,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 89 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"14":0.00629,"17":0.00314,"18":0.03772,"90":0.00629,"92":0.02829,"108":0.00629,"109":0.00314,"112":0.00314,"114":0.00314,"117":0.01257,"122":0.02514,"124":0.00314,"125":0.00314,"128":0.00629,"129":0.00314,"130":0.00314,"131":0.00314,"132":0.01886,"133":0.01257,"134":0.01886,"135":0.05972,"136":0.02514,"137":0.00629,"138":0.022,"139":0.01886,"140":0.44002,"141":2.94499,"142":0.022,_:"12 13 15 16 79 80 81 83 84 85 86 87 88 89 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 110 111 113 115 116 118 119 120 121 123 126 127"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 17.0 17.3 17.4 18.0 18.1 18.2 26.1 26.2","13.1":0.00629,"15.6":0.00314,"16.4":0.00314,"16.5":0.00314,"16.6":0.01257,"17.1":0.00314,"17.2":0.00314,"17.5":0.00314,"17.6":0.022,"18.3":0.00314,"18.4":0.00629,"18.5-18.6":0.022,"26.0":0.39916},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00047,"5.0-5.1":0,"6.0-6.1":0.00188,"7.0-7.1":0.00141,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00423,"10.0-10.2":0.00047,"10.3":0.00798,"11.0-11.2":0.11837,"11.3-11.4":0.00282,"12.0-12.1":0.00094,"12.2-12.5":0.02302,"13.0-13.1":0,"13.2":0.00235,"13.3":0.00094,"13.4-13.7":0.00376,"14.0-14.4":0.00798,"14.5-14.8":0.00845,"15.0-15.1":0.00798,"15.2-15.3":0.00611,"15.4":0.00705,"15.5":0.00798,"15.6-15.8":0.10427,"16.0":0.01409,"16.1":0.0263,"16.2":0.01362,"16.3":0.02442,"16.4":0.00611,"16.5":0.0108,"16.6-16.7":0.1395,"17.0":0.00986,"17.1":0.01503,"17.2":0.0108,"17.3":0.01597,"17.4":0.02818,"17.5":0.04838,"17.6-17.7":0.12212,"18.0":0.02771,"18.1":0.0573,"18.2":0.031,"18.3":0.09958,"18.4":0.0512,"18.5-18.6":2.61062,"26.0":0.32269,"26.1":0.01174},P:{"4":0.01025,"21":0.0205,"22":0.03074,"23":0.14347,"24":0.05124,"25":0.0205,"26":0.12297,"27":0.31768,"28":2.29551,"29":0.40991,_:"20 6.2-6.4 8.2 10.1 12.0 13.0 14.0 15.0 18.0","5.0-5.4":0.01025,"7.2-7.4":0.18446,"9.2":0.01025,"11.1-11.2":0.04099,"16.0":0.01025,"17.0":0.04099,"19.0":0.01025},I:{"0":0.29444,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00006,"4.4":0,"4.4.3-4.4.4":0.00015},K:{"0":0.98427,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00629,_:"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.41828},Q:{"14.9":0.02743},O:{"0":0.38399},H:{"0":0.01},L:{"0":67.73755}};
|
||||
|
|
@ -1,135 +0,0 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.cjs"));
|
||||
const error = () => {
|
||||
const Sizable = {
|
||||
string: { unit: "caratteri", verb: "avere" },
|
||||
file: { unit: "byte", verb: "avere" },
|
||||
array: { unit: "elementi", verb: "avere" },
|
||||
set: { unit: "elementi", verb: "avere" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const FormatDictionary = {
|
||||
regex: "input",
|
||||
email: "indirizzo email",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "data e ora ISO",
|
||||
date: "data ISO",
|
||||
time: "ora ISO",
|
||||
duration: "durata ISO",
|
||||
ipv4: "indirizzo IPv4",
|
||||
ipv6: "indirizzo IPv6",
|
||||
cidrv4: "intervallo IPv4",
|
||||
cidrv6: "intervallo IPv6",
|
||||
base64: "stringa codificata in base64",
|
||||
base64url: "URL codificata in base64",
|
||||
json_string: "stringa JSON",
|
||||
e164: "numero E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "input",
|
||||
};
|
||||
const TypeDictionary = {
|
||||
nan: "NaN",
|
||||
number: "numero",
|
||||
array: "vettore",
|
||||
};
|
||||
return (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type": {
|
||||
const expected = TypeDictionary[issue.expected] ?? issue.expected;
|
||||
const receivedType = util.parsedType(issue.input);
|
||||
const received = TypeDictionary[receivedType] ?? receivedType;
|
||||
if (/^[A-Z]/.test(issue.expected)) {
|
||||
return `Input non valido: atteso instanceof ${issue.expected}, ricevuto ${received}`;
|
||||
}
|
||||
return `Input non valido: atteso ${expected}, ricevuto ${received}`;
|
||||
}
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Input non valido: atteso ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Opzione non valida: atteso uno tra ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Troppo grande: ${issue.origin ?? "valore"} deve avere ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementi"}`;
|
||||
return `Troppo grande: ${issue.origin ?? "valore"} deve essere ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Troppo piccolo: ${issue.origin} deve avere ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Troppo piccolo: ${issue.origin} deve essere ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Stringa non valida: deve iniziare con "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Stringa non valida: deve terminare con "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Stringa non valida: deve includere "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Stringa non valida: deve corrispondere al pattern ${_issue.pattern}`;
|
||||
return `Input non valido: ${FormatDictionary[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Numero non valido: deve essere un multiplo di ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Chiav${issue.keys.length > 1 ? "i" : "e"} non riconosciut${issue.keys.length > 1 ? "e" : "a"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Chiave non valida in ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Input non valido";
|
||||
case "invalid_element":
|
||||
return `Valore non valido in ${issue.origin}`;
|
||||
default:
|
||||
return `Input non valido`;
|
||||
}
|
||||
};
|
||||
};
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error(),
|
||||
};
|
||||
}
|
||||
module.exports = exports.default;
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={C:{"2":0.00105,"4":0.01054,"43":0.00105,"64":0.00105,"87":0.00105,"115":0.03794,"135":0.00316,"136":0.00105,"140":0.00949,"141":0.00949,"142":0.01159,"143":0.27826,"144":0.23399,_:"3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 137 138 139 145 146 147 3.5 3.6"},D:{"40":0.00211,"41":0.00105,"44":0.00105,"45":0.00211,"48":0.00211,"51":0.00105,"53":0.00316,"56":0.00105,"57":0.00211,"58":0.00105,"59":0.00105,"60":0.00105,"63":0.00422,"64":0.00105,"67":0.00316,"69":0.00422,"73":0.00105,"75":0.00211,"79":0.04427,"81":0.00316,"83":0.00316,"86":0.00211,"87":0.00105,"88":0.00211,"90":0.00211,"94":0.01792,"96":0.00105,"98":0.0274,"100":0.00211,"103":0.01265,"108":0.00422,"109":0.2108,"111":0.01897,"114":0.00738,"116":0.04321,"119":0.02951,"120":0.01265,"121":0.00105,"122":0.00949,"123":0.00422,"124":0.00211,"125":0.11805,"128":0.02319,"129":0.00105,"131":0.00211,"132":0.00211,"133":0.02003,"134":0.00738,"135":0.00738,"136":0.02319,"137":0.02846,"138":0.11278,"139":0.08537,"140":0.73358,"141":1.59259,"142":0.01159,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 42 43 46 47 49 50 52 54 55 61 62 65 66 68 70 71 72 74 76 77 78 80 84 85 89 91 92 93 95 97 99 101 102 104 105 106 107 110 112 113 115 117 118 126 127 130 143 144 145"},F:{"50":0.00211,"91":0.00105,"95":0.00211,"112":0.00316,"113":0.01159,"120":0.03057,"122":0.1054,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 114 115 116 117 118 119 121 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.00105,"13":0.00211,"14":0.01054,"16":0.00843,"18":0.00738,"90":0.00738,"92":0.01581,"100":0.00738,"109":0.00738,"114":0.04005,"117":0.00738,"120":0.04111,"121":0.00211,"122":0.01054,"124":0.00316,"126":0.00105,"127":0.00316,"130":0.00105,"131":0.02846,"132":0.00105,"133":0.01054,"134":0.01265,"135":0.00211,"136":0.00632,"137":0.00422,"138":0.07378,"139":0.02213,"140":0.46481,"141":2.10062,_:"15 17 79 80 81 83 84 85 86 87 88 89 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 115 116 118 119 123 125 128 129 142"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 6.1 7.1 9.1 10.1 13.1 15.1 15.4 15.5 16.0 16.1 16.2 16.3 16.4 17.0 17.1 17.2 17.3 17.4 17.5 18.2 18.3 18.4 26.2","5.1":0.00211,"11.1":0.00527,"12.1":0.00105,"14.1":0.00105,"15.2-15.3":0.00105,"15.6":0.05165,"16.5":0.00105,"16.6":0.00211,"17.6":0.00738,"18.0":0.0137,"18.1":0.00738,"18.5-18.6":0.03267,"26.0":0.04848,"26.1":0.00211},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00026,"5.0-5.1":0,"6.0-6.1":0.00103,"7.0-7.1":0.00077,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00232,"10.0-10.2":0.00026,"10.3":0.00438,"11.0-11.2":0.06493,"11.3-11.4":0.00155,"12.0-12.1":0.00052,"12.2-12.5":0.01263,"13.0-13.1":0,"13.2":0.00129,"13.3":0.00052,"13.4-13.7":0.00206,"14.0-14.4":0.00438,"14.5-14.8":0.00464,"15.0-15.1":0.00438,"15.2-15.3":0.00335,"15.4":0.00387,"15.5":0.00438,"15.6-15.8":0.0572,"16.0":0.00773,"16.1":0.01443,"16.2":0.00747,"16.3":0.0134,"16.4":0.00335,"16.5":0.00593,"16.6-16.7":0.07653,"17.0":0.00541,"17.1":0.00825,"17.2":0.00593,"17.3":0.00876,"17.4":0.01546,"17.5":0.02654,"17.6-17.7":0.067,"18.0":0.0152,"18.1":0.03144,"18.2":0.01701,"18.3":0.05463,"18.4":0.02809,"18.5-18.6":1.43215,"26.0":0.17702,"26.1":0.00644},P:{"4":0.03079,"25":0.03079,"27":0.25657,"28":0.61576,"29":0.07184,_:"20 21 22 23 24 26 5.0-5.4 8.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","6.2-6.4":0.01026,"7.2-7.4":0.02053,"9.2":0.01026},I:{"0":0.00893,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":1.09048,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00105,_:"6 7 8 9 10 5.5"},S:{"2.5":0.03579,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.03579},Q:{_:"14.9"},O:{"0":0.14315},H:{"0":0.01},L:{"0":87.6971}};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
module.exports={A:{A:{"2":"K D E F A B xC"},B:{"1":"0 1 2 3 4 5 n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m"},C:{"2":"0 1 2 3 4 5 6 7 8 9 yC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC zC 0C 1C 2C"},D:{"1":"0 1 2 3 4 5 n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m"},E:{"2":"J ZB K D E F A B C L M G 3C aC 4C 5C 6C 7C bC NC OC 8C 9C AD cC dC PC BD QC eC fC gC hC iC CD RC jC kC lC mC nC DD SC oC pC qC rC sC tC uC ED FD"},F:{"1":"0 1 2 3 4 5 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":"6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y GD HD ID JD NC vC KD OC"},G:{"2":"E aC LD wC MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD cC dC PC fD QC eC fC gC hC iC gD RC jC kC lC mC nC hD SC oC pC qC rC sC tC uC"},H:{"2":"iD"},I:{"1":"I","2":"TC J jD kD lD mD wC nD oD"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC vC OC"},L:{"1":"I"},M:{"2":"MC"},N:{"2":"A B"},O:{"2":"PC"},P:{"2":"6 7 8 9 J AB BB CB DB EB FB pD qD rD sD tD bC uD vD wD xD yD QC RC SC zD"},Q:{"2":"0D"},R:{"2":"1D"},S:{"2":"2D 3D"}},B:7,C:"Subresource Loading with Web Bundles",D:false};
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={C:{"78":0.00929,"115":0.00929,"122":0.00929,"143":0.04645,"144":0.04645,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 145 146 147 3.5 3.6"},D:{"105":0.02787,"107":0.00929,"108":0.00929,"109":0.03716,"112":0.00929,"114":0.00929,"117":0.00929,"118":0.00929,"120":0.0929,"121":0.00929,"122":0.11148,"124":0.01858,"125":0.03716,"126":86.9544,"127":0.00929,"128":0.02787,"129":0.02787,"130":0.14864,"131":0.03716,"132":0.02787,"133":0.00929,"134":0.52953,"135":0.00929,"136":0.00929,"137":1.43995,"138":0.02787,"139":0.08361,"140":0.45521,"141":1.08693,"142":0.00929,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 106 110 111 113 115 116 119 123 143 144 145"},F:{"91":0.00929,"92":0.01858,"120":0.01858,"122":0.08361,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 121 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"121":0.08361,"139":0.00929,"140":0.05574,"141":0.22296,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 142"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.4 15.5 15.6 16.0 16.1 16.2 16.3 16.4 16.5 17.1 17.2 17.3 17.4 17.5 18.0 18.1 18.2 18.3 18.4 26.1 26.2","16.6":0.00929,"17.0":0.01858,"17.6":0.00929,"18.5-18.6":0.00929,"26.0":0.03716},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00013,"5.0-5.1":0,"6.0-6.1":0.00051,"7.0-7.1":0.00038,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00114,"10.0-10.2":0.00013,"10.3":0.00215,"11.0-11.2":0.03185,"11.3-11.4":0.00076,"12.0-12.1":0.00025,"12.2-12.5":0.00619,"13.0-13.1":0,"13.2":0.00063,"13.3":0.00025,"13.4-13.7":0.00101,"14.0-14.4":0.00215,"14.5-14.8":0.00227,"15.0-15.1":0.00215,"15.2-15.3":0.00164,"15.4":0.0019,"15.5":0.00215,"15.6-15.8":0.02806,"16.0":0.00379,"16.1":0.00708,"16.2":0.00367,"16.3":0.00657,"16.4":0.00164,"16.5":0.00291,"16.6-16.7":0.03753,"17.0":0.00265,"17.1":0.00404,"17.2":0.00291,"17.3":0.0043,"17.4":0.00758,"17.5":0.01302,"17.6-17.7":0.03286,"18.0":0.00746,"18.1":0.01542,"18.2":0.00834,"18.3":0.02679,"18.4":0.01378,"18.5-18.6":0.70242,"26.0":0.08682,"26.1":0.00316},P:{"28":0.25083,"29":0.02181,_:"4 20 21 22 23 24 25 26 27 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":1.84412,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00037,"4.4":0,"4.4.3-4.4.4":0.00092},K:{"0":0.12212,_:"10 11 12 11.1 11.5 12.1"},A:{"9":0.03252,"11":0.03252,_:"6 7 8 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.0781},Q:{"14.9":0.00497},O:{"0":0.02911},H:{"0":0},L:{"0":3.75837}};
|
||||
|
|
@ -1,153 +0,0 @@
|
|||
import type * as errors from "./errors.js";
|
||||
import type * as schemas from "./schemas.js";
|
||||
import type { Class } from "./util.js";
|
||||
////////////////////////////// CONSTRUCTORS ///////////////////////////////////////
|
||||
|
||||
type ZodTrait = { _zod: { def: any; [k: string]: any } };
|
||||
export interface $constructor<T extends ZodTrait, D = T["_zod"]["def"]> {
|
||||
new (def: D): T;
|
||||
init(inst: T, def: D): asserts inst is T;
|
||||
}
|
||||
|
||||
/** A special constant with type `never` */
|
||||
export const NEVER: never = /*@__PURE__*/ Object.freeze({
|
||||
status: "aborted",
|
||||
}) as never;
|
||||
|
||||
export /*@__NO_SIDE_EFFECTS__*/ function $constructor<T extends ZodTrait, D = T["_zod"]["def"]>(
|
||||
name: string,
|
||||
initializer: (inst: T, def: D) => void,
|
||||
params?: { Parent?: typeof Class }
|
||||
): $constructor<T, D> {
|
||||
function init(inst: T, def: D) {
|
||||
if (!inst._zod) {
|
||||
Object.defineProperty(inst, "_zod", {
|
||||
value: {
|
||||
def,
|
||||
constr: _,
|
||||
traits: new Set(),
|
||||
},
|
||||
enumerable: false,
|
||||
});
|
||||
}
|
||||
|
||||
if (inst._zod.traits.has(name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
inst._zod.traits.add(name);
|
||||
|
||||
initializer(inst, def);
|
||||
|
||||
// support prototype modifications
|
||||
const proto = _.prototype;
|
||||
const keys = Object.keys(proto);
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const k = keys[i]!;
|
||||
if (!(k in inst)) {
|
||||
(inst as any)[k] = proto[k].bind(inst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// doesn't work if Parent has a constructor with arguments
|
||||
const Parent = params?.Parent ?? Object;
|
||||
class Definition extends Parent {}
|
||||
Object.defineProperty(Definition, "name", { value: name });
|
||||
|
||||
function _(this: any, def: D) {
|
||||
const inst = params?.Parent ? new Definition() : this;
|
||||
init(inst, def);
|
||||
inst._zod.deferred ??= [];
|
||||
for (const fn of inst._zod.deferred) {
|
||||
fn();
|
||||
}
|
||||
return inst;
|
||||
}
|
||||
|
||||
Object.defineProperty(_, "init", { value: init });
|
||||
Object.defineProperty(_, Symbol.hasInstance, {
|
||||
value: (inst: any) => {
|
||||
if (params?.Parent && inst instanceof params.Parent) return true;
|
||||
return inst?._zod?.traits?.has(name);
|
||||
},
|
||||
});
|
||||
Object.defineProperty(_, "name", { value: name });
|
||||
return _ as any;
|
||||
}
|
||||
|
||||
////////////////////////////// UTILITIES ///////////////////////////////////////
|
||||
export const $brand: unique symbol = Symbol("zod_brand");
|
||||
export type $brand<T extends string | number | symbol = string | number | symbol> = {
|
||||
[$brand]: { [k in T]: true };
|
||||
};
|
||||
|
||||
export type $ZodBranded<
|
||||
T extends schemas.SomeType,
|
||||
Brand extends string | number | symbol,
|
||||
Dir extends "in" | "out" | "inout" = "out",
|
||||
> = T &
|
||||
(Dir extends "inout"
|
||||
? { _zod: { input: input<T> & $brand<Brand>; output: output<T> & $brand<Brand> } }
|
||||
: Dir extends "in"
|
||||
? { _zod: { input: input<T> & $brand<Brand> } }
|
||||
: { _zod: { output: output<T> & $brand<Brand> } });
|
||||
|
||||
export type $ZodNarrow<T extends schemas.SomeType, Out> = T & { _zod: { output: Out } };
|
||||
|
||||
export class $ZodAsyncError extends Error {
|
||||
constructor() {
|
||||
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
||||
}
|
||||
}
|
||||
|
||||
export class $ZodEncodeError extends Error {
|
||||
constructor(name: string) {
|
||||
super(`Encountered unidirectional transform during encode: ${name}`);
|
||||
this.name = "ZodEncodeError";
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////// TYPE HELPERS ///////////////////////////////////
|
||||
|
||||
// export type input<T extends schemas.$ZodType> = T["_zod"]["input"];
|
||||
// export type output<T extends schemas.$ZodType> = T["_zod"]["output"];
|
||||
// export type input<T extends schemas.$ZodType> = T["_zod"]["input"];
|
||||
// export type output<T extends schemas.$ZodType> = T["_zod"]["output"];
|
||||
export type input<T> = T extends { _zod: { input: any } } ? T["_zod"]["input"] : unknown;
|
||||
export type output<T> = T extends { _zod: { output: any } } ? T["_zod"]["output"] : unknown;
|
||||
|
||||
export type { output as infer };
|
||||
|
||||
////////////////////////////// CONFIG ///////////////////////////////////////
|
||||
|
||||
export interface $ZodConfig {
|
||||
/** Custom error map. Overrides `config().localeError`. */
|
||||
customError?: errors.$ZodErrorMap | undefined;
|
||||
/** Localized error map. Lowest priority. */
|
||||
localeError?: errors.$ZodErrorMap | undefined;
|
||||
/** Disable JIT schema compilation. Useful in environments that disallow `eval`. */
|
||||
jitless?: boolean | undefined;
|
||||
}
|
||||
|
||||
interface GlobalThisWithConfig {
|
||||
/**
|
||||
* The globalConfig instance shared across both CommonJS and ESM builds.
|
||||
* Attached to `globalThis` (mirroring `__zod_globalRegistry`) so that a
|
||||
* single config object is used regardless of how Zod is loaded — CJS,
|
||||
* ESM, multiple bundles in a monorepo, etc. This means `z.config(...)`
|
||||
* applied against any one instance is observed by all of them, and
|
||||
* pre-populating it before Zod loads (e.g. `globalThis.__zod_globalConfig
|
||||
* = { jitless: true }` in an inline script) takes effect immediately on
|
||||
* import.
|
||||
*/
|
||||
__zod_globalConfig?: $ZodConfig;
|
||||
}
|
||||
|
||||
(globalThis as GlobalThisWithConfig).__zod_globalConfig ??= {};
|
||||
export const globalConfig: $ZodConfig = (globalThis as GlobalThisWithConfig).__zod_globalConfig!;
|
||||
|
||||
export function config(newConfig?: Partial<$ZodConfig>): $ZodConfig {
|
||||
if (newConfig) Object.assign(globalConfig, newConfig);
|
||||
return globalConfig;
|
||||
}
|
||||
|
|
@ -1,137 +0,0 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.cjs"));
|
||||
const error = () => {
|
||||
const Sizable = {
|
||||
string: { unit: "ตัวอักษร", verb: "ควรมี" },
|
||||
file: { unit: "ไบต์", verb: "ควรมี" },
|
||||
array: { unit: "รายการ", verb: "ควรมี" },
|
||||
set: { unit: "รายการ", verb: "ควรมี" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const FormatDictionary = {
|
||||
regex: "ข้อมูลที่ป้อน",
|
||||
email: "ที่อยู่อีเมล",
|
||||
url: "URL",
|
||||
emoji: "อิโมจิ",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "วันที่เวลาแบบ ISO",
|
||||
date: "วันที่แบบ ISO",
|
||||
time: "เวลาแบบ ISO",
|
||||
duration: "ช่วงเวลาแบบ ISO",
|
||||
ipv4: "ที่อยู่ IPv4",
|
||||
ipv6: "ที่อยู่ IPv6",
|
||||
cidrv4: "ช่วง IP แบบ IPv4",
|
||||
cidrv6: "ช่วง IP แบบ IPv6",
|
||||
base64: "ข้อความแบบ Base64",
|
||||
base64url: "ข้อความแบบ Base64 สำหรับ URL",
|
||||
json_string: "ข้อความแบบ JSON",
|
||||
e164: "เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",
|
||||
jwt: "โทเคน JWT",
|
||||
template_literal: "ข้อมูลที่ป้อน",
|
||||
};
|
||||
const TypeDictionary = {
|
||||
nan: "NaN",
|
||||
number: "ตัวเลข",
|
||||
array: "อาร์เรย์ (Array)",
|
||||
null: "ไม่มีค่า (null)",
|
||||
};
|
||||
return (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type": {
|
||||
const expected = TypeDictionary[issue.expected] ?? issue.expected;
|
||||
const receivedType = util.parsedType(issue.input);
|
||||
const received = TypeDictionary[receivedType] ?? receivedType;
|
||||
if (/^[A-Z]/.test(issue.expected)) {
|
||||
return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${issue.expected} แต่ได้รับ ${received}`;
|
||||
}
|
||||
return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${expected} แต่ได้รับ ${received}`;
|
||||
}
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `ค่าไม่ถูกต้อง: ควรเป็น ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "ไม่เกิน" : "น้อยกว่า";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `เกินกำหนด: ${issue.origin ?? "ค่า"} ควรมี${adj} ${issue.maximum.toString()} ${sizing.unit ?? "รายการ"}`;
|
||||
return `เกินกำหนด: ${issue.origin ?? "ค่า"} ควรมี${adj} ${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? "อย่างน้อย" : "มากกว่า";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `น้อยกว่ากำหนด: ${issue.origin} ควรมี${adj} ${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `น้อยกว่ากำหนด: ${issue.origin} ควรมี${adj} ${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${_issue.prefix}"`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${_issue.includes}" อยู่ในข้อความ`;
|
||||
if (_issue.format === "regex")
|
||||
return `รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${_issue.pattern}`;
|
||||
return `รูปแบบไม่ถูกต้อง: ${FormatDictionary[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${issue.divisor} ได้ลงตัว`;
|
||||
case "unrecognized_keys":
|
||||
return `พบคีย์ที่ไม่รู้จัก: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `คีย์ไม่ถูกต้องใน ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";
|
||||
case "invalid_element":
|
||||
return `ข้อมูลไม่ถูกต้องใน ${issue.origin}`;
|
||||
default:
|
||||
return `ข้อมูลไม่ถูกต้อง`;
|
||||
}
|
||||
};
|
||||
};
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error(),
|
||||
};
|
||||
}
|
||||
module.exports = exports.default;
|
||||
|
|
@ -1,784 +0,0 @@
|
|||
// A simple implementation of make-array
|
||||
function makeArray (subject) {
|
||||
return Array.isArray(subject)
|
||||
? subject
|
||||
: [subject]
|
||||
}
|
||||
|
||||
const UNDEFINED = undefined
|
||||
const EMPTY = ''
|
||||
const SPACE = ' '
|
||||
const ESCAPE = '\\'
|
||||
const REGEX_TEST_BLANK_LINE = /^\s+$/
|
||||
const REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/
|
||||
const REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/
|
||||
const REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/
|
||||
const REGEX_SPLITALL_CRLF = /\r?\n/g
|
||||
|
||||
// Invalid:
|
||||
// - /foo,
|
||||
// - ./foo,
|
||||
// - ../foo,
|
||||
// - .
|
||||
// - ..
|
||||
// Valid:
|
||||
// - .foo
|
||||
const REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/
|
||||
|
||||
const REGEX_TEST_TRAILING_SLASH = /\/$/
|
||||
|
||||
const SLASH = '/'
|
||||
|
||||
// Do not use ternary expression here, since "istanbul ignore next" is buggy
|
||||
let TMP_KEY_IGNORE = 'node-ignore'
|
||||
/* istanbul ignore else */
|
||||
if (typeof Symbol !== 'undefined') {
|
||||
TMP_KEY_IGNORE = Symbol.for('node-ignore')
|
||||
}
|
||||
const KEY_IGNORE = TMP_KEY_IGNORE
|
||||
|
||||
const define = (object, key, value) => {
|
||||
Object.defineProperty(object, key, {value})
|
||||
return value
|
||||
}
|
||||
|
||||
const REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g
|
||||
|
||||
const RETURN_FALSE = () => false
|
||||
|
||||
// Sanitize the range of a regular expression
|
||||
// The cases are complicated, see test cases for details
|
||||
const sanitizeRange = range => range.replace(
|
||||
REGEX_REGEXP_RANGE,
|
||||
(match, from, to) => 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
|
||||
const cleanRangeBackSlash = slashes => {
|
||||
const {length} = slashes
|
||||
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 '`..`'
|
||||
const REPLACERS = [
|
||||
|
||||
[
|
||||
// Remove BOM
|
||||
// TODO:
|
||||
// Other similar zero-width characters?
|
||||
/^\uFEFF/,
|
||||
() => EMPTY
|
||||
],
|
||||
|
||||
// > Trailing spaces are ignored unless they are quoted with backslash ("\")
|
||||
[
|
||||
// (a\ ) -> (a )
|
||||
// (a ) -> (a)
|
||||
// (a ) -> (a)
|
||||
// (a \ ) -> (a )
|
||||
/((?:\\\\)*?)(\\?\s+)$/,
|
||||
(_, m1, m2) => m1 + (
|
||||
m2.indexOf('\\') === 0
|
||||
? SPACE
|
||||
: EMPTY
|
||||
)
|
||||
],
|
||||
|
||||
// Replace (\ ) with ' '
|
||||
// (\ ) -> ' '
|
||||
// (\\ ) -> '\\ '
|
||||
// (\\\ ) -> '\\ '
|
||||
[
|
||||
/(\\+?)\s/g,
|
||||
(_, m1) => {
|
||||
const {length} = m1
|
||||
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,
|
||||
match => `\\${match}`
|
||||
],
|
||||
|
||||
[
|
||||
// > a question mark (?) matches a single character
|
||||
/(?!\\)\?/g,
|
||||
() => '[^/]'
|
||||
],
|
||||
|
||||
// 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
|
||||
/^\//,
|
||||
() => '^'
|
||||
],
|
||||
|
||||
// replace special metacharacter slash after the leading slash
|
||||
[
|
||||
/\//g,
|
||||
() => '\\/'
|
||||
],
|
||||
|
||||
[
|
||||
// > 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'
|
||||
() => '^(?:.*\\/)?'
|
||||
],
|
||||
|
||||
// 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 `'/**'`
|
||||
(_, index, str) => 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'
|
||||
(_, 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.
|
||||
const 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,
|
||||
() => ESCAPE
|
||||
],
|
||||
|
||||
[
|
||||
// '\\\\' -> '\\'
|
||||
/\\\\/g,
|
||||
() => 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,
|
||||
(match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE
|
||||
// '\\[bar]' -> '\\\\[bar\\]'
|
||||
? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}`
|
||||
: close === ']'
|
||||
? endEscape.length % 2 === 0
|
||||
// A normal case, and it is a range notation
|
||||
// '[bar]'
|
||||
// '[bar\\\\]'
|
||||
? `[${sanitizeRange(range)}${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/'
|
||||
match => /\/$/.test(match)
|
||||
// foo/ will not match 'foo'
|
||||
? `${match}$`
|
||||
// foo matches 'foo' and 'foo/'
|
||||
: `${match}(?=$|\\/$)`
|
||||
]
|
||||
]
|
||||
|
||||
const REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\\\*$/
|
||||
const MODE_IGNORE = 'regex'
|
||||
const MODE_CHECK_IGNORE = 'checkRegex'
|
||||
const UNDERSCORE = '_'
|
||||
|
||||
const TRAILING_WILD_CARD_REPLACERS = {
|
||||
[MODE_IGNORE] (_, p1) {
|
||||
const prefix = p1
|
||||
// '\^':
|
||||
// '/*' does not match EMPTY
|
||||
// '/*' does not match everything
|
||||
|
||||
// '\\\/':
|
||||
// 'abc/*' does not match 'abc/'
|
||||
? `${p1}[^/]+`
|
||||
|
||||
// 'a*' matches 'a'
|
||||
// 'a*' matches 'aa'
|
||||
: '[^/]*'
|
||||
|
||||
return `${prefix}(?=$|\\/$)`
|
||||
},
|
||||
|
||||
[MODE_CHECK_IGNORE] (_, p1) {
|
||||
// When doing `git check-ignore`
|
||||
const prefix = p1
|
||||
// '\\\/':
|
||||
// 'abc/*' DOES match 'abc/' !
|
||||
? `${p1}[^/]*`
|
||||
|
||||
// 'a*' matches 'a'
|
||||
// 'a*' matches 'aa'
|
||||
: '[^/]*'
|
||||
|
||||
return `${prefix}(?=$|\\/$)`
|
||||
}
|
||||
}
|
||||
|
||||
// @param {pattern}
|
||||
const makeRegexPrefix = pattern => REPLACERS.reduce(
|
||||
(prev, [matcher, replacer]) =>
|
||||
prev.replace(matcher, replacer.bind(pattern)),
|
||||
pattern
|
||||
)
|
||||
|
||||
const isString = subject => typeof subject === 'string'
|
||||
|
||||
// > A blank line matches no files, so it can serve as a separator for readability.
|
||||
const checkPattern = pattern => 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
|
||||
|
||||
const splitPattern = pattern => pattern
|
||||
.split(REGEX_SPLITALL_CRLF)
|
||||
.filter(Boolean)
|
||||
|
||||
class IgnoreRule {
|
||||
constructor (
|
||||
pattern,
|
||||
mark,
|
||||
body,
|
||||
ignoreCase,
|
||||
negative,
|
||||
prefix
|
||||
) {
|
||||
this.pattern = pattern
|
||||
this.mark = mark
|
||||
this.negative = negative
|
||||
|
||||
define(this, 'body', body)
|
||||
define(this, 'ignoreCase', ignoreCase)
|
||||
define(this, 'regexPrefix', prefix)
|
||||
}
|
||||
|
||||
get regex () {
|
||||
const key = UNDERSCORE + MODE_IGNORE
|
||||
|
||||
if (this[key]) {
|
||||
return this[key]
|
||||
}
|
||||
|
||||
return this._make(MODE_IGNORE, key)
|
||||
}
|
||||
|
||||
get checkRegex () {
|
||||
const key = UNDERSCORE + MODE_CHECK_IGNORE
|
||||
|
||||
if (this[key]) {
|
||||
return this[key]
|
||||
}
|
||||
|
||||
return this._make(MODE_CHECK_IGNORE, key)
|
||||
}
|
||||
|
||||
_make (mode, key) {
|
||||
const str = this.regexPrefix.replace(
|
||||
REGEX_REPLACE_TRAILING_WILDCARD,
|
||||
|
||||
// It does not need to bind pattern
|
||||
TRAILING_WILD_CARD_REPLACERS[mode]
|
||||
)
|
||||
|
||||
const regex = this.ignoreCase
|
||||
? new RegExp(str, 'i')
|
||||
: new RegExp(str)
|
||||
|
||||
return define(this, key, regex)
|
||||
}
|
||||
}
|
||||
|
||||
const createRule = ({
|
||||
pattern,
|
||||
mark
|
||||
}, ignoreCase) => {
|
||||
let negative = false
|
||||
let 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, '#')
|
||||
|
||||
const regexPrefix = makeRegexPrefix(body)
|
||||
|
||||
return new IgnoreRule(
|
||||
pattern,
|
||||
mark,
|
||||
body,
|
||||
ignoreCase,
|
||||
negative,
|
||||
regexPrefix
|
||||
)
|
||||
}
|
||||
|
||||
class RuleManager {
|
||||
constructor (ignoreCase) {
|
||||
this._ignoreCase = ignoreCase
|
||||
this._rules = []
|
||||
}
|
||||
|
||||
_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
|
||||
}
|
||||
}
|
||||
|
||||
if (checkPattern(pattern.pattern)) {
|
||||
const rule = createRule(pattern, this._ignoreCase)
|
||||
this._added = true
|
||||
this._rules.push(rule)
|
||||
}
|
||||
}
|
||||
|
||||
// @param {Array<string> | string | Ignore} pattern
|
||||
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
|
||||
test (path, checkUnignored, mode) {
|
||||
let ignored = false
|
||||
let unignored = false
|
||||
let matchedRule
|
||||
|
||||
this._rules.forEach(rule => {
|
||||
const {negative} = rule
|
||||
|
||||
// | 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
|
||||
}
|
||||
|
||||
const matched = rule[mode].test(path)
|
||||
|
||||
if (!matched) {
|
||||
return
|
||||
}
|
||||
|
||||
ignored = !negative
|
||||
unignored = negative
|
||||
|
||||
matchedRule = negative
|
||||
? UNDEFINED
|
||||
: rule
|
||||
})
|
||||
|
||||
const ret = {
|
||||
ignored,
|
||||
unignored
|
||||
}
|
||||
|
||||
if (matchedRule) {
|
||||
ret.rule = matchedRule
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
}
|
||||
|
||||
const throwError = (message, Ctor) => {
|
||||
throw new Ctor(message)
|
||||
}
|
||||
|
||||
const checkPath = (path, originalPath, doThrow) => {
|
||||
if (!isString(path)) {
|
||||
return doThrow(
|
||||
`path must be a string, but got \`${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)) {
|
||||
const r = '`path.relative()`d'
|
||||
return doThrow(
|
||||
`path should be a ${r} string, but got "${originalPath}"`,
|
||||
RangeError
|
||||
)
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
const isNotRelative = path => REGEX_TEST_INVALID_PATH.test(path)
|
||||
|
||||
checkPath.isNotRelative = isNotRelative
|
||||
|
||||
// On windows, the following function will be replaced
|
||||
/* istanbul ignore next */
|
||||
checkPath.convert = p => p
|
||||
|
||||
|
||||
class Ignore {
|
||||
constructor ({
|
||||
ignorecase = true,
|
||||
ignoreCase = ignorecase,
|
||||
allowRelativePaths = false
|
||||
} = {}) {
|
||||
define(this, KEY_IGNORE, true)
|
||||
|
||||
this._rules = new RuleManager(ignoreCase)
|
||||
this._strictPathCheck = !allowRelativePaths
|
||||
this._initCache()
|
||||
}
|
||||
|
||||
_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)
|
||||
}
|
||||
|
||||
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
|
||||
addPattern (pattern) {
|
||||
return this.add(pattern)
|
||||
}
|
||||
|
||||
// @returns {TestResult}
|
||||
_test (originalPath, cache, checkUnignored, slices) {
|
||||
const path = originalPath
|
||||
// Supports nullable path
|
||||
&& checkPath.convert(originalPath)
|
||||
|
||||
checkPath(
|
||||
path,
|
||||
originalPath,
|
||||
this._strictPathCheck
|
||||
? throwError
|
||||
: RETURN_FALSE
|
||||
)
|
||||
|
||||
return this._t(path, cache, checkUnignored, slices)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
const slices = path.split(SLASH).filter(Boolean)
|
||||
slices.pop()
|
||||
|
||||
if (slices.length) {
|
||||
const 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)
|
||||
}
|
||||
|
||||
_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)
|
||||
}
|
||||
|
||||
const 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)
|
||||
}
|
||||
|
||||
ignores (path) {
|
||||
return this._test(path, this._ignoreCache, false).ignored
|
||||
}
|
||||
|
||||
createFilter () {
|
||||
return path => !this.ignores(path)
|
||||
}
|
||||
|
||||
filter (paths) {
|
||||
return makeArray(paths).filter(this.createFilter())
|
||||
}
|
||||
|
||||
// @returns {TestResult}
|
||||
test (path) {
|
||||
return this._test(path, this._testCache, true)
|
||||
}
|
||||
}
|
||||
|
||||
const factory = options => new Ignore(options)
|
||||
|
||||
const isPathValid = path =>
|
||||
checkPath(path && checkPath.convert(path), path, RETURN_FALSE)
|
||||
|
||||
/* istanbul ignore next */
|
||||
const setupWindows = () => {
|
||||
/* eslint no-control-regex: "off" */
|
||||
const makePosix = str => /^\\\\\?\\/.test(str)
|
||||
|| /["<>|\u0000-\u001F]+/u.test(str)
|
||||
? str
|
||||
: str.replace(/\\/g, '/')
|
||||
|
||||
checkPath.convert = makePosix
|
||||
|
||||
// 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/'
|
||||
// 'd:\\foo'
|
||||
const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i
|
||||
checkPath.isNotRelative = path =>
|
||||
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)
|
||||
|
|
@ -1 +0,0 @@
|
|||
export let nanoid=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e<63?"_":"-"),"");
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={A:{D:{"1":"0 1 2 3 4 5 tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB"},L:{"1":"I"},B:{"1":"0 1 2 3 4 5 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC zC 0C","2":"yC TC J ZB K D E F 1C 2C","33":"6 7 8 9 A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB"},M:{"1":"MC"},A:{"2":"K D E F A B xC"},F:{"1":"0 1 2 3 4 5 gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB GD HD ID JD NC vC KD OC"},K:{"1":"H","2":"A B C NC vC OC"},E:{"1":"B C L M G NC OC 8C 9C AD cC dC PC BD QC eC fC gC hC iC CD RC jC kC lC mC nC DD SC oC pC qC rC sC tC uC ED","2":"J ZB 3C aC 4C FD","33":"K D E F A 5C 6C 7C bC"},G:{"1":"UD VD WD XD YD ZD aD bD cD dD eD cC dC PC fD QC eC fC gC hC iC gD RC jC kC lC mC nC hD SC oC pC qC rC sC tC uC","2":"aC LD wC MD","33":"E ND OD PD QD RD SD TD"},P:{"1":"6 7 8 9 AB BB CB DB EB FB pD qD rD sD tD bC uD vD wD xD yD QC RC SC zD","2":"J"},I:{"1":"I","2":"TC J jD kD lD mD wC nD oD"}},B:6,C:"plaintext from unicode-bidi",D:undefined};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,10 +0,0 @@
|
|||
declare function setToStringTag(
|
||||
object: object & { [Symbol.toStringTag]?: unknown },
|
||||
value: string | unknown,
|
||||
options?: {
|
||||
force?: boolean;
|
||||
nonConfigurable?: boolean;
|
||||
},
|
||||
): void;
|
||||
|
||||
export = setToStringTag;
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"names":["_index","require","isType","nodeType","targetType","ALIAS_KEYS","aliases","FLIPPED_ALIAS_KEYS","includes"],"sources":["../../src/validators/isType.ts"],"sourcesContent":["import { FLIPPED_ALIAS_KEYS, ALIAS_KEYS } from \"../definitions/index.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function isType<T extends t.Node[\"type\"]>(\n nodeType: string,\n targetType: T,\n): nodeType is T;\n\nexport default function isType(\n nodeType: string | null | undefined,\n targetType: string,\n): boolean;\n\n/**\n * Test if a `nodeType` is a `targetType` or if `targetType` is an alias of `nodeType`.\n */\nexport default function isType(nodeType: string, targetType: string): boolean {\n if (nodeType === targetType) return true;\n\n // If nodeType is nullish, it can't be an alias of targetType.\n if (nodeType == null) return false;\n\n // This is a fast-path. If the test above failed, but an alias key is found, then the\n // targetType was a primary node type, so there's no need to check the aliases.\n // @ts-expect-error targetType may not index ALIAS_KEYS\n if (ALIAS_KEYS[targetType]) return false;\n\n const aliases: Array<string> | undefined = FLIPPED_ALIAS_KEYS[targetType];\n if (aliases?.includes(nodeType)) return true;\n\n return false;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAgBe,SAASC,MAAMA,CAACC,QAAgB,EAAEC,UAAkB,EAAW;EAC5E,IAAID,QAAQ,KAAKC,UAAU,EAAE,OAAO,IAAI;EAGxC,IAAID,QAAQ,IAAI,IAAI,EAAE,OAAO,KAAK;EAKlC,IAAIE,iBAAU,CAACD,UAAU,CAAC,EAAE,OAAO,KAAK;EAExC,MAAME,OAAkC,GAAGC,yBAAkB,CAACH,UAAU,CAAC;EACzE,IAAIE,OAAO,YAAPA,OAAO,CAAEE,QAAQ,CAACL,QAAQ,CAAC,EAAE,OAAO,IAAI;EAE5C,OAAO,KAAK;AACd","ignoreList":[]}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
|
||||
export type UnevaluatedPropertiesError = ErrorObject<"unevaluatedProperties", {
|
||||
unevaluatedProperty: string;
|
||||
}, AnySchema>;
|
||||
declare const def: CodeKeywordDefinition;
|
||||
export default def;
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,15 +0,0 @@
|
|||
# Installation
|
||||
> `npm install --save @types/babel__generator`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for @babel/generator (https://github.com/babel/babel/tree/master/packages/babel-generator).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__generator.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Thu, 03 Apr 2025 16:02:41 GMT
|
||||
* Dependencies: [@babel/types](https://npmjs.com/package/@babel/types)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Troy Gerwien](https://github.com/yortus), [Melvin Groenhoff](https://github.com/mgroenhoff), [Cameron Yan](https://github.com/khell), and [Lyanbin](https://github.com/Lyanbin).
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={A:{A:{"1":"A B","2":"K D E F xC"},B:{"1":"0 1 2 3 4 5 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC zC 0C","2":"yC TC 1C 2C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC","2":"J"},E:{"1":"K D E F A B C L M G 5C 6C 7C bC NC OC 8C 9C AD cC dC PC BD QC eC fC gC hC iC CD RC jC kC lC mC nC DD SC oC pC qC rC sC tC uC ED FD","2":"J 3C aC","4":"ZB 4C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z vC KD OC","2":"F B GD HD ID JD NC"},G:{"1":"E MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD cC dC PC fD QC eC fC gC hC iC gD RC jC kC lC mC nC hD SC oC pC qC rC sC tC uC","2":"aC LD","4":"wC"},H:{"2":"iD"},I:{"1":"I kD lD wC nD oD","2":"TC J jD mD"},J:{"1":"D A"},K:{"1":"C H NC vC OC","2":"A B"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB pD qD rD sD tD bC uD vD wD xD yD QC RC SC zD"},Q:{"1":"0D"},R:{"1":"1D"},S:{"1":"2D 3D"}},B:1,C:"Session history management",D:true};
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
export const DEFAULT_CACHE_LOCATION = './.stylelintcache';
|
||||
export const CACHE_STRATEGY_METADATA = 'metadata';
|
||||
export const CACHE_STRATEGY_CONTENT = 'content';
|
||||
export const DEFAULT_CACHE_STRATEGY = CACHE_STRATEGY_METADATA;
|
||||
|
||||
export const DEFAULT_IGNORE_FILENAME = '.stylelintignore';
|
||||
|
||||
export const DEFAULT_SUPPRESSION_FILENAME = 'stylelint-suppressions.json';
|
||||
|
||||
export const DEFAULT_FORMATTER = 'string';
|
||||
|
||||
// NOTE: Partially based on `sysexits.h`.
|
||||
export const EXIT_CODE_SUCCESS = 0;
|
||||
export const EXIT_CODE_FATAL_ERROR = 1;
|
||||
export const EXIT_CODE_LINT_PROBLEM = 2;
|
||||
export const EXIT_CODE_INVALID_USAGE = 64;
|
||||
export const EXIT_CODE_INVALID_CONFIG = 78;
|
||||
|
||||
export const RULE_NAME_ALL = 'all';
|
||||
|
||||
export const SEVERITY_ERROR = 'error';
|
||||
export const SEVERITY_WARNING = 'warning';
|
||||
export const DEFAULT_SEVERITY = SEVERITY_ERROR;
|
||||
|
||||
export const DEFAULT_FIX_MODE = 'lax';
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
module.exports = require('neostandard')({
|
||||
ignores: require('neostandard').resolveIgnoresFromGitignore(),
|
||||
ts: true
|
||||
})
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/const.ts"],"names":[],"mappings":";;AAEA,mDAAuC;AACvC,6CAA0C;AAC1C,+CAAuC;AAIvC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,2BAA2B;IACpC,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,kBAAkB,UAAU,GAAG;CAC3D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAC,GAAG,GAAG,CAAA;QAClD,IAAI,KAAK,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,IAAI,QAAQ,CAAC,EAAE,CAAC;YACnD,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,IAAI,IAAA,cAAO,EAAC,GAAG,EAAE,eAAK,CAAC,IAAI,IAAI,KAAK,UAAU,GAAG,CAAC,CAAA;QACnE,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,IAAI,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,QAAQ,IAAI,EAAE,CAAC,CAAA;QACpC,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
import * as util from "../core/util.js";
|
||||
const error = () => {
|
||||
const Sizable = {
|
||||
string: { unit: "belgi", verb: "bo‘lishi kerak" },
|
||||
file: { unit: "bayt", verb: "bo‘lishi kerak" },
|
||||
array: { unit: "element", verb: "bo‘lishi kerak" },
|
||||
set: { unit: "element", verb: "bo‘lishi kerak" },
|
||||
map: { unit: "yozuv", verb: "bo‘lishi kerak" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const FormatDictionary = {
|
||||
regex: "kirish",
|
||||
email: "elektron pochta manzili",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO sana va vaqti",
|
||||
date: "ISO sana",
|
||||
time: "ISO vaqt",
|
||||
duration: "ISO davomiylik",
|
||||
ipv4: "IPv4 manzil",
|
||||
ipv6: "IPv6 manzil",
|
||||
mac: "MAC manzil",
|
||||
cidrv4: "IPv4 diapazon",
|
||||
cidrv6: "IPv6 diapazon",
|
||||
base64: "base64 kodlangan satr",
|
||||
base64url: "base64url kodlangan satr",
|
||||
json_string: "JSON satr",
|
||||
e164: "E.164 raqam",
|
||||
jwt: "JWT",
|
||||
template_literal: "kirish",
|
||||
};
|
||||
const TypeDictionary = {
|
||||
nan: "NaN",
|
||||
number: "raqam",
|
||||
array: "massiv",
|
||||
};
|
||||
return (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type": {
|
||||
const expected = TypeDictionary[issue.expected] ?? issue.expected;
|
||||
const receivedType = util.parsedType(issue.input);
|
||||
const received = TypeDictionary[receivedType] ?? receivedType;
|
||||
if (/^[A-Z]/.test(issue.expected)) {
|
||||
return `Noto‘g‘ri kirish: kutilgan instanceof ${issue.expected}, qabul qilingan ${received}`;
|
||||
}
|
||||
return `Noto‘g‘ri kirish: kutilgan ${expected}, qabul qilingan ${received}`;
|
||||
}
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Noto‘g‘ri kirish: kutilgan ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Noto‘g‘ri variant: quyidagilardan biri kutilgan ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Juda katta: kutilgan ${issue.origin ?? "qiymat"} ${adj}${issue.maximum.toString()} ${sizing.unit} ${sizing.verb}`;
|
||||
return `Juda katta: kutilgan ${issue.origin ?? "qiymat"} ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Juda kichik: kutilgan ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} ${sizing.verb}`;
|
||||
}
|
||||
return `Juda kichik: kutilgan ${issue.origin} ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Noto‘g‘ri satr: "${_issue.prefix}" bilan boshlanishi kerak`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Noto‘g‘ri satr: "${_issue.suffix}" bilan tugashi kerak`;
|
||||
if (_issue.format === "includes")
|
||||
return `Noto‘g‘ri satr: "${_issue.includes}" ni o‘z ichiga olishi kerak`;
|
||||
if (_issue.format === "regex")
|
||||
return `Noto‘g‘ri satr: ${_issue.pattern} shabloniga mos kelishi kerak`;
|
||||
return `Noto‘g‘ri ${FormatDictionary[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Noto‘g‘ri raqam: ${issue.divisor} ning karralisi bo‘lishi kerak`;
|
||||
case "unrecognized_keys":
|
||||
return `Noma’lum kalit${issue.keys.length > 1 ? "lar" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin} dagi kalit noto‘g‘ri`;
|
||||
case "invalid_union":
|
||||
return "Noto‘g‘ri kirish";
|
||||
case "invalid_element":
|
||||
return `${issue.origin} da noto‘g‘ri qiymat`;
|
||||
default:
|
||||
return `Noto‘g‘ri kirish`;
|
||||
}
|
||||
};
|
||||
};
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error(),
|
||||
};
|
||||
}
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
var _typeof = require("./typeof.js")["default"];
|
||||
var setPrototypeOf = require("./setPrototypeOf.js");
|
||||
var inherits = require("./inherits.js");
|
||||
function _wrapRegExp() {
|
||||
module.exports = _wrapRegExp = function _wrapRegExp(e, r) {
|
||||
return new BabelRegExp(e, void 0, r);
|
||||
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
||||
var e = RegExp.prototype,
|
||||
r = new WeakMap();
|
||||
function BabelRegExp(e, t, p) {
|
||||
var o = RegExp(e, t);
|
||||
return r.set(o, p || r.get(e)), setPrototypeOf(o, BabelRegExp.prototype);
|
||||
}
|
||||
function buildGroups(e, t) {
|
||||
var p = r.get(t);
|
||||
return Object.keys(p).reduce(function (r, t) {
|
||||
var o = p[t];
|
||||
if ("number" == typeof o) r[t] = e[o];else {
|
||||
for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++;
|
||||
r[t] = e[o[i]];
|
||||
}
|
||||
return r;
|
||||
}, Object.create(null));
|
||||
}
|
||||
return inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) {
|
||||
var t = e.exec.call(this, r);
|
||||
if (t) {
|
||||
t.groups = buildGroups(t, this);
|
||||
var p = t.indices;
|
||||
p && (p.groups = buildGroups(p, this));
|
||||
}
|
||||
return t;
|
||||
}, BabelRegExp.prototype[Symbol.replace] = function (t, p) {
|
||||
if ("string" == typeof p) {
|
||||
var o = r.get(this);
|
||||
return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)(>|$)/g, function (e, r, t) {
|
||||
if ("" === t) return e;
|
||||
var p = o[r];
|
||||
return Array.isArray(p) ? "$" + p.join("$") : "number" == typeof p ? "$" + p : "";
|
||||
}));
|
||||
}
|
||||
if ("function" == typeof p) {
|
||||
var i = this;
|
||||
return e[Symbol.replace].call(this, t, function () {
|
||||
var e = arguments;
|
||||
return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e);
|
||||
});
|
||||
}
|
||||
return e[Symbol.replace].call(this, t, p);
|
||||
}, _wrapRegExp.apply(this, arguments);
|
||||
}
|
||||
module.exports = _wrapRegExp, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/usePrefetchInfiniteQuery.tsx
|
||||
var usePrefetchInfiniteQuery_exports = {};
|
||||
__export(usePrefetchInfiniteQuery_exports, {
|
||||
usePrefetchInfiniteQuery: () => usePrefetchInfiniteQuery
|
||||
});
|
||||
module.exports = __toCommonJS(usePrefetchInfiniteQuery_exports);
|
||||
var import_QueryClientProvider = require("./QueryClientProvider.cjs");
|
||||
function usePrefetchInfiniteQuery(options, queryClient) {
|
||||
const client = (0, import_QueryClientProvider.useQueryClient)(queryClient);
|
||||
if (!client.getQueryState(options.queryKey)) {
|
||||
client.prefetchInfiniteQuery(options);
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
usePrefetchInfiniteQuery
|
||||
});
|
||||
//# sourceMappingURL=usePrefetchInfiniteQuery.cjs.map
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
{
|
||||
"name": "array-union",
|
||||
"version": "2.1.0",
|
||||
"description": "Create an array of unique values, in order, from the input arrays",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/array-union",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"array",
|
||||
"set",
|
||||
"uniq",
|
||||
"unique",
|
||||
"duplicate",
|
||||
"remove",
|
||||
"union",
|
||||
"combine",
|
||||
"merge"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
instrumentation:
|
||||
excludes:
|
||||
- test.js
|
||||
- test/**/*
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
|
||||
// TODO: use pure ESM `import-meta-resolve` package in next major version
|
||||
import { resolve } from '@dual-bundle/import-meta-resolve';
|
||||
import resolveFrom from 'resolve-from';
|
||||
|
||||
/**
|
||||
* TODO: These suffixes are here for commonjs compatibility reason, we should remove these codes after migrating to pure ESM, because in ESM accurate paths are required
|
||||
*/
|
||||
|
||||
const pathSuffixes = ['', '.js', '.json', `${path.sep}index.js`, `${path.sep}index.json`];
|
||||
|
||||
const specifierSuffixes = ['', '.js', '.json', '/index.js', '/index.json'];
|
||||
|
||||
/**
|
||||
* Checks whether the given file exists as a file.
|
||||
* @param {string} filename The file to check.
|
||||
* @returns {boolean} `true` if the file exists and is a file, otherwise `false`.
|
||||
*/
|
||||
function existsFile(filename) {
|
||||
return fs.statSync(filename, { throwIfNoEntry: false })?.isFile() ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} parent
|
||||
* @param {string} lookup
|
||||
* @returns {string | undefined}
|
||||
*/
|
||||
export default function resolveSilent(parent, lookup) {
|
||||
if (path.isAbsolute(lookup)) {
|
||||
for (const suffix of pathSuffixes) {
|
||||
const filename = lookup + suffix;
|
||||
|
||||
if (existsFile(filename)) {
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const base = pathToFileURL(path.resolve(parent, 'noop.js')).toString();
|
||||
|
||||
for (const suffix of specifierSuffixes) {
|
||||
try {
|
||||
const resolved = fileURLToPath(resolve(lookup + suffix, base));
|
||||
|
||||
if (existsFile(resolved)) {
|
||||
return resolved;
|
||||
}
|
||||
} catch {
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Yarn P'n'P does not support pure ESM well by default, this is only a workaround for it
|
||||
* @see https://github.com/wooorm/import-meta-resolve/issues/23
|
||||
*
|
||||
* TODO: this workaround is still necessary before native `import.meta.resolve` replacement
|
||||
*/
|
||||
return resolveFrom.silent(parent, lookup);
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"alignString.js","sourceRoot":"","sources":["../../src/alignString.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AAIvC,mCAEiB;AAEjB,MAAM,SAAS,GAAG,CAAC,OAAe,EAAE,KAAa,EAAU,EAAE;IAC3D,OAAO,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,OAAe,EAAE,KAAa,EAAU,EAAE;IAC5D,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,OAAe,EAAE,KAAa,EAAU,EAAE;IAC7D,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;AACxF,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,KAAa,EAAU,EAAE;IAC9D,MAAM,kBAAkB,GAAG,IAAA,0BAAkB,EAAC,OAAO,CAAC,CAAC;IAEvD,IAAI,kBAAkB,KAAK,CAAC,EAAE;QAC5B,OAAO,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KAClC;IAED,MAAM,YAAY,GAAG,IAAA,0BAAkB,EAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;IAEnE,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,EAAE;QACjC,OAAO,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KAClC;IAED,IAAI,kBAAkB,GAAG,CAAC,CAAC;IAE3B,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,EAAE;QAC5C,OAAO,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;GAGG;AACI,MAAM,WAAW,GAAG,CAAC,OAAe,EAAE,cAAsB,EAAE,SAAoB,EAAU,EAAE;IACnG,MAAM,YAAY,GAAG,IAAA,sBAAW,EAAC,OAAO,CAAC,CAAC;IAE1C,IAAI,YAAY,KAAK,cAAc,EAAE;QACnC,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,YAAY,GAAG,cAAc,EAAE;QACjC,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;KAC9F;IAED,IAAI,YAAY,KAAK,CAAC,EAAE;QACtB,OAAO,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;KACnC;IAED,MAAM,cAAc,GAAG,cAAc,GAAG,YAAY,CAAC;IAErD,IAAI,SAAS,KAAK,MAAM,EAAE;QACxB,OAAO,SAAS,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;KAC3C;IAED,IAAI,SAAS,KAAK,OAAO,EAAE;QACzB,OAAO,UAAU,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;KAC5C;IAED,IAAI,SAAS,KAAK,SAAS,EAAE;QAC3B,OAAO,YAAY,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;KAC9C;IAED,OAAO,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;AAC9C,CAAC,CAAC;AA9BW,QAAA,WAAW,eA8BtB"}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import { Subscribable } from './subscribable.js';
|
||||
|
||||
type Listener = (online: boolean) => void;
|
||||
type SetupFn = (setOnline: Listener) => (() => void) | undefined;
|
||||
declare class OnlineManager extends Subscribable<Listener> {
|
||||
#private;
|
||||
constructor();
|
||||
protected onSubscribe(): void;
|
||||
protected onUnsubscribe(): void;
|
||||
setEventListener(setup: SetupFn): void;
|
||||
setOnline(online: boolean): void;
|
||||
isOnline(): boolean;
|
||||
}
|
||||
declare const onlineManager: OnlineManager;
|
||||
|
||||
export { OnlineManager, onlineManager };
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"names":["_iterableToArrayLimit","arr","i","iterator","Symbol","_arr","iteratorNormalCompletion","didIteratorError","step","iteratorError","next","_return","call","Object","done","push","value","length","err"],"sources":["../../src/helpers/iterableToArrayLimit.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _iterableToArrayLimit<T>(arr: Iterable<T>, i: number) {\n // this is an expanded form of \\`for...of\\` that properly supports abrupt completions of\n // iterators etc.\n\n var iterator: Iterator<T> =\n arr == null\n ? null\n : (typeof Symbol !== \"undefined\" && arr[Symbol.iterator]) ||\n (arr as any)[\"@@iterator\"];\n if (iterator == null) return;\n\n var _arr: T[] = [];\n var iteratorNormalCompletion = true;\n var didIteratorError = false;\n var step, iteratorError, next, _return;\n try {\n next = (iterator = (iterator as unknown as Function).call(arr)).next;\n if (i === 0) {\n if (Object(iterator) !== iterator) return;\n iteratorNormalCompletion = false;\n } else {\n for (\n ;\n !(iteratorNormalCompletion = (step = next.call(iterator)).done);\n iteratorNormalCompletion = true\n ) {\n _arr.push(step.value);\n if (_arr.length === i) break;\n }\n }\n } catch (err) {\n didIteratorError = true;\n iteratorError = err;\n } finally {\n try {\n if (!iteratorNormalCompletion && iterator[\"return\"] != null) {\n _return = iterator[\"return\"]();\n // eslint-disable-next-line no-unsafe-finally\n if (Object(_return) !== _return) return;\n }\n } finally {\n // eslint-disable-next-line no-unsafe-finally\n if (didIteratorError) throw iteratorError;\n }\n }\n return _arr;\n}\n"],"mappings":";;;;;;AAEe,SAASA,qBAAqBA,CAAIC,GAAgB,EAAEC,CAAS,EAAE;EAI5E,IAAIC,QAAqB,GACvBF,GAAG,IAAI,IAAI,GACP,IAAI,GACH,OAAOG,MAAM,KAAK,WAAW,IAAIH,GAAG,CAACG,MAAM,CAACD,QAAQ,CAAC,IACrDF,GAAG,CAAS,YAAY,CAAC;EAChC,IAAIE,QAAQ,IAAI,IAAI,EAAE;EAEtB,IAAIE,IAAS,GAAG,EAAE;EAClB,IAAIC,wBAAwB,GAAG,IAAI;EACnC,IAAIC,gBAAgB,GAAG,KAAK;EAC5B,IAAIC,IAAI,EAAEC,aAAa,EAAEC,IAAI,EAAEC,OAAO;EACtC,IAAI;IACFD,IAAI,GAAG,CAACP,QAAQ,GAAIA,QAAQ,CAAyBS,IAAI,CAACX,GAAG,CAAC,EAAES,IAAI;IACpE,IAAIR,CAAC,KAAK,CAAC,EAAE;MACX,IAAIW,MAAM,CAACV,QAAQ,CAAC,KAAKA,QAAQ,EAAE;MACnCG,wBAAwB,GAAG,KAAK;IAClC,CAAC,MAAM;MACL,OAEE,EAAEA,wBAAwB,GAAG,CAACE,IAAI,GAAGE,IAAI,CAACE,IAAI,CAACT,QAAQ,CAAC,EAAEW,IAAI,CAAC,EAC/DR,wBAAwB,GAAG,IAAI,EAC/B;QACAD,IAAI,CAACU,IAAI,CAACP,IAAI,CAACQ,KAAK,CAAC;QACrB,IAAIX,IAAI,CAACY,MAAM,KAAKf,CAAC,EAAE;MACzB;IACF;EACF,CAAC,CAAC,OAAOgB,GAAG,EAAE;IACZX,gBAAgB,GAAG,IAAI;IACvBE,aAAa,GAAGS,GAAG;EACrB,CAAC,SAAS;IACR,IAAI;MACF,IAAI,CAACZ,wBAAwB,IAAIH,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE;QAC3DQ,OAAO,GAAGR,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;QAE9B,IAAIU,MAAM,CAACF,OAAO,CAAC,KAAKA,OAAO,EAAE;MACnC;IACF,CAAC,SAAS;MAER,IAAIJ,gBAAgB,EAAE,MAAME,aAAa;IAC3C;EACF;EACA,OAAOJ,IAAI;AACb","ignoreList":[]}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
/** @type {import('./reflectApply')} */
|
||||
module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
|
||||
|
|
@ -1 +0,0 @@
|
|||
var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},a=function(r,t,a){return void 0===t&&(t=0),void 0===a&&(a=Math.pow(10,t)),Math.round(a*r)/a+0},n=function(r,t,a){return void 0===t&&(t=0),void 0===a&&(a=1),r>a?a:r>t?r:t},u=function(r){var t=r/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},h=function(r){return 255*(r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r)},o=96.422,e=100,c=82.521,i=function(r){var t,a,u={x:.9555766*(t=r).x+-.0230393*t.y+.0631636*t.z,y:-.0282895*t.x+1.0099416*t.y+.0210077*t.z,z:.0122982*t.x+-.020483*t.y+1.3299098*t.z};return a={r:h(.032404542*u.x-.015371385*u.y-.004985314*u.z),g:h(-.00969266*u.x+.018760108*u.y+41556e-8*u.z),b:h(556434e-9*u.x-.002040259*u.y+.010572252*u.z),a:r.a},{r:n(a.r,0,255),g:n(a.g,0,255),b:n(a.b,0,255),a:n(a.a)}},l=function(r){var t=u(r.r),a=u(r.g),h=u(r.b);return function(r){return{x:n(r.x,0,o),y:n(r.y,0,e),z:n(r.z,0,c),a:n(r.a)}}(function(r){return{x:1.0478112*r.x+.0228866*r.y+-.050127*r.z,y:.0295424*r.x+.9904844*r.y+-.0170491*r.z,z:-.0092345*r.x+.0150436*r.y+.7521316*r.z,a:r.a}}({x:100*(.4124564*t+.3575761*a+.1804375*h),y:100*(.2126729*t+.7151522*a+.072175*h),z:100*(.0193339*t+.119192*a+.9503041*h),a:r.a}))},b=216/24389,d=24389/27,f=function(r){return{l:n(r.l,0,100),c:r.c,h:(t=r.h,(t=isFinite(t)?t%360:0)>0?t:t+360),a:r.a};var t},p=function(r){return{l:a(r.l,2),c:a(r.c,2),h:a(r.h,2),a:a(r.a,3)}},v=function(r){var a=r.l,n=r.c,u=r.h,h=r.a,o=void 0===h?1:h;if(!t(a)||!t(n)||!t(u))return null;var e=f({l:Number(a),c:Number(n),h:Number(u),a:Number(o)});return M(e)},y=function(r){var t=function(r){var t=l(r),a=t.x/o,n=t.y/e,u=t.z/c;return a=a>b?Math.cbrt(a):(d*a+16)/116,{l:116*(n=n>b?Math.cbrt(n):(d*n+16)/116)-16,a:500*(a-n),b:200*(n-(u=u>b?Math.cbrt(u):(d*u+16)/116)),alpha:t.a}}(r),n=a(t.a,3),u=a(t.b,3),h=Math.atan2(u,n)/Math.PI*180;return{l:t.l,c:Math.sqrt(n*n+u*u),h:h<0?h+360:h,a:t.alpha}},M=function(r){return t={l:r.l,a:r.c*Math.cos(r.h*Math.PI/180),b:r.c*Math.sin(r.h*Math.PI/180),alpha:r.a},n=t.a/500+(a=(t.l+16)/116),u=a-t.b/200,i({x:(Math.pow(n,3)>b?Math.pow(n,3):(116*n-16)/d)*o,y:(t.l>8?Math.pow((t.l+16)/116,3):t.l/d)*e,z:(Math.pow(u,3)>b?Math.pow(u,3):(116*u-16)/d)*c,a:t.alpha});var t,a,n,u},x=/^lch\(\s*([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)\s+([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,s=function(t){var a=x.exec(t);if(!a)return null;var n,u,h=f({l:Number(a[1]),c:Number(a[2]),h:(n=a[3],u=a[4],void 0===u&&(u="deg"),Number(n)*(r[u]||1)),a:void 0===a[5]?1:Number(a[5])/(a[6]?100:1)});return M(h)};module.exports=function(r,t){r.prototype.toLch=function(){return p(y(this.rgba))},r.prototype.toLchString=function(){return r=p(y(this.rgba)),t=r.l,a=r.c,n=r.h,(u=r.a)<1?"lch("+t+"% "+a+" "+n+" / "+u+")":"lch("+t+"% "+a+" "+n+")";var r,t,a,n,u},t.string.push([s,"lch"]),t.object.push([v,"lch"])};
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable<TListener extends Function> {\n protected listeners = new Set<TListener>()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
// This alphabet uses `A-Za-z0-9_-` symbols.
|
||||
// The order of characters is optimized for better gzip and brotli compression.
|
||||
// References to the same file (works both for gzip and brotli):
|
||||
// `'use`, `andom`, and `rict'`
|
||||
// References to the brotli default dictionary:
|
||||
// `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf`
|
||||
let urlAlphabet =
|
||||
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
|
||||
|
||||
let customAlphabet = (alphabet, defaultSize = 21) => {
|
||||
return (size = defaultSize) => {
|
||||
let id = ''
|
||||
// A compact alternative for `for (var i = 0; i < step; i++)`.
|
||||
let i = size | 0
|
||||
while (i--) {
|
||||
// `| 0` is more compact and faster than `Math.floor()`.
|
||||
id += alphabet[(Math.random() * alphabet.length) | 0]
|
||||
}
|
||||
return id
|
||||
}
|
||||
}
|
||||
|
||||
let nanoid = (size = 21) => {
|
||||
let id = ''
|
||||
// A compact alternative for `for (var i = 0; i < step; i++)`.
|
||||
let i = size | 0
|
||||
while (i--) {
|
||||
// `| 0` is more compact and faster than `Math.floor()`.
|
||||
id += urlAlphabet[(Math.random() * 64) | 0]
|
||||
}
|
||||
return id
|
||||
}
|
||||
|
||||
module.exports = { nanoid, customAlphabet }
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={A:{A:{"2":"K D E F xC","1156":"A B"},B:{"1":"0 1 2 3 4 5 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","1028":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC zC 0C","2":"yC TC","1028":"6 7 8 9 C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB","1284":"A B","1412":"K D E F","1924":"J ZB 1C 2C"},D:{"1":"0 1 2 3 4 5 vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC","16":"J ZB K","1028":"cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB","1156":"FB bB","1412":"6 7 8 9 D E F A B C L M G N O P aB AB BB CB DB EB"},E:{"1":"C L M G NC OC 8C 9C AD cC dC PC BD QC eC fC gC hC iC CD RC jC kC lC mC nC DD SC oC pC qC rC sC tC uC ED FD","2":"J 3C aC","1028":"E F A B 6C 7C bC","1156":"D 5C","1412":"ZB K 4C"},F:{"1":"0 1 2 3 4 5 iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B GD HD ID JD NC vC KD","132":"G N O","1028":"6 7 8 9 C P aB AB BB CB DB EB FB bB cB dB eB fB gB hB OC"},G:{"1":"UD VD WD XD YD ZD aD bD cD dD eD cC dC PC fD QC eC fC gC hC iC gD RC jC kC lC mC nC hD SC oC pC qC rC sC tC uC","2":"aC LD wC","1028":"E PD QD RD SD TD","1156":"OD","1412":"MD ND"},H:{"2":"iD"},I:{"1":"I","2":"jD kD lD","1028":"oD","1412":"nD","1924":"TC J mD wC"},J:{"1156":"A","1412":"D"},K:{"1":"H","2":"A B NC vC","1028":"C OC"},L:{"1":"I"},M:{"1":"MC"},N:{"1156":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB pD qD rD sD tD bC uD vD wD xD yD QC RC SC zD","1028":"J"},Q:{"1":"0D"},R:{"1":"1D"},S:{"1":"2D 3D"}},B:1,C:"XMLHttpRequest advanced features",D:true};
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
import OverloadYield from "./OverloadYield.js";
|
||||
import regeneratorDefine from "./regeneratorDefine.js";
|
||||
function AsyncIterator(t, e) {
|
||||
function n(r, o, i, f) {
|
||||
try {
|
||||
var c = t[r](o),
|
||||
u = c.value;
|
||||
return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {
|
||||
n("next", t, i, f);
|
||||
}, function (t) {
|
||||
n("throw", t, i, f);
|
||||
}) : e.resolve(u).then(function (t) {
|
||||
c.value = t, i(c);
|
||||
}, function (t) {
|
||||
return n("throw", t, i, f);
|
||||
});
|
||||
} catch (t) {
|
||||
f(t);
|
||||
}
|
||||
}
|
||||
var r;
|
||||
this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
|
||||
return this;
|
||||
})), regeneratorDefine(this, "_invoke", function (t, o, i) {
|
||||
function f() {
|
||||
return new e(function (e, r) {
|
||||
n(t, i, e, r);
|
||||
});
|
||||
}
|
||||
return r = r ? r.then(f, f) : f();
|
||||
}, !0);
|
||||
}
|
||||
export { AsyncIterator as default };
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import ru from "../../../locales/ru.js";
|
||||
|
||||
describe("Russian localization", () => {
|
||||
const localeError = ru().localeError;
|
||||
|
||||
describe("pluralization rules", () => {
|
||||
for (const { type, cases } of TEST_CASES) {
|
||||
describe(`${type} pluralization`, () => {
|
||||
for (const { count, expected } of cases) {
|
||||
it(`correctly pluralizes ${count} ${type}`, () => {
|
||||
const error = localeError({
|
||||
code: "too_small",
|
||||
minimum: count,
|
||||
type: "number",
|
||||
inclusive: true,
|
||||
path: [],
|
||||
origin: type,
|
||||
input: count - 1,
|
||||
});
|
||||
|
||||
expect(error).toContain(expected);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
it("handles negative numbers correctly", () => {
|
||||
const error = localeError({
|
||||
code: "too_small",
|
||||
minimum: -2,
|
||||
type: "number",
|
||||
inclusive: true,
|
||||
path: [],
|
||||
origin: "array",
|
||||
input: -3,
|
||||
});
|
||||
|
||||
expect(error).toContain("-2 элемента");
|
||||
});
|
||||
|
||||
it("handles zero correctly", () => {
|
||||
const error = localeError({
|
||||
code: "too_small",
|
||||
minimum: 0,
|
||||
type: "number",
|
||||
inclusive: true,
|
||||
path: [],
|
||||
origin: "array",
|
||||
input: -1,
|
||||
});
|
||||
|
||||
expect(error).toContain("0 элементов");
|
||||
});
|
||||
|
||||
it("handles bigint values correctly", () => {
|
||||
const error = localeError({
|
||||
code: "too_small",
|
||||
minimum: BigInt(21),
|
||||
type: "number",
|
||||
inclusive: true,
|
||||
path: [],
|
||||
origin: "array",
|
||||
input: BigInt(20),
|
||||
});
|
||||
|
||||
expect(error).toContain("21 элемент");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
const TEST_CASES = [
|
||||
{
|
||||
type: "array",
|
||||
cases: [
|
||||
{ count: 1, expected: "1 элемент" },
|
||||
{ count: 2, expected: "2 элемента" },
|
||||
{ count: 5, expected: "5 элементов" },
|
||||
{ count: 11, expected: "11 элементов" },
|
||||
{ count: 21, expected: "21 элемент" },
|
||||
{ count: 22, expected: "22 элемента" },
|
||||
{ count: 25, expected: "25 элементов" },
|
||||
{ count: 101, expected: "101 элемент" },
|
||||
{ count: 111, expected: "111 элементов" },
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "set",
|
||||
cases: [
|
||||
{ count: 1, expected: "1 элемент" },
|
||||
{ count: 2, expected: "2 элемента" },
|
||||
{ count: 5, expected: "5 элементов" },
|
||||
{ count: 11, expected: "11 элементов" },
|
||||
{ count: 21, expected: "21 элемент" },
|
||||
{ count: 22, expected: "22 элемента" },
|
||||
{ count: 25, expected: "25 элементов" },
|
||||
{ count: 101, expected: "101 элемент" },
|
||||
{ count: 111, expected: "111 элементов" },
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "string",
|
||||
cases: [
|
||||
{ count: 1, expected: "1 символ" },
|
||||
{ count: 2, expected: "2 символа" },
|
||||
{ count: 5, expected: "5 символов" },
|
||||
{ count: 11, expected: "11 символов" },
|
||||
{ count: 21, expected: "21 символ" },
|
||||
{ count: 22, expected: "22 символа" },
|
||||
{ count: 25, expected: "25 символов" },
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "file",
|
||||
cases: [
|
||||
{ count: 0, expected: "0 байт" },
|
||||
{ count: 1, expected: "1 байт" },
|
||||
{ count: 2, expected: "2 байта" },
|
||||
{ count: 5, expected: "5 байт" },
|
||||
{ count: 11, expected: "11 байт" },
|
||||
{ count: 21, expected: "21 байт" },
|
||||
{ count: 22, expected: "22 байта" },
|
||||
{ count: 25, expected: "25 байт" },
|
||||
{ count: 101, expected: "101 байт" },
|
||||
{ count: 110, expected: "110 байт" },
|
||||
],
|
||||
},
|
||||
] as const;
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
/*!
|
||||
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
||||
*
|
||||
* Copyright (c) 2014-2016, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
module.exports = function isExtglob(str) {
|
||||
if (typeof str !== 'string' || str === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
var match;
|
||||
while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) {
|
||||
if (match[2]) return true;
|
||||
str = str.slice(match.index + match[0].length);
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
|
@ -1,360 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = rewriteLiveReferences;
|
||||
var _core = require("@babel/core");
|
||||
function isInType(path) {
|
||||
do {
|
||||
switch (path.parent.type) {
|
||||
case "TSTypeAnnotation":
|
||||
case "TSTypeAliasDeclaration":
|
||||
case "TSTypeReference":
|
||||
case "TypeAnnotation":
|
||||
case "TypeAlias":
|
||||
return true;
|
||||
case "ExportSpecifier":
|
||||
return path.parentPath.parent.exportKind === "type";
|
||||
default:
|
||||
if (path.parentPath.isStatement() || path.parentPath.isExpression()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} while (path = path.parentPath);
|
||||
}
|
||||
function rewriteLiveReferences(programPath, metadata, wrapReference) {
|
||||
const imported = new Map();
|
||||
const exported = new Map();
|
||||
const requeueInParent = path => {
|
||||
programPath.requeue(path);
|
||||
};
|
||||
for (const [source, data] of metadata.source) {
|
||||
for (const [localName, importName] of data.imports) {
|
||||
imported.set(localName, [source, importName, null]);
|
||||
}
|
||||
for (const localName of data.importsNamespace) {
|
||||
imported.set(localName, [source, null, localName]);
|
||||
}
|
||||
}
|
||||
for (const [local, data] of metadata.local) {
|
||||
let exportMeta = exported.get(local);
|
||||
if (!exportMeta) {
|
||||
exportMeta = [];
|
||||
exported.set(local, exportMeta);
|
||||
}
|
||||
exportMeta.push(...data.names);
|
||||
}
|
||||
const rewriteBindingInitVisitorState = {
|
||||
metadata,
|
||||
requeueInParent,
|
||||
scope: programPath.scope,
|
||||
exported
|
||||
};
|
||||
programPath.traverse(rewriteBindingInitVisitor, rewriteBindingInitVisitorState);
|
||||
const rewriteReferencesVisitorState = {
|
||||
seen: new WeakSet(),
|
||||
metadata,
|
||||
requeueInParent,
|
||||
scope: programPath.scope,
|
||||
imported,
|
||||
exported,
|
||||
buildImportReference([source, importName, localName], identNode) {
|
||||
const meta = metadata.source.get(source);
|
||||
meta.referenced = true;
|
||||
if (localName) {
|
||||
if (meta.wrap) {
|
||||
var _wrapReference;
|
||||
identNode = (_wrapReference = wrapReference(identNode, meta.wrap)) != null ? _wrapReference : identNode;
|
||||
}
|
||||
return identNode;
|
||||
}
|
||||
let namespace = _core.types.identifier(meta.name);
|
||||
if (meta.wrap) {
|
||||
var _wrapReference2;
|
||||
namespace = (_wrapReference2 = wrapReference(namespace, meta.wrap)) != null ? _wrapReference2 : namespace;
|
||||
}
|
||||
if (importName === "default" && meta.interop === "node-default") {
|
||||
return namespace;
|
||||
}
|
||||
const computed = metadata.stringSpecifiers.has(importName);
|
||||
return _core.types.memberExpression(namespace, computed ? _core.types.stringLiteral(importName) : _core.types.identifier(importName), computed);
|
||||
}
|
||||
};
|
||||
programPath.traverse(rewriteReferencesVisitor, rewriteReferencesVisitorState);
|
||||
}
|
||||
const rewriteBindingInitVisitor = {
|
||||
Scope(path) {
|
||||
path.skip();
|
||||
},
|
||||
ClassDeclaration(path) {
|
||||
const {
|
||||
requeueInParent,
|
||||
exported,
|
||||
metadata
|
||||
} = this;
|
||||
const {
|
||||
id
|
||||
} = path.node;
|
||||
if (!id) throw new Error("Expected class to have a name");
|
||||
const localName = id.name;
|
||||
const exportNames = exported.get(localName) || [];
|
||||
if (exportNames.length > 0) {
|
||||
const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exportNames, _core.types.identifier(localName), path.scope));
|
||||
statement._blockHoist = path.node._blockHoist;
|
||||
requeueInParent(path.insertAfter(statement)[0]);
|
||||
}
|
||||
},
|
||||
VariableDeclaration(path) {
|
||||
const {
|
||||
requeueInParent,
|
||||
exported,
|
||||
metadata
|
||||
} = this;
|
||||
const isVar = path.node.kind === "var";
|
||||
for (const decl of path.get("declarations")) {
|
||||
const {
|
||||
id
|
||||
} = decl.node;
|
||||
let {
|
||||
init
|
||||
} = decl.node;
|
||||
if (_core.types.isIdentifier(id) && exported.has(id.name) && !_core.types.isArrowFunctionExpression(init) && (!_core.types.isFunctionExpression(init) || init.id) && (!_core.types.isClassExpression(init) || init.id)) {
|
||||
if (!init) {
|
||||
if (isVar) {
|
||||
continue;
|
||||
} else {
|
||||
init = path.scope.buildUndefinedNode();
|
||||
}
|
||||
}
|
||||
decl.node.init = buildBindingExportAssignmentExpression(metadata, exported.get(id.name), init, path.scope);
|
||||
requeueInParent(decl.get("init"));
|
||||
} else {
|
||||
for (const localName of Object.keys(decl.getOuterBindingIdentifiers())) {
|
||||
if (exported.has(localName)) {
|
||||
const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exported.get(localName), _core.types.identifier(localName), path.scope));
|
||||
statement._blockHoist = path.node._blockHoist;
|
||||
requeueInParent(path.insertAfter(statement)[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const buildBindingExportAssignmentExpression = (metadata, exportNames, localExpr, scope) => {
|
||||
const exportsObjectName = metadata.exportName;
|
||||
for (let currentScope = scope; currentScope != null; currentScope = currentScope.parent) {
|
||||
if (currentScope.hasOwnBinding(exportsObjectName)) {
|
||||
currentScope.rename(exportsObjectName);
|
||||
}
|
||||
}
|
||||
return (exportNames || []).reduce((expr, exportName) => {
|
||||
const {
|
||||
stringSpecifiers
|
||||
} = metadata;
|
||||
const computed = stringSpecifiers.has(exportName);
|
||||
return _core.types.assignmentExpression("=", _core.types.memberExpression(_core.types.identifier(exportsObjectName), computed ? _core.types.stringLiteral(exportName) : _core.types.identifier(exportName), computed), expr);
|
||||
}, localExpr);
|
||||
};
|
||||
const buildImportThrow = localName => {
|
||||
return _core.template.expression.ast`
|
||||
(function() {
|
||||
throw new Error('"' + '${localName}' + '" is read-only.');
|
||||
})()
|
||||
`;
|
||||
};
|
||||
const rewriteReferencesVisitor = {
|
||||
ReferencedIdentifier(path) {
|
||||
const {
|
||||
seen,
|
||||
buildImportReference,
|
||||
scope,
|
||||
imported,
|
||||
requeueInParent
|
||||
} = this;
|
||||
if (seen.has(path.node)) return;
|
||||
seen.add(path.node);
|
||||
const localName = path.node.name;
|
||||
const importData = imported.get(localName);
|
||||
if (importData) {
|
||||
if (isInType(path)) {
|
||||
throw path.buildCodeFrameError(`Cannot transform the imported binding "${localName}" since it's also used in a type annotation. ` + `Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.`);
|
||||
}
|
||||
const localBinding = path.scope.getBinding(localName);
|
||||
const rootBinding = scope.getBinding(localName);
|
||||
if (rootBinding !== localBinding) return;
|
||||
const ref = buildImportReference(importData, path.node);
|
||||
ref.loc = path.node.loc;
|
||||
if ((path.parentPath.isCallExpression({
|
||||
callee: path.node
|
||||
}) || path.parentPath.isOptionalCallExpression({
|
||||
callee: path.node
|
||||
}) || path.parentPath.isTaggedTemplateExpression({
|
||||
tag: path.node
|
||||
})) && _core.types.isMemberExpression(ref)) {
|
||||
path.replaceWith(_core.types.sequenceExpression([_core.types.numericLiteral(0), ref]));
|
||||
} else if (path.isJSXIdentifier() && _core.types.isMemberExpression(ref)) {
|
||||
const {
|
||||
object,
|
||||
property
|
||||
} = ref;
|
||||
path.replaceWith(_core.types.jsxMemberExpression(_core.types.jsxIdentifier(object.name), _core.types.jsxIdentifier(property.name)));
|
||||
} else {
|
||||
path.replaceWith(ref);
|
||||
}
|
||||
requeueInParent(path);
|
||||
path.skip();
|
||||
}
|
||||
},
|
||||
UpdateExpression(path) {
|
||||
const {
|
||||
scope,
|
||||
seen,
|
||||
imported,
|
||||
exported,
|
||||
requeueInParent,
|
||||
buildImportReference
|
||||
} = this;
|
||||
if (seen.has(path.node)) return;
|
||||
seen.add(path.node);
|
||||
const arg = path.get("argument");
|
||||
if (arg.isMemberExpression()) return;
|
||||
const update = path.node;
|
||||
if (arg.isIdentifier()) {
|
||||
const localName = arg.node.name;
|
||||
if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {
|
||||
return;
|
||||
}
|
||||
const exportedNames = exported.get(localName);
|
||||
const importData = imported.get(localName);
|
||||
if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) {
|
||||
if (importData) {
|
||||
path.replaceWith(_core.types.assignmentExpression(update.operator[0] + "=", buildImportReference(importData, arg.node), buildImportThrow(localName)));
|
||||
} else if (update.prefix) {
|
||||
path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.cloneNode(update), path.scope));
|
||||
} else {
|
||||
const ref = scope.generateDeclaredUidIdentifier(localName);
|
||||
path.replaceWith(_core.types.sequenceExpression([_core.types.assignmentExpression("=", _core.types.cloneNode(ref), _core.types.cloneNode(update)), buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.identifier(localName), path.scope), _core.types.cloneNode(ref)]));
|
||||
}
|
||||
}
|
||||
}
|
||||
requeueInParent(path);
|
||||
path.skip();
|
||||
},
|
||||
AssignmentExpression: {
|
||||
exit(path) {
|
||||
const {
|
||||
scope,
|
||||
seen,
|
||||
imported,
|
||||
exported,
|
||||
requeueInParent,
|
||||
buildImportReference
|
||||
} = this;
|
||||
if (seen.has(path.node)) return;
|
||||
seen.add(path.node);
|
||||
const left = path.get("left");
|
||||
if (left.isMemberExpression()) return;
|
||||
if (left.isIdentifier()) {
|
||||
const localName = left.node.name;
|
||||
if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {
|
||||
return;
|
||||
}
|
||||
const exportedNames = exported.get(localName);
|
||||
const importData = imported.get(localName);
|
||||
if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) {
|
||||
const assignment = path.node;
|
||||
if (importData) {
|
||||
assignment.left = buildImportReference(importData, left.node);
|
||||
assignment.right = _core.types.sequenceExpression([assignment.right, buildImportThrow(localName)]);
|
||||
}
|
||||
const {
|
||||
operator
|
||||
} = assignment;
|
||||
let newExpr;
|
||||
if (operator === "=") {
|
||||
newExpr = assignment;
|
||||
} else if (operator === "&&=" || operator === "||=" || operator === "??=") {
|
||||
newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.logicalExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right));
|
||||
} else {
|
||||
newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.binaryExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right));
|
||||
}
|
||||
path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, newExpr, path.scope));
|
||||
requeueInParent(path);
|
||||
path.skip();
|
||||
}
|
||||
} else {
|
||||
const ids = left.getOuterBindingIdentifiers();
|
||||
const programScopeIds = Object.keys(ids).filter(localName => scope.getBinding(localName) === path.scope.getBinding(localName));
|
||||
const id = programScopeIds.find(localName => imported.has(localName));
|
||||
if (id) {
|
||||
path.node.right = _core.types.sequenceExpression([path.node.right, buildImportThrow(id)]);
|
||||
}
|
||||
const items = [];
|
||||
programScopeIds.forEach(localName => {
|
||||
const exportedNames = exported.get(localName) || [];
|
||||
if (exportedNames.length > 0) {
|
||||
items.push(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.identifier(localName), path.scope));
|
||||
}
|
||||
});
|
||||
if (items.length > 0) {
|
||||
let node = _core.types.sequenceExpression(items);
|
||||
if (path.parentPath.isExpressionStatement()) {
|
||||
node = _core.types.expressionStatement(node);
|
||||
node._blockHoist = path.parentPath.node._blockHoist;
|
||||
}
|
||||
const statement = path.insertAfter(node)[0];
|
||||
requeueInParent(statement);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
ForXStatement(path) {
|
||||
const {
|
||||
scope,
|
||||
node
|
||||
} = path;
|
||||
const {
|
||||
left
|
||||
} = node;
|
||||
const {
|
||||
exported,
|
||||
imported,
|
||||
scope: programScope
|
||||
} = this;
|
||||
if (!_core.types.isVariableDeclaration(left)) {
|
||||
let didTransformExport = false,
|
||||
importConstViolationName;
|
||||
const loopBodyScope = path.get("body").scope;
|
||||
for (const name of Object.keys(_core.types.getOuterBindingIdentifiers(left))) {
|
||||
if (programScope.getBinding(name) === scope.getBinding(name)) {
|
||||
if (exported.has(name)) {
|
||||
didTransformExport = true;
|
||||
if (loopBodyScope.hasOwnBinding(name)) {
|
||||
loopBodyScope.rename(name);
|
||||
}
|
||||
}
|
||||
if (imported.has(name) && !importConstViolationName) {
|
||||
importConstViolationName = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!didTransformExport && !importConstViolationName) {
|
||||
return;
|
||||
}
|
||||
path.ensureBlock();
|
||||
const bodyPath = path.get("body");
|
||||
const newLoopId = scope.generateUidIdentifierBasedOnNode(left);
|
||||
path.get("left").replaceWith(_core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.cloneNode(newLoopId))]));
|
||||
scope.registerDeclaration(path.get("left"));
|
||||
if (didTransformExport) {
|
||||
bodyPath.unshiftContainer("body", _core.types.expressionStatement(_core.types.assignmentExpression("=", left, newLoopId)));
|
||||
}
|
||||
if (importConstViolationName) {
|
||||
bodyPath.unshiftContainer("body", _core.types.expressionStatement(buildImportThrow(importConstViolationName)));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//# sourceMappingURL=rewrite-live-references.js.map
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
// NOTICE: This file is generated by Rollup. To modify it,
|
||||
// please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
|
||||
'use strict';
|
||||
|
||||
/** @import { Node as PostcssNode } from 'postcss' */
|
||||
|
||||
/**
|
||||
* Make a fix range as narrow as possible by trimming common prefixes and suffixes
|
||||
*
|
||||
* @param {PostcssNode} node
|
||||
* @param {{range: [number, number], text: string}} fixData
|
||||
* @returns {{range: [number, number], text: string}}
|
||||
*/
|
||||
function narrowFixRange(node, fixData) {
|
||||
if (!node.source) {
|
||||
return fixData;
|
||||
}
|
||||
|
||||
let startOffset = fixData.range[0];
|
||||
let endOffset = fixData.range[1];
|
||||
|
||||
const stringRepresentation = node.source.input.css.slice(startOffset, endOffset);
|
||||
|
||||
let replacementStartOffset = 0;
|
||||
|
||||
for (let i = 0; i < stringRepresentation.length; i++) {
|
||||
const a = stringRepresentation[i];
|
||||
const b = fixData.text[i];
|
||||
|
||||
if (a !== b) break;
|
||||
|
||||
startOffset++;
|
||||
replacementStartOffset++;
|
||||
}
|
||||
|
||||
let replacementEndOffset = fixData.text.length;
|
||||
|
||||
for (let i = 0; i < stringRepresentation.length; i++) {
|
||||
const ia = stringRepresentation.length - 1 - i;
|
||||
|
||||
if (ia < replacementStartOffset) break;
|
||||
|
||||
const a = stringRepresentation[ia];
|
||||
|
||||
const ib = fixData.text.length - 1 - i;
|
||||
|
||||
if (ib < replacementStartOffset) break;
|
||||
|
||||
const b = fixData.text[ib];
|
||||
|
||||
if (a !== b) break;
|
||||
|
||||
endOffset--;
|
||||
replacementEndOffset--;
|
||||
}
|
||||
|
||||
// Try to have a context size of at least 1
|
||||
if (startOffset === endOffset) {
|
||||
if (startOffset > fixData.range[0]) {
|
||||
startOffset--;
|
||||
replacementStartOffset--;
|
||||
} else if (endOffset < fixData.range[1]) {
|
||||
endOffset++;
|
||||
replacementEndOffset++;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
text: fixData.text.slice(replacementStartOffset, replacementEndOffset),
|
||||
range: [startOffset, endOffset],
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = narrowFixRange;
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
# @babel/helper-string-parser
|
||||
|
||||
> A utility package to parse strings
|
||||
|
||||
See our website [@babel/helper-string-parser](https://babeljs.io/docs/babel-helper-string-parser) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save @babel/helper-string-parser
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-string-parser
|
||||
```
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
var serialOrdered = require('../serialOrdered.js');
|
||||
|
||||
// API
|
||||
module.exports = ReadableSerialOrdered;
|
||||
// expose sort helpers
|
||||
module.exports.ascending = serialOrdered.ascending;
|
||||
module.exports.descending = serialOrdered.descending;
|
||||
|
||||
/**
|
||||
* Streaming wrapper to `asynckit.serialOrdered`
|
||||
*
|
||||
* @param {array|object} list - array or object (named list) to iterate over
|
||||
* @param {function} iterator - iterator to run
|
||||
* @param {function} sortMethod - custom sort function
|
||||
* @param {function} callback - invoked when all elements processed
|
||||
* @returns {stream.Readable#}
|
||||
*/
|
||||
function ReadableSerialOrdered(list, iterator, sortMethod, callback)
|
||||
{
|
||||
if (!(this instanceof ReadableSerialOrdered))
|
||||
{
|
||||
return new ReadableSerialOrdered(list, iterator, sortMethod, callback);
|
||||
}
|
||||
|
||||
// turn on object mode
|
||||
ReadableSerialOrdered.super_.call(this, {objectMode: true});
|
||||
|
||||
this._start(serialOrdered, list, iterator, sortMethod, callback);
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={A:{A:{"2":"K D E F A B xC"},B:{"1":"0 1 2 3 4 5 T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","33":"S","164":"Q H R","388":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC zC 0C","164":"gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q","676":"6 7 8 9 yC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB 1C 2C"},D:{"1":"0 1 2 3 4 5 T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC ZC","33":"S","164":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R"},E:{"1":"dC PC BD QC eC fC gC hC iC CD RC jC kC lC mC nC DD SC oC pC qC rC sC tC uC ED FD","164":"J ZB K D E F A B C L M G 3C aC 4C 5C 6C 7C bC NC OC 8C 9C AD cC"},F:{"1":"0 1 2 3 4 5 GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C GD HD ID JD NC vC KD OC","33":"DC EC FC","164":"6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC"},G:{"1":"dC PC fD QC eC fC gC hC iC gD RC jC kC lC mC nC hD SC oC pC qC rC sC tC uC","164":"E aC LD wC MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD cC"},H:{"2":"iD"},I:{"1":"I","164":"TC J jD kD lD mD wC nD oD"},J:{"164":"D A"},K:{"1":"H","2":"A B C NC vC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"2":"A","388":"B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB xD yD QC RC SC zD","164":"J pD qD rD sD tD bC uD vD wD"},Q:{"164":"0D"},R:{"1":"1D"},S:{"1":"3D","164":"2D"}},B:5,C:"CSS Appearance",D:true};
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
throw new Error(
|
||||
'react-dom/profiling is not supported in React Server Components.'
|
||||
);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue