Comparing version 0.1.10 to 0.1.11
@@ -150,22 +150,27 @@ var _ = require('lodash'); | ||
} | ||
if (!args[clangObjectName]) { | ||
return args; | ||
} | ||
var normalizedArgs = _.clone(args); | ||
Object.keys(normalizedArgs[clangObjectName]).forEach(function(key) { | ||
if (typeof inputDefinition[clangObjectName][key] !== 'string') { | ||
if (!normalizedArgs[clangObjectName][optionsIdentifier]) { | ||
normalizedArgs[clangObjectName][optionsIdentifier] = {}; | ||
normalizedArgs[clangObjectName][optionsIdentifier][optionIdentifier] = []; | ||
var moveOptions = function (object, inputDefinition) { | ||
Object.keys(object).forEach(function(key) { | ||
if (typeof inputDefinition[key] !== 'string') { | ||
if (!object[optionsIdentifier]) { | ||
object[optionsIdentifier] = {}; | ||
object[optionsIdentifier][optionIdentifier] = []; | ||
} | ||
object[optionsIdentifier][optionIdentifier].push({ | ||
name : key, | ||
value: object[key] | ||
}); | ||
delete object[key]; | ||
} | ||
normalizedArgs[clangObjectName][optionsIdentifier][optionIdentifier].push({ | ||
name : key, | ||
value: normalizedArgs[clangObjectName][key] | ||
}); | ||
delete normalizedArgs[clangObjectName][key]; | ||
} | ||
}); | ||
}); | ||
}; | ||
if (args[clangObjectName] && Object.prototype.toString.call(args[clangObjectName]) === '[object Object]') { | ||
moveOptions(normalizedArgs[clangObjectName], inputDefinition[clangObjectName]); | ||
} else { | ||
moveOptions(normalizedArgs, inputDefinition); | ||
} | ||
return normalizedArgs; | ||
@@ -172,0 +177,0 @@ }; |
{ | ||
"name": "clang", | ||
"version": "0.1.10", | ||
"version": "0.1.11", | ||
"description": "Node.js api wrapper for Clang's SOAP api", | ||
@@ -5,0 +5,0 @@ "author": "Christiaan Westerbeek <chris@devotis.nl>", |
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
227707
6604