create project
This commit is contained in:
9
kitabcitab/node_modules/@next/eslint-plugin-next/dist/utils/define-rule.js
generated
vendored
Normal file
9
kitabcitab/node_modules/@next/eslint-plugin-next/dist/utils/define-rule.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.defineRule = void 0;
|
||||
var defineRule = function(rule) {
|
||||
return rule;
|
||||
};
|
||||
exports.defineRule = defineRule;
|
||||
68
kitabcitab/node_modules/@next/eslint-plugin-next/dist/utils/get-root-dirs.js
generated
vendored
Normal file
68
kitabcitab/node_modules/@next/eslint-plugin-next/dist/utils/get-root-dirs.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getRootDirs = void 0;
|
||||
var glob = _interopRequireWildcard(require("glob"));
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function() {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
/**
|
||||
* Process a Next.js root directory glob.
|
||||
*/ var processRootDir = function(rootDir) {
|
||||
// Ensures we only match folders.
|
||||
if (!rootDir.endsWith("/")) rootDir += "/";
|
||||
return glob.sync(rootDir);
|
||||
};
|
||||
var getRootDirs = function(context) {
|
||||
var rootDirs = [
|
||||
context.getCwd()
|
||||
];
|
||||
var nextSettings = context.settings.next || {};
|
||||
var rootDir = nextSettings.rootDir;
|
||||
if (typeof rootDir === "string") {
|
||||
rootDirs = processRootDir(rootDir);
|
||||
} else if (Array.isArray(rootDir)) {
|
||||
rootDirs = rootDir.map(function(dir) {
|
||||
return typeof dir === "string" ? processRootDir(dir) : [];
|
||||
}).flat();
|
||||
}
|
||||
return rootDirs;
|
||||
};
|
||||
exports.getRootDirs = getRootDirs;
|
||||
57
kitabcitab/node_modules/@next/eslint-plugin-next/dist/utils/node-attributes.js
generated
vendored
Normal file
57
kitabcitab/node_modules/@next/eslint-plugin-next/dist/utils/node-attributes.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
function _classCallCheck(instance, Constructor) {
|
||||
if (!(instance instanceof Constructor)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
}
|
||||
var NodeAttributes = /*#__PURE__*/ function() {
|
||||
"use strict";
|
||||
function NodeAttributes(ASTnode) {
|
||||
var _this = this;
|
||||
_classCallCheck(this, NodeAttributes);
|
||||
this.attributes = {};
|
||||
ASTnode.attributes.forEach(function(attribute) {
|
||||
if (!attribute.type || attribute.type !== "JSXAttribute") {
|
||||
return;
|
||||
}
|
||||
if (!!attribute.value) {
|
||||
// hasValue
|
||||
var value = typeof attribute.value.value === "string" ? attribute.value.value : typeof attribute.value.expression.value !== "undefined" ? attribute.value.expression.value : attribute.value.expression.properties;
|
||||
_this.attributes[attribute.name.name] = {
|
||||
hasValue: true,
|
||||
value: value
|
||||
};
|
||||
} else {
|
||||
_this.attributes[attribute.name.name] = {
|
||||
hasValue: false
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
var _proto = NodeAttributes.prototype;
|
||||
_proto.hasAny = function hasAny() {
|
||||
return !!Object.keys(this.attributes).length;
|
||||
};
|
||||
_proto.has = function has(attrName) {
|
||||
return !!this.attributes[attrName];
|
||||
};
|
||||
_proto.hasValue = function hasValue(attrName) {
|
||||
return !!this.attributes[attrName].hasValue;
|
||||
};
|
||||
_proto.value = function value(attrName) {
|
||||
var attr = this.attributes[attrName];
|
||||
if (!attr) {
|
||||
return true;
|
||||
}
|
||||
if (attr.hasValue) {
|
||||
return attr.value;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
return NodeAttributes;
|
||||
}();
|
||||
exports.default = NodeAttributes;
|
||||
156
kitabcitab/node_modules/@next/eslint-plugin-next/dist/utils/url.js
generated
vendored
Normal file
156
kitabcitab/node_modules/@next/eslint-plugin-next/dist/utils/url.js
generated
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.normalizeURL = normalizeURL;
|
||||
exports.getUrlFromPagesDirectories = getUrlFromPagesDirectories;
|
||||
exports.execOnce = execOnce;
|
||||
var path = _interopRequireWildcard(require("path"));
|
||||
var fs = _interopRequireWildcard(require("fs"));
|
||||
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 _arrayWithoutHoles(arr) {
|
||||
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
||||
}
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function() {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
function _iterableToArray(iter) {
|
||||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
||||
}
|
||||
function _nonIterableSpread() {
|
||||
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
function _toConsumableArray(arr) {
|
||||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
||||
}
|
||||
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(n);
|
||||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
||||
}
|
||||
// Cache for fs.lstatSync lookup.
|
||||
// Prevent multiple blocking IO requests that have already been calculated.
|
||||
var fsLstatSyncCache = {};
|
||||
var fsLstatSync = function(source) {
|
||||
fsLstatSyncCache[source] = fsLstatSyncCache[source] || fs.lstatSync(source);
|
||||
return fsLstatSyncCache[source];
|
||||
};
|
||||
/**
|
||||
* Checks if the source is a directory.
|
||||
*/ function isDirectory(source) {
|
||||
return fsLstatSync(source).isDirectory();
|
||||
}
|
||||
/**
|
||||
* Checks if the source is a directory.
|
||||
*/ function isSymlink(source) {
|
||||
return fsLstatSync(source).isSymbolicLink();
|
||||
}
|
||||
// Cache for fs.readdirSync lookup.
|
||||
// Prevent multiple blocking IO requests that have already been calculated.
|
||||
var fsReadDirSyncCache = {};
|
||||
/**
|
||||
* Recursively parse directory for page URLs.
|
||||
*/ function parseUrlForPages(urlprefix, directory) {
|
||||
fsReadDirSyncCache[directory] = fsReadDirSyncCache[directory] || fs.readdirSync(directory);
|
||||
var res = [];
|
||||
fsReadDirSyncCache[directory].forEach(function(fname) {
|
||||
// TODO: this should account for all page extensions
|
||||
// not just js(x) and ts(x)
|
||||
if (/(\.(j|t)sx?)$/.test(fname)) {
|
||||
if (/^index(\.(j|t)sx?)$/.test(fname)) {
|
||||
res.push("".concat(urlprefix).concat(fname.replace(/^index(\.(j|t)sx?)$/, "")));
|
||||
}
|
||||
res.push("".concat(urlprefix).concat(fname.replace(/(\.(j|t)sx?)$/, "")));
|
||||
} else {
|
||||
var dirPath = path.join(directory, fname);
|
||||
if (isDirectory(dirPath) && !isSymlink(dirPath)) {
|
||||
var _res;
|
||||
(_res = res).push.apply(_res, _toConsumableArray(parseUrlForPages(urlprefix + fname + "/", dirPath)));
|
||||
}
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
function normalizeURL(url) {
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
url = url.split("?")[0];
|
||||
url = url.split("#")[0];
|
||||
url = url = url.replace(/(\/index\.html)$/, "/");
|
||||
// Empty URLs should not be trailed with `/`, e.g. `#heading`
|
||||
if (url === "") {
|
||||
return url;
|
||||
}
|
||||
url = url.endsWith("/") ? url : url + "/";
|
||||
return url;
|
||||
}
|
||||
function getUrlFromPagesDirectories(urlPrefix, directories) {
|
||||
return Array.from(// De-duplicate similar pages across multiple directories.
|
||||
new Set(directories.map(function(directory) {
|
||||
return parseUrlForPages(urlPrefix, directory);
|
||||
}).flat().map(// Since the URLs are normalized we add `^` and `$` to the RegExp to make sure they match exactly.
|
||||
function(url) {
|
||||
return "^".concat(normalizeURL(url), "$");
|
||||
}))).map(function(urlReg) {
|
||||
urlReg = urlReg.replace(/\[.*\]/g, "((?!.+?\\..+?).*?)");
|
||||
return new RegExp(urlReg);
|
||||
});
|
||||
}
|
||||
function execOnce(fn) {
|
||||
var used = false;
|
||||
var result;
|
||||
return function() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
if (!used) {
|
||||
used = true;
|
||||
result = fn.apply(void 0, _toConsumableArray(args));
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user