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 @@ -40,6 +40,7 @@ export const CONSTANTS = {
4040 REFERENCE_FIELD_OBJECT_SEPARATOR : '$' ,
4141 FIELDS_MAPPING_REGEX_PATTERN : '^\/(.*)\/$' ,
4242 FIELDS_MAPPING_EVAL_PATTERN : '^eval(\(.*\))$' ,
43+ FIELD_MAPPING_EVAL_PATTERN_ORIGINAL_VALUE : 'RAW_VALUE' ,
4344
4445 SCRIPT_FILE_NAME : 'export.json' ,
4546
Original file line number Diff line number Diff line change @@ -1862,8 +1862,9 @@ export default class MigrationJobTask {
18621862 newValue == 'null' || newValue == 'NULL' || newValue == 'undefined' || newValue == '#N/A' || newValue == undefined ? null : newValue ;
18631863
18641864 // 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' ) ;
1865+ if ( new RegExp ( CONSTANTS . FIELDS_MAPPING_EVAL_PATTERN , 'i' ) . test ( newValue ) ) {
1866+ let expr = newValue . replace ( new RegExp ( CONSTANTS . FIELDS_MAPPING_EVAL_PATTERN , 'i' ) , '$1' ) ;
1867+ expr = expr . replace ( new RegExp ( CONSTANTS . FIELD_MAPPING_EVAL_PATTERN_ORIGINAL_VALUE , 'gi' ) , rawValue ) ;
18671868 try {
18681869 newValue = eval ( expr ) ;
18691870 } catch ( ex ) { }
You can’t perform that action at this time.
0 commit comments