[CI Skip] 0.34.4

This commit is contained in:
Travis CI
2019-02-14 09:53:14 +00:00
parent 1e6eb2c283
commit b96dffabbc
274 changed files with 719 additions and 680 deletions
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **arrayFilter**(array: *`Array`<`any`>*, allowNulls?: *`boolean`*): `Array`<`any`>
*Defined in [array/filter.ts:24](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/array/filter.ts#L24)*
*Defined in [array/filter.ts:23](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/array/filter.ts#L23)*
*__name__*: arrayFilter
*__signature__*: arrayFilter (array: Array, allowNulls: boolean = true): Array
*__summary__*: Filters undefined and (optionally) null values from an array
*__description__*: Returns a new array with all `undefined` values removed. Optionally, when `allowNulls = false`, it removes the `null` values as well
+2
View File
@@ -0,0 +1,2 @@
+6 -5
View File
@@ -6,14 +6,12 @@
## assert
▸ **assert**(test: *`any`*, message: *`string` | `MessageFn`*, code?: *`number`*, data?: *`any`*): `boolean`
▸ **assert**<`T`>(test: *`Falsy` | `T`*, message: *`string` | `MessageFn`*, code?: *`number`*, data?: *`any`*): `boolean`
*Defined in [assert.ts:27](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/assert.ts#L27)*
*Defined in [assert.ts:28](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/assert.ts#L28)*
*__name__*: assert
*__signature__*: assert (test: any, message: string | () => string, code: number = ExtError.CODES.ASSERT, data: any): void
*__summary__*: Checks for a valid test, if not ExtError is thrown.
*__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.
@@ -28,11 +26,14 @@ assert(false, 'False should not be true'); // ExtError thrown
assert(false, () => 'message'); // ExtError with 'message'
```
**Type parameters:**
#### T
**Parameters:**
| Name | Type | Default value |
| ------ | ------ | ------ |
| test | `any` | - |
| test | `Falsy` | `T` | - |
| message | `string` | `MessageFn` | - |
| `Default value` code | `number` | ExtError.CODES.ASSERT |
| `Optional` data | `any` | - |
+2
View File
@@ -0,0 +1,2 @@
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **bnToBn**(value?: *`BN` | `number` | `null`*): `BN`
*Defined in [bn/toBn.ts:24](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/bn/toBn.ts#L24)*
*Defined in [bn/toBn.ts:23](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/bn/toBn.ts#L23)*
*__name__*: bnToBn
*__signature__*: bnToBn (value?: BN : number): BN
*__summary__*: Creates a BN value from a BN.js bignumber or number input.
*__description__*: `null` inputs returns a `0x0` result, BN values returns the value, numnbers returns a BN representation.
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **bnToHex**(value?: *`BN` | `number` | `null`*, options?: *`number` | `Options`*): `string`
*Defined in [bn/toHex.ts:34](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/bn/toHex.ts#L34)*
*Defined in [bn/toHex.ts:33](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/bn/toHex.ts#L33)*
*__name__*: bnToHex
*__signature__*: bnToHex (value?: BN, bitLength: number = -1): string
*__summary__*: Creates a hex value from a BN.js bignumber object.
*__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.
+2 -4
View File
@@ -10,12 +10,10 @@
▸ **bnToU8a**(value: *`BN` | `number` | `null`*, bitLength?: *`undefined` | `number`*, isLe?: *`undefined` | `false` | `true`*): `Uint8Array`
*Defined in [bn/toU8a.ts:30](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/bn/toU8a.ts#L30)*
*Defined in [bn/toU8a.ts:29](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/bn/toU8a.ts#L29)*
*__name__*: bnToU8a
*__signature__*: bnToU8a (value?: BN | number, bitLength: number = -1, isLE: boolean = false): Uint8Array
*__summary__*: Creates a Uint8Array object from a BN.
*__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.
@@ -37,7 +35,7 @@ bnToU8a(new BN(0x1234)); // => [0x12, 0x34]
**Returns:** `Uint8Array`
*Defined in [bn/toU8a.ts:31](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/bn/toU8a.ts#L31)*
*Defined in [bn/toU8a.ts:30](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/bn/toU8a.ts#L30)*
**Parameters:**
+3 -5
View File
@@ -6,14 +6,12 @@
## bufferToU8a
▸ **bufferToU8a**(buffer?: *`Buffer` | `number`[]*): `Uint8Array`
▸ **bufferToU8a**(buffer?: *`Buffer` | `number`[] | `null`*): `Uint8Array`
*Defined in [buffer/toU8a.ts:20](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/buffer/toU8a.ts#L20)*
*Defined in [buffer/toU8a.ts:19](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/buffer/toU8a.ts#L19)*
*__name__*: bufferToU8a
*__signature__*: bufferToU8a (value?: Buffer): string
*__summary__*: Creates a Uint8Array value from a Buffer object.
*__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.
@@ -30,7 +28,7 @@ bufferToU8a(Buffer.from([1, 2, 3]));
| Name | Type |
| ------ | ------ |
| `Optional` buffer | `Buffer` | `number`[] |
| `Optional` buffer | `Buffer` | `number`[] | `null` |
**Returns:** `Uint8Array`
+2
View File
@@ -0,0 +1,2 @@
+1 -1
View File
@@ -8,7 +8,7 @@
▸ **compactAddLength**(input: *`Uint8Array`*): `Uint8Array`
*Defined in [compact/addLength.ts:20](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/compact/addLength.ts#L20)*
*Defined in [compact/addLength.ts:20](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/compact/addLength.ts#L20)*
*__name__*: compactAddLength
+1 -1
View File
@@ -8,7 +8,7 @@
**● DEFAULT_BITLENGTH**: *[BitLength](_compact_types_.md#bitlength)* = 32
*Defined in [compact/defaults.ts:7](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/compact/defaults.ts#L7)*
*Defined in [compact/defaults.ts:7](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/compact/defaults.ts#L7)*
___
+1 -1
View File
@@ -8,7 +8,7 @@
▸ **compactFromU8a**(_input: *`Uint8Array` | `string`*, bitLength?: *[BitLength](_compact_types_.md#bitlength)*): [`number`, `BN`]
*Defined in [compact/fromU8a.ts:26](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/compact/fromU8a.ts#L26)*
*Defined in [compact/fromU8a.ts:26](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/compact/fromU8a.ts#L26)*
*__name__*: compactFromU8a
+1 -1
View File
@@ -8,7 +8,7 @@
▸ **compactStripLength**(input: *`Uint8Array`*, bitLength?: *[BitLength](_compact_types_.md#bitlength)*): [`number`, `Uint8Array`]
*Defined in [compact/stripLength.ts:22](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/compact/stripLength.ts#L22)*
*Defined in [compact/stripLength.ts:22](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/compact/stripLength.ts#L22)*
*__name__*: compactStripLength
+1 -1
View File
@@ -8,7 +8,7 @@
▸ **compactToU8a**(_value: *`BN` | `number`*): `Uint8Array`
*Defined in [compact/toU8a.ts:27](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/compact/toU8a.ts#L27)*
*Defined in [compact/toU8a.ts:27](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/compact/toU8a.ts#L27)*
*__name__*: compactToU8a
+1 -1
View File
@@ -8,7 +8,7 @@
**Ƭ BitLength**: *`8` | `16` | `32` | `64` | `128` | `256`*
*Defined in [compact/types.ts:5](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/compact/types.ts#L5)*
*Defined in [compact/types.ts:5](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/compact/types.ts#L5)*
___
+2
View File
@@ -0,0 +1,2 @@
+3 -5
View File
@@ -6,14 +6,12 @@
## hexAddPrefix
▸ **hexAddPrefix**(value: *`string` | `null` | `undefined`*): `string`
▸ **hexAddPrefix**(value?: *`string` | `null`*): `string`
*Defined in [hex/addPrefix.ts:22](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/hex/addPrefix.ts#L22)*
*Defined in [hex/addPrefix.ts:21](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/hex/addPrefix.ts#L21)*
*__name__*: hexAddPrefix
*__signature__*: hexAddPrefix (value: ?string): string
*__summary__*: Adds the `0x` prefix to string values.
*__description__*: Returns a `0x` prefixed string from the input value. If the input is already prefixed, it is returned unchanged.
@@ -30,7 +28,7 @@ console.log('With prefix', hexAddPrefix('0a0b12')); // => 0x0a0b12
| Name | Type |
| ------ | ------ |
| value | `string` | `null` | `undefined` |
| `Optional` value | `string` | `null` |
**Returns:** `string`
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **hexFixLength**(value: *`string`*, bitLength?: *`number`*, withPadding?: *`boolean`*): `string`
*Defined in [hex/fixLength.ts:25](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/hex/fixLength.ts#L25)*
*Defined in [hex/fixLength.ts:24](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/hex/fixLength.ts#L24)*
*__name__*: hexFixLength
*__signature__*: hexFixLength (value: string, bitLength: number = -1, withPadding: boolean = false): string
*__summary__*: Shifts a hex string to a specific bitLength
*__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`.
@@ -0,0 +1,2 @@
+3 -5
View File
@@ -6,14 +6,12 @@
## hexHasPrefix
▸ **hexHasPrefix**(value: *`string` | `null` | `undefined`*): `boolean`
▸ **hexHasPrefix**(value?: *`string` | `null`*): `boolean`
*Defined in [hex/hasPrefix.ts:22](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/hex/hasPrefix.ts#L22)*
*Defined in [hex/hasPrefix.ts:21](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/hex/hasPrefix.ts#L21)*
*__name__*: hexHasPrefix
*__signature__*: hexHasPrefix (value: ?string): boolean
*__summary__*: Tests for the existence of a `0x` prefix.
*__description__*: Checks for a valid hex input value and if the start matched `0x`
@@ -30,7 +28,7 @@ console.log('has prefix', hexHasPrefix('0x1234')); // => true
| Name | Type |
| ------ | ------ |
| value | `string` | `null` | `undefined` |
| `Optional` value | `string` | `null` |
**Returns:** `boolean`
@@ -0,0 +1,2 @@
+3 -5
View File
@@ -6,14 +6,12 @@
## hexStripPrefix
▸ **hexStripPrefix**(value: *`string` | `null` | `undefined`*): `string`
▸ **hexStripPrefix**(value?: *`string` | `null`*): `string`
*Defined in [hex/stripPrefix.ts:24](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/hex/stripPrefix.ts#L24)*
*Defined in [hex/stripPrefix.ts:23](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/hex/stripPrefix.ts#L23)*
*__name__*: hexStripPrefix
*__signature__*: hexStripPrefix (value: ?string): string
*__summary__*: Strips any leading `0x` prefix.
*__description__*: Tests for the existence of a `0x` prefix, and returns the value without the prefix. Un-prefixed values are returned as-is.
@@ -30,7 +28,7 @@ console.log('stripped', hexStripPrefix('0x1234')); // => 1234
| Name | Type |
| ------ | ------ |
| value | `string` | `null` | `undefined` |
| `Optional` value | `string` | `null` |
**Returns:** `string`
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **hexToBn**(value?: *`string` | `number` | `null`*, options?: *[ToBnOptions](../interfaces/_types_.tobnoptions.md) | `boolean`*): `BN`
*Defined in [hex/toBn.ts:36](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/hex/toBn.ts#L36)*
*Defined in [hex/toBn.ts:35](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/hex/toBn.ts#L35)*
*__name__*: hexToBn
*__signature__*: hexToBn (value?: string, \_options: ToBnOptions | boolean = { isLe: false, isNegative: false }): BN
*__summary__*: Creates a BN.js bignumber object from a hex string.
*__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.
+3 -5
View File
@@ -6,14 +6,12 @@
## hexToNumber
▸ **hexToNumber**(value?: *`undefined` | `string`*): `number`
▸ **hexToNumber**(value?: *`string` | `null`*): `number`
*Defined in [hex/toNumber.ts:22](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/hex/toNumber.ts#L22)*
*Defined in [hex/toNumber.ts:21](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/hex/toNumber.ts#L21)*
*__name__*: hexToNumber
*__signature__*: hexToNumber (value?: string): number
*__summary__*: Creates a Number value from a Buffer object.
*__description__*: `null` inputs returns an NaN result, `hex` values return the actual value as a `Number`.
@@ -30,7 +28,7 @@ hexToNumber('0x1234'); // => 0x1234
| Name | Type |
| ------ | ------ |
| `Optional` value | `undefined` | `string` |
| `Optional` value | `string` | `null` |
**Returns:** `number`
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **hexToU8a**(_value?: *`string` | `null`*, bitLength?: *`number`*): `Uint8Array`
*Defined in [hex/toU8a.ts:25](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/hex/toU8a.ts#L25)*
*Defined in [hex/toU8a.ts:24](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/hex/toU8a.ts#L24)*
*__name__*: hexToU8a
*__signature__*: hexToU8a (value?: string, bitLength: number = -1): Uint8Array
*__summary__*: Creates a Buffer object from a hex string.
*__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.
+2
View File
@@ -0,0 +1,2 @@
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **isBn**(value: *`any`*): `boolean`
*Defined in [is/bn.ts:23](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/is/bn.ts#L23)*
*Defined in [is/bn.ts:22](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/is/bn.ts#L22)*
*__name__*: isBn
*__signature__*: isBN (value: any): boolean
*__summary__*: Tests for a `BN` object instance.
*__description__*: Checks to see if the input object is an instance of `BN` (bn.js).
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **isBoolean**(value: *`any`*): `boolean`
*Defined in [is/boolean.ts:20](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/is/boolean.ts#L20)*
*Defined in [is/boolean.ts:19](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/is/boolean.ts#L19)*
*__name__*: isBoolean
*__signature__*: isBoolean (value: any): boolean
*__summary__*: Tests for a boolean value.
*__description__*: Checks to see if the input value is a JavaScript boolean.
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **isBuffer**(value: *`any`*): `boolean`
*Defined in [is/buffer.ts:22](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/is/buffer.ts#L22)*
*Defined in [is/buffer.ts:21](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/is/buffer.ts#L21)*
*__name__*: isBuffer
*__signature__*: isBuffer (value: any): boolean
*__summary__*: Tests for a `Buffer` object instance.
*__description__*: Checks to see if the input object is an instance of `Buffer`.
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **isError**(value: *`any`*): `boolean`
*Defined in [is/error.ts:22](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/is/error.ts#L22)*
*Defined in [is/error.ts:21](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/is/error.ts#L21)*
*__name__*: isError
*__signature__*: isError (value: any): boolean
*__summary__*: Tests for a `Error` object instance.
*__description__*: Checks to see if the input object is an instance of `Error`.
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **isFunction**(value: *`any`*): `boolean`
*Defined in [is/function.ts:20](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/is/function.ts#L20)*
*Defined in [is/function.ts:19](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/is/function.ts#L19)*
*__name__*: isFunction
*__signature__*: isFunction (value: any): boolean
*__summary__*: Tests for a `function`.
*__description__*: Checks to see if the input value is a JavaScript function.
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **isHex**(value: *`any`*, bitLength?: *`number`*, ignoreLength?: *`boolean`*): `boolean`
*Defined in [is/hex.ts:25](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/is/hex.ts#L25)*
*Defined in [is/hex.ts:24](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/is/hex.ts#L24)*
*__name__*: isHex
*__signature__*: isHex (value: any, bitLength: number = -1): boolean
*__summary__*: Tests for a hex string.
*__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.
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **isInstanceOf**(value: *`any`*, clazz: *`any`*): `boolean`
*Defined in [is/instanceOf.ts:20](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/is/instanceOf.ts#L20)*
*Defined in [is/instanceOf.ts:19](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/is/instanceOf.ts#L19)*
*__name__*: isInstanceOf
*__signature__*: isInstanceOf (value: any, clazz: Class): boolean
*__summary__*: Tests for a instance of a class.
*__description__*: Checks to see if the input value is an instance of the test class.
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **isIp**(value: *`string`*, type?: *`IpTypes`*): `boolean`
*Defined in [is/ip.ts:27](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/is/ip.ts#L27)*
*Defined in [is/ip.ts:26](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/is/ip.ts#L26)*
*__name__*: isIp
*__signature__*: isIp (value: string, type?: 'v4' | 'v6'): boolean
*__summary__*: Tests if the value is a valid IP address
*__description__*: Checks to see if the value is a valid IP address. Optionally check for either v4/v6
+2
View File
@@ -0,0 +1,2 @@
+3 -5
View File
@@ -6,14 +6,12 @@
## isNull
▸ **isNull**(value: *`any`*): `boolean`
▸ **isNull**(value?: *`any`*): `boolean`
*Defined in [is/null.ts:20](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/is/null.ts#L20)*
*Defined in [is/null.ts:19](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/is/null.ts#L19)*
*__name__*: isNull
*__signature__*: isNull (value: any): boolean
*__summary__*: Tests for a `null` values.
*__description__*: Checks to see if the input value is `null`.
@@ -30,7 +28,7 @@ console.log('isNull', isNull(null)); // => true
| Name | Type |
| ------ | ------ |
| value | `any` |
| `Optional` value | `any` |
**Returns:** `boolean`
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **isNumber**(value: *`any`*): `boolean`
*Defined in [is/number.ts:20](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/is/number.ts#L20)*
*Defined in [is/number.ts:19](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/is/number.ts#L19)*
*__name__*: isNumber
*__signature__*: isNumber (value: any): boolean
*__summary__*: Tests for a JavaScript number.
*__description__*: Checks to see if the input value is a valid number.
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **isObject**(value: *`any`*): `boolean`
*Defined in [is/object.ts:25](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/is/object.ts#L25)*
*Defined in [is/object.ts:24](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/is/object.ts#L24)*
*__name__*: isObject
*__signature__*: isObject (value: any): boolean
*__summary__*: Tests for an `object`.
*__description__*: Checks to see if the input value is a JavaScript object.
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **isObservable**(value: *`any`*): `boolean`
*Defined in [is/observable.ts:27](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/is/observable.ts#L27)*
*Defined in [is/observable.ts:26](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/is/observable.ts#L26)*
*__name__*: isBObservable
*__signature__*: isObservable (value: any): boolean
*__summary__*: Tests for a `Observable` object instance.
*__description__*: Checks to see if the input object is an instance of `BN` (bn.js).
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **isString**(value: *`any`*): `boolean`
*Defined in [is/string.ts:20](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/is/string.ts#L20)*
*Defined in [is/string.ts:19](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/is/string.ts#L19)*
*__name__*: isString
*__signature__*: isString (value: any): boolean
*__summary__*: Tests for a string.
*__description__*: Checks to see if the input value is a JavaScript string.
+2
View File
@@ -0,0 +1,2 @@
+3 -5
View File
@@ -6,14 +6,12 @@
## isU8a
▸ **isU8a**(value: *`any`*): `boolean`
▸ **isU8a**(value?: *`any`*): `boolean`
*Defined in [is/u8a.ts:22](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/is/u8a.ts#L22)*
*Defined in [is/u8a.ts:21](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/is/u8a.ts#L21)*
*__name__*: isU8a
*__signature__*: isU8a (value: any): boolean
*__summary__*: Tests for a `Uint8Array` object instance.
*__description__*: Checks to see if the input object is an instance of `Uint8Array`.
@@ -30,7 +28,7 @@ console.log('isU8a', isU8a([])); // => false
| Name | Type |
| ------ | ------ |
| value | `any` |
| `Optional` value | `any` |
**Returns:** `boolean`
+2
View File
@@ -0,0 +1,2 @@
+3 -5
View File
@@ -6,14 +6,12 @@
## isUndefined
▸ **isUndefined**(value: *`any`*): `boolean`
▸ **isUndefined**(value?: *`any`*): `boolean`
*Defined in [is/undefined.ts:20](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/is/undefined.ts#L20)*
*Defined in [is/undefined.ts:19](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/is/undefined.ts#L19)*
*__name__*: isUndefined
*__signature__*: isUndefined (value: any): boolean
*__summary__*: Tests for a `undefined` values.
*__description__*: Checks to see if the input value is `undefined`.
@@ -30,7 +28,7 @@ console.log('isUndefined', isUndefined(void(0))); // => true
| Name | Type |
| ------ | ------ |
| value | `any` |
| `Optional` value | `any` |
**Returns:** `boolean`
+2
View File
@@ -0,0 +1,2 @@
+2 -4
View File
@@ -8,7 +8,7 @@
▸ **format**(value: *`any`*): `any`
*Defined in [logger.ts:42](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/logger.ts#L42)*
*Defined in [logger.ts:42](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/logger.ts#L42)*
**Parameters:**
@@ -25,12 +25,10 @@ ___
▸ **logger**(_type: *`string`*): [Logger](_types_.md#logger)
*Defined in [logger.ts:105](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/logger.ts#L105)*
*Defined in [logger.ts:104](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/logger.ts#L104)*
*__name__*: Logger
*__signature__*: logger (type: string): Logger
*__summary__*: Creates a consistent log interface for messages
*__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.
+2
View File
@@ -0,0 +1,2 @@
+3 -5
View File
@@ -6,14 +6,12 @@
## numberToHex
▸ **numberToHex**(value?: *`undefined` | `number`*, bitLength?: *`number`*): `string`
▸ **numberToHex**(value?: *`number` | `null`*, bitLength?: *`number`*): `string`
*Defined in [number/toHex.ts:25](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/number/toHex.ts#L25)*
*Defined in [number/toHex.ts:24](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/number/toHex.ts#L24)*
*__name__*: numberToHex
*__signature__*: numberToHex (value?: number): string
*__summary__*: Creates a hex value from a number.
*__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.
@@ -31,7 +29,7 @@ numberToHex(0x1234, 32); // => 0x00001234
| Name | Type | Default value |
| ------ | ------ | ------ |
| `Optional` value | `undefined` | `number` | - |
| `Optional` value | `number` | `null` | - |
| `Default value` bitLength | `number` | -1 |
**Returns:** `string`
+2
View File
@@ -0,0 +1,2 @@
+3 -5
View File
@@ -6,14 +6,12 @@
## numberToU8a
▸ **numberToU8a**(value?: *`undefined` | `number`*, bitLength?: *`number`*): `Uint8Array`
▸ **numberToU8a**(value?: *`number` | `null`*, bitLength?: *`number`*): `Uint8Array`
*Defined in [number/toU8a.ts:23](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/number/toU8a.ts#L23)*
*Defined in [number/toU8a.ts:22](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/number/toU8a.ts#L22)*
*__name__*: numberToU8a
*__signature__*: numberToU8a (value?: number, bitLenght: number = -1): Uint8Array
*__summary__*: Creates a Uint8Array object from a number.
*__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.
@@ -30,7 +28,7 @@ numberToU8a(0x1234); // => [0x12, 0x34]
| Name | Type | Default value |
| ------ | ------ | ------ |
| `Optional` value | `undefined` | `number` | - |
| `Optional` value | `number` | `null` | - |
| `Default value` bitLength | `number` | -1 |
**Returns:** `Uint8Array`
+2
View File
@@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **promisify**(self: *`any`*, fn: *`Function`*, ...params: *`Array`<`any`>*): `Promise`<`any`>
*Defined in [promisify.ts:21](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/promisify.ts#L21)*
*Defined in [promisify.ts:20](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/promisify.ts#L20)*
*__name__*: promisify
*__signature__*: function promisify (this: ?Object, fn: Function, ...params: Array): Promise
*__summary__*: Wraps an async callback into a `Promise`
*__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.
+2
View File
@@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
+3 -5
View File
@@ -6,14 +6,12 @@
## stringLowerFirst
▸ **stringLowerFirst**(_value: *`string`*): `string`
▸ **stringLowerFirst**(value?: *`string` | `null`*): `string`
*Defined in [string/lowerFirst.ts:23](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/string/lowerFirst.ts#L23)*
*Defined in [string/lowerFirst.ts:19](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/string/lowerFirst.ts#L19)*
*__name__*: stringLowerFirst
*__signature__*: stringLowerFirst (\_value: string): string
*__summary__*: Lowercase the first letter of a string
*__description__*: Lowercase the first letter of a string
@@ -30,7 +28,7 @@ stringLowerFirst('ABC'); // => 'aBC'
| Name | Type |
| ------ | ------ |
| _value | `string` |
| `Optional` value | `string` | `null` |
**Returns:** `string`
@@ -0,0 +1,2 @@
+3 -5
View File
@@ -6,14 +6,12 @@
## stringShorten
▸ **stringShorten**(_value: *`any`*, prefixLength?: *`number`*): `string`
▸ **stringShorten**(_value?: *`any`*, prefixLength?: *`number`*): `string`
*Defined in [string/shorten.ts:20](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/string/shorten.ts#L20)*
*Defined in [string/shorten.ts:19](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/string/shorten.ts#L19)*
*__name__*: stringShorten
*__signature__*: stringShorten (value: any, prefixLength: number = 8): string
*__summary__*: Returns a string with maximum length
*__description__*: Checks the string against the `prefixLength`, if longer than dopuble this, shortens it by placing `..` in the middle of it
@@ -30,7 +28,7 @@ stringShorten('1234567890', 2); // => 12..90
| Name | Type | Default value |
| ------ | ------ | ------ |
| _value | `any` | - |
| `Optional` _value | `any` | - |
| `Default value` prefixLength | `number` | 6 |
**Returns:** `string`
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **stringToU8a**(value?: *`undefined` | `string`*): `Uint8Array`
*Defined in [string/toU8a.ts:40](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/string/toU8a.ts#L40)*
*Defined in [string/toU8a.ts:39](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/string/toU8a.ts#L39)*
*__name__*: stringToU8a
*__signature__*: stringToU8a (value?: string): UInt8Array
*__summary__*: Creates a Uint8Array object from a utf-8 string.
*__description__*: String input values return the actual encoded `UInt8Array`. `null` or `undefined` values returns an empty encoded array.
+2
View File
@@ -0,0 +1,2 @@
+3 -5
View File
@@ -6,14 +6,12 @@
## stringUpperFirst
▸ **stringUpperFirst**(_value: *`string`*): `string`
▸ **stringUpperFirst**(value?: *`string` | `null`*): `string`
*Defined in [string/upperFirst.ts:23](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/string/upperFirst.ts#L23)*
*Defined in [string/upperFirst.ts:19](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/string/upperFirst.ts#L19)*
*__name__*: stringUpperFirst
*__signature__*: stringUpperFirst (\_value: string): string
*__summary__*: Lowercase the first letter of a string
*__description__*: Lowercase the first letter of a string
@@ -30,7 +28,7 @@ stringUpperFirst('abc'); // => 'Abc'
| Name | Type |
| ------ | ------ |
| _value | `string` |
| `Optional` value | `string` | `null` |
**Returns:** `string`
@@ -0,0 +1,2 @@
+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/06cc692/packages/util/src/syncify.ts#L11)*
*Defined in [syncify.ts:11](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/syncify.ts#L11)*
**Parameters:**
+2
View File
@@ -0,0 +1,2 @@
+2 -2
View File
@@ -22,7 +22,7 @@
**Ƭ Logger**: *`object`*
*Defined in [types.ts:15](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/types.ts#L15)*
*Defined in [types.ts:15](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/types.ts#L15)*
#### Type declaration
@@ -33,7 +33,7 @@ ___
**Ƭ Logger$Data**: *`Array`<`any` | `Logger$Data$Fn`>*
*Defined in [types.ts:13](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/types.ts#L13)*
*Defined in [types.ts:13](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/types.ts#L13)*
___
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **u8aConcat**(..._list: *`Array`<`Uint8Array` | `string`>*): `Uint8Array`
*Defined in [u8a/concat.ts:25](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/u8a/concat.ts#L25)*
*Defined in [u8a/concat.ts:24](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/u8a/concat.ts#L24)*
*__name__*: u8aConcat
*__signature__*: u8aConcat (...values: Array<Uint8Array | string>): Uint8Array
*__summary__*: Creates a concatenated Uint8Array from the inputs.
*__description__*: Concatenates the input arrays into a single `UInt8Array`.
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **u8aFixLength**(value: *`Uint8Array`*, bitLength?: *`number`*, atStart?: *`boolean`*): `Uint8Array`
*Defined in [u8a/fixLength.ts:22](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/u8a/fixLength.ts#L22)*
*Defined in [u8a/fixLength.ts:21](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/u8a/fixLength.ts#L21)*
*__name__*: u8aFixLength
*__signature__*: u8aFixLength (value: string, bitLength: number = -1, withPadding: boolean = false): string
*__summary__*: Shifts a Uint8Array to a specific bitLength
*__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.
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **u8aToBn**(value: *`Uint8Array`*, options?: *[ToBnOptions](../interfaces/_types_.tobnoptions.md) | `boolean`*): `BN`
*Defined in [u8a/toBn.ts:30](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/u8a/toBn.ts#L30)*
*Defined in [u8a/toBn.ts:29](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/u8a/toBn.ts#L29)*
*__name__*: u8aToBn
*__signature__*: u8aToHex (value?: Uint8Array, options: ToBnOptions | boolean = { isLe: true, isNegative: false }): BN
*__summary__*: Creates a BN from a Uint8Array object.
*__description__*: `UInt8Array` input values return the actual BN. `null` or `undefined` values returns an `0x0` value.
+3 -5
View File
@@ -6,14 +6,12 @@
## u8aToBuffer
▸ **u8aToBuffer**(value?: *`Uint8Array`*): `Buffer`
▸ **u8aToBuffer**(value?: *`Uint8Array` | `null`*): `Buffer`
*Defined in [u8a/toBuffer.ts:20](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/u8a/toBuffer.ts#L20)*
*Defined in [u8a/toBuffer.ts:19](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/u8a/toBuffer.ts#L19)*
*__name__*: u8aToBuffer
*__signature__*: u8aToBuffer (value?: UInt8Array): Buffer
*__summary__*: Creates a Buffer object from a hex string.
*__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.
@@ -30,7 +28,7 @@ console.log('Buffer', u8aToBuffer('0x123480001f'));
| Name | Type |
| ------ | ------ |
| `Optional` value | `Uint8Array` |
| `Optional` value | `Uint8Array` | `null` |
**Returns:** `Buffer`
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **u8aToHex**(value?: *`Uint8Array` | `null`*, bitLength?: *`number`*, isPrefixed?: *`boolean`*): `string`
*Defined in [u8a/toHex.ts:22](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/u8a/toHex.ts#L22)*
*Defined in [u8a/toHex.ts:21](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/u8a/toHex.ts#L21)*
*__name__*: u8aToHex
*__signature__*: u8aToHex (value?: UInt8Array): string
*__summary__*: Creates a hex string from a Uint8Array object.
*__description__*: `UInt8Array` input values return the actual hex string. `null` or `undefined` values returns an `0x` string.
+2
View File
@@ -0,0 +1,2 @@
+3 -5
View File
@@ -6,14 +6,12 @@
## u8aToString
▸ **u8aToString**(value?: *`Uint8Array`*): `string`
▸ **u8aToString**(value?: *`Uint8Array` | `null`*): `string`
*Defined in [u8a/toString.ts:36](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/u8a/toString.ts#L36)*
*Defined in [u8a/toString.ts:35](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/u8a/toString.ts#L35)*
*__name__*: u8aToString
*__signature__*: u8aToString (value?: UInt8Array): string
*__summary__*: Creates a utf-8 string from a Uint8Array object.
*__description__*: `UInt8Array` input values return the actual decoded utf-8 string. `null` or `undefined` values returns an empty string.
@@ -30,7 +28,7 @@ u8aToString(new Uint8Array([0x68, 0x65, 0x6c, 0x6c, 0x6f])); // hello
| Name | Type |
| ------ | ------ |
| `Optional` value | `Uint8Array` |
| `Optional` value | `Uint8Array` | `null` |
**Returns:** `string`
+2
View File
@@ -0,0 +1,2 @@
+1 -3
View File
@@ -8,12 +8,10 @@
▸ **u8aToU8a**(value?: *`Array`<`number`> | `Buffer` | `Uint8Array` | `string` | `null`*): `Uint8Array`
*Defined in [u8a/toU8a.ts:28](https://github.com/polkadot-js/common/blob/06cc692/packages/util/src/u8a/toU8a.ts#L28)*
*Defined in [u8a/toU8a.ts:27](https://github.com/polkadot-js/common/blob/1e6eb2c/packages/util/src/u8a/toU8a.ts#L27)*
*__name__*: u8aToU8a
*__signature__*: u8aToU8a (value?: Array | Buffer | Uint8Array | string | null): Uint8Array
*__summary__*: Creates a Uint8Array value from a Uint8Array bignumber or hex input.
*__description__*: `null` inputs returns a `[]` result, Uint8Array values returns the value, hex strings returns a Uint8Array representation.
+2
View File
@@ -0,0 +1,2 @@