mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17:50 +00:00
Fix typos.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user