X-Git-Url: http://repos.xcallymotion.com/?a=blobdiff_plain;f=public%2Fbower_components%2Flodash%2Flib%2Fcommon%2Futil.js;h=64451862d0b9b6b7b3a6c805299caacc9b8eb85a;hb=5d92478b1cb7479f39a43973775a6f6147fba8ac;hp=a0a13558e1f6776f38b822511766ceebc7b98e3f;hpb=6fdab3092eb5921e04b504e7c4b8d9a83a249fb1;p=motion.git diff --git a/public/bower_components/lodash/lib/common/util.js b/public/bower_components/lodash/lib/common/util.js index a0a1355..6445186 100644 --- a/public/bower_components/lodash/lib/common/util.js +++ b/public/bower_components/lodash/lib/common/util.js @@ -1,36 +1,27 @@ 'use strict'; -var _ = require('lodash'), - fs = require('fs-extra'), - glob = require('glob'), - path = require('path'); - -var minify = require('../common/minify.js'); +var _ = require('lodash'); /*----------------------------------------------------------------------------*/ -function copyFile(srcPath, destPath) { - return _.partial(fs.copy, srcPath, destPath); -} - -function globTemplate(pattern) { - return _.transform(glob.sync(pattern), function(result, filePath) { - var key = path.basename(filePath, path.extname(filePath)); - result[key] = _.template(fs.readFileSync(filePath, 'utf8')); - }, {}); +/** + * Creates a hash object. If a `properties` object is provided, its own + * enumerable properties are assigned to the created object. + * + * @memberOf util + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new hash object. + */ +function Hash(properties) { + return _.transform(properties, function(result, value, key) { + result[key] = (_.isPlainObject(value) && !(value instanceof Hash)) + ? new Hash(value) + : value; + }, this); } -function minFile(srcPath, destPath) { - return _.partial(minify, srcPath, destPath); -} - -function writeFile(filePath, data) { - return _.partial(fs.writeFile, filePath, data); -} +Hash.prototype = Object.create(null); module.exports = { - 'copyFile': copyFile, - 'globTemplate': globTemplate, - 'minFile': minFile, - 'writeFile': writeFile + 'Hash': Hash };