update
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-react-jsx-self",
|
||||
"version": "7.25.9",
|
||||
"description": "Add a __self prop to all JSX Elements",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-plugin-transform-react-jsx-self"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-react-jsx-self",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.25.9"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.9",
|
||||
"@babel/helper-plugin-test-runner": "^7.25.9",
|
||||
"@babel/plugin-syntax-jsx": "^7.25.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"type": "commonjs"
|
||||
}
|
||||
@@ -0,0 +1,559 @@
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
||||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
||||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
||||
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
||||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
||||
// A simple implementation of make-array
|
||||
function makeArray(subject) {
|
||||
return Array.isArray(subject) ? subject : [subject];
|
||||
}
|
||||
var EMPTY = '';
|
||||
var SPACE = ' ';
|
||||
var ESCAPE = '\\';
|
||||
var REGEX_TEST_BLANK_LINE = /^\s+$/;
|
||||
var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
|
||||
var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
|
||||
var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
|
||||
var REGEX_SPLITALL_CRLF = /\r?\n/g;
|
||||
// /foo,
|
||||
// ./foo,
|
||||
// ../foo,
|
||||
// .
|
||||
// ..
|
||||
var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/;
|
||||
var SLASH = '/';
|
||||
|
||||
// Do not use ternary expression here, since "istanbul ignore next" is buggy
|
||||
var TMP_KEY_IGNORE = 'node-ignore';
|
||||
/* istanbul ignore else */
|
||||
if (typeof Symbol !== 'undefined') {
|
||||
TMP_KEY_IGNORE = Symbol["for"]('node-ignore');
|
||||
}
|
||||
var KEY_IGNORE = TMP_KEY_IGNORE;
|
||||
var define = function define(object, key, value) {
|
||||
return Object.defineProperty(object, key, {
|
||||
value: value
|
||||
});
|
||||
};
|
||||
var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
|
||||
var RETURN_FALSE = function RETURN_FALSE() {
|
||||
return false;
|
||||
};
|
||||
|
||||
// Sanitize the range of a regular expression
|
||||
// The cases are complicated, see test cases for details
|
||||
var sanitizeRange = function sanitizeRange(range) {
|
||||
return range.replace(REGEX_REGEXP_RANGE, function (match, from, to) {
|
||||
return from.charCodeAt(0) <= to.charCodeAt(0) ? match
|
||||
// Invalid range (out of order) which is ok for gitignore rules but
|
||||
// fatal for JavaScript regular expression, so eliminate it.
|
||||
: EMPTY;
|
||||
});
|
||||
};
|
||||
|
||||
// See fixtures #59
|
||||
var cleanRangeBackSlash = function cleanRangeBackSlash(slashes) {
|
||||
var length = slashes.length;
|
||||
return slashes.slice(0, length - length % 2);
|
||||
};
|
||||
|
||||
// > If the pattern ends with a slash,
|
||||
// > it is removed for the purpose of the following description,
|
||||
// > but it would only find a match with a directory.
|
||||
// > In other words, foo/ will match a directory foo and paths underneath it,
|
||||
// > but will not match a regular file or a symbolic link foo
|
||||
// > (this is consistent with the way how pathspec works in general in Git).
|
||||
// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`'
|
||||
// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call
|
||||
// you could use option `mark: true` with `glob`
|
||||
|
||||
// '`foo/`' should not continue with the '`..`'
|
||||
var REPLACERS = [[
|
||||
// remove BOM
|
||||
// TODO:
|
||||
// Other similar zero-width characters?
|
||||
/^\uFEFF/, function () {
|
||||
return EMPTY;
|
||||
}],
|
||||
// > Trailing spaces are ignored unless they are quoted with backslash ("\")
|
||||
[
|
||||
// (a\ ) -> (a )
|
||||
// (a ) -> (a)
|
||||
// (a ) -> (a)
|
||||
// (a \ ) -> (a )
|
||||
/((?:\\\\)*?)(\\?\s+)$/, function (_, m1, m2) {
|
||||
return m1 + (m2.indexOf('\\') === 0 ? SPACE : EMPTY);
|
||||
}],
|
||||
// replace (\ ) with ' '
|
||||
// (\ ) -> ' '
|
||||
// (\\ ) -> '\\ '
|
||||
// (\\\ ) -> '\\ '
|
||||
[/(\\+?)\s/g, function (_, m1) {
|
||||
var length = m1.length;
|
||||
return m1.slice(0, length - length % 2) + SPACE;
|
||||
}],
|
||||
// Escape metacharacters
|
||||
// which is written down by users but means special for regular expressions.
|
||||
|
||||
// > There are 12 characters with special meanings:
|
||||
// > - the backslash \,
|
||||
// > - the caret ^,
|
||||
// > - the dollar sign $,
|
||||
// > - the period or dot .,
|
||||
// > - the vertical bar or pipe symbol |,
|
||||
// > - the question mark ?,
|
||||
// > - the asterisk or star *,
|
||||
// > - the plus sign +,
|
||||
// > - the opening parenthesis (,
|
||||
// > - the closing parenthesis ),
|
||||
// > - and the opening square bracket [,
|
||||
// > - the opening curly brace {,
|
||||
// > These special characters are often called "metacharacters".
|
||||
[/[\\$.|*+(){^]/g, function (match) {
|
||||
return "\\".concat(match);
|
||||
}], [
|
||||
// > a question mark (?) matches a single character
|
||||
/(?!\\)\?/g, function () {
|
||||
return '[^/]';
|
||||
}],
|
||||
// leading slash
|
||||
[
|
||||
// > A leading slash matches the beginning of the pathname.
|
||||
// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
|
||||
// A leading slash matches the beginning of the pathname
|
||||
/^\//, function () {
|
||||
return '^';
|
||||
}],
|
||||
// replace special metacharacter slash after the leading slash
|
||||
[/\//g, function () {
|
||||
return '\\/';
|
||||
}], [
|
||||
// > A leading "**" followed by a slash means match in all directories.
|
||||
// > For example, "**/foo" matches file or directory "foo" anywhere,
|
||||
// > the same as pattern "foo".
|
||||
// > "**/foo/bar" matches file or directory "bar" anywhere that is directly
|
||||
// > under directory "foo".
|
||||
// Notice that the '*'s have been replaced as '\\*'
|
||||
/^\^*\\\*\\\*\\\//,
|
||||
// '**/foo' <-> 'foo'
|
||||
function () {
|
||||
return '^(?:.*\\/)?';
|
||||
}],
|
||||
// starting
|
||||
[
|
||||
// there will be no leading '/'
|
||||
// (which has been replaced by section "leading slash")
|
||||
// If starts with '**', adding a '^' to the regular expression also works
|
||||
/^(?=[^^])/, function startingReplacer() {
|
||||
// If has a slash `/` at the beginning or middle
|
||||
return !/\/(?!$)/.test(this)
|
||||
// > Prior to 2.22.1
|
||||
// > If the pattern does not contain a slash /,
|
||||
// > Git treats it as a shell glob pattern
|
||||
// Actually, if there is only a trailing slash,
|
||||
// git also treats it as a shell glob pattern
|
||||
|
||||
// After 2.22.1 (compatible but clearer)
|
||||
// > If there is a separator at the beginning or middle (or both)
|
||||
// > of the pattern, then the pattern is relative to the directory
|
||||
// > level of the particular .gitignore file itself.
|
||||
// > Otherwise the pattern may also match at any level below
|
||||
// > the .gitignore level.
|
||||
? '(?:^|\\/)'
|
||||
|
||||
// > Otherwise, Git treats the pattern as a shell glob suitable for
|
||||
// > consumption by fnmatch(3)
|
||||
: '^';
|
||||
}],
|
||||
// two globstars
|
||||
[
|
||||
// Use lookahead assertions so that we could match more than one `'/**'`
|
||||
/\\\/\\\*\\\*(?=\\\/|$)/g,
|
||||
// Zero, one or several directories
|
||||
// should not use '*', or it will be replaced by the next replacer
|
||||
|
||||
// Check if it is not the last `'/**'`
|
||||
function (_, index, str) {
|
||||
return index + 6 < str.length
|
||||
|
||||
// case: /**/
|
||||
// > A slash followed by two consecutive asterisks then a slash matches
|
||||
// > zero or more directories.
|
||||
// > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.
|
||||
// '/**/'
|
||||
? '(?:\\/[^\\/]+)*'
|
||||
|
||||
// case: /**
|
||||
// > A trailing `"/**"` matches everything inside.
|
||||
|
||||
// #21: everything inside but it should not include the current folder
|
||||
: '\\/.+';
|
||||
}],
|
||||
// normal intermediate wildcards
|
||||
[
|
||||
// Never replace escaped '*'
|
||||
// ignore rule '\*' will match the path '*'
|
||||
|
||||
// 'abc.*/' -> go
|
||||
// 'abc.*' -> skip this rule,
|
||||
// coz trailing single wildcard will be handed by [trailing wildcard]
|
||||
/(^|[^\\]+)(\\\*)+(?=.+)/g,
|
||||
// '*.js' matches '.js'
|
||||
// '*.js' doesn't match 'abc'
|
||||
function (_, p1, p2) {
|
||||
// 1.
|
||||
// > An asterisk "*" matches anything except a slash.
|
||||
// 2.
|
||||
// > Other consecutive asterisks are considered regular asterisks
|
||||
// > and will match according to the previous rules.
|
||||
var unescaped = p2.replace(/\\\*/g, '[^\\/]*');
|
||||
return p1 + unescaped;
|
||||
}], [
|
||||
// unescape, revert step 3 except for back slash
|
||||
// For example, if a user escape a '\\*',
|
||||
// after step 3, the result will be '\\\\\\*'
|
||||
/\\\\\\(?=[$.|*+(){^])/g, function () {
|
||||
return ESCAPE;
|
||||
}], [
|
||||
// '\\\\' -> '\\'
|
||||
/\\\\/g, function () {
|
||||
return ESCAPE;
|
||||
}], [
|
||||
// > The range notation, e.g. [a-zA-Z],
|
||||
// > can be used to match one of the characters in a range.
|
||||
|
||||
// `\` is escaped by step 3
|
||||
/(\\)?\[([^\]/]*?)(\\*)($|\])/g, function (match, leadEscape, range, endEscape, close) {
|
||||
return leadEscape === ESCAPE
|
||||
// '\\[bar]' -> '\\\\[bar\\]'
|
||||
? "\\[".concat(range).concat(cleanRangeBackSlash(endEscape)).concat(close) : close === ']' ? endEscape.length % 2 === 0
|
||||
// A normal case, and it is a range notation
|
||||
// '[bar]'
|
||||
// '[bar\\\\]'
|
||||
? "[".concat(sanitizeRange(range)).concat(endEscape, "]") // Invalid range notaton
|
||||
// '[bar\\]' -> '[bar\\\\]'
|
||||
: '[]' : '[]';
|
||||
}],
|
||||
// ending
|
||||
[
|
||||
// 'js' will not match 'js.'
|
||||
// 'ab' will not match 'abc'
|
||||
/(?:[^*])$/,
|
||||
// WTF!
|
||||
// https://git-scm.com/docs/gitignore
|
||||
// changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
|
||||
// which re-fixes #24, #38
|
||||
|
||||
// > If there is a separator at the end of the pattern then the pattern
|
||||
// > will only match directories, otherwise the pattern can match both
|
||||
// > files and directories.
|
||||
|
||||
// 'js*' will not match 'a.js'
|
||||
// 'js/' will not match 'a.js'
|
||||
// 'js' will match 'a.js' and 'a.js/'
|
||||
function (match) {
|
||||
return /\/$/.test(match)
|
||||
// foo/ will not match 'foo'
|
||||
? "".concat(match, "$") // foo matches 'foo' and 'foo/'
|
||||
: "".concat(match, "(?=$|\\/$)");
|
||||
}],
|
||||
// trailing wildcard
|
||||
[/(\^|\\\/)?\\\*$/, function (_, p1) {
|
||||
var prefix = p1
|
||||
// '\^':
|
||||
// '/*' does not match EMPTY
|
||||
// '/*' does not match everything
|
||||
|
||||
// '\\\/':
|
||||
// 'abc/*' does not match 'abc/'
|
||||
? "".concat(p1, "[^/]+") // 'a*' matches 'a'
|
||||
// 'a*' matches 'aa'
|
||||
: '[^/]*';
|
||||
return "".concat(prefix, "(?=$|\\/$)");
|
||||
}]];
|
||||
|
||||
// A simple cache, because an ignore rule only has only one certain meaning
|
||||
var regexCache = Object.create(null);
|
||||
|
||||
// @param {pattern}
|
||||
var makeRegex = function makeRegex(pattern, ignoreCase) {
|
||||
var source = regexCache[pattern];
|
||||
if (!source) {
|
||||
source = REPLACERS.reduce(function (prev, _ref) {
|
||||
var _ref2 = _slicedToArray(_ref, 2),
|
||||
matcher = _ref2[0],
|
||||
replacer = _ref2[1];
|
||||
return prev.replace(matcher, replacer.bind(pattern));
|
||||
}, pattern);
|
||||
regexCache[pattern] = source;
|
||||
}
|
||||
return ignoreCase ? new RegExp(source, 'i') : new RegExp(source);
|
||||
};
|
||||
var isString = function isString(subject) {
|
||||
return typeof subject === 'string';
|
||||
};
|
||||
|
||||
// > A blank line matches no files, so it can serve as a separator for readability.
|
||||
var checkPattern = function checkPattern(pattern) {
|
||||
return pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern)
|
||||
|
||||
// > A line starting with # serves as a comment.
|
||||
&& pattern.indexOf('#') !== 0;
|
||||
};
|
||||
var splitPattern = function splitPattern(pattern) {
|
||||
return pattern.split(REGEX_SPLITALL_CRLF);
|
||||
};
|
||||
var IgnoreRule = /*#__PURE__*/_createClass(function IgnoreRule(origin, pattern, negative, regex) {
|
||||
_classCallCheck(this, IgnoreRule);
|
||||
this.origin = origin;
|
||||
this.pattern = pattern;
|
||||
this.negative = negative;
|
||||
this.regex = regex;
|
||||
});
|
||||
var createRule = function createRule(pattern, ignoreCase) {
|
||||
var origin = pattern;
|
||||
var negative = false;
|
||||
|
||||
// > An optional prefix "!" which negates the pattern;
|
||||
if (pattern.indexOf('!') === 0) {
|
||||
negative = true;
|
||||
pattern = pattern.substr(1);
|
||||
}
|
||||
pattern = pattern
|
||||
// > Put a backslash ("\") in front of the first "!" for patterns that
|
||||
// > begin with a literal "!", for example, `"\!important!.txt"`.
|
||||
.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!')
|
||||
// > Put a backslash ("\") in front of the first hash for patterns that
|
||||
// > begin with a hash.
|
||||
.replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#');
|
||||
var regex = makeRegex(pattern, ignoreCase);
|
||||
return new IgnoreRule(origin, pattern, negative, regex);
|
||||
};
|
||||
var throwError = function throwError(message, Ctor) {
|
||||
throw new Ctor(message);
|
||||
};
|
||||
var checkPath = function checkPath(path, originalPath, doThrow) {
|
||||
if (!isString(path)) {
|
||||
return doThrow("path must be a string, but got `".concat(originalPath, "`"), TypeError);
|
||||
}
|
||||
|
||||
// We don't know if we should ignore EMPTY, so throw
|
||||
if (!path) {
|
||||
return doThrow("path must not be empty", TypeError);
|
||||
}
|
||||
|
||||
// Check if it is a relative path
|
||||
if (checkPath.isNotRelative(path)) {
|
||||
var r = '`path.relative()`d';
|
||||
return doThrow("path should be a ".concat(r, " string, but got \"").concat(originalPath, "\""), RangeError);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
var isNotRelative = function isNotRelative(path) {
|
||||
return REGEX_TEST_INVALID_PATH.test(path);
|
||||
};
|
||||
checkPath.isNotRelative = isNotRelative;
|
||||
checkPath.convert = function (p) {
|
||||
return p;
|
||||
};
|
||||
var Ignore = /*#__PURE__*/function () {
|
||||
function Ignore() {
|
||||
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
||||
_ref3$ignorecase = _ref3.ignorecase,
|
||||
ignorecase = _ref3$ignorecase === void 0 ? true : _ref3$ignorecase,
|
||||
_ref3$ignoreCase = _ref3.ignoreCase,
|
||||
ignoreCase = _ref3$ignoreCase === void 0 ? ignorecase : _ref3$ignoreCase,
|
||||
_ref3$allowRelativePa = _ref3.allowRelativePaths,
|
||||
allowRelativePaths = _ref3$allowRelativePa === void 0 ? false : _ref3$allowRelativePa;
|
||||
_classCallCheck(this, Ignore);
|
||||
define(this, KEY_IGNORE, true);
|
||||
this._rules = [];
|
||||
this._ignoreCase = ignoreCase;
|
||||
this._allowRelativePaths = allowRelativePaths;
|
||||
this._initCache();
|
||||
}
|
||||
_createClass(Ignore, [{
|
||||
key: "_initCache",
|
||||
value: function _initCache() {
|
||||
this._ignoreCache = Object.create(null);
|
||||
this._testCache = Object.create(null);
|
||||
}
|
||||
}, {
|
||||
key: "_addPattern",
|
||||
value: function _addPattern(pattern) {
|
||||
// #32
|
||||
if (pattern && pattern[KEY_IGNORE]) {
|
||||
this._rules = this._rules.concat(pattern._rules);
|
||||
this._added = true;
|
||||
return;
|
||||
}
|
||||
if (checkPattern(pattern)) {
|
||||
var rule = createRule(pattern, this._ignoreCase);
|
||||
this._added = true;
|
||||
this._rules.push(rule);
|
||||
}
|
||||
}
|
||||
|
||||
// @param {Array<string> | string | Ignore} pattern
|
||||
}, {
|
||||
key: "add",
|
||||
value: function add(pattern) {
|
||||
this._added = false;
|
||||
makeArray(isString(pattern) ? splitPattern(pattern) : pattern).forEach(this._addPattern, this);
|
||||
|
||||
// Some rules have just added to the ignore,
|
||||
// making the behavior changed.
|
||||
if (this._added) {
|
||||
this._initCache();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// legacy
|
||||
}, {
|
||||
key: "addPattern",
|
||||
value: function addPattern(pattern) {
|
||||
return this.add(pattern);
|
||||
}
|
||||
|
||||
// | 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
|
||||
|
||||
// @param {boolean} whether should check if the path is unignored,
|
||||
// setting `checkUnignored` to `false` could reduce additional
|
||||
// path matching.
|
||||
|
||||
// @returns {TestResult} true if a file is ignored
|
||||
}, {
|
||||
key: "_testOne",
|
||||
value: function _testOne(path, checkUnignored) {
|
||||
var ignored = false;
|
||||
var unignored = false;
|
||||
this._rules.forEach(function (rule) {
|
||||
var negative = rule.negative;
|
||||
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
|
||||
return;
|
||||
}
|
||||
var matched = rule.regex.test(path);
|
||||
if (matched) {
|
||||
ignored = !negative;
|
||||
unignored = negative;
|
||||
}
|
||||
});
|
||||
return {
|
||||
ignored: ignored,
|
||||
unignored: unignored
|
||||
};
|
||||
}
|
||||
|
||||
// @returns {TestResult}
|
||||
}, {
|
||||
key: "_test",
|
||||
value: function _test(originalPath, cache, checkUnignored, slices) {
|
||||
var path = originalPath
|
||||
// Supports nullable path
|
||||
&& checkPath.convert(originalPath);
|
||||
checkPath(path, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
|
||||
return this._t(path, cache, checkUnignored, slices);
|
||||
}
|
||||
}, {
|
||||
key: "_t",
|
||||
value: function _t(path, cache, checkUnignored, slices) {
|
||||
if (path in cache) {
|
||||
return cache[path];
|
||||
}
|
||||
if (!slices) {
|
||||
// path/to/a.js
|
||||
// ['path', 'to', 'a.js']
|
||||
slices = path.split(SLASH);
|
||||
}
|
||||
slices.pop();
|
||||
|
||||
// If the path has no parent directory, just test it
|
||||
if (!slices.length) {
|
||||
return cache[path] = this._testOne(path, checkUnignored);
|
||||
}
|
||||
var parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices);
|
||||
|
||||
// If the path contains a parent directory, check the parent first
|
||||
return cache[path] = parent.ignored
|
||||
// > It is not possible to re-include a file if a parent directory of
|
||||
// > that file is excluded.
|
||||
? parent : this._testOne(path, checkUnignored);
|
||||
}
|
||||
}, {
|
||||
key: "ignores",
|
||||
value: function ignores(path) {
|
||||
return this._test(path, this._ignoreCache, false).ignored;
|
||||
}
|
||||
}, {
|
||||
key: "createFilter",
|
||||
value: function createFilter() {
|
||||
var _this = this;
|
||||
return function (path) {
|
||||
return !_this.ignores(path);
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: "filter",
|
||||
value: function filter(paths) {
|
||||
return makeArray(paths).filter(this.createFilter());
|
||||
}
|
||||
|
||||
// @returns {TestResult}
|
||||
}, {
|
||||
key: "test",
|
||||
value: function test(path) {
|
||||
return this._test(path, this._testCache, true);
|
||||
}
|
||||
}]);
|
||||
return Ignore;
|
||||
}();
|
||||
var factory = function factory(options) {
|
||||
return new Ignore(options);
|
||||
};
|
||||
var isPathValid = function isPathValid(path) {
|
||||
return checkPath(path && checkPath.convert(path), path, RETURN_FALSE);
|
||||
};
|
||||
factory.isPathValid = isPathValid;
|
||||
|
||||
// Fixes typescript
|
||||
factory["default"] = factory;
|
||||
module.exports = factory;
|
||||
|
||||
// Windows
|
||||
// --------------------------------------------------------------
|
||||
/* istanbul ignore if */
|
||||
if (
|
||||
// Detect `process` so that it can run in browsers.
|
||||
typeof process !== 'undefined' && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === 'win32')) {
|
||||
/* eslint no-control-regex: "off" */
|
||||
var makePosix = function makePosix(str) {
|
||||
return /^\\\\\?\\/.test(str) || /[\0-\x1F"<>\|]+/.test(str) ? str : str.replace(/\\/g, '/');
|
||||
};
|
||||
checkPath.convert = makePosix;
|
||||
|
||||
// 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/'
|
||||
// 'd:\\foo'
|
||||
var REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
||||
checkPath.isNotRelative = function (path) {
|
||||
return REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path);
|
||||
};
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _callSuper;
|
||||
var _getPrototypeOf = require("./getPrototypeOf.js");
|
||||
var _isNativeReflectConstruct = require("./isNativeReflectConstruct.js");
|
||||
var _possibleConstructorReturn = require("./possibleConstructorReturn.js");
|
||||
function _callSuper(_this, derived, args) {
|
||||
derived = (0, _getPrototypeOf.default)(derived);
|
||||
return (0, _possibleConstructorReturn.default)(_this, (0, _isNativeReflectConstruct.default)() ? Reflect.construct(derived, args || [], (0, _getPrototypeOf.default)(_this).constructor) : derived.apply(_this, args));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=callSuper.js.map
|
||||
@@ -0,0 +1,3 @@
|
||||
These files are compiled dot templates from dot folder.
|
||||
|
||||
Do NOT edit them directly, edit the templates and run `npm run build` from main ajv folder.
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_defineProperty","require","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread2","target","i","arguments","length","source","forEach","key","defineProperty","getOwnPropertyDescriptors","defineProperties"],"sources":["../../src/helpers/objectSpread2.ts"],"sourcesContent":["/* @minVersion 7.5.0 */\n\nimport defineProperty from \"./defineProperty.ts\";\n\n// This function is different to \"Reflect.ownKeys\". The enumerableOnly\n// filters on symbol properties only. Returned string properties are always\n// enumerable. It is good to use in objectSpread.\n\nfunction ownKeys(\n object: object,\n enumerableOnly?: boolean | undefined,\n): (string | symbol)[] {\n var keys: (string | symbol)[] = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n // sym already comes from `Object.getOwnPropertySymbols`, so getOwnPropertyDescriptor should always be defined\n return Object.getOwnPropertyDescriptor(object, sym)!.enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\n\ntype Intersection<R extends any[]> = R extends [infer H, ...infer S]\n ? H & Intersection<S>\n : unknown;\n\nexport default function _objectSpread2<T extends object, U extends unknown[]>(\n target: T,\n ...sources: U\n): T & Intersection<U>;\nexport default function _objectSpread2(target: object) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(\n target,\n key,\n // key already comes from ownKeys, so getOwnPropertyDescriptor should always be defined\n Object.getOwnPropertyDescriptor(source, key)!,\n );\n });\n }\n }\n return target;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AAMA,SAASC,OAAOA,CACdC,MAAc,EACdC,cAAoC,EACf;EACrB,IAAIC,IAAyB,GAAGC,MAAM,CAACD,IAAI,CAACF,MAAM,CAAC;EACnD,IAAIG,MAAM,CAACC,qBAAqB,EAAE;IAChC,IAAIC,OAAO,GAAGF,MAAM,CAACC,qBAAqB,CAACJ,MAAM,CAAC;IAClD,IAAIC,cAAc,EAAE;MAClBI,OAAO,GAAGA,OAAO,CAACC,MAAM,CAAC,UAAUC,GAAG,EAAE;QAEtC,OAAOJ,MAAM,CAACK,wBAAwB,CAACR,MAAM,EAAEO,GAAG,CAAC,CAAEE,UAAU;MACjE,CAAC,CAAC;IACJ;IACAP,IAAI,CAACQ,IAAI,CAACC,KAAK,CAACT,IAAI,EAAEG,OAAO,CAAC;EAChC;EACA,OAAOH,IAAI;AACb;AAUe,SAASU,cAAcA,CAACC,MAAc,EAAE;EACrD,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGC,SAAS,CAACC,MAAM,EAAEF,CAAC,EAAE,EAAE;IACzC,IAAIG,MAAM,GAAGF,SAAS,CAACD,CAAC,CAAC,IAAI,IAAI,GAAGC,SAAS,CAACD,CAAC,CAAC,GAAG,CAAC,CAAC;IACrD,IAAIA,CAAC,GAAG,CAAC,EAAE;MACTf,OAAO,CAACI,MAAM,CAACc,MAAM,CAAC,EAAE,IAAI,CAAC,CAACC,OAAO,CAAC,UAAUC,GAAG,EAAE;QACnD,IAAAC,uBAAc,EAACP,MAAM,EAAEM,GAAG,EAAEF,MAAM,CAACE,GAAG,CAAC,CAAC;MAC1C,CAAC,CAAC;IACJ,CAAC,MAAM,IAAIhB,MAAM,CAACkB,yBAAyB,EAAE;MAC3ClB,MAAM,CAACmB,gBAAgB,CAACT,MAAM,EAAEV,MAAM,CAACkB,yBAAyB,CAACJ,MAAM,CAAC,CAAC;IAC3E,CAAC,MAAM;MACLlB,OAAO,CAACI,MAAM,CAACc,MAAM,CAAC,CAAC,CAACC,OAAO,CAAC,UAAUC,GAAG,EAAE;QAC7ChB,MAAM,CAACiB,cAAc,CACnBP,MAAM,EACNM,GAAG,EAEHhB,MAAM,CAACK,wBAAwB,CAACS,MAAM,EAAEE,GAAG,CAC7C,CAAC;MACH,CAAC,CAAC;IACJ;EACF;EACA,OAAON,MAAM;AACf","ignoreList":[]}
|
||||
@@ -0,0 +1,166 @@
|
||||
/**
|
||||
* @fileoverview Rule to enforce line breaks between arguments of a function call
|
||||
* @author Alexey Gonchar <https://github.com/finico>
|
||||
* @deprecated in ESLint v8.53.0
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
deprecated: {
|
||||
message: "Formatting rules are being moved out of ESLint core.",
|
||||
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
||||
deprecatedSince: "8.53.0",
|
||||
availableUntil: "10.0.0",
|
||||
replacedBy: [
|
||||
{
|
||||
message:
|
||||
"ESLint Stylistic now maintains deprecated stylistic core rules.",
|
||||
url: "https://eslint.style/guide/migration",
|
||||
plugin: {
|
||||
name: "@stylistic/eslint-plugin-js",
|
||||
url: "https://eslint.style/packages/js",
|
||||
},
|
||||
rule: {
|
||||
name: "function-call-argument-newline",
|
||||
url: "https://eslint.style/rules/js/function-call-argument-newline",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
type: "layout",
|
||||
|
||||
docs: {
|
||||
description:
|
||||
"Enforce line breaks between arguments of a function call",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/latest/rules/function-call-argument-newline",
|
||||
},
|
||||
|
||||
fixable: "whitespace",
|
||||
|
||||
schema: [
|
||||
{
|
||||
enum: ["always", "never", "consistent"],
|
||||
},
|
||||
],
|
||||
|
||||
messages: {
|
||||
unexpectedLineBreak: "There should be no line break here.",
|
||||
missingLineBreak:
|
||||
"There should be a line break after this argument.",
|
||||
},
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const sourceCode = context.sourceCode;
|
||||
|
||||
const checkers = {
|
||||
unexpected: {
|
||||
messageId: "unexpectedLineBreak",
|
||||
check: (prevToken, currentToken) =>
|
||||
prevToken.loc.end.line !== currentToken.loc.start.line,
|
||||
createFix: (token, tokenBefore) => fixer =>
|
||||
fixer.replaceTextRange(
|
||||
[tokenBefore.range[1], token.range[0]],
|
||||
" ",
|
||||
),
|
||||
},
|
||||
missing: {
|
||||
messageId: "missingLineBreak",
|
||||
check: (prevToken, currentToken) =>
|
||||
prevToken.loc.end.line === currentToken.loc.start.line,
|
||||
createFix: (token, tokenBefore) => fixer =>
|
||||
fixer.replaceTextRange(
|
||||
[tokenBefore.range[1], token.range[0]],
|
||||
"\n",
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Check all arguments for line breaks in the CallExpression
|
||||
* @param {CallExpression} node node to evaluate
|
||||
* @param {{ messageId: string, check: Function }} checker selected checker
|
||||
* @returns {void}
|
||||
* @private
|
||||
*/
|
||||
function checkArguments(node, checker) {
|
||||
for (let i = 1; i < node.arguments.length; i++) {
|
||||
const prevArgToken = sourceCode.getLastToken(
|
||||
node.arguments[i - 1],
|
||||
);
|
||||
const currentArgToken = sourceCode.getFirstToken(
|
||||
node.arguments[i],
|
||||
);
|
||||
|
||||
if (checker.check(prevArgToken, currentArgToken)) {
|
||||
const tokenBefore = sourceCode.getTokenBefore(
|
||||
currentArgToken,
|
||||
{ includeComments: true },
|
||||
);
|
||||
|
||||
const hasLineCommentBefore = tokenBefore.type === "Line";
|
||||
|
||||
context.report({
|
||||
node,
|
||||
loc: {
|
||||
start: tokenBefore.loc.end,
|
||||
end: currentArgToken.loc.start,
|
||||
},
|
||||
messageId: checker.messageId,
|
||||
fix: hasLineCommentBefore
|
||||
? null
|
||||
: checker.createFix(currentArgToken, tokenBefore),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if open space is present in a function name
|
||||
* @param {CallExpression} node node to evaluate
|
||||
* @returns {void}
|
||||
* @private
|
||||
*/
|
||||
function check(node) {
|
||||
if (node.arguments.length < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
const option = context.options[0] || "always";
|
||||
|
||||
if (option === "never") {
|
||||
checkArguments(node, checkers.unexpected);
|
||||
} else if (option === "always") {
|
||||
checkArguments(node, checkers.missing);
|
||||
} else if (option === "consistent") {
|
||||
const firstArgToken = sourceCode.getLastToken(
|
||||
node.arguments[0],
|
||||
);
|
||||
const secondArgToken = sourceCode.getFirstToken(
|
||||
node.arguments[1],
|
||||
);
|
||||
|
||||
if (
|
||||
firstArgToken.loc.end.line === secondArgToken.loc.start.line
|
||||
) {
|
||||
checkArguments(node, checkers.unexpected);
|
||||
} else {
|
||||
checkArguments(node, checkers.missing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
CallExpression: check,
|
||||
NewExpression: check,
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _interopRequireDefault;
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=interopRequireDefault.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["tsRewriteRelativeImportExtensions","path","preserveJsx","test","replace","m","tsx","d","ext","cm","toLowerCase"],"sources":["../../src/helpers/tsRewriteRelativeImportExtensions.ts"],"sourcesContent":["/* @minVersion 7.27.0 */\n\n// https://github.com/microsoft/TypeScript/blob/71716a2868c87248af5020e33a84a2178d41a2d6/src/compiler/factory/emitHelpers.ts#L1451\nexport default function tsRewriteRelativeImportExtensions(\n path: unknown,\n preserveJsx?: boolean,\n) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(\n /\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+)?)\\.([cm]?)ts$/i,\n function (m, tsx, d, ext, cm) {\n return tsx\n ? preserveJsx\n ? \".jsx\"\n : \".js\"\n : d && (!ext || !cm)\n ? m\n : d + ext + \".\" + cm.toLowerCase() + \"js\";\n },\n );\n }\n return path;\n}\n"],"mappings":";;;;;;AAGe,SAASA,iCAAiCA,CACvDC,IAAa,EACbC,WAAqB,EACrB;EACA,IAAI,OAAOD,IAAI,KAAK,QAAQ,IAAI,UAAU,CAACE,IAAI,CAACF,IAAI,CAAC,EAAE;IACrD,OAAOA,IAAI,CAACG,OAAO,CACjB,iDAAiD,EACjD,UAAUC,CAAC,EAAEC,GAAG,EAAEC,CAAC,EAAEC,GAAG,EAAEC,EAAE,EAAE;MAC5B,OAAOH,GAAG,GACNJ,WAAW,GACT,MAAM,GACN,KAAK,GACPK,CAAC,KAAK,CAACC,GAAG,IAAI,CAACC,EAAE,CAAC,GAChBJ,CAAC,GACDE,CAAC,GAAGC,GAAG,GAAG,GAAG,GAAGC,EAAE,CAACC,WAAW,CAAC,CAAC,GAAG,IAAI;IAC/C,CACF,CAAC;EACH;EACA,OAAOT,IAAI;AACb","ignoreList":[]}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_semver","require","_targets","prettifyVersion","version","major","minor","patch","semver","parse","parts","push","join","prettifyTargets","targets","Object","keys","reduce","results","target","value","unreleasedLabel","unreleasedLabels"],"sources":["../src/pretty.ts"],"sourcesContent":["import semver from \"semver\";\nimport { unreleasedLabels } from \"./targets.ts\";\nimport type { Targets, Target } from \"./types.ts\";\n\nexport function prettifyVersion(version: string) {\n if (typeof version !== \"string\") {\n return version;\n }\n\n const { major, minor, patch } = semver.parse(version);\n\n const parts = [major];\n\n if (minor || patch) {\n parts.push(minor);\n }\n\n if (patch) {\n parts.push(patch);\n }\n\n return parts.join(\".\");\n}\n\nexport function prettifyTargets(targets: Targets): Targets {\n return Object.keys(targets).reduce((results, target: Target) => {\n let value = targets[target];\n\n const unreleasedLabel =\n // @ts-expect-error undefined is strictly compared with string later\n unreleasedLabels[target];\n if (typeof value === \"string\" && unreleasedLabel !== value) {\n value = prettifyVersion(value);\n }\n\n results[target] = value;\n return results;\n }, {} as Targets);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAGO,SAASE,eAAeA,CAACC,OAAe,EAAE;EAC/C,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IAC/B,OAAOA,OAAO;EAChB;EAEA,MAAM;IAAEC,KAAK;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGC,OAAM,CAACC,KAAK,CAACL,OAAO,CAAC;EAErD,MAAMM,KAAK,GAAG,CAACL,KAAK,CAAC;EAErB,IAAIC,KAAK,IAAIC,KAAK,EAAE;IAClBG,KAAK,CAACC,IAAI,CAACL,KAAK,CAAC;EACnB;EAEA,IAAIC,KAAK,EAAE;IACTG,KAAK,CAACC,IAAI,CAACJ,KAAK,CAAC;EACnB;EAEA,OAAOG,KAAK,CAACE,IAAI,CAAC,GAAG,CAAC;AACxB;AAEO,SAASC,eAAeA,CAACC,OAAgB,EAAW;EACzD,OAAOC,MAAM,CAACC,IAAI,CAACF,OAAO,CAAC,CAACG,MAAM,CAAC,CAACC,OAAO,EAAEC,MAAc,KAAK;IAC9D,IAAIC,KAAK,GAAGN,OAAO,CAACK,MAAM,CAAC;IAE3B,MAAME,eAAe,GAEnBC,yBAAgB,CAACH,MAAM,CAAC;IAC1B,IAAI,OAAOC,KAAK,KAAK,QAAQ,IAAIC,eAAe,KAAKD,KAAK,EAAE;MAC1DA,KAAK,GAAGjB,eAAe,CAACiB,KAAK,CAAC;IAChC;IAEAF,OAAO,CAACC,MAAM,CAAC,GAAGC,KAAK;IACvB,OAAOF,OAAO;EAChB,CAAC,EAAE,CAAC,CAAY,CAAC;AACnB","ignoreList":[]}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"102":0.00316,"115":0.03472,"120":0.16096,"128":0.00947,"133":0.00316,"134":0.00316,"135":0.36294,"136":0.56177,_:"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 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 121 122 123 124 125 126 127 129 130 131 132 137 138 139 140 3.5 3.6"},D:{"39":0.00316,"40":0.00316,"41":0.00316,"42":0.00316,"45":0.00316,"46":0.00316,"47":0.00316,"48":0.00316,"50":0.00316,"51":0.00316,"52":0.00316,"53":0.00316,"54":0.00316,"56":0.00316,"57":0.00316,"58":0.00316,"59":0.00316,"60":0.00631,"76":0.00316,"79":0.00631,"81":0.00316,"86":0.00316,"87":0.00316,"88":0.50812,"91":0.07574,"92":0.00316,"93":0.01894,"94":0.00316,"102":0.01578,"103":0.06312,"105":0.00316,"108":0.00316,"109":0.06312,"112":0.00316,"113":0.01262,"114":0.21776,"116":0.08837,"119":0.00631,"120":0.00947,"121":0.00316,"122":0.08521,"123":0.00316,"124":0.01578,"125":0.01894,"126":0.03472,"127":0.00316,"128":0.03787,"129":0.00631,"130":0.01894,"131":0.14833,"132":0.1578,"133":2.4964,"134":4.27322,"135":0.01262,"136":0.00316,_:"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 43 44 49 55 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 77 78 80 83 84 85 89 90 95 96 97 98 99 100 101 104 106 107 110 111 115 117 118 137 138"},F:{"87":0.00316,"88":0.00316,"95":0.00947,"115":0.00316,"116":0.09784,"117":0.68485,_:"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 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00316,"109":0.04734,"113":0.00316,"114":0.02525,"126":0.00631,"127":0.00316,"131":0.00631,"132":0.01262,"133":0.52074,"134":1.28449,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 115 116 117 118 119 120 121 122 123 124 125 128 129 130"},E:{"15":0.00316,_:"0 4 5 6 7 8 9 10 11 12 13 14 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1","13.1":0.15149,"14.1":0.00631,"15.1":0.07574,"15.2-15.3":0.0284,"15.4":0.06628,"15.5":0.0284,"15.6":0.57124,"16.0":0.00316,"16.1":0.08837,"16.2":0.11362,"16.3":0.07574,"16.4":0.05681,"16.5":0.03787,"16.6":0.88368,"17.0":0.00947,"17.1":1.0257,"17.2":0.10099,"17.3":0.08837,"17.4":0.14518,"17.5":0.34716,"17.6":1.46438,"18.0":0.11677,"18.1":0.53652,"18.2":0.27142,"18.3":10.97657,"18.4":0.06943},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00993,"5.0-5.1":0,"6.0-6.1":0.0298,"7.0-7.1":0.01987,"8.1-8.4":0,"9.0-9.2":0.0149,"9.3":0.06954,"10.0-10.2":0.00497,"10.3":0.11425,"11.0-11.2":0.52654,"11.3-11.4":0.03477,"12.0-12.1":0.01987,"12.2-12.5":0.49177,"13.0-13.1":0.00993,"13.2":0.0149,"13.3":0.01987,"13.4-13.7":0.06954,"14.0-14.4":0.17386,"14.5-14.8":0.20863,"15.0-15.1":0.11425,"15.2-15.3":0.11425,"15.4":0.13909,"15.5":0.15896,"15.6-15.8":1.95715,"16.0":0.27817,"16.1":0.57125,"16.2":0.29804,"16.3":0.51661,"16.4":0.11425,"16.5":0.2136,"16.6-16.7":2.31976,"17.0":0.13909,"17.1":0.24837,"17.2":0.18876,"17.3":0.26327,"17.4":0.52654,"17.5":1.1723,"17.6-17.7":3.40265,"18.0":0.95374,"18.1":3.11951,"18.2":1.39583,"18.3":29.17339,"18.4":0.43216},P:{"4":0.02093,"22":0.01047,"23":0.01047,"24":0.01047,"25":0.01047,"27":0.99439,_:"20 21 26 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.01047},I:{"0":0.14342,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00004,"4.4":0,"4.4.3-4.4.4":0.00016},K:{"0":0.08213,_:"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.67756},Q:{_:"14.9"},O:{"0":0.02053},H:{"0":0},L:{"0":17.69552}};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_arrayLikeToArray","require","_arrayWithoutHoles","arr","Array","isArray","arrayLikeToArray"],"sources":["../../src/helpers/arrayWithoutHoles.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport arrayLikeToArray from \"./arrayLikeToArray.ts\";\n\nexport default function _arrayWithoutHoles<T>(arr: Array<T>) {\n if (Array.isArray(arr)) return arrayLikeToArray<T>(arr);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAEe,SAASC,kBAAkBA,CAAIC,GAAa,EAAE;EAC3D,IAAIC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,EAAE,OAAO,IAAAG,yBAAgB,EAAIH,GAAG,CAAC;AACzD","ignoreList":[]}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB 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 n o p q r","194":"s t u","516":"0 9 v w x y z AB"},C:{"1":"0 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"1 2 3 4 5 6 7 8 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x qC rC","322":"y z"},D:{"1":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r","194":"s t u","516":"0 9 v w x y z AB"},E:{"1":"cC dC eC fC 2C KC gC hC iC jC 3C","2":"J PB K D E F A B C L M G sC SC tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC","516":"aC 1C JC bC"},F:{"1":"0 p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d 4C 5C 6C 7C FC kC 8C GC","194":"e f g","516":"h i j k l m n o"},G:{"1":"cC dC eC fC VD KC gC hC iC jC","2":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC","516":"aC UD JC bC"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"2":"HC"},P:{"2":"1 2 3 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD","516":"4 5 6 7 8"},Q:{"2":"oD"},R:{"2":"pD"},S:{"2":"qD rD"}},B:5,C:"CSS Nesting",D:true};
|
||||
@@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
const fs = require('fs');
|
||||
const {promisify} = require('util');
|
||||
|
||||
const pAccess = promisify(fs.access);
|
||||
|
||||
module.exports = async path => {
|
||||
try {
|
||||
await pAccess(path);
|
||||
return true;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports.sync = path => {
|
||||
try {
|
||||
fs.accessSync(path);
|
||||
return true;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,61 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const Range = require('../classes/range')
|
||||
const gt = require('../functions/gt')
|
||||
|
||||
const minVersion = (range, loose) => {
|
||||
range = new Range(range, loose)
|
||||
|
||||
let minver = new SemVer('0.0.0')
|
||||
if (range.test(minver)) {
|
||||
return minver
|
||||
}
|
||||
|
||||
minver = new SemVer('0.0.0-0')
|
||||
if (range.test(minver)) {
|
||||
return minver
|
||||
}
|
||||
|
||||
minver = null
|
||||
for (let i = 0; i < range.set.length; ++i) {
|
||||
const comparators = range.set[i]
|
||||
|
||||
let setMin = null
|
||||
comparators.forEach((comparator) => {
|
||||
// Clone to avoid manipulating the comparator's semver object.
|
||||
const compver = new SemVer(comparator.semver.version)
|
||||
switch (comparator.operator) {
|
||||
case '>':
|
||||
if (compver.prerelease.length === 0) {
|
||||
compver.patch++
|
||||
} else {
|
||||
compver.prerelease.push(0)
|
||||
}
|
||||
compver.raw = compver.format()
|
||||
/* fallthrough */
|
||||
case '':
|
||||
case '>=':
|
||||
if (!setMin || gt(compver, setMin)) {
|
||||
setMin = compver
|
||||
}
|
||||
break
|
||||
case '<':
|
||||
case '<=':
|
||||
/* Ignore maximum versions */
|
||||
break
|
||||
/* istanbul ignore next */
|
||||
default:
|
||||
throw new Error(`Unexpected operation: ${comparator.operator}`)
|
||||
}
|
||||
})
|
||||
if (setMin && (!minver || gt(minver, setMin))) {
|
||||
minver = setMin
|
||||
}
|
||||
}
|
||||
|
||||
if (minver && range.test(minver)) {
|
||||
return minver
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
module.exports = minVersion
|
||||
@@ -0,0 +1,10 @@
|
||||
import * as React from "react";
|
||||
const matchContext = React.createContext(void 0);
|
||||
const dummyMatchContext = React.createContext(
|
||||
void 0
|
||||
);
|
||||
export {
|
||||
dummyMatchContext,
|
||||
matchContext
|
||||
};
|
||||
//# sourceMappingURL=matchContext.js.map
|
||||
@@ -0,0 +1,42 @@
|
||||
Browser-friendly inheritance fully compatible with standard node.js
|
||||
[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
|
||||
|
||||
This package exports standard `inherits` from node.js `util` module in
|
||||
node environment, but also provides alternative browser-friendly
|
||||
implementation through [browser
|
||||
field](https://gist.github.com/shtylman/4339901). Alternative
|
||||
implementation is a literal copy of standard one located in standalone
|
||||
module to avoid requiring of `util`. It also has a shim for old
|
||||
browsers with no `Object.create` support.
|
||||
|
||||
While keeping you sure you are using standard `inherits`
|
||||
implementation in node.js environment, it allows bundlers such as
|
||||
[browserify](https://github.com/substack/node-browserify) to not
|
||||
include full `util` package to your client code if all you need is
|
||||
just `inherits` function. It worth, because browser shim for `util`
|
||||
package is large and `inherits` is often the single function you need
|
||||
from it.
|
||||
|
||||
It's recommended to use this package instead of
|
||||
`require('util').inherits` for any code that has chances to be used
|
||||
not only in node.js but in browser too.
|
||||
|
||||
## usage
|
||||
|
||||
```js
|
||||
var inherits = require('inherits');
|
||||
// then use exactly as the standard one
|
||||
```
|
||||
|
||||
## note on version ~1.0
|
||||
|
||||
Version ~1.0 had completely different motivation and is not compatible
|
||||
neither with 2.0 nor with standard node.js `inherits`.
|
||||
|
||||
If you are using version ~1.0 and planning to switch to ~2.0, be
|
||||
careful:
|
||||
|
||||
* new version uses `super_` instead of `super` for referencing
|
||||
superclass
|
||||
* new version overwrites current prototype while old one preserves any
|
||||
existing fields on it
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"useLoaderData.cjs","sources":["../../src/useLoaderData.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type {\n StructuralSharingOption,\n ValidateSelected,\n} from './structuralSharing'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseLoaderData,\n StrictOrFrom,\n UseLoaderDataResult,\n} from '@tanstack/router-core'\n\nexport interface UseLoaderDataBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TSelected,\n TStructuralSharing,\n> {\n select?: (\n match: ResolveUseLoaderData<TRouter, TFrom, TStrict>,\n ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n}\n\nexport type UseLoaderDataOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TSelected,\n TStructuralSharing,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseLoaderDataBaseOptions<\n TRouter,\n TFrom,\n TStrict,\n TSelected,\n TStructuralSharing\n > &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseLoaderDataRoute<out TId> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts?: UseLoaderDataBaseOptions<\n TRouter,\n TId,\n true,\n TSelected,\n TStructuralSharing\n > &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n) => UseLoaderDataResult<TRouter, TId, true, TSelected>\n\nexport function useLoaderData<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts: UseLoaderDataOptions<\n TRouter,\n TFrom,\n TStrict,\n TSelected,\n TStructuralSharing\n >,\n): UseLoaderDataResult<TRouter, TFrom, TStrict, TSelected> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n structuralSharing: opts.structuralSharing,\n select: (s: any) => {\n return opts.select ? opts.select(s.loaderData) : s.loaderData\n },\n } as any) as UseLoaderDataResult<TRouter, TFrom, TStrict, TSelected>\n}\n"],"names":["useMatch"],"mappings":";;;AAwDO,SAAS,cAOd,MAOyD;AACzD,SAAOA,kBAAS;AAAA,IACd,MAAM,KAAK;AAAA,IACX,QAAQ,KAAK;AAAA,IACb,mBAAmB,KAAK;AAAA,IACxB,QAAQ,CAAC,MAAW;AAClB,aAAO,KAAK,SAAS,KAAK,OAAO,EAAE,UAAU,IAAI,EAAE;AAAA,IAAA;AAAA,EACrD,CACM;AACV;;"}
|
||||
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function ({ key, objectKey }) {
|
||||
// special case for parsers
|
||||
const isParser =
|
||||
objectKey === "parser" && (key === "parse" || key === "parseForESLint");
|
||||
const parserMessage = `
|
||||
This typically happens when you're using a custom parser that does not
|
||||
provide a "meta" property, which is how ESLint determines the serialized
|
||||
representation. Please open an issue with the maintainer of the custom parser
|
||||
and share this link:
|
||||
|
||||
https://eslint.org/docs/latest/extend/custom-parsers#meta-data-in-custom-parsers
|
||||
`.trim();
|
||||
|
||||
return `
|
||||
The requested operation requires ESLint to serialize configuration data,
|
||||
but the configuration key "${objectKey}.${key}" contains a function value,
|
||||
which cannot be serialized.
|
||||
|
||||
${
|
||||
isParser
|
||||
? parserMessage
|
||||
: "Please double-check your configuration for errors."
|
||||
}
|
||||
|
||||
If you still have problems, please stop by https://eslint.org/chat/help to chat
|
||||
with the team.
|
||||
`.trimStart();
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N O 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:{"1":"0 9 yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"1 2 3 4 5 6 7 8 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB qC rC"},D:{"1":"0 9 n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m"},E:{"1":"ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"J PB K D E F A B C L M G sC SC tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC"},F:{"1":"0 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":"1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","2":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"2":"HC"},P:{"1":"1 2 3 4 5 6 7 8","2":"J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"2":"oD"},R:{"2":"pD"},S:{"1":"rD","2":"qD"}},B:4,C:"Media Queries: Range Syntax",D:true};
|
||||
@@ -0,0 +1,160 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||
function last(arr) {
|
||||
return arr[arr.length - 1];
|
||||
}
|
||||
function isFunction(d) {
|
||||
return typeof d === "function";
|
||||
}
|
||||
function functionalUpdate(updater, previous) {
|
||||
if (isFunction(updater)) {
|
||||
return updater(previous);
|
||||
}
|
||||
return updater;
|
||||
}
|
||||
function pick(parent, keys) {
|
||||
return keys.reduce((obj, key) => {
|
||||
obj[key] = parent[key];
|
||||
return obj;
|
||||
}, {});
|
||||
}
|
||||
function replaceEqualDeep(prev, _next) {
|
||||
if (prev === _next) {
|
||||
return prev;
|
||||
}
|
||||
const next = _next;
|
||||
const array = isPlainArray(prev) && isPlainArray(next);
|
||||
if (array || isPlainObject(prev) && isPlainObject(next)) {
|
||||
const prevItems = array ? prev : Object.keys(prev);
|
||||
const prevSize = prevItems.length;
|
||||
const nextItems = array ? next : Object.keys(next);
|
||||
const nextSize = nextItems.length;
|
||||
const copy = array ? [] : {};
|
||||
let equalItems = 0;
|
||||
for (let i = 0; i < nextSize; i++) {
|
||||
const key = array ? i : nextItems[i];
|
||||
if ((!array && prevItems.includes(key) || array) && prev[key] === void 0 && next[key] === void 0) {
|
||||
copy[key] = void 0;
|
||||
equalItems++;
|
||||
} else {
|
||||
copy[key] = replaceEqualDeep(prev[key], next[key]);
|
||||
if (copy[key] === prev[key] && prev[key] !== void 0) {
|
||||
equalItems++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return prevSize === nextSize && equalItems === prevSize ? prev : copy;
|
||||
}
|
||||
return next;
|
||||
}
|
||||
function isPlainObject(o) {
|
||||
if (!hasObjectPrototype(o)) {
|
||||
return false;
|
||||
}
|
||||
const ctor = o.constructor;
|
||||
if (typeof ctor === "undefined") {
|
||||
return true;
|
||||
}
|
||||
const prot = ctor.prototype;
|
||||
if (!hasObjectPrototype(prot)) {
|
||||
return false;
|
||||
}
|
||||
if (!prot.hasOwnProperty("isPrototypeOf")) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function hasObjectPrototype(o) {
|
||||
return Object.prototype.toString.call(o) === "[object Object]";
|
||||
}
|
||||
function isPlainArray(value) {
|
||||
return Array.isArray(value) && value.length === Object.keys(value).length;
|
||||
}
|
||||
function getObjectKeys(obj, ignoreUndefined) {
|
||||
let keys = Object.keys(obj);
|
||||
if (ignoreUndefined) {
|
||||
keys = keys.filter((key) => obj[key] !== void 0);
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
function deepEqual(a, b, opts) {
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
if (typeof a !== typeof b) {
|
||||
return false;
|
||||
}
|
||||
if (isPlainObject(a) && isPlainObject(b)) {
|
||||
const ignoreUndefined = (opts == null ? void 0 : opts.ignoreUndefined) ?? true;
|
||||
const aKeys = getObjectKeys(a, ignoreUndefined);
|
||||
const bKeys = getObjectKeys(b, ignoreUndefined);
|
||||
if (!(opts == null ? void 0 : opts.partial) && aKeys.length !== bKeys.length) {
|
||||
return false;
|
||||
}
|
||||
return bKeys.every((key) => deepEqual(a[key], b[key], opts));
|
||||
}
|
||||
if (Array.isArray(a) && Array.isArray(b)) {
|
||||
if (a.length !== b.length) {
|
||||
return false;
|
||||
}
|
||||
return !a.some((item, index) => !deepEqual(item, b[index], opts));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function createControlledPromise(onResolve) {
|
||||
let resolveLoadPromise;
|
||||
let rejectLoadPromise;
|
||||
const controlledPromise = new Promise((resolve, reject) => {
|
||||
resolveLoadPromise = resolve;
|
||||
rejectLoadPromise = reject;
|
||||
});
|
||||
controlledPromise.status = "pending";
|
||||
controlledPromise.resolve = (value) => {
|
||||
controlledPromise.status = "resolved";
|
||||
controlledPromise.value = value;
|
||||
resolveLoadPromise(value);
|
||||
onResolve == null ? void 0 : onResolve(value);
|
||||
};
|
||||
controlledPromise.reject = (e) => {
|
||||
controlledPromise.status = "rejected";
|
||||
rejectLoadPromise(e);
|
||||
};
|
||||
return controlledPromise;
|
||||
}
|
||||
function escapeJSON(jsonString) {
|
||||
return jsonString.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/"/g, '\\"');
|
||||
}
|
||||
function shallow(objA, objB) {
|
||||
if (Object.is(objA, objB)) {
|
||||
return true;
|
||||
}
|
||||
if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
|
||||
return false;
|
||||
}
|
||||
const keysA = Object.keys(objA);
|
||||
if (keysA.length !== Object.keys(objB).length) {
|
||||
return false;
|
||||
}
|
||||
for (const item of keysA) {
|
||||
if (!Object.prototype.hasOwnProperty.call(objB, item) || !Object.is(objA[item], objB[item])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function hasUriEncodedChars(inputString) {
|
||||
const pattern = /%[0-9A-Fa-f]{2}/;
|
||||
return pattern.test(inputString);
|
||||
}
|
||||
exports.createControlledPromise = createControlledPromise;
|
||||
exports.deepEqual = deepEqual;
|
||||
exports.escapeJSON = escapeJSON;
|
||||
exports.functionalUpdate = functionalUpdate;
|
||||
exports.hasUriEncodedChars = hasUriEncodedChars;
|
||||
exports.isPlainArray = isPlainArray;
|
||||
exports.isPlainObject = isPlainObject;
|
||||
exports.last = last;
|
||||
exports.pick = pick;
|
||||
exports.replaceEqualDeep = replaceEqualDeep;
|
||||
exports.shallow = shallow;
|
||||
//# sourceMappingURL=utils.cjs.map
|
||||
Reference in New Issue
Block a user