Skip to content

Commit

Permalink
Remove semicolons.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Feb 6, 2017
1 parent f3a8e55 commit 6cb3460
Show file tree
Hide file tree
Showing 452 changed files with 4,262 additions and 4,262 deletions.
42 changes: 21 additions & 21 deletions .internal/Hash.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** Used to stand-in for `undefined` hash values. */
const HASH_UNDEFINED = '__lodash_hash_undefined__';
const HASH_UNDEFINED = '__lodash_hash_undefined__'

class Hash {

Expand All @@ -11,13 +11,13 @@ class Hash {
* @param {Array} [entries] The key-value pairs to cache.
*/
constructor(entries) {
let index = -1;
const length = entries == null ? 0 : entries.length;
let index = -1
const length = entries == null ? 0 : entries.length

this.clear();
this.clear()
while (++index < length) {
const entry = entries[index];
this.set(entry[0], entry[1]);
const entry = entries[index]
this.set(entry[0], entry[1])
}
}

Expand All @@ -27,8 +27,8 @@ class Hash {
* @memberOf Hash
*/
clear() {
this.__data__ = Object.create(null);
this.size = 0;
this.__data__ = Object.create(null)
this.size = 0
}

/**
Expand All @@ -40,9 +40,9 @@ class Hash {
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
delete(key) {
const result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
const result = this.has(key) && delete this.__data__[key]
this.size -= result ? 1 : 0
return result
}

/**
Expand All @@ -53,9 +53,9 @@ class Hash {
* @returns {*} Returns the entry value.
*/
get(key) {
const data = this.__data__;
const result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
const data = this.__data__
const result = data[key]
return result === HASH_UNDEFINED ? undefined : result
}

/**
Expand All @@ -66,8 +66,8 @@ class Hash {
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
has(key) {
const data = this.__data__;
return data[key] !== undefined;
const data = this.__data__
return data[key] !== undefined
}

/**
Expand All @@ -79,11 +79,11 @@ class Hash {
* @returns {Object} Returns the hash instance.
*/
set(key, value) {
const data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = value === undefined ? HASH_UNDEFINED : value;
return this;
const data = this.__data__
this.size += this.has(key) ? 0 : 1
data[key] = value === undefined ? HASH_UNDEFINED : value
return this
}
}

export default Hash;
export default Hash
56 changes: 28 additions & 28 deletions .internal/ListCache.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assocIndexOf from './assocIndexOf.js';
import assocIndexOf from './assocIndexOf.js'

/** Built-in value references. */
const splice = Array.prototype.splice;
const splice = Array.prototype.splice

class ListCache {

Expand All @@ -13,13 +13,13 @@ class ListCache {
* @param {Array} [entries] The key-value pairs to cache.
*/
constructor(entries) {
let index = -1;
const length = entries == null ? 0 : entries.length;
let index = -1
const length = entries == null ? 0 : entries.length

this.clear();
this.clear()
while (++index < length) {
const entry = entries[index];
this.set(entry[0], entry[1]);
const entry = entries[index]
this.set(entry[0], entry[1])
}
}

Expand All @@ -29,8 +29,8 @@ class ListCache {
* @memberOf ListCache
*/
clear() {
this.__data__ = [];
this.size = 0;
this.__data__ = []
this.size = 0
}

/**
Expand All @@ -41,20 +41,20 @@ class ListCache {
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
delete(key) {
const data = this.__data__;
const index = assocIndexOf(data, key);
const data = this.__data__
const index = assocIndexOf(data, key)

if (index < 0) {
return false;
return false
}
const lastIndex = data.length - 1;
const lastIndex = data.length - 1
if (index == lastIndex) {
data.pop();
data.pop()
} else {
splice.call(data, index, 1);
splice.call(data, index, 1)
}
--this.size;
return true;
--this.size
return true
}

/**
Expand All @@ -65,9 +65,9 @@ class ListCache {
* @returns {*} Returns the entry value.
*/
get(key) {
const data = this.__data__;
const index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
const data = this.__data__
const index = assocIndexOf(data, key)
return index < 0 ? undefined : data[index][1]
}

/**
Expand All @@ -78,7 +78,7 @@ class ListCache {
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
has(key) {
return assocIndexOf(this.__data__, key) > -1;
return assocIndexOf(this.__data__, key) > -1
}

/**
Expand All @@ -90,17 +90,17 @@ class ListCache {
* @returns {Object} Returns the list cache instance.
*/
set(key, value) {
const data = this.__data__;
const index = assocIndexOf(data, key);
const data = this.__data__
const index = assocIndexOf(data, key)

if (index < 0) {
++this.size;
data.push([key, value]);
++this.size
data.push([key, value])
} else {
data[index][1] = value;
data[index][1] = value
}
return this;
return this
}
}

export default ListCache;
export default ListCache
48 changes: 24 additions & 24 deletions .internal/MapCache.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import Hash from './Hash.js';
import ListCache from './ListCache.js';
import Hash from './Hash.js'
import ListCache from './ListCache.js'

/**
* Gets the data for `map`.
Expand All @@ -11,10 +11,10 @@ import ListCache from './ListCache.js';
* @returns {*} Returns the map data.
*/
function getMapData({ __data__ }, key) {
const data = __data__;
const data = __data__
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
: data.map
}

/**
Expand All @@ -25,10 +25,10 @@ function getMapData({ __data__ }, key) {
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
const type = typeof value;
const type = typeof value
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
: (value === null)
}

class MapCache {
Expand All @@ -41,13 +41,13 @@ class MapCache {
* @param {Array} [entries] The key-value pairs to cache.
*/
constructor(entries) {
let index = -1;
const length = entries == null ? 0 : entries.length;
let index = -1
const length = entries == null ? 0 : entries.length

this.clear();
this.clear()
while (++index < length) {
const entry = entries[index];
this.set(entry[0], entry[1]);
const entry = entries[index]
this.set(entry[0], entry[1])
}
}

Expand All @@ -57,12 +57,12 @@ class MapCache {
* @memberOf MapCache
*/
clear() {
this.size = 0;
this.size = 0
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
}

/**
Expand All @@ -73,9 +73,9 @@ class MapCache {
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
delete(key) {
const result = getMapData(this, key)['delete'](key);
this.size -= result ? 1 : 0;
return result;
const result = getMapData(this, key)['delete'](key)
this.size -= result ? 1 : 0
return result
}

/**
Expand All @@ -86,7 +86,7 @@ class MapCache {
* @returns {*} Returns the entry value.
*/
get(key) {
return getMapData(this, key).get(key);
return getMapData(this, key).get(key)
}

/**
Expand All @@ -97,7 +97,7 @@ class MapCache {
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
has(key) {
return getMapData(this, key).has(key);
return getMapData(this, key).has(key)
}

/**
Expand All @@ -109,13 +109,13 @@ class MapCache {
* @returns {Object} Returns the map cache instance.
*/
set(key, value) {
const data = getMapData(this, key);
const size = data.size;
const data = getMapData(this, key)
const size = data.size

data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
data.set(key, value)
this.size += data.size == size ? 0 : 1
return this
}
}

export default MapCache;
export default MapCache
22 changes: 11 additions & 11 deletions .internal/SetCache.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import MapCache from './MapCache.js';
import MapCache from './MapCache.js'

/** Used to stand-in for `undefined` hash values. */
const HASH_UNDEFINED = '__lodash_hash_undefined__';
const HASH_UNDEFINED = '__lodash_hash_undefined__'

class SetCache {

Expand All @@ -13,12 +13,12 @@ class SetCache {
* @param {Array} [values] The values to cache.
*/
constructor(values) {
let index = -1;
const length = values == null ? 0 : values.length;
let index = -1
const length = values == null ? 0 : values.length

this.__data__ = new MapCache;
this.__data__ = new MapCache
while (++index < length) {
this.add(values[index]);
this.add(values[index])
}
}

Expand All @@ -31,8 +31,8 @@ class SetCache {
* @returns {Object} Returns the cache instance.
*/
add(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
this.__data__.set(value, HASH_UNDEFINED)
return this
}

/**
Expand All @@ -43,10 +43,10 @@ class SetCache {
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
has(value) {
return this.__data__.has(value);
return this.__data__.has(value)
}
}

SetCache.prototype.push = SetCache.prototype.add;
SetCache.prototype.push = SetCache.prototype.add

export default SetCache;
export default SetCache
Loading

0 comments on commit 6cb3460

Please sign in to comment.