Members
extras :object
Return all registered paths that aren't 'system' one, or in other words, any path registered after the app initilization.
Methods
FULL(p_path) → {string}
Expand a path, replacing the %SHORTCUT% variables with their full value.
Opposite of SHORT.
Parameters:
| Name | Type | Description |
|---|---|---|
p_path |
string |
Examples:
PATH.FULL('%STYLE%/main.css'); == './style/default/main.css'
SHORT(p_path) → {string}
Shrink a path, replacing expanded environment path with their %SHORTCUT%
Opposite of FULL.
Parameters:
| Name | Type | Description |
|---|---|---|
p_path |
string |
Examples:
PATH.FULL('./style/default/main.css') == '%STYLE%/main.css'
SET(p_envShortcut, p_path)
Registers a shortcut/path pair to PATH.
Parameters:
| Name | Type | Description |
|---|---|---|
p_envShortcut |
string | %MY_SHORTCUT% |
p_path |
string | path/to/foo |
UNSET(p_envShortcut)
Removes a shortcut from PATH.
Parameters:
| Name | Type | Description |
|---|---|---|
p_envShortcut |
string |
dir(p_path) → {string}
Get the parent directory path
Parameters:
| Name | Type | Description |
|---|---|---|
p_path |
string |
ext(p_path) → {string}
Attempts to isolate and return the extension from a given path
Parameters:
| Name | Type | Description |
|---|---|---|
p_path |
string |
Examples:
PATH.name('./style/default/main.css') === '.css'
PATH.name('./style/default/main.css?value=none') === '.css'
name(p_path) → {string}
Attempt to isolate the last name inside a path.
Parameters:
| Name | Type | Description |
|---|---|---|
p_path |
string |
Examples:
PATH.name('./style/default/main.css') === 'main'
PATH.name('./style/default/main') === 'main'
PATH.name('./style/default/main/') === 'main'
Sanitize(p_string) → {string}
Replaces \ with /
Parameters:
| Name | Type | Description |
|---|---|---|
p_string |
string | The string to sanitize |
stripExt(p_path) → {string}
Remove the extension of a filename string.
Parameters:
| Name | Type | Description |
|---|---|---|
p_path |
string |
Examples:
stripExt('file.ext') === 'file'