Skip to content

[Replacement]: is-utf8 #1024

Description

@outslept

Package to replace

is-utf8

Suggested replacement(s)

const decoder = new TextDecoder('utf-8', { fatal: true });

const isUtf8 = (bytes) => {
  try {
    decoder.decode(bytes);
    return true;
  } catch {
    return false;
  }
};

Manifest type

micro-utility (tiny utility replaceable with native code or removal)

Rationale

inlinable. this variation is even better than the og

Availability

No response

Code example (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions