move require out of function (not really needed in a browser environment)

This commit is contained in:
Iuri Matias 2018-10-14 13:12:05 -04:00 committed by Pascal Precht
parent deeeb985ad
commit 64713254f6
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 2 additions and 1 deletions

View File

@ -1,3 +1,5 @@
const Convert = require('ansi-to-html');
export function last(array) {
return array && array.length ? array[array.length - 1] : undefined;
}
@ -14,7 +16,6 @@ export function hashCode(str) {
}
export function ansiToHtml(text) {
const Convert = require('ansi-to-html');
const convert = new Convert();
return convert.toHtml(text.replace(/\n/g,'<br>'))
}