This commit is contained in:
@@ -278,7 +278,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Not a string at all?
|
//Not a string at all?
|
||||||
if (!window.$gz._.isString(string)) {
|
if (!this.isString(string)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -465,7 +465,18 @@ export default {
|
|||||||
// https://stackoverflow.com/a/52986361/8939
|
// https://stackoverflow.com/a/52986361/8939
|
||||||
//
|
//
|
||||||
isNumeric: function(n) {
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user