Skip to content
Snippets Groups Projects
Commit 87dc1d0f authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix: check for matchResult

parent 3cdfd7a2
No related branches found
No related tags found
No related merge requests found
import { logger } from '../../../../../logger';
import { regEx } from '../../../../../util/regex';
export function replaceConstraintVersion(
......@@ -16,6 +17,14 @@ export function replaceConstraintVersion(
const matchString = `(${escaped}((",|,)[^\n:]+)?:\n)(.*\n)*?(\\s+dependencies|\n[@a-z])`;
// yarn will fill in the details later
const matchResult = regEx(matchString).exec(lockFileContent);
// istanbul ignore if
if (!matchResult) {
logger.debug(
{ depName, constraint, newVersion },
'Could not find constraint in lock file'
);
return lockFileContent;
}
let constraintLine = matchResult[1];
if (newConstraint) {
const newDepNameConstraint = `${depName}@${newConstraint}`;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment