ini icon indicating copy to clipboard operation
ini copied to clipboard

Support duplicate property names as array

Open wujunchuan opened this issue 4 years ago • 4 comments

Most implementations only support having one property with a given name in a section. But some programs use duplicate property names to implement multi-valued properties.

If the ini library can compatible this feature, it will improve compatible with difference scenes. It all depends on the developer needs.

This PR include these change about:

  • handle duplicate property as array
  • add new options.withoutArraySuffix:boolean for encode method to decide output array include [] suffix or not default is false and will work just like before
  • add test/duplicate-properties.js for 100% coverage test

References

Wikipedia about INI file description in varying features: Wikipedia - INI file

wujunchuan avatar Nov 28 '20 08:11 wujunchuan

/home/travis/build/npm/ini/node_modules/tap/node_modules/stack-utils/index.js:51
  clean (stack, indent = 0) {
                       ^
SyntaxError: Unexpected token = xxxxx

This seems to be a compatibility issue with the test library tap in Nodejs@4(default argument value feature)

wujunchuan avatar Nov 28 '20 08:11 wujunchuan

@wujunchuan are you still working on this feature?

chapterjason avatar Jan 14 '21 18:01 chapterjason

@wujunchuan are you still working on this feature?

No, as it seems that the repo is not maintained anymore.

But if you need this feature, you can fork my repo.

wujunchuan avatar Jan 15 '21 01:01 wujunchuan

I fixed all issues and made a new pr: https://github.com/npm/ini/pull/137, please review :)

Leask avatar Nov 10 '21 04:11 Leask

Closing for https://github.com/npm/ini/pull/137

wraithgar avatar Apr 11 '23 21:04 wraithgar