steveukx / properties

Properties reader for Node.js
MIT License
77 stars 33 forks source link

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

Open ms1111 opened 2 years ago

ms1111 commented 2 years ago

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 commented 9 months ago

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.