tests update

This commit is contained in:
Tykayn 2025-04-28 00:34:41 +02:00 committed by tykayn
parent 088aa1f5f4
commit 353fa37c85
4 changed files with 49 additions and 24 deletions

View file

@ -1,4 +1,3 @@
import MappingConfigType from "./mapping-config.type";
import Formatters from "./formatters";
import config from "../config";
@ -22,8 +21,8 @@ export default class MappingEngine {
private current_geojson_point: any; // currently converting point
constructor(mappingConfig: MappingConfigType) {
this.mapping_config = mappingConfig;
this.setConfig(mappingConfig)
this.stats = {
filtered_by_excluded_tags: 0,
phones_updated: 0,
@ -35,9 +34,8 @@ export default class MappingEngine {
}
setConfig(mappingConfig: MappingConfigType) {
debugLog('load config', mappingConfig.config_name)
debugLog('load config', mappingConfig.config_name)
this.mapping_config = mappingConfig
//debugLog('load config', mappingConfig.config_name);
this.mapping_config = mappingConfig;
}
getConfig() {
@ -411,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(originalValue) !== -1) {
if (configObject.ignore_if_falsy && custom_utils.falsyValues.indexOf(this.convertToBoolean(originalValue)) !== -1) {
remove_original_key = true
}
if (configObject.ignore_if_truthy && custom_utils.truthyValues.indexOf(originalValue) !== -1) {
if (configObject.ignore_if_truthy && custom_utils.truthyValues.indexOf(this.convertToBoolean(originalValue)) !== -1) {
remove_original_key = true
}