[Pkg-javascript-commits] [node-sha.js] 201/237: index: adhere to standard

Bastien Roucariès rouca at moszumanska.debian.org
Fri May 5 09:04:00 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-sha.js.

commit 1839fb715518fb18077e2b02449ad3627efc3ecb
Author: Daniel Cousens <github at dcousens.com>
Date:   Sat May 30 13:31:35 2015 +1000

    index: adhere to standard
---
 index.js | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/index.js b/index.js
index 111d97b..87cdf49 100644
--- a/index.js
+++ b/index.js
@@ -1,9 +1,11 @@
-var exports = module.exports = function (alg) {
-  var Alg = exports[alg.toLowerCase()]
-  if(!Alg) throw new Error(alg + ' is not supported (we accept pull requests)')
-  return new Alg()
-}
+var exports = module.exports = function SHA (algorithm) {
+  algorithm = algorithm.toLowerCase()
+
+  var Algorithm = exports[algorithm]
+  if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')
 
+  return new Algorithm()
+}
 
 exports.sha = require('./sha')
 exports.sha1 = require('./sha1')

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-sha.js.git



More information about the Pkg-javascript-commits mailing list