1
- The main feature of this package is the OpenArray class. All the other classes were
2
- created mainly to act as dependencies for OpenArray to use.
1
+ The main feature of this package is the PublicArray class. All the other classes were
2
+ created mainly to act as dependencies for PublicArray to use.
3
3
4
- The main reason you would use OpenArray is if you hate JavaScript's built-in Array
5
- methods, like .slice(), .splice(), .push(), and .shift(). OpenArray has much clearer
4
+ The main reason you would use PublicArray is if you hate JavaScript's built-in Array
5
+ methods, like .slice(), .splice(), .push(), and .shift(). PublicArray has much clearer
6
6
and expressive method names. Examples:
7
7
8
- let arr = ObjectFactory.getInstance(OpenArray , [ [1,2,3,4,5,6] ]);
8
+ let arr = ObjectFactory.getInstance(PublicArray , [ [1,2,3,4,5,6] ]);
9
9
10
10
arr.remove.tail(2); // arr.data is now [1,2,3,4]
11
11
@@ -15,43 +15,43 @@ if (arr.notEmpty) arr.prepend([10]); // arr.data is now [10,3,4]
15
15
16
16
arr.append([100,200,300]); // arr.data is now [10,3,4,100,200,300]
17
17
18
- To actually see or get the array itself, you must access OpenArray 's data property:
18
+ To actually see or get the array itself, you must access PublicArray 's data property:
19
19
20
20
console.log(arr.data); // logs '[10,3,4,100,200,300]'
21
21
22
- OpenArray has several injected dependencies, so you need to use ObjectFactory (which is
22
+ PublicArray has several injected dependencies, so you need to use ObjectFactory (which is
23
23
included by npm) to instantiate it:
24
24
25
- let arr = ObjectFactory.getInstance(OpenArray , [ [1,2,3,4,5,6] ]);
25
+ let arr = ObjectFactory.getInstance(PublicArray , [ [1,2,3,4,5,6] ]);
26
26
27
- Aside from 'data', OpenArray has these public properties, which are all instances of the
27
+ Aside from 'data', PublicArray has these public properties, which are all instances of the
28
28
other classes in this package:
29
29
30
- 'filter': instance of OpenArrayFilter
30
+ 'filter': instance of PublicArrayFilter
31
31
32
- 'getConverted': instance of OpenArrayGetterConverter
32
+ 'getConverted': instance of PublicArrayGetterConverter
33
33
34
- 'get': instance of OpenArrayItemGetter
34
+ 'get': instance of PublicArrayItemGetter
35
35
36
- 'getAndRemove': instance of OpenArrayItemGetterRemover
36
+ 'getAndRemove': instance of PublicArrayItemGetterRemover
37
37
38
- 'insert': instance of OpenArrayItemInserter
38
+ 'insert': instance of PublicArrayItemInserter
39
39
40
- 'remove': instance of OpenArrayItemRemover
40
+ 'remove': instance of PublicArrayItemRemover
41
41
42
- 'replace': instance of OpenArrayItemReplacer
42
+ 'replace': instance of PublicArrayItemReplacer
43
43
44
- 'sort': instance of OpenArraySorter
44
+ 'sort': instance of PublicArraySorter
45
45
46
46
To know what methods each of those properties offer, look at the code of each class.
47
47
48
- OpenArray also has these 2 methods:
48
+ PublicArray also has these 2 methods:
49
49
50
50
.append(values)
51
51
52
52
.prepend(values)
53
53
54
- Also, OpenArray inherits from OpenArrayContent , which has many of the basic properties
54
+ Also, PublicArray inherits from PublicArrayContent , which has many of the basic properties
55
55
and methods you need to understand the array's contents, such as:
56
56
57
57
length, isEmpty, notEmpty, has(value), hasAll(values), hasAny(values), startsWith(values),
0 commit comments