diff --git a/docs/README.md b/docs/README.md index 3e78365d1..9a422573a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -19,7 +19,7 @@ Utility methods for this package are split into groups Checks for a valid test, if not ExtError is thrown. ```js -assert (test: boolean, message: string, code: number = ExtError.CODES.ASSERT, data: any): void +assert (test: any, message: string | () => string, code: number = ExtError.CODES.ASSERT, data: any): void ``` @@ -30,6 +30,7 @@ const assert = require('@polkadot/util/assert'); assert(true, 'True should be true'); // true returned assert(false, 'False should not be true'); // ExtError thrown +assert(false, () => 'message'); // ExtError with 'message' ``` ## Logger diff --git a/docs/number.md b/docs/number.md index eae8cc5b1..1997177d3 100644 --- a/docs/number.md +++ b/docs/number.md @@ -45,7 +45,7 @@ numberToBuffer (value?: number): Buffer ```js import { numberToBuffer } from '@polkadot/util'; -const buffer = numberToBuffer('0x1234'); // => Buffer.from([0x12, 0x34]) +const buffer = numberToBuffer(0x1234); // => Buffer.from([0x12, 0x34]) ``` ## numberToHex diff --git a/package.json b/package.json index b67ee3e5a..1792e8a7f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/util", - "version": "0.6.6", + "version": "0.6.7", "description": "A collection of useful utilities for @polkadot", "main": "index.js", "keywords": [