From 62196d9183f27b760ff0253c181ce39296821eaf Mon Sep 17 00:00:00 2001 From: JP Richardson Date: Wed, 11 Jun 2014 23:32:08 -0500 Subject: [PATCH] removed semicolons --- CHANGELOG.md | 5 +++++ lib/hdkey.js | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64dafcc..f20f87d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +x.y.z / 2014-06-dd +------------------ +- removed semicolons per http://cryptocoinjs.com/about/contributing/#semicolons +- + 0.0.1 / 2014-05-29 ------------------ - initial release \ No newline at end of file diff --git a/lib/hdkey.js b/lib/hdkey.js index a3bc6d0..49ee46e 100644 --- a/lib/hdkey.js +++ b/lib/hdkey.js @@ -112,31 +112,31 @@ HDKey.prototype.getFingerprint = function() { HDKey.prototype.derive = function(path) { - var e = path.split('/'); + var e = path.split('/') // Special cases: if (path == 'm' || path == 'M' || path == 'm\'' || path == 'M\'') - return this; + return this - var hkey = this; + var hkey = this for (var i in e) { - var c = e[i]; + var c = e[i] if (i == 0 ) { - if (c != 'm') throw new Error('invalid path'); - continue; + if (c != 'm') throw new Error('invalid path') + continue } - var usePrivate = (c.length > 1) && (c[c.length-1] == '\''); - var childIndex = parseInt(usePrivate ? c.slice(0, c.length - 1) : c) & 0x7fffffff; + var usePrivate = (c.length > 1) && (c[c.length-1] == '\'') + var childIndex = parseInt(usePrivate ? c.slice(0, c.length - 1) : c) & 0x7fffffff if (usePrivate) - childIndex += HARDENED_OFFSET; + childIndex += HARDENED_OFFSET - hkey = hkey.deriveChild(childIndex); + hkey = hkey.deriveChild(childIndex) } - return hkey; + return hkey } HDKey.prototype.deriveChild = function(index) {