Skip to content

Commit 349b84c

Browse files
authored
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>
1 parent c603831 commit 349b84c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,24 +134,24 @@ const ce2 = ce.cloneWith({extension: "Value"});
134134

135135
You can create a `CloudEvent` object in many ways, for example, in TypeScript:
136136

137-
```js
137+
```ts
138138
import { CloudEvent, CloudEventV1, CloudEventV1Attributes } from "cloudevents";
139139
const ce: CloudEventV1<string> = {
140-
specversion: '1.0',
141-
source: '/some/source',
142-
type: 'example',
143-
id: '1234'
140+
specversion: "1.0",
141+
source: "/some/source",
142+
type: "example",
143+
id: "1234"
144144
};
145145
const event = new CloudEvent(ce);
146146
const ce2: CloudEventV1Attributes<string> = {
147-
specversion: '1.0',
148-
source: '/some/source',
149-
type: 'example',
147+
specversion: "1.0",
148+
source: "/some/source",
149+
type: "example",
150150
};
151151
const event2 = new CloudEvent(ce2);
152152
const event3 = new CloudEvent({
153-
source: '/some/source',
154-
type: 'example',
153+
source: "/some/source",
154+
type: "example",
155155
});
156156
```
157157

0 commit comments

Comments
 (0)