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