minor doc changes + config shadowing warning...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-07-04 17:06:10 +03:00
parent c91723c94b
commit 3035b45b47
3 changed files with 19 additions and 3 deletions

View File

@ -55,9 +55,13 @@ feature_set.Feature({
depends: [], depends: [],
// Exclusive tag (optional) // Exclusive tag (optional)
exclusive: 'Example feature', // NOTE: a feature can be a member of more than one exclusive group,
// to list more than one use an Array...
exclusive: 'Example',
// feature configuration (optional) // feature configuration (optional)
// NOTE: if not present here this will be taken from .actions.config
// NOTE: this takes priority over .actions.config
config: { config: {
option: 'value', option: 'value',
// ... // ...
@ -65,6 +69,10 @@ feature_set.Feature({
// actions (optional) // actions (optional)
actions: Actions({ actions: Actions({
// alternative configuration location...
config: {
// ...
}
// ... // ...
}) })

View File

@ -134,6 +134,14 @@ module.FeatureProto = {
if(this.config != null if(this.config != null
|| (this.actions != null || (this.actions != null
&& this.actions.config != null)){ && this.actions.config != null)){
// sanity check -- warn of config shadowing...
if(this.config && this.actions.config){
console.warn('Feature config shadowed: '
+'both .config (used) and .actions.config (ignored) are defined for:',
this.tag,
this)
}
var config = this.config = this.config || this.actions.config var config = this.config = this.config || this.actions.config
if(actions.config == null){ if(actions.config == null){

View File

@ -1,6 +1,6 @@
{ {
"name": "ig-features", "name": "ig-features",
"version": "3.2.0", "version": "3.2.1",
"description": "", "description": "",
"main": "features.js", "main": "features.js",
"scripts": { "scripts": {
@ -23,7 +23,7 @@
}, },
"homepage": "https://github.com/flynx/features.js#readme", "homepage": "https://github.com/flynx/features.js#readme",
"dependencies": { "dependencies": {
"ig-actions": "^3.2.4", "ig-actions": "^3.2.5",
"ig-object": "^1.0.0" "ig-object": "^1.0.0"
} }
} }