Skip to content

Commit cc588a8

Browse files
committed
Merge pull request #89 from substack/use-xtend
Use xtend instead of shallow-copy
2 parents e0e85fa + 1592d48 commit cc588a8

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ var concat = require('concat-stream');
99
var parents = require('parents');
1010
var combine = require('stream-combiner2');
1111
var duplexer = require('duplexer2');
12-
var copy = require('shallow-copy');
1312
var xtend = require('xtend');
1413
var defined = require('defined');
1514

@@ -51,7 +50,7 @@ function Deps (opts) {
5150
this.transforms = [].concat(opts.transform).filter(Boolean);
5251
this.globalTransforms = [].concat(opts.globalTransform).filter(Boolean);
5352
this.resolver = opts.resolve || browserResolve;
54-
this.options = copy(opts || {});
53+
this.options = xtend(opts);
5554
if (!this.options.modules) this.options.modules = {};
5655

5756
// If the caller passes options.expose, store resolved pathnames for exposed
@@ -301,7 +300,7 @@ Deps.prototype.walk = function (id, parent, cb) {
301300
var rec = {};
302301
var input;
303302
if (typeof id === 'object') {
304-
rec = copy(id);
303+
rec = xtend(id);
305304
if (rec.entry === false) delete rec.entry;
306305
id = rec.file || rec.id;
307306
input = true;

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"parents": "^1.0.0",
1818
"readable-stream": "^1.0.27-1",
1919
"resolve": "^1.1.3",
20-
"shallow-copy": "0.0.1",
2120
"stream-combiner2": "~1.0.0",
2221
"subarg": "^1.0.0",
2322
"through2": "~0.4.1",

test/cache_partial_expose.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var parser = require('../');
22
var test = require('tape');
33
var fs = require('fs');
44
var path = require('path');
5-
var copy = require('shallow-copy');
5+
var xtend = require('xtend');
66

77
var files = {
88
abc: path.join(__dirname, '/expose/lib/abc.js'),
@@ -46,7 +46,7 @@ cache[files.main] = {
4646
test('preserves expose and entry with partial cache', function(t) {
4747
t.plan(1);
4848

49-
var partialCache = copy(cache);
49+
var partialCache = xtend(cache);
5050
delete partialCache[files.bar];
5151

5252
var p = parser({ cache: partialCache });

0 commit comments

Comments
 (0)