mirror of
https://github.com/svg/svgo.git
synced 2026-01-27 07:02:06 +03:00
fix: types for loadConfig and add more tests (#2123)
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
import { expectType, expectAssignable } from 'tsd';
|
||||
import { DataUri, Output, optimize } from '../../types/lib/svgo-node.js';
|
||||
import {
|
||||
type Config,
|
||||
type DataUri,
|
||||
type Output,
|
||||
loadConfig,
|
||||
optimize,
|
||||
} from '../../types/lib/svgo-node.js';
|
||||
|
||||
expectType<Output>(optimize('<svg></svg>'));
|
||||
expectAssignable<DataUri>('enc');
|
||||
|
||||
expectType<Promise<Config | null>>(loadConfig());
|
||||
expectType<Promise<Config | null>>(loadConfig(undefined));
|
||||
expectType<Promise<Config | null>>(loadConfig(null));
|
||||
expectType<Promise<Config>>(loadConfig('svgo.config.js'));
|
||||
|
||||
Reference in New Issue
Block a user