0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-03-18 02:22:46 -05:00

removing unused code

This commit is contained in:
Alex Kocharin 2014-07-26 20:46:17 +04:00
parent 4f913f2468
commit 21704c9f84
4 changed files with 1 additions and 42 deletions

View file

@ -4,7 +4,6 @@ var assert = require('assert')
, minimatch = require('minimatch')
, UError = require('./error').UserError
, utils = require('./utils')
, users = require('./users')
// [[a, [b, c]], d] -> [a, b, c, d]
function flatten(array) {

View file

@ -15,9 +15,7 @@ var express = require('express')
, fs = require('fs')
, localList = require('./local-list')
, search = require('./search')
, _ = require('underscore')
, users = require('./users')
, marked = require('marked');
, marked = require('marked')
function match(regexp) {
return function(req, res, next, value, name) {

View file

@ -1,37 +0,0 @@
var fs = require('fs')
, crypto = require('crypto')
, usersPath = './users.json';
var Users = function() {
if(fs.existsSync(usersPath)) {
this.users = JSON.parse(fs.readFileSync(usersPath, 'utf8'));
}
else {
this.users = {};
}
};
Users.prototype = {
add: function(params, callback) {
//Hash the Password
if(params.password) {
params.password = crypto.createHash('sha1').update(params.password).digest('hex');
}
else if(params.password_sha) {
params.password = params.password_sha;
}
//Save
this.users[params.name] = params;
this.sync(callback);
},
remove: function(name, callback) {
delete this.users[name];
this.sync(callback);
},
sync: function(callback) {
fs.writeFile(usersPath, JSON.stringify(this.users), callback);
}
};
module.exports = new Users();

View file

@ -37,7 +37,6 @@ dependencies:
onscroll: '0.0.3'
tar.gz: '^0.1.1'
transition-complete: '0.0.2'
underscore: '^1.6.0'
unopinionate: '0.0.4'
optionalDependencies: