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.14 to 0.0.15

2

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

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

@@ -68,2 +68,5 @@ Properties-Reader

To get the complete set of properties, either loop through them with the `.each((key, value) => {})` iterator or
use the convenience method `getAllProperties` to return the complete set of flattened properties.
Data Types

@@ -70,0 +73,0 @@ ==========

@@ -187,2 +187,15 @@ (function() {

/**
* Gets the object that represents all properties.
*
* @returns {Object}
*/
PropertiesReader.prototype.getAllProperties = function() {
var properties = {};
this.each(function (key, value) {
properties[key] = value;
});
return properties;
};
/**
* Creates and returns a new PropertiesReader based on the values in this instance.

@@ -189,0 +202,0 @@ * @return {PropertiesReader}

@@ -212,3 +212,36 @@

), "fetch an entire object");
},
'test getAllProperties returns properties map': function () {
givenFilePropertiesReader('\
root.a.b = Hello\n\
some.thing = Else\n\
');
Assertions.assert(same(
properties.getAllProperties(),
{
'root.a.b': "Hello",
'some.thing': 'Else'
}
), "fetch an entire object");
},
'test getAllProperties is immutable': function () {
givenFilePropertiesReader('\
root.a.b = Hello\n\
some.thing = Else\n\
');
var allProperties = properties.getAllProperties();
allProperties['root.a.b'] = 'New Value';
Assertions.assert(same(
properties.getAllProperties(),
{
'root.a.b': "Hello",
'some.thing': 'Else'
}
), "properties remain unchanged");
}
});
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