This commit is contained in:
2020-10-08 16:55:07 +00:00
parent 796f44de84
commit 665f84db5f

View File

@@ -278,7 +278,7 @@ export default {
}
//Not a string at all?
if (!window.$gz._.isString(string)) {
if (!this.isString(string)) {
return 0;
}
@@ -465,7 +465,18 @@ export default {
// https://stackoverflow.com/a/52986361/8939
//
isNumeric: function(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
//lodash isNumber returned false if it's a string and that's what the rest of the code expects even though it's parseable to a number
return !this.isString(n) && !isNaN(parseFloat(n)) && isFinite(n);
},
///////////////////////////////////////////////
// is string replacement for lodash
// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_isString
//
isString: function(str) {
if (str && typeof str.valueOf() === "string") {
return true;
}
return false;
}
/**