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

properties-parser

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

properties-parser - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

play-ground.js

3

index.js

@@ -270,3 +270,3 @@ var fs = require("fs");

} else if(range.type === "key-value") {
range.children[2] = { type: "literal", text: val, parent: range };
range.children[2] = { type: "literal", text: val };
} else {

@@ -295,3 +295,2 @@ throw "Unknown node type: " + range.type;

buffer.push(node.text);
if(node.parent) { buffer.push(text.substring(node.end, node.parent.end)); }
break;

@@ -298,0 +297,0 @@ case "key":

{ "name": "properties-parser"
, "version": "0.2.2"
, "version": "0.2.3"
, "description": "A parser for .properties files written in javascript"

@@ -4,0 +4,0 @@ , "keywords": [ "parser", ".properties", "properties", "java", "file parser", "actionscript" ]

@@ -87,4 +87,38 @@ var fs = require("fs");

prop.createEditor("./test-cases.properties", function(err, editor) {
var properties = {};
properties.lala = 'whatever';
properties.website = 'whatever';
properties.language = 'whatever';
properties.message = 'whatever';
properties['key with spaces'] = 'whatever';
properties.tab = 'whatever';
properties['long-unicode'] = 'whatever';
properties['another-test'] = 'whatever';
for (var item in properties) {
editor.set(item, properties[item]);
}
assert.equal(
editor.toString(),
'# You are reading the ".properties" entry.\n' +
'! The exclamation mark can also mark text as comments.\n' +
'lala=whatever\n' +
'website = whatever\n' +
'language = whatever\n' +
'# The backslash below tells the application to continue reading\n' +
'# the value onto the next line.\n' +
'message = whatever\n' +
'# Add spaces to the key\n' +
'key\\ with\\ spaces = whatever\n' +
'# Unicode\n' +
'tab : whatever\n' +
'long-unicode : whatever\n' +
'space\\ separator key val \\n three\n' +
'another-test :whatever\n' +
' null-prop'
);
});
// java ReadProperties test-cases.properties
// javac ReadProperties.java
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