cookie-es 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  <!-- /automd -->
11
11
 
12
- 🍪 [`Cookie`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie) and [`Set-Cookie`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie) parser and serializer based on [cookie](https://github.com/jshttp/cookiee) and [set-cookie-parser](https://github.com/nfriedly/set-cookie-parser) with dual ESM/CJS exports and bundled types. 🎁
12
+ 🍪 [`Cookie`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie) and [`Set-Cookie`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie) parser and serializer based on [cookie](https://github.com/jshttp/cookie) and [set-cookie-parser](https://github.com/nfriedly/set-cookie-parser) with dual ESM/CJS exports and bundled types. 🎁
13
13
 
14
14
  ## Usage
15
15
 
package/dist/index.cjs CHANGED
@@ -21,6 +21,10 @@ function parse(str, options) {
21
21
  continue;
22
22
  }
23
23
  const key = str.slice(index, eqIdx).trim();
24
+ if (opt?.filter && !opt?.filter(key)) {
25
+ index = endIdx + 1;
26
+ continue;
27
+ }
24
28
  if (void 0 === obj[key]) {
25
29
  let val = str.slice(eqIdx + 1, endIdx).trim();
26
30
  if (val.codePointAt(0) === 34) {
package/dist/index.d.cts CHANGED
@@ -202,7 +202,7 @@ interface SetCookie {
202
202
  /**
203
203
  * Indicates a cookie ought not to be sent along with cross-site requests
204
204
  */
205
- sameSite?: string | undefined;
205
+ sameSite?: true | false | "lax" | "strict" | "none" | undefined;
206
206
  [key: string]: unknown;
207
207
  }
208
208
 
package/dist/index.d.mts CHANGED
@@ -202,7 +202,7 @@ interface SetCookie {
202
202
  /**
203
203
  * Indicates a cookie ought not to be sent along with cross-site requests
204
204
  */
205
- sameSite?: string | undefined;
205
+ sameSite?: true | false | "lax" | "strict" | "none" | undefined;
206
206
  [key: string]: unknown;
207
207
  }
208
208
 
package/dist/index.d.ts CHANGED
@@ -202,7 +202,7 @@ interface SetCookie {
202
202
  /**
203
203
  * Indicates a cookie ought not to be sent along with cross-site requests
204
204
  */
205
- sameSite?: string | undefined;
205
+ sameSite?: true | false | "lax" | "strict" | "none" | undefined;
206
206
  [key: string]: unknown;
207
207
  }
208
208
 
package/dist/index.mjs CHANGED
@@ -19,6 +19,10 @@ function parse(str, options) {
19
19
  continue;
20
20
  }
21
21
  const key = str.slice(index, eqIdx).trim();
22
+ if (opt?.filter && !opt?.filter(key)) {
23
+ index = endIdx + 1;
24
+ continue;
25
+ }
22
26
  if (void 0 === obj[key]) {
23
27
  let val = str.slice(eqIdx + 1, endIdx).trim();
24
28
  if (val.codePointAt(0) === 34) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cookie-es",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "repository": "unjs/cookie-es",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,