mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
Fix exporting cheerio module
cheerio is intended to be used as below:
```javascript
var cheerio = require('cheerio'),
$ = cheerio.load('<h2 class="title">Hello world</h2>');
```
So we should use `import * as cheerio from "cheerio"` in TypeScript.
However, `cheerio` was defined with `export default` in cheerio.d.ts.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/// <reference path="cheerio.d.ts" />
|
||||
|
||||
import cheerio from 'cheerio';
|
||||
import * as cheerio from 'cheerio';
|
||||
|
||||
/*
|
||||
* LOADING
|
||||
|
||||
Vendored
+1
-1
@@ -262,5 +262,5 @@ interface CheerioAPI extends CheerioSelector {
|
||||
declare var cheerio:CheerioAPI;
|
||||
|
||||
declare module "cheerio" {
|
||||
export default cheerio;
|
||||
export = cheerio;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user