Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / internal / createPadDir.js
1 var baseToString = require('./baseToString'),
2     createPadding = require('./createPadding');
3
4 /**
5  * Creates a function for `_.padLeft` or `_.padRight`.
6  *
7  * @private
8  * @param {boolean} [fromRight] Specify padding from the right.
9  * @returns {Function} Returns the new pad function.
10  */
11 function createPadDir(fromRight) {
12   return function(string, length, chars) {
13     string = baseToString(string);
14     return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);
15   };
16 }
17
18 module.exports = createPadDir;