Files: 9e8ae7783fd0d457d00c5e5a8c0201dcf6f23983 / README.md
2757 bytesRaw
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
any
Returns integer
get
gets a POJO given a refernce as an int
Parameters
ref
integer
Returns any
delete
deletes an object given a referance as an int
Parameters
integer
ref
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
LICENSE
Built with git-ssb-web