Skip to content

Commit ae90c86

Browse files
committed
Drop object.assign
1 parent 24395bc commit ae90c86

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
var pool = require('ndarray-scratch')
44
var fill = require('ndarray-fill')
5+
var extend = require('util-extend')
56

67
module.exports = linspace
78

@@ -13,18 +14,21 @@ var defaults = {
1314
function linspace () {
1415
var start, end, n, options, output
1516

17+
options = {}
18+
extend(options, defaults)
19+
1620
if (Number.isFinite(arguments[0])) {
1721
start = arguments[0]
1822
end = arguments[1]
1923
n = arguments[2]
20-
options = Object.assign({}, defaults, arguments[3] || {})
24+
extend(options, arguments[3] || {})
2125
output = pool.zeros([n], options.dtype)
2226
} else {
2327
output = arguments[0]
2428
start = arguments[1]
2529
end = arguments[2]
2630
n = arguments[3]
27-
options = Object.assign({}, defaults, arguments[4] || {})
31+
extend(options, arguments[4] || {})
2832

2933
if (output.shape[0] !== n) {
3034
throw new Error('number of values (' + n + ') must match the first dimension of the output (' + output.shape[0] + ')')

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
},
2626
"dependencies": {
2727
"ndarray-fill": "^1.0.1",
28-
"ndarray-scratch": "^1.2.0"
28+
"ndarray-scratch": "^1.2.0",
29+
"util-extend": "^1.0.1"
2930
}
3031
}

0 commit comments

Comments
 (0)