refactor(hash) hash.create -> hash

This commit is contained in:
coderaiser 2014-10-23 10:53:22 -04:00
parent 8e3f7469ed
commit 622849d233
2 changed files with 9 additions and 9 deletions

View file

@ -1,11 +1,11 @@
(function (object) {
(function () {
'use strict';
var util = require('util'),
crypto = require('crypto'),
Writable = require('stream').Writable;
object.create = function() {
module.exports = function() {
var ret;
if (Writable) {
@ -33,4 +33,4 @@
};
}
})(this);
})();

View file

@ -6,13 +6,13 @@
DIR_SERVER = DIR + 'server/',
pipe = require(DIR_SERVER + 'pipe'),
flop = require(DIR_SERVER + 'flop'),
Hash = require(DIR_SERVER + 'hash'),
hash = require(DIR_SERVER + 'hash'),
mellow = require(DIR_SERVER + 'mellow'),
beautify = require(DIR_SERVER + 'beautify'),
Util = require(DIR + 'util');
module.exports = function(query, name, callback) {
var hash, error;
var hashStream, error;
Util.checkArgs(arguments, ['query', 'name', 'callback']);
@ -34,17 +34,17 @@
break;
case 'hash':
hash = Hash.create();
hashStream = hash();
if (!hash) {
if (!hashStream) {
error = 'hash: not suported, try update node';
callback(Error(error));
} else
pipe.create(name, hash, function (error) {
pipe.create(name, hashStream, function (error) {
var hex;
if (!error)
hex = hash.get();
hex = hashStream.get();
callback(error, hex);
});