Comparing version 0.4.0 to 0.5.0
@@ -5,9 +5,7 @@ 'use strict'; | ||
const expandPorts = ports => { | ||
if (ports.constructor !== Object) { | ||
return ports; | ||
} | ||
return Object.keys(ports).reduce((res, name) => { | ||
let width = ports[name]; | ||
const expandWire = wire => { | ||
if (wire.width && wire.direction) { | ||
return wire; | ||
} else { | ||
let width = wire; | ||
let direction = 'in'; | ||
@@ -29,8 +27,23 @@ | ||
return { | ||
direction: direction, | ||
width: width | ||
}; | ||
} | ||
}; | ||
const expandPorts = ports => { | ||
if (ports.constructor !== Object) { | ||
return ports.map((port) => { | ||
return { | ||
name: port.name, | ||
wire: expandWire(port.wire) | ||
}; | ||
}); | ||
} | ||
return Object.keys(ports).reduce((res, name) => { | ||
return res.concat({ | ||
name: name, | ||
wire: { | ||
direction: direction, | ||
width: width | ||
} | ||
wire: expandWire(ports[name]) | ||
}); | ||
@@ -37,0 +50,0 @@ }, []); |
{ | ||
"name": "duh-core", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "DUH core", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
15668
105
1