arcane-cli 1.9.1 → 1.9.2

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
@@ -6110,18 +6110,26 @@ function parseGitHubRemote(url) {
6110
6110
  if (!owner || !repo) return null;
6111
6111
  return { owner, repo };
6112
6112
  }
6113
- function parseAdoRemote(url) {
6114
- const modern = /dev\.azure\.com\/([^/]+)\/([^/]+)\/_git\/([^/?]+)/.exec(url);
6115
- if (modern) {
6116
- const [, org, project, repo] = modern;
6117
- if (org && project && repo) return { org, project, repo };
6118
- }
6119
- const legacy = /([^./]+)\.visualstudio\.com\/([^/]+)\/_git\/([^/?]+)/.exec(url);
6120
- if (legacy) {
6121
- const [, org, project, repo] = legacy;
6122
- if (org && project && repo) return { org, project, repo };
6113
+ function decodeAdoSegment(raw) {
6114
+ let decoded;
6115
+ try {
6116
+ decoded = decodeURIComponent(raw);
6117
+ } catch {
6118
+ return null;
6123
6119
  }
6124
- return null;
6120
+ if (!decoded || decoded.startsWith("-")) return null;
6121
+ return decoded;
6122
+ }
6123
+ function parseAdoRemote(url) {
6124
+ const match = /dev\.azure\.com\/([^/]+)\/([^/]+)\/_git\/([^/?]+)/.exec(url) ?? /([^./]+)\.visualstudio\.com\/([^/]+)\/_git\/([^/?]+)/.exec(url);
6125
+ if (!match) return null;
6126
+ const [, rawOrg, rawProject, rawRepo] = match;
6127
+ if (!rawOrg || !rawProject || !rawRepo) return null;
6128
+ const org = decodeAdoSegment(rawOrg);
6129
+ const project = decodeAdoSegment(rawProject);
6130
+ const repo = decodeAdoSegment(rawRepo);
6131
+ if (org === null || project === null || repo === null) return null;
6132
+ return { org, project, repo };
6125
6133
  }
6126
6134
 
6127
6135
  // src/modules/placeholders.ts