Commit 52669b2e408727e968a486c5f237af91de1a054d

Authored by Adhidarma Hadiwinoto
1 parent 00fd3da335
Exists in master

rc-local.json is exclusive

Showing 1 changed file with 5 additions and 5 deletions Side-by-side Diff

lib/translate-rc/index.js
... ... @@ -11,7 +11,7 @@ const dictCustomFilename = path.join(process.cwd(), 'rc-local.json');
11 11 const dictCustomFileExists = fs.existsSync(dictCustomFilename);
12 12  
13 13 // eslint-disable-next-line import/no-dynamic-require
14   -const dictCustom = dictCustomFileExists ? require(dictCustomFilename) : {};
  14 +const dictCustom = dictCustomFileExists ? require(dictCustomFilename) : null;
15 15  
16 16 if (dictCustomFileExists) {
17 17 logger.verbose(`${MODULE_NAME} 14F61E23: Custom RC dictionary found`, {
... ... @@ -23,14 +23,14 @@ if (dictCustomFileExists) {
23 23 module.exports = (xid, rcFromPartner) => {
24 24 if (!rcFromPartner) {
25 25 logger.verbose(`${MODULE_NAME} 030CFC8F: Unknown rcFromPartner`, { xid });
26   - return null;
  26 + return '68';
27 27 }
28 28  
29 29 logger.verbose(`${MODULE_NAME} 9EDC60A9: Translating RC from partner`, { xid, rcFromPartner });
30 30  
31   - if (dictCustom[rcFromPartner]) {
32   - logger.verbose(`${MODULE_NAME} 0F4ED40E: Found on custom dict`, { xid });
33   - return dictCustom[rcFromPartner];
  31 + if (dictCustom) {
  32 + logger.verbose(`${MODULE_NAME} 3A495EC2: Using rc-local.json`, { xid });
  33 + return dictCustom[rcFromPartner] || '40';
34 34 }
35 35  
36 36 if (dictDefault[rcFromPartner]) {