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/terragrunt/util.ts
2023-11-07 15:50:29 +00:00

26 lines
582 B
TypeScript

import { regEx } from '../../../util/regex';
import type { TerragruntDependencyTypes } from './common';
export const keyValueExtractionRegex = regEx(
/^\s*source\s+=\s+"(?<value>[^"]+)"\s*$/,
);
export function getTerragruntDependencyType(
value: string,
): TerragruntDependencyTypes {
switch (value) {
case 'terraform': {
return 'terraform';
}
default: {
return 'unknown';
}
}
}
export function checkFileContainsDependency(
content: string,
checkList: string[],
): boolean {
return checkList.some((check) => content.includes(check));
}