Skip to content
This repository was archived by the owner on Apr 10, 2024. It is now read-only.

Conversation

@egilll
Copy link

@egilll egilll commented Sep 1, 2018

Removal of array constructor ".last()" so that this project does not clash with other custom array methods.

Some other packages, like array-sugar, add new methods for arrays.

When such packages are used with html2json, HTML parsing will fail because of the clash of the newly created array methods ".last" and ".last()".

The proposed change removes the custom array method and uses vanilla Javascript instead.

The error that will otherwise pop up is: stack.last is not a function.

…clash with other custom array methods

Some other packages, like [`array-sugar`](https://github.com/capaj/array-sugar), add new methods for arrays.

When such packages are used with html2json, HTML parsing will fail because of the clash of the newly created array methods ".last" and ".last()".

The proposed change removes the custom array method and uses vanilla Javascript instead.

The error that will otherwise pop up is: `stack.last is not a function`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant