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:
parent
c603831e93
commit
349b84c3da
20
README.md
20
README.md
|
@ -134,24 +134,24 @@ const ce2 = ce.cloneWith({extension: "Value"});
|
||||||
|
|
||||||
You can create a `CloudEvent` object in many ways, for example, in TypeScript:
|
You can create a `CloudEvent` object in many ways, for example, in TypeScript:
|
||||||
|
|
||||||
```js
|
```ts
|
||||||
import { CloudEvent, CloudEventV1, CloudEventV1Attributes } from "cloudevents";
|
import { CloudEvent, CloudEventV1, CloudEventV1Attributes } from "cloudevents";
|
||||||
const ce: CloudEventV1<string> = {
|
const ce: CloudEventV1<string> = {
|
||||||
specversion: '1.0',
|
specversion: "1.0",
|
||||||
source: '/some/source',
|
source: "/some/source",
|
||||||
type: 'example',
|
type: "example",
|
||||||
id: '1234'
|
id: "1234"
|
||||||
};
|
};
|
||||||
const event = new CloudEvent(ce);
|
const event = new CloudEvent(ce);
|
||||||
const ce2: CloudEventV1Attributes<string> = {
|
const ce2: CloudEventV1Attributes<string> = {
|
||||||
specversion: '1.0',
|
specversion: "1.0",
|
||||||
source: '/some/source',
|
source: "/some/source",
|
||||||
type: 'example',
|
type: "example",
|
||||||
};
|
};
|
||||||
const event2 = new CloudEvent(ce2);
|
const event2 = new CloudEvent(ce2);
|
||||||
const event3 = new CloudEvent({
|
const event3 = new CloudEvent({
|
||||||
source: '/some/source',
|
source: "/some/source",
|
||||||
type: 'example',
|
type: "example",
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue