mastercontroller 1.3.21 → 1.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -75,7 +75,8 @@ const ERROR_CODES = {
|
|
|
75
75
|
* Levenshtein distance for "Did you mean?" suggestions
|
|
76
76
|
*/
|
|
77
77
|
function levenshteinDistance(str1, str2) {
|
|
78
|
-
// Guard against
|
|
78
|
+
// Guard against non-strings (objects, regex, undefined) and extremely long paths
|
|
79
|
+
if (typeof str1 !== 'string' || typeof str2 !== 'string') return Infinity;
|
|
79
80
|
if (str1.length > 200 || str2.length > 200) return Infinity;
|
|
80
81
|
const len1 = str1.length;
|
|
81
82
|
const len2 = str2.length;
|
package/package.json
CHANGED