@rolldown/pluginutils 1.0.0-beta.30 → 1.0.0-beta.31-commit.832324a

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.cjs CHANGED
@@ -142,15 +142,13 @@ function interpreter(exprs, code$1, id$1, moduleType$1) {
142
142
  function interpreterImpl(expr, code$1, id$1, moduleType$1, ctx = {}) {
143
143
  let hasInclude = false;
144
144
  for (const e of expr) switch (e.kind) {
145
- case "include": {
145
+ case "include":
146
146
  hasInclude = true;
147
147
  if (exprInterpreter(e.expr, code$1, id$1, moduleType$1, ctx)) return true;
148
148
  break;
149
- }
150
- case "exclude": {
149
+ case "exclude":
151
150
  if (exprInterpreter(e.expr, code$1, id$1, moduleType$1)) return false;
152
151
  break;
153
- }
154
152
  }
155
153
  return !hasInclude;
156
154
  }
@@ -159,19 +157,16 @@ function exprInterpreter(expr, code$1, id$1, moduleType$1, ctx = {}) {
159
157
  case "and": return expr.args.every((e) => exprInterpreter(e, code$1, id$1, moduleType$1, ctx));
160
158
  case "or": return expr.args.some((e) => exprInterpreter(e, code$1, id$1, moduleType$1, ctx));
161
159
  case "not": return !exprInterpreter(expr.expr, code$1, id$1, moduleType$1, ctx);
162
- case "id": {
160
+ case "id":
163
161
  if (id$1 === void 0) throw new Error("`id` is required for `id` expression");
164
162
  if (expr.params.cleanUrl) id$1 = cleanUrl(id$1);
165
163
  return typeof expr.pattern === "string" ? id$1 === expr.pattern : expr.pattern.test(id$1);
166
- }
167
- case "moduleType": {
164
+ case "moduleType":
168
165
  if (moduleType$1 === void 0) throw new Error("`moduleType` is required for `moduleType` expression");
169
166
  return moduleType$1 === expr.pattern;
170
- }
171
- case "code": {
167
+ case "code":
172
168
  if (code$1 === void 0) throw new Error("`code` is required for `code` expression");
173
169
  return typeof expr.pattern === "string" ? code$1.includes(expr.pattern) : expr.pattern.test(code$1);
174
- }
175
170
  case "query": {
176
171
  if (id$1 === void 0) throw new Error("`id` is required for `Query` expression");
177
172
  if (!ctx.urlSearchParamsCache) {
package/dist/index.js CHANGED
@@ -141,15 +141,13 @@ function interpreter(exprs, code$1, id$1, moduleType$1) {
141
141
  function interpreterImpl(expr, code$1, id$1, moduleType$1, ctx = {}) {
142
142
  let hasInclude = false;
143
143
  for (const e of expr) switch (e.kind) {
144
- case "include": {
144
+ case "include":
145
145
  hasInclude = true;
146
146
  if (exprInterpreter(e.expr, code$1, id$1, moduleType$1, ctx)) return true;
147
147
  break;
148
- }
149
- case "exclude": {
148
+ case "exclude":
150
149
  if (exprInterpreter(e.expr, code$1, id$1, moduleType$1)) return false;
151
150
  break;
152
- }
153
151
  }
154
152
  return !hasInclude;
155
153
  }
@@ -158,19 +156,16 @@ function exprInterpreter(expr, code$1, id$1, moduleType$1, ctx = {}) {
158
156
  case "and": return expr.args.every((e) => exprInterpreter(e, code$1, id$1, moduleType$1, ctx));
159
157
  case "or": return expr.args.some((e) => exprInterpreter(e, code$1, id$1, moduleType$1, ctx));
160
158
  case "not": return !exprInterpreter(expr.expr, code$1, id$1, moduleType$1, ctx);
161
- case "id": {
159
+ case "id":
162
160
  if (id$1 === void 0) throw new Error("`id` is required for `id` expression");
163
161
  if (expr.params.cleanUrl) id$1 = cleanUrl(id$1);
164
162
  return typeof expr.pattern === "string" ? id$1 === expr.pattern : expr.pattern.test(id$1);
165
- }
166
- case "moduleType": {
163
+ case "moduleType":
167
164
  if (moduleType$1 === void 0) throw new Error("`moduleType` is required for `moduleType` expression");
168
165
  return moduleType$1 === expr.pattern;
169
- }
170
- case "code": {
166
+ case "code":
171
167
  if (code$1 === void 0) throw new Error("`code` is required for `code` expression");
172
168
  return typeof expr.pattern === "string" ? code$1.includes(expr.pattern) : expr.pattern.test(code$1);
173
- }
174
169
  case "query": {
175
170
  if (id$1 === void 0) throw new Error("`id` is required for `Query` expression");
176
171
  if (!ctx.urlSearchParamsCache) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolldown/pluginutils",
3
- "version": "1.0.0-beta.30",
3
+ "version": "1.0.0-beta.31-commit.832324a",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "devDependencies": {
27
27
  "@types/picomatch": "^4.0.0",
28
28
  "picomatch": "^4.0.2",
29
- "tsdown": "0.13.0",
29
+ "tsdown": "0.13.4",
30
30
  "vitest": "^3.0.1"
31
31
  },
32
32
  "scripts": {