install
npm install referanceMap
SYNOPSIS
This is a simple determinstic map that maps POJOs to an integer.
API
constructor
Handle mapping arbitary JS object to ints
add
Adds an object to the referance map returning an int to be used as a referance
Parameters
obj
anytype
any optional
Returns integer
get
gets a POJO given a refernce as an int
Parameters
ref
integertypeCheck
type
Object optional
Returns any
delete
deletes an object given a referance as an int
Parameters
ref
integer
Returns boolean whether or not the object was deleted
clear
clears the referance map of a objects
size
returns the number of items in the refernace map
Returns integer
has
tests wether a given referance is valid or not
Parameters
ref
Returns boolean