Methods
equal(path1, path2) → {boolean}
Check two paths are equal.
- Version:
- 0.1.4
- Since:
- 0.0.1
- Source:
Parameters:
Name | Type | Description |
---|---|---|
path1 |
string
|
to check path |
path2 |
string
|
to check path |
Returns:
- Type:
-
boolean
If paths are equal, returns true.
fromRoot(_path, options, callback) → {string}
goto _path from root if no breaks.
- Version:
- 0.1.4
- Since:
- 0.1.4
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
_path |
string
|
End point of path. | ||||||||||||||||
options |
Object
|
|
||||||||||||||||
callback |
function
|
If this callback function returns true, loop will be break. |
Throws:
-
Callback or path(options.reliable == true) does not exist.
- Type
-
Error
Returns:
- Type:
-
string
breaked path. If no breaks returns _path
isParent(path1, path2) → {boolean}
Check path1 is parent of path2
- Version:
- 0.1.4
- Since:
- 0.0.1
- Source:
Parameters:
Name | Type | Description |
---|---|---|
path1 |
string
|
maybe parent |
path2 |
string
|
maybe child |
Returns:
- Type:
-
boolean
If path1 is parent of path2, returns true.
locateBase:(_path, regexp) → {string}
Search base locate
- Version:
- 0.1.4
- Since:
- 0.0.1
- Source:
Parameters:
Name | Type | Description |
---|---|---|
_path |
string
|
Starting point |
regexp |
query
|
If matched, will be break. |
Throws:
-
path does not exists.
- Type
-
Error
Returns:
- Type:
-
string
base path or "/"
toRoot(_path, options, callback) → {string}
goto root if no breaks.
- Version:
- 0.1.4
- Since:
- 0.0.1
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
_path |
string
|
Starting path | ||||||||||||||||
options |
Object
|
|
||||||||||||||||
callback |
function
|
If this callback function returns true, loop will be break. |
Throws:
-
Callback or path(options.reliable == true) does not exist.
- Type
-
Error
Returns:
- Type:
-
string
breaked path. If no breaks returns "/"