Inputmask icon indicating copy to clipboard operation
Inputmask copied to clipboard

JSON.parse: expected property name or '}'

Open migsAV opened this issue 2 years ago • 1 comments

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 + "} ' )

migsAV avatar Jul 15 '22 08:07 migsAV

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.

roland-d avatar Aug 05 '22 14:08 roland-d