import type { GetServerSideProps , GetStaticPaths , GetStaticProps } from 'next' ; /** Needed in combination with `InferGetServerSidePropsType` */ export function defineServerSideProps < Fn extends GetServerSideProps > ( fn ) { return fn ; } /** Needed in combination with `InferGetStaticPropsType` */ export function defineStaticProps < Fn extends GetStaticProps > ( fn ) { return fn ; } export function defineStaticPaths < Fn extends GetStaticPaths > ( fn ) { return fn ; } export function toParams ( path ) { return { params : { slug : path . replace ( /^\// , '' ) . split ( '/' ) } } ; } export function notUndefined < T > ( _ ) { return _ !== undefined ; }