ljharb / js-traverse

MIT License
45 stars 8 forks source link

fix: use is-typed-array instead of which-typed-array #13

Closed Uzlopak closed 1 month ago

Uzlopak commented 1 month ago

We should use is-typed-array instead of which-typed-array.

ljharb commented 1 month ago

altho, there's really no point in doing this, since is-typed-array just calls which-typed-array.

kibertoad commented 1 month ago

@ljharb Clear benefit here would be 4 less dependencies, for no loss in compatibility or behaviour robustness. What is the disadvantage?

kibertoad commented 1 month ago

oh, sorry, I thought which-typed-array used is-typed-array, but it's the other way around, so yeah, that would be one extra dependency. my bad.

ljharb commented 1 month ago

I'd forgotten, but this is actually why I chose which-typed-array in the first place - because it does the same job with fewer dependencies.

AaronDewes commented 1 month ago

I'd forgotten, but this is actually why I chose which-typed-array in the first place - because it does the same job with fewer dependencies.

Why did you even create is-typed-array if which-typed-array is sufficient?

ljharb commented 1 month ago

Initially it didn’t use which-typed-array, and, it’s clearer to have a predicate for the relevant use cases. Later i refactored to have one use the other, to maximize dependency deduplication.