New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

swiz

Package Overview
Dependencies
Maintainers
4
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swiz - npm Package Compare versions

Comparing version 0.4.24 to 0.4.25

3

lib/serializer.js

@@ -303,2 +303,3 @@ /*

/**

@@ -320,3 +321,3 @@ * convert an xml element into a javascript object.

// if there is text, there should be no children.
if (elem.text.length > 0) {
if (elem.text.length > 0 && elem.text.trim().length > 0) {
var field = findField(elem.tag, def.fields);

@@ -323,0 +324,0 @@ if (field) {

@@ -14,3 +14,3 @@ {

"description": "Serilization and Validation Framework for objects in RESTful APIs",
"version": "0.4.24",
"version": "0.4.25",
"homepage": "https://github.com/racker/node-swiz",

@@ -17,0 +17,0 @@ "repository": {

@@ -1816,2 +1816,27 @@ /*

exports['test_xml_with_whitespace'] = function(test, assert) {
var validity = swiz.defToValve(def),
v = new V(validity.Node),
testxml,
obj, sw = new swiz.Swiz(def);
testxml = sw.deserializeXml('<?xml version="1.0" encoding="utf-8"?><node id="xkCD366" name="exmample"> <is_active>true</is_active><agent_name>your mom</agent_name><ipaddress>42.24.42.24</ipaddress></node>');
v.check(testxml, function(err, cleaned) {
assert.ifError(err);
obj = cleaned;
obj.getSerializerType = function() {return 'Node';};
sw.serialize(swiz.SERIALIZATION.SERIALIZATION_XML, 1, obj,
function(err, xml) {
console.error(xml);
assert.ifError(err);
sw.deserialize(swiz.SERIALIZATION.SERIALIZATION_XML, 1, xml, function(err, newObj) {
assert.deepEqual(newObj, exampleNode, 'Round trip json swiz/valve test');
assert.ifError(err);
test.finish();
});
});
});
};
exports['test_boolean'] = function(test, assert) {

@@ -1818,0 +1843,0 @@ var v = new V({

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