@nodecraft/ini
Advanced tools
Comparing version 2.2.2 to 2.3.0
@@ -19,2 +19,3 @@ 'use strict'; | ||
inlineArrays: false, | ||
allowEmptySection: false, | ||
}; | ||
@@ -47,3 +48,3 @@ }else{ | ||
if(options.section && out.length > 0){ | ||
if((options.section && out.length > 0) || (children.length === 0 && options.allowEmptySection)){ | ||
out = '[' + safe(options.section, null, options) + ']' + eol + out; | ||
@@ -60,2 +61,3 @@ } | ||
forceStringifyKeys: options.forceStringifyKeys, | ||
allowEmptySection: options.allowEmptySection, | ||
}); | ||
@@ -62,0 +64,0 @@ if(out.length > 0 && child.length > 0){ |
{ | ||
"name": "@nodecraft/ini", | ||
"version": "2.2.2", | ||
"version": "2.3.0", | ||
"description": "An ini encoder/decoder for node", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -42,2 +42,9 @@ An ini format parser and serializer for node. | ||
## New `allowEmptySection` option | ||
If you want to allow empty sections, you can set this option to `true`. | ||
```ini | ||
[section] | ||
``` | ||
Previously, this would omit the section entirely on encode. Now, it will be included in the output. | ||
## Usage | ||
@@ -125,2 +132,3 @@ | ||
find that it's more human-readable and pretty with the whitespace. | ||
* `allowEmptySection` Whether to allow empty sections. Defaults to `false`. | ||
@@ -127,0 +135,0 @@ For backwards compatibility reasons, if a `string` options is passed |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13568
219
154