juliangruber / balanced-match

Match balanced character pairs, like { and }
MIT License
125 stars 40 forks source link

bug! #21

Closed janryWang closed 3 years ago

janryWang commented 7 years ago

https://github.com/juliangruber/balanced-match/blob/master/index.js#L13 If a and b are null, then an error will be throw

juliangruber commented 7 years ago

oh, yeah you're right! do you want to create a pull request to fix this?

gaythubtrash commented 3 years ago

not fix,if a or b is null

'null'.indexOf(null) 0