From 3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 Mon Sep 17 00:00:00 2001 From: Minteck Date: Thu, 23 Feb 2023 19:34:56 +0100 Subject: Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated) --- .../school/node_modules/lodash/toInteger.js | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 includes/external/school/node_modules/lodash/toInteger.js (limited to 'includes/external/school/node_modules/lodash/toInteger.js') diff --git a/includes/external/school/node_modules/lodash/toInteger.js b/includes/external/school/node_modules/lodash/toInteger.js new file mode 100644 index 0000000..c6aadf8 --- /dev/null +++ b/includes/external/school/node_modules/lodash/toInteger.js @@ -0,0 +1,36 @@ +var toFinite = require('./toFinite'); + +/** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ +function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; +} + +module.exports = toInteger; -- cgit