diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index e8aa21e7..15169adc 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -4,6 +4,7 @@ todo: lodash, according to lighthouse it's vulnerable version and needs update can I just remove it and replace the functionality with built in javascript methods now? window.$gz._ + pick-list.vue uses the debounce function which can be replicated with this code here: https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_debounce diff --git a/ayanova/src/api/gzutil.js b/ayanova/src/api/gzutil.js index ba8926f7..0a8fbd83 100644 --- a/ayanova/src/api/gzutil.js +++ b/ayanova/src/api/gzutil.js @@ -477,6 +477,13 @@ export default { return true; } return false; + }, + /////////////////////////////////////////////// + // is Boolean replacement for lodash + // https://stackoverflow.com/a/43718478/8939 + // + isBoolean: function(obj) { + return obj === true || obj === false || typeof variable === "boolean"; } /** diff --git a/ayanova/src/components/custom-fields-control.vue b/ayanova/src/components/custom-fields-control.vue index 050e734f..b33ba94b 100644 --- a/ayanova/src/components/custom-fields-control.vue +++ b/ayanova/src/components/custom-fields-control.vue @@ -298,10 +298,10 @@ export default { break; case 6: //if it's not already a boolean - if (!window.$gz._.isBoolean(ret)) { + if (!window.$gz.util.isBoolean(ret)) { //it's not a bool and it's not null, it came from some other data type, //perhaps though, it's a truthy string so check for that before giving up and nulling - if (window.$gz._.isString(ret)) { + if (window.$gz.util.isString(ret)) { ret = window.$gz.util.stringToBoolean(ret); break; } @@ -481,16 +481,6 @@ export default { } } }, - beforeCreate() { - //check pre-requisites exist just in case - if (this.$ay.dev) { - if (!window.$gz._) { - throw new Error( - "custom-fields-control: $gz._ (lodash) is required and missing" - ); - } - } - }, created() { if (this.$ay.dev) { if (!this.formKey) {