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
{{ message }}
Repository navigation
CloudEvent constructor should accept inline extensions #209
There is no way to create a CloudEvent instance using the constructor and have the extensions initialized there. For example, this is not valid, but should work.
changed the title [-]CloudEvent constructor should accept extensions inline[/-][+]CloudEvent constructor should accept inline extensions[/+]on Jun 4, 2020
Activity
[-]CloudEvent constructor should accept extensions inline[/-][+]CloudEvent constructor should accept inline extensions[/+]lholmquist commentedon Jun 8, 2020
@lance should the extensions property in your example, be an array of key:value pairs?
lholmquist commentedon Jun 8, 2020
The reason I ask is because if you take a look at what is created after doing
const ce = new CloudEvent(...)The extensions property is a blank array
As soon as you call
addExtension(key, value), the value of thta property actually turns into an object:Not sure what the correct answer should be here
lance commentedon Jun 8, 2020
@lholmquist that was a bug that was fixed at the end of last week https://github.com/cloudevents/sdk-javascript/pull/202/files#diff-695048fccf8efadd88b77db776a94d06L84. It should be an object.
lholmquist commentedon Jun 8, 2020
@lance yea, i was just looking in the code and couldn't find that array, and just realized my example was using the version on npm. 🤦
featpass extension into the contructor.
feat!: pass extension into the constructor.
feat!: pass extension into the constructor.
feat: pass extension into the constructor. (#214)