mirror of
https://github.com/flynx/actions.js.git
synced 2025-10-28 18:00:11 +00:00
extended object.doc(..) to also document functions...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
597129c5a0
commit
023c5c5c7b
28
actions.js
28
actions.js
@ -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 =
|
||||||
|
|||||||
@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user