authentic-ui
Version:
Authentic UI is a set of client side views that use authentic-client to provide an easy signup and authentication flow.
18 lines (16 loc) • 423 B
JavaScript
module.exports = function createLinks (linkTypes, provided, defaults) {
var links = []
linkTypes.forEach(function (type) {
var link = provided[type]
if (!link) return
if (link.href && link.text) return links.push(link)
if (typeof link === 'string') {
if (!defaults[type]) return
return links.push({
text: defaults[type].text,
href: link
})
}
})
return links
}