From aeaf01ac0a0f84fdeebd919e6082dca6740c767f Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 12 Aug 2016 13:47:12 -0700 Subject: [PATCH] Bump to v3.10.0. --- README.md | 2 +- lodash.ceil/LICENSE | 22 +++++++++ lodash.ceil/README.md | 20 ++++++++ lodash.ceil/index.js | 54 ++++++++++++++++++++++ lodash.ceil/package.json | 19 ++++++++ lodash.defaultsdeep/LICENSE | 22 +++++++++ lodash.defaultsdeep/README.md | 20 ++++++++ lodash.defaultsdeep/index.js | 63 +++++++++++++++++++++++++ lodash.defaultsdeep/package.json | 23 ++++++++++ lodash.floor/LICENSE | 22 +++++++++ lodash.floor/README.md | 20 ++++++++ lodash.floor/index.js | 54 ++++++++++++++++++++++ lodash.floor/package.json | 19 ++++++++ lodash.modargs/LICENSE | 22 +++++++++ lodash.modargs/README.md | 20 ++++++++ lodash.modargs/index.js | 79 ++++++++++++++++++++++++++++++++ lodash.modargs/package.json | 24 ++++++++++ lodash.round/LICENSE | 22 +++++++++ lodash.round/README.md | 20 ++++++++ lodash.round/index.js | 54 ++++++++++++++++++++++ lodash.round/package.json | 19 ++++++++ 21 files changed, 619 insertions(+), 1 deletion(-) create mode 100644 lodash.ceil/LICENSE create mode 100644 lodash.ceil/README.md create mode 100644 lodash.ceil/index.js create mode 100644 lodash.ceil/package.json create mode 100644 lodash.defaultsdeep/LICENSE create mode 100644 lodash.defaultsdeep/README.md create mode 100644 lodash.defaultsdeep/index.js create mode 100644 lodash.defaultsdeep/package.json create mode 100644 lodash.floor/LICENSE create mode 100644 lodash.floor/README.md create mode 100644 lodash.floor/index.js create mode 100644 lodash.floor/package.json create mode 100644 lodash.modargs/LICENSE create mode 100644 lodash.modargs/README.md create mode 100644 lodash.modargs/index.js create mode 100644 lodash.modargs/package.json create mode 100644 lodash.round/LICENSE create mode 100644 lodash.round/README.md create mode 100644 lodash.round/index.js create mode 100644 lodash.round/package.json diff --git a/README.md b/README.md index 750069183..e64608192 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lodash v3.9.2 +# lodash v3.10.0 The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method. diff --git a/lodash.ceil/LICENSE b/lodash.ceil/LICENSE new file mode 100644 index 000000000..9cd87e5dc --- /dev/null +++ b/lodash.ceil/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.ceil/README.md b/lodash.ceil/README.md new file mode 100644 index 000000000..0693c0121 --- /dev/null +++ b/lodash.ceil/README.md @@ -0,0 +1,20 @@ +# lodash.ceil v3.10.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.ceil` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.ceil +``` + +In Node.js/io.js: + +```js +var ceil = require('lodash.ceil'); +``` + +See the [documentation](https://lodash.com/docs#ceil) or [package source](https://github.com/lodash/lodash/blob/3.10.0-npm-packages/lodash.ceil) for more details. diff --git a/lodash.ceil/index.js b/lodash.ceil/index.js new file mode 100644 index 000000000..5bf35a36c --- /dev/null +++ b/lodash.ceil/index.js @@ -0,0 +1,54 @@ +/** + * lodash 3.10.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Native method references. */ +var pow = Math.pow; + +/** + * Creates a `_.ceil`, `_.floor`, or `_.round` function. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ +function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + precision = precision === undefined ? 0 : (+precision || 0); + if (precision) { + precision = pow(10, precision); + return func(number * precision) / precision; + } + return func(number); + }; +} + +/** + * Calculates `n` rounded up to `precision`. + * + * @static + * @memberOf _ + * @category Math + * @param {number} n The number to round up. + * @param {number} [precision=0] The precision to round up to. + * @returns {number} Returns the rounded up number. + * @example + * + * _.ceil(4.006); + * // => 5 + * + * _.ceil(6.004, 2); + * // => 6.01 + * + * _.ceil(6040, -2); + * // => 6100 + */ +var ceil = createRound('ceil'); + +module.exports = ceil; diff --git a/lodash.ceil/package.json b/lodash.ceil/package.json new file mode 100644 index 000000000..093cc8fa6 --- /dev/null +++ b/lodash.ceil/package.json @@ -0,0 +1,19 @@ +{ + "name": "lodash.ceil", + "version": "3.10.0", + "description": "The modern build of lodash’s `_.ceil` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash, lodash-modularized, stdlib, util", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Benjamin Tan (https://d10.github.io/)", + "Blaine Bublitz (http://www.iceddev.com/)", + "Kit Cambridge (http://kitcambridge.be/)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/lodash.defaultsdeep/LICENSE b/lodash.defaultsdeep/LICENSE new file mode 100644 index 000000000..9cd87e5dc --- /dev/null +++ b/lodash.defaultsdeep/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.defaultsdeep/README.md b/lodash.defaultsdeep/README.md new file mode 100644 index 000000000..7473d5089 --- /dev/null +++ b/lodash.defaultsdeep/README.md @@ -0,0 +1,20 @@ +# lodash.defaultsdeep v3.10.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.defaultsDeep` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.defaultsdeep +``` + +In Node.js/io.js: + +```js +var defaultsDeep = require('lodash.defaultsdeep'); +``` + +See the [documentation](https://lodash.com/docs#defaultsDeep) or [package source](https://github.com/lodash/lodash/blob/3.10.0-npm-packages/lodash.defaultsdeep) for more details. diff --git a/lodash.defaultsdeep/index.js b/lodash.defaultsdeep/index.js new file mode 100644 index 000000000..68f7d46df --- /dev/null +++ b/lodash.defaultsdeep/index.js @@ -0,0 +1,63 @@ +/** + * lodash 3.10.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var merge = require('lodash.merge'), + restParam = require('lodash.restparam'); + +/** + * Creates a `_.defaults` or `_.defaultsDeep` function. + * + * @private + * @param {Function} assigner The function to assign values. + * @param {Function} customizer The function to customize assigned values. + * @returns {Function} Returns the new defaults function. + */ +function createDefaults(assigner, customizer) { + return restParam(function(args) { + var object = args[0]; + if (object == null) { + return object; + } + args.push(customizer); + return assigner.apply(undefined, args); + }); +} + +/** + * Used by `_.defaultsDeep` to customize its `_.merge` use. + * + * @private + * @param {*} objectValue The destination object property value. + * @param {*} sourceValue The source object property value. + * @returns {*} Returns the value to assign to the destination object. + */ +function mergeDefaults(objectValue, sourceValue) { + return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults); +} + +/** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } }); + * // => { 'user': { 'name': 'barney', 'age': 36 } } + * + */ +var defaultsDeep = createDefaults(merge, mergeDefaults); + +module.exports = defaultsDeep; diff --git a/lodash.defaultsdeep/package.json b/lodash.defaultsdeep/package.json new file mode 100644 index 000000000..0002e750b --- /dev/null +++ b/lodash.defaultsdeep/package.json @@ -0,0 +1,23 @@ +{ + "name": "lodash.defaultsdeep", + "version": "3.10.0", + "description": "The modern build of lodash’s `_.defaultsDeep` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash, lodash-modularized, stdlib, util", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Benjamin Tan (https://d10.github.io/)", + "Blaine Bublitz (http://www.iceddev.com/)", + "Kit Cambridge (http://kitcambridge.be/)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, + "dependencies": { + "lodash.merge": "^3.0.0", + "lodash.restparam": "^3.0.0" + } +} diff --git a/lodash.floor/LICENSE b/lodash.floor/LICENSE new file mode 100644 index 000000000..9cd87e5dc --- /dev/null +++ b/lodash.floor/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.floor/README.md b/lodash.floor/README.md new file mode 100644 index 000000000..567004142 --- /dev/null +++ b/lodash.floor/README.md @@ -0,0 +1,20 @@ +# lodash.floor v3.10.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.floor` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.floor +``` + +In Node.js/io.js: + +```js +var floor = require('lodash.floor'); +``` + +See the [documentation](https://lodash.com/docs#floor) or [package source](https://github.com/lodash/lodash/blob/3.10.0-npm-packages/lodash.floor) for more details. diff --git a/lodash.floor/index.js b/lodash.floor/index.js new file mode 100644 index 000000000..9b635af03 --- /dev/null +++ b/lodash.floor/index.js @@ -0,0 +1,54 @@ +/** + * lodash 3.10.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Native method references. */ +var pow = Math.pow; + +/** + * Creates a `_.ceil`, `_.floor`, or `_.round` function. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ +function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + precision = precision === undefined ? 0 : (+precision || 0); + if (precision) { + precision = pow(10, precision); + return func(number * precision) / precision; + } + return func(number); + }; +} + +/** + * Calculates `n` rounded down to `precision`. + * + * @static + * @memberOf _ + * @category Math + * @param {number} n The number to round down. + * @param {number} [precision=0] The precision to round down to. + * @returns {number} Returns the rounded down number. + * @example + * + * _.floor(4.006); + * // => 4 + * + * _.floor(0.046, 2); + * // => 0.04 + * + * _.floor(4060, -2); + * // => 4000 + */ +var floor = createRound('floor'); + +module.exports = floor; diff --git a/lodash.floor/package.json b/lodash.floor/package.json new file mode 100644 index 000000000..6b43355a7 --- /dev/null +++ b/lodash.floor/package.json @@ -0,0 +1,19 @@ +{ + "name": "lodash.floor", + "version": "3.10.0", + "description": "The modern build of lodash’s `_.floor` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash, lodash-modularized, stdlib, util", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Benjamin Tan (https://d10.github.io/)", + "Blaine Bublitz (http://www.iceddev.com/)", + "Kit Cambridge (http://kitcambridge.be/)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/lodash.modargs/LICENSE b/lodash.modargs/LICENSE new file mode 100644 index 000000000..9cd87e5dc --- /dev/null +++ b/lodash.modargs/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.modargs/README.md b/lodash.modargs/README.md new file mode 100644 index 000000000..b2f130272 --- /dev/null +++ b/lodash.modargs/README.md @@ -0,0 +1,20 @@ +# lodash.modargs v3.10.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.modArgs` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.modargs +``` + +In Node.js/io.js: + +```js +var modArgs = require('lodash.modargs'); +``` + +See the [documentation](https://lodash.com/docs#modArgs) or [package source](https://github.com/lodash/lodash/blob/3.10.0-npm-packages/lodash.modargs) for more details. diff --git a/lodash.modargs/index.js b/lodash.modargs/index.js new file mode 100644 index 000000000..21c40ffac --- /dev/null +++ b/lodash.modargs/index.js @@ -0,0 +1,79 @@ +/** + * lodash 3.10.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var arrayEvery = require('lodash._arrayevery'), + baseFlatten = require('lodash._baseflatten'), + restParam = require('lodash.restparam'); + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * The base implementation of `_.isFunction` without support for environments + * with incorrect `typeof` results. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + */ +function baseIsFunction(value) { + // Avoid a Chakra JIT bug in compatibility modes of IE 11. + // See https://github.com/jashkenas/underscore/issues/1621 for more details. + return typeof value == 'function' || false; +} + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Creates a function that runs each argument through a corresponding + * transform function. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms] The functions to transform + * arguments, specified as individual functions or arrays of functions. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var modded = _.modArgs(function(x, y) { + * return [x, y]; + * }, square, doubled); + * + * modded(1, 2); + * // => [1, 4] + * + * modded(5, 10); + * // => [25, 20] + */ +var modArgs = restParam(function(func, transforms) { + transforms = baseFlatten(transforms); + if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = transforms.length; + return restParam(function(args) { + var index = nativeMin(args.length, length); + while (index--) { + args[index] = transforms[index](args[index]); + } + return func.apply(this, args); + }); +}); + +module.exports = modArgs; diff --git a/lodash.modargs/package.json b/lodash.modargs/package.json new file mode 100644 index 000000000..f6fc8219c --- /dev/null +++ b/lodash.modargs/package.json @@ -0,0 +1,24 @@ +{ + "name": "lodash.modargs", + "version": "3.10.0", + "description": "The modern build of lodash’s `_.modArgs` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash, lodash-modularized, stdlib, util", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Benjamin Tan (https://d10.github.io/)", + "Blaine Bublitz (http://www.iceddev.com/)", + "Kit Cambridge (http://kitcambridge.be/)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, + "dependencies": { + "lodash._arrayevery": "^3.0.0", + "lodash._baseflatten": "^3.0.0", + "lodash.restparam": "^3.0.0" + } +} diff --git a/lodash.round/LICENSE b/lodash.round/LICENSE new file mode 100644 index 000000000..9cd87e5dc --- /dev/null +++ b/lodash.round/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.round/README.md b/lodash.round/README.md new file mode 100644 index 000000000..d655edfa2 --- /dev/null +++ b/lodash.round/README.md @@ -0,0 +1,20 @@ +# lodash.round v3.10.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.round` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.round +``` + +In Node.js/io.js: + +```js +var round = require('lodash.round'); +``` + +See the [documentation](https://lodash.com/docs#round) or [package source](https://github.com/lodash/lodash/blob/3.10.0-npm-packages/lodash.round) for more details. diff --git a/lodash.round/index.js b/lodash.round/index.js new file mode 100644 index 000000000..1fef322d8 --- /dev/null +++ b/lodash.round/index.js @@ -0,0 +1,54 @@ +/** + * lodash 3.10.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Native method references. */ +var pow = Math.pow; + +/** + * Creates a `_.ceil`, `_.floor`, or `_.round` function. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ +function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + precision = precision === undefined ? 0 : (+precision || 0); + if (precision) { + precision = pow(10, precision); + return func(number * precision) / precision; + } + return func(number); + }; +} + +/** + * Calculates `n` rounded to `precision`. + * + * @static + * @memberOf _ + * @category Math + * @param {number} n The number to round. + * @param {number} [precision=0] The precision to round to. + * @returns {number} Returns the rounded number. + * @example + * + * _.round(4.006); + * // => 4 + * + * _.round(4.006, 2); + * // => 4.01 + * + * _.round(4060, -2); + * // => 4100 + */ +var round = createRound('round'); + +module.exports = round; diff --git a/lodash.round/package.json b/lodash.round/package.json new file mode 100644 index 000000000..626e463a3 --- /dev/null +++ b/lodash.round/package.json @@ -0,0 +1,19 @@ +{ + "name": "lodash.round", + "version": "3.10.0", + "description": "The modern build of lodash’s `_.round` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash, lodash-modularized, stdlib, util", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Benjamin Tan (https://d10.github.io/)", + "Blaine Bublitz (http://www.iceddev.com/)", + "Kit Cambridge (http://kitcambridge.be/)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +}