path
MMO.core.path · 16 symbols · generated 30 Sep 2026
MMO.core.path.REGEX_UNESCAPE = /~[01]/g;- Namespace
MMO.core.path
MMO.core.path.REGEX_ESCAPE = /[~/]/g;- Namespace
MMO.core.path
function MMO.core.path.unescapeReplacer(m)- Namespace
MMO.core.path
function MMO.core.path.escapeReplacer(m)- Namespace
MMO.core.path
function MMO.core.path.unescape(text)- Namespace
MMO.core.path
function MMO.core.path.escape(text)- Namespace
MMO.core.path
sometimes path is a solo number (in array). So force type to string.
function MMO.core.path.split(path)- Namespace
MMO.core.path
function MMO.core.path.join(path)- Namespace
MMO.core.path
Split a path, removing starting and endding '/'
function MMO.core.path.trimSplit(path)- Namespace
MMO.core.path
| path | string | integer | Array | |
| returns | Array | |
Get the last segment of a path, WITHOUT unescaping it.
function MMO.core.path.lastKey(path)- Namespace
MMO.core.path
| path | string | |
| returns | string | the whole path when it carries no separator |
Simplify a path by removing . and ` and trying to get rid of ..`.
function MMO.core.path.simplify(path)- Namespace
MMO.core.path
| path | Array | |
| returns | Array | the simplified path |
Get a relative path compare to a root path.
function MMO.core.path.relative(path, root, join = true)- Namespace
MMO.core.path
If root or path is not absolute, returns path| path | Array | string | |
| root | Array | string | |
| join = true | | |
| returns | Array | string | |
Resolve a path against a root. A path that is already absolute is returned untouched.
function MMO.core.path.absolute(path, root, join = true)- Namespace
MMO.core.path
| path | string | Array | |
| root | string | Array | |
| join = true | boolean | return a string rather than an array of segments |
| returns | string | Array | |
Get the parent path of a path.
function MMO.core.path.dirname(path)- Namespace
MMO.core.path
| path | string | |
| returns | string | '' when the path has no separator |
dirname('/a/b') === '/a' ; dirname('/a') === '/' ; dirname('a') === ''
Test if root is contained in path
function MMO.core.path.contains(path, root)- Namespace
MMO.core.path
| path | string | Array | |
| root | string | Array | |
| returns | boolean | |
Test whether two paths designate the same thing.
function MMO.core.path.equal(a, b)- Namespace
MMO.core.path
| a | string | Array | |
| b | string | Array | |
| returns | boolean | |