[CI Skip] 0.32.8

This commit is contained in:
Travis CI
2018-10-24 14:06:04 +00:00
parent 0cb6e6c746
commit 0bae9bbb23
157 changed files with 422 additions and 369 deletions
+13 -12
View File
@@ -2,13 +2,14 @@
*__name__*: ExtError
*__signature__*: ExtError (message: string = '', code: number = UNKNOWN_ERROR, value: any)
*__signature__*: ExtError (message: string = '', code: number = UNKNOWN\_ERROR, value: any)
*__summary__*: Extension to the basic JS Error.
*__description__*: The built-in JavaScript Error class is extended by adding a code to allow for Error categorization. In addition to the normal `stack`, `message`, the numeric `code` and `data` (any types) parameters are available on the object.
*__example__*:
```javascript
const { ExtError } from '@polkadot/util');
@@ -33,7 +34,7 @@ throw new ExtError('some message', ExtError.CODES.METHOD_NOT_FOUND); // => error
⊕ **new ExtError**(message?: *`string`*, code?: *`number`*, data?: *`any`*): [ExtError](_ext_error_.exterror.md)
*Defined in [ext/error.ts:44](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/ext/error.ts#L44)*
*Defined in [ext/error.ts:44](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/ext/error.ts#L44)*
**Parameters:**
@@ -55,7 +56,7 @@ ___
**● code**: *`number`*
*Defined in [ext/error.ts:36](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/ext/error.ts#L36)*
*Defined in [ext/error.ts:36](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/ext/error.ts#L36)*
___
<a id="data"></a>
@@ -64,7 +65,7 @@ ___
**● data**: *`any`*
*Defined in [ext/error.ts:38](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/ext/error.ts#L38)*
*Defined in [ext/error.ts:38](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/ext/error.ts#L38)*
___
<a id="message"></a>
@@ -75,7 +76,7 @@ ___
*Overrides Error.message*
*Defined in [ext/error.ts:40](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/ext/error.ts#L40)*
*Defined in [ext/error.ts:40](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/ext/error.ts#L40)*
___
<a id="name"></a>
@@ -86,7 +87,7 @@ ___
*Overrides Error.name*
*Defined in [ext/error.ts:42](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/ext/error.ts#L42)*
*Defined in [ext/error.ts:42](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/ext/error.ts#L42)*
___
<a id="stack"></a>
@@ -97,7 +98,7 @@ ___
*Overrides Error.stack*
*Defined in [ext/error.ts:44](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/ext/error.ts#L44)*
*Defined in [ext/error.ts:44](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/ext/error.ts#L44)*
___
<a id="error"></a>
@@ -118,7 +119,7 @@ ___
**CODES**: *`object`*
*Defined in [ext/error.ts:61](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/ext/error.ts#L61)*
*Defined in [ext/error.ts:61](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/ext/error.ts#L61)*
<a id="codes.assert"></a>
@@ -126,7 +127,7 @@ ___
**● ASSERT**: *`number`* = -90009
*Defined in [ext/error.ts:62](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/ext/error.ts#L62)*
*Defined in [ext/error.ts:62](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/ext/error.ts#L62)*
___
<a id="codes.invalid_jsonrpc"></a>
@@ -135,7 +136,7 @@ ___
**● INVALID_JSONRPC**: *`number`* = -99998
*Defined in [ext/error.ts:64](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/ext/error.ts#L64)*
*Defined in [ext/error.ts:64](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/ext/error.ts#L64)*
___
<a id="codes.method_not_found"></a>
@@ -144,7 +145,7 @@ ___
**● METHOD_NOT_FOUND**: *`number`* = -32601
*Defined in [ext/error.ts:65](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/ext/error.ts#L65)*
*Defined in [ext/error.ts:65](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/ext/error.ts#L65)*
___
<a id="codes.unknown"></a>
@@ -153,7 +154,7 @@ ___
**● UNKNOWN**: *`number`*
*Defined in [ext/error.ts:63](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/ext/error.ts#L63)*
*Defined in [ext/error.ts:63](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/ext/error.ts#L63)*
___
+1 -1
View File
@@ -416,7 +416,7 @@
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"util","level":"1.5","depth":1,"next":{"title":"util-crypto","level":"1.6","depth":1,"path":"util-crypto/README.md","ref":"util-crypto/README.md","articles":[]},"previous":{"title":"trie-hash","level":"1.4","depth":1,"path":"trie-hash/README.md","ref":"trie-hash/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/common/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot Common Book","gitbook":">=2.4.0"},"file":{"path":"util/README.md","mtime":"2018-10-24T12:37:00.109Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-24T12:37:43.748Z"},"basePath":"..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"util","level":"1.5","depth":1,"next":{"title":"util-crypto","level":"1.6","depth":1,"path":"util-crypto/README.md","ref":"util-crypto/README.md","articles":[]},"previous":{"title":"trie-hash","level":"1.4","depth":1,"path":"trie-hash/README.md","ref":"trie-hash/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/common/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot Common Book","gitbook":">=2.4.0"},"file":{"path":"util/README.md","mtime":"2018-10-24T14:05:17.011Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-24T14:05:57.961Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **arrayFilter**(array: *`Array`<`any`>*, allowNulls?: *`boolean`*): `Array`<`any`>
*Defined in [array/filter.ts:24](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/array/filter.ts#L24)*
*Defined in [array/filter.ts:24](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/array/filter.ts#L24)*
*__name__*: arrayFilter
@@ -19,6 +19,7 @@
*__description__*: Returns a new array with all `undefined` values removed. Optionally, when `allowNulls = false`, it removes the `null` values as well
*__example__*:
```javascript
import { arrayFilter } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **assert**(test: *`any`*, message: * `string` &#124; `MessageFn`*, code?: *`number`*, data?: *`any`*): `boolean`
*Defined in [assert.ts:27](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/assert.ts#L27)*
*Defined in [assert.ts:27](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/assert.ts#L27)*
*__name__*: assert
@@ -19,6 +19,7 @@
*__description__*: Checks that `test` is a truthy value. If value is falsy (`null`, `undefined`, `false`, ...), it throws an ExtError with the supplied `message` and an optional `code` and `data`. When `test` passes, `true` is returned.
*__example__*:
```javascript
const { assert } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **bnToBn**(value?: * `BN` &#124; `number`*): `BN`
*Defined in [bn/toBn.ts:24](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/bn/toBn.ts#L24)*
*Defined in [bn/toBn.ts:24](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/bn/toBn.ts#L24)*
*__name__*: bnToBn
@@ -19,6 +19,7 @@
*__description__*: `null` inputs returns a `0x0` result, BN values returns the value, numnbers returns a BN representation.
*__example__*:
```javascript
import BN from 'bn.js';
import { bnToBn } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **bnToHex**(value?: * `BN` &#124; `number`*, bitLength?: *`number`*): `string`
*Defined in [bn/toHex.ts:28](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/bn/toHex.ts#L28)*
*Defined in [bn/toHex.ts:28](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/bn/toHex.ts#L28)*
*__name__*: bnToHex
@@ -19,6 +19,7 @@
*__description__*: `null` inputs returns a `0x` result, BN values return the actual value as a `0x` prefixed hex value. Anything that is not a BN object throws an error. With `bitLength` set, it fixes the number to the specified length.
*__example__*:
```javascript
import BN from 'bn.js';
import { bnToHex } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **bnToU8a**(value: * `BN` &#124; `number`*, bitLength: *`number`*, isLe: *`boolean`*): `Uint8Array`
*Defined in [bn/toU8a.ts:26](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/bn/toU8a.ts#L26)*
*Defined in [bn/toU8a.ts:26](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/bn/toU8a.ts#L26)*
*__name__*: bnToU8a
@@ -19,6 +19,7 @@
*__description__*: `null`/`undefined`/`NaN` inputs returns an empty `Uint8Array` result. `BN` input values return the actual bytes value converted to a `Uint8Array`. Optionally convert using little-endian format if `isLE` is set.
*__example__*:
```javascript
import { bnToU8a } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **bufferToU8a**(buffer?: * `Buffer` &#124; `number`[]*): `Uint8Array`
*Defined in [buffer/toU8a.ts:20](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/buffer/toU8a.ts#L20)*
*Defined in [buffer/toU8a.ts:20](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/buffer/toU8a.ts#L20)*
*__name__*: bufferToU8a
@@ -19,6 +19,7 @@
*__description__*: `null` inputs returns an empty result, `Buffer` values return the actual value as a `Uint8Array`. Anything that is not a `Buffer` object throws an error.
*__example__*:
```javascript
import { bufferToU8a } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **hexAddPrefix**(value: * `string` &#124; `null` &#124; `undefined`*): `string`
*Defined in [hex/addPrefix.ts:22](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/hex/addPrefix.ts#L22)*
*Defined in [hex/addPrefix.ts:22](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/hex/addPrefix.ts#L22)*
*__name__*: hexAddPrefix
@@ -19,6 +19,7 @@
*__description__*: Returns a `0x` prefixed string from the input value. If the input is already prefixed, it is returned unchanged.
*__example__*:
```javascript
import { hexAddPrefix } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **hexFixLength**(value: *`string`*, bitLength?: *`number`*, withPadding?: *`boolean`*): `string`
*Defined in [hex/fixLength.ts:25](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/hex/fixLength.ts#L25)*
*Defined in [hex/fixLength.ts:25](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/hex/fixLength.ts#L25)*
*__name__*: hexFixLength
@@ -19,6 +19,7 @@
*__description__*: Returns a `0x` prefixed string with the specified number of bits contained in the return value. (If bitLength is -1, length checking is not done). Values with more bits are trimmed to the specified length. Input values with less bits are returned as-is by default. When `withPadding` is set, shorter values are padded with `0`.
*__example__*:
```javascript
import { hexFixLength } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **hexHasPrefix**(value: * `string` &#124; `null` &#124; `undefined`*): `boolean`
*Defined in [hex/hasPrefix.ts:22](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/hex/hasPrefix.ts#L22)*
*Defined in [hex/hasPrefix.ts:22](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/hex/hasPrefix.ts#L22)*
*__name__*: hexHasPrefix
@@ -19,6 +19,7 @@
*__description__*: Checks for a valid hex input value and if the start matched `0x`
*__example__*:
```javascript
import { hexHasPrefix } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **hexStripPrefix**(value: * `string` &#124; `null` &#124; `undefined`*): `string`
*Defined in [hex/stripPrefix.ts:24](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/hex/stripPrefix.ts#L24)*
*Defined in [hex/stripPrefix.ts:24](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/hex/stripPrefix.ts#L24)*
*__name__*: hexStripPrefix
@@ -19,6 +19,7 @@
*__description__*: Tests for the existence of a `0x` prefix, and returns the value without the prefix. Un-prefixed values are returned as-is.
*__example__*:
```javascript
import { hexStripPrefix } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **hexToBn**(_value?: * `undefined` &#124; `string`*, isLe?: *`boolean`*): `BN`
*Defined in [hex/toBn.ts:30](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/hex/toBn.ts#L30)*
*Defined in [hex/toBn.ts:30](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/hex/toBn.ts#L30)*
*__name__*: hexToBn
@@ -19,6 +19,7 @@
*__description__*: `null` inputs returns a `BN(0)` result. Hex input values return the actual value converted to a BN. Anything that is not a hex string (including the `0x` prefix) throws an error.
*__example__*:
```javascript
import { hexToBn } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **hexToNumber**(value?: * `undefined` &#124; `string`*): `number`
*Defined in [hex/toNumber.ts:22](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/hex/toNumber.ts#L22)*
*Defined in [hex/toNumber.ts:22](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/hex/toNumber.ts#L22)*
*__name__*: hexToNumber
@@ -19,6 +19,7 @@
*__description__*: `null` inputs returns an NaN result, `hex` values return the actual value as a `Number`.
*__example__*:
```javascript
import { hexToNumber } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **hexToU8a**(_value?: * `string` &#124; `null`*, bitLength?: *`number`*): `Uint8Array`
*Defined in [hex/toU8a.ts:25](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/hex/toU8a.ts#L25)*
*Defined in [hex/toU8a.ts:25](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/hex/toU8a.ts#L25)*
*__name__*: hexToU8a
@@ -19,6 +19,7 @@
*__description__*: `null` inputs returns an empty `Uint8Array` result. Hex input values return the actual bytes value converted to a Uint8Array. Anything that is not a hex string (including the `0x` prefix) throws an error.
*__example__*:
```javascript
import { hexToU8a } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **isBn**(value: *`any`*): `boolean`
*Defined in [is/bn.ts:23](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/is/bn.ts#L23)*
*Defined in [is/bn.ts:23](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/is/bn.ts#L23)*
*__name__*: isBn
@@ -19,6 +19,7 @@
*__description__*: Checks to see if the input object is an instance of `BN` (bn.js).
*__example__*:
```javascript
import BN from 'bn.js';
import { isBn } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **isBoolean**(value: *`any`*): `boolean`
*Defined in [is/boolean.ts:20](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/is/boolean.ts#L20)*
*Defined in [is/boolean.ts:20](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/is/boolean.ts#L20)*
*__name__*: isBoolean
@@ -19,6 +19,7 @@
*__description__*: Checks to see if the input value is a JavaScript boolean.
*__example__*:
```javascript
import { isBoolean } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **isBuffer**(value: *`any`*): `boolean`
*Defined in [is/buffer.ts:22](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/is/buffer.ts#L22)*
*Defined in [is/buffer.ts:22](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/is/buffer.ts#L22)*
*__name__*: isBuffer
@@ -19,6 +19,7 @@
*__description__*: Checks to see if the input object is an instance of `Buffer`.
*__example__*:
```javascript
import { isBuffer } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **isError**(value: *`any`*): `boolean`
*Defined in [is/error.ts:22](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/is/error.ts#L22)*
*Defined in [is/error.ts:22](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/is/error.ts#L22)*
*__name__*: isError
@@ -19,6 +19,7 @@
*__description__*: Checks to see if the input object is an instance of `Error`.
*__example__*:
```javascript
import { isError } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **isFunction**(value: *`any`*): `boolean`
*Defined in [is/function.ts:20](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/is/function.ts#L20)*
*Defined in [is/function.ts:20](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/is/function.ts#L20)*
*__name__*: isFunction
@@ -19,6 +19,7 @@
*__description__*: Checks to see if the input value is a JavaScript function.
*__example__*:
```javascript
import { isFunction } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **isHex**(_value: *`any`*, bitLength?: *`number`*, ignoreLength?: *`boolean`*): `boolean`
*Defined in [is/hex.ts:25](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/is/hex.ts#L25)*
*Defined in [is/hex.ts:25](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/is/hex.ts#L25)*
*__name__*: isHex
@@ -19,6 +19,7 @@
*__description__*: Checks to see if the input value is a `0x` prefixed hex string. Optionally (`bitLength` !== -1) checks to see if the bitLength is correct.
*__example__*:
```javascript
import { isHex } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **isInstanceOf**(value: *`any`*, clazz: *`any`*): `boolean`
*Defined in [is/instanceOf.ts:20](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/is/instanceOf.ts#L20)*
*Defined in [is/instanceOf.ts:20](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/is/instanceOf.ts#L20)*
*__name__*: isInstanceOf
@@ -19,6 +19,7 @@
*__description__*: Checks to see if the input value is an instance of the test class.
*__example__*:
```javascript
import { isInstanceOf } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **isIp**(value: *`string`*, type?: *`IpTypes`*): `boolean`
*Defined in [is/ip.ts:27](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/is/ip.ts#L27)*
*Defined in [is/ip.ts:27](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/is/ip.ts#L27)*
*__name__*: isIp
@@ -19,6 +19,7 @@
*__description__*: Checks to see if the value is a valid IP address. Optionally check for either v4/v6
*__example__*:
```javascript
import { isIp } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **isNull**(value: *`any`*): `boolean`
*Defined in [is/null.ts:20](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/is/null.ts#L20)*
*Defined in [is/null.ts:20](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/is/null.ts#L20)*
*__name__*: isNull
@@ -19,6 +19,7 @@
*__description__*: Checks to see if the input value is `null`.
*__example__*:
```javascript
import { isNull } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **isNumber**(value: *`any`*): `boolean`
*Defined in [is/number.ts:20](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/is/number.ts#L20)*
*Defined in [is/number.ts:20](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/is/number.ts#L20)*
*__name__*: isNumber
@@ -19,6 +19,7 @@
*__description__*: Checks to see if the input value is a valid number.
*__example__*:
```javascript
import { isNumber } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **isObject**(value: *`any`*): `boolean`
*Defined in [is/object.ts:25](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/is/object.ts#L25)*
*Defined in [is/object.ts:25](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/is/object.ts#L25)*
*__name__*: isObject
@@ -19,6 +19,7 @@
*__description__*: Checks to see if the input value is a JavaScript object.
*__example__*:
```javascript
import { isObject } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **isObservable**(value: *`any`*): `boolean`
*Defined in [is/observable.ts:27](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/is/observable.ts#L27)*
*Defined in [is/observable.ts:27](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/is/observable.ts#L27)*
*__name__*: isBObservable
@@ -19,6 +19,7 @@
*__description__*: Checks to see if the input object is an instance of `BN` (bn.js).
*__example__*:
```javascript
import { isObservable } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **isString**(value: *`any`*): `boolean`
*Defined in [is/string.ts:20](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/is/string.ts#L20)*
*Defined in [is/string.ts:20](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/is/string.ts#L20)*
*__name__*: isString
@@ -19,6 +19,7 @@
*__description__*: Checks to see if the input value is a JavaScript string.
*__example__*:
```javascript
import { isString } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **isU8a**(value: *`any`*): `boolean`
*Defined in [is/u8a.ts:22](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/is/u8a.ts#L22)*
*Defined in [is/u8a.ts:22](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/is/u8a.ts#L22)*
*__name__*: isU8a
@@ -19,6 +19,7 @@
*__description__*: Checks to see if the input object is an instance of `Uint8Array`.
*__example__*:
```javascript
import { isUint8Array } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **isUndefined**(value: *`any`*): `boolean`
*Defined in [is/undefined.ts:20](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/is/undefined.ts#L20)*
*Defined in [is/undefined.ts:20](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/is/undefined.ts#L20)*
*__name__*: isUndefined
@@ -19,6 +19,7 @@
*__description__*: Checks to see if the input value is `undefined`.
*__example__*:
```javascript
import { isUndefined } from '@polkadot/util';
+3 -2
View File
@@ -8,7 +8,7 @@
▸ **format**(value: *`any`*): `any`
*Defined in [logger.ts:36](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/logger.ts#L36)*
*Defined in [logger.ts:36](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/logger.ts#L36)*
**Parameters:**
@@ -25,7 +25,7 @@ ___
▸ **logger**(_type: *`string`*): `Logger`
*Defined in [logger.ts:105](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/logger.ts#L105)*
*Defined in [logger.ts:105](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/logger.ts#L105)*
*__name__*: Logger
@@ -36,6 +36,7 @@ ___
*__description__*: Returns a `Logger` that has `.log`, `.error`, `.warn` and `.debug` (controlled with environment `DEBUG=typeA,typeB`) methods. Logging is done with a consistent prefix (type of logger, date) followed by the actual message using the underlying console.
*__example__*:
```javascript
const l from '@polkadot/util/logger')('test');
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **numberToHex**(value?: * `undefined` &#124; `number`*, bitLength?: *`number`*): `string`
*Defined in [number/toHex.ts:25](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/number/toHex.ts#L25)*
*Defined in [number/toHex.ts:25](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/number/toHex.ts#L25)*
*__name__*: numberToHex
@@ -19,6 +19,7 @@
*__description__*: `null`/`undefined`/`NaN` inputs returns an empty `0x` result. `number` input values return the actual bytes value converted to a `hex`. With `bitLength` set, it converts the number to the equivalent size.
*__example__*:
```javascript
import { numberToHex } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **numberToU8a**(value?: * `undefined` &#124; `number`*, bitLength?: *`number`*): `Uint8Array`
*Defined in [number/toU8a.ts:23](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/number/toU8a.ts#L23)*
*Defined in [number/toU8a.ts:23](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/number/toU8a.ts#L23)*
*__name__*: numberToU8a
@@ -19,6 +19,7 @@
*__description__*: `null`/`undefined`/`NaN` inputs returns an empty `Uint8Array` result. `number` input values return the actual bytes value converted to a `Uint8Array`. With `bitLength`, it converts the value to the equivalent size.
*__example__*:
```javascript
import { numberToU8a } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **promisify**(self: *`any`*, fn: *`Function`*, ...params: *`Array`<`any`>*): `Promise`<`any`>
*Defined in [promisify.ts:21](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/promisify.ts#L21)*
*Defined in [promisify.ts:21](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/promisify.ts#L21)*
*__name__*: promisify
@@ -19,6 +19,7 @@
*__description__*: Wraps the supplied async function `fn` that has a standard JS callback `(error: Error, result: any)` into a `Promise`, passing the supplied parameters. When `error` is set, the Promise is rejected, else the Promise resolves with the `result` value.
*__example__*:
```javascript
const { promisify } from '@polkadot/util';
+3 -2
View File
@@ -8,17 +8,18 @@
▸ **stringLowerFirst**(_value: *`string`*): `string`
*Defined in [string/lowerFirst.ts:23](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/string/lowerFirst.ts#L23)*
*Defined in [string/lowerFirst.ts:23](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/string/lowerFirst.ts#L23)*
*__name__*: stringLowerFirst
*__signature__*: stringLowerFirst (_value: string): string
*__signature__*: stringLowerFirst (\_value: string): string
*__summary__*: Lowercase the first letter of a string
*__description__*: Lowercase the first letter of a string
*__example__*:
```javascript
import { stringLowerFirst } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **stringShorten**(_value: *`any`*, prefixLength?: *`number`*): `string`
*Defined in [string/shorten.ts:20](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/string/shorten.ts#L20)*
*Defined in [string/shorten.ts:20](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/string/shorten.ts#L20)*
*__name__*: stringShorten
@@ -19,6 +19,7 @@
*__description__*: Checks the string against the `prefixLength`, if longer than dopuble this, shortens it by placing `..` in the middle of it
*__example__*:
```javascript
import { stringShorten } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **stringToU8a**(value?: * `undefined` &#124; `string`*): `Uint8Array`
*Defined in [string/toU8a.ts:24](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/string/toU8a.ts#L24)*
*Defined in [string/toU8a.ts:24](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/string/toU8a.ts#L24)*
*__name__*: stringToU8a
@@ -19,6 +19,7 @@
*__description__*: String input values return the actual encoded `UInt8Array`. `null` or `undefined` values returns an empty encoded array.
*__example__*:
```javascript
import { stringToU8a } from '@polkadot/util';
+3 -2
View File
@@ -8,17 +8,18 @@
▸ **stringUpperFirst**(_value: *`string`*): `string`
*Defined in [string/upperFirst.ts:23](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/string/upperFirst.ts#L23)*
*Defined in [string/upperFirst.ts:23](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/string/upperFirst.ts#L23)*
*__name__*: stringUpperFirst
*__signature__*: stringUpperFirst (_value: string): string
*__signature__*: stringUpperFirst (\_value: string): string
*__summary__*: Lowercase the first letter of a string
*__description__*: Lowercase the first letter of a string
*__example__*:
```javascript
import { stringUpperFirst } from '@polkadot/util';
+1 -1
View File
@@ -8,7 +8,7 @@
▸ **syncify**(promise: *`Promise`<`any`>*): `any`
*Defined in [syncify.ts:11](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/syncify.ts#L11)*
*Defined in [syncify.ts:11](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/syncify.ts#L11)*
**Parameters:**
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **u8aConcat**(..._list: *`Array`< `Uint8Array` &#124; `string`>*): `Uint8Array`
*Defined in [u8a/concat.ts:25](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/u8a/concat.ts#L25)*
*Defined in [u8a/concat.ts:25](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/u8a/concat.ts#L25)*
*__name__*: u8aConcat
@@ -19,6 +19,7 @@
*__description__*: Concatenates the input arrays into a single `UInt8Array`.
*__example__*:
```javascript
import { u8aConcat } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **u8aFixLength**(value: *`Uint8Array`*, bitLength?: *`number`*, atStart?: *`boolean`*): `Uint8Array`
*Defined in [u8a/fixLength.ts:22](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/u8a/fixLength.ts#L22)*
*Defined in [u8a/fixLength.ts:22](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/u8a/fixLength.ts#L22)*
*__name__*: u8aFixLength
@@ -19,6 +19,7 @@
*__description__*: Returns a uint8Array with the specified number of bits contained in the return value. (If bitLength is -1, length checking is not done). Values with more bits are trimmed to the specified length.
*__example__*:
```javascript
import { u8aFixLength } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **u8aToBn**(value: *`Uint8Array`*, isLe: *`boolean`*): `BN`
*Defined in [u8a/toBn.ts:25](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/u8a/toBn.ts#L25)*
*Defined in [u8a/toBn.ts:25](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/u8a/toBn.ts#L25)*
*__name__*: u8aToBn
@@ -19,6 +19,7 @@
*__description__*: `UInt8Array` input values return the actual BN. `null` or `undefined` values returns an `0x0` value.
*__example__*:
```javascript
import { u8aToBn } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **u8aToBuffer**(value?: *`Uint8Array`*): `Buffer`
*Defined in [u8a/toBuffer.ts:20](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/u8a/toBuffer.ts#L20)*
*Defined in [u8a/toBuffer.ts:20](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/u8a/toBuffer.ts#L20)*
*__name__*: u8aToBuffer
@@ -19,6 +19,7 @@
*__description__*: `null` inputs returns an empty `Buffer` result. `UInt8Array` input values return the actual bytes value converted to a `Buffer`. Anything that is not a `UInt8Array` throws an error.
*__example__*:
```javascript
import { u8aToBuffer } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **u8aToHex**(value?: * `Uint8Array` &#124; `null`*, bitLength?: *`number`*, isPrefixed?: *`boolean`*): `string`
*Defined in [u8a/toHex.ts:20](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/u8a/toHex.ts#L20)*
*Defined in [u8a/toHex.ts:20](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/u8a/toHex.ts#L20)*
*__name__*: u8aToHex
@@ -19,6 +19,7 @@
*__description__*: `UInt8Array` input values return the actual hex string. `null` or `undefined` values returns an `0x` string.
*__example__*:
```javascript
import { u8aToHex } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **u8aToString**(value?: *`Uint8Array`*): `string`
*Defined in [u8a/toString.ts:24](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/u8a/toString.ts#L24)*
*Defined in [u8a/toString.ts:24](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/u8a/toString.ts#L24)*
*__name__*: u8aToString
@@ -19,6 +19,7 @@
*__description__*: `UInt8Array` input values return the actual decoded utf-8 string. `null` or `undefined` values returns an empty string.
*__example__*:
```javascript
import { u8aToString } from '@polkadot/util';
+2 -1
View File
@@ -8,7 +8,7 @@
▸ **u8aToU8a**(value?: * `Array`<`number`> &#124; `Buffer` &#124; `Uint8Array` &#124; `string` &#124; `null`*): `Uint8Array`
*Defined in [u8a/toU8a.ts:28](https://github.com/polkadot-js/common/blob/5ce8f91/packages/util/src/u8a/toU8a.ts#L28)*
*Defined in [u8a/toU8a.ts:28](https://github.com/polkadot-js/common/blob/0cb6e6c/packages/util/src/u8a/toU8a.ts#L28)*
*__name__*: u8aToU8a
@@ -19,6 +19,7 @@
*__description__*: `null` inputs returns a `[]` result, Uint8Array values returns the value, hex strings returns a Uint8Array representation.
*__example__*:
```javascript
import { u8aToU8a } from '@polkadot/util';