From 291803c31f829fe0d32bb3207bc11def95a7408c Mon Sep 17 00:00:00 2001 From: Nevena Bojovic Date: Tue, 1 Mar 2022 20:05:50 +0100 Subject: Urađena test aplikacija. Povezan front i back. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../node_modules/lodash/_createMathOperation.js | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 sandbox/testAppNevena/Front/node_modules/lodash/_createMathOperation.js (limited to 'sandbox/testAppNevena/Front/node_modules/lodash/_createMathOperation.js') diff --git a/sandbox/testAppNevena/Front/node_modules/lodash/_createMathOperation.js b/sandbox/testAppNevena/Front/node_modules/lodash/_createMathOperation.js new file mode 100644 index 00000000..f1e238ac --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/lodash/_createMathOperation.js @@ -0,0 +1,38 @@ +var baseToNumber = require('./_baseToNumber'), + baseToString = require('./_baseToString'); + +/** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ +function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; +} + +module.exports = createMathOperation; -- cgit v1.2.3