Use @polkadot/dev for common tasks (#8)

* Link to docs in README

* Use @polkadot/dev for common tasks

* 0.5.0 since docs added
This commit is contained in:
Jaco Greeff
2017-11-20 23:04:33 +01:00
committed by GitHub
parent 4ec391e81d
commit 1216968145
38 changed files with 2472 additions and 350 deletions
+12 -1
View File
@@ -6,7 +6,18 @@ const hexStripPrefix = require('../hex/stripPrefix');
const EMPTY_BUFFER = Buffer.from([]);
module.exports = function fromHex (value?: string): Buffer {
/**
@name bufferFromHex
@signature bufferFromHex (value?: string): Buffer
@summary Creates a Buffer object from a hex string.
@description
`null` inputs returns an empty `Buffer` result. Hex input values return the actual bytes value converted to a Buffer. Anything that is not a hex string (including the `0x` prefix) throws an error.
@example
import { bufferFromHex } from '@polkadot/util';
console.log('Buffer object', bufferFromHex('0x123480001f'));
*/
module.exports = function bufferFromHex (value?: string): Buffer {
if (!value) {
return EMPTY_BUFFER;
}