Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function writeSpecFromLead(lead,command) {
var exPatch = _.cloneDeep(lead);
var origin = util.getOrigin(exPatch);
if (Array.isArray(origin))
origin = origin.pop();
var source = origin.url;
var format = converter.getFormatName(origin.format, origin.version);
if (!exPatch.info['x-origin'].length) {
delete exPatch.info['x-origin'];
}
return writeSpec(source, format, exPatch, command);
}