[Pkg-javascript-commits] [node-browserify-aes] 21/92: move dependency injection into a separate file
Bastien Roucariès
rouca at moszumanska.debian.org
Sun Jun 4 09:35:16 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-browserify-aes.
commit 3bf29cc0f35fc1d4b9fc2f0ea7376c2648e9848b
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date: Mon Oct 20 12:16:48 2014 +0000
move dependency injection into a separate file
---
index.js | 17 ++---------------
index.js => inject.js | 6 ++----
2 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/index.js b/index.js
index 479804c..1e258ed 100644
--- a/index.js
+++ b/index.js
@@ -1,17 +1,4 @@
var crypto = require('crypto');
-exports.__browserify = function (crypto, exports) {
- exports = exports || {};
- var ciphers = require('./encrypter')(crypto);
- exports.createCipher = ciphers.createCipher;
- exports.createCipheriv = ciphers.createCipheriv;
- var deciphers = require('./decrypter')(crypto);
- exports.createDecipher = deciphers.createDecipher;
- exports.createDecipheriv = deciphers.createDecipheriv;
- var modes = require('./modes');
- function listCiphers () {
- return Object.keys(modes);
- }
- exports.listCiphers = listCiphers;
-};
-exports.__browserify(crypto, module.exports);
\ No newline at end of file
+exports.__browserify = require('./inject')
+exports.__browserify(crypto, module.exports);
diff --git a/index.js b/inject.js
similarity index 78%
copy from index.js
copy to inject.js
index 479804c..e426ad7 100644
--- a/index.js
+++ b/inject.js
@@ -1,6 +1,4 @@
-var crypto = require('crypto');
-
-exports.__browserify = function (crypto, exports) {
+module.exports = function (crypto, exports) {
exports = exports || {};
var ciphers = require('./encrypter')(crypto);
exports.createCipher = ciphers.createCipher;
@@ -14,4 +12,4 @@ exports.__browserify = function (crypto, exports) {
}
exports.listCiphers = listCiphers;
};
-exports.__browserify(crypto, module.exports);
\ No newline at end of file
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-browserify-aes.git
More information about the Pkg-javascript-commits
mailing list