mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +00:00
Fix typos.
This commit is contained in:
@@ -19,7 +19,8 @@
|
|||||||
function filterObject(object, predicate) {
|
function filterObject(object, predicate) {
|
||||||
const result = []
|
const result = []
|
||||||
Object.keys(Object(object)).forEach((key) => {
|
Object.keys(Object(object)).forEach((key) => {
|
||||||
if (predicate(object[key], key, object)) {
|
const value = object[key]
|
||||||
|
if (predicate(value, key, object)) {
|
||||||
result.push(value)
|
result.push(value)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
* @param {Object} object The object to iterate over.
|
* @param {Object} object The object to iterate over.
|
||||||
* @param {Function} iteratee The function invoked per iteration.
|
* @param {Function} iteratee The function invoked per iteration.
|
||||||
* @returns {Object} Returns the new mapped object.
|
* @returns {Object} Returns the new mapped object.
|
||||||
* @see mapValues
|
* @see mapValue
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* mapKey({ 'a': 1, 'b': 2 }, function(value, key) {
|
* mapKey({ 'a': 1, 'b': 2 }, function(value, key) {
|
||||||
@@ -26,4 +26,4 @@ function mapKey(object, iteratee) {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
export default mapKeys
|
export default mapKey
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
* // => [16, 64] (iteration order is not guaranteed)
|
* // => [16, 64] (iteration order is not guaranteed)
|
||||||
*/
|
*/
|
||||||
function mapObject(object, iteratee) {
|
function mapObject(object, iteratee) {
|
||||||
const props = Object.keys(object);
|
const props = Object.keys(object)
|
||||||
const result = new Array(props.length)
|
const result = new Array(props.length)
|
||||||
|
|
||||||
props.forEach((key, index) => {
|
props.forEach((key, index) => {
|
||||||
|
|||||||
@@ -23,9 +23,9 @@
|
|||||||
function mapValue(object, iteratee) {
|
function mapValue(object, iteratee) {
|
||||||
const result = {}
|
const result = {}
|
||||||
Object.keys(Object(object)).forEach((key) => {
|
Object.keys(Object(object)).forEach((key) => {
|
||||||
result[key] = iteratee(object[value], key, object)
|
result[key] = iteratee(object[key], key, object)
|
||||||
})
|
})
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
export default mapValues
|
export default mapValue
|
||||||
|
|||||||
Reference in New Issue
Block a user