import kebabCase from 'lodash/string/kebabCase'
import pluralizeArea from '../../src/lib/pluralize-area'

export default function findAreaPath({name, type, revision}) {
	name = kebabCase(name.replace(`'`, ''))
	type = pluralizeArea(type)
	return `${type}/${name}.yaml`
}

@@ -110,16 +110,8 @@
 ort 
-default 
 func
@@ -119,139 +119,194 @@
 ion 
-findAreaPath(%7Bname, type, revision%7D) %7B%0A%09name = kebabCase(name.replace(%60'%60, ''))%0A%09type = pluralizeArea(type)%0A%09return %60$%7B
+slugifyAreaName(name) %7B%0A%09return kebabCase(name.replace(%60'%60, ''))%0A%7D%0A%0Aexport default function findAreaPath(%7Bname, type, revision%7D) %7B%0A%09return %60$%7BpluralizeArea(
 type
+)
 %7D/$%7B
+slugifyAreaName(
 name
+)
 %7D.ya

extract slugifyAreaName into a function