Index

core

MMO.core · 41 symbols · generated 5 Oct 2026

constant

RFC_TIME

Date.js:14

Date time as defined in RFC3339 1: year (Y) 2: month (m) 3: day (d) 4: hour (H) 5: minute (i) 6: seconds (s) 7: .millisecond (u) 8: timezone (P)

MMO.core.RFC_TIME = '([0-2][0-9]):([0-6][0-9])(?::([0-6][0-9])(\\.[0-9]+)?)?';
Namespace
MMO.core
constant

REG_TIME

Date.js:15
MMO.core.REG_TIME = new RegExp('^' + MMO.core.RFC_TIME + '$');
Namespace
MMO.core
constant

RFC_DATE

Date.js:17
MMO.core.RFC_DATE = '([0-9]{4})-([01][0-9])-([0-3][0-9])';
Namespace
MMO.core
constant

REG_DATE

Date.js:18
MMO.core.REG_DATE = new RegExp('^' + MMO.core.RFC_DATE + '$');
Namespace
MMO.core
constant

REG_DATETIME

Date.js:20
MMO.core.REG_DATETIME = new RegExp('^' + MMO.core.RFC_DATE + 'T' + MMO.core.RFC_TIME + '(Z|[+-][0-2][0-9]:[0-6][0-9])?$');
Namespace
MMO.core
constant

REG_UNIXTIME

Date.js:21
MMO.core.REG_UNIXTIME = new RegExp('^[0-9]{10}$');
Namespace
MMO.core
constant

EVENTS_SYMBOL

EventEmitter.js:8

Thanks to https://github.com/Hypercubed/mini-signals

MMO.core.EVENTS_SYMBOL = Symbol('MMO.core.EVENTS_SYMBOL');
Namespace
MMO.core
constant

SYMBOL_STYLES

core.js:3
MMO.core.SYMBOL_STYLES = Symbol('MMO.core.styles');
Namespace
MMO.core
constant

SYMBOL_DOM_REPLACE

core.js:4
MMO.core.SYMBOL_DOM_REPLACE = Symbol('MMO.core.replace');
Namespace
MMO.core
constant

UNWATCH_EVENT

core.js:5
MMO.core.UNWATCH_EVENT = Symbol('MMO.core.unwatch');
Namespace
MMO.core
constant

ID

core.js:18

MMO.core.SYMBOL_MODEL = Symbol('MMO.core.Model'); MMO.core.MODEL_EVENT_REMOVE = Symbol('Model.event.remove'); MMO.core.MODEL_EVENT_ALL = Symbol('Model.event.all'); MMO.core.MODEL_EVENT_DONE = Symbol('Model.event.done'); MMO.core.MODEL_EVENT_CHANGE = Symbol('Model.event.change'); MMO.core.MODEL_SLEEP = 1; MMO.core.MODEL_ANIM = 2; MMO.core.MODEL_UNSET = 4; MMO.core.MODEL_MAX_EMIT = 10000;

MMO.core.ID = 0;
Namespace
MMO.core
constant

REG_BYTE

core.js:20
MMO.core.REG_BYTE = new RegExp('^[a-zA-Z0-9/+]*={0,2}$');
Namespace
MMO.core
function

htmlentitiesEncode

core.js:40

Equivalent of php function htmlentities()

function MMO.core.htmlentitiesEncode(text)
Namespace
MMO.core
text
returns*
function

htmlentitiesDecode

core.js:48

Decode html entities encoded with php function htmlentities() or js function MMO.core.htmlentitiesEncode()

function MMO.core.htmlentitiesDecode(text)
Namespace
MMO.core
text
function

preventPropagation

core.js:59

Alias to stop event propagation

function MMO.core.preventPropagation(e, allow_link = false)
Namespace
MMO.core
eEvent
allow_link = false
returnsFunction
function

isEmpty

core.js:77

Check if object is empty

function MMO.core.isEmpty(obj)
Namespace
MMO.core
objObject
returnsBoolean
function

isEqual

core.js:93

Check if 2 values are equal (deep)

function MMO.core.isEqual(a, b)
Namespace
MMO.core
a
b
returnsBoolean
function

isSimilar

core.js:165

Test whether b is "contained in" a (a one-way, loose comparison).

function MMO.core.isSimilar(a, b)
Namespace
MMO.core
Unlike `MMO.core.isEqual` this is NOT symmetric: `a` may hold more than `b`. - primitives: compared loosely (`==`), so `1` and `'1'` are similar - objects/Maps: every key of `b` must be present in `a` and similar; extra keys in `a` are ignored - arrays: `b` must be a SUBSEQUENCE of `a`, order preserved
a*the larger value
b*the value to look for inside a
returnsboolean
isSimilar({a:1, b:2}, {a:1}) // true -- subset isSimilar([1,2,3], [1,3]) // true -- subsequence isSimilar([1,2,3], [3,1]) // false -- wrong order
function

compare

core.js:207

Compare the two parameters

function MMO.core.compare(a, b)
Namespace
MMO.core
a
b
returnsnull | intnull if comparison cannot be done, 0 if similar, -1 if inferior, 1 if superior.
function

compareDescending

core.js:223
function MMO.core.compareDescending(a, b)
Namespace
MMO.core
See
MMO.core.compare with the operands swapped, for a descending sort.
a*
b*
returns?number
function

isUnique

core.js:232

Check if an array has only unique items

function MMO.core.isUnique(array)
Namespace
MMO.core
arrayArray
returnsBoolean
function

isSimpleObject

core.js:250

Test whether a value is a plain data container rather than a class instance.

function MMO.core.isSimpleObject(obj, allowArray = true)
Namespace
MMO.core
This is what decides whether `MMO.core.Map#set` converts a value into a nested Map.
obj*
allowArray = truebooleancount arrays as simple objects
returnsboolean
function

isSameArray

core.js:263

Test if two arrays hold the same values, ignoring their order.

function MMO.core.isSameArray(a, b)
Namespace
MMO.core
Values are compared with `Array.includes` (strict equality, `NaN` included). NOTE: duplicates are not accounted for, `[1,1]` and `[1,2]` both "contain" `1`, but they differ in length so the check still rejects them.
aArray
bArray
returnsboolean
function

watch

core.js:281

Watch for a change on a proerty's value Redefine object's property with a getter and a setter.

function MMO.core.watch(obj, key, handler)
Namespace
MMO.core
NOTE : To remove the watch, assign MMO.core.UNWATCH_EVENT to the property. It will restore the previous property descriptor ex: MMO.core.watch(obj, 'a'); ...; obj.a = MMO.core.UNWATCH_EVENT;
objObjectthe object
keystring
handlerFunctionfunction(value, key, old_value) called with this = obj
function

unwatch

core.js:344

Unwatch an object's property ONLY set the value to MMO.core.UNWATCH_EVENT.

function MMO.core.unwatch(obj, key)
Namespace
MMO.core
objObjectthe object
keystring
returnsBooleantrue if the property was watched
function

getter

core.js:381

Create a function that reads an object's property when called.

function MMO.core.getter(obj, key)
Namespace
MMO.core
Useful as an argument of `MMO.core.linkFn`
objObject
keystring
returnsFunctionfunction(): *
function

linkFn

core.js:393

Set a function as an object's property To remove the function just delete the property

function MMO.core.linkFn(obj, key, fn, ...args)
Namespace
MMO.core
objObjectthe object
keystring
fnFunctionfunction(...args): value
...args...?a list of values|function to use to call the function.
function

UID

core.js:419

Get a stable numeric id for an object, assigning one on first use.

function MMO.core.UID(obj)
Namespace
MMO.core
Useful to key an object in a plain map or in a dom attribute.
objObject
returnsnumber
function

merge

core.js:443

Merge primitive objects or values. The merge doesn't modify the original objects.

function MMO.core.merge(a, b, appendList = false)
Namespace
MMO.core
a*
b*
appendList = falseboolif true concat arrays. else set their values
returns*the new merged object
function

ksort

core.js:474

Reorder an object's keys IN PLACE (a javascript object keeps its insertion order).

function MMO.core.ksort(map, cmpFn)
Namespace
MMO.core
mapObjectmodified in place
cmpFn?Functionfunction(keyA, keyB): number, defaults to Array.sort's order
returnsObjectthe same object
function

clone

core.js:496

Deep clone a simple Object

function MMO.core.clone(obj)
Namespace
MMO.core
objobject
returnsobject
constant

MAP_WATCHES

Map.js:4
MMO.core.MAP_WATCHES = Symbol('MMO.core.MAP_WATCHES');
Namespace
MMO.core
constant

MAP_CHANGED

Map.js:8

function (<Symbol> MMO.core.MAP_CHANGED, <MMO.core.Map> map). Emitted when the map is changed in any way.

MMO.core.MAP_CHANGED = Symbol('MMO.core.MAP_CHANGED');
Namespace
MMO.core
constant

MAP_CONNECT

Map.js:11

function (<Symbol> MMO.core.MAP_CONNECT, <MMO.core.Map> parent, <string|int> key, <MMO.core.Map> value). Emitted when a map is connected as a child of another Map.

MMO.core.MAP_CONNECT = Symbol('MMO.core.MAP_CONNECT');
Namespace
MMO.core
constant

MAP_DISCONNECT

Map.js:14

function (<Symbol> MMO.core.MAP_DISCONNECT, <MMO.core.Map> parent, <string|int> key, <MMO.core.Map> value). Emitted when a map is disconnected as a child of another Map.

MMO.core.MAP_DISCONNECT = Symbol('MMO.core.MAP_DISCONNECT');
Namespace
MMO.core
constant

MAP_VALUE_CHANGED

Map.js:17

function (<char> MMO.core.MAP_VALUE_CHANGED, <MMO.core.Map> map, <string|int> key). Emitted at the key when the value is changed.

MMO.core.MAP_VALUE_CHANGED = '=';
Namespace
MMO.core
constant

MAP_VALUE_CREATED

Map.js:20

function (<char> MMO.core.MAP_VALUE_CREATED, <MMO.core.Map> map, <string|int> key). Emitted at the key when the value is created.

MMO.core.MAP_VALUE_CREATED = '+';
Namespace
MMO.core
constant

MAP_VALUE_DELETED

Map.js:23

function (<char> MMO.core.MAP_VALUE_DELETED, <MMO.core.Map> map, <string|int> key). Emitted at the key when the value is deleted.

MMO.core.MAP_VALUE_DELETED = '-';
Namespace
MMO.core
constant

MAP_INDEX_CHANGED

Map.js:26

function (<char> MMO.core.MAP_INDEX_CHANGED, <MMO.core.Map> map, <string|int> key, <int> oldIndex). Emitted at the key when the index of a key is changed ({a:1, b:2} => {b:2, a:1})

MMO.core.MAP_INDEX_CHANGED = '#';
Namespace
MMO.core
constant

MAP_KEY_CHANGED

Map.js:29

function (<char> MMO.core.MAP_KEY_CHANGED, <MMO.core.Map> map, <string> key, <string> oldKey). Emitted at the new key when the key is changed ({a:1, b:2} => {newA:1, b:2})

MMO.core.MAP_KEY_CHANGED = '$';
Namespace
MMO.core