Add support for authoring custom rules.

This commit is contained in:
David Anson 2018-02-25 16:04:13 -08:00
parent f24f98e146
commit 802c81f929
6 changed files with 375 additions and 97 deletions

View file

@ -46,6 +46,16 @@ module.exports.clone = function clone(obj) {
return assign({}, obj);
};
// Returns true iff the input is a string
module.exports.isString = function isString(obj) {
return typeof obj === "string";
};
// Returns true iff the input string is empty
module.exports.isEmptyString = function isEmptyString(str) {
return str.length === 0;
};
// Replaces the text of all properly-formatted HTML comments with whitespace
// This preserves the line/column information for the rest of the document
// Trailing whitespace is avoided with a '\' character in the last column