Version 1
[yaffs-website] / node_modules / grunt-legacy-log / node_modules / lodash / internal / createPadDir.js
diff --git a/node_modules/grunt-legacy-log/node_modules/lodash/internal/createPadDir.js b/node_modules/grunt-legacy-log/node_modules/lodash/internal/createPadDir.js
new file mode 100644 (file)
index 0000000..da0ebf1
--- /dev/null
@@ -0,0 +1,18 @@
+var baseToString = require('./baseToString'),
+    createPadding = require('./createPadding');
+
+/**
+ * Creates a function for `_.padLeft` or `_.padRight`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify padding from the right.
+ * @returns {Function} Returns the new pad function.
+ */
+function createPadDir(fromRight) {
+  return function(string, length, chars) {
+    string = baseToString(string);
+    return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);
+  };
+}
+
+module.exports = createPadDir;