Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix type exports #364

Merged
merged 1 commit into from
Mar 26, 2023
Merged

Fix type exports #364

merged 1 commit into from
Mar 26, 2023

Commits on Feb 13, 2023

  1. Fix type exports

    According to the old type definitions, this was correct usage:
    
    ```js
    // CJS
    const MockAdapter = require('axios-mock-adapter');
    
    const mock = new MockAdapter.default(/* … */)
    ```
    
    ```js
    // ESM
    const MockAdapter = require('axios-mock-adapter');
    
    const mock = new MockAdapter.default(/* … */)
    ```
    
    With the updated type definitions, this is:
    
    ```js
    // CJS
    const MockAdapter = require('axios-mock-adapter');
    
    const mock = new MockAdapter(/* … */)
    ```
    
    ```js
    // ESM
    const MockAdapter = require('axios-mock-adapter');
    
    const mock = new MockAdapter(/* … */)
    ```
    
    This has always been an issue, but it has become more apparent with the
    `"module": "node16"` option introduced in TypeScript 4.7.
    remcohaszing committed Feb 13, 2023
    Configuration menu
    Copy the full SHA
    76c9f08 View commit details
    Browse the repository at this point in the history