Comparing version 0.9.3 to 0.9.4-rc1
@@ -109,7 +109,7 @@ 'use strict'; | ||
_val = _ref2._val; | ||
var target = get(core[HOOKS], depth); | ||
var target = get(menhera[HOOKS], depth); | ||
if (!target) { | ||
target = new Map([[uuid$$1, _val.bind(cp)]]); | ||
set$1(core[HOOKS], depth, target); | ||
set$1(menhera[HOOKS], depth, target); | ||
} else { | ||
@@ -123,3 +123,3 @@ target.set(uuid$$1, _val.bind(cp)); | ||
_val = _ref3._val; | ||
var target = get(core[HOOKS], depth); | ||
var target = get(menhera[HOOKS], depth); | ||
_val = new Set(_val.map(function (v) { | ||
@@ -131,3 +131,3 @@ return v.bind(cp); | ||
target = new Map([[uuid$$1, _val]]); | ||
set$1(core[HOOKS], depth, target); | ||
set$1(menhera[HOOKS], depth, target); | ||
} else { | ||
@@ -169,3 +169,3 @@ target.set(uuid$$1, _val); | ||
_val = _ref6._val; | ||
var target = get(core[HOOKS], depth); | ||
var target = get(menhera[HOOKS], depth); | ||
if (!target) return; | ||
@@ -195,5 +195,11 @@ target.delete(uuid$$1); | ||
}; | ||
var _metas = { | ||
_: function _(_ref8) { | ||
var _val = _ref8._val; | ||
$set$$1(menhera, _val); | ||
} | ||
}; | ||
var _mount = { | ||
$: function $$$1(_ref8) { | ||
var _val = _ref8._val; | ||
$: function $$$1(_ref9) { | ||
var _val = _ref9._val; | ||
var cps = Array.isArray(_val) ? _val : [_val]; | ||
@@ -203,7 +209,7 @@ | ||
var cp = typeof component === 'function' ? component({ | ||
_: core | ||
_: menhera | ||
}) : component; | ||
var name = cp.name; | ||
if (core[name]) { | ||
if (menhera[name]) { | ||
console.log("_mount: name \"".concat(name, "\" exists")); | ||
@@ -213,5 +219,5 @@ return; | ||
core[name] = cp; | ||
menhera[name] = cp; | ||
core.$use(core[name]); | ||
menhera.$use(menhera[name]); | ||
}); | ||
@@ -221,5 +227,5 @@ } | ||
var _run = { | ||
$: function $$$1(_ref9) { | ||
var _val = _ref9._val, | ||
cp = _ref9.cp; | ||
$: function $$$1(_ref10) { | ||
var _val = _ref10._val, | ||
cp = _ref10.cp; | ||
var cps = Array.isArray(_val) ? _val : [_val]; | ||
@@ -229,6 +235,6 @@ | ||
var cp = typeof component === 'function' ? component({ | ||
_: core | ||
_: menhera | ||
}) : component; | ||
core.$use(cp); | ||
menhera.$use(cp); | ||
}); | ||
@@ -241,2 +247,3 @@ } | ||
_unhooks: _unhooks, | ||
_metas: _metas, | ||
_mount: _mount, | ||
@@ -246,3 +253,3 @@ _run: _run | ||
var sugar = { | ||
var utils = { | ||
injectVar: function injectVar(name) { | ||
@@ -254,3 +261,3 @@ return { | ||
var key = "".concat(name, ".").concat(_key); | ||
set$1(core, key, _val); | ||
set$1(menhera, key, _val); | ||
} | ||
@@ -265,3 +272,3 @@ }; | ||
var key = "".concat(name, ".").concat(_key); | ||
set$1(core, key, _val); | ||
set$1(menhera, key, _val); | ||
} | ||
@@ -274,4 +281,4 @@ }; | ||
var _val = _ref3._val; | ||
var target = get(core, name, []); | ||
set$1(core, name, _toConsumableArray(target).concat([_val])); | ||
var target = get(menhera, name, []); | ||
set$1(menhera, name, _toConsumableArray(target).concat([_val])); | ||
} | ||
@@ -284,4 +291,4 @@ }; | ||
var _val = _ref4._val; | ||
var target = get(core, name, {}); | ||
set$1(core, name, Object.assign({}, target, _val)); | ||
var target = get(menhera, name, {}); | ||
set$1(menhera, name, Object.assign({}, target, _val)); | ||
} | ||
@@ -296,4 +303,4 @@ }; | ||
var key = "".concat(name, ".").concat(_key); | ||
var target = get(core, key, []); | ||
set$1(core, key, _toConsumableArray(target).concat(_toConsumableArray(_val))); | ||
var target = get(menhera, key, []); | ||
set$1(menhera, key, _toConsumableArray(target).concat(_toConsumableArray(_val))); | ||
} | ||
@@ -308,4 +315,4 @@ }; | ||
var key = "".concat(name, ".").concat(_key); | ||
var target = get(core, key, {}); | ||
set$1(core, key, Object.assign({}, target, _val)); | ||
var target = get(menhera, key, {}); | ||
set$1(menhera, key, Object.assign({}, target, _val)); | ||
} | ||
@@ -320,3 +327,3 @@ }; | ||
var key = "".concat(name, ".").concat(_key); | ||
set$1(core, key, _val); | ||
set$1(menhera, key, _val); | ||
} | ||
@@ -329,4 +336,4 @@ }; | ||
var _val = _ref8._val; | ||
var target = get(core, name, []); | ||
set$1(core, name, _toConsumableArray(target).concat(_toConsumableArray(_val))); | ||
var target = get(menhera, name, []); | ||
set$1(menhera, name, _toConsumableArray(target).concat(_toConsumableArray(_val))); | ||
} | ||
@@ -340,3 +347,3 @@ }; | ||
_val = _ref9._val; | ||
return core.$use(_defineProperty({}, key, _val)); | ||
return menhera.$use(_defineProperty({}, key, _val)); | ||
} | ||
@@ -375,4 +382,4 @@ }; | ||
var use$$1 = function use$$1(data) { | ||
$use$$1(core, $compile$$1(core, data)); | ||
return core; | ||
$use$$1(menhera, $compile$$1(menhera, data)); | ||
return menhera; | ||
}; | ||
@@ -436,4 +443,4 @@ var $use$$1 = function $use$$1(_, _object) { | ||
var unuse$$1 = function unuse$$1(data) { | ||
$unuse$$1(core, $compile$$1(core, data)); | ||
return core; | ||
$unuse$$1(menhera, $compile$$1(menhera, data)); | ||
return menhera; | ||
}; | ||
@@ -830,3 +837,3 @@ var $unuse$$1 = function $unuse$$1(_, _object) { | ||
var _compilers = { | ||
hooks: function hooks(ctx) { | ||
_hooks: function _hooks(ctx) { | ||
var keys = ctx._keys; | ||
@@ -845,3 +852,3 @@ keys = keys.filter(function (key) { | ||
}, | ||
metas: function metas(ctx) { | ||
_metas: function _metas(ctx) { | ||
var keys = ctx._keys; | ||
@@ -853,6 +860,6 @@ keys = keys.filter(function (key) { | ||
if (keys.length > 0) { | ||
ctx._hooks = {}; | ||
ctx._metas = {}; | ||
keys.forEach(function (key) { | ||
var newKey = key.replace(/--/, ''); | ||
ctx._hooks[newKey] = ctx._object[key]; | ||
var newKey = key.replace(/__/, ''); | ||
ctx._metas[newKey] = ctx._object[key]; | ||
}); | ||
@@ -889,3 +896,3 @@ } | ||
_object = _ref._object; | ||
var hooks = get(core[HOOKS], key); | ||
var hooks = get(menhera[HOOKS], key); | ||
hooks instanceof Map && hooks && $M(hooks, function (uuid$$1, h) { | ||
@@ -917,6 +924,5 @@ if (h instanceof Set) { | ||
key = _ref2.key, | ||
_key = _ref2._key, | ||
_val = _ref2._val, | ||
_object = _ref2._object; | ||
var hooks = get(core[HOOKS], key); | ||
var hooks = get(menhera[HOOKS], key); | ||
hooks instanceof Map && hooks && $(_val, function (key, val) { | ||
@@ -974,3 +980,2 @@ $M(hooks, function (uuid$$1, h) { | ||
var object = _ref5.object, | ||
parentDepth = _ref5.parentDepth, | ||
depth = _ref5.depth, | ||
@@ -1036,6 +1041,4 @@ _key = _ref5._key, | ||
}); | ||
} | ||
}, | ||
onArray: { | ||
A: function A(_ref9) { | ||
}, | ||
$I: function $I(_ref9) { | ||
var object = _ref9.object, | ||
@@ -1047,3 +1050,3 @@ parentDepth = _ref9.parentDepth, | ||
_object = _ref9._object; | ||
var key = "".concat(depth, ".A"); | ||
var key = "".concat(parentDepth, ".$I"); | ||
handleHooks({ | ||
@@ -1057,4 +1060,6 @@ object: object, | ||
}); | ||
}, | ||
$: function $$$1(_ref10) { | ||
} | ||
}, | ||
onArray: { | ||
A: function A(_ref10) { | ||
var object = _ref10.object, | ||
@@ -1065,7 +1070,8 @@ depth = _ref10.depth, | ||
_object = _ref10._object; | ||
var key = "".concat(depth, ".$"); | ||
handleEachHooks({ | ||
var key = "".concat(depth, ".A"); | ||
handleHooks({ | ||
object: object, | ||
depth: depth, | ||
key: key, | ||
_key: _key, | ||
_val: _val, | ||
@@ -1075,5 +1081,4 @@ _object: _object | ||
}, | ||
A$: function A$(_ref11) { | ||
$: function $$$1(_ref11) { | ||
var object = _ref11.object, | ||
parentDepth = _ref11.parentDepth, | ||
depth = _ref11.depth, | ||
@@ -1083,3 +1088,3 @@ _key = _ref11._key, | ||
_object = _ref11._object; | ||
var key = "".concat(depth, ".A$"); | ||
var key = "".concat(depth, ".$"); | ||
handleEachHooks({ | ||
@@ -1093,5 +1098,4 @@ object: object, | ||
}, | ||
$A: function $A(_ref12) { | ||
A$: function A$(_ref12) { | ||
var object = _ref12.object, | ||
parentDepth = _ref12.parentDepth, | ||
depth = _ref12.depth, | ||
@@ -1101,15 +1105,12 @@ _key = _ref12._key, | ||
_object = _ref12._object; | ||
var key = "".concat(parentDepth, ".$A"); | ||
handleHooks({ | ||
var key = "".concat(depth, ".A$"); | ||
handleEachHooks({ | ||
object: object, | ||
depth: depth, | ||
key: key, | ||
_key: _key, | ||
_val: _val, | ||
_object: _object | ||
}); | ||
} | ||
}, | ||
onFunction: { | ||
F: function F(_ref13) { | ||
}, | ||
$A: function $A(_ref13) { | ||
var object = _ref13.object, | ||
@@ -1121,3 +1122,3 @@ parentDepth = _ref13.parentDepth, | ||
_object = _ref13._object; | ||
var key = "".concat(depth, ".F"); | ||
var key = "".concat(parentDepth, ".$A"); | ||
handleHooks({ | ||
@@ -1132,3 +1133,3 @@ object: object, | ||
}, | ||
$F: function $F(_ref14) { | ||
$I: function $I(_ref14) { | ||
var object = _ref14.object, | ||
@@ -1140,3 +1141,3 @@ parentDepth = _ref14.parentDepth, | ||
_object = _ref14._object; | ||
var key = "".concat(parentDepth, ".$F"); | ||
var key = "".concat(parentDepth, ".$I"); | ||
handleHooks({ | ||
@@ -1152,6 +1153,5 @@ object: object, | ||
}, | ||
onVariable: { | ||
V: function V(_ref15) { | ||
onFunction: { | ||
F: function F(_ref15) { | ||
var object = _ref15.object, | ||
parentDepth = _ref15.parentDepth, | ||
depth = _ref15.depth, | ||
@@ -1161,3 +1161,3 @@ _key = _ref15._key, | ||
_object = _ref15._object; | ||
var key = "".concat(depth, ".V"); | ||
var key = "".concat(depth, ".F"); | ||
handleHooks({ | ||
@@ -1172,3 +1172,3 @@ object: object, | ||
}, | ||
$V: function $V(_ref16) { | ||
I: function I(_ref16) { | ||
var object = _ref16.object, | ||
@@ -1180,2 +1180,71 @@ parentDepth = _ref16.parentDepth, | ||
_object = _ref16._object; | ||
var key = "".concat(parentDepth, ".I"); | ||
handleHooks({ | ||
object: object, | ||
depth: depth, | ||
key: key, | ||
_key: _key, | ||
_val: _val, | ||
_object: _object | ||
}); | ||
}, | ||
$F: function $F(_ref17) { | ||
var object = _ref17.object, | ||
parentDepth = _ref17.parentDepth, | ||
depth = _ref17.depth, | ||
_key = _ref17._key, | ||
_val = _ref17._val, | ||
_object = _ref17._object; | ||
var key = "".concat(parentDepth, ".$F"); | ||
handleHooks({ | ||
object: object, | ||
depth: depth, | ||
key: key, | ||
_key: _key, | ||
_val: _val, | ||
_object: _object | ||
}); | ||
} | ||
}, | ||
onVariable: { | ||
V: function V(_ref18) { | ||
var object = _ref18.object, | ||
depth = _ref18.depth, | ||
_key = _ref18._key, | ||
_val = _ref18._val, | ||
_object = _ref18._object; | ||
var key = "".concat(depth, ".V"); | ||
handleHooks({ | ||
object: object, | ||
depth: depth, | ||
key: key, | ||
_key: _key, | ||
_val: _val, | ||
_object: _object | ||
}); | ||
}, | ||
I: function I(_ref19) { | ||
var object = _ref19.object, | ||
parentDepth = _ref19.parentDepth, | ||
depth = _ref19.depth, | ||
_key = _ref19._key, | ||
_val = _ref19._val, | ||
_object = _ref19._object; | ||
var key = "".concat(parentDepth, ".I"); | ||
handleHooks({ | ||
object: object, | ||
depth: depth, | ||
key: key, | ||
_key: _key, | ||
_val: _val, | ||
_object: _object | ||
}); | ||
}, | ||
$V: function $V(_ref20) { | ||
var object = _ref20.object, | ||
parentDepth = _ref20.parentDepth, | ||
depth = _ref20.depth, | ||
_key = _ref20._key, | ||
_val = _ref20._val, | ||
_object = _ref20._object; | ||
var key = "".concat(parentDepth, ".$V"); | ||
@@ -1356,12 +1425,12 @@ handleHooks({ | ||
var _core; | ||
var core = (_core = {}, _defineProperty(_core, HOOKS, initHooks()), _defineProperty(_core, "_scanHooks", _scanHooks$$1), _defineProperty(_core, "_compilers", _compilers), _defineProperty(_core, "use", use$$1), _defineProperty(_core, "$use", use$$1), _defineProperty(_core, "unuse", unuse$$1), _core); | ||
core.use({ | ||
$compilers: sugar.injectObject('_compilers'), | ||
$scanHooks: sugar.injectObjectDeep('_scanHooks') | ||
var _menhera; | ||
var menhera = (_menhera = {}, _defineProperty(_menhera, HOOKS, initHooks()), _defineProperty(_menhera, "_scanHooks", _scanHooks$$1), _defineProperty(_menhera, "_compilers", _compilers), _defineProperty(_menhera, "use", use$$1), _defineProperty(_menhera, "$use", use$$1), _defineProperty(_menhera, "unuse", unuse$$1), _menhera); | ||
menhera.use({ | ||
$compilers: utils.injectObject('_compilers'), | ||
$scanHooks: utils.injectObjectDeep('_scanHooks') | ||
}); | ||
exports.uuid = uuid; | ||
exports.default = core; | ||
exports.sugar = sugar; | ||
exports.default = menhera; | ||
exports.utils = utils; | ||
exports.HOOKS = HOOKS; | ||
@@ -1368,0 +1437,0 @@ exports.matchSlashPath = matchSlashPath; |
{ | ||
"name": "menhera", | ||
"version": "0.9.3", | ||
"version": "0.9.4-rc1", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37101
1321