Skip to content

Commit

Permalink
/lib/short.js hanging commas
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhotchkiss committed Jan 18, 2012
1 parent e4c5fc2 commit bd8949d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/short.js
Expand Up @@ -3,8 +3,8 @@
Core Modules
*/

var mongoose = require('mongoose'),
ShortURL = require(__dirname+'/../models/ShortURL.js');
var mongoose = require('mongoose')
, ShortURL = require(__dirname+'/../models/ShortURL.js');

/*!
@method hasher
Expand Down Expand Up @@ -41,9 +41,8 @@ function connect(mongodb){

function generate(URL, options, callback){
var hashedURL;

//Options takes an optional object literal
//Right now it only supports an options.length argument
// Options takes an optional object literal
// Right now it only supports an options.length argument
if (arguments.length === 2 && arguments[1] instanceof Function) {
callback = arguments[1];
hashedURL = hasher(URL);
Expand All @@ -54,7 +53,6 @@ function generate(URL, options, callback){
else {
throw new Error("generate requires a URL and callback function!");
}

var item = new ShortURL({
URL : URL,
hash : hashedURL
Expand Down Expand Up @@ -85,8 +83,8 @@ function retrieve(hash, options, callback){
callback = arguments[1];
options = null;
} else if (arguments.length === 3 && arguments[1] instanceof Object && arguments[2] instanceof Function) {
//Options takes an optional object literal
//Right now it only supports an options.visitor argument
// Options takes an optional object literal
// Right now it only supports an options.visitor argument
} else {
throw new Error("retrieve requires a hash and callback function!");
}
Expand Down

0 comments on commit bd8949d

Please sign in to comment.