Skip to content

Commit 68ade79

Browse files
authored
Merge pull request #515 from forcedotcom/#512
fix: #512 Added RAW_VALUE
2 parents fc164e2 + 7823123 commit 68ade79

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/modules/components/common_components/statics.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

src/modules/models/job_models/migrationJobTask.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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) { }

0 commit comments

Comments
 (0)