airbnb / react-with-styles-interface-aphrodite

Interface to use react-with-styles with Aphrodite
MIT License
54 stars 14 forks source link

Replace array-flatten with array.prototype.flat #55

Closed lencioni closed 6 years ago

lencioni commented 6 years ago

This is the shim package for the standard Array.prototype.flat, so this will use the native function in environments where it is available.

Since we might have deeply nested arrays, I decided to pass flat a depth of Infinity. Looking at the test suite, this seems to be the correct way to accomplish this:

https://github.com/es-shims/Array.prototype.flat/blob/0bb5b417/test/tests.js#L19