properties
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -58,3 +58,3 @@ "use strict"; | ||
if (escapingUnicode && unicodeRemaining){ | ||
unicode = (unicode<<4) + hex (c); | ||
unicode = (unicode << 4) + hex (c); | ||
if (--unicodeRemaining) return key; | ||
@@ -113,3 +113,3 @@ escape = false; | ||
for (var i=~~control.resume, ii=data.length; i<ii; i++){ | ||
for (var i=~~control.resume; i<data.length; i++){ | ||
if (control.abort) return; | ||
@@ -116,0 +116,0 @@ if (control.pause){ |
@@ -32,3 +32,3 @@ "use strict"; | ||
for (var i=0, ii=str.length; i<ii; i++){ | ||
for (var i=0; i<str.length; i++){ | ||
c = str[i]; | ||
@@ -94,3 +94,3 @@ | ||
for (var i=0, ii=n.length-1; i<ii; i++){ | ||
for (var i=0; i<n.length-1; i++){ | ||
str = n[i]; | ||
@@ -108,6 +108,9 @@ if (p[str] === undefined) return; | ||
for (var i=0, ii=n.length-1; i<ii; i++){ | ||
for (var i=0; i<n.length-1; i++){ | ||
str = n[i]; | ||
if (p[str] === undefined){ | ||
p[str] = {}; | ||
}else if (typeof p[str] !== "object"){ | ||
return new Error ("Invalid namespace chain, the key must contain an " + | ||
"object: " + key); | ||
} | ||
@@ -211,2 +214,4 @@ p = p[str]; | ||
var line; | ||
var error; | ||
if (options.reviver){ | ||
@@ -227,4 +232,5 @@ if (options.sections){ | ||
if (options.namespaces){ | ||
namespace (currentSection === null ? n : n[currentSection], key, | ||
value); | ||
error = namespace (currentSection === null ? n : n[currentSection], | ||
key, value); | ||
if (error) abort (error); | ||
} | ||
@@ -246,3 +252,4 @@ } | ||
if (options.namespaces){ | ||
namespace (n, key, value); | ||
error = namespace (n, key, value); | ||
if (error) abort (error); | ||
} | ||
@@ -261,4 +268,5 @@ } | ||
if (options.namespaces){ | ||
namespace (currentSection === null ? n : n[currentSection], key, | ||
value); | ||
error = namespace (currentSection === null ? n : n[currentSection], | ||
key, value); | ||
if (error) abort (error); | ||
} | ||
@@ -273,3 +281,4 @@ }; | ||
if (options.namespaces){ | ||
namespace (n, key, value); | ||
error = namespace (n, key, value); | ||
if (error) abort (error); | ||
} | ||
@@ -276,0 +285,0 @@ }; |
@@ -16,3 +16,3 @@ "use strict"; | ||
for (var i=0, ii=comment.length; i<ii; i++){ | ||
for (var i=0; i<comment.length; i++){ | ||
c = comment[i]; | ||
@@ -40,3 +40,3 @@ code = comment.charCodeAt (i); | ||
for (var i=0, ii=s.length; i<ii; i++){ | ||
for (var i=0; i<s.length; i++){ | ||
c = s[i]; | ||
@@ -55,3 +55,3 @@ code = s.charCodeAt (i); | ||
for (var i=0, ii=s.length; i<ii; i++){ | ||
for (var i=0; i<s.length; i++){ | ||
c = s[i]; | ||
@@ -58,0 +58,0 @@ code = s.charCodeAt (i); |
{ | ||
"name": "properties", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": ".properties parser/stringifier", | ||
@@ -5,0 +5,0 @@ "keywords": ["properties", "ini", "parser", "stringifier", "config"], |
@@ -15,2 +15,21 @@ properties | ||
#### Quick example #### | ||
``` | ||
# file | ||
a = 1 | ||
b: 2 | ||
``` | ||
```javascript | ||
var properties = require ("properties"); | ||
properties.load ("file", { path: true }, function (error, obj){ | ||
if (error) return console.error (error); | ||
console.log (obj); | ||
//{ a: 1, b: 2 } | ||
}); | ||
``` | ||
#### Documentation #### | ||
@@ -36,9 +55,2 @@ | ||
#### Migration from v0.3 to v1 | ||
- `load()` and `store()` have been removed. Now `parse()` and `stringify()` can read and write from/to files using the `path` option. | ||
- `stringify()` has been refactored. Now a `Stringifier` can be used to stringify an object if you want to write sections or comments. | ||
- The `pretty` option has been removed from `stringify()`. | ||
- The `replacer` from `stringify()` must be a function. Cannot be an array like in previous versions. | ||
--- | ||
@@ -358,3 +370,3 @@ | ||
- __strict__ - _Boolean_ | ||
This option can be used with the comments and separators options. If is set to true __only__ the tokens specified in these options are used to parse comments and separators. | ||
This option can be used with the `comments` and `separators` options. If true, __only__ the tokens specified in these options are used to parse comments and separators. | ||
- __sections__ - _Boolean_ | ||
@@ -361,0 +373,0 @@ Parses INI sections. See the [ini](#ini) section for further details. |
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
45516
890
609