This change adds a `ValidationError` type that extends `TypeError`. Any time a `CloudEvent` cannot be received and created with the given input, this error will be thrown. Tests have all
been updated to check for the error type.
Signed-off-by: Lance Ball <lball@redhat.com>
Enforce the use of `let` and `const` by using elsint rules.
When creating the eslint configuration, I had assumed that
`extends: eslint:recommended` would have covered this, but
apparently not!
Existing usage of `var` fixed with `npm run lint -- --fix`.
Fixes: https://github.com/cloudevents/sdk-javascript/issues/97
Signed-off-by: Lance Ball <lball@redhat.com>
This commit removes support for the v0.2 specification. It also removes the
`contenttype` attribute from the `CloudEvent` object. While the HTTP protocol
binding specifies that in binary mode, the `datacontenttype` attribute should
map to the HTTP Content-Type header, that doesn't mean that the `CloudEvent`
object should have a `contenttype` property.
Fixes: https://github.com/cloudevents/sdk-javascript/issues/61
Fixes: https://github.com/cloudevents/sdk-javascript/issues/66
Signed-off-by: Lance Ball <lball@redhat.com>
Automatically fixed > 2000 issues. The remaining 200+ issues need
to be fixed by hand. Additionally, all strings are double quotes
which is not typically standard and I wonder about fixing that too.
Signed-off-by: Lance Ball <lball@redhat.com>