From ecf29b56bb2f1debcf370cd608e6c8be724d534a Mon Sep 17 00:00:00 2001 From: Travis CI <> Date: Sat, 2 Dec 2017 08:53:26 +0000 Subject: [PATCH] [CI Skip] 0.6.4 --- docs/README.md | 18 ++++++++++++++++++ package.json | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 02fad24fe..6870801bf 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,6 +14,24 @@ Utility methods for this package are split into groups # Available methods +## assert + +Checks for a valid test, if not ExtError is thrown. + +```js +assert (test: boolean, message: string, code: number = ExtError.CODES.ASSERT, data: any): void +``` + + +Checks that `test` is a true value. If value is `false` (or `false-ish`), it throws an ExtError with the supplied `message` and an optional `code` and `data`. When `test` passes, `true` is returned. + +```js +const assert = require('@polkadot/util/assert'); + +assert(true === true, 'True should be true'); // true returned +assert(false === true, 'False should not be true'); // ExtError thrown +``` + ## Logger Creates a consistent log interface for messages diff --git a/package.json b/package.json index 10d69ef1a..069fa8e42 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/util", - "version": "0.6.3", + "version": "0.6.4", "description": "A collection of useful utilities for @polkadot", "main": "index.js", "keywords": [