#Hash
DESCRIPTION
General
Installation
npm install eden-hash
Usage
var hash = require('eden-hash');
Methods
concat
object concat(Object[,object..]);
Concats objects into one
Parameters
- object[,object..]
Returns
object
Example
Code
hash().concat();
Outputs
RESULTS
each
bool each(Object, Function);
Custom for each loop that handles scopes and extra arguments
Parameters
-
object
-
function
Returns
bool
Example
Code
hash().each();
Outputs
RESULTS
indexOf
number|false indexOf(Object, Mixed, Boolis.has, Object, Mixed);
Returns true if the array has given value
Parameters
-
object
-
mixed
-
boolis.has - = function(data, value) {Argument Testingis.argument()est(1, 'object')est(2, 'mixed');turn !this.each(data, function(key, test) {turn !(test === value);;*Returns the index of where inthe array the value is found
-
object
-
mixed
Returns
number|false
Example
Code
hash().indexOf();
Outputs
RESULTS
implode
string implode(Object, String);
Join array elements with a string
Parameters
-
object
-
string
Returns
string
Example
Code
hash().implode();
Outputs
RESULTS
isEmpty
bool isEmpty(Object);
Returns true if empty
Parameters
- object
Returns
bool
Example
Code
hash().isEmpty();
Outputs
RESULTS
isHash
bool isHash(Object);
Returns true if given is hash
Parameters
- object
Returns
bool
Example
Code
hash().isHash();
Outputs
RESULTS
keys
array keys(Object);
Returns a list of keys
Parameters
- object
Returns
array
Example
Code
hash().keys();
Outputs
RESULTS
ksort
object ksort(Object);
sorts hash by key
Parameters
- object
Returns
object
Example
Code
hash().ksort();
Outputs
RESULTS
krsort
object krsort(Object);
reverse sorts hash by key
Parameters
- object
Returns
object
Example
Code
hash().krsort();
Outputs
RESULTS
map
object map(Object, Function, [mixed[,mixed..]]);
Custom map loop that handles scopes and extra arguments
Parameters
-
object
-
function
-
[mixed[,mixed..]]
Returns
object
Example
Code
hash().map();
Outputs
RESULTS
natksort
object natksort(Object);
Rearranges objects where keys are natural sorted
Parameters
- object
Returns
object
Example
Code
hash().natksort();
Outputs
RESULTS
natsort
object natsort(Object);
Sorts array by natural sort
Parameters
- object
Returns
object
Example
Code
hash().natsort();
Outputs
RESULTS
reverse
object reverse(Object);
Reverse sorts a hash with respect to its keys
Parameters
- object
Returns
object
Example
Code
hash().reverse();
Outputs
RESULTS
size
number size(Object);
Returns the size of the object
Parameters
- object
Returns
number
Example
Code
hash().size();
Outputs
RESULTS
sort
object sort(Object, [callback]);
Sorts a hash with respect to its keys
Parameters
-
object
-
[callback]
Returns
object
Example
Code
hash().sort();
Outputs
RESULTS
toQuery
string toQuery(Object);
Converts array to query string
Parameters
- object
Returns
string
Example
Code
hash().toQuery();
Outputs
RESULTS
toString
string toString(Object);
Converts array to string
Parameters
- object
Returns
string
Example
Code
hash().toString();
Outputs
RESULTS
values
array values(Object);
Returns a list of values
Parameters
- object
Returns
array
Example
Code
hash().values();
Outputs
RESULTS