patorjk / figlet.js

A FIG Driver written in JavaScript which aims to fully implement the FIGfont spec.
MIT License
2.61k stars 167 forks source link

Problem with code that pollute array prototype #75

Closed jcubic closed 3 years ago

jcubic commented 3 years ago

I use filget.js with ROT.js library (for rouge like games) and it modify Array prototype and it break figlet. This can be easy fixed. The problem is this line:

for(var i in fonts){
   me.parseFont(fonts[i], fontData[i]);
}

the loop should use hasOwnProperty to filter out stuff from prototype.