blob: 33469c970de912e5aa30be91f0f27e961276eff2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
|
import { test, expect } from "bun:test";
import { isUtf8 } from "node:buffer";
import isValidUTF8 from "utf-8-validate";
test("utf-8-validate", () => {
expect(isValidUTF8).toBe(isUtf8);
expect(isValidUTF8(Buffer.from("😀"))).toBeTrue();
expect(isValidUTF8(Buffer.from([0xff]))).toBeFalse();
});
|