Skip to content
Myr

encoding.js

This file

Path

test/helpers/encoding.js

7 lines · 326 bytes · JavaScript

Last changed by

Require Node.js 22 (#1243)Sindre Sorhusbefore adoption04b4454

History of this file

Take it

The walk stopped after 200 commits: lines older than 9f65b86 point at it.

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 1–6why, one step back
1const textEncoder = new TextEncoder();
23export const multibyteChar = '\u{1F984}';4export const multibyteString = `${multibyteChar}${multibyteChar}`;5export const multibyteUint8Array = textEncoder.encode(multibyteString);6export const breakingLength = multibyteUint8Array.length * 0.75;

Require Node.js 22 (#1243)Sindre Sorhusbefore adoption04b4454

line 7why, one step back
7export const brokenSymbol = '\u{FFFD}';