mathiasbynens / jsesc

Given some data, jsesc returns the shortest possible stringified & ASCII-safe representation of that data.
https://mths.be/jsesc
MIT License
718 stars 49 forks source link

Usage of string.prototype.repeat breaks IE11 #46

Closed smonusbonus closed 5 years ago

smonusbonus commented 5 years ago

When using jsesc inside the browser context the usage of string.prototype.repeat breaks IE11. It results in a TypeError: Object doesn't support property or method 'repeat'. Is it a conscious decision not to support ES5/IE11 with this library? I think a polyfill or transpilation to ES5 Javascript would solve the problem ...

mathiasbynens commented 5 years ago

https://github.com/mathiasbynens/jsesc#support

mathiasbynens commented 5 years ago

Sounds like you want npm i jsesc@1.3.0.