X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2Fsubtract.js;fp=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2Fsubtract.js;h=9ce53f2a36e2c889c998b45fcc3191a88d7dd85f;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/grunt-legacy-util/node_modules/lodash/subtract.js b/node_modules/grunt-legacy-util/node_modules/lodash/subtract.js new file mode 100644 index 000000000..9ce53f2a3 --- /dev/null +++ b/node_modules/grunt-legacy-util/node_modules/lodash/subtract.js @@ -0,0 +1,29 @@ +/** + * Subtract two numbers. + * + * @static + * @memberOf _ + * @category Math + * @param {number} minuend The first number in a subtraction. + * @param {number} subtrahend The second number in a subtraction. + * @returns {number} Returns the difference. + * @example + * + * _.subtract(6, 4); + * // => 2 + */ +function subtract(minuend, subtrahend) { + var result; + if (minuend === undefined && subtrahend === undefined) { + return 0; + } + if (minuend !== undefined) { + result = minuend; + } + if (subtrahend !== undefined) { + result = result === undefined ? subtrahend : (result - subtrahend); + } + return result; +} + +module.exports = subtract;