From 665f84db5f8499c702566a54cd413f5e0bc2258d Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 8 Oct 2020 16:55:07 +0000 Subject: [PATCH] --- ayanova/src/api/gzutil.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ayanova/src/api/gzutil.js b/ayanova/src/api/gzutil.js index f5b58d26..ba8926f7 100644 --- a/ayanova/src/api/gzutil.js +++ b/ayanova/src/api/gzutil.js @@ -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; } /**