fix(zcash-conf): parse comment lines in zcash.conf
This commit is contained in:
parent
0e88d924c4
commit
c3df064b48
|
@ -13,6 +13,7 @@ let originalDate;
|
|||
const fixedDate = new Date('2018-02-28T09:39:59');
|
||||
|
||||
beforeAll(() => {
|
||||
// $FlowFixMe
|
||||
dateFns.format = jest.fn(() => '17:01 PM');
|
||||
|
||||
originalDate = global.Date;
|
||||
|
|
|
@ -13,6 +13,7 @@ let originalDate;
|
|||
const fixedDate = new Date('2018-02-28T09:39:59');
|
||||
|
||||
beforeAll(() => {
|
||||
// $FlowFixMe
|
||||
dateFns.format = jest.fn(() => '17:01 PM');
|
||||
|
||||
originalDate = global.Date;
|
||||
|
|
|
@ -42,6 +42,11 @@ export const parseZcashConf = (): Promise<Array<string>> => new Promise((resolve
|
|||
const { rpcuser, rpcpassword, ...payload }: ZcashConfFile = filterObjectNullKeys(
|
||||
fileString.split('\n').reduce((acc, cur) => {
|
||||
if (!cur) return acc;
|
||||
|
||||
const line = cur.trim();
|
||||
|
||||
if (line.startsWith('#')) return acc;
|
||||
|
||||
const [key, value] = cur.split('=');
|
||||
return { ...acc, [key.trim().toLowerCase()]: value.trim() };
|
||||
}, {}),
|
||||
|
|
Loading…
Reference in New Issue