added numan-readablr priority getter...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-07-09 15:27:15 +03:00
parent fe73561b5d
commit ea917bd6f1
2 changed files with 10 additions and 3 deletions

View File

@ -103,11 +103,18 @@ module.FeatureProto = {
isApplicable: function(actions){ return true }, isApplicable: function(actions){ return true },
getPriority: function(){ getPriority: function(human_readable){
var res = this.priority || 0 var res = this.priority || 0
return res == 'high' ? 99 res = res == 'high' ? 99
: res == 'low' ? -99 : res == 'low' ? -99
: res == 'medium' ? 0 : res == 'medium' ? 0
: res == 'normal' ? 0
: res
return human_readable ?
(res == 99 ? 'high'
: res == 0 ? 'normal'
: res == -99 ? 'low'
: res)
: res : res
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "ig-features", "name": "ig-features",
"version": "3.2.4", "version": "3.2.5",
"description": "", "description": "",
"main": "features.js", "main": "features.js",
"scripts": { "scripts": {