@shipstatic/drop 2.13.0-beta.2 → 2.13.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -271,11 +271,12 @@ function rebase(line, base) {
271
271
  const pattern = line.replace(/(\\ )? *$/, (_, escaped) => escaped ?? "");
272
272
  if (pattern === "" || pattern.startsWith("#")) return null;
273
273
  if (base === "") return pattern;
274
+ const folder = base.replace(/[\\*?[\]]/g, "\\$&").replace(/^[#!]/, "\\$&");
274
275
  const negated = pattern.startsWith("!");
275
276
  let body = negated ? pattern.slice(1) : pattern;
276
277
  const directoryOnly = body.endsWith("/");
277
278
  if (directoryOnly) body = body.slice(0, -1);
278
- const rebased = body.includes("/") ? `${base}/${body.replace(/^\//, "")}` : `${base}/**/${body}`;
279
+ const rebased = body.includes("/") ? `${folder}/${body.replace(/^\//, "")}` : `${folder}/**/${body}`;
279
280
  return `${negated ? "!" : ""}${rebased}${directoryOnly ? "/" : ""}`;
280
281
  }
281
282
  async function projectSource(files) {