configuration
Advanced tools
Comparing version 4.1.4 to 4.1.5
@@ -54,9 +54,8 @@ /* IMPORT */ | ||
for (const data of this.handlers) { | ||
if (Lang.isNullary(data.callback)) { //TODO: This is not exactly correct, something might have been changed while the flattened configuration could still be the same, but this is much faster | ||
const value = data.getter(); | ||
if ((Lang.isUndefined(data.value) || !Lang.isPrimitive(data.value)) && !Lang.isPrimitive(value) && Lang.isNullary(data.callback)) { //TODO: This is not exactly correct, something might have been changed while the flattened configuration could still be the same, but this is much faster | ||
data.callback(); | ||
data.value = value; | ||
} | ||
else { | ||
const value = data.getter(); | ||
if (Lang.isEqual(data.value, value)) | ||
continue; | ||
else if (!Lang.isEqual(data.value, value)) { | ||
const valueNext = Lang.cloneDeep(value); | ||
@@ -224,3 +223,3 @@ data.callback(valueNext, data.value); | ||
const valueRaw = getter(); | ||
const value = !Lang.isNullary(callback) ? Lang.cloneDeep(valueRaw) : undefined; | ||
const value = Lang.isPrimitive(valueRaw) || !Lang.isNullary(callback) ? Lang.cloneDeep(valueRaw) : undefined; | ||
const data = { callback, getter, value }; | ||
@@ -227,0 +226,0 @@ handlers.push(data); |
@@ -5,3 +5,3 @@ { | ||
"description": "Performant and feature rich library for managing configurations/settings.", | ||
"version": "4.1.4", | ||
"version": "4.1.5", | ||
"type": "module", | ||
@@ -8,0 +8,0 @@ "sideEffects": false, |
@@ -107,12 +107,12 @@ | ||
if ( Lang.isNullary ( data.callback ) ) { //TODO: This is not exactly correct, something might have been changed while the flattened configuration could still be the same, but this is much faster | ||
const value = data.getter (); | ||
if ( ( Lang.isUndefined ( data.value ) || !Lang.isPrimitive ( data.value ) ) && !Lang.isPrimitive ( value ) && Lang.isNullary ( data.callback ) ) { //TODO: This is not exactly correct, something might have been changed while the flattened configuration could still be the same, but this is much faster | ||
data.callback (); | ||
} else { | ||
data.value = value; | ||
const value = data.getter (); | ||
} else if ( !Lang.isEqual ( data.value, value ) ) { | ||
if ( Lang.isEqual ( data.value, value ) ) continue; | ||
const valueNext = Lang.cloneDeep ( value ); | ||
@@ -397,3 +397,3 @@ | ||
const valueRaw = getter (); | ||
const value = !Lang.isNullary ( callback ) ? Lang.cloneDeep ( valueRaw ) : undefined; | ||
const value = Lang.isPrimitive ( valueRaw ) || !Lang.isNullary ( callback ) ? Lang.cloneDeep ( valueRaw ) : undefined; | ||
const data: ChangeHandlerData = {callback, getter, value}; | ||
@@ -400,0 +400,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106611
2662