Nuxt/docs/utils/createTitle.js
2022-04-09 11:25:13 +02:00

6 lines
234 B
JavaScript

import { splitByCase, upperFirst } from 'scule'
export default (title, link) => {
return title || link.split('/').filter(Boolean).map(part => splitByCase(part).map(p => upperFirst(p)).join(' ')).join(' > ').replace('Api', 'API')
}