Skip to content

Commit

Permalink
Style tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
wbyoung committed Mar 27, 2015
1 parent 788f71e commit 82f9d56
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ function makeAMD(moduleContents, opts) {
var includes = [];
var defines = [];
_.each(opts.require, function(include, define) {
if(include === null) { return; }
includes.push(JSON.stringify(include));
defines.push(define);
if (include !== null) {
includes.push(JSON.stringify(include));
defines.push(define);
}
});
return 'define([' + includes.join(',') + '], ' +
'function(' + defines.join(',') + ') { return ' + moduleContents + '; });';
Expand All @@ -21,8 +22,9 @@ function makeAMD(moduleContents, opts) {
function makeCommonJS(moduleContents, opts) {
// var Dependency = require('dependency');module.exports = moduleObject;
var requires = _.map(opts.require, function(key, value) {
if(value === null) { return; }
return 'var ' + value + ' = require(' + JSON.stringify(key) + ');';
if (value !== null) {
return 'var ' + value + ' = require(' + JSON.stringify(key) + ');';
}
});
return requires + 'module.exports = ' + moduleContents + ';';
}
Expand Down

0 comments on commit 82f9d56

Please sign in to comment.