Comparing version 0.9.1-rc1 to 0.9.1
@@ -236,3 +236,3 @@ 'use strict'; | ||
var inject = { | ||
var sugar = { | ||
injectVar: function injectVar(name) { | ||
@@ -316,2 +316,11 @@ return { | ||
}; | ||
}, | ||
relay: function relay(key) { | ||
return { | ||
$: function $$$1(_ref9) { | ||
var _key = _ref9._key, | ||
_val = _ref9._val; | ||
return core.$use(_defineProperty({}, key, _val)); | ||
} | ||
}; | ||
} | ||
@@ -1357,4 +1366,4 @@ }; | ||
core.$use({ | ||
$compilers: inject.injectObject('_compilers'), | ||
$scanHooks: inject.injectObjectDeep('_scanHooks') | ||
$compilers: sugar.injectObject('_compilers'), | ||
$scanHooks: sugar.injectObjectDeep('_scanHooks') | ||
}); | ||
@@ -1364,3 +1373,3 @@ | ||
exports.default = core; | ||
exports.inject = inject; | ||
exports.sugar = sugar; | ||
exports.HOOKS = HOOKS; | ||
@@ -1367,0 +1376,0 @@ exports.matchSlashPath = matchSlashPath; |
{ | ||
"name": "menhera", | ||
"version": "0.9.1-rc1", | ||
"version": "0.9.1", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -14,16 +14,16 @@ # Menhera | ||
```js | ||
import Mhr from 'menhera' | ||
const Mhr = require('menhera').default | ||
const {sugar} = require('menhera') | ||
Mhr.$use({ | ||
$foo: { | ||
bar: { | ||
test: ({_val}) => console.log(_val), | ||
testFn: ({_val}) => console.log(_val()) | ||
} | ||
$foo: sugar.relay('bar'), | ||
$bar({_val}) { | ||
console.log(_val) | ||
}, | ||
'foo.bar': { | ||
test: 'foo bar', | ||
testFn: () => 'foo bar' | ||
} | ||
foo: [{a: 1, b: 2}, {a: 2, b: 3}, {a: 3, b: 4}] | ||
}) | ||
// { a: 1, b: 2 } | ||
// { a: 2, b: 3 } | ||
// { a: 3, b: 4 } | ||
``` |
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
35255
1289