Files
klz-cables.com/.pnpm-store/v10/files/93/f0a699e76d960c88f72ee545cb8185f73e57441fa67806d1312c0cbc4130922c6f58e18d7a9e243df1e042ba59697463cdc49dc7ea39ef2d29a17d9283df28
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

29 lines
844 B
Plaintext

# utf8-byte-length [![build status](https://secure.travis-ci.org/parshap/utf8-byte-length.svg?branch=master)](http://travis-ci.org/parshap/utf8-byte-length)
Get the utf8 byte length of a string, taking into account multi-byte
characters and surrogate pairs.
By default, this module defers to `Buffer.byteLength`. A browser
implementation is also provided that doesn't use `Buffer.byteLength`
minimize build size.
## Example
```js
var getLength = require("utf8-byte-length")
console.log(truncate("a☃", 2)) // a = 1 byte, ☃ = 3 bytes
// -> 4
```
## API
### `var getLength = require("utf8-byte-length")`
*When using browserify or webpack*, this automatically resolves to an
implementation that does not use `Buffer.byteLength`.
### `getLength(string)`
Returns the byte length of `string`. Throws an error if `string` is not
a string.