mirror of
https://github.com/misskey-dev/summaly.git
synced 2025-05-29 09:27:16 +09:00
Fix bug
This commit is contained in:
parent
65de5ae1fb
commit
33132b2ba2
@ -9,7 +9,7 @@ Installation
|
|||||||
|
|
||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
`(url: string, opts: Options) => Promise<string>`
|
`(url: string, options: Options) => Promise<string>`
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
| Property | Type | Description | Default |
|
| Property | Type | Description | Default |
|
||||||
|
@ -11,9 +11,14 @@ const plugins: IPlugin[] = [
|
|||||||
require('./plugins/wikipedia')
|
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 _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];
|
const plugin = plugins.filter(plugin => plugin.test(_url))[0];
|
||||||
|
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user