[
  {
    "path": ".github/FUNDING.yml",
    "content": "github: 3846masa\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: bug\nassignees: 3846masa\n---\n\n## Describe the bug\n\nA clear and concise description of what the bug is.\n\n## To Reproduce\n\nSteps to reproduce the behavior:\n\n1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error\n\n## Expected behavior\n\nA clear and concise description of what you expected to happen.\n\n## Code that reproduces the bug\n\nSharing code that reproduces the bug in RunKit, Glitch, etc.\n\nIf the code is not shared, we will not be able to investigate and may close the issue.\n\n## Environments\n\n- OS: [e.g. macOS]\n- Node.js version: [e.g. 12.0.0]\n- axios version: [e.g. 0.21.0]\n- tough-cookie version: [e.g. 4.0.0]\n"
  },
  {
    "path": ".github/renovate.json",
    "content": "{\n  \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n  \"extends\": [\"github>3846masa/configs//renovate/default#fde6015cc9703c2aee5630993ba80e43ce7120ba\"]\n}\n"
  },
  {
    "path": ".github/workflows/default.yml",
    "content": "on:\n  push:\n    branches:\n      - main\n  pull_request: {}\njobs:\n  lint:\n    name: Lint\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n      - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0\n        with:\n          package_json_file: package.json\n      - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0\n        with:\n          node-version-file: .node-version\n          cache: pnpm\n      - run: pnpm install\n      - run: pnpm lint\n  test:\n    name: Test\n    runs-on: ${{ matrix.os }}\n    strategy:\n      matrix:\n        node: [\"20\", \"22\", \"24\"]\n        os: [\"ubuntu-latest\", \"macos-latest\", \"windows-latest\"]\n    steps:\n      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n      - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0\n        with:\n          package_json_file: package.json\n      - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0\n        with:\n          node-version: ${{ matrix.node }}\n          cache: pnpm\n      - run: pnpm install\n      - run: pnpm test\n  passed:\n    name: All CI passed\n    runs-on: ubuntu-latest\n    needs:\n      - lint\n      - test\n    if: always()\n    steps:\n      - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0\n        env:\n          RESULT_JSON: ${{ toJSON(needs) }}\n        with:\n          script: |\n            const result = JSON.parse(process.env.RESULT_JSON);\n            const passed = Object.values(result).every(({ result }) => result === 'success');\n            if (!passed) process.exit(1);\n  release:\n    name: Release\n    if: github.ref == 'refs/heads/main'\n    needs:\n      - passed\n    runs-on: ubuntu-latest\n    concurrency:\n      group: release\n      cancel-in-progress: false\n    permissions:\n      contents: read\n      id-token: write\n    steps:\n      - uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1\n        id: app-token\n        with:\n          app-id: Iv23liuADjK7bhvAlWZw\n          private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}\n      - name: Checkout\n        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n        with:\n          token: ${{ steps.app-token.outputs.token }}\n          fetch-depth: 0\n      - name: Configure Git\n        run: |\n          git config user.name 'github-actions[bot]'\n          git config user.email '41898282+github-actions[bot]@users.noreply.github.com'\n      - name: Setup pnpm\n        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0\n        with:\n          package_json_file: \"package.json\"\n      - name: Setup Node.js\n        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0\n        with:\n          node-version: 'lts/*'\n          registry-url: 'https://registry.npmjs.org'\n          cache: \"pnpm\"\n      - run: pnpm install\n      - run: pnpm build\n      - name: Release\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          RELEASE_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}\n        run: |\n          pnpm run release\n          # Release under the scoped package name\n          jq '.name |= \"@3846masa/axios-cookiejar-support\"' package.json > /tmp/package.json && mv /tmp/package.json package.json\n          pnpm run release --no-increment --no-git --no-github.release\n"
  },
  {
    "path": ".github/workflows/stale.yml",
    "content": "name: Close inactive issues\non:\n  schedule:\n    - cron: '0 11 * * *'\njobs:\n  close-issues:\n    name: Close inactive issues\n    runs-on: ubuntu-latest\n    permissions:\n      issues: write\n      pull-requests: write\n    steps:\n      - uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0\n        with:\n          days-before-stale: 30\n          days-before-close: 7\n          stale-issue-label: 'stale'\n          stale-issue-message: 'This issue is stale because it has been open for 30 days with no activity.'\n          close-issue-message: 'This issue was closed because it has been inactive for 7 days since being marked as stale.'\n          stale-pr-message: 'This PR is stale because it has been open for 30 days with no activity.'\n          close-pr-message: 'This PR was closed because it has been inactive for 7 days since being marked as stale.'\n          exempt-pr-labels: 'dependencies'\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".gitignore",
    "content": "\n# Created by https://www.toptal.com/developers/gitignore/api/node,windows,macos,linux,visualstudiocode\n# Edit at https://www.toptal.com/developers/gitignore?templates=node,windows,macos,linux,visualstudiocode\n\n### Linux ###\n*~\n\n# temporary files which can be created if a process still has a handle open of a deleted file\n.fuse_hidden*\n\n# KDE directory preferences\n.directory\n\n# Linux trash folder which might appear on any partition or disk\n.Trash-*\n\n# .nfs files are created when an open file is removed but is still being accessed\n.nfs*\n\n### macOS ###\n# General\n.DS_Store\n.AppleDouble\n.LSOverride\n\n# Icon must end with two \\r\nIcon\r\r\n\n# Thumbnails\n._*\n\n# Files that might appear in the root of a volume\n.DocumentRevisions-V100\n.fseventsd\n.Spotlight-V100\n.TemporaryItems\n.Trashes\n.VolumeIcon.icns\n.com.apple.timemachine.donotpresent\n\n# Directories potentially created on remote AFP share\n.AppleDB\n.AppleDesktop\nNetwork Trash Folder\nTemporary Items\n.apdisk\n\n### Node ###\n# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\nlerna-debug.log*\n.pnpm-debug.log*\n\n# Diagnostic reports (https://nodejs.org/api/report.html)\nreport.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n*.lcov\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# Bower dependency directory (https://bower.io/)\nbower_components\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (https://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\nnode_modules/\njspm_packages/\n\n# Snowpack dependency directory (https://snowpack.dev/)\nweb_modules/\n\n# TypeScript cache\n*.tsbuildinfo\n\n# Optional npm cache directory\n.npm\n\n# Optional eslint cache\n.eslintcache\n\n# Microbundle cache\n.rpt2_cache/\n.rts2_cache_cjs/\n.rts2_cache_es/\n.rts2_cache_umd/\n\n# Optional REPL history\n.node_repl_history\n\n# Output of 'npm pack'\n*.tgz\n\n# Yarn Integrity file\n.yarn-integrity\n\n# dotenv environment variables file\n.env\n.env.test\n.env.production\n\n# parcel-bundler cache (https://parceljs.org/)\n.cache\n.parcel-cache\n\n# Next.js build output\n.next\nout\n\n# Nuxt.js build / generate output\n.nuxt\ndist\n\n# Gatsby files\n.cache/\n# Comment in the public line in if your project uses Gatsby and not Next.js\n# https://nextjs.org/blog/next-9-1#public-directory-support\n# public\n\n# vuepress build output\n.vuepress/dist\n\n# Serverless directories\n.serverless/\n\n# FuseBox cache\n.fusebox/\n\n# DynamoDB Local files\n.dynamodb/\n\n# TernJS port file\n.tern-port\n\n# Stores VSCode versions used for testing VSCode extensions\n.vscode-test\n\n# yarn v2\n.yarn/cache\n.yarn/unplugged\n.yarn/build-state.yml\n.yarn/install-state.gz\n.pnp.*\n\n### VisualStudioCode ###\n.vscode/*\n!.vscode/settings.json\n!.vscode/tasks.json\n!.vscode/launch.json\n!.vscode/extensions.json\n*.code-workspace\n\n# Local History for Visual Studio Code\n.history/\n\n### VisualStudioCode Patch ###\n# Ignore all local history of files\n.history\n.ionide\n\n### Windows ###\n# Windows thumbnail cache files\nThumbs.db\nThumbs.db:encryptable\nehthumbs.db\nehthumbs_vista.db\n\n# Dump file\n*.stackdump\n\n# Folder config file\n[Dd]esktop.ini\n\n# Recycle Bin used on file shares\n$RECYCLE.BIN/\n\n# Windows Installer files\n*.cab\n*.msi\n*.msix\n*.msm\n*.msp\n\n# Windows shortcuts\n*.lnk\n\n# End of https://www.toptal.com/developers/gitignore/api/node,windows,macos,linux,visualstudiocode\n"
  },
  {
    "path": ".node-version",
    "content": "20.20.2\n"
  },
  {
    "path": ".npmrc",
    "content": "save-prefix=''\nenable-pre-post-scripts=true\nshell-emulator=true\nengine-strict=true\npublic-hoist-pattern[]=*eslint*\npublic-hoist-pattern[]=*prettier*\npublic-hoist-pattern[]=@tsconfig/*\n"
  },
  {
    "path": ".prettierignore",
    "content": "dist/\nCHANGELOG.md\n*.yml\n*.yaml\n"
  },
  {
    "path": ".release-it.yaml",
    "content": "git:\n  commitMessage: 'chore: release v${version} [skip ci]'\n  pushArgs: ['--follow-tags', '--force']\ngithub:\n  release: true\n  releaseName: 'Release v${version}'\n  tokenRef: RELEASE_GITHUB_TOKEN\nnpm:\n  skipChecks: true\nplugins:\n  '@release-it/conventional-changelog':\n    infile: CHANGELOG.md\n    preset:\n      name: conventionalcommits\n      bumpStrict: true\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "## [6.0.5](https://github.com/3846masa/axios-cookiejar-support/compare/v6.0.4...v6.0.5) (2025-11-19)\n\n\n### Bug Fixes\n\n* **npm:** update dependency http-cookie-agent to ^7.0.3 ([#1547](https://github.com/3846masa/axios-cookiejar-support/issues/1547)) ([d20fd55](https://github.com/3846masa/axios-cookiejar-support/commit/d20fd55bb5622509f80f3e4d5e63dce62b8c8ad0))\n\n## [6.0.4](https://github.com/3846masa/axios-cookiejar-support/compare/v6.0.3...v6.0.4) (2025-07-17)\n\n\n### Bug Fixes\n\n* **npm:** update dependency http-cookie-agent to ^7.0.2 ([#1432](https://github.com/3846masa/axios-cookiejar-support/issues/1432)) ([6f3cfb3](https://github.com/3846masa/axios-cookiejar-support/commit/6f3cfb3b8c02307630b1f2a0b937f6adee8d92ff))\n\n## [6.0.3](https://github.com/3846masa/axios-cookiejar-support/compare/v6.0.2...v6.0.3) (2025-06-29)\n\n\n### Bug Fixes\n\n* reorder \"exports\" field in package.json to place \"default\" key last ([#1398](https://github.com/3846masa/axios-cookiejar-support/issues/1398)) ([1f18baf](https://github.com/3846masa/axios-cookiejar-support/commit/1f18baf5424a93d56943bdbc50eec5a0c968771e))\n\n## [6.0.2](https://github.com/3846masa/axios-cookiejar-support/compare/v6.0.1...v6.0.2) (2025-04-26)\n\n\n### Bug Fixes\n\n* improve module resolution compatibility with bundlers ([#1350](https://github.com/3846masa/axios-cookiejar-support/issues/1350)) ([4619c4d](https://github.com/3846masa/axios-cookiejar-support/commit/4619c4d812e4721a90d96bd0ff6faf374b6f3ecc))\n\n## [6.0.1](https://github.com/3846masa/axios-cookiejar-support/compare/v6.0.0...v6.0.1) (2025-04-23)\n\n\n### Bug Fixes\n\n* restore main / types fields for npm ts badge ([#1348](https://github.com/3846masa/axios-cookiejar-support/issues/1348)) ([0970328](https://github.com/3846masa/axios-cookiejar-support/commit/097032888a2dd1a2e0bc687c615edb09c6af2209))\n\n# [6.0.0](https://github.com/3846masa/axios-cookiejar-support/compare/v5.0.5...v6.0.0) (2025-04-14)\n\n\n### Bug Fixes\n\n* **npm:** update dependency http-cookie-agent to v7 ([#1342](https://github.com/3846masa/axios-cookiejar-support/issues/1342)) ([8f51516](https://github.com/3846masa/axios-cookiejar-support/commit/8f51516630260c6e443057bf7a79ca0ee1b3570f))\n\n\n### chore\n\n* drop support for Node.js v18 ([#1341](https://github.com/3846masa/axios-cookiejar-support/issues/1341)) ([7cd7817](https://github.com/3846masa/axios-cookiejar-support/commit/7cd78175922242135c7c9265abb1f93c5a4f79c4))\n\n\n### Features\n\n* provides ESM only ([#1340](https://github.com/3846masa/axios-cookiejar-support/issues/1340)) ([5ffb726](https://github.com/3846masa/axios-cookiejar-support/commit/5ffb7261a9312598a63012c3cc035e89963433d8))\n\n\n### BREAKING CHANGES\n\n* Drop support for Node.js v18. See MIGRATION.md\n* CommonJS is no longer provided. See MIGRATION.md\n\n## [5.0.5](https://github.com/3846masa/axios-cookiejar-support/compare/v5.0.4...v5.0.5) (2024-12-16)\n\n\n### Bug Fixes\n\n* **npm:** update dependency http-cookie-agent to ^6.0.8 ([#1211](https://github.com/3846masa/axios-cookiejar-support/issues/1211)) ([047a8b4](https://github.com/3846masa/axios-cookiejar-support/commit/047a8b48506f6d67006087d7207ea1478d2ffcd5))\n\n## [5.0.4](https://github.com/3846masa/axios-cookiejar-support/compare/v5.0.3...v5.0.4) (2024-12-14)\n\n\n### Bug Fixes\n\n* **npm:** update dependency http-cookie-agent to ^6.0.7 ([#1209](https://github.com/3846masa/axios-cookiejar-support/issues/1209)) ([a6b8e5b](https://github.com/3846masa/axios-cookiejar-support/commit/a6b8e5b35ba7bbca02a9d3d9bcb26a085e94deb4))\n\n## [5.0.3](https://github.com/3846masa/axios-cookiejar-support/compare/v5.0.2...v5.0.3) (2024-09-26)\n\n\n### Bug Fixes\n\n* **npm:** update dependency http-cookie-agent to ^6.0.6 ([#1119](https://github.com/3846masa/axios-cookiejar-support/issues/1119)) ([dec5f97](https://github.com/3846masa/axios-cookiejar-support/commit/dec5f97278f154aa529b016384b579d3fa570960))\n\n## [5.0.2](https://github.com/3846masa/axios-cookiejar-support/compare/v5.0.1...v5.0.2) (2024-05-05)\n\n\n### Bug Fixes\n\n* **npm:** update dependency http-cookie-agent to ^6.0.5 ([#996](https://github.com/3846masa/axios-cookiejar-support/issues/996)) ([5a16f9f](https://github.com/3846masa/axios-cookiejar-support/commit/5a16f9fb99a0536319d74bfba681a16945a135f4))\n\n## [5.0.1](https://github.com/3846masa/axios-cookiejar-support/compare/v5.0.0...v5.0.1) (2024-04-07)\n\n\n### Bug Fixes\n\n* **npm:** update dependency http-cookie-agent to ^6.0.3 ([#968](https://github.com/3846masa/axios-cookiejar-support/issues/968)) ([4f0c06f](https://github.com/3846masa/axios-cookiejar-support/commit/4f0c06ff6dbcb82b7769a0abaf53853174a9666f))\n\n# [5.0.0](https://github.com/3846masa/axios-cookiejar-support/compare/v4.0.7...v5.0.0) (2024-01-14)\n\n\n### Features\n\n* drop Node.js v14 and v16 ([#880](https://github.com/3846masa/axios-cookiejar-support/issues/880)) ([c7e5e0b](https://github.com/3846masa/axios-cookiejar-support/commit/c7e5e0b6572e9859c291906f079f654dd5a37c97))\n\n\n### BREAKING CHANGES\n\n* drop Node.js v14 and v16\n\n## [4.0.7](https://github.com/3846masa/axios-cookiejar-support/compare/v4.0.6...v4.0.7) (2023-06-22)\n\n\n### Bug Fixes\n\n* **npm:** update dependency http-cookie-agent to ^5.0.4 ([#764](https://github.com/3846masa/axios-cookiejar-support/issues/764)) ([c63b7bd](https://github.com/3846masa/axios-cookiejar-support/commit/c63b7bd7f237c1f3fb4c13a84fae9a09f56c8951))\n\n## [4.0.6](https://github.com/3846masa/axios-cookiejar-support/compare/v4.0.5...v4.0.6) (2023-01-01)\n\n\n### Bug Fixes\n\n* **npm:** update dependency http-cookie-agent to v5 ([#655](https://github.com/3846masa/axios-cookiejar-support/issues/655)) ([42cc5ee](https://github.com/3846masa/axios-cookiejar-support/commit/42cc5ee9085be81257cd6c74c88caf0a5b35b6af))\n\n## [4.0.5](https://github.com/3846masa/axios-cookiejar-support/compare/v4.0.4...v4.0.5) (2022-12-28)\n\n\n### Bug Fixes\n\n* **docs:** add funding link to README ([#653](https://github.com/3846masa/axios-cookiejar-support/issues/653)) ([d3a21b6](https://github.com/3846masa/axios-cookiejar-support/commit/d3a21b6f78dc13f89030300bd1837d98fdd847dd))\n\n## [4.0.4](https://github.com/3846masa/axios-cookiejar-support/compare/v4.0.3...v4.0.4) (2022-12-26)\n\n\n### Bug Fixes\n\n* allow to reuse config (e.g. axios-retry) ([#650](https://github.com/3846masa/axios-cookiejar-support/issues/650)) ([86a759c](https://github.com/3846masa/axios-cookiejar-support/commit/86a759ca0ade2c39cda4e1c79eab2b8e1510d9f1))\n\n## [4.0.3](https://github.com/3846masa/axios-cookiejar-support/compare/v4.0.2...v4.0.3) (2022-07-26)\n\n\n### Bug Fixes\n\n* **npm:** update dependency http-cookie-agent to ^4.0.2 ([#541](https://github.com/3846masa/axios-cookiejar-support/issues/541)) ([6246253](https://github.com/3846masa/axios-cookiejar-support/commit/6246253bbf89de29a6158a4c77e22209e06a5779))\n\n## [4.0.2](https://github.com/3846masa/axios-cookiejar-support/compare/v4.0.1...v4.0.2) (2022-05-24)\n\n\n### Bug Fixes\n\n* **npm:** update dependency http-cookie-agent to ^4.0.1 ([#494](https://github.com/3846masa/axios-cookiejar-support/issues/494)) ([1c75dcf](https://github.com/3846masa/axios-cookiejar-support/commit/1c75dcfe8d5fcdb5f8c9891e3310a842e223b4e0))\n\n## [4.0.1](https://github.com/3846masa/axios-cookiejar-support/compare/v4.0.0...v4.0.1) (2022-05-08)\n\n\n### Bug Fixes\n\n* **npm:** update dependency http-cookie-agent to ^4.0.0 ([#485](https://github.com/3846masa/axios-cookiejar-support/issues/485)) ([7b85d03](https://github.com/3846masa/axios-cookiejar-support/commit/7b85d03ce3134915fb3a08077a6bf3973ea67ef1))\n\n# [4.0.0](https://github.com/3846masa/axios-cookiejar-support/compare/v3.0.0...v4.0.0) (2022-05-07)\n\n\n### Features\n\n* **npm:** update dependency http-cookie-agent to ^3.0.0 ([#482](https://github.com/3846masa/axios-cookiejar-support/issues/482)) ([1dac53a](https://github.com/3846masa/axios-cookiejar-support/commit/1dac53a0c26e51c8d4327b3ee30304fc29ba1cf3))\n\n\n### BREAKING CHANGES\n\n* **npm:** an asynchronous Cookie store (e.g. `redis-cookie-store`) is no longer supported.\n\n# [3.0.0](https://github.com/3846masa/axios-cookiejar-support/compare/v2.0.5...v3.0.0) (2022-05-03)\n\n\n### Features\n\n* drop Node.js v12 support ([#472](https://github.com/3846masa/axios-cookiejar-support/issues/472)) ([3ed3b37](https://github.com/3846masa/axios-cookiejar-support/commit/3ed3b3739fda356f2aa07c72c7b48c88b773e84f))\n\n\n### BREAKING CHANGES\n\n* drop Node.js v12 support, please use v14 or above\n\n## [2.0.5](https://github.com/3846masa/axios-cookiejar-support/compare/v2.0.4...v2.0.5) (2022-05-02)\n\n## [2.0.4](https://github.com/3846masa/axios-cookiejar-support/compare/v2.0.3...v2.0.4) (2022-02-27)\n\n\n### Bug Fixes\n\n* **deps:** update actions/setup-node action to v3 ([#450](https://github.com/3846masa/axios-cookiejar-support/issues/450)) ([0b6fca2](https://github.com/3846masa/axios-cookiejar-support/commit/0b6fca2c3d89c271616d66495a18e75813f6c1f7))\n\n## [2.0.3](https://github.com/3846masa/axios-cookiejar-support/compare/v2.0.2...v2.0.3) (2021-10-14)\n\n\n### Bug Fixes\n\n* fix supported node version ([#423](https://github.com/3846masa/axios-cookiejar-support/issues/423)) ([8fbbb45](https://github.com/3846masa/axios-cookiejar-support/commit/8fbbb45d0b0977d7d911b9cc5378eb2e7f0d8f6e)), closes [/github.com/3846masa/axios-cookiejar-support/issues/420#issuecomment-943350949](https://github.com//github.com/3846masa/axios-cookiejar-support/issues/420/issues/issuecomment-943350949)\n\n## [2.0.2](https://github.com/3846masa/axios-cookiejar-support/compare/v2.0.1...v2.0.2) (2021-09-24)\n\n\n### Bug Fixes\n\n* change axios semver in peer dependencies ([#411](https://github.com/3846masa/axios-cookiejar-support/issues/411)) ([f58c4b4](https://github.com/3846masa/axios-cookiejar-support/commit/f58c4b46bd08e989bf894e9f62c198824c7330c9))\n\n## [2.0.1](https://github.com/3846masa/axios-cookiejar-support/compare/v2.0.0...v2.0.1) (2021-09-24)\n\n\n### Bug Fixes\n\n* send cookies even when target is same host but different port ([#408](https://github.com/3846masa/axios-cookiejar-support/issues/408)) ([b52126c](https://github.com/3846masa/axios-cookiejar-support/commit/b52126c765a507f8a1382e3571c32104561787d7))\n\n# [2.0.0](https://github.com/3846masa/axios-cookiejar-support/compare/v1.9.9...v2.0.0) (2021-09-17)\n\n\n### Features\n\n* refactoring ([59a4bd8](https://github.com/3846masa/axios-cookiejar-support/commit/59a4bd865f94b239fd7b8977d41148a54710bc5a))\n\n\n### BREAKING CHANGES\n\n* see MIGRATION.md\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright © 2021 3846masa\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the “Software”), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE."
  },
  {
    "path": "MIGRATION.md",
    "content": "# MIGRATION GUIDES\n\n## Migration guide from v5.x.x to v6.0.0\n\n- [Update requirements.](#update-requirements)\n- [CommonJS is no longer provided.](#commonjs-is-no-longer-provided)\n\n### Update requirements.\n\n- Node.js v20.0.0 or above\n\n### CommonJS is no longer provided.\n\nIf using Node.js >= v20.19.0 or >= v22.12.0, axios-cookiejar-support can be loaded from a CommonJS file.\n\n## Migration guide from v3.x.x to v4.0.0\n\n- [An asynchronous Cookie store is no longer supported.](#an-asynchronous-cookie-store-is-no-longer-supported)\n\n### An asynchronous Cookie store is no longer supported.\n\nAn asynchronous Cookie store (e.g. `redis-cookie-store`) is no longer supported.\n\n(If you create a CookieJar without options, this change has no effect.)\n\n`http-cookie-agent` allows to use an asynchronous Cookie store.\n\n```js\nimport axios from 'axios';\nimport { CookieJar } from 'tough-cookie';\nimport redis from 'redis';\nimport RedisCookieStore from 'redis-cookie-store';\nimport { HttpCookieAgent, HttpsCookieAgent } from 'http-cookie-agent/node:http';\n\nconst redisClient = redis.createClient();\nconst store = new RedisCookieStore(redisClient);\nconst jar = new CookieJar(store);\n\nconst client = axios.create({\n  httpAgent: new HttpCookieAgent({ cookies: { async_UNSTABLE: true, jar } }),\n  httpsAgent: new HttpsCookieAgent({ cookies: { async_UNSTABLE: true, jar } }),\n});\n\nawait client.get('https://example.com');\n```\n\n## Migration guide from v2.x.x to v3.0.0\n\n- [Update requirements.](#update-requirements-1)\n\n### Update requirements.\n\n- Node.js v14.18.0 / v16.0.0 or above\n\n## Migration guide from v1.0.x to v2.0.0\n\n- [Update requirements.](#update-requirements-2)\n- [The wrapper function are exported as \"named exports\".](#the-wrapper-function-are-exported-as-named-exports)\n- [No longer refers to `config.withCredentials`.](#no-longer-refers-to-configwithcredentials)\n- [`config.httpAgent` / `config.httpsAgent` cannot use with `axios-cookiejar-support`.](#confighttpagent--confighttpsagent-cannot-use-with-axios-cookiejar-support)\n- [`config.jar` no longer accepts boolean.](#configjar-no-longer-accepts-boolean)\n- [Invalid cookies will always be ignored.](#invalid-cookies-will-always-be-ignored)\n\n### Update requirements.\n\n- Node.js v12.19.0 / v14.5.0 or above\n- `axios@0.20.0` or above\n- `tough-cookie@4.0.0` or above\n\n### The wrapper function are exported as \"named exports\".\n\n```diff\n  // CommonJS\n- const axiosCookieJarSupport = require('axios-cookiejar-support');\n+ const { wrapper: axiosCookieJarSupport } = require('axios-cookiejar-support');\n```\n\n```diff\n  // ES Module\n- import axiosCookieJarSupport from 'axios-cookiejar-support';\n+ import { wrapper as axiosCookieJarSupport } from 'axios-cookiejar-support';\n```\n\n### No longer refers to `config.withCredentials`.\n\n```diff\n  // Remove config.withCredentials\n  axios.get('https://example.com', {\n    jar: new CookieJar(),\n-   withCredentials: true,\n  });\n```\n\nIf you want to prevent sending cookies, unset `config.jar` directly.\n\n```diff\n  // Remove config.jar for preventing to send cookie\n  axios.get('https://example.com', {\n-   jar: new CookieJar(),\n-   withCredentials: false,\n  });\n```\n\n### `config.httpAgent` / `config.httpsAgent` cannot use with `axios-cookiejar-support`.\n\n`http-cookie-agent` allows to use another Agent with CookieJar.\n\n```js\nimport axios from 'axios';\nimport { CookieJar } from 'tough-cookie';\nimport { createCookieAgent } from 'http-cookie-agent';\nimport httpProxyAgent from 'http-proxy-agent';\nimport httpsProxyAgent from 'https-proxy-agent';\n\nconst HttpProxyCookieAgent = createCookieAgent(httpProxyAgent.HttpProxyAgent);\nconst HttpsProxyCookieAgent = createCookieAgent(httpsProxyAgent.HttpsProxyAgent);\n\nconst jar = new CookieJar();\nconst client = axios.create({\n  httpAgent: new HttpProxyCookieAgent({ jar, hostname: '127.0.0.1', port: 8080 }),\n  httpsAgent: new HttpsProxyCookieAgent({ jar, hostname: '127.0.0.1', port: 8080 }),\n});\n\nawait client.get('https://example.com');\n```\n\n### `config.jar` no longer accepts boolean.\n\n```diff\n  // Cannot use boolean as config.jar since v2.x\n+ const cookieJar = new CookieJar();\n  axios.get('https://example.com', {\n-   jar: true,\n+   jar: cookieJar,\n  });\n```\n\n### Invalid cookies will always be ignored.\n\nUp to v1.x, `axios-cookie-jar` throws an error by default when a client receives invalid cookies.\n\nHowever, since v2.0, `axios-cookie-jar` will always ignore invalid cookies.\n\n```diff\n  const cookieJar = new CookieJar();\n  axios.get('https://example.com', {\n    jar: cookieJar,\n-   ignoreCookieErrors: true,\n  });\n```\n"
  },
  {
    "path": "README.md",
    "content": "# axios-cookiejar-support\n\n![axios-cookiejar-support](./docs/assets/ogp.jpg)\n\n[![github sponsors](https://flat.badgen.net/badge/GitHub%20Sponsors/Support%20me%20%E2%9D%A4/ff69b4?icon=github)](https://github.com/sponsors/3846masa)\n[![npm](https://flat.badgen.net/npm/v/axios-cookiejar-support)](https://www.npmjs.com/package/axios-cookiejar-support)\n[![license](https://flat.badgen.net/badge/license/MIT/blue)](LICENSE)\n[![standard-readme compliant](https://flat.badgen.net/badge/readme%20style/standard/green)](https://github.com/RichardLitt/standard-readme)\n\nAdd `tough-cookie` support to axios.\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n  - [Extended Request Config](#extended-request-config)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Install\n\n```\nnpm install axios tough-cookie axios-cookiejar-support\n```\n\n## Usage\n\n```js\nimport axios from 'axios';\nimport { wrapper } from 'axios-cookiejar-support';\nimport { CookieJar } from 'tough-cookie';\n\nconst jar = new CookieJar();\nconst client = wrapper(axios.create({ jar }));\n\nawait client.get('https://example.com');\n```\n\nSee [examples](./examples) for more details.\n\n### Extended Request Config\n\n```ts\nimport type { CookieJar } from 'tough-cookie';\n\ndeclare module 'axios' {\n  interface AxiosRequestConfig {\n    jar?: CookieJar;\n  }\n}\n```\n\nSee also https://github.com/axios/axios#request-config .\n\n## FAQ\n\n- Q. Why can't I assign the httpAgent / httpsAgent?\n  - A. axios-cookiejar-support uses httpAgent / httpsAgent to read and write cookies. If other Agents are assigned, cookies cannot be read/written.\n- Q. I want to use it with another Agent (e.g., http-proxy-agent).\n  - A. Consider using http-cookie-agent. axios-cookiejar-support also uses http-cookie-agent. Read http-cookie-agent's README for more details.\n\n## Contributing\n\nPRs accepted.\n\n## License\n\n[MIT (c) 3846masa](./LICENSE)\n"
  },
  {
    "path": "babel.config.mjs",
    "content": "const config = {\n  plugins: ['@babel/plugin-proposal-explicit-resource-management'],\n  presets: [\n    [\n      '@babel/preset-env',\n      {\n        modules: false,\n        targets: { node: 18 },\n      },\n    ],\n    ['@babel/preset-typescript'],\n  ],\n};\n\nexport default config;\n"
  },
  {
    "path": "eslint.config.mjs",
    "content": "import { configs as sharedConfigs } from '@3846masa/configs/eslint';\n\n/** @type {import('eslint').Linter.Config[]} */\nexport default [\n  {\n    ignores: ['dist/**', 'examples/**'],\n  },\n  ...sharedConfigs,\n  {\n    files: ['examples/**/*'],\n    rules: {\n      'import/order': [\n        'error',\n        {\n          pathGroups: [\n            {\n              group: 'external',\n              pattern: 'axios-cookiejar-support',\n            },\n          ],\n        },\n      ],\n    },\n  },\n];\n"
  },
  {
    "path": "examples/basic.cjs",
    "content": "/* eslint-disable @typescript-eslint/no-require-imports */\n'use strict';\n\nconst { default: axios } = require('axios');\nconst { CookieJar } = require('tough-cookie');\nconst { wrapper } = require('axios-cookiejar-support');\n\nconst jar = new CookieJar();\nconst client = wrapper(axios.create({ jar }));\n\nvoid client.get('https://httpbin.org/cookies/set/session/userid').then(({ config }) => {\n  console.log(config.jar?.toJSON());\n});\n"
  },
  {
    "path": "examples/basic.mjs",
    "content": "import axios from 'axios';\nimport { wrapper } from 'axios-cookiejar-support';\nimport { CookieJar } from 'tough-cookie';\n\nasync function main() {\n  const jar = new CookieJar();\n  const client = wrapper(axios.create({ jar }));\n\n  const { config } = await client.get('https://httpbin.org/cookies/set/session/userid');\n\n  console.log(config.jar?.toJSON());\n}\n\nvoid main();\n"
  },
  {
    "path": "examples/wrap_static_axios.mjs",
    "content": "import axios from 'axios';\nimport { wrapper } from 'axios-cookiejar-support';\nimport { CookieJar } from 'tough-cookie';\n\nasync function main() {\n  wrapper(axios);\n\n  const jar = new CookieJar();\n  const { config } = await axios.get('https://httpbin.org/cookies/set/session/userid', {\n    jar,\n  });\n\n  console.log(config.jar?.toJSON());\n}\n\nvoid main();\n"
  },
  {
    "path": "noop.js",
    "content": "/**\n * @template T\n * @param {T} axios\n * @returns {T}\n */\nexport function wrapper(axios) {\n  return axios;\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"axios-cookiejar-support\",\n  \"version\": \"6.0.5\",\n  \"description\": \"Add tough-cookie support to axios.\",\n  \"keywords\": [\n    \"axios\",\n    \"cookie\",\n    \"cookiejar\",\n    \"cookies\",\n    \"tough-cookie\"\n  ],\n  \"homepage\": \"https://github.com/3846masa/axios-cookiejar-support#readme\",\n  \"bugs\": {\n    \"url\": \"https://github.com/3846masa/axios-cookiejar-support/issues\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/3846masa/axios-cookiejar-support.git\"\n  },\n  \"funding\": \"https://github.com/sponsors/3846masa\",\n  \"license\": \"MIT\",\n  \"author\": \"3846masa <3846masahiro+git@gmail.com>\",\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": {\n      \"node\": {\n        \"types\": \"./dist/index.d.ts\",\n        \"default\": \"./dist/index.js\"\n      },\n      \"browser\": {\n        \"types\": \"./dist/index.d.ts\",\n        \"default\": \"./noop.js\"\n      },\n      \"default\": {\n        \"types\": \"./dist/index.d.ts\",\n        \"default\": \"./dist/index.js\"\n      }\n    }\n  },\n  \"main\": \"./dist/index.js\",\n  \"types\": \"./dist/index.d.ts\",\n  \"files\": [\n    \"dist\",\n    \"noop.js\"\n  ],\n  \"scripts\": {\n    \"prebuild\": \"rimraf dist\",\n    \"build\": \"tsc --project tsconfig.build.json\",\n    \"format\": \"pnpm run --sequential \\\"/^format:.*/\\\"\",\n    \"format:eslint\": \"eslint --fix .\",\n    \"format:prettier\": \"prettier --write .\",\n    \"prelint\": \"pnpm run build\",\n    \"lint\": \"pnpm run \\\"/^lint:.*/\\\"\",\n    \"lint:eslint\": \"eslint .\",\n    \"lint:prettier\": \"prettier --check .\",\n    \"lint:tsc\": \"tsc --noEmit\",\n    \"release\": \"release-it\",\n    \"test\": \"vitest run\"\n  },\n  \"dependencies\": {\n    \"http-cookie-agent\": \"^7.0.3\"\n  },\n  \"devDependencies\": {\n    \"@3846masa/configs\": \"github:3846masa/configs#fde6015cc9703c2aee5630993ba80e43ce7120ba\",\n    \"@babel/plugin-proposal-explicit-resource-management\": \"7.27.4\",\n    \"@babel/preset-env\": \"7.29.2\",\n    \"@babel/preset-typescript\": \"7.28.5\",\n    \"@release-it/conventional-changelog\": \"10.0.6\",\n    \"@types/eslint\": \"9.6.1\",\n    \"@types/node\": \"20.19.39\",\n    \"axios\": \"1.13.2\",\n    \"conventional-changelog-conventionalcommits\": \"9.3.1\",\n    \"disposablestack\": \"1.1.7\",\n    \"release-it\": \"19.2.4\",\n    \"rimraf\": \"6.1.3\",\n    \"tough-cookie\": \"6.0.1\",\n    \"typescript\": \"6.0.2\",\n    \"vitest\": \"4.0.18\"\n  },\n  \"peerDependencies\": {\n    \"axios\": \">=0.20.0\",\n    \"tough-cookie\": \">=4.0.0\"\n  },\n  \"packageManager\": \"pnpm@10.33.0\",\n  \"engines\": {\n    \"node\": \">=20.0.0\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"pnpm\": {\n    \"overrides\": {\n      \"conventional-changelog-conventionalcommits\": \"$conventional-changelog-conventionalcommits\"\n    }\n  }\n}\n"
  },
  {
    "path": "patches/@semantic-release__git@10.0.1.patch",
    "content": "diff --git a/lib/git.js b/lib/git.js\nindex 267ef1d7a38a4de2c1b9986333eb8b2782ec358b..5644689352ab0dfe9f83dbfc5c37156a3db8b3f1 100644\n--- a/lib/git.js\n+++ b/lib/git.js\n@@ -48,7 +48,7 @@ async function commit(message, execaOptions) {\n  * @throws {Error} if the push failed.\n  */\n async function push(origin, branch, execaOptions) {\n-  await execa('git', ['push', '--tags', origin, `HEAD:${branch}`], execaOptions);\n+  await execa('git', ['push', '--tags', '--force', origin, `HEAD:${branch}`], execaOptions);\n }\n \n /**\n"
  },
  {
    "path": "prettier.config.mjs",
    "content": "import { config as sharedConfig } from '@3846masa/configs/prettier';\n\nexport default {\n  ...sharedConfig,\n};\n"
  },
  {
    "path": "src/__tests__/basic.spec.ts",
    "content": "import http from 'node:http';\nimport https from 'node:https';\n\nimport axios from 'axios';\nimport { CookieJar } from 'tough-cookie';\nimport { beforeAll, expect, test } from 'vitest';\n\nimport { wrapper } from '../';\n\nimport { createTestServer } from './helpers';\n\nbeforeAll(() => {\n  wrapper(axios);\n});\n\ntest('should receive response correctly', async () => {\n  using server = await createTestServer([\n    (_req, res) => {\n      res.end('Hello World!');\n    },\n  ]);\n\n  const jar = new CookieJar();\n\n  const actual = await axios.get(`http://localhost:${server.port.toString(10)}`, { jar, responseType: 'text' });\n  expect(actual).toMatchObject({\n    data: 'Hello World!',\n    status: 200,\n  });\n});\n\ntest('should store cookies to cookiejar', async () => {\n  using server = await createTestServer([\n    (_req, res) => {\n      res.setHeader('Set-Cookie', 'key=value');\n      res.end();\n    },\n  ]);\n\n  const jar = new CookieJar();\n\n  await axios.get(`http://localhost:${server.port.toString(10)}`, { jar });\n\n  const actual = await jar.getCookies(`http://localhost:${server.port.toString(10)}`);\n  expect(actual).toMatchObject([{ key: 'key', value: 'value' }]);\n});\n\ntest('should send cookies from cookiejar', async () => {\n  using server = await createTestServer([\n    (req, res) => {\n      res.write(req.headers['cookie']);\n      res.end();\n    },\n  ]);\n\n  const jar = new CookieJar();\n  await jar.setCookie('key=value', `http://localhost:${server.port.toString(10)}`);\n\n  const { data: actual } = await axios.get<string>(`http://localhost:${server.port.toString(10)}`, {\n    jar,\n    responseType: 'text',\n  });\n  expect(actual).toBe('key=value');\n});\n\ntest('should merge cookies from cookiejar and cookie header', async () => {\n  using server = await createTestServer([\n    (req, res) => {\n      res.write(req.headers['cookie']);\n      res.end();\n    },\n  ]);\n\n  const jar = new CookieJar();\n  await jar.setCookie('key1=value1', `http://localhost:${server.port.toString(10)}`);\n\n  const { data: actual } = await axios.get<string>(`http://localhost:${server.port.toString(10)}`, {\n    headers: { Cookie: 'key2=value2' },\n    jar,\n    responseType: 'text',\n  });\n  expect(actual).toBe('key1=value1; key2=value2');\n});\n\ntest('should send cookies which received first request when redirecting to same domain', async () => {\n  using server = await createTestServer([\n    (_req, res) => {\n      res.statusCode = 301;\n      res.setHeader('Location', '/another-path');\n      res.setHeader('Set-Cookie', 'key=value');\n      res.end();\n    },\n    (req, res) => {\n      res.write(req.headers['cookie']);\n      res.end();\n    },\n  ]);\n\n  const jar = new CookieJar();\n\n  const { data: actual } = await axios.get<string>(`http://localhost:${server.port.toString(10)}`, {\n    jar,\n    responseType: 'text',\n  });\n  expect(actual).toBe('key=value');\n});\n\ntest('should not send cookies which received first request when redirecting to another domain', async () => {\n  using server = await createTestServer([\n    (_req, res) => {\n      res.statusCode = 301;\n      res.setHeader('Location', `http://127.0.0.1:${server.port.toString(10)}`);\n      res.setHeader('Set-Cookie', 'key=value');\n      res.end();\n    },\n    (req, res) => {\n      res.write(JSON.stringify(req.headers));\n      res.end();\n    },\n  ]);\n\n  const jar = new CookieJar();\n\n  const { data: actual } = await axios.get<object>(`http://localhost:${server.port.toString(10)}`, {\n    jar,\n    responseType: 'json',\n  });\n  expect(actual).not.toHaveProperty('cookie');\n});\n\ntest('should send cookies even when target is same host but different port', async () => {\n  using firstServer = await createTestServer([\n    (_req, res) => {\n      res.setHeader('Set-Cookie', 'key=expected');\n      res.end();\n    },\n  ]);\n\n  using secondServer = await createTestServer([\n    (req, res) => {\n      res.write(req.headers['cookie']);\n      res.end();\n    },\n  ]);\n\n  const jar = new CookieJar();\n\n  await axios.get(`http://localhost:${firstServer.port.toString(10)}`, { jar });\n  const { data: actual } = await axios.get<string>(`http://localhost:${secondServer.port.toString(10)}`, {\n    jar,\n    responseType: 'text',\n  });\n  expect(actual).toBe('key=expected');\n});\n\ntest('should throw error when config.httpAgent was assigned', async () => {\n  using server = await createTestServer([\n    (_req, res) => {\n      res.end();\n    },\n  ]);\n\n  const jar = new CookieJar();\n\n  const actual = axios.get(`http://localhost:${server.port.toString(10)}`, { httpAgent: new http.Agent(), jar });\n  await expect(actual).rejects.toThrowError(\n    expect.objectContaining({\n      message: 'axios-cookiejar-support does not support for use with other http(s).Agent.',\n    }) as Error,\n  );\n});\n\ntest('should throw error when config.httpsAgent was assigned', async () => {\n  using server = await createTestServer([\n    (_req, res) => {\n      res.end();\n    },\n  ]);\n\n  const jar = new CookieJar();\n\n  const actual = axios.get(`http://localhost:${server.port.toString(10)}`, { httpsAgent: new https.Agent(), jar });\n  await expect(actual).rejects.toThrowError(\n    expect.objectContaining({\n      message: 'axios-cookiejar-support does not support for use with other http(s).Agent.',\n    }) as Error,\n  );\n});\n\ntest('should throw error when config.jar was assigned with boolean', async () => {\n  using server = await createTestServer([\n    (_req, res) => {\n      res.end();\n    },\n  ]);\n\n  const actual = axios.get(`http://localhost:${server.port.toString(10)}`, {\n    // @ts-expect-error -- Legacy version allows to assign boolean as jar.\n    jar: true,\n  });\n  await expect(actual).rejects.toThrowError(\n    expect.objectContaining({\n      message: 'config.jar does not accept boolean since axios-cookiejar-support@2.0.0.',\n    }) as Error,\n  );\n});\n\ntest('should allow to reuse config', async () => {\n  using server = await createTestServer([\n    (_req, res) => {\n      res.end('Hello World!');\n    },\n    (_req, res) => {\n      res.end('Hello World!');\n    },\n  ]);\n\n  const jar = new CookieJar();\n\n  const { config } = await axios.get(`http://localhost:${server.port.toString(10)}`, { jar, responseType: 'text' });\n  const actual = axios.get(`http://localhost:${server.port.toString(10)}`, config);\n  await expect(actual).resolves.not.toThrowError();\n});\n"
  },
  {
    "path": "src/__tests__/create_instance.spec.ts",
    "content": "import axios from 'axios';\nimport { CookieJar } from 'tough-cookie';\nimport { beforeAll, expect, test } from 'vitest';\n\nimport { wrapper } from '../';\n\nimport { createTestServer } from './helpers';\n\nbeforeAll(() => {\n  wrapper(axios);\n});\n\ntest('should store cookies to cookiejar when using instance', async () => {\n  using server = await createTestServer([\n    (_req, res) => {\n      res.setHeader('Set-Cookie', 'key=value');\n      res.end();\n    },\n  ]);\n\n  const jar = new CookieJar();\n  const client = axios.create({ jar });\n\n  await client.get(`http://localhost:${server.port.toString(10)}`);\n\n  const actual = await jar.getCookies(`http://localhost:${server.port.toString(10)}`);\n  expect(actual).toMatchObject([{ key: 'key', value: 'value' }]);\n});\n\ntest('should send cookies from cookiejar when using instance', async () => {\n  using server = await createTestServer([\n    (req, res) => {\n      res.write(req.headers['cookie']);\n      res.end();\n    },\n  ]);\n\n  const jar = new CookieJar();\n  const client = axios.create({ jar });\n  await jar.setCookie('key=value', `http://localhost:${server.port.toString(10)}`);\n\n  const { data: actual } = await client.get<string>(`http://localhost:${server.port.toString(10)}`, {\n    responseType: 'text',\n  });\n  expect(actual).toBe('key=value');\n});\n"
  },
  {
    "path": "src/__tests__/default_config.spec.ts",
    "content": "import axios from 'axios';\nimport { CookieJar } from 'tough-cookie';\nimport { afterEach, beforeAll, expect, test } from 'vitest';\n\nimport { wrapper } from '../';\n\nimport { createTestServer } from './helpers';\n\nbeforeAll(() => {\n  wrapper(axios);\n});\n\nafterEach(() => {\n  delete axios.defaults.jar;\n});\n\ntest('should store cookies to cookiejar when default.jar was assigned', async () => {\n  using server = await createTestServer([\n    (_req, res) => {\n      res.setHeader('Set-Cookie', 'key=value');\n      res.end();\n    },\n  ]);\n\n  const jar = new CookieJar();\n  axios.defaults.jar = jar;\n\n  await axios.get(`http://localhost:${server.port.toString(10)}`);\n\n  const actual = await jar.getCookies(`http://localhost:${server.port.toString(10)}`);\n  expect(actual).toMatchObject([{ key: 'key', value: 'value' }]);\n});\n\ntest('should send cookies from cookiejar when default.jar was assigned', async () => {\n  using server = await createTestServer([\n    (req, res) => {\n      res.write(req.headers['cookie']);\n      res.end();\n    },\n  ]);\n\n  const jar = new CookieJar();\n  axios.defaults.jar = jar;\n  await jar.setCookie('key=value', `http://localhost:${server.port.toString(10)}`);\n\n  const { data: actual } = await axios.get<string>(`http://localhost:${server.port.toString(10)}`, {\n    responseType: 'text',\n  });\n  expect(actual).toBe('key=value');\n});\n\ntest('should use config.cookiejar in preference to default.jar', async () => {\n  using server = await createTestServer([\n    (req, res) => {\n      res.write(req.headers['cookie']);\n      res.end();\n    },\n  ]);\n\n  const defaultJar = new CookieJar();\n  axios.defaults.jar = defaultJar;\n  await defaultJar.setCookie('key=default', `http://localhost:${server.port.toString(10)}`);\n\n  const configJar = new CookieJar();\n  await configJar.setCookie('key=config', `http://localhost:${server.port.toString(10)}`);\n\n  const { data: actual } = await axios.get<string>(`http://localhost:${server.port.toString(10)}`, {\n    jar: configJar,\n    responseType: 'text',\n  });\n  expect(actual).toBe('key=config');\n});\n"
  },
  {
    "path": "src/__tests__/helpers.ts",
    "content": "import http from 'node:http';\nimport { promisify } from 'node:util';\n\nexport async function createTestServer(\n  stories: http.RequestListener[],\n): Promise<{ [Symbol.dispose]: () => void; port: number }> {\n  const server = http.createServer();\n\n  await promisify(server.listen.bind(server)).apply(null);\n\n  const serverInfo = server.address();\n  if (serverInfo == null || typeof serverInfo === 'string') {\n    throw new Error('Failed to setup a test server.');\n  }\n\n  server.on('request', (req, res) => {\n    const listener = stories.shift();\n    listener?.(req, res);\n  });\n\n  return {\n    [Symbol.dispose]: () => {\n      server.close();\n    },\n    port: serverInfo.port,\n  };\n}\n"
  },
  {
    "path": "src/__tests__/without_cookiejar.spec.ts",
    "content": "import axios from 'axios';\nimport { beforeAll, expect, test } from 'vitest';\n\nimport { wrapper } from '../';\n\nimport { createTestServer } from './helpers';\n\nbeforeAll(() => {\n  wrapper(axios);\n});\n\ntest('should receive response correctly without cookiejar', async () => {\n  using server = await createTestServer([\n    (_req, res) => {\n      res.end('Hello World!');\n    },\n  ]);\n\n  const actual = await axios.get(`http://localhost:${server.port.toString(10)}`, { responseType: 'text' });\n  expect(actual).toMatchObject({\n    data: 'Hello World!',\n    status: 200,\n  });\n});\n"
  },
  {
    "path": "src/__tests__/wrap_instance.spec.ts",
    "content": "import axios from 'axios';\nimport { CookieJar } from 'tough-cookie';\nimport { expect, test } from 'vitest';\n\nimport { wrapper } from '../';\n\nimport { createTestServer } from './helpers';\n\ntest('should store cookies to cookiejar when instance was wrapped', async () => {\n  using server = await createTestServer([\n    (_req, res) => {\n      res.setHeader('Set-Cookie', 'key=value');\n      res.end();\n    },\n  ]);\n\n  const jar = new CookieJar();\n  const client = wrapper(axios.create({ jar }));\n\n  await client.get(`http://localhost:${server.port.toString(10)}`);\n\n  const actual = await jar.getCookies(`http://localhost:${server.port.toString(10)}`);\n  expect(actual).toMatchObject([{ key: 'key', value: 'value' }]);\n});\n\ntest('should send cookies from cookiejar when instance was wrapped', async () => {\n  using server = await createTestServer([\n    (req, res) => {\n      res.write(req.headers['cookie']);\n      res.end();\n    },\n  ]);\n\n  const jar = new CookieJar();\n  const client = wrapper(axios.create({ jar }));\n  await jar.setCookie('key=value', `http://localhost:${server.port.toString(10)}`);\n\n  const { data: actual } = await client.get<string>(`http://localhost:${server.port.toString(10)}`, {\n    responseType: 'text',\n  });\n  expect(actual).toBe('key=value');\n});\n"
  },
  {
    "path": "src/index.ts",
    "content": "import type { AxiosInstance, AxiosStatic, InternalAxiosRequestConfig } from 'axios';\nimport { HttpCookieAgent, HttpsCookieAgent } from 'http-cookie-agent/http';\nimport type { CookieJar } from 'tough-cookie';\n\nconst AGENT_CREATED_BY_AXIOS_COOKIEJAR_SUPPORT = Symbol('AGENT_CREATED_BY_AXIOS_COOKIEJAR_SUPPORT');\n\ntype AttachedAgent = {\n  [AGENT_CREATED_BY_AXIOS_COOKIEJAR_SUPPORT]?: boolean;\n};\n\ndeclare module 'axios' {\n  interface AxiosRequestConfig {\n    jar?: CookieJar;\n  }\n}\n\nfunction requestInterceptor(config: InternalAxiosRequestConfig): InternalAxiosRequestConfig {\n  if (!config.jar) {\n    return config;\n  }\n\n  // @ts-expect-error -- Legacy config allows to assign boolean as jar.\n  if (config.jar === true) {\n    throw new Error('config.jar does not accept boolean since axios-cookiejar-support@2.0.0.');\n  }\n\n  if (\n    (config.httpAgent != null &&\n      (config.httpAgent as AttachedAgent)[AGENT_CREATED_BY_AXIOS_COOKIEJAR_SUPPORT] !== true) ||\n    (config.httpsAgent != null &&\n      (config.httpsAgent as AttachedAgent)[AGENT_CREATED_BY_AXIOS_COOKIEJAR_SUPPORT] !== true)\n  ) {\n    throw new Error('axios-cookiejar-support does not support for use with other http(s).Agent.');\n  }\n\n  config.httpAgent = new HttpCookieAgent({ cookies: { jar: config.jar } });\n  Object.defineProperty(config.httpAgent, AGENT_CREATED_BY_AXIOS_COOKIEJAR_SUPPORT, {\n    configurable: false,\n    enumerable: false,\n    value: true,\n    writable: false,\n  });\n\n  config.httpsAgent = new HttpsCookieAgent({ cookies: { jar: config.jar } });\n  Object.defineProperty(config.httpsAgent, AGENT_CREATED_BY_AXIOS_COOKIEJAR_SUPPORT, {\n    configurable: false,\n    enumerable: false,\n    value: true,\n    writable: false,\n  });\n\n  return config;\n}\n\nexport function wrapper<T extends AxiosStatic | AxiosInstance>(axios: T): T {\n  const isWrapped = axios.interceptors.request.handlers.find(({ fulfilled }) => fulfilled === requestInterceptor);\n\n  if (isWrapped) {\n    return axios;\n  }\n\n  axios.interceptors.request.use(requestInterceptor);\n\n  if ('create' in axios) {\n    const create = axios.create.bind(axios);\n    axios.create = (...args) => {\n      const instance = create.apply(axios, args);\n      instance.interceptors.request.use(requestInterceptor);\n      return instance;\n    };\n  }\n\n  return axios;\n}\n"
  },
  {
    "path": "src/types.d.ts",
    "content": "import 'axios';\n\ndeclare module 'axios' {\n  interface AxiosInterceptorManager {\n    handlers: Array<{\n      fulfilled: (...args: unknown[]) => unknown;\n      rejected: (...args: unknown[]) => unknown;\n      runWhen: unknown;\n      synchronous: unknown;\n    }>;\n  }\n}\n"
  },
  {
    "path": "tsconfig.build.json",
    "content": "{\n  \"compilerOptions\": {\n    \"declaration\": true,\n    \"noEmit\": false,\n    \"outDir\": \"./dist\",\n    \"rootDir\": \"./src\"\n  },\n  \"exclude\": [\"**/__tests__\"],\n  \"extends\": \"./tsconfig.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"lib\": [\"ESNext\"],\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"noEmit\": true,\n    \"paths\": {\n      \"axios-cookiejar-support\": [\"./\"]\n    },\n    \"target\": \"ESNext\",\n    \"types\": [\"@types/node\"],\n    \"verbatimModuleSyntax\": false\n  },\n  \"exclude\": [\"dist/\", \"examples/\"],\n  \"extends\": \"@3846masa/configs/typescript/tsconfig.json\",\n  \"include\": [\"**/*\", \"**/.*\"]\n}\n"
  },
  {
    "path": "vitest.config.ts",
    "content": "import { defineConfig } from 'vitest/config';\n\nexport default defineConfig({\n  test: {\n    include: ['**/__tests__/*.spec.ts'],\n    root: './src',\n    setupFiles: ['disposablestack/auto'],\n  },\n});\n"
  }
]