codepoint0
v1.0.0
Published
Return the first Unicode code point of a non-empty string.
Maintainers
Readme
codepoint0
Return the first Unicode code point of a non-empty string.
Install
npm install codepoint0Usage
import { codePoint0 } from "codepoint0";
codePoint0("a"); // 97
codePoint0("😀"); // 128512
// @ts-expect-error -- empty strings are rejected at compile time
codePoint0("");The parameter type is based on NonEmptyString from type-fest, bundled into this package's type declarations.
License
MIT
