Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "spelunk", | ||
"description": "Traverse a folder in node, turning its contents into an object for easy consumption", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"homepage": "https://github.com/Rich-Harris/spelunk", | ||
@@ -32,2 +32,2 @@ "author": { | ||
} | ||
} | ||
} |
@@ -100,3 +100,3 @@ var fs, path, minimatch; | ||
else { | ||
key = getKey( fileName ); | ||
key = getKey( fileName, options ); | ||
getFile( dirPath, fileName, gotFile ); | ||
@@ -135,6 +135,6 @@ } | ||
// Get key from path, e.g. 'project/data/config.json' -> 'config' | ||
function getKey ( fileName ) { | ||
function getKey ( fileName, options ) { | ||
var lastDotIndex = fileName.lastIndexOf( '.' ); | ||
if ( lastDotIndex > 0 ) { | ||
if ( lastDotIndex > 0 && !options.keepExtensions ) { | ||
return fileName.substr( 0, lastDotIndex ); | ||
@@ -141,0 +141,0 @@ } |
9634