ProjextRollupUtils
This is a set of utility methods the Projext Rollup plugins use.
Static Method Summary
Static Public Methods | ||
public static |
cloneRegex(expression: RegExp, injectFlags: string): RegExp Copies a regular expression and, if specified, inject extra flags. |
|
public static |
createLogger(plugin: string, logger: Logger): Logger Validate and create a Logger instance for a plugin. |
|
public static |
escapeRegex(expression: string): string Escapes special characters from a string in order to be used on a RegExp. |
|
public static |
formatPlaceholder(placeholder: string, info: Object): string Formats a string path by replacing the |
Static Public Methods
public static cloneRegex(expression: RegExp, injectFlags: string): RegExp source
Copies a regular expression and, if specified, inject extra flags.
public static createLogger(plugin: string, logger: Logger): Logger source
Validate and create a Logger instance for a plugin. If the logger the plugin received on its options is an instance of Logger or has the same interface, it will "accept it" and return it; If the plugin didn't receive a logger, it will create a new instance of Logger and return it, but if the received logger is an invalid object, it will throw an error.
public static escapeRegex(expression: string): string source
Escapes special characters from a string in order to be used on a RegExp.
Params:
Name | Type | Attribute | Description |
expression | string | The string to escape. |