move require out of function (not really needed in a browser environment)
This commit is contained in:
parent
deeeb985ad
commit
64713254f6
|
@ -1,3 +1,5 @@
|
||||||
|
const Convert = require('ansi-to-html');
|
||||||
|
|
||||||
export function last(array) {
|
export function last(array) {
|
||||||
return array && array.length ? array[array.length - 1] : undefined;
|
return array && array.length ? array[array.length - 1] : undefined;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +16,6 @@ export function hashCode(str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ansiToHtml(text) {
|
export function ansiToHtml(text) {
|
||||||
const Convert = require('ansi-to-html');
|
|
||||||
const convert = new Convert();
|
const convert = new Convert();
|
||||||
return convert.toHtml(text.replace(/\n/g,'<br>'))
|
return convert.toHtml(text.replace(/\n/g,'<br>'))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue