Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ms1111 opened this issue Aug 26, 2022 · 1 comment · May be fixed by #71
Open

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

ms1111 opened this issue Aug 26, 2022 · 1 comment · May be fixed by #71

Comments

@ms1111
Copy link

ms1111 commented Aug 26, 2022

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 added a commit to ms1111/properties that referenced this issue Jan 13, 2024
The return value of properties.path() had enumerable keys in 2.1.1 and
earlier. Starting in 2.2.0, the keys were no longer enumerable as part
of the change made for steveukx#40 in 0877cc8.

Fixes steveukx#58
@ms1111 ms1111 linked a pull request Jan 13, 2024 that will close this issue
@ms1111
Copy link
Author

ms1111 commented Jan 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant