Socket
Socket
Sign inDemoInstall

clang

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clang - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

29

lib/clang.js

@@ -144,8 +144,29 @@ var _ = require('lodash');

particle: 'prefix',
email: 'emailAddress'
email: 'emailAddress',
gender: {
fieldName: 'gender',
values: {
M: 'MAN',
F: 'WOMAN'
}
}
});
// create a new object with altered keys based on fieldMap
customer = _.mapKeys(customer, function(value, key) {
return options.fieldMap[key] || key;
// create a new object with altered keys and values based on the fieldMap configuration
var transformedCustomer = {};
_.forOwn(customer, function(value, key) {
var fieldMapTo = options.fieldMap[key];
if (typeof fieldMapTo === 'string') {
// set the value on a new key
transformedCustomer[fieldMapTo] = value;
}
else if (typeof fieldMapTo === 'object') {
// take the fieldName and values configuration of this fieldMap to transform the key and value
transformedCustomer[fieldMapTo.fieldName] = fieldMapTo.values[value] || value;
}
else {
// set the value on a the same key
transformedCustomer[key] = value;
}
});
customer = transformedCustomer;

@@ -152,0 +173,0 @@ var customerArgs = {};

2

package.json
{
"name": "clang",
"version": "0.2.5",
"version": "0.2.6",
"description": "Node.js api wrapper for Clang's SOAP api",

@@ -5,0 +5,0 @@ "author": "Christiaan Westerbeek <chris@devotis.nl>",

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