0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-01-11 13:48:55 +00:00
renovatebot_renovate/lib/modules/manager/helmv3/oci.ts
2024-04-20 11:16:24 +00:00

19 lines
522 B
TypeScript

import is from '@sindresorhus/is';
import type { Repository } from './types';
export function isOCIRegistry(
repository: Repository | string | null | undefined,
): boolean {
if (is.nullOrUndefined(repository)) {
return false;
}
const repo = is.string(repository) ? repository : repository.repository;
return repo.startsWith('oci://');
}
export function removeOCIPrefix(repository: string): string {
if (isOCIRegistry(repository)) {
return repository.replace('oci://', '');
}
return repository;
}