Add unicode tests

This commit is contained in:
Matt 2020-08-19 10:55:29 +01:00
parent 13a54ec318
commit 3ab95384df
No known key found for this signature in database
GPG key ID: 2DD462FE98BF38C2
5 changed files with 87 additions and 27 deletions

View file

@ -46,7 +46,6 @@ class UnicodeTextFormat extends Operation {
run(input, args) {
const [underline, strikethrough] = args;
let output = input.map(char => [char]);
console.dir(output);
if (strikethrough) {
output = output.map(charFormat => {
charFormat.push(...Utils.strToUtf8ByteArray("\u0336"));
@ -59,8 +58,8 @@ class UnicodeTextFormat extends Operation {
return charFormat;
});
}
console.dir(output);
return output.flat();
// return output.flat(); - Not supported in Node 10, polyfilled
return [].concat(...output);
}
}