This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user