anvilresearch / json-document

Fast, declarative, standards-based JavaScript (ES6) data modeling & manipulation
MIT License
13 stars 2 forks source link

Having "type" as key name as validation property throws error #14

Open cstefanache opened 7 years ago

cstefanache commented 7 years ago

Example: ... properties: { id: { type: 'string'}, type: {type: 'string' },

Trace:

` undefined:47 if (value !== undefined && ) { ^

SyntaxError: Unexpected token ) `

christiansmith commented 7 years ago

Need more info on the context. This hasn't been a problem for us thus far and it is completely valid to have a property named "type".