File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export * from './svgo.js';
3737 * You can also specify relative or absolute path and customize current working
3838 * directory.
3939 *
40- * @type {<T extends string>(configFile?: T | null , cwd?: string) => Promise<T extends string ? import('./svgo.js').Config : import('./svgo.js').Config | null> }
40+ * @type {<T extends string | null >(configFile?: T, cwd?: string) => Promise<T extends string ? import('./svgo.js').Config : import('./svgo.js').Config | null> }
4141 */
4242export const loadConfig = async ( configFile , cwd = process . cwd ( ) ) => {
4343 if ( configFile != null ) {
Original file line number Diff line number Diff line change 11import { expectType , expectAssignable } from 'tsd' ;
2- import { DataUri , Output , optimize } from '../../types/lib/svgo-node.js' ;
2+ import {
3+ type Config ,
4+ type DataUri ,
5+ type Output ,
6+ loadConfig ,
7+ optimize ,
8+ } from '../../types/lib/svgo-node.js' ;
39
410expectType < Output > ( optimize ( '<svg></svg>' ) ) ;
511expectAssignable < DataUri > ( 'enc' ) ;
12+
13+ expectType < Promise < Config | null > > ( loadConfig ( ) ) ;
14+ expectType < Promise < Config | null > > ( loadConfig ( undefined ) ) ;
15+ expectType < Promise < Config | null > > ( loadConfig ( null ) ) ;
16+ expectType < Promise < Config > > ( loadConfig ( 'svgo.config.js' ) ) ;
You can’t perform that action at this time.
0 commit comments