properties icon indicating copy to clipboard operation
properties copied to clipboard

properties.path() not working for dot-separated keys after upgrade from 2.1.1 to 2.2.0

Open ms1111 opened this issue 3 years ago • 1 comments

Hi, thanks for this library! I'm using it to parse Spring-like properties files.

Given a properties file with no header and a dot-separated value:

testkey.nested=testval

In 2.1.1 I used to be able to do:

const propertiesReader = require("properties-reader");
const properties = propertiesReader("test.properties");
properties.path()

This would give an object: { testkey: { nested: 'testval' } }

In 2.2.0, path() here returns: {}

ms1111 avatar Aug 26 '22 19:08 ms1111

The keys are there, they just don't show up in console.log() or for (const key of properties.path()) because they aren't enumerable. Added #71 to make them enumerable.

ms1111 avatar Jan 13 '24 17:01 ms1111