diff --git a/lib/tput.js b/lib/tput.js index e1c431f..6cfbb01 100644 --- a/lib/tput.js +++ b/lib/tput.js @@ -1055,7 +1055,9 @@ Tput.prototype.compileTermcap = function(info) { } info.all[ti] = info.all[tc]; a.forEach(function(k) { - info.all[k] = info.all[tc]; + if (!info.all[k]) { + info.all[k] = info.all[tc]; + } }); } }); @@ -1067,33 +1069,6 @@ Tput.prototype.compileTermcap = function(info) { return info.all; }; -/*Tput.prototype.compileTermcap = function(info) { - var self = this - , alias = Tput.talias; - - info.all = {}; - - ['bools', 'numbers', 'strings'].forEach(function(key) { - Object.keys(info[key]).forEach(function(cap) { - var val = self._compile(info[key][cap]); - info[key][cap] = val; - info.all[cap] = val; - if (alias[cap]) { - alias.forEach(function(k) { - info[key][k] = val; - info.all[k] = val; - }); - } - }); - }); - - Object.keys(info.all).forEach(function(key) { - self[key] = info.all[key]; - }); - - return info.all; -};*/ - /** * Helpers */ @@ -1239,20 +1214,6 @@ delete Tput.alias.numbers; merge(Tput.alias, Tput.alias.strings); delete Tput.alias.strings; -// Separate aliases for termcap -/*Tput.talias = (function() { - var alias = Tput.alias - , out = {}; - - Object.keys(alias).forEach(function(key) { - var a = alias[key].slice() - , tc = a.splice(1, 1)[0]; - out[tc] = [key].concat(a); - }); - - return out; -})();*/ - // Make sure there are no collisions between cap and tcap. Tput._vec = Object.keys(Tput.alias).map(function(key) { return Array.isArray(Tput.alias[key])