docs: fix ts example (#467)

* docs: fix ts example

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>

* docs: fix ts example

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>

* docs: update quote mark

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
This commit is contained in:
Grant Timmerman 2022-01-26 22:50:36 -06:00 committed by GitHub
parent c603831e93
commit 349b84c3da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 10 deletions

View File

@ -134,24 +134,24 @@ const ce2 = ce.cloneWith({extension: "Value"});
You can create a `CloudEvent` object in many ways, for example, in TypeScript:
```js
```ts
import { CloudEvent, CloudEventV1, CloudEventV1Attributes } from "cloudevents";
const ce: CloudEventV1<string> = {
specversion: '1.0',
source: '/some/source',
type: 'example',
id: '1234'
specversion: "1.0",
source: "/some/source",
type: "example",
id: "1234"
};
const event = new CloudEvent(ce);
const ce2: CloudEventV1Attributes<string> = {
specversion: '1.0',
source: '/some/source',
type: 'example',
specversion: "1.0",
source: "/some/source",
type: "example",
};
const event2 = new CloudEvent(ce2);
const event3 = new CloudEvent({
source: '/some/source',
type: 'example',
source: "/some/source",
type: "example",
});
```