Comparing version 0.0.11 to 0.0.12
30
a.js
@@ -1,3 +0,29 @@ | ||
var j = require('./jsontoxml'); | ||
var obj = { | ||
"message":[ | ||
{name:"authkey", text:"api"}, | ||
{name:"sender", text:"777777"}, | ||
{name:"route", text:"default"}, | ||
{name:"campaign", text:"get perks"}, | ||
{name:"country",text:"91"}, | ||
{name:"sms",attrs:{text:"Check api"},children:[ | ||
{name:"address",attrs:{to:"12345"}}, | ||
{name:"address",attrs:{to:"123455"}} | ||
]} | ||
] | ||
} | ||
console.log(j([{attrs:{a:"b"},name:"b"}])) | ||
var jsontoxml = require('./') | ||
console.log(jsontoxml([ | ||
{name: "sitemapindex",attrs:{xmlns:"http://www.sitemaps.org/schemas/sitemap/0.9"},children:[ | ||
{name:"sitemap",children:{ | ||
loc:"url1" | ||
}}, | ||
{name:"sitemap",children:{ | ||
loc:"url2" | ||
}}, | ||
{name:"sitemap",children:{ | ||
loc:"url3" | ||
}}, | ||
]} | ||
],{prettyPrint:true,indent:" "})) |
@@ -7,2 +7,3 @@ //copyright Ryan Day 2010 <http://ryanday.org>, Joscha Feth 2013 <http://www.feth.com> [MIT Licensed] | ||
var element_replace = new RegExp("^([^" + element_start_char + "])|^((x|X)(m|M)(l|L))|([^" + element_start_char + element_non_start_char + "])", "g"); | ||
var not_safe_in_xml = /[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm; | ||
@@ -183,3 +184,4 @@ var process_to_xml = function(node_data,options){ | ||
.replace(/'/g, ''') | ||
.replace(/"/g, '"'); | ||
.replace(/"/g, '"') | ||
.replace(not_safe_in_xml, ''); | ||
} | ||
@@ -186,0 +188,0 @@ |
{ | ||
"name": "jsontoxml", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"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/ken-franken/node-jsontoxml", |
@@ -30,3 +30,3 @@ [![Build Status](https://secure.travis-ci.org/soldair/node-jsontoxml.png)](http://travis-ci.org/soldair/node-jsontoxml) | ||
hi:'is a nice thing to say', | ||
node:'i am another not special child node' | ||
node:'i am another not special child node', | ||
date:function(){ | ||
@@ -75,3 +75,3 @@ return (new Date())+''; | ||
- `xmlHeader` can either be boolan (add generic `<?xml …?>` header) or an object. If an object valid options are: | ||
- `standalone` if true, the `<?xml …?>` gets an additional attribute `standalone="true"`. | ||
- `standalone` if true, the `<?xml …?>` gets an additional attribute `standalone="yes"`. | ||
- `docType` if defined gets added as the `<!DOCTYPE …>` contents (unescaped). | ||
@@ -78,0 +78,0 @@ - `prettyPrint` if truthy the output gets a rudimentary pretty print (good for debugging, don't expect too much) |
@@ -11,3 +11,3 @@ //copyright Ryan Day 2010 <http://ryanday.org> [MIT Licensed] | ||
parent:[ | ||
{name:'taco',text:'beef taco',children:{salsa:'hot!'}}, | ||
{name:'taco',text:'beef taco',children:{salsa:'hot!'}}, | ||
{name:'xml',text:'tag'}, | ||
@@ -14,0 +14,0 @@ {name:'taco',text:'fish taco',attrs:{mood:'sad'},children:[ |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 7 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
0
14275
8
277