Update of multiple frontend libs.

This commit is contained in:
baldo 2017-05-13 13:25:33 +02:00
parent de261dbde5
commit a9c6ddc03b
276 changed files with 41257 additions and 19300 deletions
app/bower_components/lodash/lib/common

View file

@ -1,11 +1,11 @@
'use strict';
var _ = require('lodash'),
fs = require('fs-extra'),
glob = require('glob'),
path = require('path');
const _ = require('lodash');
const fs = require('fs-extra');
const glob = require('glob');
const path = require('path');
var minify = require('../common/minify.js');
const minify = require('../common/minify.js');
/*----------------------------------------------------------------------------*/
@ -23,15 +23,15 @@ function copy(srcPath, destPath) {
}
/**
* Creates an object of compiled template and base name pairs that match `pattern`.
* Creates an object of base name and compiled template pairs that match `pattern`.
*
* @memberOf file
* @param {string} pattern The glob pattern to be match.
* @returns {Object} Returns the object of compiled templates.
*/
function globTemplate(pattern) {
return _.transform(glob.sync(pattern), function(result, filePath) {
var key = path.basename(filePath, path.extname(filePath));
return _.transform(glob.sync(pattern), (result, filePath) => {
const key = path.basename(filePath, path.extname(filePath));
result[key] = _.template(fs.readFileSync(filePath, 'utf8'));
}, {});
}
@ -64,8 +64,8 @@ function write(destPath, data) {
/*----------------------------------------------------------------------------*/
module.exports = {
'copy': copy,
'globTemplate': globTemplate,
'min': min,
'write': write
copy,
globTemplate,
min,
write
};

View file

@ -1,8 +1,8 @@
'use strict';
var _mapping = require('../../fp/_mapping'),
util = require('./util'),
Hash = util.Hash;
const _mapping = require('../../fp/_mapping');
const util = require('./util');
const Hash = util.Hash;
/*----------------------------------------------------------------------------*/

View file

@ -1,10 +1,10 @@
'use strict';
var _ = require('lodash'),
fs = require('fs-extra'),
uglify = require('uglify-js');
const _ = require('lodash');
const fs = require('fs-extra');
const uglify = require('uglify-js');
var uglifyOptions = require('./uglify.options');
const uglifyOptions = require('./uglify.options');
/*----------------------------------------------------------------------------*/
@ -13,8 +13,8 @@ var uglifyOptions = require('./uglify.options');
* invokes `callback` upon completion. The callback is invoked with one argument:
* (error).
*
* If unspecified, `destPath` is `srcPath` with an extension of `.min.js`. For
* example, a `srcPath` of `path/to/foo.js` would have a `destPath` of `path/to/foo.min.js`.
* If unspecified, `destPath` is `srcPath` with an extension of `.min.js`.
* (e.g. the `destPath` of `path/to/foo.js` would be `path/to/foo.min.js`)
*
* @param {string} srcPath The path of the file to minify.
* @param {string} [destPath] The path to write the file to.
@ -32,7 +32,7 @@ function minify(srcPath, destPath, callback, options) {
if (!destPath) {
destPath = srcPath.replace(/(?=\.js$)/, '.min');
}
var output = uglify.minify(srcPath, _.defaults(options || {}, uglifyOptions));
const output = uglify.minify(srcPath, _.defaults(options || {}, uglifyOptions));
fs.writeFile(destPath, output.code, 'utf-8', callback);
}

View file

@ -8,16 +8,15 @@
*/
module.exports = {
'compress': {
'collapse_vars': true,
'negate_iife': false,
'pure_getters': true,
'unsafe': true,
'warnings': false
},
'mangle': {
'except': ['define']
},
'output': {
'ascii_only': true,
'comments': /^!|@cc_on|@license|@preserve/i,
'comments': /@license/,
'max_line_len': 500
}
};

View file

@ -1,19 +1,19 @@
'use strict';
var _ = require('lodash');
const _ = require('lodash');
/*----------------------------------------------------------------------------*/
/**
* Creates a hash object. If a `properties` object is provided, its own
* enumerable properties are assigned to the created object.
* enumerable properties are assigned to the created hash.
*
* @memberOf util
* @param {Object} [properties] The properties to assign to the object.
* @param {Object} [properties] The properties to assign to the hash.
* @returns {Object} Returns the new hash object.
*/
function Hash(properties) {
return _.transform(properties, function(result, value, key) {
return _.transform(properties, (result, value, key) => {
result[key] = (_.isPlainObject(value) && !(value instanceof Hash))
? new Hash(value)
: value;
@ -22,6 +22,19 @@ function Hash(properties) {
Hash.prototype = Object.create(null);
/**
* This method throws any error it receives.
*
* @memberOf util
* @param {Object} [error] The error object.
*/
function pitch(error) {
if (error != null) {
throw error;
}
}
module.exports = {
'Hash': Hash
Hash,
pitch
};