Comparing version 0.5.2 to 0.5.3
@@ -70,10 +70,22 @@ "use strict"; | ||
}; | ||
var onObject = function onObject(_ref6) { | ||
var object = _ref6.object, | ||
depth = _ref6.depth, | ||
_key = _ref6._key, | ||
var onVariable = function onVariable(_ref6) { | ||
var depth = _ref6.depth, | ||
_val = _ref6._val; | ||
(0, _utils.scanObject)({ object: object, depth: depth, onObject: onObject, onFunction: onFunction }); | ||
if (Array.isArray(_val)) { | ||
_val.forEach(function (val) { | ||
if (typeof val === "function") { | ||
onFunction({ depth: depth, _val: val }); | ||
} | ||
}); | ||
} | ||
}; | ||
var onObject = function onObject(_ref7) { | ||
var object = _ref7.object, | ||
depth = _ref7.depth, | ||
_key = _ref7._key, | ||
_val = _ref7._val; | ||
(0, _utils.scanObject)({ object: object, depth: depth, onObject: onObject, onFunction: onFunction, onVariable: onVariable }); | ||
}; | ||
if ((typeof _val === "undefined" ? "undefined" : _typeof(_val)) === "object") { | ||
@@ -84,7 +96,7 @@ onObject({ object: _val, depth: "" }); | ||
var _mount = exports._mount = function _mount(_ref7) { | ||
var _ = _ref7._, | ||
_key = _ref7._key, | ||
_val = _ref7._val, | ||
cp = _ref7.cp; | ||
var _mount = exports._mount = function _mount(_ref8) { | ||
var _ = _ref8._, | ||
_key = _ref8._key, | ||
_val = _ref8._val, | ||
cp = _ref8.cp; | ||
var _iteratorNormalCompletion = true; | ||
@@ -96,11 +108,11 @@ var _didIteratorError = false; | ||
for (var _iterator = Object.entries(_val)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var _ref8 = _step.value; | ||
var _ref9 = _step.value; | ||
var _ref9 = _slicedToArray(_ref8, 2); | ||
var _ref10 = _slicedToArray(_ref9, 2); | ||
var key = _ref9[0]; | ||
var val = _ref9[1]; | ||
var key = _ref10[0]; | ||
var val = _ref10[1]; | ||
val.forEach(function () { | ||
var _ref10 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(component) { | ||
var _ref11 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(component) { | ||
var cp, name; | ||
@@ -126,3 +138,3 @@ return regeneratorRuntime.wrap(function _callee$(_context) { | ||
return function (_x) { | ||
return _ref10.apply(this, arguments); | ||
return _ref11.apply(this, arguments); | ||
}; | ||
@@ -129,0 +141,0 @@ }()); |
{ | ||
"name": "menhera", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"main": "dist", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -14,4 +14,13 @@ # Menhera | ||
```js | ||
import Menhera from "menhera"; | ||
import Menhera from "menehra"; | ||
const test = ({ _val }) => console.log(_val); | ||
const testFn = ({ _val }) => console.log(_val()); | ||
const testEach = ({ _val }) => { | ||
for (let [key, val] of Object.entries(_val)) { | ||
typeof val === "function" && testFn({ _val: val }); | ||
typeof val !== "function" && test({ _val: val }); | ||
} | ||
}; | ||
const _ = new Menhera({ | ||
@@ -23,3 +32,5 @@ _hooks: { | ||
bar1: { | ||
test: ({ _val }) => console.log(_val) | ||
_: testEach, | ||
test, | ||
testFn | ||
} | ||
@@ -34,3 +45,4 @@ } | ||
bar1: { | ||
test: "foo bar" | ||
test: "foo bar", | ||
testFn: () => "foo bar" | ||
} | ||
@@ -49,5 +61,13 @@ } | ||
} | ||
const Bar = parms => core({ _: new Foo(), parms }); | ||
const test = ({ _val }) => console.log(_val); | ||
const testFn = ({ _val }) => console.log(_val()); | ||
const testEach = ({ _val }) => { | ||
for (let [key, val] of Object.entries(_val)) { | ||
typeof val === "function" && testFn({ _val: val }); | ||
typeof val !== "function" && test({ _val: val }); | ||
} | ||
}; | ||
const _ = new Bar({ | ||
@@ -59,3 +79,5 @@ _hooks: { | ||
bar1: { | ||
test: ({ _val }) => console.log(_val) | ||
_: testEach, | ||
test, | ||
testFn | ||
} | ||
@@ -70,3 +92,4 @@ } | ||
bar1: { | ||
test: "foo bar" | ||
test: "foo bar", | ||
testFn: () => "foo bar" | ||
} | ||
@@ -73,0 +96,0 @@ } |
13808
244
179