Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

properties-reader

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

properties-reader - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

2

package.json
{
"name": "properties-reader",
"description": "Properties file reader for Node.js",
"version": "0.0.6",
"version": "0.0.7",
"author": {

@@ -6,0 +6,0 @@ "name": "Steve King",

@@ -99,2 +99,8 @@ (function() {

}
else {
var replacements = {'\\n': '\n', '\\r': '\r', '\\t': '\t'};
parsedValue = value.replace(/\\[nrt]/g, function (key) {
return replacements[key];
});
}

@@ -101,0 +107,0 @@ return parsedValue;

@@ -106,3 +106,15 @@

Assertions.assert(app.set.withArgs('foo.bar', 'A Value').calledOnce, 'Sets all properties');
},
'test Permits escaped new line characters': function () {
var properties = givenFilePropertiesReader('\n\nsome.property= Multi\\n Line \\nString \nfoo.bar = A Value');
// parsed access modifies the new line characters
Assertions.assertEquals(properties.get('foo.bar'), 'A Value', 'Sets all properties');
Assertions.assertEquals(properties.get('some.property'), 'Multi\n Line \nString', 'Sets all properties');
// raw access does not modify the new line characters
Assertions.assertEquals(properties.getRaw('some.property'), 'Multi\\n Line \\nString', 'Sets all properties');
Assertions.assertEquals(properties.path().some.property, 'Multi\\n Line \\nString', 'Sets all properties');
}
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc