File tree Expand file tree Collapse file tree
components/common_components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ export const CONSTANTS = {
3939 COMPLEX_FIELDS_SEPARATOR : ';' ,
4040 REFERENCE_FIELD_OBJECT_SEPARATOR : '$' ,
4141 FIELDS_MAPPING_REGEX_PATTERN : '^\/(.*)\/$' ,
42+ FIELDS_MAPPING_EVAL_PATTERN : '^eval(\(.*\))$' ,
4243
4344 SCRIPT_FILE_NAME : 'export.json' ,
4445
Original file line number Diff line number Diff line change @@ -1860,6 +1860,15 @@ export default class MigrationJobTask {
18601860 newValue = newValue == 'TRUE' || newValue == 'true' ? true :
18611861 newValue == 'FALSE' || newValue == 'false' ? false :
18621862 newValue == 'null' || newValue == 'NULL' || newValue == 'undefined' || newValue == '#N/A' || newValue == undefined ? null : newValue ;
1863+
1864+ // Eval
1865+ if ( new RegExp ( CONSTANTS . FIELDS_MAPPING_EVAL_PATTERN ) . test ( newValue ) ) {
1866+ let expr = newValue . replace ( new RegExp ( CONSTANTS . FIELDS_MAPPING_EVAL_PATTERN ) , '$1' ) ;
1867+ try {
1868+ newValue = eval ( expr ) ;
1869+ } catch ( ex ) { }
1870+ }
1871+
18631872 if ( typeof newValue != 'undefined' ) {
18641873 record [ field ] = newValue ;
18651874 }
You can’t perform that action at this time.
0 commit comments