basic-collection
Advanced tools
Comparing version 0.0.1 to 0.0.11
{ | ||
"name" : "basic-collection", | ||
"version" : "0.0.1", | ||
"version" : "0.0.11", | ||
"keywords" : [ "map", "data", "collection" ], | ||
@@ -5,0 +5,0 @@ "description" : "A generic collection class to contain array-like data", |
@@ -11,2 +11,4 @@ # basic-collection | ||
To port it to Browser or any other environment (not node), use a JS bundler ([Browserify](http://browserify.org/), [Webpack](http://webpack.github.io/), etc.). | ||
## Basic usage | ||
@@ -71,14 +73,18 @@ | ||
| Method | Access | Return | | ||
|-------------------------|------------|------------| | ||
| `normalize( key )` | protected | string | | ||
| `set( key, value )` | public | null | | ||
| `get( key[, default] )` | public | mixed | | ||
| `has( key )` | public | bool | | ||
| `remove( key )` | public | null | | ||
| `clear()` | public | null | | ||
| `each( callback )` | public | null | | ||
| `size` | public | int | | ||
| `entries` | public | iterable | | ||
| `keys` | public | iterable | | ||
| `values` | public | iterable | | ||
| Method | Description | Access | Return | | ||
|:------------------------|:------------|:-----------|:-----------| | ||
| `normalize( key )` | Normalizes data key. | protected | string | | ||
| `set( key, value )` | Sets an attribute for the current collection. If the attribute name already exists, its value will be overwritten. | public | null | | ||
| `get( key[, default] )` | Returns an attribute of the collection or a default value if the key does not exist. | public | mixed | | ||
| `has( key )` | Checks if an attribute exists in the current collection. | public | bool | | ||
| `remove( key )` | Removes an attribute from the current collection. | public | null | | ||
| `clear()` | Clears all values. | public | null | | ||
| `each( callback )` | Executes a callback for each element of this Collection. | public | null | | ||
| `size` | Counts parameters. | public | int | | ||
| `entries` | Returns a new Iterator object that contains an array of [key, value] for each element in the Collection in insertion order. | public | iterable | | ||
| `keys` | Returns a new Iterator object that contains the keys for each element in the Collection in insertion order. | public | iterable | | ||
| `values` | Returns a new Iterator object that contains the values for each element in the Collection in insertion order. | public | iterable | | ||
## Tests | ||
`$ npm test` |
@@ -13,3 +13,3 @@ "use strict"; | ||
/** | ||
* Create a new `Collection` instance with optionally injected parameters. | ||
* Creates a new `Collection` instance with optionally injected parameters. | ||
* | ||
@@ -24,3 +24,3 @@ * @param array parameters | ||
/** | ||
* Normalize data key. | ||
* Normalizes data key. | ||
* | ||
@@ -36,3 +36,3 @@ * @param string key The name of the parameter | ||
/** | ||
* Clear all values. | ||
* Clears all values. | ||
* | ||
@@ -46,3 +46,3 @@ * @access public | ||
/** | ||
* Set an attribute for the current collection. If the attribute name | ||
* Sets an attribute for the current collection. If the attribute name | ||
* already exists, its value will be overwritten. | ||
@@ -61,3 +61,3 @@ * | ||
/** | ||
* Return an attribute of the collection or a default value if the key does | ||
* Returns an attribute of the collection or a default value if the key does | ||
* not exist. | ||
@@ -79,3 +79,3 @@ * | ||
/** | ||
* Check if an attribute exists in the current collection. | ||
* Checks if an attribute exists in the current collection. | ||
* | ||
@@ -93,3 +93,3 @@ * @param string key The name of the parameter | ||
/** | ||
* Remove an attribute from the current collection. | ||
* Removes an attribute from the current collection. | ||
* | ||
@@ -116,3 +116,3 @@ * @param string key The name of the parameter | ||
/** | ||
* Count parameters. | ||
* Counts parameters. | ||
* | ||
@@ -119,0 +119,0 @@ * @return int |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11095
89