Permalink
Browse files

using Hashish module instead of own hash merge implementation

  • Loading branch information...
gregormelhorn committed Jan 26, 2012
1 parent fdb977c commit d8a4760bd9c316745c3a167d3c588b643f860deb
Showing with 7 additions and 24 deletions.
  1. +1 −0 .gitignore
  2. +3 −24 index.js
  3. +3 −0 package.json
View
@@ -1,2 +1,3 @@
.*.sw*
+node_modules
scrap.js
View
@@ -7,6 +7,7 @@
*/
var http = require( 'http' );
+var Hash = require('hashish');
/**
* Version
@@ -25,28 +26,6 @@ function formatLoc ( loc ) {
return loc.replace( /\s/g, '+' );
}
-/**
- * Combines given `objects` and returns the result
- *
- * @param objects, required
- * @api private
- */
-
-function merge ( objects ) {
- var result = {},
- args = Array.prototype.slice.call( arguments );
-
- args.forEach(function ( item ) {
- for ( var prop in item ) {
- if ( item.hasOwnProperty( prop ) ) {
- result[prop] = item[prop];
- }
- }
- });
-
- return result;
-}
-
/**
* Makes request to Google API and passes result to a callback
*
@@ -117,7 +96,7 @@ Geocoder.prototype = {
headers: {}
};
- options = merge( defaults, opts || {} );
+ options = Hash.merge( defaults, opts || {} );
return request( options, cbk );
@@ -140,7 +119,7 @@ Geocoder.prototype = {
headers: {}
};
- options = merge( defaults, opts || {} );
+ options = Hash.merge( defaults, opts || {} );
return request( options, cbk );
View
@@ -11,5 +11,8 @@
"license": {
"type": "Apachev2",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
+ },
+ "dependencies" : {
+ "hashish" : ">= 0.0.4"
}
}

0 comments on commit d8a4760

Please sign in to comment.