Nuxt/docs/utils/createTitle.js

6 lines
271 B
JavaScript
Raw Normal View History

2022-04-09 09:25:13 +00:00
import { splitByCase, upperFirst } from 'scule'
export default (title, link) => {
return title || (link.startsWith('http') && link) || link.split('/').filter(Boolean).map(part => splitByCase(part).map(p => upperFirst(p)).join(' ')).join(' > ').replace('Api', 'API')
2022-04-09 09:25:13 +00:00
}