RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.4k stars 2.17k forks source link

JSON.parse: expected property name or '}' #2635

Open migsAV opened 2 years ago

migsAV commented 2 years ago

https://github.com/RobinHerbots/Inputmask/blob/c807c50ae10e8d5190c5bf1270e7b33425bf70d9/dist/inputmask.js#L1693

It seems that there is a syntax issue with the JSON.parse

When I install inputmast through nmp install I get the error JSON.parse: expected property name or '}'

Current syntax:

JSON.parse( " {" + f + "} " )

Online they show that there should be single and double quotes, similar to the code below.

JSON.parse( ' {" + f + "} ' )
roland-d commented 2 years ago

Having the same error and in my case it is caused by a data attribute data-inputmask="[A-Z0-9]{0,11}" Changing the name inputmask to something else like inputmask-regex fixes the error.