chore: adds the return type for the extensions (#221)

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
This commit is contained in:
Lucas Holmquist 2020-06-18 17:12:54 -04:00 committed by GitHub
parent 850e893ca7
commit 5ab81641ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -298,7 +298,7 @@ export class CloudEvent {
* @param {*} value the value of the extension attribute * @param {*} value the value of the extension attribute
* @returns {void} * @returns {void}
*/ */
addExtension(key: string, value: any) { addExtension(key: string, value: any): void {
this.spec.addExtension(key, value); this.spec.addExtension(key, value);
this.extensions = { [key]: value, ...this.extensions }; this.extensions = { [key]: value, ...this.extensions };
} }
@ -308,7 +308,7 @@ export class CloudEvent {
* @see https://github.com/cloudevents/spec/blob/master/spec.md#extension-context-attributes * @see https://github.com/cloudevents/spec/blob/master/spec.md#extension-context-attributes
* @returns {Object} the extensions attributes - if none exist will will be {} * @returns {Object} the extensions attributes - if none exist will will be {}
*/ */
getExtensions() { getExtensions(): object {
return this.extensions; return this.extensions;
} }
} }