lodash: Fix post-compile.js VERSION detection to allow newlines. [jddalton]

Former-commit-id: 2e0d342cf66c4507a2956eeac912333cfdca5817
This commit is contained in:
John-David Dalton
2012-04-30 22:16:21 -04:00
parent e3f03fa2ce
commit 142ee20bca

View File

@@ -24,7 +24,7 @@
*/
function postprocess(source) {
// set the version
var license = licenseTemplate.replace('@VERSION', (/VERSION:([\'"])(.*?)\1/).exec(source).pop());
var license = licenseTemplate.replace('@VERSION', (/VERSION\s*:\s*([\'"])(.*?)\1/).exec(source).pop());
// move vars exposed by Closure Compiler into the IIFE
source = source.replace(/^([^(\n]+)\s*(\(function[^)]+\){)/, '$2$1');
// use double quotes consistently