Fix typos.

This commit is contained in:
John-David Dalton
2017-04-16 08:57:46 -05:00
parent 64a9975488
commit e2941dda3b
4 changed files with 7 additions and 6 deletions

View File

@@ -19,7 +19,8 @@
function filterObject(object, predicate) {
const result = []
Object.keys(Object(object)).forEach((key) => {
if (predicate(object[key], key, object)) {
const value = object[key]
if (predicate(value, key, object)) {
result.push(value)
}
})

View File

@@ -9,7 +9,7 @@
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns the new mapped object.
* @see mapValues
* @see mapValue
* @example
*
* mapKey({ 'a': 1, 'b': 2 }, function(value, key) {
@@ -26,4 +26,4 @@ function mapKey(object, iteratee) {
return result
}
export default mapKeys
export default mapKey

View File

@@ -17,7 +17,7 @@
* // => [16, 64] (iteration order is not guaranteed)
*/
function mapObject(object, iteratee) {
const props = Object.keys(object);
const props = Object.keys(object)
const result = new Array(props.length)
props.forEach((key, index) => {

View File

@@ -23,9 +23,9 @@
function mapValue(object, iteratee) {
const result = {}
Object.keys(Object(object)).forEach((key) => {
result[key] = iteratee(object[value], key, object)
result[key] = iteratee(object[key], key, object)
})
return result
}
export default mapValues
export default mapValue