mirror of
https://github.com/TextPlace/CoreTextPlace.git
synced 2026-01-15 01:42:34 +00:00
Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
| 8746ae1494 |
3 changed files with 5 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@textplace/core",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.1",
|
||||
"exports": "./src/mod.ts",
|
||||
"imports": {
|
||||
"@std/cli": "jsr:@std/cli@1"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@textplace/core",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.1",
|
||||
"description": "The core logic of TextPlace.",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
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 {
|
||||
const segments = [...segmenter.segment(ch)];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue