Compare commits

..

No commits in common. "main" and "0.4.0" have entirely different histories.
main ... 0.4.0

3 changed files with 2 additions and 9 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@textplace/core",
"version": "0.4.1",
"version": "0.4.0",
"exports": "./mod.ts",
"imports": {
"@deno/dnt": "jsr:@deno/dnt@^0.41.3",

View file

@ -10,6 +10,5 @@ export function getCharacterWidth(ch: string): number {
);
}
// TODO: Properly fix this.
return Math.min(unicodeWidth(ch), 2);
return unicodeWidth(ch);
}

View file

@ -32,12 +32,6 @@ Deno.test("getCharacterWidth CJK", () => {
assertThrows(() => getCharacterWidth("ヨスガノ"));
});
Deno.test("getCharacterWidth Emoji", () => {
assertEquals(getCharacterWidth("👋"), 2);
assertEquals(getCharacterWidth("🌲️"), 2);
assertEquals(getCharacterWidth("👨‍👩‍👧‍👦"), 2);
});
Deno.test("getCharacterWidth previously faulty cases", () => {
assertEquals(getCharacterWidth("𤲶"), 2);
});