From f8f7f594952a5977ccf4652091b5bf6a25851ecd Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 3 Jan 2019 19:18:21 +0300 Subject: [PATCH] updated docs... Signed-off-by: Alex A. Naanou --- ui (gen4)/imagegrid/tags.js | 53 ++++++++++++++----------------------- 1 file changed, 20 insertions(+), 33 deletions(-) diff --git a/ui (gen4)/imagegrid/tags.js b/ui (gen4)/imagegrid/tags.js index 519be8e6..827e78eb 100755 --- a/ui (gen4)/imagegrid/tags.js +++ b/ui (gen4)/imagegrid/tags.js @@ -56,22 +56,24 @@ var util = require('lib/util') // a list enabling the following method signature: // // Example: -// -// // func(arg, ..) -// // func([arg, ..]) -// // -> args +// // someFunc(arg) +// // -> value // // -// var func = function(...args){ -// return normalizeSplit(args) } -// -// func(123) // -> [123] -// func(1, 2, 3) // -> [1, 2, 3] -// -// -// func([1, 2, 3]) // -> [1, 2, 3] -// -// // a more complex case... -// func([1], [2], 3) // -> [[1], [2], 3] +// // someFunc(arg, ..) +// // someFunc([arg, ..]) +// // -> [value, ..] +// // +// var someFunc = function(...args){ +// // the output is allways an array... +// normalizeSplit(args) +// .map(function(arg){ +// // do stuff with args... +// ... +// return arg +// }) +// // make the result same format as the input args... +// .run(normalizeRes(args)) +// } // var normalizeSplit = function(args){ return ((args.length == 1 && args[0] instanceof Array) ? @@ -95,24 +97,9 @@ var normalizeSplit = function(args){ // to the same format as was passed into the function... // // This is designed to be passed to Object.prototype.run(..) -// -// Example: -// // someFunc(arg) -// // -> value -// // -// // someFunc(arg, ..) -// // someFunc([arg, ..]) -// // -> [value, ..] -// // -// var someFunc = function(...args){ -// normalizeSplit(args) -// .map(function(arg){ -// // do stuff with args... -// ... -// return arg -// }) -// .run(normalizeRes(args)) -// } +// +// +// NOTE: for an example see normalizeSplit(..) docs above. // var normalizeRes = function(args){ return function(value){