extended object.doc(..) to also document functions...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-11-30 05:05:04 +03:00
parent 597129c5a0
commit 023c5c5c7b
2 changed files with 30 additions and 2 deletions

View File

@ -16,6 +16,34 @@ var object = require('ig-object')
/*********************************************************************/ /*********************************************************************/
// helpers... // helpers...
// Document function...
//
// doc(doc, func)
// -> func
//
// doc(doc, long_doc, func)
// -> func
//
//
var doc =
module.doc =
function(doc, action){
// template string processor...
if(doc instanceof Array){
return object.doc(...arguments) }
// document function...
var args = [...arguments]
action = args.pop()
var [doc, long_doc] = args
return object.mixinFlat(
action,
{
doc,
long_doc,
}) }
// XXX doc... // XXX doc...
var doWithRootAction = var doWithRootAction =
module.doWithRootAction = module.doWithRootAction =

View File

@ -1,6 +1,6 @@
{ {
"name": "ig-actions", "name": "ig-actions",
"version": "3.24.18", "version": "3.24.19",
"description": "", "description": "",
"main": "actions.js", "main": "actions.js",
"scripts": { "scripts": {
@ -23,6 +23,6 @@
}, },
"homepage": "https://github.com/flynx/actions.js#readme", "homepage": "https://github.com/flynx/actions.js#readme",
"dependencies": { "dependencies": {
"ig-object": "^5.0.2" "ig-object": "^5.4.12"
} }
} }