Ely
Ely
Maps and unmaps object properties to emitter.
Every further change of properties will emit the changes.
Can keep the emitter inside or outside of the original object.
new Ely()
Static Members
▸
mapIn(object, patterns)
Maps and keeps emitter inside the object
Shortkey for map(object, true, patterns)
Parameters
object (Object)
object with properties
patterns (Patterns
= undefined
)
patterns of matching
Returns
EventEmitter
:
event emitter
▸
mapOut(object, patterns)
Maps and keeps emitter outside the object
Shortkey for map(object, false, patterns)
Parameters
object (Object)
object with properties
patterns (Patterns
= undefined
)
patterns of matching
Returns
EventEmitter
:
event emitter
▸
map(object, embed, patterns)
Maps object properties
Main map method
Parameters
object (Object)
object with properties
embed (boolean
= true
)
embed the emitter or not
patterns (Patterns
= undefined
)
patterns of matching
Returns
EventEmitter
:
event emitter
Unmaps object properties
Parameters
object (Object)
object with properties
Gets default pattern
defaultPatterns
Returns
Patterns
:
default patterns
Finds the ely map key
Checks if default ely map key already exists and replaces
it with unique one.
Parameters
object (Object)
object with properties
Returns
string
:
▸
findEmptyKey(object, key, prefix)
Finds empty key
Checks if key overlap inside object. Creates unique one if needed.
Parameters
object (Object)
object with properties
key (string)
key to be checked
prefix (string)
prefix to be applied
Returns
string
:
unique key
Matches key to pattern
Checks if key matches a given pattern
Parameters
key (string)
key to be checked
patterns (Patterns)
patterns to check against
Returns
boolean
:
match result
▸
notmatch(key, patterns)
No Matches key to pattern
Checks if key does not match a given pattern
Parameters
key (string)
key to be checked
patterns (Patterns)
patterns to check against
Returns
boolean
:
match result
Patterns
Patterns
Patterns for matching.
Parameters
accept (RegExp)
regular expression for accept
skip (RegExp)
regular expression for skip
emitall (boolean
= false
)
emitall status
Instance Members
▸
constructor(accept, skip, emitall)
Patterns constructor
Parameters
accept (RegExp)
regular expression for accept
skip (RegExp)
regular expression for skip
emitall (boolean
= false
)
emitall status
StorageMap
StorageMap
Storage map for properties
new StorageMap()
Instance Members
StorageMap constructor
constructor()