You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a matrix comparing JS array API, PHP anc Chain.
I've matched the methods when possible.
I haven't dig into JS objects API, nor lodash or reactivex yet.
TODO: implement, what would be a good name? walk, or tap (used in reactivex, also used in lodash but with different semantic) or peek (used in java streams API)
❕
array_walk_recursive
TODO: implement as an option
✔️
keys
array_keys
keys
❕
flat
TODO: implement
✔️
flatMap
flatMap
✔️
map
map
❌
array_map
PHP implementation is… let's just say it's weird. Better not reuse that.
TODO: implement for orthogonality, we already have the methods for the values
❕
array_key_last
TODO: implement for orthogonality, we already have the methods for the values
✔️
array_replace
replace
❔
array_replace_recursive
should replace have a recursive option, like merge ?
✔️
array_change_key_case
changeKeyCase
❕
array_chunk
TODO: implement
❕
array_column
TODO: implement, I think pluck (used in underscore, lodash, data tables, …) would be a better name
✔️
array_count_values
countValues
✔️
uasort
sort (with callable parameter and option assoc = true)
✔️
sort
usort
sort (with callable parameter)
✔️
arsort
sort (with option assoc = true and reverse = true)
✔️
asort
sort (with option assoc = true)
✔️
rsort
sort (with option reverse = true)
✔️
sort
sort
sort
✔️
uksort
sortKeys (with callable parameter)
✔️
krsort
sortKeys (with option reverse = true)
✔️
ksort
sortKeys
✔️
array_diff
diff
❔
array_diff_assoc
shouldn't diff have a bunch of options like sort ?
❔
array_diff_key
shouldn't diff have a bunch of options like sort ?
❔
array_diff_uassoc
shouldn't diff have a bunch of options like sort ?
❔
array_diff_ukey
shouldn't diff have a bunch of options like sort ?
❔
array_udiff
shouldn't diff have a bunch of options like sort ?
❔
array_udiff_assoc
shouldn't diff have a bunch of options like sort ?
❔
array_udiff_uassoc
shouldn't diff have a bunch of options like sort ?
✔️
array_intersect
intersect
⁉️
array_intersect_assoc
intersectAssoc
shouldn't intersect have a bunch of options like sort ? Should this be deprecated in favor of intersect with option assoc = true for consistency ?
❔
array_intersect_uassoc
shouldn't intersect have a bunch of options like sort ?
✔️
array_intersect_key
intersectKey
❔
array_intersect_ukey
shouldn't intersectKey have a bunch of options like sort ?
❔
array_uintersect
shouldn't that be in one of the existing intersect operators ?
❔
array_uintersect_assoc
shouldn't that be in one of the existing intersect operators ?
❔
array_uintersect_uassoc
shouldn't that be in one of the existing intersect operators ?
natsort
natcasesort
array_multisort
❌
compact
do not really see use case seems like a legacy method, prefer merge, unshift or push
What I think needs to be implemented:
includes (in_array)
every
flat
some
range
chunk
pluck
firstKey
lastKey
walk / tap / peek, not sure about the name
I also noticed that diff and intersect needs some work, some modes aren't supported. Also it would be nice to keep consistency with what has been done in sort.
What's your opinion about that ?
The text was updated successfully, but these errors were encountered:
I made a matrix comparing JS array API, PHP anc Chain.
I've matched the methods when possible.
I haven't dig into JS objects API, nor lodash or reactivex yet.
What I think needs to be implemented:
includes
(in_array
)every
flat
some
range
chunk
pluck
firstKey
lastKey
walk
/tap
/peek
, not sure about the nameI also noticed that diff and intersect needs some work, some modes aren't supported. Also it would be nice to keep consistency with what has been done in sort.
What's your opinion about that ?
The text was updated successfully, but these errors were encountered: