Fixin new map imports.

This commit is contained in:
Michał Lipiński
2017-04-18 09:33:58 +02:00
parent e5e8f35c06
commit bb059c0f64
14 changed files with 28 additions and 28 deletions

View File

@@ -1,7 +1,7 @@
import SetCache from './SetCache.js'
import arrayIncludes from './arrayIncludes.js'
import arrayIncludesWith from './arrayIncludesWith.js'
import arrayMap from './arrayMap.js'
import map from '../map.js'
import cacheHas from './cacheHas.js'
/** Used as the size to enable large array optimizations. */
@@ -28,7 +28,7 @@ function baseDifference(array, values, iteratee, comparator) {
return result
}
if (iteratee) {
values = arrayMap(values, (value) => iteratee(value))
values = map(values, (value) => iteratee(value))
}
if (comparator) {
includes = arrayIncludesWith

View File

@@ -1,7 +1,7 @@
import SetCache from './SetCache.js'
import arrayIncludes from './arrayIncludes.js'
import arrayIncludesWith from './arrayIncludesWith.js'
import arrayMap from './arrayMap.js'
import map from '../map.js'
import cacheHas from './cacheHas.js'
/**
@@ -28,7 +28,7 @@ function baseIntersection(arrays, iteratee, comparator) {
while (othIndex--) {
array = arrays[othIndex]
if (othIndex && iteratee) {
array = arrayMap(array, (value) => iteratee(value))
array = map(array, (value) => iteratee(value))
}
maxLength = Math.min(array.length, maxLength)
caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))

View File

@@ -1,4 +1,4 @@
import arrayMap from './arrayMap.js'
import map from '../map.js'
import baseIndexOf from './baseIndexOf.js'
import baseIndexOfWith from './baseIndexOfWith.js'
import copyArray from './copyArray.js'
@@ -27,7 +27,7 @@ function basePullAll(array, values, iteratee, comparator) {
values = copyArray(values)
}
if (iteratee) {
seen = arrayMap(array, (value) => iteratee(value))
seen = map(array, (value) => iteratee(value))
}
while (++index < length) {
let fromIndex = 0

View File

@@ -1,4 +1,4 @@
import arrayMap from './.internal/arrayMap.js'
import map from './map.js'
/**
* Creates a function that iterates over `pairs` and invokes the corresponding
@@ -30,7 +30,7 @@ import arrayMap from './.internal/arrayMap.js'
function cond(pairs) {
const length = pairs == null ? 0 : pairs.length
pairs = !length ? [] : arrayMap(pairs, (pair) => {
pairs = !length ? [] : map(pairs, (pair) => {
if (typeof pair[1] != 'function') {
throw new TypeError('Expected a function')
}

View File

@@ -1,4 +1,4 @@
import arrayMap from './.internal/arrayMap.js'
import map from './map.js'
import baseIntersection from './.internal/baseIntersection.js'
import castArrayLikeObject from './.internal/castArrayLikeObject.js'
@@ -18,7 +18,7 @@ import castArrayLikeObject from './.internal/castArrayLikeObject.js'
* // => [2]
*/
function intersection(...arrays) {
const mapped = arrayMap(arrays, castArrayLikeObject)
const mapped = map(arrays, castArrayLikeObject)
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped)
: []

View File

@@ -1,4 +1,4 @@
import arrayMap from './.internal/arrayMap.js'
import map from './map.js'
import baseIntersection from './.internal/baseIntersection.js'
import castArrayLikeObject from './.internal/castArrayLikeObject.js'
import last from './last.js'
@@ -22,7 +22,7 @@ import last from './last.js'
*/
function intersectionBy(...arrays) {
let iteratee = last(arrays)
const mapped = arrayMap(arrays, castArrayLikeObject)
const mapped = map(arrays, castArrayLikeObject)
if (iteratee === last(mapped)) {
iteratee = undefined

View File

@@ -1,4 +1,4 @@
import arrayMap from './.internal/arrayMap.js'
import map from './map.js'
import baseIntersection from './.internal/baseIntersection.js'
import castArrayLikeObject from './.internal/castArrayLikeObject.js'
import last from './last.js'
@@ -24,7 +24,7 @@ import last from './last.js'
*/
function intersectionWith(...arrays) {
let comparator = last(arrays)
const mapped = arrayMap(arrays, castArrayLikeObject)
const mapped = map(arrays, castArrayLikeObject)
comparator = typeof comparator == 'function' ? comparator : undefined
if (comparator) {

View File

@@ -1,4 +1,4 @@
import arrayMap from './.internal/arrayMap.js'
import map from './map.js'
/**
* Creates a function that invokes `iteratees` with the arguments it receives
@@ -18,7 +18,7 @@ import arrayMap from './.internal/arrayMap.js'
*/
function over(iteratees) {
return function(...args) {
return arrayMap(iteratees, (iteratee) => iteratee.apply(this, args))
return map(iteratees, (iteratee) => iteratee.apply(this, args))
}
}

View File

@@ -1,4 +1,4 @@
import arrayMap from './.internal/arrayMap.js'
import map from './map.js'
import basePickBy from './.internal/basePickBy.js'
import getAllKeysIn from './.internal/getAllKeysIn.js'
@@ -22,7 +22,7 @@ function pickBy(object, predicate) {
if (object == null) {
return {}
}
const props = arrayMap(getAllKeysIn(object), (prop) => [prop])
const props = map(getAllKeysIn(object), (prop) => [prop])
return basePickBy(object, props, (value, path) => predicate(value, path[0]))
}

View File

@@ -1,4 +1,4 @@
import arrayMap from './.internal/arrayMap.js'
import map from './map.js'
import baseAt from './.internal/baseAt.js'
import basePullAt from './.internal/basePullAt.js'
import compareAscending from './.internal/compareAscending.js'
@@ -31,7 +31,7 @@ function pullAt(array, ...indexes) {
const length = array == null ? 0 : array.length
const result = baseAt(array, indexes)
basePullAt(array, arrayMap(indexes, (index) => isIndex(index, length) ? +index : index).sort(compareAscending))
basePullAt(array, map(indexes, (index) => isIndex(index, length) ? +index : index).sort(compareAscending))
return result
}

View File

@@ -1,4 +1,4 @@
import arrayMap from './.internal/arrayMap.js'
import map from './map.js'
import copyArray from './.internal/copyArray.js'
import isSymbol from './isSymbol.js'
import stringToPath from './.internal/stringToPath.js'
@@ -21,7 +21,7 @@ import toKey from './.internal/toKey.js'
*/
function toPath(value) {
if (Array.isArray(value)) {
return arrayMap(value, toKey)
return map(value, toKey)
}
return isSymbol(value) ? [value] : copyArray(stringToPath(value))
}

View File

@@ -1,4 +1,4 @@
import arrayMap from './.internal/arrayMap.js'
import map from './map.js'
import isSymbol from './isSymbol.js'
/** Used as references for various `Number` constants. */
@@ -37,7 +37,7 @@ function toString(value) {
}
if (Array.isArray(value)) {
// Recursively convert values (susceptible to call stack limits).
return `${arrayMap(value, (other) => other == null ? other : toString(other))}`
return `${map(value, (other) => other == null ? other : toString(other))}`
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : ''

View File

@@ -1,5 +1,5 @@
import arrayFilter from './.internal/arrayFilter.js'
import arrayMap from './.internal/arrayMap.js'
import map from './map.js'
import baseProperty from './.internal/baseProperty.js'
import isArrayLikeObject from './isArrayLikeObject.js'
@@ -35,7 +35,7 @@ function unzip(array) {
let index = -1
const result = new Array(length)
while (++index < length) {
result[index] = arrayMap(array, baseProperty(index))
result[index] = map(array, baseProperty(index))
}
return result
}

View File

@@ -1,4 +1,4 @@
import arrayMap from './.internal/arrayMap.js'
import map from './map.js'
import unzip from './unzip.js'
/**
@@ -25,7 +25,7 @@ function unzipWith(array, iteratee) {
return []
}
const result = unzip(array)
return arrayMap(result, (group) => iteratee.apply(undefined, group))
return map(result, (group) => iteratee.apply(undefined, group))
}
export default unzipWith