diff --git a/common.mjs b/common.mjs index 3db03f1..c120597 100644 --- a/common.mjs +++ b/common.mjs @@ -5,6 +5,7 @@ import fs from 'node:fs'; import { readdir, readFile } from 'node:fs/promises'; import { resolve } from 'node:path'; +import { Buffer } from 'node:buffer'; import md5 from 'md5'; class Common { @@ -209,7 +210,7 @@ class Common { } byteSize(str) { - return new Blob([str]).size; + return Buffer.byteLength(str, 'utf8'); } }