mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27:49 +00:00
Bump to v3.1.1.
This commit is contained in:
committed by
John-David Dalton
parent
27d65e814a
commit
971ec866a8
@@ -1,4 +1,4 @@
|
||||
# lodash.pad v3.1.0
|
||||
# lodash.pad v3.1.1
|
||||
|
||||
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.pad` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
|
||||
|
||||
@@ -17,4 +17,4 @@ In Node.js/io.js:
|
||||
var pad = require('lodash.pad');
|
||||
```
|
||||
|
||||
See the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.pad) for more details.
|
||||
See the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/3.1.1-npm-packages/lodash.pad) for more details.
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
/**
|
||||
* lodash 3.1.0 (Custom Build) <https://lodash.com/>
|
||||
* lodash 3.1.1 (Custom Build) <https://lodash.com/>
|
||||
* Build: `lodash modern modularize exports="npm" -o ./`
|
||||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
||||
* Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE>
|
||||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
* Available under MIT license <https://lodash.com/license>
|
||||
*/
|
||||
var baseToString = require('lodash._basetostring'),
|
||||
createPadding = require('lodash._createpadding');
|
||||
|
||||
/** Native method references. */
|
||||
var ceil = Math.ceil,
|
||||
floor = Math.floor;
|
||||
|
||||
/* Native method references for those with the same name as other `lodash` methods. */
|
||||
var nativeIsFinite = global.isFinite;
|
||||
var nativeCeil = Math.ceil,
|
||||
nativeFloor = Math.floor,
|
||||
nativeIsFinite = global.isFinite;
|
||||
|
||||
/**
|
||||
* Pads `string` on the left and right sides if it's shorter than `length`.
|
||||
@@ -47,8 +45,8 @@ function pad(string, length, chars) {
|
||||
return string;
|
||||
}
|
||||
var mid = (length - strLength) / 2,
|
||||
leftLength = floor(mid),
|
||||
rightLength = ceil(mid);
|
||||
leftLength = nativeFloor(mid),
|
||||
rightLength = nativeCeil(mid);
|
||||
|
||||
chars = createPadding('', rightLength, chars);
|
||||
return chars.slice(0, leftLength) + string + chars;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lodash.pad",
|
||||
"version": "3.1.0",
|
||||
"version": "3.1.1",
|
||||
"description": "The modern build of lodash’s `_.pad` as a module.",
|
||||
"homepage": "https://lodash.com/",
|
||||
"icon": "https://lodash.com/icon.svg",
|
||||
|
||||
Reference in New Issue
Block a user