From 985ea40b45f76a7eda191cb050caaaf74d21b0a9 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 11 Apr 2018 10:55:19 +0200 Subject: [PATCH] Remove unneeded 0 constant (#113) --- package.json | 2 +- packages/util/src/hex/constants.js | 10 ---------- packages/util/src/hex/fixLength.js | 3 +-- yarn.lock | 14 +++++++------- 4 files changed, 9 insertions(+), 20 deletions(-) delete mode 100644 packages/util/src/hex/constants.js diff --git a/package.json b/package.json index da897d9be..1ace4fa9f 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "test": "jest --coverage" }, "devDependencies": { - "@polkadot/dev": "^0.17.2", + "@polkadot/dev": "^0.17.4", "lerna": "^2.5.1" } } diff --git a/packages/util/src/hex/constants.js b/packages/util/src/hex/constants.js deleted file mode 100644 index 31e738536..000000000 --- a/packages/util/src/hex/constants.js +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2017-2018 Jaco Greeff -// This software may be modified and distributed under the terms -// of the ISC license. See the LICENSE file for details. -// @flow - -const ZEROS_256 = '0000000000000000000000000000000000000000000000000000000000000000'; - -module.exports = { - ZEROS_256 -}; diff --git a/packages/util/src/hex/fixLength.js b/packages/util/src/hex/fixLength.js index a27bc8983..fa0cb3201 100644 --- a/packages/util/src/hex/fixLength.js +++ b/packages/util/src/hex/fixLength.js @@ -5,7 +5,6 @@ const hexAddPrefix = require('./addPrefix'); const hexStripPrefix = require('./stripPrefix'); -const { ZEROS_256 } = require('./constants'); /** @name hexFixLength @@ -37,6 +36,6 @@ module.exports = function hexFixLength (value: string, bitLength: number = -1, w } return hexAddPrefix( - `${ZEROS_256}${hexStripPrefix(value)}`.slice(-1 * strLength) + `${'0'.repeat(strLength)}${hexStripPrefix(value)}`.slice(-1 * strLength) ); }; diff --git a/yarn.lock b/yarn.lock index 2b61d7f5b..680316c94 100644 --- a/yarn.lock +++ b/yarn.lock @@ -85,9 +85,9 @@ dependencies: babel-runtime "^6.26.0" -"@polkadot/dev@^0.17.2": - version "0.17.2" - resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.17.2.tgz#1009c81f9db1548774361aa23631b4bdf8b7ede9" +"@polkadot/dev@^0.17.4": + version "0.17.4" + resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.17.4.tgz#d5bcbbb0a6531ebbce222d946be9ae4a52eea1e4" dependencies: babel-cli "^6.26.0" babel-core "^6.26.0" @@ -112,7 +112,7 @@ eslint-plugin-promise "^3.6.0" eslint-plugin-react "^7.7.0" eslint-plugin-standard "^3.0.1" - flow-bin "^0.68.0" + flow-bin "^0.69.0" flow-copy-source "^1.3.0" jest "^22.4.2" makeshift "^1.1.0" @@ -2360,9 +2360,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.68.0: - version "0.68.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.68.0.tgz#86c2d14857d306eb2e85e274f2eebf543564f623" +flow-bin@^0.69.0: + version "0.69.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.69.0.tgz#053159a684a6051fcbf0b71a2eb19a9679082da6" flow-copy-source@^1.3.0: version "1.3.0"