From 3035b45b47ba3ccc5f3b9031f13a259927119d6a Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 4 Jul 2017 17:06:10 +0300 Subject: [PATCH] minor doc changes + config shadowing warning... Signed-off-by: Alex A. Naanou --- README.md | 10 +++++++++- features.js | 8 ++++++++ package.json | 4 ++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c167cb0..fa896c9 100644 --- a/README.md +++ b/README.md @@ -55,9 +55,13 @@ feature_set.Feature({ depends: [], // 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) + // NOTE: if not present here this will be taken from .actions.config + // NOTE: this takes priority over .actions.config config: { option: 'value', // ... @@ -65,6 +69,10 @@ feature_set.Feature({ // actions (optional) actions: Actions({ + // alternative configuration location... + config: { + // ... + } // ... }) diff --git a/features.js b/features.js index 45f8414..7fab818 100755 --- a/features.js +++ b/features.js @@ -134,6 +134,14 @@ module.FeatureProto = { if(this.config != null || (this.actions != 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 if(actions.config == null){ diff --git a/package.json b/package.json index a1ce8ed..4496e29 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-features", - "version": "3.2.0", + "version": "3.2.1", "description": "", "main": "features.js", "scripts": { @@ -23,7 +23,7 @@ }, "homepage": "https://github.com/flynx/features.js#readme", "dependencies": { - "ig-actions": "^3.2.4", + "ig-actions": "^3.2.5", "ig-object": "^1.0.0" } }