Remove semicolons.

This commit is contained in:
John-David Dalton
2017-02-04 23:50:10 -08:00
parent f3a8e55e70
commit 6cb3460fce
452 changed files with 4261 additions and 4261 deletions

32
size.js
View File

@@ -1,12 +1,12 @@
import baseKeys from './.internal/baseKeys.js';
import getTag from './.internal/getTag.js';
import isArrayLike from './isArrayLike.js';
import isString from './isString.js';
import stringSize from './.internal/stringSize.js';
import baseKeys from './.internal/baseKeys.js'
import getTag from './.internal/getTag.js'
import isArrayLike from './isArrayLike.js'
import isString from './isString.js'
import stringSize from './.internal/stringSize.js'
/** `Object#toString` result references. */
const mapTag = '[object Map]';
const setTag = '[object Set]';
const mapTag = '[object Map]'
const setTag = '[object Set]'
/**
* Gets the size of `collection` by returning its length for array-like
@@ -18,27 +18,27 @@ const setTag = '[object Set]';
* @returns {number} Returns the collection size.
* @example
*
* size([1, 2, 3]);
* size([1, 2, 3])
* // => 3
*
* size({ 'a': 1, 'b': 2 });
* size({ 'a': 1, 'b': 2 })
* // => 2
*
* size('pebbles');
* size('pebbles')
* // => 7
*/
function size(collection) {
if (collection == null) {
return 0;
return 0
}
if (isArrayLike(collection)) {
return isString(collection) ? stringSize(collection) : collection.length;
return isString(collection) ? stringSize(collection) : collection.length
}
const tag = getTag(collection);
const tag = getTag(collection)
if (tag == mapTag || tag == setTag) {
return collection.size;
return collection.size
}
return baseKeys(collection).length;
return baseKeys(collection).length
}
export default size;
export default size