File tree Expand file tree Collapse file tree
packages/integrations/sitemap/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,17 +4,9 @@ import { SITEMAP_CONFIG_DEFAULTS } from './config-defaults';
44
55const localeKeySchema = ( ) => z . string ( ) . min ( 1 ) ;
66
7- const isFunction = ( fn : any ) => fn instanceof Function ;
8-
9- const fnSchema = ( ) =>
10- z
11- . any ( )
12- . refine ( ( val ) => ! val || isFunction ( val ) , { message : 'Not a function' } )
13- . optional ( ) ;
14-
157export const SitemapOptionsSchema = z
168 . object ( {
17- filter : fnSchema ( ) ,
9+ filter : z . function ( ) . optional ( ) ,
1810 customPages : z . string ( ) . url ( ) . array ( ) . optional ( ) ,
1911 canonicalURL : z . string ( ) . url ( ) . optional ( ) ,
2012
@@ -32,12 +24,12 @@ export const SitemapOptionsSchema = z
3224 ) ,
3325 } )
3426 . refine ( ( val ) => ! val || val . locales [ val . defaultLocale ] , {
35- message : '`defaultLocale` must exists in `locales` keys' ,
27+ message : '`defaultLocale` must exist in `locales` keys' ,
3628 } )
3729 . optional ( ) ,
3830
39- entryLimit : z . number ( ) . nonnegative ( ) . default ( SITEMAP_CONFIG_DEFAULTS . entryLimit ) ,
40- serialize : fnSchema ( ) ,
31+ entryLimit : z . number ( ) . nonnegative ( ) . optional ( ) . default ( SITEMAP_CONFIG_DEFAULTS . entryLimit ) ,
32+ serialize : z . function ( ) . optional ( ) ,
4133
4234 changefreq : z . enum ( changefreqValues ) . optional ( ) ,
4335 lastmod : z . date ( ) . optional ( ) ,
You can’t perform that action at this time.
0 commit comments