@@ -109,8 +109,12 @@ get.between(numItemsToIgnoreAtEachEnd): any[]
109
109
// Returns middle of this.data, between numItemsToIgnoreAtEachEnd
110
110
111
111
get.adjacentAt(startingIndex, numItemsToGet): any[]
112
- // Returns adjacent items. startingIndex can be negative or positive.
113
-
112
+ // Returns adjacent items. startingIndex can be negative or positive.
113
+
114
+ // For all the functions below, the parameter 'value' cannot be object.
115
+ // 'object' does not include Arrays. Arrays are OK, as long as they don't
116
+ // contain objects.
117
+
114
118
get.adjacentToValue(info: IAdjacentToValueInfo): any[]
115
119
/**************
116
120
Returns adjacent items including, or near, a particular value.
@@ -126,9 +130,8 @@ get.adjacentToValue(info: IAdjacentToValueInfo): any[]
126
130
// this.data is [1,2,3,4,5,6,7,8,9,10]
127
131
let numbers = this.get.adjacentToValue({value:5, offset: -2, howMany:3});
128
132
// numbers is now [3,4,5]
129
- ***************/
133
+ ***************/
130
134
131
- // For all the functions below, the parameter 'value' cannot be object.
132
135
133
136
get.allAfterFirst(value): any[]
134
137
// returns all items after the first instance of value.
@@ -210,6 +213,10 @@ getAndRemove.between(numItemsToKeepAtEachEnd): any[]
210
213
getAndRemove.adjacentAt(startingIndex, numItemsToRemove): any[]
211
214
// removes and returns adjacent items. startingIndex can be negative or positive.
212
215
216
+ // For all the functions below, the parameter 'value' cannot be object.
217
+ // 'object' does not include Arrays. Arrays are OK, as long as they don't
218
+ // contain objects.
219
+
213
220
getAndRemove.adjacentToValue(info: IAdjacentToValueInfo): any[]
214
221
/********
215
222
Removes and returns adjacent items including, or near, a particular value.
@@ -226,8 +233,7 @@ getAndRemove.adjacentToValue(info: IAdjacentToValueInfo): any[]
226
233
let numbers = this.getAndRemove.adjacentToValue({value:5, offset: 0, howMany:4});
227
234
// numbers is now [5,6,7,8]. this.data is now [1,2,3,4,9,10]
228
235
*********/
229
-
230
- // For all the functions below, the parameter 'value' cannot be object.
236
+
231
237
232
238
getAndRemove.allAfterFirst(value): any[]
233
239
// removes and returns all items after first instance of value
@@ -300,6 +306,24 @@ remove.byIndexes(indexes): PublicArrayRemover
300
306
remove.adjacentAt(startingIndex, numItemsToRemove): PublicArrayRemover
301
307
// Removes adjacent items. startingIndex can be negative or positive.
302
308
309
+ remove.head(numItemsToRemove): PublicArrayRemover
310
+ // Removes numItemsToRemove from beginning of this.data .
311
+
312
+ remove.tail(numItemsToRemove): PublicArrayRemover
313
+ // Removes numItemsToRemove from end of this.data .
314
+
315
+ remove.between(numItemsToKeepAtEachEnd): PublicArrayRemover
316
+ // Removes everything between numItemsToKeepAtEachEnd.
317
+ // i.e., if numItemsToKeepAtEachEnd = 2, then only the first 2 items and last 2 items will remain.
318
+
319
+ /************
320
+ For all the functions below:
321
+ Any parameter called 'value' cannot be an object.
322
+ Any parameter called 'values' cannot contain an object.
323
+ 'object' does not include Arrays. Arrays are OK, as long as they don't
324
+ contain objects.
325
+ ************/
326
+
303
327
remove.adjacentToValue(info: IAdjacentToValueInfo): PublicArrayRemover
304
328
/************
305
329
Removes adjacent items including, or near, a particular value.
@@ -316,22 +340,7 @@ remove.adjacentToValue(info: IAdjacentToValueInfo): PublicArrayRemover
316
340
arr.remove.adjacentToValue({value:5, offset: 1, howMany:2});
317
341
// arr.data is now [1,2,3,4,5,8,9,10]
318
342
*************/
319
-
320
- remove.head(numItemsToRemove): PublicArrayRemover
321
- // Removes numItemsToRemove from beginning of this.data .
322
-
323
- remove.tail(numItemsToRemove): PublicArrayRemover
324
- // Removes numItemsToRemove from end of this.data .
325
-
326
- remove.between(numItemsToKeepAtEachEnd): PublicArrayRemover
327
- // Removes everything between numItemsToKeepAtEachEnd.
328
- // i.e., if numItemsToKeepAtEachEnd = 2, then only the first 2 items and last 2 items will remain.
329
343
330
- /************
331
- For all the functions below:
332
- Any parameter called 'value' cannot be an object.
333
- Any parameter called 'values' cannot contain an object.
334
- ************/
335
344
336
345
remove.firstOf(value): PublicArrayRemover
337
346
// Removes first instance of value.
@@ -382,7 +391,20 @@ replace.adjacentAt(startingIndex, newValues: any[]): PublicArrayReplacer
382
391
// Replaces adjacent items beginning at startingIndex with newValues.
383
392
// Number of adjacent items that are replaced is same as number of items in newValues.
384
393
// startingIndex can be negative or positive.
394
+
395
+ replace.between(numItemsToKeepAtEachEnd, newValues: any[]): PublicArrayReplacer
396
+ // Replaces everything between numItemsToKeepAtEachEnd with newValues.
397
+ // Example: if this.data is [1,2,3,4,5,6,7] , and you call .between(2, [9,10])
398
+ // this.data will be [1,2,9,10,6,7] . It preserves the first 2 items and the last 2.
385
399
400
+ /************
401
+ For all the functions below:
402
+ Any parameter called 'value' cannot be an object.
403
+ Any parameter called 'values' cannot contain an object.
404
+ 'object' does not include Arrays. Arrays are OK, as long as they don't
405
+ contain objects.
406
+ ************/
407
+
386
408
replace.adjacentToValue(info: IAdjacentToValueInfo, newValues: any[]): PublicArrayReplacer
387
409
/**********
388
410
Replaces adjacent items including, or near a particular value, with newValues.
@@ -400,17 +422,6 @@ replace.adjacentToValue(info: IAdjacentToValueInfo, newValues: any[]): PublicArr
400
422
// this.adjacentToValue({value: 5, offset: -1, howMany: 2}, newValues);
401
423
// this.data is now [1,2,3,20,30,40,6,7,8]
402
424
**********/
403
-
404
- replace.between(numItemsToKeepAtEachEnd, newValues: any[]): PublicArrayReplacer
405
- // Replaces everything between numItemsToKeepAtEachEnd with newValues.
406
- // Example: if this.data is [1,2,3,4,5,6,7] , and you call .between(2, [9,10])
407
- // this.data will be [1,2,9,10,6,7] . It preserves the first 2 items and the last 2.
408
-
409
- /************
410
- For all the functions below:
411
- Any parameter called 'value' cannot be an object.
412
- Any parameter called 'values' cannot contain an object.
413
- ************/
414
425
415
426
replace.firstOf(value, newValue): PublicArrayReplacer
416
427
// Replaces first instance of value with newValue.
@@ -486,6 +497,8 @@ asString(glue = ', '): string
486
497
For all the functions below:
487
498
Any parameter called 'value' cannot be an object.
488
499
Any parameter called 'values' cannot contain an object.
500
+ 'object' does not include Arrays. Arrays are OK, as long as they don't
501
+ contain objects.
489
502
************/
490
503
491
504
has(value): boolean
@@ -549,20 +562,42 @@ set(newArray): void
549
562
// Changes value of this.data to newArray without breaking its memory reference.
550
563
// So if there are copies of this.data, the copies will be updated as well.
551
564
552
- protected _createGetterAndOrSetterForEach(
565
+ protected _createGetterAndOrSetterForEach(
553
566
propertyNames: string[],
554
- configuration: GetterSetterConfiguration
555
- ) : void
567
+ configuration: IGetterSetterConfiguration
568
+ ) : void
569
+ /*********************
570
+ Use this method when you have a bunch of properties that need getter and/or
571
+ setter functions that all do the same thing. You pass in an array of string
572
+ names of those properties, and the method attaches the same getter and/or
573
+ setter function to each property.
574
+ IGetterSetterConfiguration is this object:
575
+ {
576
+ get_setterFunction?: (
577
+ propertyName: string, index?: number, propertyNames?: string[]
578
+ ) => Function,
579
+ // get_setterFunction takes the property name as first argument and
580
+ // returns the setter function. The setter function must take one
581
+ // parameter and return void.
582
+
583
+ get_getterFunction?: (
584
+ propertyName: string, index?: number, propertyNames?: string[]
585
+ ) => Function
586
+ // get_getterFunction takes the property name as first argument and
587
+ // returns the getter function. The getter function must return something.
588
+ }
589
+ *********************/
590
+
556
591
557
- returnThis_after (voidExpression: any) : this
558
- // Executes voidExpression and returns this.
592
+ protected _returnThis_after (voidExpression: any) : this
593
+ // voidExpression is executed, then function returns this.
559
594
// Even if voidExpression returns something, the returned data isn't used.
560
595
561
- runMethod_and_returnThis (
596
+ protected _runMethod_and_returnThis (
562
597
callingObject,
563
598
method: Function,
564
599
methodArgs: any[],
565
- additionalAction?
600
+ additionalAction?: Function // takes the result returned by method as an argument.
566
601
) : this
567
602
```
568
603
</details >
0 commit comments