mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
Bump to v3.1.1.
This commit is contained in:
committed by
John-David Dalton
parent
27d65e814a
commit
971ec866a8
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user