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.1 to 0.1.2

37

lib/properties.js

@@ -26,21 +26,24 @@ /*

return {
get: function(key) {
var rawValue = objs[key];
if (rawValue) {
return this.interpolate(rawValue);
}
},
set: function(key, value) {
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));
});
var get = function(key) {
var rawValue = objs[key];
if (rawValue) {
return interpolate(rawValue);
}
};
var set = function(key, value) {
objs[key] = value;
};
var interpolate = function(s) {
return s
.replace(/\\\\/g, '\\')
.replace(/\$\{([A-Za-z0-9\.]*)\}/g, function(match) {
return get(match.substring(2, match.length - 1));
});
};
return {
get: get,
set: set,
interpolate: interpolate
};
};
{
"name": "java-properties",
"description": "Reads and interpolates Java .properties files",
"version": "0.1.1",
"version": "0.1.2",
"homepage": "http://github.com/mattdsteele/java-properties",

@@ -6,0 +6,0 @@ "author": {

@@ -89,9 +89,2 @@ 'use strict';

},
'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) {

@@ -98,0 +91,0 @@ test.expect(1);

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