Skip to content

Commit

Permalink
Revert "chore(scripts): generate docs to /docs for GitHub Pages"
Browse files Browse the repository at this point in the history
This reverts commit 8750aef.
  • Loading branch information
wjhsf committed Sep 9, 2024
1 parent 7b4266b commit 30d2734
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
24 changes: 7 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ yarn add tough-cookie
import { Cookie, CookieJar } from 'tough-cookie'

// parse a `Cookie` request header
const reqCookies = 'ID=298zf09hf012fh2; csrf=u32t4o3tb3gg43; _gat=1'
.split(';')
.map(Cookie.parse)
const reqCookies = 'ID=298zf09hf012fh2; csrf=u32t4o3tb3gg43; _gat=1'.split(';').map(Cookie.parse)
// generate a `Cookie` request header
const cookieHeader = reqCookies.map((cookie) => cookie.cookieString()).join(';')
const cookieHeader = reqCookies.map(cookie => cookie.cookieString()).join(';')

// parse a Set-Cookie response header
const resCookie = Cookie.parse(
'foo=bar; Domain=example.com; Path=/; Expires=Tue, 21 Oct 2025 00:00:00 GMT',
)
const resCookie = Cookie.parse('foo=bar; Domain=example.com; Path=/; Expires=Tue, 21 Oct 2025 00:00:00 GMT')
// generate a Set-Cookie response header
const setCookieHeader = cookie.toString()

Expand All @@ -42,7 +38,7 @@ const matchingCookies = await cookieJar.getCookies('https://example.com/')
```

> [!IMPORTANT]
> For more detailed usage information, refer to the [API docs](https://salesforce.github.io/tough-cookie/tough-cookie.md).
> For more detailed usage information, refer to the [API docs](./api/docs/tough-cookie.md).
## RFC6265bis

Expand All @@ -62,14 +58,8 @@ import { CookieJar } from 'tough-cookie'
const cookieJar = new CookieJar() // uses the in-memory store by default

// storing cookies with various SameSite attributes
await cookieJar.setCookie(
'strict=authorized; SameSite=strict',
'http://example.com/index.html',
)
await cookieJar.setCookie(
'lax=okay; SameSite=lax',
'http://example.com/index.html',
)
await cookieJar.setCookie('strict=authorized; SameSite=strict', 'http://example.com/index.html')
await cookieJar.setCookie('lax=okay; SameSite=lax', 'http://example.com/index.html')
await cookieJar.setCookie('normal=whatever', 'http://example.com/index.html')

// retrieving cookies using a SameSite context
Expand Down Expand Up @@ -115,7 +105,7 @@ You can define this functionality by passing in the `prefixSecurity` option to `
import { CookieJar, MemoryCookieStore } from 'tough-cookie'

const cookieJar = new CookieJar(new MemoryCookieStore(), {
prefixSecurity: 'silent',
prefixSecurity: 'silent'
})

// this cookie will be silently ignored since the url is insecure (http)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@
"scripts": {
"docs": "npm run build && npm run docs:ci",
"docs:ci": "npm run docs:extract -- --local && npm run docs:generate",
"docs:generate": "api-documenter markdown --input-folder ./tmp --output-folder ./docs",
"docs:generate": "api-documenter markdown --input-folder ./tmp --output-folder ./api/docs",
"docs:extract": "api-extractor run --verbose",
"build": "npm run clean && tsc",
"clean": "rm -rf dist",
"version:version-file": "genversion --template version-template.ejs --force lib/version.ts",
"version": "npm run version:version-file && npm run docs && git add ./lib/version.ts ./docs",
"version": "npm run version:version-file && npm run docs && git add ./lib/version.ts ./api/docs",
"test": "npm run test:ts && npm run test:legacy",
"test:ts": "jest",
"test:legacy": "npm run build -- --declaration false && ./test/scripts/vows.js test/*_test.js",
Expand Down

0 comments on commit 30d2734

Please sign in to comment.