Comparing version 1.3.2 to 1.4.0
@@ -17,3 +17,3 @@ exports.stringify = function(data){ | ||
if(needs_escaping) value = value.replace(/["\\]/g, '\\$&'); | ||
if(needs_quoting) value = '"' + value + '"'; | ||
if(needs_quoting || needs_escaping) value = '"' + value + '"'; | ||
if(value === '' && !is_null) value = '""'; | ||
@@ -20,0 +20,0 @@ |
{ | ||
"name": "logfmt", | ||
"version": "1.3.2", | ||
"version": "1.4.0", | ||
"description": "key=value logger and parser", | ||
@@ -5,0 +5,0 @@ "main": "logfmt.js", |
@@ -25,2 +25,7 @@ var logfmt = require('../logfmt'), | ||
test("quotes strings with quotes in them", function(){ | ||
var data = {foo: JSON.stringify({ bar: 'baz'})} | ||
assert.equal('foo="{\\"bar\\":\\"baz\\"}"', logfmt.stringify(data)) | ||
}) | ||
test("escapes quotes within strings with spaces in them", function(){ | ||
@@ -27,0 +32,0 @@ var data = {foo: 'hello my "friend"'} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65433
1507