@@ -66,35 +66,30 @@ getPublicArray(array = []): PublicArray
66
66
#### notEmpty: boolean (read-only)
67
67
68
68
#### filter: PublicArrayFilter (read-only)
69
- Filter has methods that narrow down the content of the array it contains
70
- and return the class instance.
71
-
72
- To instantiate, pass the actual array it will contain into its constructor:
73
-
74
- let filter = new PublicArrayFilter( [item1, item2, item3,...] );
75
-
76
- You can also reset the array by accessing the class 'data' property:
77
-
78
- filter.data = [1,2,3,4,...];
79
-
80
- These are all its methods:
81
-
82
- // Narrows down the array to only the values that pass test:
83
-
84
- byTest(testFunction): this
85
- // testFunction = function(currentValue, currentIndex?, theArray?){...}
86
- // testFunction must return boolean.
87
-
88
-
89
- // Narrows down the array to only values that are the specified type:
69
+ ###### This has methods that narrow down the content of the array and return the PublicArrayFilter instance:
70
+ ```
71
+ filter.byTest(testFunction): PublicArrayFilter
72
+ // Narrows down the array to only the values that pass testFunction.
73
+ // testFunction = function(currentValue, currentIndex?, theArray?): boolean
74
+
75
+ filter.byType(
76
+ type: 'number' | 'boolean' | 'string' | 'array' | 'object' | 'function' | 'undefined'
77
+ ): PublicArrayFilter
78
+ // Narrows down the array to only values that are the specified type.
79
+ ```
90
80
91
- byType(
92
- type: 'number' | 'boolean' | 'string' | 'array' | 'object' | 'function' | 'undefined'
93
- ): this
81
+ #### getConverted: PublicArrayGetterConverter (read-only)
82
+ ###### This has the Array methods .map() and .reduce() , but renamed to .each() and .toOne() , respectively. None of them modify the array.
83
+ ```
84
+ getConverted.toOne(
85
+ reducingFunction: ((previousValue: any, currentValue: any, index?, array?) => any)
86
+ ): any
87
+ // reduces all values in array down to a single value, and returns that value.
94
88
89
+ getConverted.each(mappingFunction: ((item, index?, array?) => any)): any[]
90
+ // returns new array where each value in current array is converted into something else.
91
+ ```
95
92
96
- #### getConverted: PublicArrayGetterConverter (read-only)
97
-
98
93
#### get: PublicArrayGetter (read-only)
99
94
100
95
#### getAndRemove: PublicArrayGetterRemover (read-only)
0 commit comments