Comparing version 0.8.4 to 0.8.5-rc1
@@ -264,21 +264,2 @@ 'use strict'; | ||
var hooks$1 = function hooks(ctx) { | ||
var keys = ctx._keys; | ||
keys = keys.filter(function (key) { | ||
return key.startsWith('$'); | ||
}); | ||
if (keys.length > 0) { | ||
ctx._hooks = {}; | ||
keys.forEach(function (key) { | ||
var newKey = key.replace(/\$/, ''); | ||
ctx._hooks[newKey] = ctx._object[key]; | ||
}); | ||
} | ||
}; | ||
var compiles = /*#__PURE__*/Object.freeze({ | ||
hooks: hooks$1 | ||
}); | ||
var compose = function compose(middleware) { | ||
@@ -622,3 +603,35 @@ return function (ctx, next) { | ||
var hooks$1 = function hooks(ctx) { | ||
var keys = ctx._keys; | ||
keys = keys.filter(function (key) { | ||
return key.startsWith('$'); | ||
}); | ||
if (keys.length > 0) { | ||
ctx._hooks = {}; | ||
keys.forEach(function (key) { | ||
var newKey = key.replace(/\$/, ''); | ||
ctx._hooks[newKey] = ctx._object[key]; | ||
}); | ||
} | ||
}; | ||
var compiles = /*#__PURE__*/Object.freeze({ | ||
hooks: hooks$1 | ||
}); | ||
var $str$$1 = JSON.stringify; | ||
var $compile$$1 = function $compile$$1(_object) { | ||
return $exec$$1(_compile$$1, {}, _object); | ||
}; | ||
var _compile$$1 = function _compile$$1(_, _object) { | ||
var ctx = { | ||
_object: _object, | ||
_keys: Object.keys(_object) | ||
}; | ||
$(compiles, function (k, v) { | ||
v(ctx); | ||
}); | ||
return Object.assign({}, ctx, ctx._object); | ||
}; | ||
var $exec$$1 = function $exec$$1(_method, _, _object) { | ||
@@ -1155,12 +1168,2 @@ if (!_method) { | ||
var matchPath = /\/|\./; | ||
var compile = function compile(_object) { | ||
var ctx = { | ||
_object: _object, | ||
_keys: Object.keys(_object) | ||
}; | ||
$(compiles, function (k, v) { | ||
v(ctx); | ||
}); | ||
return Object.assign({}, ctx, ctx._object); | ||
}; | ||
var initHooks = function initHooks() { | ||
@@ -1330,7 +1333,7 @@ var cache = {}; | ||
assign(_, (_assign = {}, _defineProperty(_assign, HOOKS, initHooks(_)), _defineProperty(_assign, "_events", new events.EventEmitter()), _defineProperty(_assign, "$use", function $use(object) { | ||
_._events.emit('$use', compile(object)); | ||
_._events.emit('$use', $compile$$1(object)); | ||
return _; | ||
}), _defineProperty(_assign, "$unuse", function $unuse(object) { | ||
_._events.emit('$unuse', compile(object)); | ||
_._events.emit('$unuse', $compile$$1(object)); | ||
@@ -1362,3 +1365,2 @@ return _; | ||
exports.matchPath = matchPath; | ||
exports.compile = compile; | ||
exports.initHooks = initHooks; | ||
@@ -1372,2 +1374,4 @@ exports.get = get; | ||
exports.$str = $str$$1; | ||
exports.$compile = $compile$$1; | ||
exports._compile = _compile$$1; | ||
exports.$exec = $exec$$1; | ||
@@ -1374,0 +1378,0 @@ exports.$use = $use$$1; |
{ | ||
"name": "menhera", | ||
"version": "0.8.4", | ||
"version": "0.8.5-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
34562
1262