|
63 | 63 | // Global config options
|
64 | 64 |
|
65 | 65 | /**
|
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 |
71 | 67 | */
|
| 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 | + }, |
72 | 92 |
|
73 | 93 | /**
|
74 | 94 | * Determines whether "foreach" should check the number of arguments in the callback function.
|
|
125 | 145 | * @private
|
126 | 146 | * @function processOptions
|
127 | 147 | *
|
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". |
131 | 151 | *
|
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. |
149 | 153 | */
|
150 | 154 | function processOptions(options, setGlobal) {
|
151 | 155 | var checkArgs = checkArguments,
|
|
0 commit comments