Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Sep 12, 2016
1 parent 65de5ae commit 33132b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Installation

Usage
-----
`(url: string, opts: Options) => Promise<string>`
`(url: string, options: Options) => Promise<string>`

### Options
| Property | Type | Description | Default |
Expand Down
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ const plugins: IPlugin[] = [
require('./plugins/wikipedia')
];

export default async (url: string, opts: Options): Promise<string> => {
export default async (url: string, options?: Options): Promise<string> => {
const _url = URL.parse(url, true);

const opts: any = options || {};
if (!opts.hasOwnProperty('proxy')) {
opts.proxy = null;
}

const plugin = plugins.filter(plugin => plugin.test(_url))[0];

if (plugin) {
Expand Down

0 comments on commit 33132b2

Please sign in to comment.