You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.js
+9-2Lines changed: 9 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -633,7 +633,9 @@ const publicApiProxy = new Proxy(publicApi, {
633
633
process.exit(1);// eslint-disable-line
634
634
}
635
635
};
636
-
}elseif(typeoftarget[prop]==='undefined'){
636
+
}
637
+
638
+
if(typeoftarget[prop]==='undefined'){
637
639
// Find the property with the closest Levenshtein distance
638
640
letsimilarProperty;
639
641
letminDistance=Number.MAX_VALUE;
@@ -645,7 +647,12 @@ const publicApiProxy = new Proxy(publicApi, {
645
647
}
646
648
}
647
649
648
-
consterror=newError(`${chalk.red(`Encore.${prop}`)} is not a recognized property or method, did you mean ${chalk.green(`Encore.${similarProperty}`)}?`);
650
+
leterrorMessage=`${chalk.red(`Encore.${prop}`)} is not a recognized property or method.`;
651
+
if(minDistance<3){
652
+
errorMessage+=` Did you mean ${chalk.green(`Encore.${similarProperty}`)}?`;
0 commit comments