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

java-properties

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

java-properties - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

15

lib/properties.js

@@ -28,10 +28,5 @@ /*

get: function(key) {
var self = this;
var rawValue = objs[key];
if (rawValue) {
return rawValue
.replace(/\\\\/g, '\\')
.replace(/\$\{([A-Za-z0-9\.]*)\}/g, function(match) {
return self.get(match.substring(2, match.length - 1));
});
return this.interpolate(rawValue);
}

@@ -41,4 +36,12 @@ },

objs[key] = value;
},
interpolate: function(s) {
var self = this;
return s
.replace(/\\\\/g, '\\')
.replace(/\$\{([A-Za-z0-9\.]*)\}/g, function(match) {
return self.get(match.substring(2, match.length - 1));
});
}
};
};

4

package.json
{
"name": "java-properties",
"description": "Reads and interpolates Java .properties files",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "http://github.com/mattdsteele/java-properties",

@@ -34,5 +34,5 @@ "author": {

"grunt-contrib-watch": "~0.2.0",
"grunt": "~0.4.0"
"grunt": "~0.4.1"
},
"keywords": ["java", "properties"]
}

@@ -88,3 +88,15 @@ 'use strict';

test.done();
},
'problematic file': function(test) {
test.expect(2);
props = properties.of('test/fixtures/service.properties');
test.equal('service', props.get('service.dir'));
test.equal('service/secure', props.get('service.secured.dir'));
test.done();
},
'interpolating' : function(test) {
test.expect(1);
test.equal('version 7 is the best!', props.interpolate('version ${ricola.version.minor} is the best!'));
test.done();
}
};
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