Version 1
[yaffs-website] / node_modules / grunt-legacy-log-utils / node_modules / lodash / unary.js
diff --git a/node_modules/grunt-legacy-log-utils/node_modules/lodash/unary.js b/node_modules/grunt-legacy-log-utils/node_modules/lodash/unary.js
new file mode 100644 (file)
index 0000000..c18ebd8
--- /dev/null
@@ -0,0 +1,21 @@
+var ary = require('./ary');
+
+/**
+ * Creates a function that accepts up to one argument, ignoring any
+ * additional arguments.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to cap arguments for.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * _.map(['6', '8', '10'], _.unary(parseInt));
+ * // => [6, 8, 10]
+ */
+function unary(func) {
+  return ary(func, 1);
+}
+
+module.exports = unary;