Permalink
Browse files

chore: enable object as entry

  • Loading branch information...
adriancmiranda committed Oct 17, 2017
1 parent fe7568e commit 3401a2be1577de542181f39e9cc31019de494fba
Showing with 15 additions and 0 deletions.
  1. +15 −0 index.js
@@ -24,6 +24,12 @@ var assignStrategy = assign(assignStrategyDefault);
*/
var guid = 1;

/*!
* returns a boolean indicating whether the object has
* the specified property as own (not inherited) property
*/
var hasOwnProperty = Object.prototype.hasOwnProperty;

/*!
* Define a local copy of `DotCfg`.
* @param namespace: A string containing a qualified name to identify objects from.
@@ -125,6 +131,15 @@ var exe = function (notation/*!*/) {
*/
var setter = function (notation/*!*/, value/*!*/, strategy/*?*/) {
var fn = !is.undef(value) && is.fn(strategy) ? strategy : this.strategy;
if (is.object(notation)) {
var context;
for (var key in notation) {
if (hasOwnProperty.call(notation, key)) {
context = write(this.scope(), key, notation[key], fn);
}
}
return context;
}
return write(this.scope(), notation, value, fn);
};

0 comments on commit 3401a2b

Please sign in to comment.