Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 54f11e4

Browse files
author
Jacob
committed
Prettier ran locally to confirm changes and configuration
1 parent 57339a7 commit 54f11e4

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

.prettierrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"proseWrap": "never"
2+
"proseWrap": "preserve"
33
}

CHANGELOG.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## 3.2.0
1212

13-
- **Add 'error' WebSocket event types overrides [@bretthoerner], [pull/143] & [pull/150]**
13+
- **Add 'error' WebSocket event types overrides [@bretthoerner], [pull/143] & [pull/150]**
1414
- **Add PagesFunction type [@GregBrimble], [pull/154]**
1515
- **Updated types for 2021.11.400 [@autodecl-bot], [pull/145]**
1616
- **Updated types for 2021.11.700 [@autodecl-bot], [pull/149]**
@@ -153,7 +153,7 @@
153153
Remove this from your code:
154154
155155
```typescript
156-
import {} from '@cloudflare/workers-types'
156+
import {} from "@cloudflare/workers-types";
157157
```
158158
159159
And instead include the types explicitly in your TypeScript configuration compiler options:
@@ -178,10 +178,12 @@
178178
179179
```typescript
180180
// Force response to be cached for 300 seconds.
181-
fetch(event.request, { cf: { cacheTtl: 300 } })
181+
fetch(event.request, { cf: { cacheTtl: 300 } });
182182

183183
// Force response to be cached for 86400 seconds for 200 status codes, 1 second for 404, and do not cache 500 errors
184-
fetch(request, { cf: { cacheTtlByStatus: { '200-299': 86400, '404': 1, '500-599': 0 } } })
184+
fetch(request, {
185+
cf: { cacheTtlByStatus: { "200-299": 86400, "404": 1, "500-599": 0 } },
186+
});
185187
```
186188
187189
Read more about these properties in the [`Request` docs](https://developers.cloudflare.com/workers/reference/apis/request/).
@@ -195,7 +197,7 @@
195197
The Workers runtime exposes a default global cache as `caches.default`, accessed like:
196198
197199
```typescript
198-
let cache = caches.default
200+
let cache = caches.default;
199201
```
200202
201203
This is an extension to the [Service Workers spec for `CacheStorage`](https://w3c.github.io/ServiceWorker/#cachestorage), and thus needed to be added explicitly to our type definitions.
@@ -238,7 +240,7 @@
238240
Previously, this pattern wasn't allowed:
239241
240242
```typescript
241-
new Request(parsedUrl.toString(), request)
243+
new Request(parsedUrl.toString(), request);
242244
```
243245
244246
This is because the `cf` object on inbound Request objects, and that expected in the `init` dictionary arg to the Request constructor, have a different shape.
@@ -247,7 +249,7 @@
247249
248250
```typescript
249251
interface RequestInit {
250-
cf?: RequestInitCfProperties | IncomingRequestCfProperties
252+
cf?: RequestInitCfProperties | IncomingRequestCfProperties;
251253
}
252254
```
253255
@@ -291,7 +293,7 @@
291293
Previously, the `KVNamespace` interface required that callers provide an empty options object when listing all the keys in a namespace, like so:
292294
293295
```typescript
294-
await NAMESPACE.list({})
296+
await NAMESPACE.list({});
295297
```
296298
297299
However, this argument is not actually required. This change updates the interface to match the runtime.

docs/kv.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ Returns a `Promise` that you should `await` on in order to verify a successful u
2121
#### Examples
2222

2323
```js
24-
await NAMESPACE.put(key, value)
24+
await NAMESPACE.put(key, value);
2525
```

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"scripts": {
1414
"export:docs": "node -r esbuild-register export/docs.ts",
1515
"export:overrides": "node -r esbuild-register export/overrides.ts",
16-
"prettier:md": "prettier --write --prose-wrap never --parser markdown '**/*.md' --ignore-path ./LICENSE.md",
16+
"prettier:md": "prettier --write --parser markdown '**/*.md' --ignore-path ./LICENSE.md",
1717
"test": "tsc"
1818
},
1919
"author": "Cloudflare Workers Team <[email protected]> (https://workers.cloudflare.com)",

0 commit comments

Comments
 (0)