Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function(options) {
var builder = new less.Builder();
return function lessMiddleware(req, res, next) {
// handle only GET / HEAD requests
if (!/^(GET|HEAD)$/i.test(req.method)) {
next();
return;
}
var pathname = url.parse(req.url).pathname;
/*
groups (array index):
1 => library name
2 => theme name
3 => theme suffix
grunt.registerMultiTask('openui5_theme', 'OpenUI5 Theme Build', function() {
// Merge task-specific and/or target-specific options with these defaults.
var options = this.options({
rootPaths: [],
rtl: true,
parser: {},
compiler: {}
});
var builder = new less.Builder();
// TODO check no file
// Iterate over all specified file groups.
async.eachSeries(this.files, function(fileObj, nextFileObj) {
var files = fileObj.src.filter(function(filepath) {
// Warn on and remove invalid source files (if nonull was set).
if (!grunt.file.exists(filepath)) {
grunt.log.warn('Source file "' + filepath + '" not found.');
return false;
} else {
return true;
}
});
// TODO check no file
import gulpif from 'gulp-if'
import rename from 'gulp-rename'
import tap from 'gulp-tap'
import uglify from 'gulp-uglify'
import cleanCSS from 'gulp-clean-css'
import ui5preload from 'gulp-ui5-preload'
import lessOpenUI5 from 'less-openui5'
import request from 'request'
import progress from 'request-progress'
import Zip from 'adm-zip'
import { execSync } from 'child_process'
import fs from 'fs'
import path from 'path'
// create a builder instance
const builder = new lessOpenUI5.Builder()
// export functions
export { downloadUI5, buildUI5 }
/**
* Download OpenUI5 repository from external URL and unzip.
*
* @param {string} [sDownloadURL] Download URL of required archive.
* @param {string} [sDownloadPath] Destination path for the download archive and extracted files.
* @param {string} [sUI5Version] Version number of UI5 to create at <code>sDownloadPath</code> a subdirectory named <code>/{{sUI5Version}}</code>.
* @param {Object} [oOptions] Download options.
* @param {function(number,number,{ name: string, progress: number|null}):void} [oOptions.onProgress] Callback function to track download progress taking as params: current step number, total step number and if available, step details (object with name and progress in percent).
* @returns {Promise.string} Promise which resolves to a success or error message.
*/
function downloadUI5(sDownloadURL, sDownloadPath, sUI5Version, oOptions = {}) {
// check params
constructor({fs}) {
this.builder = new less.Builder({fs});
}