From 19b31eb01be0fa9f20b2d6676d92aac77d00b0e4 Mon Sep 17 00:00:00 2001 From: jasonandjay <342690199@qq.com> Date: Thu, 2 Nov 2023 14:25:30 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20build=20src?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/address.d.ts | 17 +++++------------ src/address.js | 17 +++++------------ 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/src/address.d.ts b/src/address.d.ts index 132537497..5f3af8a78 100644 --- a/src/address.d.ts +++ b/src/address.d.ts @@ -27,19 +27,12 @@ export interface Bech32Result { } /** * decode address with base58 specification, return address version and address hash if valid - * @example + * @case * ```ts - * // valid case - * fromBase58Check('1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH') - * // => {version: 0, hash: } - * - * // invalid case: address is too short - * fromBase58Check('7SeEnXWPaCCALbVrTnszCVGfRU8cGfx') - * // => throw new TypeError('7SeEnXWPaCCALbVrTnszCVGfRU8cGfx is too short') - * - * // invalid case: address is too long - * fromBase58Check('j9ywUkWg2fTQrouxxh5rSZhRvrjMkEUfuiKe') - * // => throw new TypeError('j9ywUkWg2fTQrouxxh5rSZhRvrjMkEUfuiKe is too long') + * // You can test it here and find more case in test/address.spec.ts + * const result = address.fromBase58Check('1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH') + * console.log(JSON.stringify(result)) + * // => {"version":0,"hash":{"type":"Buffer","data":[117,30,118,232,25,145,150,212,84,148,28,69,209,179,163,35,241,67,59,214]}} * ``` */ export declare function fromBase58Check(address: string): Base58CheckResult; diff --git a/src/address.js b/src/address.js index b1b199188..11cba0686 100644 --- a/src/address.js +++ b/src/address.js @@ -43,19 +43,12 @@ function _toFutureSegwitAddress(output, network) { } /** * decode address with base58 specification, return address version and address hash if valid - * @example + * @case * ```ts - * // valid case - * fromBase58Check('1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH') - * // => {version: 0, hash: } - * - * // invalid case: address is too short - * fromBase58Check('7SeEnXWPaCCALbVrTnszCVGfRU8cGfx') - * // => throw new TypeError('7SeEnXWPaCCALbVrTnszCVGfRU8cGfx is too short') - * - * // invalid case: address is too long - * fromBase58Check('j9ywUkWg2fTQrouxxh5rSZhRvrjMkEUfuiKe') - * // => throw new TypeError('j9ywUkWg2fTQrouxxh5rSZhRvrjMkEUfuiKe is too long') + * // You can test it here and find more case in test/address.spec.ts + * const result = address.fromBase58Check('1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH') + * console.log(JSON.stringify(result)) + * // => {"version":0,"hash":{"type":"Buffer","data":[117,30,118,232,25,145,150,212,84,148,28,69,209,179,163,35,241,67,59,214]}} * ``` */ function fromBase58Check(address) {