File tree Expand file tree Collapse file tree
docusaurus-plugin-ideal-image/src/theme/IdealImageLegacy/components
docusaurus-theme-common/src/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -480,7 +480,7 @@ Available document ids are:
480480
481481export function toDocNavigationLink (
482482 doc : DocMetadataBase ,
483- options ?: { sidebarItemLabel ?: string | undefined } ,
483+ options ?: { sidebarItemLabel ?: string } ,
484484) : PropNavigationLink {
485485 const {
486486 title,
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ export const bytesToSize = (bytes) => {
8686const detectWebpSupport = ( ) => {
8787 if ( ssr ) return false ;
8888 const elem = document . createElement ( 'canvas' ) ;
89- if ( elem . getContext && elem . getContext ( '2d' ) ) {
89+ if ( elem . getContext ?. ( '2d' ) ) {
9090 // was able or not to get WebP representation
9191 return elem . toDataURL ( 'image/webp' ) . indexOf ( 'data:image/webp' ) === 0 ;
9292 } else {
@@ -97,8 +97,7 @@ const detectWebpSupport = () => {
9797
9898export const supportsWebp = detectWebpSupport ( ) ;
9999
100- const isWebp = ( x ) =>
101- x . format === 'webp' || ( x . src && x . src . match ( / \. w e b p ( $ | \? .* ) / i) ) ;
100+ const isWebp = ( x ) => x . format === 'webp' || x . src ?. match ( / \. w e b p ( $ | \? .* ) / i) ;
102101
103102// eslint-disable-next-line no-shadow
104103export const selectSrc = ( { srcSet, maxImageWidth, supportsWebp} ) => {
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export type DocsVersionPersistence = 'localStorage' | 'none';
1515
1616// TODO improve types, use unions
1717export type NavbarItem = {
18- type ?: string | undefined ;
18+ type ?: string ;
1919 items ?: NavbarItem [ ] ;
2020 label ?: string ;
2121 position ?: 'left' | 'right' ;
You can’t perform that action at this time.
0 commit comments