mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Fixin filter imports.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import arrayFilter from './arrayFilter.js'
|
||||
import filter from '../filter.js'
|
||||
|
||||
/** Built-in value references. */
|
||||
const propertyIsEnumerable = Object.prototype.propertyIsEnumerable
|
||||
@@ -18,7 +18,7 @@ const getSymbols = !nativeGetSymbols ? () => [] : (object) => {
|
||||
return []
|
||||
}
|
||||
object = Object(object)
|
||||
return arrayFilter(nativeGetSymbols(object), (symbol) => propertyIsEnumerable.call(object, symbol))
|
||||
return filter(nativeGetSymbols(object), (symbol) => propertyIsEnumerable.call(object, symbol))
|
||||
}
|
||||
|
||||
export default getSymbols
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import arrayFilter from './.internal/arrayFilter.js'
|
||||
import baseFilter from './.internal/baseFilter.js'
|
||||
import filter from './filter.js'
|
||||
import filterObject from './filterObject.js'
|
||||
import negate from './negate.js'
|
||||
|
||||
/**
|
||||
@@ -23,7 +23,7 @@ import negate from './negate.js'
|
||||
* // => objects for ['fred']
|
||||
*/
|
||||
function reject(collection, predicate) {
|
||||
const func = Array.isArray(collection) ? arrayFilter : baseFilter
|
||||
const func = Array.isArray(collection) ? filter : filterObject
|
||||
return func(collection, negate(predicate))
|
||||
}
|
||||
|
||||
|
||||
4
unzip.js
4
unzip.js
@@ -1,4 +1,4 @@
|
||||
import arrayFilter from './.internal/arrayFilter.js'
|
||||
import filter from './filter.js'
|
||||
import map from './map.js'
|
||||
import baseProperty from './.internal/baseProperty.js'
|
||||
import isArrayLikeObject from './isArrayLikeObject.js'
|
||||
@@ -26,7 +26,7 @@ function unzip(array) {
|
||||
return []
|
||||
}
|
||||
let length = 0
|
||||
array = arrayFilter(array, (group) => {
|
||||
array = filter(array, (group) => {
|
||||
if (isArrayLikeObject(group)) {
|
||||
length = Math.max(group.length, length)
|
||||
return true
|
||||
|
||||
4
xor.js
4
xor.js
@@ -1,4 +1,4 @@
|
||||
import arrayFilter from './.internal/arrayFilter.js'
|
||||
import filter from './filter.js'
|
||||
import baseXor from './.internal/baseXor.js'
|
||||
import isArrayLikeObject from './isArrayLikeObject.js'
|
||||
|
||||
@@ -19,7 +19,7 @@ import isArrayLikeObject from './isArrayLikeObject.js'
|
||||
* // => [1, 3]
|
||||
*/
|
||||
function xor(...arrays) {
|
||||
return baseXor(arrayFilter(arrays, isArrayLikeObject))
|
||||
return baseXor(filter(arrays, isArrayLikeObject))
|
||||
}
|
||||
|
||||
export default xor
|
||||
|
||||
4
xorBy.js
4
xorBy.js
@@ -1,4 +1,4 @@
|
||||
import arrayFilter from './.internal/arrayFilter.js'
|
||||
import filter from './filter.js'
|
||||
import baseXor from './.internal/baseXor.js'
|
||||
import isArrayLikeObject from './isArrayLikeObject.js'
|
||||
import last from './last.js'
|
||||
@@ -26,7 +26,7 @@ function xorBy(...arrays) {
|
||||
if (isArrayLikeObject(iteratee)) {
|
||||
iteratee = undefined
|
||||
}
|
||||
return baseXor(arrayFilter(arrays, isArrayLikeObject), iteratee)
|
||||
return baseXor(filter(arrays, isArrayLikeObject), iteratee)
|
||||
}
|
||||
|
||||
export default xorBy
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import arrayFilter from './.internal/arrayFilter.js'
|
||||
import filter from './filter.js'
|
||||
import baseXor from './.internal/baseXor.js'
|
||||
import isArrayLikeObject from './isArrayLikeObject.js'
|
||||
import last from './last.js'
|
||||
@@ -26,7 +26,7 @@ import last from './last.js'
|
||||
function xorWith(...arrays) {
|
||||
let comparator = last(arrays)
|
||||
comparator = typeof comparator == 'function' ? comparator : undefined
|
||||
return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator)
|
||||
return baseXor(filter(arrays, isArrayLikeObject), undefined, comparator)
|
||||
}
|
||||
|
||||
export default xorWith
|
||||
|
||||
Reference in New Issue
Block a user