Skip to content

Commit 24f188f

Browse files
committed
Tinker with doclets.io
1 parent 29c5833 commit 24f188f

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

src/js-partial-foreach.js

+23-8
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
* If it is disabled, every key => value of the container object will be passed to the callback function.
9999
*
100100
* @property {boolean} [castArrayIndex=true] -
101-
*
101+
*
102102
* Determines whether "foreach" should cast the indices of the array-like container object
103103
* to integers (in {number}).
104104
*
@@ -169,9 +169,9 @@
169169
* @function processOptions
170170
* @memberOf js/partial/foreach
171171
*
172-
* @param {config} [options] The object, which contains the config options.
173-
* @param {boolean} [setGlobal] Whether the passed config options should change
174-
* the global config options for "foreach".
172+
* @param {config} [options] The object, which contains the config options.
173+
* @param {boolean} [setGlobal=false] Whether the passed config options should change
174+
* the global config options for "foreach".
175175
*
176176
* @returns {config} The valid, changeable config options with their actual, current value.
177177
*/
@@ -226,7 +226,9 @@
226226
* @param {*} object The container object.
227227
* @param {function} callback The callback function to receive key or key=>value arguments.
228228
* @param {config} [options] The object, which contains the config options.
229-
229+
*
230+
* @return {void}
231+
*
230232
* @example
231233
* // for arrays
232234
* var array = [1, 2, 3, 4, 5];
@@ -297,8 +299,6 @@
297299
* console.log(char); // 'a' .. 'h'
298300
* }
299301
* );
300-
*
301-
* @return {void}
302302
*/
303303
function foreach(object, callback, options) {
304304
var numArgs = TWO_ARGUMENTS,
@@ -366,19 +366,34 @@
366366
* @param {config} [options] The object, which contains the config options.
367367
*
368368
* @return {void}
369+
*
370+
* @example
371+
* // after setOptions(...), the global config of "foreach" will be changed
372+
* foreach.setOptions({
373+
* checkArguments : true,
374+
* checkOwnProperty : false,
375+
* castArrayIndex : false
376+
* });
369377
*/
370378
foreach.setOptions = function(options) {
371379
processOptions(options, true);
372380
};
373381

374382
/**
375-
* Gets the global config options for "foreach" partial.
383+
* Returns the global config options for "foreach" partial.
376384
*
377385
* @static
378386
* @function getOptions
379387
* @memberOf js/partial/foreach
380388
*
381389
* @returns {config} The valid, changeable config options with their actual, current value.
390+
*
391+
* @example
392+
* var options = foreach.getOptions();
393+
* // options now will contain:
394+
* // options.checkArguments
395+
* // options.checkOwnProperty
396+
* // options.castArrayIndex
382397
*/
383398
foreach.getOptions = function() {
384399
return processOptions();

0 commit comments

Comments
 (0)