Explicit Array<any> (#246)

* Explicit Array<any>

* Ordering

* Bump dev
This commit is contained in:
Jaco Greeff
2018-11-12 17:54:41 +01:00
committed by GitHub
parent a8e39297b5
commit 22f8df1fd0
7 changed files with 108 additions and 60 deletions
+2 -2
View File
@@ -21,7 +21,7 @@
},
"devDependencies": {
"@babel/core": "^7.1.2",
"@polkadot/dev": "^0.21.3",
"@polkadot/ts": "^0.1.34"
"@polkadot/dev": "^0.21.4",
"@polkadot/ts": "^0.1.35"
}
}
+1 -1
View File
@@ -363,7 +363,7 @@ export default class FileFlatDb implements BaseDb {
const { keyAt, keyValue } = this.writeNewKey(key);
const keyIndex = key.nibbles[matchIndex] * defaults.ENTRY_SIZE;
const prevIndex = prevKey.nibbles[matchIndex] * defaults.ENTRY_SIZE;
const buffers = [];
const buffers: Array<Buffer> = [];
let newBranchAt = this._fileSize;
let newBranch = Buffer.alloc(defaults.BRANCH_SIZE);
+1 -1
View File
@@ -4,7 +4,7 @@
export default function encodeHexPrefix (nibbles: Uint8Array | Array<number>, isLeaf: boolean): Uint8Array {
const bits = ((nibbles.length & 1) + (2 * (isLeaf ? 1 : 0))) << 4;
const result = [];
const result: Array<number> = [];
let offset = nibbles.length % 2;
result.push(bits + (offset ? nibbles[0] : 0));
+1 -2
View File
@@ -21,8 +21,7 @@ function calcLength (pairs: Trie$Pairs, preLength: number, index: number, start:
}
export default function encodePairs (pairs: Trie$Pairs, preLength: number): Array<any> {
const result = [];
const result: Array<any> = [];
let start = preLength === pairs[0].k.length
? 1
: 0;
+1 -1
View File
@@ -12,7 +12,7 @@ export default function decodeListLong (decode: DecodeFunc, input: Uint8Array):
const llength = input[0] - 0xf6;
const length = safeParseInt(input.slice(1, llength));
const totalLength = llength + length;
const decoded = [];
const decoded: Array<any | Uint8Array> = [];
assert(totalLength <= input.length, 'invalid rlp: total length is larger than the data');
+1 -1
View File
@@ -5,9 +5,9 @@
import { DecodeFunc, DecodeOutput } from './types';
export default function decodeListShort (decode: DecodeFunc, input: Uint8Array): DecodeOutput {
const decoded: Array<any | Uint8Array> = [];
const length = input[0] - 0xbf;
let innerRemainder = input.slice(1, length);
const decoded = [];
while (innerRemainder.length) {
const d = decode(innerRemainder);
+101 -52
View File
@@ -1261,10 +1261,10 @@
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.2.tgz#54c5a964462be3d4d78af631363c18d6fa91ac26"
integrity sha512-yprFYuno9FtNsSHVlSWd+nRlmGoAbqbeCwOryP6sC/zoCjhpArcRMYp19EvpSUSizJAlsXEwJv+wcWS9XaXdMw==
"@polkadot/dev@^0.21.3":
version "0.21.3"
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.21.3.tgz#4798988eda35009bbd871bfacf4d51d561c4eee9"
integrity sha512-eJC3LJ0lxgYcNL/K18ixLjZaLByhBHvDE72CKLx5qvv75FD6tYDtJF2ojLgkp/hY8F3ZuwanZ8zopdZDqpPvCg==
"@polkadot/dev@^0.21.4":
version "0.21.4"
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.21.4.tgz#f26e4d662fa1e87507f6dffa0f648711e54c820d"
integrity sha512-vujvtv/JNbpGdTfcAQfl/N27VCdTgo5AJ4Rn8oy54f32knrR7Wl4plMdDvEue4/hl1CMZSRrmWubg+XK1so/Jg==
dependencies:
"@babel/cli" "^7.1.2"
"@babel/core" "^7.1.2"
@@ -1284,8 +1284,8 @@
babel-plugin-module-resolver "^3.1.1"
chalk "^2.4.1"
codeclimate-test-reporter "^0.5.1"
copyfiles "^2.1.0"
coveralls "^3.0.1"
cpx "^1.5.0"
dox "^0.9.0"
eslint "^5.7.0"
eslint-config-semistandard "^13.0.0"
@@ -1305,7 +1305,6 @@
lerna "^3.4.3"
makeshift "^1.1.0"
mkdirp "^0.5.1"
ncp "^2.0.0"
rimraf "^2.6.2"
tslint "^5.11.0"
tslint-config-semistandard "^7.0.0"
@@ -1313,10 +1312,10 @@
typedoc-plugin-markdown "^1.1.17"
typescript "^3.1.3"
"@polkadot/ts@^0.1.34":
version "0.1.34"
resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.1.34.tgz#ac513a85a6a070c1d98bc1999ae1dec1b05f5c11"
integrity sha512-s9s5WbdyoVaZV5JmNwL7v7NGk30ww2fCbsgYqyDcl05dlOOY8DtbeSlhWt3gr2sfgnGaO76jTwb49glMXWBwwQ==
"@polkadot/ts@^0.1.35":
version "0.1.35"
resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.1.35.tgz#f92fa72e1c47bd47f3d2e6b1cc7c03f2328d9cc4"
integrity sha512-AbZXWdJXelZwq04CJdTwpctnA5NF2GugeOlTnvIsTlc0PEjOZeEf/nReQvvKprNEg6qXl8xcMRr5TBXcccxupA==
dependencies:
"@types/node" "^10.12.0"
@@ -1605,6 +1604,14 @@ ansistyles@~0.1.3:
resolved "https://registry.yarnpkg.com/ansistyles/-/ansistyles-0.1.3.tgz#5de60415bda071bb37127854c864f41b23254539"
integrity sha1-XeYEFb2gcbs3EnhUyGT0GyMlRTk=
anymatch@^1.3.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a"
integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==
dependencies:
micromatch "^2.1.5"
normalize-path "^2.0.0"
anymatch@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb"
@@ -1687,6 +1694,11 @@ array-equal@^1.0.0:
resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93"
integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=
array-filter@~0.0.0:
version "0.0.1"
resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec"
integrity sha1-fajPLiZijtcygDWB/SH2fKzS7uw=
array-find-index@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1"
@@ -1697,6 +1709,16 @@ array-ify@^1.0.0:
resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece"
integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=
array-map@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662"
integrity sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=
array-reduce@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b"
integrity sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=
array-union@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39"
@@ -1909,7 +1931,7 @@ babel-preset-jest@^23.2.0:
babel-plugin-jest-hoist "^23.2.0"
babel-plugin-syntax-object-rest-spread "^6.13.0"
babel-runtime@^6.22.0, babel-runtime@^6.26.0:
babel-runtime@^6.22.0, babel-runtime@^6.26.0, babel-runtime@^6.9.2:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4=
@@ -2412,6 +2434,22 @@ chmodr@~1.0.2:
resolved "http://registry.npmjs.org/chmodr/-/chmodr-1.0.2.tgz#04662b932d0f02ec66deaa2b0ea42811968e3eb9"
integrity sha1-BGYrky0PAuxm3qorDqQoEZaOPrk=
chokidar@^1.6.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468"
integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=
dependencies:
anymatch "^1.3.0"
async-each "^1.0.0"
glob-parent "^2.0.0"
inherits "^2.0.1"
is-binary-path "^1.0.0"
is-glob "^2.0.0"
path-is-absolute "^1.0.0"
readdirp "^2.0.0"
optionalDependencies:
fsevents "^1.0.0"
chokidar@^2.0.3:
version "2.0.4"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26"
@@ -2766,18 +2804,6 @@ copy-descriptor@^0.1.0:
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=
copyfiles@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/copyfiles/-/copyfiles-2.1.0.tgz#0e2a4188162d6b2f3c5adfe34e9c0bd564d23164"
integrity sha512-cAeDE0vL/koE9WSEGxqPpSyvU638Kgfu6wfrnj7kqp9FWa1CWsU54Coo6sdYZP4GstWa39tL/wIVJWfXcujgNA==
dependencies:
glob "^7.0.5"
minimatch "^3.0.3"
mkdirp "^0.5.1"
noms "0.0.0"
through2 "^2.0.1"
yargs "^11.0.0"
core-js@^2.4.0, core-js@^2.5.7:
version "2.5.7"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e"
@@ -2809,6 +2835,23 @@ coveralls@^3.0.1:
minimist "^1.2.0"
request "^2.85.0"
cpx@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/cpx/-/cpx-1.5.0.tgz#185be018511d87270dedccc293171e37655ab88f"
integrity sha1-GFvgGFEdhycN7czCkxceN2VauI8=
dependencies:
babel-runtime "^6.9.2"
chokidar "^1.6.0"
duplexer "^0.1.1"
glob "^7.0.5"
glob2base "^0.0.12"
minimatch "^3.0.2"
mkdirp "^0.5.1"
resolve "^1.1.7"
safe-buffer "^5.0.1"
shell-quote "^1.6.1"
subarg "^1.0.0"
create-error-class@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6"
@@ -3809,6 +3852,11 @@ find-cache-dir@^1.0.0:
make-dir "^1.0.0"
pkg-dir "^2.0.0"
find-index@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/find-index/-/find-index-0.1.1.tgz#675d358b2ca3892d795a1ab47232f8b6e2e0dde4"
integrity sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ=
find-up@^1.0.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f"
@@ -3975,7 +4023,7 @@ fs.realpath@^1.0.0:
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
fsevents@^1.2.2, fsevents@^1.2.3:
fsevents@^1.0.0, fsevents@^1.2.2, fsevents@^1.2.3:
version "1.2.4"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426"
integrity sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==
@@ -4268,6 +4316,13 @@ glob-to-regexp@^0.3.0:
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab"
integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=
glob2base@^0.0.12:
version "0.0.12"
resolved "https://registry.yarnpkg.com/glob2base/-/glob2base-0.0.12.tgz#9d419b3e28f12e83a362164a277055922c9c0d56"
integrity sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=
dependencies:
find-index "^0.1.1"
glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@~7.1.2:
version "7.1.3"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
@@ -6217,7 +6272,7 @@ mermaid@^7.0.7:
lodash "^4.17.4"
moment "^2.20.1"
micromatch@^2.3.11:
micromatch@^2.1.5, micromatch@^2.3.11:
version "2.3.11"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565"
integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=
@@ -6297,7 +6352,7 @@ minimist@0.0.8:
resolved "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0:
minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0:
version "1.2.0"
resolved "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=
@@ -6464,11 +6519,6 @@ natural-compare@^1.4.0:
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
ncp@^2.0.0:
version "2.0.0"
resolved "http://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3"
integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=
needle@^2.2.1:
version "2.2.4"
resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e"
@@ -6591,14 +6641,6 @@ node-uuid@~1.4.7:
resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907"
integrity sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=
noms@0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/noms/-/noms-0.0.0.tgz#da8ebd9f3af9d6760919b27d9cdc8092a7332859"
integrity sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=
dependencies:
inherits "^2.0.1"
readable-stream "~1.0.31"
noop-logger@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2"
@@ -6644,7 +6686,7 @@ normalize-package-data@~2.3.5:
semver "2 || 3 || 4 || 5"
validate-npm-package-license "^3.0.1"
normalize-path@^2.0.1, normalize-path@^2.1.1:
normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9"
integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=
@@ -7885,16 +7927,6 @@ read@1, read@~1.0.1, read@~1.0.7:
string_decoder "~1.1.1"
util-deprecate "~1.0.1"
readable-stream@~1.0.31:
version "1.0.34"
resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c"
integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.1"
isarray "0.0.1"
string_decoder "~0.10.x"
readable-stream@~1.1.10:
version "1.1.14"
resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9"
@@ -8249,7 +8281,7 @@ resolve@1.1.7:
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=
resolve@^1.1.6, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.6.0, resolve@^1.8.1:
resolve@^1.1.6, resolve@^1.1.7, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.6.0, resolve@^1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26"
integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==
@@ -8440,6 +8472,16 @@ shebang-regex@^1.0.0:
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=
shell-quote@^1.6.1:
version "1.6.1"
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767"
integrity sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=
dependencies:
array-filter "~0.0.0"
array-map "~0.0.0"
array-reduce "~0.0.0"
jsonify "~0.0.0"
shelljs@^0.8.2:
version "0.8.2"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.2.tgz#345b7df7763f4c2340d584abb532c5f752ca9e35"
@@ -8879,6 +8921,13 @@ strong-log-transformer@^2.0.0:
minimist "^1.2.0"
through "^2.3.4"
subarg@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2"
integrity sha1-9izxdYHplrSPyWVpn1TAauJouNI=
dependencies:
minimist "^1.1.0"
sunlight-x@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/sunlight-x/-/sunlight-x-0.0.3.tgz#a97ce285f5687cfacde09710ebac3e89393ee46b"
@@ -9020,7 +9069,7 @@ throat@^4.0.0:
resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a"
integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=
through2@^2.0.0, through2@^2.0.1, through2@^2.0.2:
through2@^2.0.0, through2@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be"
integrity sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=