UNPKG
@qelos/assets
Version:
latest (3.8.0)
3.8.0
3.7.4
3.7.3
manage assets like images and static files on remote servers
@qelos/assets
/
node_modules
/
@smithy
/
util-utf8
/
dist-es
/
fromUtf8.js
6 lines
(5 loc)
•
240 B
JavaScript
View Raw
1
2
3
4
5
6
import
{ fromString }
from
"@smithy/util-buffer-from"
;
export
const
fromUtf8
= (
input
) => {
const
buf =
fromString
(input,
"utf8"
);
return
new
Uint8Array
(buf.
buffer
, buf.
byteOffset
, buf.
byteLength
/
Uint8Array
.
BYTES_PER_ELEMENT
); };