Fix alias links (#34)

* Fix alias links

* Update alias links

* Update generated docs
This commit is contained in:
Jaco Greeff
2017-12-01 20:34:51 +01:00
committed by GitHub
parent 4c6a3d94e7
commit 5d0a7231dc
34 changed files with 108 additions and 259 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
{
"extends": "@polkadot/dev/.babelrc"
"extends": "@polkadot/dev/config/babel"
}
+2
View File
@@ -0,0 +1,2 @@
exclude_patterns:
- "**/*.spec.js"
-1
View File
@@ -1 +0,0 @@
service_name: travis-pro
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": [
"./node_modules/@polkadot/dev/.eslintrc.json"
"./node_modules/@polkadot/dev/config/eslint.js"
]
}
-3
View File
@@ -7,6 +7,3 @@
./node_modules/@polkadot/dev/flow-typed
[options]
esproposal.decorators=ignore
module.ignore_non_literal_requires=true
unsafe.enable_getters_and_setters=true
-3
View File
@@ -1,3 +0,0 @@
{
"extends": "@polkadot/dev/.stylelintrc.json"
}
+1 -1
View File
@@ -8,6 +8,6 @@ cache:
before_install:
- npm install --global yarn --cache-min 999999999
install:
- yarn
- yarn install
script:
- yarn polkadot-dev-build-travis
+10 -10
View File
@@ -1,16 +1,16 @@
![ISC](https://img.shields.io/badge/license-ISC-lightgrey.svg)
[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg)](https://github.com/Flet/semistandard)
[![npm (scoped)](https://img.shields.io/npm/v/@polkadot/util.svg)](https://www.npmjs.com/package/@polkadot/util)
[![Build Status](https://travis-ci.org/polkadot-js/util.svg?branch=master)](https://travis-ci.org/polkadot-js/util)
[![Maintainability](https://api.codeclimate.com/v1/badges/ab7b7cd7a0485a04693f/maintainability)](https://codeclimate.com/github/polkadot-js/util/maintainability)
[![Coverage Status](https://coveralls.io/repos/github/polkadot-js/util/badge.svg?branch=master)](https://coveralls.io/github/polkadot-js/util?branch=master)
[![Greenkeeper badge](https://badges.greenkeeper.io/polkadot-js/util.svg)](https://greenkeeper.io/)
[![Dependency Status](https://david-dm.org/polkadot-js/util.svg)](https://david-dm.org/polkadot-js/util)
[![devDependency Status](https://david-dm.org/polkadot-js/util/dev-status.svg)](https://david-dm.org/polkadot-js/util#info=devDependencies)
![isc](https://img.shields.io/badge/license-ISC-lightgrey.svg?style=flat-square)
[![style](https://img.shields.io/badge/code%20style-semistandard-lightgrey.svg?style=flat-square)](https://github.com/Flet/semistandard)
[![npm](https://img.shields.io/npm/v/@polkadot/util.svg?style=flat-square)](https://www.npmjs.com/package/@polkadot/util)
[![travis](https://img.shields.io/travis/polkadot-js/util.svg?style=flat-square)](https://travis-ci.org/polkadot-js/util)
[![maintainability](https://img.shields.io/codeclimate/maintainability/polkadot-js/util.svg?style=flat-square)](https://codeclimate.com/github/polkadot-js/util/maintainability)
[![coverage](https://img.shields.io/coveralls/polkadot-js/util.svg?style=flat-square)](https://coveralls.io/github/polkadot-js/util?branch=master)
[![greenkeeper](https://img.shields.io/badge/greenkeeper-enabled-brightgreen.svg?style=flat-square)](https://greenkeeper.io/)
[![dependency](https://img.shields.io/david/polkadot-js/util.svg?style=flat-square)](https://david-dm.org/polkadot-js/util)
[![devDependency](https://img.shields.io/david/dev/polkadot-js/util.svg?style=flat-square)](https://david-dm.org/polkadot-js/util#info=devDependencies)
# @polkadot/util
Various useful utility functions that are used across all projects in the @polkadot namespace. It provides utility functions with additional safety checks, allowing not only for consistent coding, but also reducing the general boilerplate.
Various useful utility functions that are used across all projects in the [@polkadot](https://polkadot.js.org) namespace. It provides utility functions with additional safety checks, allowing not only for consistent coding, but also reducing the general boilerplate.
## Usage
+1 -1
View File
@@ -16,7 +16,7 @@ Utility methods for this package are split into groups
## Logger
Creates a consistent log interface for messages
Creates a consistent log interface for messages
```js
logger (type: string): Logger
+3 -3
View File
@@ -2,12 +2,12 @@
Utility methods to convert to and from `BN` objects
- [bnFromHex](#bnfromhex) Creates a BN.js bignumber object from a hex string. [hex.md#hextobn](alias hexToBn)
- [bnFromHex](#bnfromhex) Creates a BN.js bignumber object from a hex string.
- [bnToHex](#bntohex) Creates a hex value from a BN.js bignumber object.
## bnFromHex
Creates a BN.js bignumber object from a hex string. [hex.md#hextobn](alias hexToBn)
Creates a BN.js bignumber object from a hex string. [(alias of hexToBn)](hex.md#hextobn)
```js
bnFromHex (value?: string): BN
@@ -19,7 +19,7 @@ bnFromHex (value?: string): BN
## bnToHex
Creates a hex value from a BN.js bignumber object.
Creates a hex value from a BN.js bignumber object.
```js
bnToHex (value?: BN): string
+9 -9
View File
@@ -2,16 +2,16 @@
Utility methods to convert to and from `Buffer` objects
- [bufferFromHex](#bufferfromhex) Creates a Buffer object from a hex string. [hex.md#hextobuffer](alias hexToBuffer)
- [bufferFromNumber](#bufferfromnumber) Creates a Buffer object from a number. [number.md#numbertobuffer](alias numberToBuffer)
- [bufferFromU8a](#bufferfromu8a) Creates a Buffer object from a Uint8Array. [u8a.md#u8atobuffer](alias u8aToBuffer)
- [bufferFromHex](#bufferfromhex) Creates a Buffer object from a hex string.
- [bufferFromNumber](#bufferfromnumber) Creates a Buffer object from a number.
- [bufferFromU8a](#bufferfromu8a) Creates a Buffer object from a Uint8Array.
- [bufferToHex](#buffertohex) Creates a hex value from a Buffer object.
- [bufferToNumber](#buffertonumber) Creates a Number value from a Buffer object.
- [bufferToU8a](#buffertou8a) Creates a Uint8Array value from a Buffer object.
## bufferFromHex
Creates a Buffer object from a hex string. [hex.md#hextobuffer](alias hexToBuffer)
Creates a Buffer object from a hex string. [(alias of hexToBuffer)](hex.md#hextobuffer)
```js
bufferFromHex (value?: string): Buffer
@@ -23,7 +23,7 @@ bufferFromHex (value?: string): Buffer
## bufferFromNumber
Creates a Buffer object from a number. [number.md#numbertobuffer](alias numberToBuffer)
Creates a Buffer object from a number. [(alias of numberToBuffer)](number.md#numbertobuffer)
```js
bufferFromNumber (value?: number): Buffer
@@ -35,7 +35,7 @@ bufferFromNumber (value?: number): Buffer
## bufferFromU8a
Creates a Buffer object from a Uint8Array. [u8a.md#u8atobuffer](alias u8aToBuffer)
Creates a Buffer object from a Uint8Array. [(alias of u8aToBuffer)](u8a.md#u8atobuffer)
```js
bufferFromU8a (value?: string): Buffer
@@ -47,7 +47,7 @@ bufferFromU8a (value?: string): Buffer
## bufferToHex
Creates a hex value from a Buffer object.
Creates a hex value from a Buffer object.
```js
bufferToHex (value?: Buffer): string
@@ -64,7 +64,7 @@ console.log('Hex value', bufferToHex(Buffer.from([1, 2, 3]));
## bufferToNumber
Creates a Number value from a Buffer object.
Creates a Number value from a Buffer object.
```js
bufferToNumber (value?: Buffer): number
@@ -81,7 +81,7 @@ bufferToNumber(Buffer.from([12, 34, 56])); // => 0x123456
## bufferToU8a
Creates a Uint8Array value from a Buffer object.
Creates a Uint8Array value from a Buffer object.
```js
bufferToU8a (value?: Buffer): string
+1 -1
View File
@@ -6,7 +6,7 @@ Extensions to basic classes
## ExtError
Extension to the basic JS Error.
Extension to the basic JS Error.
```js
ExtError (message: string = '', code: number = UNKNOWN_ERROR, value: any)
+12 -12
View File
@@ -3,9 +3,9 @@
Internal utilities to create and test for hex values
- [hexAddPrefix](#hexaddprefix) Adds the `0x` prefix to string values.
- [hexFromBn](#hexfrombn) Creates a hex value from a BN.js bignumber object. [bn.md#bntohex](alias bnToHex)
- [hexFromBn](#hexfrombn) Creates a hex value from a Buffer object. [buffer.md#buffertohex](alias bufferToHex)
- [hexFromNumber](#hexfromnumber) Creates a hex value from a number. [number.md#numbertohex](alias numberToHex)
- [hexFromBn](#hexfrombn) Creates a hex value from a BN.js bignumber object.
- [hexFromBn](#hexfrombn) Creates a hex value from a Buffer object.
- [hexFromNumber](#hexfromnumber) Creates a hex value from a number.
- [hexHasPrefix](#hexhasprefix) Tests for the existence of a `0x` prefix.
- [hexStripPrefix](#hexstripprefix) Strips any leading `0x` prefix.
- [hexToBn](#hextobn) Creates a BN.js bignumber object from a hex string.
@@ -14,7 +14,7 @@ Internal utilities to create and test for hex values
## hexAddPrefix
Adds the `0x` prefix to string values.
Adds the `0x` prefix to string values.
```js
hexAddPrefix (value: ?string): string
@@ -31,7 +31,7 @@ console.log('With prefix', hexAddPrefix('0a0b12')) // => 0x0a0b12
## hexFromBn
Creates a hex value from a BN.js bignumber object. [bn.md#bntohex](alias bnToHex)
Creates a hex value from a BN.js bignumber object. [(alias of bnToHex)](bn.md#bntohex)
```js
hexFromBn (value?: BN): string
@@ -43,7 +43,7 @@ hexFromBn (value?: BN): string
## hexFromBn
Creates a hex value from a Buffer object. [buffer.md#buffertohex](alias bufferToHex)
Creates a hex value from a Buffer object. [(alias of bufferToHex)](buffer.md#buffertohex)
```js
hexFromBuffer (value?: Buffer): string
@@ -55,7 +55,7 @@ hexFromBuffer (value?: Buffer): string
## hexFromNumber
Creates a hex value from a number. [number.md#numbertohex](alias numberToHex)
Creates a hex value from a number. [(alias of numberToHex)](number.md#numbertohex)
```js
hexFromNumber (value?: number): string
@@ -67,7 +67,7 @@ hexFromNumber (value?: number): string
## hexHasPrefix
Tests for the existence of a `0x` prefix.
Tests for the existence of a `0x` prefix.
```js
hexHasPrefix (value: ?string): boolean
@@ -84,7 +84,7 @@ console.log('has prefix', hexHasPrefix('0x1234')); // => true
## hexStripPrefix
Strips any leading `0x` prefix.
Strips any leading `0x` prefix.
```js
hexStripPrefix (value: ?string): string
@@ -101,7 +101,7 @@ console.log('stripped', hexStripPrefix('0x1234')); // => 1234
## hexToBn
Creates a BN.js bignumber object from a hex string.
Creates a BN.js bignumber object from a hex string.
```js
hexToBn (value?: string): BN
@@ -118,7 +118,7 @@ console.log('BN object', hexToBn('0x123480001f'));
## hexToBuffer
Creates a Buffer object from a hex string.
Creates a Buffer object from a hex string.
```js
hexToBuffer (value?: string): Buffer
@@ -135,7 +135,7 @@ console.log('Buffer object', hexToBuffer('0x123480001f'));
## hexToNumber
Creates a Number value from a Buffer object.
Creates a Number value from a Buffer object.
```js
hexToNumber (value?: Hex): number
+11 -11
View File
@@ -16,7 +16,7 @@ Type checking utilities
## isBN
Tests for a `BN` object instance.
Tests for a `BN` object instance.
```js
isBN (value: any): boolean
@@ -34,7 +34,7 @@ console.log('isBN', isBN(new BN(1))); // => true
## isBuffer
Tests for a `Buffer` object instance.
Tests for a `Buffer` object instance.
```js
isBuffer (value: any): boolean
@@ -51,7 +51,7 @@ console.log('isBuffer', isBuffer(Buffer.from([]))); // => true
## isError
Tests for a `Error` object instance.
Tests for a `Error` object instance.
```js
isError (value: any): boolean
@@ -68,7 +68,7 @@ console.log('isError', isError(new Error('message'))); // => true
## isFunction
Tests for a `function`.
Tests for a `function`.
```js
isFunction (value: any): boolean
@@ -85,7 +85,7 @@ console.log('isFunction', isFunction(() => false)); // => true
## isHex
Tests for a hex string.
Tests for a hex string.
```js
isHex (value: any): boolean
@@ -102,7 +102,7 @@ console.log('isHex', isHex('0x1234')); // => true
## isInstanceOf
Tests for a instance of a class.
Tests for a instance of a class.
```js
isInstanceOf (value: any, clazz: any): boolean
@@ -119,7 +119,7 @@ console.log('isinstanceOf', isInstanceOf(new Array(0), Array)); // => true
## isNull
Tests for a `null` values.
Tests for a `null` values.
```js
isNull (value: any): boolean
@@ -136,7 +136,7 @@ console.log('isNull', isNull(null)); // => true
## isNumber
Tests for a JavaScript number.
Tests for a JavaScript number.
```js
isNumber (value: any): boolean
@@ -153,7 +153,7 @@ console.log('isNumber', isNumber(1234)); // => true
## isString
Tests for a string.
Tests for a string.
```js
isString (value: any): boolean
@@ -170,7 +170,7 @@ console.log('isString', isString('test')); // => true
## isUint8Array
Tests for a `Uint8Array` object instance.
Tests for a `Uint8Array` object instance.
```js
isUint8Array (value: any): boolean
@@ -187,7 +187,7 @@ console.log('isUint8Array', isUint8Array([])); // => false
## isUndefined
Tests for a `undefined` values.
Tests for a `undefined` values.
```js
isUndefined (value: any): boolean
+1 -1
View File
@@ -6,7 +6,7 @@ Convenience functions for values from @polkadot/api-jsonrpc
## jsonrpcSignature
Returns a string representation of the method with inputs and outputs.
Returns a string representation of the method with inputs and outputs.
```js
jsonrpcSignature (name: string, _inputs: Array<InterfaceInputType>, _output: InterfaceOutputType): string
+3 -3
View File
@@ -8,7 +8,7 @@ Create Keccak256 values as hex, string & buffer output
## keccakAsBuffer
Creates a keccak Buffer from the input.
Creates a keccak Buffer from the input.
```js
keccakAsBuffer (value: Buffer | string): Buffer
@@ -25,7 +25,7 @@ console.log('asBuffer', keccakAsBuffer('123')) // => Buffer
## keccakAsHex
Creates a keccak hex string from the input.
Creates a keccak hex string from the input.
```js
keccakAsHex (value: Buffer | string): string
@@ -42,7 +42,7 @@ console.log('asHex', keccakAsHex('123')) // => 0x...
## keccakAsString
Creates a keccak string from the input.
Creates a keccak string from the input.
```js
keccakAsString (value: Buffer | string): string
+6 -6
View File
@@ -2,14 +2,14 @@
Utility methods to convert to and from `number` values
- [numberFromBuffer](#numberfrombuffer) Creates a Number value from a Buffer object. [buffer.md#buffertonumber](alias bufferToNumber)
- [numberFromHex](#numberfromhex) Creates a Number value from a Buffer object. [buffer.md#hextonumber](alias hexToNumber)
- [numberFromBuffer](#numberfrombuffer) Creates a Number value from a Buffer object.
- [numberFromHex](#numberfromhex) Creates a Number value from a Buffer object.
- [numberToBuffer](#numbertobuffer) Creates a Buffer object from a number.
- [numberToHex](#numbertohex) Creates a hex value from a number.
## numberFromBuffer
Creates a Number value from a Buffer object. [buffer.md#buffertonumber](alias bufferToNumber)
Creates a Number value from a Buffer object. [(alias of bufferToNumber)](buffer.md#buffertonumber)
```js
numberFromBuffer (value?: Buffer): number
@@ -21,7 +21,7 @@ numberFromBuffer (value?: Buffer): number
## numberFromHex
Creates a Number value from a Buffer object. [buffer.md#hextonumber](alias hexToNumber)
Creates a Number value from a Buffer object. [(alias of hexToNumber)](hex.md#hextonumber)
```js
numberFromHex (value?: Hex): number
@@ -33,7 +33,7 @@ numberFromHex (value?: Hex): number
## numberToBuffer
Creates a Buffer object from a number.
Creates a Buffer object from a number.
```js
numberToBuffer (value?: number): Buffer
@@ -50,7 +50,7 @@ const buffer = numberToBuffer('0x1234'); // => Buffer.from([0x12, 0x34])
## numberToHex
Creates a hex value from a number.
Creates a hex value from a number.
```js
numberToHex (value?: number): string
+3 -3
View File
@@ -2,12 +2,12 @@
Utility methods to convert to and from `Uint8Array` objects
- [u8aFromBuffer](#u8afrombuffer) Creates a Uint8Array value from a Buffer object. [buffer.md#buffertou8a](alias bufferToU8a)
- [u8aFromBuffer](#u8afrombuffer) Creates a Uint8Array value from a Buffer object.
- [u8aToBuffer](#u8atobuffer) Creates a Buffer object from a hex string.
## u8aFromBuffer
Creates a Uint8Array value from a Buffer object. [buffer.md#buffertou8a](alias bufferToU8a)
Creates a Uint8Array value from a Buffer object. [(alias of bufferToU8a)](buffer.md#buffertou8a)
```js
u8aFromBuffer (value?: Buffer): number
@@ -19,7 +19,7 @@ u8aFromBuffer (value?: Buffer): number
## u8aToBuffer
Creates a Buffer object from a hex string.
Creates a Buffer object from a hex string.
```js
u8aToBuffer (value?: UInt8Array): Buffer
+1 -1
View File
@@ -1 +1 @@
module.exports = require('@polkadot/dev/jest.config');
module.exports = require('@polkadot/dev/config/jest');
+2 -2
View File
@@ -26,11 +26,11 @@
"scripts": {
"build": "polkadot-dev-build-babel && polkadot-dev-build-docs",
"check": "eslint src && flow check",
"test": "jest --coverage src"
"test": "jest src"
},
"devDependencies": {
"@polkadot/api-jsonrpc": "^0.5.5",
"@polkadot/dev": "^0.11.1"
"@polkadot/dev": "^0.12.4"
},
"dependencies": {
"babel-runtime": "^6.26.0",
+2 -1
View File
@@ -6,6 +6,7 @@ const bnFromHex = require('../hex/toBn');
/**
@name bnFromHex
@signature bnFromHex (value?: string): BN
@summary Creates a BN.js bignumber object from a hex string. [hex.md#hextobn](alias hexToBn)
@summary Creates a BN.js bignumber object from a hex string.
@alias hex/toBn
*/
module.exports = bnFromHex;
+2 -1
View File
@@ -6,6 +6,7 @@ const bufferFromHex = require('../hex/toBuffer');
/**
@name bufferFromHex
@signature bufferFromHex (value?: string): Buffer
@summary Creates a Buffer object from a hex string. [hex.md#hextobuffer](alias hexToBuffer)
@summary Creates a Buffer object from a hex string.
@alias hex/toBuffer
*/
module.exports = bufferFromHex;
+2 -1
View File
@@ -6,6 +6,7 @@ const bufferFromNumber = require('../number/toBuffer');
/**
@name bufferFromNumber
@signature bufferFromNumber (value?: number): Buffer
@summary Creates a Buffer object from a number. [number.md#numbertobuffer](alias numberToBuffer)
@summary Creates a Buffer object from a number.
@alias number/toBuffer
*/
module.exports = bufferFromNumber;
+2 -1
View File
@@ -6,6 +6,7 @@ const bufferFromU8a = require('../u8a/toBuffer');
/**
@name bufferFromU8a
@signature bufferFromU8a (value?: string): Buffer
@summary Creates a Buffer object from a Uint8Array. [u8a.md#u8atobuffer](alias u8aToBuffer)
@summary Creates a Buffer object from a Uint8Array.
@alias u8a/toBuffer
*/
module.exports = bufferFromU8a;
+2 -1
View File
@@ -6,6 +6,7 @@ const hexFromBn = require('../bn/toHex');
/**
@name hexFromBn
@signature hexFromBn (value?: BN): string
@summary Creates a hex value from a BN.js bignumber object. [bn.md#bntohex](alias bnToHex)
@summary Creates a hex value from a BN.js bignumber object.
@alias bn/toHex
*/
module.exports = hexFromBn;
+2 -1
View File
@@ -6,6 +6,7 @@ const hexFromBuffer = require('../bn/toHex');
/**
@name hexFromBn
@signature hexFromBuffer (value?: Buffer): string
@summary Creates a hex value from a Buffer object. [buffer.md#buffertohex](alias bufferToHex)
@summary Creates a hex value from a Buffer object.
@alias buffer/toHex
*/
module.exports = hexFromBuffer;
+2 -1
View File
@@ -6,6 +6,7 @@ const hexFromNumber = require('../number/toHex');
/**
@name hexFromNumber
@signature hexFromNumber (value?: number): string
@summary Creates a hex value from a number. [number.md#numbertohex](alias numberToHex)
@summary Creates a hex value from a number.
@alias number/toHex
*/
module.exports = hexFromNumber;
+2 -1
View File
@@ -9,11 +9,12 @@ const is = require('./is');
const jsonrpc = require('./jsonrpc');
const keccak = require('./keccak');
const logger = require('./logger');
const number = require('./number');
const u8a = require('./u8a');
/**
@summary Utility methods for this package are split into groups
*/
module.exports = Object.assign(
{}, bn, buffer, ext, hex, is, jsonrpc, keccak, { logger }, u8a
{}, bn, buffer, ext, hex, is, jsonrpc, keccak, { logger }, number, u8a
);
+7 -18
View File
@@ -7,20 +7,10 @@ type Logger = {
warn: (params: any) => void
};
function format (type: string, values: Array<any>): Array<any> {
return [new Date().toString(), type].concat(values);
}
type LogType = 'error' | 'log' | 'warn';
function error (type: string, values: Array<any>): void {
console.error.apply(console, format(type, values));
}
function log (type: string, values: Array<any>): void {
console.log.apply(console, format(type, values));
}
function warn (type: string, values: Array<any>): void {
console.warn.apply(console, format(type, values));
function apply (log: LogType, type: string, values: Array<any>): void {
console[log].apply(console, [new Date().toString(), type].concat(values));
}
/**
@@ -35,12 +25,11 @@ function warn (type: string, values: Array<any>): void {
l.log('blah'); // <date> TEST: blah
*/
module.exports = function logger (_type: string): Logger {
const type = ` ${_type.toUpperCase()}:`.slice(-11);
const type = ` ${_type.toUpperCase()}:`.slice(-16);
return {
format: (...values: any): Array<any> => format(type, values),
error: (...values: any): void => error(type, values),
log: (...values: any): void => log(type, values),
warn: (...values: any): void => warn(type, values)
error: (...values: any): void => apply('error', type, values),
log: (...values: any): void => apply('log', type, values),
warn: (...values: any): void => apply('warn', type, values)
};
};
-12
View File
@@ -21,18 +21,6 @@ describe('logger', () => {
jest.restoreAllMocks();
});
describe('format', () => {
let formatted;
beforeEach(() => {
formatted = l.format('paramA', 'paramB');
});
it('adds the date, type & params', () => {
expect(formatted).toHaveLength(4);
});
});
it('logs to console.error with .error', () => {
l.error('console.error test');
+2 -1
View File
@@ -6,6 +6,7 @@ const numberFromBuffer = require('../buffer/toNumber');
/**
@name numberFromBuffer
@signature numberFromBuffer (value?: Buffer): number
@summary Creates a Number value from a Buffer object. [buffer.md#buffertonumber](alias bufferToNumber)
@summary Creates a Number value from a Buffer object.
@alias buffer/toNumber
*/
module.exports = numberFromBuffer;
+2 -1
View File
@@ -6,6 +6,7 @@ const numberFromHex = require('../hex/toNumber');
/**
@name numberFromHex
@signature numberFromHex (value?: Hex): number
@summary Creates a Number value from a Buffer object. [buffer.md#hextonumber](alias hexToNumber)
@summary Creates a Number value from a Buffer object.
@alias hex/toNumber
*/
module.exports = numberFromHex;
+2 -1
View File
@@ -6,6 +6,7 @@ const u8aFromBuffer = require('../buffer/toU8a');
/**
@name u8aFromBuffer
@signature u8aFromBuffer (value?: Buffer): number
@summary Creates a Uint8Array value from a Buffer object. [buffer.md#buffertou8a](alias bufferToU8a)
@summary Creates a Uint8Array value from a Buffer object.
@alias buffer/toU8a
*/
module.exports = u8aFromBuffer;
+11 -145
View File
@@ -60,9 +60,9 @@
dependencies:
babel-runtime "^6.26.0"
"@polkadot/dev@^0.11.1":
version "0.11.1"
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.11.1.tgz#1f43103c5bb911a905b626340384e2cffe342bd5"
"@polkadot/dev@^0.12.4":
version "0.12.4"
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.12.4.tgz#5ce16c17bc29cf92793900a4096c7cc76cf2a0ac"
dependencies:
babel-cli "^6.26.0"
babel-core "^6.26.0"
@@ -72,8 +72,6 @@
babel-plugin-transform-object-rest-spread "^6.26.0"
babel-plugin-transform-runtime "^6.23.0"
babel-preset-env "^1.6.1"
babel-preset-flow "^6.23.0"
babel-preset-stage-0 "^6.24.1"
coveralls "^3.0.0"
dox "^0.9.0"
eslint "^4.11.0"
@@ -88,11 +86,12 @@
eslint-plugin-promise "^3.6.0"
eslint-plugin-react "^7.4.0"
eslint-plugin-standard "^3.0.1"
flow-bin "^0.59.0"
flow-bin "^0.60.0"
flow-copy-source "^1.2.1"
jest "^21.2.1"
makeshift "^1.1.0"
mkdirp "^0.5.1"
postcss "^6.0.14"
postcss-sass "^0.2.0"
rimraf "^2.6.2"
stylelint "^8.2.0"
@@ -397,14 +396,6 @@ babel-generator@^6.18.0, babel-generator@^6.26.0:
source-map "^0.5.6"
trim-right "^1.0.1"
babel-helper-bindify-decorators@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz#14c19e5f142d7b47f19a52431e52b1ccbc40a330"
dependencies:
babel-runtime "^6.22.0"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babel-helper-builder-binary-assignment-operator-visitor@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664"
@@ -439,15 +430,6 @@ babel-helper-explode-assignable-expression@^6.24.1:
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babel-helper-explode-class@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz#7dc2a3910dee007056e1e31d640ced3d54eaa9eb"
dependencies:
babel-helper-bindify-decorators "^6.24.1"
babel-runtime "^6.22.0"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babel-helper-function-name@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9"
@@ -550,46 +532,18 @@ babel-plugin-syntax-async-functions@^6.8.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95"
babel-plugin-syntax-async-generators@^6.5.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a"
babel-plugin-syntax-class-constructor-call@^6.18.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz#9cb9d39fe43c8600bec8146456ddcbd4e1a76416"
babel-plugin-syntax-class-properties@^6.8.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de"
babel-plugin-syntax-decorators@^6.13.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz#312563b4dbde3cc806cee3e416cceeaddd11ac0b"
babel-plugin-syntax-do-expressions@^6.8.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz#5747756139aa26d390d09410b03744ba07e4796d"
babel-plugin-syntax-dynamic-import@^6.18.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da"
babel-plugin-syntax-exponentiation-operator@^6.8.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de"
babel-plugin-syntax-export-extensions@^6.8.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz#70a1484f0f9089a4e84ad44bac353c95b9b12721"
babel-plugin-syntax-flow@^6.18.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d"
babel-plugin-syntax-function-bind@^6.8.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.13.0.tgz#48c495f177bdf31a981e732f55adc0bdd2601f46"
babel-plugin-syntax-object-rest-spread@^6.13.0, babel-plugin-syntax-object-rest-spread@^6.8.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5"
@@ -598,15 +552,7 @@ babel-plugin-syntax-trailing-function-commas@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3"
babel-plugin-transform-async-generator-functions@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db"
dependencies:
babel-helper-remap-async-to-generator "^6.24.1"
babel-plugin-syntax-async-generators "^6.5.0"
babel-runtime "^6.22.0"
babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-to-generator@^6.24.1:
babel-plugin-transform-async-to-generator@^6.22.0:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761"
dependencies:
@@ -614,14 +560,6 @@ babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-
babel-plugin-syntax-async-functions "^6.8.0"
babel-runtime "^6.22.0"
babel-plugin-transform-class-constructor-call@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz#80dc285505ac067dcb8d6c65e2f6f11ab7765ef9"
dependencies:
babel-plugin-syntax-class-constructor-call "^6.18.0"
babel-runtime "^6.22.0"
babel-template "^6.24.1"
babel-plugin-transform-class-properties@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac"
@@ -631,23 +569,6 @@ babel-plugin-transform-class-properties@^6.24.1:
babel-runtime "^6.22.0"
babel-template "^6.24.1"
babel-plugin-transform-decorators@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz#788013d8f8c6b5222bdf7b344390dfd77569e24d"
dependencies:
babel-helper-explode-class "^6.24.1"
babel-plugin-syntax-decorators "^6.13.0"
babel-runtime "^6.22.0"
babel-template "^6.24.1"
babel-types "^6.24.1"
babel-plugin-transform-do-expressions@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz#28ccaf92812d949c2cd1281f690c8fdc468ae9bb"
dependencies:
babel-plugin-syntax-do-expressions "^6.8.0"
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-arrow-functions@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221"
@@ -816,7 +737,7 @@ babel-plugin-transform-es2015-unicode-regex@^6.22.0:
babel-runtime "^6.22.0"
regexpu-core "^2.0.0"
babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-exponentiation-operator@^6.24.1:
babel-plugin-transform-exponentiation-operator@^6.22.0:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e"
dependencies:
@@ -824,13 +745,6 @@ babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-e
babel-plugin-syntax-exponentiation-operator "^6.8.0"
babel-runtime "^6.22.0"
babel-plugin-transform-export-extensions@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz#53738b47e75e8218589eea946cbbd39109bbe653"
dependencies:
babel-plugin-syntax-export-extensions "^6.8.0"
babel-runtime "^6.22.0"
babel-plugin-transform-flow-strip-types@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf"
@@ -838,14 +752,7 @@ babel-plugin-transform-flow-strip-types@^6.22.0:
babel-plugin-syntax-flow "^6.18.0"
babel-runtime "^6.22.0"
babel-plugin-transform-function-bind@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.22.0.tgz#c6fb8e96ac296a310b8cf8ea401462407ddf6a97"
dependencies:
babel-plugin-syntax-function-bind "^6.8.0"
babel-runtime "^6.22.0"
babel-plugin-transform-object-rest-spread@^6.22.0, babel-plugin-transform-object-rest-spread@^6.26.0:
babel-plugin-transform-object-rest-spread@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06"
dependencies:
@@ -914,12 +821,6 @@ babel-preset-env@^1.6.1:
invariant "^2.2.2"
semver "^5.3.0"
babel-preset-flow@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz#e71218887085ae9a24b5be4169affb599816c49d"
dependencies:
babel-plugin-transform-flow-strip-types "^6.22.0"
babel-preset-jest@^21.2.0:
version "21.2.0"
resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-21.2.0.tgz#ff9d2bce08abd98e8a36d9a8a5189b9173b85638"
@@ -927,41 +828,6 @@ babel-preset-jest@^21.2.0:
babel-plugin-jest-hoist "^21.2.0"
babel-plugin-syntax-object-rest-spread "^6.13.0"
babel-preset-stage-0@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-preset-stage-0/-/babel-preset-stage-0-6.24.1.tgz#5642d15042f91384d7e5af8bc88b1db95b039e6a"
dependencies:
babel-plugin-transform-do-expressions "^6.22.0"
babel-plugin-transform-function-bind "^6.22.0"
babel-preset-stage-1 "^6.24.1"
babel-preset-stage-1@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz#7692cd7dcd6849907e6ae4a0a85589cfb9e2bfb0"
dependencies:
babel-plugin-transform-class-constructor-call "^6.24.1"
babel-plugin-transform-export-extensions "^6.22.0"
babel-preset-stage-2 "^6.24.1"
babel-preset-stage-2@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz#d9e2960fb3d71187f0e64eec62bc07767219bdc1"
dependencies:
babel-plugin-syntax-dynamic-import "^6.18.0"
babel-plugin-transform-class-properties "^6.24.1"
babel-plugin-transform-decorators "^6.24.1"
babel-preset-stage-3 "^6.24.1"
babel-preset-stage-3@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz#836ada0a9e7a7fa37cb138fb9326f87934a48395"
dependencies:
babel-plugin-syntax-trailing-function-commas "^6.22.0"
babel-plugin-transform-async-generator-functions "^6.24.1"
babel-plugin-transform-async-to-generator "^6.24.1"
babel-plugin-transform-exponentiation-operator "^6.24.1"
babel-plugin-transform-object-rest-spread "^6.22.0"
babel-register@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071"
@@ -1940,9 +1806,9 @@ flat-cache@^1.2.1:
graceful-fs "^4.1.2"
write "^0.2.1"
flow-bin@^0.59.0:
version "0.59.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.59.0.tgz#8c151ee7f09f1deed9bf0b9d1f2e8ab9d470f1bb"
flow-bin@^0.60.0:
version "0.60.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.60.0.tgz#885d0d92a90f94c29445e0f9a0382f5b5debaaed"
flow-copy-source@^1.2.1:
version "1.2.1"