Compare commits

..

1 commit
0.6.0 ... main

Author SHA1 Message Date
8746ae1494 fix: mark intl call as pure
Some checks failed
Test / test (push) Has been cancelled
2025-12-16 18:14:37 +08:00
3 changed files with 5 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "@textplace/core", "name": "@textplace/core",
"version": "0.6.0", "version": "0.6.1",
"exports": "./src/mod.ts", "exports": "./src/mod.ts",
"imports": { "imports": {
"@std/cli": "jsr:@std/cli@1" "@std/cli": "jsr:@std/cli@1"

View file

@ -1,6 +1,6 @@
{ {
"name": "@textplace/core", "name": "@textplace/core",
"version": "0.6.0", "version": "0.6.1",
"description": "The core logic of TextPlace.", "description": "The core logic of TextPlace.",
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",

View file

@ -1,6 +1,8 @@
import { unicodeWidth } from "@std/cli/unicode-width"; import { unicodeWidth } from "@std/cli/unicode-width";
const segmenter = new Intl.Segmenter("en", { granularity: "grapheme" }); const segmenter = /*#__PURE__*/ new Intl.Segmenter("en", {
granularity: "grapheme",
});
export function getCharacterWidth(ch: string): number { export function getCharacterWidth(ch: string): number {
const segments = [...segmenter.segment(ch)]; const segments = [...segmenter.segment(ch)];