Comparing version 1.4.2 to 1.4.3
@@ -1,2 +0,1 @@ | ||
// Generated by CoffeeScript 2.5.1 | ||
(function() { | ||
@@ -264,3 +263,9 @@ //########################################################################################################### | ||
if (S.format != null) { | ||
text = S.format(text, {value, is_header, key, idx}); | ||
text = S.format(text, { | ||
value, | ||
row: data, | ||
is_header, | ||
key, | ||
idx | ||
}); | ||
} | ||
@@ -501,3 +506,1 @@ R.push(text); | ||
}).call(this); | ||
//# sourceMappingURL=tabulate.js.map |
@@ -1,2 +0,1 @@ | ||
// Generated by CoffeeScript 2.5.1 | ||
(function() { | ||
@@ -230,2 +229,3 @@ 'use strict'; | ||
key: 1, | ||
type: 'normal', | ||
value: 123456789 | ||
@@ -235,2 +235,3 @@ }, | ||
key: 2, | ||
type: 'normal', | ||
value: null | ||
@@ -240,48 +241,54 @@ }, | ||
key: 3, | ||
type: 'underline', | ||
value: "some text" | ||
}, | ||
{ | ||
key: 3, | ||
key: 4, | ||
type: 'normal', | ||
value: true | ||
}, | ||
{ | ||
key: 3, | ||
key: 5, | ||
type: 'normal', | ||
value: false | ||
} | ||
], | ||
["┌────────────┬────────────┐", | ||
"│\u001b[38;05;255m\u001b[7m\u001b[1mkey \u001b[22m\u001b[27m\u001b[0m│\u001b[38;05;255m\u001b[7m\u001b[1mvalue \u001b[22m\u001b[27m\u001b[0m│", | ||
"├────────────┼────────────┤", | ||
"│\u001b[38;05;34m\u001b[7m1 \u001b[27m\u001b[0m│\u001b[38;05;34m123456789 \u001b[0m│", | ||
"│\u001b[38;05;34m\u001b[7m2 \u001b[27m\u001b[0m│\u001b[38;05;67m● \u001b[0m│", | ||
"│\u001b[38;05;34m\u001b[7m3 \u001b[27m\u001b[0m│\u001b[38;05;27msome text \u001b[0m│", | ||
"│\u001b[38;05;34m\u001b[7m3 \u001b[27m\u001b[0m│\u001b[38;05;226mtrue \u001b[0m│", | ||
"│\u001b[38;05;34m\u001b[7m3 \u001b[27m\u001b[0m│\u001b[38;05;226mfalse \u001b[0m│", | ||
"└────────────┴────────────┘"] | ||
["┌────────────┬────────────┬────────────┐", | ||
"│\u001b[38;05;255m\u001b[7m\u001b[1mkey \u001b[22m\u001b[27m\u001b[0m│\u001b[38;05;255m\u001b[7m\u001b[1mtype \u001b[22m\u001b[27m\u001b[0m│\u001b[38;05;255m\u001b[7m\u001b[1mvalue \u001b[22m\u001b[27m\u001b[0m│", | ||
"├────────────┼────────────┼────────────┤", | ||
"│\u001b[38;05;34m1 \u001b[0m│\u001b[38;05;27mnormal \u001b[0m│\u001b[38;05;34m123456789 \u001b[0m│", | ||
"│\u001b[38;05;34m2 \u001b[0m│\u001b[38;05;27mnormal \u001b[0m│\u001b[38;05;199m● \u001b[0m│", | ||
"│\u001b[4m\u001b[38;05;34m3 \u001b[0m\u001b[24m│\u001b[4m\u001b[38;05;27munderline \u001b[0m\u001b[24m│\u001b[4m\u001b[38;05;27msome text \u001b[0m\u001b[24m│", | ||
"│\u001b[38;05;34m4 \u001b[0m│\u001b[38;05;27mnormal \u001b[0m│\u001b[38;05;226mtrue \u001b[0m│", | ||
"│\u001b[38;05;34m5 \u001b[0m│\u001b[38;05;27mnormal \u001b[0m│\u001b[38;05;226mfalse \u001b[0m│", | ||
"└────────────┴────────────┴────────────┘"] | ||
] | ||
]; | ||
//......................................................................................................... | ||
colorize = (cell_txt, {value, is_header, key, idx}) => { | ||
var color; | ||
colorize = (cell_txt, {value, row, is_header, key, idx}) => { | ||
var R; | ||
if (is_header) { | ||
return CND.white(CND.reverse(CND.bold(cell_txt))); | ||
} | ||
color = (function() { | ||
R = CND.white(CND.reverse(CND.bold(cell_txt))); | ||
} else { | ||
switch (type_of(value)) { | ||
case 'boolean': | ||
return CND.yellow; | ||
R = CND.yellow(cell_txt); | ||
break; | ||
case 'text': | ||
return CND.blue; | ||
R = CND.blue(cell_txt); | ||
break; | ||
case 'number': | ||
return CND.green; | ||
R = CND.green(cell_txt); | ||
break; | ||
case 'null': | ||
return CND.steel; | ||
R = CND.pink(cell_txt); | ||
break; | ||
default: | ||
return CND.white; | ||
R = CND.white(cell_txt); | ||
} | ||
})(); | ||
if (idx !== 0) { | ||
return color(cell_txt); | ||
if (row.type === 'underline') { | ||
R = CND.underline(R); | ||
} | ||
} | ||
return color(CND.reverse(cell_txt)); | ||
return R; | ||
}; | ||
@@ -703,15 +710,13 @@ //......................................................................................................... | ||
// await @_xxx_kw_demo() | ||
return test(this); | ||
// test @ | ||
// test @[ "demo" ] | ||
// test @[ "multiline text" ] | ||
// test @[ "text representation" ] | ||
return test(this["format callback"]); | ||
})(); | ||
} | ||
// test @[ "demo" ] | ||
// test @[ "multiline text" ] | ||
// test @[ "text representation" ] | ||
// test @[ "format callback" ] | ||
// for cid in [ 0 .. 32 ] | ||
// for cid in [ 0 .. 32 ] | ||
// debug ( cid.toString 16 ).padStart 4, '0' | ||
}).call(this); | ||
//# sourceMappingURL=tabulate.test.js.map |
{ | ||
"name": "intertext", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "Services for Recurrent Text-related Tasks", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5803
688333