You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionvalidate(user){if(typeofuser!=="object"||user===null)thrownewError("Expected user to be User");if(typeofuser.name!=="string")thrownewError("Expected user.name to be a string");if(typeofuser.id!=="number"||user.id<10)thrownewError("Expected user.id to be a number, to be greater than 10");if(typeofuser.obj!=="object"||user.obj===null)thrownewError("Expected user.obj to be an object");if(typeofuser.obj["a-special-key"]!=="string")thrownewError("Expected user.obj.a-special-key to be a string");}validate({name: "abc",id: 4,obj: {'a-special-key': "test"}});
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
Properties are accessed using PropertyAccessExpression, but must use ElementAccessExpression that contain special characters.
Playground link
playground
Expected behavior
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: