Skip to content
This repository has been archived by the owner on May 8, 2021. It is now read-only.

Commit

Permalink
use function arity to determine if default value is returned
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholascloud committed Feb 22, 2013
1 parent ae6ca0a commit 359f0a0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
13 changes: 9 additions & 4 deletions Jakefile.js
Expand Up @@ -11,6 +11,8 @@ var ROOT_DIR = __dirname,
BUILD_DIR = path.join(ROOT_DIR, 'build'),
TEST_DIR = path.join(ROOT_DIR, 'test');

var VERSION_TEMPLATE_VAR = '{{VERSION}}';

namespace('package', function () {
// gets the project version from package.json
task('version', function () {
Expand Down Expand Up @@ -53,7 +55,8 @@ task('test', function () {

var mochaBin = path.join(ROOT_DIR, 'node_modules', '.bin', 'mocha');
var testCmd = mochaBin + ' ' + TEST_DIR;
jake.exec(testCmd, function () {}, {printStdout: true});
jake.exec(testCmd, function () {
}, {printStdout: true});
});

task('default', function () {
Expand All @@ -65,8 +68,8 @@ task('default', function () {
function concatFiles(files, outputFile, callback) {
var readHandlers = files.map(function (file) {
return function (callback) {
fs.readFile(file, function (err, data) {
callback(err, data);
fs.readFile(file, function (err, contentBuffer) {
callback(err, contentBuffer);
})
};
});
Expand All @@ -75,6 +78,8 @@ function concatFiles(files, outputFile, callback) {
if (err) {
return callback(err);
}
fs.writeFile(outputFile, files.join(os.EOL), callback);
var output = files.join(os.EOL)
.replace(VERSION_TEMPLATE_VAR, pkg.version);
fs.writeFile(outputFile, output, callback);
});
}
4 changes: 2 additions & 2 deletions build/l33teral-0.7.1.js → build/l33teral-0.7.2.js
@@ -1,5 +1,5 @@
/**
* l33teral
* l33teral 0.7.2
*
* The MIT License (MIT)
*
Expand Down Expand Up @@ -92,7 +92,7 @@
continue;
}

if (defaultValue !== undefined) {
if (arguments.length === 2) {
return defaultValue;
}

Expand Down
2 changes: 1 addition & 1 deletion l33teral.js
Expand Up @@ -67,7 +67,7 @@
continue;
}

if (defaultValue !== undefined) {
if (arguments.length === 2) {
return defaultValue;
}

Expand Down
2 changes: 1 addition & 1 deletion license.js
@@ -1,5 +1,5 @@
/**
* l33teral
* l33teral {{VERSION}}
*
* The MIT License (MIT)
*
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "l33teral",
"version": "0.7.1",
"version": "0.7.2",
"author": "Nicholas Cloud",
"description": "functions to help deal with object literals",
"keywords": ["literals", "objects", "utilities"],
Expand All @@ -16,7 +16,7 @@
"clone": "0.1.5",
"rimraf": "2.1.4"
},
"main": "./build/l33teral-0.7.1",
"main": "./build/l33teral-0.7.2",
"scripts": {
"test": "jake test --trace",
"prepublish": "jake build"
Expand Down

0 comments on commit 359f0a0

Please sign in to comment.