@equinor/fusion-framework-cli
Version:
[](./LICENSE)
14 lines • 555 B
JavaScript
/**
* Resolves the GitHub repository URL from a given `package.json` object.
*
* @param pkg - The `package.json` object to extract the repository information from.
* @returns The GitHub repository URL as a string.
* @throws Will throw an error if the `package.json` does not contain a repository field.
*/
export const resolveRepoFromPackage = (pkg) => {
if (pkg.repository) {
return typeof pkg.repository === 'string' ? pkg.repository : pkg.repository.url;
}
return undefined;
};
//# sourceMappingURL=resolve-package-repo.js.map