shaack / cm-pgn

Parse and create PGNs (Portable Game Notation for chess games)
MIT License
28 stars 20 forks source link

Avoid extending Map and Array; also rewriting the tests using Mocha #1

Closed ngocdaothanh closed 6 years ago

ngocdaothanh commented 6 years ago

I tried using the library in a React Native project.

There's error about extending Map, so I rewrote the code to avoid extending the built-in classes Map and Array.

I also rewrote the tests using Mocha, you can run the tests with npm test.

ngocdaothanh commented 6 years ago

If you're OK with the changes, please merge and release a new version. Thanks!

ngocdaothanh commented 6 years ago

I also fixed and added a test for parsing variation at first move, like this (there's bug with the old code):

1. Rf2 (1. Rh7 Kf8 2. Rg1 Ke8 3. Rg8#) 1... Kg7 2. Rg1+ Kh6 3. Rh2# *
shaack commented 6 years ago

Seems to be nice work for me, I will merge it. Thanks!