Skip to content

Commit ff429c2

Browse files
committed
Update README
1 parent 54b8930 commit ff429c2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/headers/README.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ import Headers from '@mjackson/headers';
2525
let headers = new Headers();
2626

2727
// Accept
28-
headers.accept = { 'text/html': 1, 'text/*': 0.9 };
29-
// or headers.accept = 'text/html,text/*;q=0.9';
28+
headers.accept = 'text/html, text/*;q=0.9';
3029

3130
headers.accept.mediaTypes; // [ 'text/html', 'text/*' ]
3231
Object.fromEntries(headers.accept.entries()); // { 'text/html': 1, 'text/*': 0.9 }
@@ -43,17 +42,15 @@ headers.accept.set('text/*', 0.8);
4342
headers.get('Accept'); // 'text/html,text/plain;q=0.9,text/*;q=0.8'
4443

4544
// Accept-Encoding
46-
headers.acceptEncoding = { gzip: 1, deflate: 0.8 };
47-
// or headers.acceptEncoding = 'gzip, deflate;q=0.8';
45+
headers.acceptEncoding = 'gzip, deflate;q=0.8';
4846

4947
headers.acceptEncoding.accepts('gzip'); // true
5048
headers.acceptEncoding.accepts('br'); // false
5149

5250
headers.acceptEncoding.getPreferred(['gzip', 'deflate']); // 'gzip'
5351

5452
// Accept-Language
55-
headers.acceptLanguage = { 'en-US': 1, en: 0.9 };
56-
// or headers.acceptLanguage = 'en-US,en;q=0.9';
53+
headers.acceptLanguage = 'en-US, en;q=0.9';
5754

5855
headers.acceptLanguage.languages; // [ 'en-us', 'en' ]
5956
Object.fromEntries(headers.acceptLanguage.entries()); // { 'en-us': 1, en: 0.9 }

0 commit comments

Comments
 (0)