gitea push
This commit is contained in:
+8
-9
@@ -9,10 +9,7 @@ const DescriptionFileUtils = require("./DescriptionFileUtils");
|
||||
const forEachBail = require("./forEachBail");
|
||||
const { processImportsField } = require("./util/entrypoints");
|
||||
const { parseIdentifier } = require("./util/identifier");
|
||||
const {
|
||||
deprecatedInvalidSegmentRegEx,
|
||||
invalidSegmentRegEx,
|
||||
} = require("./util/path");
|
||||
const { invalidSegmentRegEx } = require("./util/path");
|
||||
|
||||
/** @typedef {import("./Resolver")} Resolver */
|
||||
/** @typedef {import("./Resolver").JsonObject} JsonObject */
|
||||
@@ -67,8 +64,13 @@ module.exports = class ImportsFieldPlugin {
|
||||
}
|
||||
|
||||
const { descriptionFileData } = request;
|
||||
// Skip the concat when there's nothing to append — the common
|
||||
// case has empty query/fragment, so this avoids an allocation
|
||||
// per resolve. Mirrors the pattern in ExportsFieldPlugin.
|
||||
const remainingRequest =
|
||||
request.request + request.query + request.fragment;
|
||||
request.query || request.fragment
|
||||
? request.request + request.query + request.fragment
|
||||
: request.request;
|
||||
|
||||
/** @type {string[]} */
|
||||
let paths;
|
||||
@@ -152,10 +154,7 @@ module.exports = class ImportsFieldPlugin {
|
||||
// should be relative
|
||||
case dotCode: {
|
||||
const withoutDotSlash = path_.slice(2);
|
||||
if (
|
||||
invalidSegmentRegEx.exec(withoutDotSlash) !== null &&
|
||||
deprecatedInvalidSegmentRegEx.test(withoutDotSlash) !== null
|
||||
) {
|
||||
if (invalidSegmentRegEx.test(withoutDotSlash)) {
|
||||
if (paths.length === i) {
|
||||
return callback(
|
||||
new Error(
|
||||
|
||||
Reference in New Issue
Block a user