Skip to content

Commit d7f96c6

Browse files
committed
Tinker with doclets.io
1 parent fa2ca32 commit d7f96c6

File tree

1 file changed

+29
-25
lines changed

1 file changed

+29
-25
lines changed

src/js-partial-foreach.js

+29-25
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,32 @@
6363
// Global config options
6464

6565
/**
66-
* @typedef Options
67-
* @type Object
68-
* @property {boolean} [checkArguments=true] checkArguments
69-
* @property {boolean} [checkOwnProperty=true] checkOwnProperty
70-
* @property {boolean} [castArrayIndex=true] castArrayIndex
66+
* @typedef configOptions
7167
*/
68+
configOptions = {
69+
/**
70+
* @property {boolean} [checkArguments=true]
71+
* @memberOf configOptions
72+
* @description Determines whether "foreach" should check the number of arguments in the callback function.
73+
*
74+
* If it is enabled and:
75+
* - when the callback function has one argument, "foreach" will
76+
* pass one argument to the callback function, which will contain
77+
* the actual **value** of the container object.
78+
*
79+
* - when the callback function has two arguments, "foreach" will
80+
* pass two arguments to the callback function, the first will be
81+
* the actual **key**, the second will be the
82+
* actual **value** of the container object.
83+
*
84+
* If it is disabled, always two arguments will be passed to the
85+
* callback function, the first will be the actual **key**,
86+
* the second will be the actual **value** of the container object.
87+
*/
88+
checkArguments : true,
89+
checkOwnProperty : true,
90+
castArrayIndex : true
91+
},
7292

7393
/**
7494
* Determines whether "foreach" should check the number of arguments in the callback function.
@@ -125,27 +145,11 @@
125145
* @private
126146
* @function processOptions
127147
*
128-
* @param {object} [options] The object, which contains the config options.
129-
* @param {boolean} [setGlobal] Whether the passed config options should change
130-
* the global config options for "foreach".
148+
* @param {configOptions} [options] The object, which contains the config options.
149+
* @param {boolean} [setGlobal] Whether the passed config options should change
150+
* the global config options for "foreach".
131151
*
132-
* @param {boolean} [options.checkArguments=true] Sets whether "foreach" should check the number of arguments
133-
* in the callback function. For detailed description,
134-
* check: {@link checkArguments}
135-
*
136-
* @param {boolean} [options.checkOwnProperty=true] Sets whether "foreach" should only pass the key or
137-
* key=>value pairs, if they pass the .hasOwnProperty(...) test.
138-
* For detailed description, check: {@link checkOwnProperty}
139-
*
140-
* @param {boolean} [options.castArrayIndex=true] Sets whether "foreach" should cast the indices (key) of the
141-
* array-like container object to integers.
142-
* For detailed description, check: {@link castArrayIndex}
143-
*
144-
* @returns {{
145-
* checkArguments : boolean,
146-
* checkOwnProperty : boolean,
147-
* castArrayIndex : boolean
148-
* }} The valid, changeable config options with their actual, current value.
152+
* @returns {configOptions} The valid, changeable config options with their actual, current value.
149153
*/
150154
function processOptions(options, setGlobal) {
151155
var checkArgs = checkArguments,

0 commit comments

Comments
 (0)