This commit is contained in:
2020-10-08 17:12:33 +00:00
parent 665f84db5f
commit 2beec7ebde
3 changed files with 10 additions and 12 deletions

View File

@@ -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

View File

@@ -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";
}
/**

View File

@@ -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) {