Skip to content

Commit

Permalink
Upgrade to steal-npm 1.0.3.
Browse files Browse the repository at this point in the history
steal-npm 1.0.3 includes a fix for setting configuration on recursive
objects. This manifests when using the `instantiated` configuration and
the value is some type of object that points back to itself.
  • Loading branch information
matthewp committed Dec 19, 2016
1 parent 3f8cdc3 commit d328d9b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
30 changes: 28 additions & 2 deletions ext/npm-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,44 @@ var slice = Array.prototype.slice;
var npmModuleRegEx = /.+@.+\..+\..+#.+/;
var conditionalModuleRegEx = /#\{[^\}]+\}|#\?.+$/;
var gitUrlEx = /(git|http(s?)):\/\//;
var supportsSet = typeof Set === "function";

var utils = {
extend: function(d, s, deep){
extend: function(d, s, deep, set){
var val;

if(deep) {
if(!set) {
if(supportsSet) {
set = new Set();
} else {
set = [];
}
}

if(supportsSet) {
if(set.has(s)) {
return s;
} else {
set.add(s);
}
} else {
if(set.indexOf(s) !== -1) {
return s;
} else {
set.push(s);
}
}
}

for(var prop in s) {
val = s[prop];

if(deep) {
if(utils.isArray(val)) {
d[prop] = slice.call(val);
} else if(utils.isObject(val)) {
d[prop] = utils.extend({}, val, deep);
d[prop] = utils.extend({}, val, deep, set);
} else {
d[prop] = s[prop];
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"saucelabs": "^1.3.0",
"steal-env": "^1.0.0",
"steal-es6-module-loader": "0.17.13",
"steal-npm": "1.0.2",
"steal-npm": "1.0.3",
"steal-qunit": "^1.0.0",
"system-bower": "stealjs/system-bower#v0.2.1",
"system-live-reload": "1.5.3",
Expand Down

0 comments on commit d328d9b

Please sign in to comment.