Comparing version
@@ -17,7 +17,13 @@ "use strict"; | ||
_.hooks._mount = { $: [_plugins._mount] }; | ||
_.$use = (0, _plugins.$use)({ _: _ }); | ||
_.$get = (0, _plugins.$get)({ _: _ }); | ||
_.$set = (0, _plugins.$set)({ _: _ }); | ||
_.$use = function (_object) { | ||
return (0, _plugins.$use)({ _: _, _object: _object }); | ||
}; | ||
_.$get = function (_object) { | ||
return (0, _plugins.$get)({ _: _, _object: _object }); | ||
}; | ||
_.$set = function (_object) { | ||
return (0, _plugins.$set)({ _: _, _object: _object }); | ||
}; | ||
_.$use(_object); | ||
return _; | ||
}; |
@@ -27,125 +27,137 @@ "use strict"; | ||
var $use = exports.$use = function $use(_ref) { | ||
var _ = _ref._; | ||
return function (_object) { | ||
var onVariable = function onVariable(_ref2) { | ||
var object = _ref2.object, | ||
depth = _ref2.depth, | ||
_key = _ref2._key, | ||
_val = _ref2._val; | ||
var _ = _ref._, | ||
_object = _ref._object; | ||
var hooks = (0, _lodash.get)(_.hooks, depth, []); | ||
var onVariable = function onVariable(_ref2) { | ||
var object = _ref2.object, | ||
depth = _ref2.depth, | ||
_key = _ref2._key, | ||
_val = _ref2._val; | ||
hooks.length > 0 && hooks.forEach(function (h) { | ||
return h({ _: _, _key: _key, _val: _val, cp: _object }); | ||
}); | ||
}; | ||
var onObject = function onObject(_ref3) { | ||
var object = _ref3.object, | ||
depth = _ref3.depth, | ||
_key = _ref3._key, | ||
_val = _ref3._val; | ||
var hooks = (0, _lodash.get)(_.hooks, depth, []); | ||
var rootHookDepth = (0, _utils.getRootHookDepth)(depth); | ||
var eachHookDepth = (0, _utils.getEachHookDepth)(depth); | ||
var rootHooks = (0, _lodash.get)(_.hooks, rootHookDepth, []); | ||
var eachHooks = (0, _lodash.get)(_.hooks, eachHookDepth, []); | ||
rootHooks.length > 0 && rootHooks.forEach(function (h) { | ||
return h({ _: _, _key: _key, _val: _val, cp: _object }); | ||
hooks.length > 0 && hooks.forEach(function (h) { | ||
return h({ _: _, _key: _key, _val: _val, cp: _object }); | ||
}); | ||
}; | ||
var onObject = function onObject(_ref3) { | ||
var object = _ref3.object, | ||
depth = _ref3.depth, | ||
_key = _ref3._key, | ||
_val = _ref3._val; | ||
var rootHookDepth = (0, _utils.getRootHookDepth)(depth); | ||
var eachHookDepth = (0, _utils.getEachHookDepth)(depth); | ||
var rootHooks = (0, _lodash.get)(_.hooks, rootHookDepth, []); | ||
var eachHooks = (0, _lodash.get)(_.hooks, eachHookDepth, []); | ||
rootHooks.length > 0 && rootHooks.forEach(function (h) { | ||
return h({ _: _, _key: _key, _val: _val, cp: _object }); | ||
}); | ||
eachHooks.length > 0 && (0, _utils.$)(_val, function (key, val) { | ||
eachHooks.forEach(function (h) { | ||
return h({ _: _, _key: key, _val: val, cp: _object }); | ||
}); | ||
eachHooks.length > 0 && (0, _utils.$)(_val, function (key, val) { | ||
eachHooks.forEach(function (h) { | ||
return h({ _: _, _key: key, _val: val, cp: _object }); | ||
}); | ||
}); | ||
}); | ||
(0, _utils.scanObject)({ object: object, depth: depth, onObject: onObject, onVariable: onVariable, onFunction: onVariable }); | ||
}; | ||
if ((typeof _object === "undefined" ? "undefined" : (0, _typeof3.default)(_object)) === "object") { | ||
onObject({ object: _object, depth: "" }); | ||
} | ||
return _; | ||
(0, _utils.scanObject)({ object: object, depth: depth, onObject: onObject, onVariable: onVariable, onFunction: onVariable }); | ||
}; | ||
if ((typeof _object === "undefined" ? "undefined" : (0, _typeof3.default)(_object)) === "object") { | ||
onObject({ object: _object, depth: "" }); | ||
} | ||
return _; | ||
}; | ||
var $set = exports.$set = function $set(_ref4) { | ||
var _ = _ref4._; | ||
return function (_object) { | ||
var cache = {}; | ||
var onVariable = function onVariable(_ref5) { | ||
var object = _ref5.object, | ||
depth = _ref5.depth, | ||
_key = _ref5._key, | ||
_val = _ref5._val; | ||
var _ = _ref4._, | ||
_object = _ref4._object; | ||
(0, _lodash.set)(_, depth, _val); | ||
(0, _lodash.set)(cache, depth, _val); | ||
}; | ||
var onFunction = function onFunction(_ref6) { | ||
var object = _ref6.object, | ||
depth = _ref6.depth, | ||
_key = _ref6._key, | ||
_val = _ref6._val; | ||
var cache = {}; | ||
var onVariable = function onVariable(_ref5) { | ||
var object = _ref5.object, | ||
depth = _ref5.depth, | ||
_key = _ref5._key, | ||
_val = _ref5._val; | ||
var tar = (0, _lodash.get)(_, depth); | ||
var result = _val({ tar: tar }); | ||
(0, _lodash.set)(_, depth, result); | ||
(0, _lodash.set)(cache, depth, result); | ||
}; | ||
(0, _lodash.set)(_, depth, _val); | ||
(0, _lodash.set)(cache, depth, _val); | ||
}; | ||
var onFunction = function onFunction(_ref6) { | ||
var object = _ref6.object, | ||
depth = _ref6.depth, | ||
_key = _ref6._key, | ||
_val = _ref6._val; | ||
var onObject = function onObject(_ref7) { | ||
var object = _ref7.object, | ||
depth = _ref7.depth, | ||
_key = _ref7._key, | ||
_val = _ref7._val; | ||
var tar = (0, _lodash.get)(_, depth); | ||
var result = _val({ tar: tar }); | ||
(0, _lodash.set)(_, depth, result); | ||
(0, _lodash.set)(cache, depth, result); | ||
}; | ||
(0, _utils.scanObject)({ object: object, depth: depth, onObject: onObject, onVariable: onVariable, onFunction: onFunction }); | ||
}; | ||
if ((typeof _object === "undefined" ? "undefined" : (0, _typeof3.default)(_object)) === "object") { | ||
onObject({ object: _object, depth: "" }); | ||
} | ||
return cache; | ||
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, | ||
onVariable: onVariable, | ||
onFunction: onFunction | ||
}); | ||
}; | ||
if ((typeof _object === "undefined" ? "undefined" : (0, _typeof3.default)(_object)) === "object") { | ||
onObject({ object: _object, depth: "" }); | ||
} | ||
return cache; | ||
}; | ||
var $get = exports.$get = function $get(_ref8) { | ||
var _ = _ref8._; | ||
return function (_object) { | ||
var cache = {}; | ||
var onVariable = function onVariable(_ref9) { | ||
var object = _ref9.object, | ||
depth = _ref9.depth, | ||
_key = _ref9._key, | ||
_val = _ref9._val; | ||
var _ = _ref8._, | ||
_object = _ref8._object; | ||
var result = (0, _lodash.get)(_, depth); | ||
result && (0, _lodash.set)(cache, depth, result); | ||
!result && (0, _lodash.set)(cache, depth, _val); | ||
}; | ||
var cache = {}; | ||
var onVariable = function onVariable(_ref9) { | ||
var object = _ref9.object, | ||
depth = _ref9.depth, | ||
_key = _ref9._key, | ||
_val = _ref9._val; | ||
var onFunction = function onFunction(_ref10) { | ||
var object = _ref10.object, | ||
depth = _ref10.depth, | ||
_key = _ref10._key, | ||
_val = _ref10._val; | ||
var result = (0, _lodash.get)(_, depth); | ||
result && (0, _lodash.set)(cache, depth, result); | ||
!result && (0, _lodash.set)(cache, depth, _val); | ||
}; | ||
var tar = (0, _lodash.get)(_, depth); | ||
var result = _val({ tar: tar }); | ||
result && (0, _lodash.set)(cache, depth, result); | ||
!result && (0, _lodash.set)(cache, depth, _val); | ||
}; | ||
var onFunction = function onFunction(_ref10) { | ||
var object = _ref10.object, | ||
depth = _ref10.depth, | ||
_key = _ref10._key, | ||
_val = _ref10._val; | ||
var onObject = function onObject(_ref11) { | ||
var object = _ref11.object, | ||
depth = _ref11.depth, | ||
_key = _ref11._key, | ||
_val = _ref11._val; | ||
var tar = (0, _lodash.get)(_, depth); | ||
var result = _val({ tar: tar }); | ||
result && (0, _lodash.set)(cache, depth, result); | ||
!result && (0, _lodash.set)(cache, depth, _val); | ||
}; | ||
(0, _utils.scanObject)({ object: object, depth: depth, onObject: onObject, onFunction: onFunction, onVariable: onVariable }); | ||
}; | ||
var onObject = function onObject(_ref11) { | ||
var object = _ref11.object, | ||
depth = _ref11.depth, | ||
_key = _ref11._key, | ||
_val = _ref11._val; | ||
if ((typeof _object === "undefined" ? "undefined" : (0, _typeof3.default)(_object)) === "object") { | ||
onObject({ object: _object, depth: "" }); | ||
} | ||
return cache; | ||
(0, _utils.scanObject)({ | ||
object: object, | ||
depth: depth, | ||
onObject: onObject, | ||
onFunction: onFunction, | ||
onVariable: onVariable | ||
}); | ||
}; | ||
if ((typeof _object === "undefined" ? "undefined" : (0, _typeof3.default)(_object)) === "object") { | ||
onObject({ object: _object, depth: "" }); | ||
} | ||
return cache; | ||
}; | ||
@@ -152,0 +164,0 @@ |
{ | ||
"name": "menhera", | ||
"version": "0.6.1-rc3", | ||
"version": "0.6.1-rc4", | ||
"main": "dist", | ||
@@ -5,0 +5,0 @@ "files": [ |
19394
0.18%484
3.2%