Comparing version 0.0.8 to 0.0.9
@@ -9,3 +9,4 @@ //copyright Ryan Day 2010 <http://ryanday.org>, Joscha Feth 2013 <http://www.feth.com> [MIT Licensed] | ||
var indent = options.prettyPrint ? '\n' + new Array(level).join("\t") : ''; | ||
var indent_value = options.indent !== undefined ? options.indent : "\t"; | ||
var indent = options.prettyPrint ? '\n' + new Array(level).join(indent_value) : ''; | ||
@@ -125,3 +126,5 @@ var node = [indent, '<',name, (attributes || '')]; | ||
if(typeof obj == 'string' || isBuffer(obj)) { | ||
var Buffer = this.Buffer || function Buffer () {}; | ||
if(typeof obj == 'string' || obj instanceof Buffer) { | ||
try{ | ||
@@ -183,7 +186,1 @@ obj = JSON.parse(obj.toString()); | ||
}; | ||
function isBuffer(b){ | ||
if(typeof Buffer == 'undefined') return false; | ||
return (b instanceof Buffer); | ||
} | ||
{ | ||
"name": "jsontoxml", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "This is a library designed to render js objects as xml. Its not made to parse or otherwise edit existing xml/html structures.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/soldair/node-jsontoxml", |
@@ -77,2 +77,3 @@ [![Build Status](https://secure.travis-ci.org/soldair/node-jsontoxml.png)](http://travis-ci.org/soldair/node-jsontoxml) | ||
- `prettyPrint` if truthy the output gets a rudimentary pretty print (good for debugging, don't expect too much) | ||
- `indent` specify what unit you would like to indent by (spaces, tabstop, nothing - pass an empty string) | ||
@@ -86,4 +87,4 @@ | ||
`jsontoxml.cdata (string)` | ||
* wraps string with `<!CDATA[[ ]]>` | ||
* wraps string with `<![CDATA[ ]]>` | ||
* removes all occurences of close cdata (`]]>`) in input text | ||
@@ -90,0 +91,0 @@ |
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
251653
97
7469