UNPKG

@mintlify/common

Version:

Commonly shared code within Mintlify

12 lines (11 loc) 249 B
export function replaceSlashIndex(path) { if (typeof path !== 'string') return path; if (path.endsWith('/index')) { return path.slice(0, -6); } else if (path === 'index') { return ''; } return path; }