@@ -25,6 +25,7 @@ export interface DocsCacheDefaults {
2525 maxFiles ?: number ;
2626 allowHosts : string [ ] ;
2727 toc ?: boolean | TocFormat ;
28+ unwrapSingleRootDir ?: boolean ;
2829}
2930
3031export interface DocsCacheSource {
@@ -84,6 +85,7 @@ export const DEFAULT_CONFIG: DocsCacheConfig = {
8485 maxBytes : 200000000 ,
8586 allowHosts : [ "github.com" , "gitlab.com" ] ,
8687 toc : true ,
88+ unwrapSingleRootDir : false ,
8789 } ,
8890 sources : [ ] ,
8991} ;
@@ -299,6 +301,13 @@ export const validateConfig = (input: unknown): DocsCacheConfig => {
299301 defaultsInput . toc !== undefined
300302 ? ( defaultsInput . toc as boolean | TocFormat )
301303 : defaultValues . toc ,
304+ unwrapSingleRootDir :
305+ defaultsInput . unwrapSingleRootDir !== undefined
306+ ? assertBoolean (
307+ defaultsInput . unwrapSingleRootDir ,
308+ "defaults.unwrapSingleRootDir" ,
309+ )
310+ : defaultValues . unwrapSingleRootDir ,
302311 } ;
303312 } else if ( targetModeOverride !== undefined ) {
304313 defaults = {
@@ -431,7 +440,8 @@ export const resolveSources = (
431440 maxFiles : source . maxFiles ?? defaults . maxFiles ,
432441 integrity : source . integrity ,
433442 toc : source . toc ?? defaults . toc ,
434- unwrapSingleRootDir : source . unwrapSingleRootDir ,
443+ unwrapSingleRootDir :
444+ source . unwrapSingleRootDir ?? defaults . unwrapSingleRootDir ,
435445 } ) ) ;
436446} ;
437447
0 commit comments