-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlogdirectives.js
29 lines (29 loc) · 1.38 KB
/
logdirectives.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const chalk = require('chalk')
const custom = require('../customcolors')
const colorComment = custom.colorComment
const colorPrimitive = custom.colorPrimitive
const colorError = custom.colorError
const args = custom.colorArgs
module.exports = {
logDirectives: function(obj){
return(
`
${chalk.green('Category:')} ${obj.category}
${chalk.green('Name:')} ${obj.name + '\n'}
${obj.shorthand ? `* Shorthand: ${args(obj.shorthand)}` : ''}
${obj.expects ? `* Expects: ${args(obj.expects)}` : ''}
${obj.restriction ? `* Restriction: ${obj.restriction}` : ''}
${obj.limited ? `* Limited to: ${obj.limited}` : ''}
${obj.usage ? `* Usage: ${obj.usage}` : ''}
${obj.details ? `* Details: ${obj.details}` : ''}
${obj.arguments ? `* Arguments (${obj.arguments.length})` : ''}
${obj.arguments ? obj.arguments.map((arg, index) => {
return `${index+1}: ${args(arg)} `
}).join(" ") : ''}
${obj.modifiers ? `* Modifiers: ${obj.modifiers}` : ''}
${obj.returns ? `* Returns: ${args(obj.returns)}` : ''}
${obj.example ? `* Example: ${obj.example}` : ''}
`
)
}
}