node-properties
node-properties copied to clipboard
Is there a way to not auto translate hex values?
my config file:
bla=bla
HEX_ARRAY_1=0x34,0x38,0x99
HEX_ARRAY_2=0x31
properties parse result:
{ bla: 'bla',
HEX_ARRAY_1: '0x34,0x38,0x99',
HEX_ARRAY_2: 49 }
The one value in HEX_ARRAY_2 is translated to decimal directly.
Is there a way to not do that ?
By default, property values will be cast to their JavaScript type equivalent. You can use tatablack's fix to disable number type cast: https://github.com/gagle/node-properties/pull/12
@shaochuancs i can't understand how to use tatablack's fix..
@aleclofabbro The easiest way to use his fix is directly clone from his forked repository: https://github.com/tatablack/node-properties/tree/make-casting-optional
:+1: Thx!