nunta/node_modules/grunt-contrib-concat/tasks/lib/comment.js
David Miller 0025e7e961 setting up Gruntfile and dist folder
index.html, mail/, bootstrap and jquery bower components will build to
the dist folder when running grunt
2014-08-12 21:01:38 -04:00

35 lines
892 B
JavaScript

/*
* grunt-contrib-concat
* http://gruntjs.com/
*
* Copyright (c) 2013 "Cowboy" Ben Alman, contributors
* Licensed under the MIT license.
*/
'use strict';
exports.init = function(/*grunt*/) {
var exports = {};
// Return the given source code with any leading banner comment stripped.
exports.stripBanner = function(src, options) {
if (!options) { options = {}; }
var m = [];
if (options.line) {
// Strip // ... leading banners.
m.push('(?:.*\\/\\/.*\\r?\\n)+\\s*');
}
if (options.block) {
// Strips all /* ... */ block comment banners.
m.push('\\/\\*[\\s\\S]*?\\*\\/');
} else {
// Strips only /* ... */ block comment banners, excluding /*! ... */.
m.push('\\/\\*[^!][\\s\\S]*?\\*\\/');
}
var re = new RegExp('^\\s*(?:' + m.join('|') + ')\\s*', '');
return src.replace(re, '');
};
return exports;
};