From 349b84c3dad5d282d24780a884a0f94643871247 Mon Sep 17 00:00:00 2001 From: Grant Timmerman <744973+grant@users.noreply.github.com> Date: Wed, 26 Jan 2022 22:50:36 -0600 Subject: [PATCH] docs: fix ts example (#467) * docs: fix ts example Signed-off-by: Grant Timmerman * docs: fix ts example Signed-off-by: Grant Timmerman * docs: update quote mark Signed-off-by: Grant Timmerman --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b3b7d81..ae79cf8 100644 --- a/README.md +++ b/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: -```js +```ts import { CloudEvent, CloudEventV1, CloudEventV1Attributes } from "cloudevents"; const ce: CloudEventV1 = { - 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 = { - 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", }); ```