Skip to content

Commit 923418f

Browse files
committed
rename shuffle's 2nd arg to "modify" in code and jsdoc types
(was "bool")
1 parent aeeba87 commit 923418f

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/utilities/utility_functions.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ function utilityFunctions(p5, fn){
676676
*
677677
* @method shuffle
678678
* @param {Array} array array to shuffle.
679-
* @param {Boolean} [bool] if `true`, shuffle the original array in place. Defaults to `false`.
679+
* @param {Boolean} [modify] if `true`, shuffle the original array in place. Defaults to `false`.
680680
* @return {Array} shuffled array.
681681
*
682682
* @example
@@ -759,9 +759,9 @@ function utilityFunctions(p5, fn){
759759
* </code>
760760
* </div>
761761
*/
762-
fn.shuffle = function (arr, bool) {
762+
fn.shuffle = function (arr, modify) {
763763
const isView = ArrayBuffer && ArrayBuffer.isView && ArrayBuffer.isView(arr);
764-
arr = bool || isView ? arr : arr.slice();
764+
arr = modify || isView ? arr : arr.slice();
765765

766766
let rnd,
767767
tmp,

utils/patch.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export function applyPatches() {
4646

4747
replace(
4848
['p5.d.ts', 'global.d.ts'],
49-
'shuffle(array: any[], bool?: boolean): any[];',
50-
'shuffle<T>(array: T[], bool?: boolean): T[];'
49+
'shuffle(array: any[], modify?: boolean): any[];',
50+
'shuffle<T>(array: T[], modify?: boolean): T[];'
5151
);
5252

5353
replace(

0 commit comments

Comments
 (0)