Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.4 to 0.2.5

33

lib/clang.js

@@ -124,2 +124,3 @@ var _ = require('lodash');

var customerGetMethodName;
var mergeMethodName;
var sendMethodName;

@@ -140,2 +141,12 @@

options.lookup = options.lookup || 'externalId';
options.fieldMap = options.fieldMap || {};
_.merge(options.fieldMap, {
// default field mappings
particle: 'prefix',
email: 'emailAddress'
});
// create a new object with altered keys based on fieldMap
customer = _.mapKeys(customer, function(value, key) {
return options.fieldMap[key] || key;
});

@@ -216,18 +227,8 @@ var customerArgs = {};

customer.id = record.id;
me.request('customer_update', {customer: customer}, function(err, result) {
if (err) {
return callback(err);
}
if (!result || !result.length) {
return callback(new Error('No customer returned after update'));
}
if (result.length > 1) {
return callback(new Error('Multiple customers returned after update'));
}
callback(null, result[0]);
});
return;
mergeMethodName = 'customer_update';
} else {
mergeMethodName = 'customer_insert';
}
me.request('customer_insert', {customer: customer}, function(err, result) {
me.request(mergeMethodName, {customer: customer}, function(err, result) {
if (err) {

@@ -237,6 +238,6 @@ return callback(err);

if (!result || !result.length) {
return callback(new Error('No customer returned after create'));
return callback(new Error('No customer returned after ' + mergeMethodName));
}
if (result.length > 1) {
return callback(new Error('Multiple customers returned after create'));
return callback(new Error('Multiple customers returned after ' + mergeMethodName));
}

@@ -243,0 +244,0 @@ callback(null, result[0]);

{
"name": "clang",
"version": "0.2.4",
"version": "0.2.5",
"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