@fern-api/generator-cli 0.9.27 → 0.9.29
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/api.js +5 -2
- package/dist/cli.js +1624 -1366
- package/package.json +2 -2
package/dist/api.js
CHANGED
|
@@ -6252,15 +6252,18 @@ function parseRepository(githubRepository) {
|
|
|
6252
6252
|
githubRepository = githubRepository.slice(0, -4);
|
|
6253
6253
|
}
|
|
6254
6254
|
const parts = githubRepository.split("/");
|
|
6255
|
-
if (parts.length === 2 && parts[0]
|
|
6255
|
+
if (parts.length === 2 && isNonEmptyPart(parts[0]) && isNonEmptyPart(parts[1])) {
|
|
6256
6256
|
[owner, repo] = parts;
|
|
6257
|
-
} else if (parts.length === 3 && parts[0]
|
|
6257
|
+
} else if (parts.length === 3 && isNonEmptyPart(parts[0]) && isNonEmptyPart(parts[1]) && isNonEmptyPart(parts[2])) {
|
|
6258
6258
|
[remote, owner, repo] = parts;
|
|
6259
6259
|
} else {
|
|
6260
6260
|
throw new Error(`Failed to parse GitHub repository ${githubRepository}`);
|
|
6261
6261
|
}
|
|
6262
6262
|
return newRepositoryReference({ remote, owner, repo });
|
|
6263
6263
|
}
|
|
6264
|
+
function isNonEmptyPart(part) {
|
|
6265
|
+
return part != null && part.length > 0;
|
|
6266
|
+
}
|
|
6264
6267
|
function newRepositoryReference({ remote, owner, repo }) {
|
|
6265
6268
|
const repoUrl = getRepoUrl({ remote, owner, repo });
|
|
6266
6269
|
const cloneUrl = getCloneUrl({ remote, owner, repo });
|