mirror of
https://forge.chapril.org/tykayn/wololo
synced 2025-06-20 01:34:42 +02:00
up testing engine
This commit is contained in:
parent
353fa37c85
commit
44a6d309a9
2 changed files with 24 additions and 19 deletions
|
@ -409,10 +409,10 @@ export default class MappingEngine {
|
|||
if (configObject.remove_original_key) {
|
||||
remove_original_key = true
|
||||
}
|
||||
if (configObject.ignore_if_falsy && custom_utils.falsyValues.indexOf(this.convertToBoolean(originalValue)) !== -1) {
|
||||
if (configObject.ignore_if_falsy && !this.convertToBoolean(originalValue)) {
|
||||
remove_original_key = true
|
||||
}
|
||||
if (configObject.ignore_if_truthy && custom_utils.truthyValues.indexOf(this.convertToBoolean(originalValue)) !== -1) {
|
||||
if (configObject.ignore_if_truthy && this.convertToBoolean(originalValue)) {
|
||||
remove_original_key = true
|
||||
}
|
||||
|
||||
|
@ -576,20 +576,14 @@ export default class MappingEngine {
|
|||
return convertedValue;
|
||||
}
|
||||
|
||||
private convertToBoolean(originalValue: any) {
|
||||
debugLog('convertProperty: ==========> original value', originalValue)
|
||||
let convertedValue;
|
||||
private convertToBoolean(originalValue: any): boolean {
|
||||
if (custom_utils.truthyValues.indexOf(originalValue) !== -1) {
|
||||
convertedValue = true
|
||||
} else {
|
||||
debugLog('convertProperty: ==========> !!! NOT in truthy values', originalValue)
|
||||
return true;
|
||||
}
|
||||
if (custom_utils.falsyValues.indexOf(originalValue) !== -1) {
|
||||
convertedValue = false
|
||||
} else {
|
||||
debugLog('convertProperty: ==========> !!! NOT in falsy values', originalValue)
|
||||
return false;
|
||||
}
|
||||
return convertedValue;
|
||||
return false; // valeur par défaut
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue