lodash-contrib
Advanced tools
Comparing version 241.4.10 to 241.4.11
@@ -38,3 +38,3 @@ ### object.selectors | ||
_.getGeneralOf("rome"); | ||
getGeneralOf("rome"); | ||
// => "Scipio" | ||
@@ -41,0 +41,0 @@ ``` |
module.exports = function (grunt) { | ||
var _ = require('lodash'); | ||
var sandboxCode; | ||
@@ -99,3 +100,6 @@ grunt.loadNpmTasks('grunt-browserify'); | ||
files: [ | ||
{ src: ['common-js/*.*'] } | ||
{ | ||
src: ['common-js/*.*'], | ||
dst: 'lodash-contrib.js' | ||
} | ||
] | ||
@@ -113,3 +117,3 @@ } | ||
files: { | ||
'gen/double.browserified.js' : 'index.js' | ||
'gen/double.browserified.js': 'lodash-contrib.js' | ||
}, | ||
@@ -173,4 +177,4 @@ browserifyOptions: { debug: true } | ||
code += ' return inNewContext;\n'; | ||
code += '}'; | ||
sandboxCode = code; | ||
code += '}\n'; | ||
sandboxCode = {code: code, name: 'sandbox'}; | ||
}); | ||
@@ -180,9 +184,18 @@ | ||
grunt.registerMultiTask('wrapForNode', 'index.js scaffolding task.', function () { | ||
grunt.log.writeln('Generating index.js'); | ||
grunt.log.writeln('Generating first pass index.js'); | ||
var setup = this.files.pop(); | ||
var code = 'var inNewContext = require("lodash").runInContext();\n'; | ||
code += 'inNewContext = (' + sandboxCode + ')(inNewContext);\n'; | ||
var code = sandboxCode.code; | ||
code += 'var inNewContext = ' + sandboxCode.name + '(require("lodash").runInContext());\n\n'; | ||
code += setup.src.reduce(function (seed, val) { return seed + 'require("./' + val + '")(inNewContext);\n'; }, ''); | ||
code += 'module.exports = inNewContext;\n'; | ||
grunt.file.write('index.js', code); | ||
code += '\n\nmodule.exports = inNewContext;\n'; | ||
grunt.file.write(setup.dst, code); | ||
grunt.log.writeln('Adding explicit method names in index.js'); | ||
var ctrb1 = require('./' + setup.dst); | ||
Object.keys(ctrb1).forEach(function (name) { | ||
var len = Math.max(20 - name.length, 2); | ||
var arr = new Array(len); | ||
var aligner = arr.join(' '); | ||
code += 'module.exports.' + name + aligner + ' = inNewContext.' + name + ';\n'; | ||
}); | ||
grunt.file.write(setup.dst, code); | ||
}); | ||
@@ -194,5 +207,5 @@ | ||
grunt.registerTask('gen', ['webGen', 'nodeGen']); | ||
grunt.registerTask('test', ['gen', 'jshint', 'qunit:main', 'mochaTest']); | ||
grunt.registerTask('dist', ['test', 'concat', 'qunit:concat', 'uglify', 'qunit:min', 'browserify:test', 'qunit:browserified']); | ||
grunt.registerTask('test', ['gen', 'jshint', 'qunit:main', 'mochaTest', 'browserify:test', 'qunit:browserified']); | ||
grunt.registerTask('dist', ['test', 'concat', 'qunit:concat', 'uglify', 'qunit:min']); | ||
grunt.registerTask('default', ['dist']); | ||
}; |
{ | ||
"name": "lodash-contrib", | ||
"description": "The brass buckles on lodash's utility belt", | ||
"version": "241.4.10", | ||
"main": "index.js", | ||
"version": "241.4.11", | ||
"main": "lodash-contrib.js", | ||
"dependencies": { | ||
@@ -10,5 +10,5 @@ "lodash": "2.4.1" | ||
"devDependencies": { | ||
"browserify": "^4.1.8", | ||
"browserify": "", | ||
"grunt": "", | ||
"grunt-browserify": "^2.1.0", | ||
"grunt-browserify": "", | ||
"grunt-cli": "", | ||
@@ -15,0 +15,0 @@ "grunt-contrib-concat": "", |
@@ -33,6 +33,7 @@ The brass buckles on lodash's utility belt | ||
like the following to your pages: | ||
```html | ||
<script src="lodash.js"></script> | ||
<script src="lodash.object.builders.js"></script> | ||
``` | ||
<script type="text/javascript" src="lodash.js"></script> | ||
<script type="text/javascript" src="lodash.object.builders.js"></script> | ||
At the moment there are no cross-contrib dependencies (i.e. each library can stand by itself), but that may | ||
@@ -64,5 +65,1 @@ change in the future. | ||
What do these mean? Well, that’s up for discussion. :-) | ||
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/Empeeric/lodash-contrib/trend.png)](https://bitdeli.com/free "Bitdeli Badge") | ||
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
1541989
29410
64
6