Skip to content

Conversation

jmcouillard
Copy link

To detect correctly arrays, Array.isArray() should be preferred to instanceof Array. This improvement would allow node-robocopy to work correctly in more complex situations, such as when embedded in a Electron or NW.JS application.

This is explained by inaccurate results of instanceof Array when it is used across different context:

However, since instanceof Array doesn't work correctly across iframes/window, Array.isArray() would be more robust solution.

Source: https://stackoverflow.com/a/22289982

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant