Static Method Summary
Static Public Methods | ||
public static |
arrayIndexOf(arr: Array, obj: Object): Number This method returns the first index at which a given element can be found in the array |
|
public static |
datetimeFromWpGMT(gmt: String): Object Get a datetime from WordPress XML GMT |
|
public static |
escapeRegExp(str: String): String Escape a regexp syntaxes. |
|
public static |
existsSync(path: String): Boolean Check the existence of a file or folder. |
|
public static |
formatDate(date: Date, format: String): String Converts the value of the Date object to its equivalent string representation using the specified format. |
|
public static |
isBlockElement(node: Node): Boolean Check the node of a block element. |
|
public static |
isVoidElement(node: Node): Boolean Check the node of a void element. |
|
public static |
Asynchronous mkdir(2). |
|
public static |
Get the HTML string of an element with its contents converted. |
|
public static |
Remove whitespace from both sides of a string. |
|
public static |
uniquePathWithSequentialNumber(path: String, min: Number, max: Number): String If the file or folder to the same path on exists, generates a unique path that does not duplicate. |
Static Public Methods
public static arrayIndexOf(arr: Array, obj: Object): Number source
This method returns the first index at which a given element can be found in the array
public static datetimeFromWpGMT(gmt: String): Object source
Get a datetime from WordPress XML GMT
Params:
Name | Type | Attribute | Description |
gmt | String | String of GMT. |
public static escapeRegExp(str: String): String source
Escape a regexp syntaxes.
Params:
Name | Type | Attribute | Description |
str | String | Original string. |
public static existsSync(path: String): Boolean source
Check the existence of a file or folder.
Params:
Name | Type | Attribute | Description |
path | String | Path of the file or folder. |
public static formatDate(date: Date, format: String): String source
Converts the value of the Date object to its equivalent string representation using the specified format.
public static isBlockElement(node: Node): Boolean source
Check the node of a block element.
Params:
Name | Type | Attribute | Description |
node | Node | Node. |
public static isVoidElement(node: Node): Boolean source
Check the node of a void element.
Params:
Name | Type | Attribute | Description |
node | Node | Node. |
public static mkdirSync(path: String): Boolean source
Asynchronous mkdir(2). No arguments other than a possible exception are given to the completion callback. mode defaults to 0o777.
Params:
Name | Type | Attribute | Description |
path | String | Directory path. |
public static outerHTML(node: Node, content: String): String source
Get the HTML string of an element with its contents converted.
Params:
Name | Type | Attribute | Description |
node | Node | DOM node. |
|
content | String | Text. |
public static trim(str: String): String source
Remove whitespace from both sides of a string.
Params:
Name | Type | Attribute | Description |
str | String | String. |
public static uniquePathWithSequentialNumber(path: String, min: Number, max: Number): String source
If the file or folder to the same path on exists, generates a unique path that does not duplicate. e.g. "./test" to "test-1", "./test.md" to "./test-1.md"
Return:
String | Success is the unique path (full path), failure is null. If not duplicate returns the original path. |