Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cosmjs/encoding

Package Overview
Dependencies
Maintainers
2
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cosmjs/encoding - npm Package Compare versions

Comparing version 0.29.2 to 0.29.3

8

build/utf8.d.ts
export declare function toUtf8(str: string): Uint8Array;
export declare function fromUtf8(data: Uint8Array): string;
/**
* Takes UTF-8 data and decodes it to a string.
*
* In lossy mode, the replacement character � is used to substitude invalid
* encodings. By default lossy mode is off and invalid data will lead to exceptions.
*/
export declare function fromUtf8(data: Uint8Array, lossy?: boolean): string;

@@ -8,6 +8,13 @@ "use strict";

exports.toUtf8 = toUtf8;
function fromUtf8(data) {
return new TextDecoder("utf-8", { fatal: true }).decode(data);
/**
* Takes UTF-8 data and decodes it to a string.
*
* In lossy mode, the replacement character � is used to substitude invalid
* encodings. By default lossy mode is off and invalid data will lead to exceptions.
*/
function fromUtf8(data, lossy = false) {
const fatal = !lossy;
return new TextDecoder("utf-8", { fatal }).decode(data);
}
exports.fromUtf8 = fromUtf8;
//# sourceMappingURL=utf8.js.map

2

package.json
{
"name": "@cosmjs/encoding",
"version": "0.29.2",
"version": "0.29.3",
"description": "Encoding helpers for blockchain projects",

@@ -5,0 +5,0 @@ "contributors": [

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc