@architect/parser
Advanced tools
Comparing version 1.0.6 to 1.1.0
/** | ||
* removes # comments and trims leading/trailing whitespace | ||
* removes: | ||
* - comments | ||
* - empty lines | ||
* - trailing spaces | ||
*/ | ||
var comments = /\#.*/gm | ||
var emptyLines = /(^[ \t]*\n)/gm | ||
var trailingSpaces = / (\n|\r)/g | ||
module.exports = function removeComments(text) { | ||
return text.trim().replace(/\#.*/g, '').replace(/ \n/g, '').trim() | ||
var noComments = text.trim().replace(comments, '').trim() | ||
var noEmptyLines = noComments.replace(emptyLines, '') | ||
var noTrailingSpaces = noEmptyLines.replace(trailingSpaces, '\n') | ||
return noTrailingSpaces | ||
} |
{ | ||
"name": "@architect/parser", | ||
"version": "1.0.6", | ||
"version": "1.1.0", | ||
"description": "function that accepts .arc text and returns a plain JavaScript Object", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18524
137