Update @polkadot/dev with flow-types (#12)

This commit is contained in:
Jaco Greeff
2017-11-22 20:15:34 +01:00
committed by GitHub
parent 70df83a7eb
commit f41af5240a
6 changed files with 1151 additions and 102 deletions
-4
View File
@@ -1,4 +0,0 @@
instrumentation:
root: src
extensions:
- .js
+24
View File
@@ -0,0 +1,24 @@
// GPLv3, Copyright (C) 2017, theBlock, https://theblock.io
// @flow
declare module 'bn.js' {
declare class BN {
constructor (value?: any, base: ?number): BN;
add (value?: BN): BN;
div (value?: BN): BN;
divRound (value?: BN): BN;
eq (value: BN): boolean;
gt (value: BN): boolean;
isZero (): boolean;
lt (value: BN): boolean;
mul (value?: BN): BN;
sub (value?: BN): BN;
toNumber (): number;
toString (base?: number, padding?: number): string;
static isBN (value?: any): boolean;
}
declare module.exports: typeof BN;
}
+12
View File
@@ -0,0 +1,12 @@
// ISC, Copyright 2017 Jaco Greeff
// @flow
type KeccakType = 'keccak256';
declare module 'keccak' {
declare module.exports: (type: KeccakType) => {
update: (value: Buffer | string) => {
digest: () => Buffer;
}
};
}
+1111 -92
View File
File diff suppressed because it is too large Load Diff
+3 -5
View File
@@ -24,15 +24,13 @@
},
"homepage": "https://github.com/polkadot-js/util#readme",
"scripts": {
"build": "npm run build:js && npm run build:md",
"build:js": "rimraf build && babel src --out-dir build --ignore *.spec.js",
"build:md": "polkadot-dev-build-docs",
"build": "polkadot-dev-build-babel && polkadot-dev-build-docs",
"check": "eslint src && flow check",
"test": "jest --coverage src"
},
"devDependencies": {
"@polkadot/dev": "^0.2.2",
"@polkadot/jsonrpc": "^0.3.6"
"@polkadot/dev": "^0.2.3",
"@polkadot/jsonrpc": "^0.3.7"
},
"dependencies": {
"babel-runtime": "^6.26.0",
+1 -1
View File
@@ -26,7 +26,7 @@ module.exports = function bnToHex (value?: BN): string {
}
if (!isBN(value)) {
throw new Error(`Cannot convert from non-BN value '${value}' to hex`);
throw new Error(`Cannot convert from non-BN value '${(value: any)}' to hex`);
}
return hexAddPrefix(value.toString(16));