From 365b6ffc7c8ce685ec11fb908c4918d66c4047b5 Mon Sep 17 00:00:00 2001 From: rhysd Date: Fri, 4 Sep 2015 17:23:11 +0900 Subject: [PATCH] Fix exporting cheerio module cheerio is intended to be used as below: ```javascript var cheerio = require('cheerio'), $ = cheerio.load('

Hello world

'); ``` So we should use `import * as cheerio from "cheerio"` in TypeScript. However, `cheerio` was defined with `export default` in cheerio.d.ts. --- cheerio/cheerio-tests.ts | 2 +- cheerio/cheerio.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cheerio/cheerio-tests.ts b/cheerio/cheerio-tests.ts index 2f7b9f948..cb74619d4 100644 --- a/cheerio/cheerio-tests.ts +++ b/cheerio/cheerio-tests.ts @@ -1,6 +1,6 @@ /// -import cheerio from 'cheerio'; +import * as cheerio from 'cheerio'; /* * LOADING diff --git a/cheerio/cheerio.d.ts b/cheerio/cheerio.d.ts index 57d526d1b..3b5b998d9 100644 --- a/cheerio/cheerio.d.ts +++ b/cheerio/cheerio.d.ts @@ -262,5 +262,5 @@ interface CheerioAPI extends CheerioSelector { declare var cheerio:CheerioAPI; declare module "cheerio" { - export default cheerio; + export = cheerio; }