UNPKG

verb

Version:

Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.

21 lines (16 loc) 443 B
'use strict'; var isPlainObject = require('is-plain-object'); var author = require('parse-author'); /** * Called in the `init` transform. Adds an `author` * property to the context, or normalizes the existing one. */ module.exports = function(app) { var res = app.get('data.author'); if (isPlainObject(res)) return; if (typeof res === 'string') { app.data({author: author(res)}); } else { app.data({author: {}}); } };