@bufbuild/protoplugin 2.2.0 → 2.2.1

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.
@@ -77,12 +77,14 @@ function parseParameter(parameter, parseExtraOptions) {
77
77
  }
78
78
  break;
79
79
  case "rewrite_imports": {
80
- const parts = value.split(":");
81
- if (parts.length !== 2) {
80
+ const i = value.indexOf(":");
81
+ if (i < 0) {
82
82
  throw new error_js_1.PluginOptionError(raw, "must be in the form of <pattern>:<target>");
83
83
  }
84
- const [pattern, target] = parts;
85
- rewriteImports.push({ pattern, target });
84
+ rewriteImports.push({
85
+ pattern: value.substring(0, i),
86
+ target: value.substring(i + 1),
87
+ });
86
88
  // rewrite_imports can be noisy and is more of an implementation detail
87
89
  // so we strip it out of the preamble
88
90
  sanitize = true;
@@ -74,12 +74,14 @@ export function parseParameter(parameter, parseExtraOptions) {
74
74
  }
75
75
  break;
76
76
  case "rewrite_imports": {
77
- const parts = value.split(":");
78
- if (parts.length !== 2) {
77
+ const i = value.indexOf(":");
78
+ if (i < 0) {
79
79
  throw new PluginOptionError(raw, "must be in the form of <pattern>:<target>");
80
80
  }
81
- const [pattern, target] = parts;
82
- rewriteImports.push({ pattern, target });
81
+ rewriteImports.push({
82
+ pattern: value.substring(0, i),
83
+ target: value.substring(i + 1),
84
+ });
83
85
  // rewrite_imports can be noisy and is more of an implementation detail
84
86
  // so we strip it out of the preamble
85
87
  sanitize = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bufbuild/protoplugin",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Helps to create your own Protocol Buffers code generators.",
6
6
  "keywords": [
@@ -35,7 +35,7 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@bufbuild/protobuf": "2.2.0",
38
+ "@bufbuild/protobuf": "2.2.1",
39
39
  "@typescript/vfs": "^1.5.2",
40
40
  "typescript": "5.4.5"
41
41
  },