]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/ansistyles.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / ansistyles / ansistyles.js
1 'use strict';
2
3 /*
4  * Info: http://www.termsys.demon.co.uk/vtansi.htm#colors 
5  * Following caveats
6  * bright    - brightens the color (bold-blue is same as brigthtBlue)
7  * dim       - nothing on Mac or Linux
8  * italic    - nothing on Mac or Linux
9  * underline - underlines string
10  * blink     - nothing on Mac or linux
11  * inverse   - background becomes foreground and vice versa
12  *
13  * In summary, the only styles that work are:
14  *  - bright, underline and inverse
15  *  - the others are only included for completeness
16  */
17
18 var styleNums = {
19     reset     :  [0, 22]
20   , bright    :  [1, 22]
21   , dim       :  [2, 22]
22   , italic    :  [3, 23]
23   , underline :  [4, 24]
24   , blink     :  [5, 25]
25   , inverse   :  [7, 27]
26   }
27   , styles = {}
28   ;
29
30 Object.keys(styleNums).forEach(function (k) {
31   styles[k] = function (s) { 
32     var open = styleNums[k][0]
33       , close = styleNums[k][1];
34     return '\u001b[' + open + 'm' + s + '\u001b[' + close + 'm';
35   };
36 });
37
38 module.exports = styles;