Constructor
new List(obj, optsopt)
Build a new List wrapper.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
obj |
object | The list object. Typically an |
||||||||||||||||
opts |
object |
<optional> |
Options for advanced use. Properties
|
- Source:
Members
(static) KNOWN_CLOSURES
A list of known closure properties.
Corresponding wrap_${closure}
methods will be used to generate
the closure properties.
- Source:
Methods
containsAll(…items) → {boolean}
See if our list contains all of the specified items.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
items |
any |
<repeatable> |
- Source:
Returns:
- Type
- boolean
containsAny(…items) → {boolean}
See if our list object contains any of the specified items.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
items |
any |
<repeatable> |
- Source:
Returns:
- Type
- boolean
removeAll(…items) → {number}
Remove items from our list object.
Passed any number of items, it will see if any of those items are found in the array, and if they are, will remove them from the array.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
items |
any |
<repeatable> |
- Source:
Returns:
Number of items actually removed.
- Type
- number
wrap_contains(obj) → {function}
Return a closure that returns if an item is in a list object.
Parameters:
Name | Type | Description |
---|---|---|
obj |
object | The list object the closure will be for. May be an |
- Source:
Throws:
Returns:
- Type
- function
wrap_remove(obj) → {function}
Return a closure that removes an item from a list.
Parameters:
Name | Type | Description |
---|---|---|
obj |
object | The list object the closure will be for. May be an |
- Source:
Throws:
Returns:
- Type
- function
(static) for(obj, optsopt)
Return a List instance for the passed object.
If the object is already a List
it is returned as is.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
obj |
object | The list object. |
|
opts |
object |
<optional> |
Passed to constructor. |
- Source: